Schema
class Schema<Nodes extends string = any, Marks extends string = any> { }
constructor(spec: SchemaSpec<Nodes, Marks>);
cached: {};
[key: string]: any;
linebreakReplacement: NodeType | null;
spec: {
nodes: OrderedMap<NodeSpec>;
marks: OrderedMap<MarkSpec>;
topNode?: string;
};topNodeType: NodeType;
§Constructors
§
new Schema(spec: SchemaSpec<Nodes, Marks>)
[src]Construct a schema from a schema specification.
§Properties
§
cached: {}
[src][key: string]: any;
An object for storing whatever values modules may want to compute and cache per schema. (If you want to store something in it, try to use property names unlikely to clash.)
§
The linebreak replacement node defined in this schema, if any.
§
spec: {
[src]nodes: OrderedMap<NodeSpec>;
marks: OrderedMap<MarkSpec>;
topNode?: string;
}The spec on which the schema is based,
with the added guarantee that its nodes
and marks
properties are
OrderedMap
instances
(not raw objects).
§
The type of the default top node for this schema.
§Methods
§
node(type: string | NodeType, attrs?: Attrs | null, content?: Fragment | Node | readonly Node[], marks?: readonly Mark[]): Node
[src]Create a node in this schema. The type
may be a string or a
NodeType
instance. Attributes will be extended with defaults,
content
may be a Fragment
, null
, a Node
, or an array of
nodes.