TLStore
See source codeThe main tldraw store type, representing a reactive database of tldraw records with associated store properties. This is the central data structure that holds all shapes, assets, pages, and user state.
type TLStore = Store<TLRecord, TLStoreProps>
Example
import { Store } from '@tldraw/store'
import { createTLSchema } from '@tldraw/tlschema'
const schema = createTLSchema()
const store: TLStore = new Store({
schema,
props: {
defaultName: 'Untitled',
assets: myAssetStore,
onMount: () => console.log('Store mounted'),
},
})
Prev
TLShapePartialNext
TLStoreSchema