@mocanvas/editor · interface

TLSvgExportContext

interface TLSvgExportContext extends ShapeSvgContext

What a shape can find out about the export it is being rendered into.


Methods · 2

resolveAssetUrl(assetId: AssetId, width: number): Promise<string | null>

Resolve an asset at the size this export needs.

Not the same as the on-screen resolution: an export usually wants the original, where the canvas wants whatever is sharp at the current zoom.

waitUntil(promise: Promise<unknown>): void

Hold the export open until promise settles.

The escape hatch for anything that is not ready at first paint. The export waits for every registered promise, up to options.maxExportDelayMs, and then gives up — a shape that never resolves delays the export rather than hanging it forever.


Properties · 2

pixelRatio: number | null

The output's device-pixel multiplier, or null for a pure SVG export.

scale: number

The logical scale the export is being rendered at. 1 unless asked otherwise.

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.