-
Notifications
You must be signed in to change notification settings - Fork 125
/
Copy pathkeyboard_actions_interface.ts
119 lines (116 loc) · 2.96 KB
/
keyboard_actions_interface.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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,
toggleZenMode,
firstTab,
secondTab,
thirdTab,
fourthTab,
fifthTab,
sixthTab,
seventhTab,
eigthTab,
ninthTab,
lastTab,
showNoteSource,
showOptions,
showRevisions,
showRecentChanges,
showSQLConsole,
showBackendLog,
showCheatsheet,
showHelp,
addLinkToText,
followLinkUnderCursor,
insertDateTimeToText,
pasteMarkdownIntoText,
cutIntoNote,
addIncludeNoteToText,
editReadOnlyNote,
addNewLabel,
addNewRelation,
toggleRibbonTabClassicEditor,
toggleRibbonTabBasicProperties,
toggleRibbonTabBookProperties,
toggleRibbonTabFileProperties,
toggleRibbonTabImageProperties,
toggleRibbonTabOwnedAttributes,
toggleRibbonTabInheritedAttributes,
toggleRibbonTabPromotedAttributes,
toggleRibbonTabNoteMap,
toggleRibbonTabNoteInfo,
toggleRibbonTabNotePaths,
toggleRibbonTabSimilarNotes,
toggleRightPane,
printActiveNote,
exportAsPdf,
openNoteExternally,
renderActiveNote,
runActiveNote,
toggleNoteHoisting,
unhoist,
reloadFrontendApp,
openDevTools,
findInText,
toggleLeftPane,
toggleFullscreen,
zoomOut,
zoomIn,
zoomReset,
copyWithoutFormatting,
forceSaveRevision
}
export type KeyboardActionNames = keyof typeof KeyboardActionNamesEnum;
export interface KeyboardShortcut {
separator?: string;
actionName?: KeyboardActionNames;
description?: string;
defaultShortcuts?: string[];
effectiveShortcuts?: string[];
/**
* Scope here means on which element the keyboard shortcuts are attached - this means that for the shortcut to work,
* the focus has to be inside the element.
*
* So e.g. shortcuts with "note-tree" scope work only when the focus is in note tree.
* This allows to have the same shortcut have different actions attached based on the context
* e.g. CTRL-C in note tree does something a bit different from CTRL-C in the text editor.
*/
scope?: "window" | "note-tree" | "text-detail" | "code-detail";
}
export interface KeyboardShortcutWithRequiredActionName extends KeyboardShortcut {
actionName: KeyboardActionNames;
}