@mocanvas/editor · interface

TLIndicatorHost

interface TLIndicatorHost extends OverlayHost

What the compositor needs from the editor. Structural rather than the concrete Editor so the interesting half — which shapes, which weight, which colour — can be tested without a store, an engine or a canvas.


Methods · 10

getCamera(): {
getCurrentToolId(): string
getHintingShapeIds(): readonly string[]
getHoveredShape(): UnknownShape | undefined
getInstanceState(): {
getSelectedShapes(): UnknownShape[]
getShape(id: string): UnknownShape | undefined
getShapeGeometryBounds(shape: UnknownShape): {
getShapePageTransform(shape: UnknownShape): TLIndicatorTransform
getShapeUtil(shape: UnknownShape): IndicatorShapeUtil

Properties · 2

getShapeSketchPath?(shape: UnknownShape): number[] | null

The outline the hand-drawn style really strokes, or null for a shape drawn along its geometry. Optional, so a host that has no renderer behind it — a test double, most of them — simply falls back to the util's own outline.

theme: TLThemeHost

The live theme; the selection colour comes from it, never from this module.

Mentioned here

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.