Interface ITextRange
Package: @aurigma/design-atoms-text
Properties
isEmpty
Indicates that the text range is empty (starting position is the same as ending position).
Declaration
isEmpty: boolean;
Property Value
| Type | Description |
|---|---|
| boolean | Indicates that the text range is empty (starting position is the same as ending position). |
isValid
Indicates that the original text still exists and was not modified.
Declaration
isValid: boolean;
Property Value
| Type | Description |
|---|---|
| boolean | Indicates that the original text still exists and was not modified. |
Methods
getEndPosition()
Returns the end position of text range.
Declaration
getEndPosition(): IPositionInText;
Returns
| Type | Description |
|---|---|
| IPositionInText |
getFormattedText()
Returns the formatted text of text range.
Declaration
getFormattedText(): string;
Returns
| Type | Description |
|---|---|
| string |
getLeftPosition()
Returns the left position of text range.
Declaration
getLeftPosition(): IPositionInText;
Returns
| Type | Description |
|---|---|
| IPositionInText |
getParagraphIndexes()
Returns the indexes of paragraphs within a text range.
Declaration
getParagraphIndexes(): number[];
Returns
| Type | Description |
|---|---|
| number[] |
Remarks
Indexes are ordered from lowest to highest.
getPlainText()
Returns the plain text (without formatting) of text range.
Declaration
getPlainText(): string;
Returns
| Type | Description |
|---|---|
| string |
getRightPosition()
Returns the right position of text range.
Declaration
getRightPosition(): IPositionInText;
Returns
| Type | Description |
|---|---|
| IPositionInText |
getStartPosition()
Returns the start position of text range.
Declaration
getStartPosition(): IPositionInText;
Returns
| Type | Description |
|---|---|
| IPositionInText |
isEqualTo(textRange)
Compares the current text range with another.
Declaration
isEqualTo(textRange: ITextRange): boolean;
Parameters
| Type | Name | Description |
|---|---|---|
| ITextRange | textRange |
another text range. |
Returns
| Type | Description |
|---|---|
| boolean | true if the ranges match, false otherwise. |