@mocanvas/editor · function
declare function loadSnapshot(editor: Editor, snapshot: TLEditorSnapshot | StoreSnapshot<EditorRecord>, opts?: TLLoadSnapshotOptions): voidRestore a snapshot, or just its document half.
Loading is not undoable — it replaces the document, so there is nothing coherent for an undo to go back to — and the history is cleared afterwards rather than left holding steps against records that no longer exist.
Every id in the session half is validated against the document that was just loaded: a page that is gone falls back to the first page, and selected shapes that are gone are dropped. A session from an unknown future version is ignored entirely rather than half-applied.
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.