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

    Interface CommandContribution

    A tracked contribution session on a scope (see CommandScope.contribution). Every updateCommand through it records the key; remove tears down exactly those keys in one call — so a contributor's teardown is a single contribution.remove() instead of an easy-to-miss, per-key removeCommand list (which gets long for large contributors). Re-updateCommand for a key already tracked is idempotent.

    interface CommandContribution {
        getKeysByTag(tag: string): string[];
        remove(): void;
        updateCommand<STATE = any, CONTEXT = any, ARGS = void>(
            commandKey: string,
            partial: Omit<ICommandDefinition<STATE, CONTEXT, ARGS>, "key">,
        ): void;
        use(middleware: CommandMiddleware<any, any, any>): void;
    }
    Index
    • All command keys reachable from the owning scope (its chain → root) whose merged definition carries tag. The authoring counterpart of CommandScope.collectKeysByTag — it lets a contributor apply a cross-cutting rule by tag without hand-maintaining a parallel key list: e.g. a sheet's protection reducer does for (const key of getKeysByTag('mutator')) updateCommand(key, { disabledReasons }), so the tag authored in the catalog is the single source of truth (the resolved disabled() then accumulates the reasons — no new resolve-time machinery needed).

      Parameters

      • tag: string

      Returns string[]

    • Remove every command + middleware this contribution touched. Idempotent.

      Returns void

    • Register dispatch CommandMiddleware on the owning scope — the cross-cutting wrapper for the callbacks this contribution authors (e.g. a sheet's transactional batch/busy wrapper, so each command callback stays pure). Tracked like commands: undone by remove. This is the authoring facet's equivalent of CommandScope.use, so a contributor never needs the raw scope.

      Parameters

      Returns void