@mocanvas/mocanvas · function

serializeTldrawJson

declare function serializeTldrawJson(editor: Editor): Promise<string>

The editor's document as .tldr JSON text.

Asynchronous by contract even though nothing here awaits: an app that resolves assets to data URLs before saving needs the same signature, and changing a synchronous function to an asynchronous one later would break every call site.

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.