SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface ResolvedCommand<STATE, CONTEXT, ARGS>

    The read surface of a resolved command — the derived, immutable view that CommandButton/toolbars/menus consume. Deliberately the read subset of the retired mutable ICommand interface (same getLabel/getIcon/getShortcut/disabled/execute signatures) so consumers didn't change during the port — the one-sided-change invariant (see design/COMMAND-DESIGN.md). The authoring side (mutation, listeners) is gone: you contribute ICommandDefinitions and re-derive, you don't mutate.

    Adds disabledReasons(); disabled() is derived from it (+ "no callback") for compat. Carries contributedBy for cascade introspection. ARGS (the execute payload) is split from STATE (the value the command reflects) — see CommandCallback.

    interface ResolvedCommand<STATE = any, CONTEXT = any, ARGS = void> {
        contributedBy: Readonly<Record<string, number>>;
        disabled(): boolean;
        disabledReasons(): string[];
        execute(args?: ARGS): Promise<boolean>;
        getContext(): CONTEXT;
        getDescription(groupKey?: string): string;
        getIcon(
            groupKey?: string,
        ): string | ReactElement<unknown, string | JSXElementConstructor<any>>;
        getKey(): string;
        getLabel(groupKey?: string): string;
        getShortcut(): IKeyStroke | readonly IKeyStroke[] | null;
        getState(): STATE;
        getTags(): string[];
        getTarget(): ITarget;
    }

    Type Parameters

    • STATE = any
    • CONTEXT = any
    • ARGS = void
    Index
    contributedBy: Readonly<Record<string, number>>

    Cascade introspection: property name → contribution index that supplied it.

    • Derived: disabled if any reason is present OR there is no callback.

      Returns boolean

    • Reasons the command is unavailable (empty when available).

      Returns string[]

    • Dispatch the command: fire the per-key ExecuteHooks (the registry injects a live accessor at creation) then run the callback. disabled / no-callback / beforeExecute-returns-false ⇒ false. This is what buttons and keystrokes call directly — it's the ripple/close path, no separate registry call needed. args is the per-invocation input (ARGS), distinct from getState().

      Parameters

      Returns Promise<boolean>

    • groupKey selects a pack's desc@<groupKey> variant, if any (no inline scoped field yet).

      Parameters

      • OptionalgroupKey: string

      Returns string

    • groupKey is accepted for signature symmetry — reserved for scoped icons.

      Parameters

      • OptionalgroupKey: string

      Returns string | ReactElement<unknown, string | JSXElementConstructor<any>>

    • Returns string

    • Parameters

      • OptionalgroupKey: string

        Where the command is being rendered (the parent panel/group key, e.g. 'contextMenu', 'cellStyle') — selects the matching groupLabels variant. Omit for the full label. This is the ONLY per-call flavor: dynamic (function) values evaluate against the definition's own context (where the model data lives), never a caller's.

      Returns string

    • The current model value the command reflects (output, for display/enablement).

      Returns STATE

    • Returns string[]