mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	refactor(client/ts): use compact mappings for commands
This commit is contained in:
		
							parent
							
								
									3bfb163a39
								
							
						
					
					
						commit
						be0c80249e
					
				| @ -35,69 +35,45 @@ interface CommandData { | |||||||
|     ntxId?: string; |     ntxId?: string; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| interface ApiLogMessagesData extends CommandData { |  | ||||||
|        |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| interface FocusOnDetailData extends CommandData { |  | ||||||
|     ntxId: string; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| interface SearchNotesData extends CommandData {     |  | ||||||
|     searchString: string | undefined; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| interface ShowDeleteNotesDialogData extends CommandData {     |  | ||||||
|     branchIdsToDelete: string[]; |  | ||||||
|     callback: (value: ResolveOptions) => void; |  | ||||||
|     forceDeleteAllClones: boolean; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| interface OpenedFileUpdatedData extends CommandData { |  | ||||||
|     entityType: string; |  | ||||||
|     entityId: string; |  | ||||||
|     lastModifiedMs: number; |  | ||||||
|     filePath: string; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| interface FocusAndSelectTitleData extends CommandData { |  | ||||||
|     isNewNote: boolean; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| interface OpenNewNoteSplitData extends CommandData { |  | ||||||
|     ntxId: string; |  | ||||||
|     notePath: string; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| interface ExecuteInActiveNoteDetailWidgetData extends CommandData { |  | ||||||
|     callback: (value: NoteDetailWidget | PromiseLike<NoteDetailWidget>) => void |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| interface AddTextToActiveEditorData extends CommandData { |  | ||||||
|     text: string;    |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| interface NoData extends CommandData { } |  | ||||||
| 
 |  | ||||||
| type CommandMappings = { | type CommandMappings = { | ||||||
|     "api-log-messages": ApiLogMessagesData; |     "api-log-messages": CommandData; | ||||||
|     focusOnDetail: FocusOnDetailData; |     focusOnDetail: Required<CommandData>; | ||||||
|     searchNotes: SearchNotesData; |     searchNotes: CommandData & { | ||||||
|     showDeleteNotesDialog: ShowDeleteNotesDialogData; |         searchString: string | undefined; | ||||||
|  |     }; | ||||||
|  |     showDeleteNotesDialog: CommandData & { | ||||||
|  |         branchIdsToDelete: string[]; | ||||||
|  |         callback: (value: ResolveOptions) => void; | ||||||
|  |         forceDeleteAllClones: boolean; | ||||||
|  |     }; | ||||||
|     showConfirmDeleteNoteBoxWithNoteDialog: ConfirmWithTitleOptions; |     showConfirmDeleteNoteBoxWithNoteDialog: ConfirmWithTitleOptions; | ||||||
|     openedFileUpdated: OpenedFileUpdatedData; |     openedFileUpdated: CommandData & { | ||||||
|     focusAndSelectTitle: FocusAndSelectTitleData; |         entityType: string; | ||||||
|  |         entityId: string; | ||||||
|  |         lastModifiedMs: number; | ||||||
|  |         filePath: string; | ||||||
|  |     }; | ||||||
|  |     focusAndSelectTitle: CommandData & { | ||||||
|  |         isNewNote: boolean; | ||||||
|  |     }; | ||||||
|     showPromptDialog: PromptDialogOptions; |     showPromptDialog: PromptDialogOptions; | ||||||
|     showInfoDialog: ConfirmWithMessageOptions; |     showInfoDialog: ConfirmWithMessageOptions; | ||||||
|     showConfirmDialog: ConfirmWithMessageOptions; |     showConfirmDialog: ConfirmWithMessageOptions; | ||||||
|     openNewNoteSplit: OpenNewNoteSplitData; |     openNewNoteSplit: CommandData & { | ||||||
|     executeInActiveNoteDetailWidget: ExecuteInActiveNoteDetailWidgetData; |         ntxId: string; | ||||||
|     addTextToActiveEditor: AddTextToActiveEditorData; |         notePath: string;    | ||||||
|  |     }; | ||||||
|  |     executeInActiveNoteDetailWidget: CommandData & { | ||||||
|  |         callback: (value: NoteDetailWidget | PromiseLike<NoteDetailWidget>) => void | ||||||
|  |     }; | ||||||
|  |     addTextToActiveEditor: CommandData & { | ||||||
|  |         text: string; | ||||||
|  |     }; | ||||||
|      |      | ||||||
|     importMarkdownInline: NoData; |     importMarkdownInline: CommandData; | ||||||
|     showPasswordNotSet: NoData; |     showPasswordNotSet: CommandData; | ||||||
|     showProtectedSessionPasswordDialog: NoData; |     showProtectedSessionPasswordDialog: CommandData; | ||||||
|     closeProtectedSessionPasswordDialog: NoData; |     closeProtectedSessionPasswordDialog: CommandData; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| type EventMappings = { | type EventMappings = { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran