chore(client): type errors

This commit is contained in:
Elian Doran 2025-07-27 23:21:07 +03:00
parent 13115b9ed1
commit e0850958b0
No known key found for this signature in database
3 changed files with 6 additions and 4 deletions

View File

@ -133,6 +133,8 @@ export type CommandMappings = {
hideLeftPane: CommandData; hideLeftPane: CommandData;
showCpuArchWarning: CommandData; showCpuArchWarning: CommandData;
showLeftPane: CommandData; showLeftPane: CommandData;
showAttachments: CommandData;
showSearchHistory: CommandData;
hoistNote: CommandData & { noteId: string }; hoistNote: CommandData & { noteId: string };
leaveProtectedSession: CommandData; leaveProtectedSession: CommandData;
enterProtectedSession: CommandData; enterProtectedSession: CommandData;
@ -173,7 +175,7 @@ export type CommandMappings = {
deleteNotes: ContextMenuCommandData; deleteNotes: ContextMenuCommandData;
importIntoNote: ContextMenuCommandData; importIntoNote: ContextMenuCommandData;
exportNote: ContextMenuCommandData; exportNote: ContextMenuCommandData;
searchInSubtree: ContextMenuCommandData; searchInSubtree: CommandData & { notePath: string; };
moveNoteUp: ContextMenuCommandData; moveNoteUp: ContextMenuCommandData;
moveNoteDown: ContextMenuCommandData; moveNoteDown: ContextMenuCommandData;
moveNoteUpInHierarchy: ContextMenuCommandData; moveNoteUpInHierarchy: ContextMenuCommandData;

View File

@ -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, // 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. // so they need to be added manually.
export type TreeCommandNames = FilteredCommandNames<ContextMenuCommandData> | "openBulkActionsDialog"; export type TreeCommandNames = FilteredCommandNames<ContextMenuCommandData> | "openBulkActionsDialog" | "searchInSubtree";
export default class TreeContextMenu implements SelectMenuItemEventListener<TreeCommandNames> { export default class TreeContextMenu implements SelectMenuItemEventListener<TreeCommandNames> {
private treeWidget: NoteTreeWidget; private treeWidget: NoteTreeWidget;
@ -129,7 +129,7 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree
enabled: isNotRoot && parentNotSearch && noSelectedNotes && notOptionsOrHelp enabled: isNotRoot && parentNotSearch && noSelectedNotes && notOptionsOrHelp
}, },
{ title: t("tree-context-menu.convert-to-attachment"), command: "convertNoteToAttachment", uiIcon: "bx bx-paperclip", enabled: isNotRoot && !isHoisted && notOptionsOrHelp }, { title: t("tree-context-menu.convert-to-attachment"), command: "convertNoteToAttachment", uiIcon: "bx bx-paperclip", enabled: isNotRoot && !isHoisted && notOptionsOrHelp },
{ title: "----" }, { title: "----" },
{ title: `${t("tree-context-menu.expand-subtree")} <kbd data-command="expandSubtree"></kbd>`, command: "expandSubtree", uiIcon: "bx bx-expand", enabled: noSelectedNotes }, { title: `${t("tree-context-menu.expand-subtree")} <kbd data-command="expandSubtree"></kbd>`, command: "expandSubtree", uiIcon: "bx bx-expand", enabled: noSelectedNotes },

View File

@ -11,7 +11,7 @@ export interface CommandDefinition {
icon?: string; icon?: string;
shortcut?: string; shortcut?: string;
commandName?: CommandNames; commandName?: CommandNames;
handler?: () => void | Promise<void>; handler?: () => Promise<unknown> | null | undefined | void;
aliases?: string[]; aliases?: string[];
source?: "manual" | "keyboard-action"; source?: "manual" | "keyboard-action";
/** Reference to the original keyboard action for scope checking. */ /** Reference to the original keyboard action for scope checking. */