TLSchema

See source code

The complete schema definition for a tldraw store, encompassing all record types, validation rules, and migration sequences. This schema defines the structure of the persistent data model used by tldraw.

type TLSchema = StoreSchema<TLRecord, TLStoreProps>;

Example

import { createTLSchema, defaultShapeSchemas } from "@tldraw/tlschema";
import { Store } from "@tldraw/store";

const schema: TLSchema = createTLSchema({
  shapes: defaultShapeSchemas,
});

const store = new Store({ schema });
Prev
TLRichText
Next
TLSerializedStore