Constructors
Properties
Methods
Determines whether the position lies within the span. Returns true if the position is greater than or equal to Start and strictly less than End, otherwise false.
Parameters:
Name | Type | Description |
---|---|---|
position |
number |
The position to check. |
M containsTextSpan(span: ts.TextSpan) boolean
Determines whether span falls completely within this span. Returns true if the specified span falls completely within this span, otherwise false.
Parameters:
Name | Type | Description |
---|---|---|
span |
ts.TextSpan |
The span to check. |
M fromBounds(start: number, end: number) ts.TextSpan
Creates a new TextSpan from the given start and end positions as opposed to a position and length.
Parameters:
Name | Type |
---|---|
start |
number |
end |
number |
M intersection(span: ts.TextSpan) ts.TextSpan
Returns the intersection with the given span, or undefined if there is no intersection.
Parameters:
Name | Type | Description |
---|---|---|
span |
ts.TextSpan |
The span to check. |
Parameters:
Name | Type |
---|---|
start |
number |
length |
number |
Determines whether the given position intersects this span. A position is considered to intersect if it is between the start and end positions (inclusive) of this span. Returns true if the position intersects, false otherwise.
Parameters:
Name | Type | Description |
---|---|---|
position |
number |
The position to check. |
M intersectsWithTextSpan(The: any, span: ts.TextSpan) boolean
Determines whether span intersects this span. Two spans are considered to intersect if they have positions in common or the end of one span coincides with the start of the other span. Returns true if the spans intersect, false otherwise.
Parameters:
Name | Type | Description |
---|---|---|
The |
span to check. |
|
span |
ts.TextSpan |
M overlap(span: ts.TextSpan) ts.TextSpan
Returns the overlap with the given span, or undefined if there is no overlap.
Parameters:
Name | Type | Description |
---|---|---|
span |
ts.TextSpan |
The span to check. |
M overlapsWith(span: ts.TextSpan) boolean
Determines whether the given span overlaps this span. Two spans are considered to overlap if they have positions in common and neither is empty. Empty spans do not overlap with any other span. Returns true if the spans overlap, false otherwise.
Parameters:
Name | Type | Description |
---|---|---|
span |
ts.TextSpan |
The span to check. |