@mocanvas/mocanvas · function

loadMocanvasFile

declare function loadMocanvasFile(editor: Editor, json: unknown): LoadMocanvasFileResult

Load a .tldr file (text or parsed JSON) into the editor, replacing the document.

Records are normalized before they reach the store, so shapes written by another generation of the format — a rich-text label, a packed freehand path, a prop this build did not exist for — arrive in the form the shape utils expect. records in the result are the normalized ones.

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.