mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 03:32:26 +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 {
|
type CommandMappings = {
|
||||||
|
"api-log-messages": CommandData;
|
||||||
}
|
focusOnDetail: Required<CommandData>;
|
||||||
|
searchNotes: CommandData & {
|
||||||
interface FocusOnDetailData extends CommandData {
|
|
||||||
ntxId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SearchNotesData extends CommandData {
|
|
||||||
searchString: string | undefined;
|
searchString: string | undefined;
|
||||||
}
|
};
|
||||||
|
showDeleteNotesDialog: CommandData & {
|
||||||
interface ShowDeleteNotesDialogData extends CommandData {
|
|
||||||
branchIdsToDelete: string[];
|
branchIdsToDelete: string[];
|
||||||
callback: (value: ResolveOptions) => void;
|
callback: (value: ResolveOptions) => void;
|
||||||
forceDeleteAllClones: boolean;
|
forceDeleteAllClones: boolean;
|
||||||
}
|
};
|
||||||
|
showConfirmDeleteNoteBoxWithNoteDialog: ConfirmWithTitleOptions;
|
||||||
interface OpenedFileUpdatedData extends CommandData {
|
openedFileUpdated: CommandData & {
|
||||||
entityType: string;
|
entityType: string;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
lastModifiedMs: number;
|
lastModifiedMs: number;
|
||||||
filePath: string;
|
filePath: string;
|
||||||
}
|
};
|
||||||
|
focusAndSelectTitle: CommandData & {
|
||||||
interface FocusAndSelectTitleData extends CommandData {
|
|
||||||
isNewNote: boolean;
|
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 = {
|
|
||||||
"api-log-messages": ApiLogMessagesData;
|
|
||||||
focusOnDetail: FocusOnDetailData;
|
|
||||||
searchNotes: SearchNotesData;
|
|
||||||
showDeleteNotesDialog: ShowDeleteNotesDialogData;
|
|
||||||
showConfirmDeleteNoteBoxWithNoteDialog: ConfirmWithTitleOptions;
|
|
||||||
openedFileUpdated: OpenedFileUpdatedData;
|
|
||||||
focusAndSelectTitle: FocusAndSelectTitleData;
|
|
||||||
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