fn
createRegistry
testedBuild an immutable Registry from block and mark definitions.
Signature
ts
export function createRegistry(options: CreateRegistryOptions ={ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
options? | CreateRegistryOptions | — |
Returns
Registry| Property | Type | Description |
|---|---|---|
blocks | ReadonlyMap<string, BlockDefinition> | — |
marks | ReadonlyMap<string, MarkDefinition> | — |
schema | Schema | — |
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 | — |