|
1 | 1 | import { Hotkey } from 'obsidian'; |
2 | 2 | import { ViewStore } from 'src/view/view'; |
3 | 3 | import Lineage from 'src/main'; |
4 | | -import { addNodeAndSplitAtCursor } from 'src/view/actions/keyboard-shortcuts/helpers/add-node-and-split-at-cursor'; |
5 | | -import { saveNodeContent } from 'src/view/actions/keyboard-shortcuts/helpers/save-node-content'; |
6 | | -import { cancelChanges } from 'src/view/actions/keyboard-shortcuts/helpers/cancel-changes'; |
7 | | -import { saveNodeAndInsertNode } from 'src/view/actions/keyboard-shortcuts/helpers/save-node-and-insert-node'; |
8 | | -import { mergeNode } from 'src/view/actions/keyboard-shortcuts/helpers/merge-node'; |
| 4 | +import { addNodeAndSplitAtCursor } from 'src/view/actions/keyboard-shortcuts/helpers/tree/add-node-and-split-at-cursor'; |
| 5 | +import { saveNodeContent } from 'src/view/actions/keyboard-shortcuts/helpers/tree/save-node-content'; |
| 6 | +import { cancelChanges } from 'src/view/actions/keyboard-shortcuts/helpers/tree/cancel-changes'; |
| 7 | +import { saveNodeAndInsertNode } from 'src/view/actions/keyboard-shortcuts/helpers/tree/save-node-and-insert-node'; |
| 8 | +import { mergeNode } from 'src/view/actions/keyboard-shortcuts/helpers/tree/merge-node'; |
9 | 9 |
|
10 | 10 | export const hotkeysLang = { |
11 | 11 | save_changes_and_exit_card: 'Save changes and exit card', |
@@ -39,6 +39,8 @@ export type PluginCommand = { |
39 | 39 | hotkeys: Hotkey[]; |
40 | 40 | }; |
41 | 41 |
|
| 42 | +export type LineageCommandName = keyof typeof hotkeysLang; |
| 43 | +export type LineageCommands = Record<LineageCommandName, PluginCommand>; |
42 | 44 | export const createCommands = (plugin: Lineage) => { |
43 | 45 | const isEditing = (store: ViewStore) => { |
44 | 46 | return !!store.getValue().ui.state.editing.activeNodeId; |
@@ -297,5 +299,5 @@ export const createCommands = (plugin: Lineage) => { |
297 | 299 | { key: 'ArrowDown', modifiers: ['Ctrl', 'Shift'] }, |
298 | 300 | ], |
299 | 301 | }, |
300 | | - } satisfies Record<keyof typeof hotkeysLang, PluginCommand>; |
| 302 | + } satisfies LineageCommands; |
301 | 303 | }; |
0 commit comments