fn

createRegistry

tested

Build an immutable Registry from block and mark definitions.

Signature

ts
export function createRegistry(options: CreateRegistryOptions ={ ... }

Parameters

ParameterTypeDescription
options?CreateRegistryOptions—

Returns

Registry
PropertyTypeDescription
blocksReadonlyMap<string, BlockDefinition>—
marksReadonlyMap<string, MarkDefinition>—
schemaSchema—
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 listMarks, for the inline renderer/parser.
hasBlock(type: string) => boolean—
hasMark(type: string) => boolean—