TLGlobalRecordPropsMap

See source code

Interface for extending tldraw with custom record types via TypeScript module augmentation.

Custom record types allow you to add entirely new data types to the tldraw store that don't fit into the existing shape, binding, or asset categories. Each key in this interface becomes a new record type name, and the value should be your full record type.

interface TLGlobalRecordPropsMap {}

Example

import { BaseRecord, RecordId } from '@tldraw/store'

// Define your custom record type
interface TLComment extends BaseRecord<'comment', RecordId<TLComment>> {
  text: string
  shapeId: TLShapeId
  authorId: string
  createdAt: number
}

// Augment the global record props map
declare module '@tldraw/tlschema' {
  interface TLGlobalRecordPropsMap {
    comment: TLComment
  }
}

// Now TLRecord includes your custom comment type
// and you can use it with createTLSchema()
Prev
TLGlobalBindingPropsMap
Next
TLGlobalShapePropsMap