refactor(command_palette): separate model for keyboard shortcuts

This commit is contained in:
Elian Doran 2025-07-27 16:40:48 +03:00
parent 9508e92676
commit 793867269b
No known key found for this signature in database

View File

@ -98,9 +98,12 @@ const enum KeyboardActionNamesEnum {
export type KeyboardActionNames = keyof typeof KeyboardActionNamesEnum; export type KeyboardActionNames = keyof typeof KeyboardActionNamesEnum;
export interface KeyboardShortcut { export interface KeyboardShortcutSeparator {
separator?: string; separator: string;
actionName?: KeyboardActionNames; }
export interface KeyboardShortcutBase {
actionName: KeyboardActionNames;
description?: string; description?: string;
defaultShortcuts?: string[]; defaultShortcuts?: string[];
effectiveShortcuts?: string[]; effectiveShortcuts?: string[];
@ -115,6 +118,8 @@ export interface KeyboardShortcut {
scope?: "window" | "note-tree" | "text-detail" | "code-detail"; scope?: "window" | "note-tree" | "text-detail" | "code-detail";
} }
type KeyboardShortcut = KeyboardShortcutBase | KeyboardShortcutSeparator;
export interface KeyboardShortcutWithRequiredActionName extends KeyboardShortcut { export interface KeyboardShortcutWithRequiredActionName extends KeyboardShortcut {
actionName: KeyboardActionNames; actionName: KeyboardActionNames;
} }