fn

createSchema

tested

Build a Schema from node and mark spec maps.

Signature

ts
export function createSchema(input:{ ... }

Parameters

ParameterTypeDescription
input{ nodes: ReadonlyMap<string, NodeSpec>; marks: ReadonlyMap<string, MarkSpec>; }—

Returns

Schema
PropertyTypeDescription
nodesReadonlyMap<string, NodeSpec>—
marksReadonlyMap<string, MarkSpec>—
nodeSpec(type: string) => NodeSpec | undefined—
markSpec(type: string) => MarkSpec | undefined—
defaultAttrs(type: string) => AttrsDefault attrs for a block type (all defaults applied).
coerceAttrs(type: string, attrs?: Attrs) => AttrsFill defaults, run validate, keep unknown keys for a block type.
defaultMarkAttrs(type: string) => AttrsDefault attrs for a mark type.
coerceMarkAttrs(type: string, attrs?: Attrs) => AttrsFill defaults, run validate, keep unknown keys for a mark type.