R
I

Registry

tested

The single source of truth for which block and mark types exist and how they behave. Immutable: built once via {@link createRegistry}; {@link extendRegistry} returns a new registry. The {@link Schema} is projected from the definitions.

Signature

ts
interface Registry

Properties

PropertyTypeDescription
blocksreadonlyReadonlyMap<string, BlockDefinition>
marksreadonlyReadonlyMap<string, MarkDefinition>
schemareadonlySchema
getBlock(type: string) => BlockDefinition | undefined
getMark(type: string) => MarkDefinition | undefined
listBlocks() => readonly BlockDefinition[]Definitions in registration order (drives slash menu / toolbars).
listMarks() => readonly MarkDefinition[]
allMarks() => readonly MarkDefinition[]Alias of {@link listMarks}, for the inline renderer/parser.
hasBlock(type: string) => boolean
hasMark(type: string) => boolean