TLBindingId

See source code

Branded string type for binding record identifiers. Prevents mixing binding IDs with other types of record IDs at compile time.

type TLBindingId = RecordId<TLUnknownBinding>

Example

import { createBindingId } from '@tldraw/tlschema'

// Create a new binding ID
const bindingId: TLBindingId = createBindingId()

// Use in binding records
const binding: TLBinding = {
  id: bindingId,
  type: 'arrow',
  fromId: 'shape:arrow1',
  toId: 'shape:rectangle1',
  // ... other properties
}
Prev
TLBindingCreate
Next
TLBindingUpdate