Constructor
new Range(head, tailopt, directionopt)
Parameters:
- Source:
Members
direction
Properties:
- Source:
head
Properties:
- Source:
tail
Properties:
- Source:
Methods
(static) create(headSection, headOffset, tailSectionopt, tailOffsetopt, directionopt) → {Range}
Shorthand to create a new range from a section(s) and offset(s).
When given only a head section and offset, creates a collapsed range.
Parameters:
Name |
Type |
Attributes |
Default |
Description |
headSection |
Section
|
|
|
|
headOffset |
number
|
|
|
|
tailSection |
Section
|
<optional>
|
headSection
|
|
tailOffset |
number
|
<optional>
|
headOffset
|
|
direction |
Direction
|
<optional>
|
null
|
|
- Source:
Returns:
-
Type
-
Range
expandByMarker(detectMarker) → {Range}
expand a range to all markers matching a given check
Parameters:
Name |
Type |
Description |
detectMarker |
function
|
|
- Source:
Returns:
-
Type
-
Range
extend(units) → {Range}
Expands the range 1 unit in the given direction
If the range is expandable in the given direction, always returns a
non-collapsed range.
Parameters:
Name |
Type |
Description |
units |
Number
|
If units is > 0, the range is extended to the right,
otherwise range is extended to the left. |
- Source:
Returns:
-
Type
-
Range
move(direction) → {Range}
Moves this range 1 unit in the given direction.
If the range is collapsed, returns a collapsed range shifted by 1 unit,
otherwise collapses this range to the position at the direction
end of the range.
Always returns a collapsed range.
Parameters:
- Source:
Returns:
-
Type
-
Range