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

NodeRange

Represents a flat range of content, i.e. one that starts and ends in the same node.

class NodeRange {
constructor(
$from: ResolvedPos,
depth: number,
);
readonly $from: ResolvedPos;
readonly $to: ResolvedPos;
readonly depth: number;
get start(): number;
get end(): number;
get parent(): Node;
get startIndex(): number;
get endIndex(): number;
}

§Constructors

§
new NodeRange($from: ResolvedPos, $to: ResolvedPos, depth: number)
[src]

Construct a node range. $from and $to should point into the same node until at least the given depth, since a node range denotes an adjacent set of nodes in a single parent node.

§Properties

§

A resolved position along the start of the content. May have a depth greater than this object's depth property, since these are the positions that were used to compute the range, not re-resolved positions directly at its boundaries.

§

A position along the end of the content. See caveat for $from.

§
depth: number
[src]

The depth of the node that this range points into.

§
start: number readonly
[src]

The position at the start of the range.

§
end: number readonly
[src]

The position at the end of the range.

§
parent: Node readonly
[src]

The parent node that the range points into.

§
startIndex: number readonly
[src]

The start index of the range in the parent node.

§
endIndex: number readonly
[src]

The end index of the range in the parent node.