TLBindingUpdate

See source code

Type for updating existing bindings with partial properties. Only the id and type are required, all other properties are optional.

type TLBindingUpdate<T extends TLBinding = TLBinding> = Expand<{
  fromId?: T['fromId']
  id: TLBindingId
  meta?: Partial<T['meta']>
  props?: Partial<T['props']>
  toId?: T['toId']
  type: T['type']
  typeName?: T['typeName']
}>

Example

// Update arrow binding properties
const bindingUpdate: TLBindingUpdate<TLArrowBinding> = {
  id: 'binding:arrow1',
  type: 'arrow',
  props: {
    normalizedAnchor: { x: 0.7, y: 0.3 }, // Only update anchor position
  },
}

editor.updateBindings([bindingUpdate])
Prev
TLBindingId
Next
TLBookmarkAsset