@mocanvas/editor · function

createTLSchemaFromUtils

declare function createTLSchemaFromUtils(options?: TLStoreSchemaOptions): StoreSchema<EditorRecord, EditorStoreProps>

Build a store schema from the utils an editor will be given.

Pass the *same* lists you pass the editor. The schema collects each util's static migrations, which is what backfills a prop onto documents saved before that prop existed — a document opened against a schema built from a different set of utils either fails to migrate or migrates against the wrong sequence, and neither is recoverable afterwards.

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.