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

    Interface ICommandButtonRegistry

    interface ICommandButtonRegistry {
        addListener(listener: { onChange?(): void }): () => void;
        get(key: string): CommandButtonEntry<any, any> | null;
        getVersion(): number;
        register(
            entry: CommandButtonEntry<any, any> & { key: string },
            replace?: boolean,
        ): void;
        resolveMembers(
            groupKey: string,
        ): (string | CommandButtonEntry<any, any> | null)[] | null;
        unregister(key: string): void;
    }
    Index
    • Subscribe to register/unregister mutations. Returns an unsubscribe. Paired with getVersion this drives useCommandButtonRegistry's re-render on dynamic contributions.

      Parameters

      • listener: { onChange?(): void }

      Returns () => void

    • Gets a registered item's definition by key (a plain dictionary lookup).

      Parameters

      • key: string

        The unique key for the item.

      Returns CommandButtonEntry<any, any> | null

      The registered item or null if not found.

    • Monotonic version, bumped on every register / unregister. Surfaces snapshot it (with addListener) so a dynamically contributed entry — e.g. a contextual ribbon tab a feature adds while its selection is active — re-resolves reactively, not just at init.

      Returns number

    • Registers an entry (requires a key). Replacing (replace: true) an entry with the same key overwrites it.

      Parameters

      • entry: CommandButtonEntry<any, any> & { key: string }

        The entry (must have a key).

      • Optionalreplace: boolean

        Whether to replace an existing entry with the same key. Default is false.

      Returns void

      In dev, warns when an entry key shadows the command it wraps (key === defaultKey) - entry and command keys are one namespace, so name the panel apart (e.g. ${key}Options). This is a convention-only check: without visibility into the command registry it can only catch the command an entry names via defaultKey, not an arbitrary command key. Suppressed when replace is true.

    • Resolves a panel's final member list: its own members woven with every entry that injects itself into the panel via contributions, ordered. Pure with respect to the current registry snapshot. Returns null if the panel is not registered.

      Parameters

      • groupKey: string

        The panel to resolve.

      Returns (string | CommandButtonEntry<any, any> | null)[] | null

    • Unregister an item.

      Parameters

      • key: string

        The unique key for the item.

      Returns void