ReadonlyfromThe lower boundary of the range.
ReadonlygoalThe goal column (stored vertical offset) associated with a cursor. This is used to preserve the vertical position when moving across lines of different length.
ReadonlytoThe upper boundary of the range.
The anchor of the range—the side that doesn't move when you extend it.
If this is a cursor that is explicitly associated with the character on one of its sides, this returns the side. -1 means the character before its position, 1 the character after, and 0 means no association.
The bidirectional text level associated with this cursor, if any.
True when anchor and head are at the same position.
The head of the range, which is moved when the range is extended.
A flag that, when set, makes some selection-extending commands treat the range's head and anchor as exchangeable, so that for example Shift-ArrowUp will make the lower side of the selection the anchor, even if that was the head before. Used to implement MacOS-style undirectional selections.
Compare this range to another range.
OptionalincludeAssoc: booleanExtend this range to cover at least from to to.
Optionalto: numberOptionalassoc: numberMap this range through a change, producing a valid range in the updated document.
Optionalassoc: numberReturn a JSON-serializable object representing the range.
StaticfromConvert a JSON representation of a range to a SelectionRange
instance.
A single selection range. When
allowMultipleSelectionsis enabled, a selection may hold multiple ranges. By default, selections hold exactly one range.