Field Notes
    Preparing search index...

    Interface ToolContext

    interface ToolContext {
        activeLayerId?: string;
        camera: Camera;
        constraintService?: ConstraintServiceAccess;
        editElement?: (id: string) => void;
        elementRegistry?: ElementRegistry;
        fitNoteHeight?: (id: string) => void;
        getVisibleRect?: () => Bounds;
        hasLayer?: (layerId: string) => boolean;
        isLayerLocked?: (layerId: string) => boolean;
        isLayerVisible?: (layerId: string) => boolean;
        openLink?: (elementId: string) => void;
        requestOverlayRender: () => void;
        requestRender: () => void;
        selectionColor?: string;
        setCursor?: (cursor: string) => void;
        setSelection?: (ids: string[]) => void;
        smartGuides?: boolean;
        store: ElementStore;
        switchTool?: (name: string) => void;
        theme?: ResolvedTheme;
    }
    Index
    activeLayerId?: string
    camera: Camera
    constraintService?: ConstraintServiceAccess
    editElement?: (id: string) => void
    elementRegistry?: ElementRegistry
    fitNoteHeight?: (id: string) => void
    getVisibleRect?: () => Bounds
    hasLayer?: (layerId: string) => boolean

    Returns whether a layer still exists.

    isLayerLocked?: (layerId: string) => boolean
    isLayerVisible?: (layerId: string) => boolean
    openLink?: (elementId: string) => void

    Opens the element's link through the viewport's open path.

    requestOverlayRender: () => void

    Repaints only the overlay (this tool's renderOverlay and registered overlays). Use requestRender when the scene changed.

    requestRender: () => void
    selectionColor?: string

    Colour of selection chrome; tools fall back to theme.tokens.selection.

    setCursor?: (cursor: string) => void
    setSelection?: (ids: string[]) => void
    smartGuides?: boolean
    switchTool?: (name: string) => void

    Active viewport theme; tools fall back to DEFAULT_THEME.