Type Editor / @type-editor/model / elements/NodeRange / NodeRange
Class: NodeRange
Defined in: packages/model/src/elements/NodeRange.ts:9
Represents a flat range of content, i.e. one that starts and ends in the same node.
Constructors
Constructor
new NodeRange(
$from,
$to,
depth): NodeRange;Defined in: packages/model/src/elements/NodeRange.ts:42
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.
Parameters
| Parameter | Type | Description |
|---|---|---|
$from | ResolvedPos | 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. |
$to | ResolvedPos | A position along the end of the content. See caveat for $from. |
depth | number | The depth of the node that this range points into. |
Returns
NodeRange
Accessors
$from
Get Signature
get $from(): ResolvedPos;Defined in: packages/model/src/elements/NodeRange.ts:51
A resolved position at the start of the range.
Returns
$to
Get Signature
get $to(): ResolvedPos;Defined in: packages/model/src/elements/NodeRange.ts:58
A resolved position at the end of the range.
Returns
depth
Get Signature
get depth(): number;Defined in: packages/model/src/elements/NodeRange.ts:65
The depth of the node that this range points into.
Returns
number
end
Get Signature
get end(): number;Defined in: packages/model/src/elements/NodeRange.ts:83
The position at the end of the range.
Returns
number
The absolute position at the end of this node range.
endIndex
Get Signature
get endIndex(): number;Defined in: packages/model/src/elements/NodeRange.ts:110
The end index of the range in the parent node.
Returns
number
The child index after where this range ends within its parent.
parent
Get Signature
get parent(): Node;Defined in: packages/model/src/elements/NodeRange.ts:92
The parent node that the range points into.
Returns
The parent node containing this range at the specified depth.
start
Get Signature
get start(): number;Defined in: packages/model/src/elements/NodeRange.ts:74
The position at the start of the range.
Returns
number
The absolute position at the start of this node range.
startIndex
Get Signature
get startIndex(): number;Defined in: packages/model/src/elements/NodeRange.ts:101
The start index of the range in the parent node.
Returns
number
The child index where this range starts within its parent.