Interface ICommandProperties<STATE, CONTEXT>

interface ICommandProperties<STATE, CONTEXT> {
    context?: DynamicContext<CONTEXT>;
    description?: DynamicValue<string, CONTEXT>;
    disabled?: boolean | (() => boolean);
    icon?: DynamicValue<ReactNode, CONTEXT>;
    label?: DynamicValue<string, CONTEXT>;
    scopedLabels?: Record<string, DynamicValue<string, CONTEXT>>;
    shortcut?: IKeyStroke | IKeyStroke[] | (() => IKeyStroke);
    state?: STATE;
    tags?: DynamicValue<string[], CONTEXT>;
}

Type Parameters

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

Properties

context?: DynamicContext<CONTEXT>
description?: DynamicValue<string, CONTEXT>
disabled?: boolean | (() => boolean)

Type declaration

    • (): boolean
    • Returns boolean

icon?: DynamicValue<ReactNode, CONTEXT>
label?: DynamicValue<string, CONTEXT>
scopedLabels?: Record<string, DynamicValue<string, CONTEXT>>

The ability to override labels for specific context. This is useful for content menus For example 'Rename Sheet' command might only want to be displayed as 'Rename' in the content menu.

shortcut?: IKeyStroke | IKeyStroke[] | (() => IKeyStroke)

Type declaration

state?: STATE
tags?: DynamicValue<string[], CONTEXT>