UI Headless Runtime API - v1.0.0
    Preparing search index...

    Interface CommandPaletteController

    Headless Command Palette controller.

    interface CommandPaletteController {
        bind(elements: OverlayElements): () => void;
        bindShortcut(ownerDocument: Document): () => void;
        close(details?: ChangeDetails<OpenChangeReason>): void;
        destroy(): void;
        getSnapshot(): Readonly<TSnapshot>;
        handleKeyDown(event: KeyboardEvent): void;
        off<TKey extends keyof CommandPaletteEvents>(
            type: TKey,
            listener: RuntimeEventListener<CommandPaletteEvents[TKey]>,
        ): void;
        on<TKey extends keyof CommandPaletteEvents>(
            type: TKey,
            listener: RuntimeEventListener<CommandPaletteEvents[TKey]>,
        ): Unsubscribe;
        once<TKey extends keyof CommandPaletteEvents>(
            type: TKey,
            listener: RuntimeEventListener<CommandPaletteEvents[TKey]>,
        ): Unsubscribe;
        open(details?: ChangeDetails<OpenChangeReason>): void;
        registerCommand(command: CommandItem): () => void;
        select(id: string, details?: ChangeDetails<CommandPaletteReason>): void;
        setQuery(
            query: string,
            details?: ChangeDetails<CommandPaletteReason>,
        ): void;
        subscribe(listener: SnapshotListener<CommandPaletteSnapshot>): Unsubscribe;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Registers the configured global shortcut on an explicit owner document.

      Parameters

      • ownerDocument: Document

      Returns () => void

    • Handles navigation, activation, and Escape.

      Parameters

      • event: KeyboardEvent

      Returns void