Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

ContentMatch

Instances of this class represent a match state of a node type's content expression, and can be used to find out whether further content matches here, and whether a given position is a valid end of the node.

class ContentMatch {
get defaultType(): NodeType | null;
get edgeCount(): number;
readonly validEnd: boolean;
 
edge(n: number): MatchEdge;
fillBefore(
after: Fragment,
toEnd?: boolean,
startIndex?: number,
): Fragment | null;
findWrapping(target: NodeType): readonly NodeType[] | null;
matchFragment(
frag: Fragment,
start?: number,
end?: number,
): ContentMatch | null;
matchType(type: NodeType): ContentMatch | null;
}

§Properties

§
defaultType: NodeType | null readonly
[src]

Get the first matching node type at this match position that can be generated.

§
edgeCount: number readonly
[src]

The number of outgoing edges this node has in the finite automaton that describes the content expression.

§
validEnd: boolean
[src]

True when this match state represents a valid end of the node.

§Methods

§
edge(n: number): MatchEdge
[src]

Get the _n_​th outgoing edge from this node in the finite automaton that describes the content expression.

§
fillBefore(after: Fragment, toEnd?: boolean, startIndex?: number): Fragment | null
[src]

Try to match the given fragment, and if that fails, see if it can be made to match by inserting nodes in front of it. When successful, return a fragment of inserted nodes (which may be empty if nothing had to be inserted). When toEnd is true, only return a fragment if the resulting match goes to the end of the content expression.

§
findWrapping(target: NodeType): readonly NodeType[] | null
[src]

Find a set of wrapping node types that would allow a node of the given type to appear at this position. The result may be empty (when it fits directly) and will be null when no such wrapping exists.

§
matchFragment(frag: Fragment, start?: number, end?: number): ContentMatch | null
[src]

Try to match a fragment. Returns the resulting match when successful.

§
matchType(type: NodeType): ContentMatch | null
[src]

Match a node type, returning a match after that node if successful.