bindingIdValidator
See source codeValidator for binding IDs. Ensures that binding identifiers follow the correct format and type constraints required by the tldraw schema system.
Used internally by the schema validation system to verify binding IDs when records are created or modified. All binding IDs must be prefixed with 'binding:'.
bindingIdValidator: T.Validator<TLBindingId>
Example
import { bindingIdValidator } from '@tldraw/tlschema'
// Validate a binding ID
const isValid = bindingIdValidator.isValid('binding:abc123') // true
const isInvalid = bindingIdValidator.isValid('shape:abc123') // false
// Use in custom validation schema
const customBindingValidator = T.object({
id: bindingIdValidator,
// ... other properties
})
Prev
assetValidatorNext
bookmarkShapeMigrations