Skip to main content

CurrentTextInfo

Classes​

CurrentTextInfo​

Information about the current cursor position and selected text.

Implements​

Constructors​

Constructor​
new CurrentTextInfo(textManager): CurrentTextInfo;
Parameters​
ParameterType
textManagerNewTextManager
Returns​

CurrentTextInfo

Accessors​

isCaretAtTheEndOfParagraph​
Get Signature​
get isCaretAtTheEndOfParagraph(): boolean;

Indicates if the cursor is at the end of a paragraph.

Returns​

boolean

Indicates if the cursor is at the end of a paragraph.

Implementation of​

ICurrentTextInfo.isCaretAtTheEndOfParagraph

isCursorAtTheBeginningOfParagraph​
Get Signature​
get isCursorAtTheBeginningOfParagraph(): boolean;

Indicates if the cursor is at the beginning of a paragraph.

Returns​

boolean

Indicates if the cursor is at the beginning of a paragraph.

Implementation of​

ICurrentTextInfo.isCursorAtTheBeginningOfParagraph

isParagraphAListItem​
Get Signature​
get isParagraphAListItem(): boolean;

Indicates if the current paragraph is a list item.

Returns​

boolean

Indicates if the current paragraph is a list item.

Implementation of​

ICurrentTextInfo.isParagraphAListItem

isParagraphEmpty​
Get Signature​
get isParagraphEmpty(): boolean;

Indicates if the current paragraph is empty.

Returns​

boolean

Indicates if the current paragraph is empty.

Implementation of​

ICurrentTextInfo.isParagraphEmpty

isSelectionCollapsed​
Get Signature​
get isSelectionCollapsed(): boolean;

Indicates that current selection is collapsed.

Returns​

boolean

Indicates that current selection is collapsed.

Implementation of​

ICurrentTextInfo.isSelectionCollapsed

isSelectionMultiline​
Get Signature​
get isSelectionMultiline(): boolean;

Indicates that current selection is multiline.

Returns​

boolean

Indicates that current selection is multiline.

Implementation of​

ICurrentTextInfo.isSelectionMultiline

Methods​

findItemToContinueBulletedList()​
findItemToContinueBulletedList(bulletCharCode): number;

Finds the previous list item to continue bulleted list.

Parameters​
ParameterTypeDescription
bulletCharCodenumbercharacter code used as 'bullet' (e.g., code 8225 used for “‡“).
Returns​

number

the paragraph index of the found list item (if it was found).

Implementation of​

ICurrentTextInfo.findItemToContinueBulletedList

findItemToContinueNumberedList()​
findItemToContinueNumberedList(format, itemNumber): number;

Finds the previous list item to continue bulleted list.

Parameters​
ParameterTypeDescription
formatNumberingFormatTypenumbering format.
itemNumbernumberlist item number (from 1).
Returns​

number

the paragraph index of the found list item (if it was found).

Implementation of​

ICurrentTextInfo.findItemToContinueNumberedList

getCursorPosition()​
getCursorPosition(): IPositionInText;

Returns the current cursor position.

Returns​

IPositionInText

Implementation of​

ICurrentTextInfo.getCursorPosition

getListItemLevel()​
getListItemLevel(): number;

Returns the nesting level of a list item (from 0).

Returns​

number

Remarks​

if the paragraph is not a list element, then returned 'null'.

Implementation of​

ICurrentTextInfo.getListItemLevel

getNextParagraphLength()​
getNextParagraphLength(): number;

Returns the next paragraph text length.

Returns​

number

Implementation of​

ICurrentTextInfo.getNextParagraphLength

getParagraphIndex()​
getParagraphIndex(): number;

Returns the current index of the paragraph (from 0).

Returns​

number

Implementation of​

ICurrentTextInfo.getParagraphIndex

getParagraphLength()​
getParagraphLength(index): number;

Returns the text length of the paragraph with specified index.

Parameters​
ParameterTypeDescription
indexnumberindex of the paragraph.
Returns​

number

Implementation of​

ICurrentTextInfo.getParagraphLength

getParagraphText()​
getParagraphText(): ITextRange;

Returns the text range of a paragraph by index.

Returns​

ITextRange

Implementation of​

ICurrentTextInfo.getParagraphText

getPreviousParagraphLength()​
getPreviousParagraphLength(): number;

Returns the previous paragraph text length.

Returns​

number

Implementation of​

ICurrentTextInfo.getPreviousParagraphLength

getSelection()​
getSelection(): ITextRange;

Returns the currently selected text range.

Returns​

ITextRange

Implementation of​

ICurrentTextInfo.getSelection

getSelectionLeftParagraphIndex()​
getSelectionLeftParagraphIndex(): number;
Returns​

number

Implementation of​

ICurrentTextInfo.getSelectionLeftParagraphIndex

getSelectionLeftParagraphLength()​
getSelectionLeftParagraphLength(): number;
Returns​

number

Implementation of​

ICurrentTextInfo.getSelectionLeftParagraphLength

getSelectionLeftParagraphOffset()​
getSelectionLeftParagraphOffset(): number;
Returns​

number

Implementation of​

ICurrentTextInfo.getSelectionLeftParagraphOffset

getSelectionRightParagraphIndex()​
getSelectionRightParagraphIndex(): number;
Returns​

number

Implementation of​

ICurrentTextInfo.getSelectionRightParagraphIndex

getSelectionRightParagraphLength()​
getSelectionRightParagraphLength(): number;
Returns​

number

Implementation of​

ICurrentTextInfo.getSelectionRightParagraphLength

getSelectionRightParagraphOffset()​
getSelectionRightParagraphOffset(): number;
Returns​

number

Implementation of​

ICurrentTextInfo.getSelectionRightParagraphOffset

getTextFromStartOfParagraph()​
getTextFromStartOfParagraph(): ITextRange;

Returns the text range from the beginning of the paragraph to the current position.

Returns​

ITextRange

Implementation of​

ICurrentTextInfo.getTextFromStartOfParagraph

getTextMetrics()​
getTextMetrics(): ITextMetrics;

Returns the current text metrics (for limits): textLength, currentLineLength, linesCount, isSelectionCollapsed.

Returns​

ITextMetrics

Implementation of​

ICurrentTextInfo.getTextMetrics

Was this page helpful?