CommandContext
Type Stability: stable
What the engine builds at each key press (and for nabu.exec of a command, with event: null). Extensions add FACTS
(any other property) through Extension#commandContext; facts never replace the fields below.
Related guide: Commands and keymap →
Definition
TypeScript
import type { CommandContext } from '@aionbuilders/nabu/extend';TypeScript
interface CommandContext {
ancestors: string[];
block: Block | null;
event: KeyboardEvent | null;
inRoot: boolean;
isCollapsed: boolean;
nabu: Nabu;
selection: NabuSelection;
}Properties
| Property | Type | Description |
|---|---|---|
ancestors | string[] | types of the ancestors of |
block | Block | null | the block holding the selection anchor |
event | KeyboardEvent | null | the key press; |
inRoot | boolean |
|
isCollapsed | boolean | n/a |
nabu | Nabu | n/a |
selection | NabuSelection | n/a |
Source: src/lib/utils/commands.js:17