CommandBase
The members every command shares.
Import:
import type { CommandBase } from 'obsidian-dev-utils/obsidian/modals/modal-command-builder';Signature:
export interface CommandBaseProperties
| Property | Type | Description |
|---|---|---|
| key | string | The key that activates the command. |
| modifiers? | Modifier[] | The modifiers combined with CommandBase.key. When omitted, no modifiers are required. |
| purpose | string | The human-readable description shown next to the control. |
Methods
| Method | Returns | Description |
|---|---|---|
| checkIsAvailable(this) | boolean | Whether the control can be used right now. When it returns false the control is rendered **disabled rather than removed**, so the strip does not reflow under the pointer as modes change — which on a phone means a mis-tap.Re-read by ModalCommands.refresh. When omitted, the builder never touches the control's disabled state, leaving whatever CheckboxCommand.onInit / DropDownCommand.onInit set. |
Links to this page: