Field Notes
    Preparing search index...

    Interface MountViewportOptions

    Mount options; onChange, changeDebounceMs, onToolChange, tool and defaultTool are read at use time, so getters stay live.

    interface MountViewportOptions {
        autoSave?: MountAutoSaveOptions;
        changeDebounceMs?: number;
        defaultTool?: string;
        initialData?: string | ImportableCanvasState;
        onChange?: (state: CanvasState) => void;
        onReady?: (viewport: Viewport) => void;
        onToolChange?: (name: string) => void;
        options?: ViewportOptions;
        tool?: string;
        tools?: "default" | Tool[];
    }
    Index

    Loads the saved board after onReady (a saved board wins over initialData), then saves on change.

    changeDebounceMs?: number

    Debounce window for onChange in milliseconds (default 250).

    defaultTool?: string

    Uncontrolled initial tool; ignored when tool is set.

    initialData?: string | ImportableCanvasState

    Read once at mount: a saved state (object or JSON string) loaded before onReady.

    onChange?: (state: CanvasState) => void

    Trailing-debounced with the exported state after any change; flushed by destroy().

    onReady?: (viewport: Viewport) => void

    Called once the viewport exists; a throw destroys the viewport and is rethrown.

    onToolChange?: (name: string) => void

    Fires on active-tool changes after mount, not for activation during mount.

    options?: ViewportOptions

    Read once at mount.

    tool?: string

    Active tool at mount; wins over defaultTool.

    tools?: "default" | Tool[]

    Read once at mount. 'default': createDefaultTools() before onReady, select active. Omitted (and no options.tools): the same bundle after onReady, only if none is registered by then.