pivotick - v1.5.0
    Preparing search index...

    Interface ModeStore

    A tiny observable holding the mode-rail state. The rail, contextual tool panel and View flyout subscribe to it; clicks / keybindings dispatch to it. Setters are idempotent — they only notify when the value actually changes — and every notification carries a fresh snapshot so a listener can't mutate the store's internal state.

    subscribe fires on changes only; render initial state from getState first, then subscribe for updates.

    interface ModeStore {
        armTool(mode: PointerMode, tool: string | null): void;
        dispose(): void;
        getArmedTool(mode: PointerMode): string | null;
        getMode(): RailMode;
        getState(): Readonly<ModeState>;
        isPanelOpen(mode: PointerMode): boolean;
        isViewActive(): boolean;
        setMode(mode: RailMode): void;
        setPanelOpen(mode: PointerMode, open: boolean): void;
        subscribe(listener: ModeListener): () => void;
        toggleToolPanel(mode: PointerMode): void;
        toggleView(): void;
    }
    Index

    Methods

    • Arm a tool in a pointer-mode (the rail slot reflects it). Idempotent.

      Parameters

      Returns void

    • Drop every subscriber (called on UI teardown).

      Returns void

    • Whether the View flyout is open (i.e. View is the active mode).

      Returns boolean

    • Subscribe to state changes. Returns an unsubscribe fn (pass to UIComponent.track).

      Parameters

      • listener: ModeListener

      Returns () => void

    • Enter View mode, or leave it back to the last pointer-mode.

      Returns void