API / @aionbuilders/nabu

CommandInfo

Type Stability: stable

What nabu.commands.list() / get() return: a plain snapshot (the registry is fixed once the editor is built, so it needs no reactivity; read it again after a keymap change, i.e. a new editor).

Related guide: Commands and keymap →

Definition

TypeScript
import type { CommandInfo } from '@aionbuilders/nabu';
TypeScript
interface CommandInfo {
  available: boolean;
  confirm: CommandConfirm | null;
  display: string[];
  extension: string;
  id: string;
  keys: string[];
  label: string;
  scope: string | undefined;
}

Properties

Properties of CommandInfo
PropertyTypeDescription
availableboolean

when is true in the given / current context (true without when)

confirmCommandConfirm | nulln/a
displaystring[]

keys formatted for the platform ('⌘B' / 'Ctrl+B')

extensionstring

name of the declaring extension ('core' for the engine's own commands)

idstringn/a
keysstring[]

the chords bound to the command, as written ('Mod-b')

labelstring

resolved (a label function is called with the given / current context)

scopestring | undefinedn/a

Source: src/lib/utils/commands.js:59