From e0850958b0094a64222b1c87a30cc7441c3f6301 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 27 Jul 2025 23:21:07 +0300 Subject: [PATCH] chore(client): type errors --- apps/client/src/components/app_context.ts | 4 +++- apps/client/src/menus/tree_context_menu.ts | 4 ++-- apps/client/src/services/command_registry.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/client/src/components/app_context.ts b/apps/client/src/components/app_context.ts index f5a1a3834..2944005bd 100644 --- a/apps/client/src/components/app_context.ts +++ b/apps/client/src/components/app_context.ts @@ -133,6 +133,8 @@ export type CommandMappings = { hideLeftPane: CommandData; showCpuArchWarning: CommandData; showLeftPane: CommandData; + showAttachments: CommandData; + showSearchHistory: CommandData; hoistNote: CommandData & { noteId: string }; leaveProtectedSession: CommandData; enterProtectedSession: CommandData; @@ -173,7 +175,7 @@ export type CommandMappings = { deleteNotes: ContextMenuCommandData; importIntoNote: ContextMenuCommandData; exportNote: ContextMenuCommandData; - searchInSubtree: ContextMenuCommandData; + searchInSubtree: CommandData & { notePath: string; }; moveNoteUp: ContextMenuCommandData; moveNoteDown: ContextMenuCommandData; moveNoteUpInHierarchy: ContextMenuCommandData; diff --git a/apps/client/src/menus/tree_context_menu.ts b/apps/client/src/menus/tree_context_menu.ts index 40730a51c..8e8f2ed16 100644 --- a/apps/client/src/menus/tree_context_menu.ts +++ b/apps/client/src/menus/tree_context_menu.ts @@ -23,7 +23,7 @@ let lastTargetNode: HTMLElement | null = null; // This will include all commands that implement ContextMenuCommandData, but it will not work if it additional options are added via the `|` operator, // so they need to be added manually. -export type TreeCommandNames = FilteredCommandNames | "openBulkActionsDialog"; +export type TreeCommandNames = FilteredCommandNames | "openBulkActionsDialog" | "searchInSubtree"; export default class TreeContextMenu implements SelectMenuItemEventListener { private treeWidget: NoteTreeWidget; @@ -129,7 +129,7 @@ export default class TreeContextMenu implements SelectMenuItemEventListener`, command: "expandSubtree", uiIcon: "bx bx-expand", enabled: noSelectedNotes }, diff --git a/apps/client/src/services/command_registry.ts b/apps/client/src/services/command_registry.ts index b955d4e0b..64b84918d 100644 --- a/apps/client/src/services/command_registry.ts +++ b/apps/client/src/services/command_registry.ts @@ -11,7 +11,7 @@ export interface CommandDefinition { icon?: string; shortcut?: string; commandName?: CommandNames; - handler?: () => void | Promise; + handler?: () => Promise | null | undefined | void; aliases?: string[]; source?: "manual" | "keyboard-action"; /** Reference to the original keyboard action for scope checking. */