Constructor
new Range(head, tailopt, directionopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
head |
Position | |||
tail |
Position |
<optional> |
head | |
direction |
Direction |
<optional> |
null |
- Source:
Members
direction
Properties:
Name | Type | Description |
---|---|---|
direction |
Direction |
- Source:
head
Properties:
Name | Type | Description |
---|---|---|
head |
Position |
- Source:
tail
Properties:
Name | Type | Description |
---|---|---|
tail |
Position |
- 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
extend(direction) → {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 |
---|---|---|
direction |
Direction |
- 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:
Name | Type | Description |
---|---|---|
direction |
Direction |
- Source:
Returns:
- Type
- Range