@mocanvas/editor · function

getDisplayValues

declare function getDisplayValues<S = TLStyledShape, D extends object = TLDefaultDisplayValues>(util: TLDisplayValuesSource<S, D>, shape: S): D

The display values of one shape, as its util resolves them.

Merges the util's defaults with whatever its getCustomDisplayValues override returns, against the theme and colour mode the editor is *currently* painting with — so calling this inside a reactive context re-runs it when the theme changes.

The two type arguments are given by the caller rather than inferred, because a util looked up by string out of editor.shapeUtils has lost its own display-value type by then:

``ts const display = getDisplayValues<NoteShape, NoteDisplayValues>(util, note) ``

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.