Interface ICommand<STATE, CONTEXT>

interface ICommand<STATE, CONTEXT> {
    addExecuteListener(listener): RemoveListener;
    addPropertyListener(listener, fireOnListen?): RemoveListener;
    context(): CONTEXT;
    description(context?): string;
    disabled(): boolean;
    execute(args?, hook?): Promise<boolean>;
    icon(context?): ReactNode;
    key(): string;
    label(scope?, context?): string;
    shortcut(): IKeyStroke | IKeyStroke[];
    state(): STATE;
    tags(context?): string[];
    target(): CommandTarget;
    update(props): ICommand<STATE, CONTEXT>;
    updateCallback(callback): ICommand<STATE, CONTEXT>;
}

Type Parameters

  • STATE extends any = any
  • CONTEXT extends any = void

Implemented by

Methods

  • Parameters

    • Optional context: DynamicContext<CONTEXT>

    Returns string

  • Returns boolean

  • Parameters

    • Optional context: DynamicContext<CONTEXT>

    Returns ReactNode

  • A unique key for the command. This is how the command is identified within the CommandTree

    Returns string

    Remarks

    Immutable

  • Parameters

    • Optional scope: string
    • Optional context: DynamicContext<CONTEXT>

    Returns string

  • Represents the current state of the value that can also be set

    Returns STATE

  • Parameters

    • Optional context: DynamicContext<CONTEXT>

    Returns string[]