weasel API - v0.8.0
    Preparing search index...

    Interface ToolsApi

    interface ToolsApi {
        active: string;
        ambient: readonly AnyTool[];
        disengageHotkey: () => void;
        engageHotkey: (id: string) => void;
        hotkeyEngaged: string | null;
        registry: Readonly<Record<string, AnyTool>>;
        setActive: (id: string) => void;
        getActiveOverlays(): RenderLayer<unknown>[];
        has(id: string): boolean;
    }
    Index

    Properties

    active: string

    Current active-slot tool id.

    ambient: readonly AnyTool[]

    All always-on tools, in registration order.

    disengageHotkey: () => void

    Disengage the hotkey-slot tool, if any.

    engageHotkey: (id: string) => void

    Engage a hotkey-slot tool by id.

    hotkeyEngaged: string | null

    Currently hotkey-engaged tool id (or null). Derived as the top of the hotkey stack for backwards compat with the pre-stack API.

    registry: Readonly<Record<string, AnyTool>>

    Full registry — for userland UI (palette buttons, etc.).

    setActive: (id: string) => void

    Set the active-slot tool. The gesture dispatcher watches the active tool and cancels any in-flight handle itself.

    Methods

    • All overlay layers from currently-engaged tools (active slot, hotkey slot if engaged, all ambient slot tools). Filters out tools with no overlay field. Order: active, then hotkey (if engaged), then ambient (registration order).

      Returns RenderLayer<unknown>[]