richTextValidator

See source code

Validator for TLRichText objects that ensures they have the correct structure for document-based rich text content. Validates a document with a type field and an array of content blocks.

richTextValidator: T.ObjectValidator<{
  content: unknown[]
  type: string
}>

Example

const richText = {
  type: 'doc',
  content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Hello' }] }],
}
const isValid = richTextValidator.check(richText) // true
Prev
PointerRecordType
Next
rootBindingMigrations