Skip to content

CommandSwitches

A read-only view of the user’s command switches, read by command handlers each time a menu is built.

Import:

import type { CommandSwitches } from '@mnaoumov/obsidian-lib/command-handlers/command-switches';

Signature:

export interface CommandSwitches

Properties

PropertyTypeDescription
isCommandShownInMenus(commandId: string) => booleanWhether the user's switches let a command into the context menus.

A hidden command still runs from the command palette and its hotkeys: the switches govern the menus only.
shouldAddCommandsToSubmenubooleanWhether the plugin's context-menu commands are grouped under one submenu entry.

Links to this page: