Skip to main content

ITextRange

Interfaces

ITextRange

Properties

isEmpty
isEmpty: boolean;

Indicates that the text range is empty (starting position is the same as ending position).

isValid
isValid: boolean;

Indicates that the original text still exists and was not modified.

Methods

getEndPosition()
getEndPosition(): IPositionInText;

Returns the end position of text range.

Returns

IPositionInText

getFormattedText()
getFormattedText(): string;

Returns the formatted text of text range.

Returns

string

getLeftPosition()
getLeftPosition(): IPositionInText;

Returns the left position of text range.

Returns

IPositionInText

getParagraphIndexes()
getParagraphIndexes(): number[];

Returns the indexes of paragraphs within a text range.

Returns

number[]

Remarks

Indexes are ordered from lowest to highest.

getPlainText()
getPlainText(): string;

Returns the plain text (without formatting) of text range.

Returns

string

getRightPosition()
getRightPosition(): IPositionInText;

Returns the right position of text range.

Returns

IPositionInText

getStartPosition()
getStartPosition(): IPositionInText;

Returns the start position of text range.

Returns

IPositionInText

isEqualTo()
isEqualTo(textRange): boolean;

Compares the current text range with another.

Parameters
ParameterTypeDescription
textRangeITextRangeanother text range.
Returns

boolean

true if the ranges match, false otherwise.

Was this page helpful?