mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-17 08:41:44 +08:00
refactor(server): typed keyboard action names
This commit is contained in:
parent
728037075f
commit
a9ea3c8b63
@ -462,6 +462,7 @@ function getDefaultKeyboardActions() {
|
||||
description: t("keyboard_actions.toggle-inherited-attributes"),
|
||||
scope: "window"
|
||||
},
|
||||
// TODO: Remove or change since promoted attributes have been changed.
|
||||
{
|
||||
actionName: "toggleRibbonTabPromotedAttributes",
|
||||
defaultShortcuts: [],
|
||||
|
@ -1,6 +1,102 @@
|
||||
const enum KeyboardActionNamesEnum {
|
||||
backInNoteHistory,
|
||||
forwardInNoteHistory,
|
||||
jumpToNote,
|
||||
scrollToActiveNote,
|
||||
quickSearch,
|
||||
searchInSubtree,
|
||||
expandSubtree,
|
||||
collapseTree,
|
||||
collapseSubtree,
|
||||
sortChildNotes,
|
||||
createNoteAfter,
|
||||
createNoteInto,
|
||||
createNoteIntoInbox,
|
||||
deleteNotes,
|
||||
moveNoteUp,
|
||||
moveNoteDown,
|
||||
moveNoteUpInHierarchy,
|
||||
moveNoteDownInHierarchy,
|
||||
editNoteTitle,
|
||||
editBranchPrefix,
|
||||
cloneNotesTo,
|
||||
moveNotesTo,
|
||||
copyNotesToClipboard,
|
||||
pasteNotesFromClipboard,
|
||||
cutNotesToClipboard,
|
||||
selectAllNotesInParent,
|
||||
addNoteAboveToSelection,
|
||||
addNoteBelowToSelection,
|
||||
duplicateSubtree,
|
||||
openNewTab,
|
||||
closeActiveTab,
|
||||
reopenLastTab,
|
||||
activateNextTab,
|
||||
activatePreviousTab,
|
||||
openNewWindow,
|
||||
toggleTray,
|
||||
firstTab,
|
||||
secondTab,
|
||||
thirdTab,
|
||||
fourthTab,
|
||||
fifthTab,
|
||||
sixthTab,
|
||||
seventhTab,
|
||||
eigthTab,
|
||||
ninthTab,
|
||||
lastTab,
|
||||
showNoteSource,
|
||||
showOptions,
|
||||
showRevisions,
|
||||
showRecentChanges,
|
||||
showSQLConsole,
|
||||
showBackendLog,
|
||||
showHelp,
|
||||
addLinkToText,
|
||||
followLinkUnderCursor,
|
||||
insertDateTimeToText,
|
||||
pasteMarkdownIntoText,
|
||||
cutIntoNote,
|
||||
addIncludeNoteToText,
|
||||
editReadOnlyNote,
|
||||
addNewLabel,
|
||||
addNewRelation,
|
||||
toggleRibbonTabClassicEditor,
|
||||
toggleRibbonTabBasicProperties,
|
||||
toggleRibbonTabBookProperties,
|
||||
toggleRibbonTabFileProperties,
|
||||
toggleRibbonTabImageProperties,
|
||||
toggleRibbonTabOwnedAttributes,
|
||||
toggleRibbonTabInheritedAttributes,
|
||||
toggleRibbonTabPromotedAttributes,
|
||||
toggleRibbonTabNoteMap,
|
||||
toggleRibbonTabNoteInfo,
|
||||
toggleRibbonTabNotePaths,
|
||||
toggleRibbonTabSimilarNotes,
|
||||
toggleRightPane,
|
||||
printActiveNote,
|
||||
openNoteExternally,
|
||||
renderActiveNote,
|
||||
runActiveNote,
|
||||
toggleNoteHoisting,
|
||||
unhoist,
|
||||
reloadFrontendApp,
|
||||
openDevTools,
|
||||
findInText,
|
||||
toggleLeftPane,
|
||||
toggleFullscreen,
|
||||
zoomOut,
|
||||
zoomIn,
|
||||
zoomReset,
|
||||
copyWithoutFormatting,
|
||||
forceSaveRevision
|
||||
}
|
||||
|
||||
type KeyboardActionNames = keyof typeof KeyboardActionNamesEnum;
|
||||
|
||||
export interface KeyboardShortcut {
|
||||
separator?: string;
|
||||
actionName?: string;
|
||||
actionName?: KeyboardActionNames;
|
||||
description?: string;
|
||||
defaultShortcuts?: string[];
|
||||
effectiveShortcuts?: string[];
|
||||
@ -16,5 +112,5 @@ export interface KeyboardShortcut {
|
||||
}
|
||||
|
||||
export interface KeyboardShortcutWithRequiredActionName extends KeyboardShortcut {
|
||||
actionName: string;
|
||||
actionName: KeyboardActionNames;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user