Clone and validate a position from existing position. If the given position has invalid offset, this function will return a corrected value.
The original position to clone from
Create a Position from node and an offset number
The node of this position
Offset of this position
Whether this position is created from end of a range. An position created from end of range has different behavior when normalize, it will use the child node before current position if any as a deeper level node and set isAtEnd to true.
Create a Position from node and a type of position
The node of this position
Type of the position, can be Begin, End, Before, After
Check if this position is equal to the given position
The position to check
Checks if this position is after the given position
Move this position with offset, returns a new position with a valid offset in the same node
Offset to move with
Normalize this position to the leaf node, return the normalize result. If current position is already using leaf node, return this position object itself
Get end position of the given Range
The range to get position from
Get start position of the given Range
The range to get position from
Generated using TypeDoc
Represent a position in DOM tree by the node and its offset index