Back to Website
Show / Hide Table of Contents

Interface ICurrentTextInfo

Information about the current cursor position and selected text.

Package: @aurigma/design-atoms-text

Properties

isCaretAtTheEndOfParagraph

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

Declaration
isCaretAtTheEndOfParagraph: boolean;
Property Value
Type Description
boolean

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

isCursorAtTheBeginningOfParagraph

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

Declaration
isCursorAtTheBeginningOfParagraph: boolean;
Property Value
Type Description
boolean

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

isParagraphAListItem

Indicates if the current paragraph is a list item.

Declaration
isParagraphAListItem: boolean;
Property Value
Type Description
boolean

Indicates if the current paragraph is a list item.

isParagraphEmpty

Indicates if the current paragraph is empty.

Declaration
isParagraphEmpty: boolean;
Property Value
Type Description
boolean

Indicates if the current paragraph is empty.

isSelectionCollapsed

Indicates that current selection is collapsed.

Declaration
isSelectionCollapsed: boolean;
Property Value
Type Description
boolean

Indicates that current selection is collapsed.

isSelectionMultiline

Indicates that current selection is multiline.

Declaration
isSelectionMultiline: boolean;
Property Value
Type Description
boolean

Indicates that current selection is multiline.

Methods

findItemToContinueBulletedList(bulletCharCode)

Finds the previous list item to continue bulleted list.

Declaration
findItemToContinueBulletedList(bulletCharCode: number): number | null;
Parameters
Type Name Description
number bulletCharCode

character code used as 'bullet' (e.g., code 8225 used for “‡“). the paragraph index of the found list item (if it was found).

Returns
Type Description
number | null

findItemToContinueNumberedList(format, itemNumber)

Finds the previous list item to continue bulleted list.

Declaration
findItemToContinueNumberedList(format: NumberingFormatType, itemNumber: number): number | null;
Parameters
Type Name Description
NumberingFormatType format

numbering format.

number itemNumber

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

Returns
Type Description
number | null

getCursorPosition()

Returns the current cursor position.

Declaration
getCursorPosition(): IPositionInText;
Returns
Type Description
IPositionInText

getListItemLevel()

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

Declaration
getListItemLevel(): number | null;
Returns
Type Description
number | null
Remarks

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

getNextParagraphLength()

Returns the next paragraph text length.

Declaration
getNextParagraphLength(): number;
Returns
Type Description
number

getParagraphIndex()

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

Declaration
getParagraphIndex(): number;
Returns
Type Description
number

getParagraphLength(index)

Returns the text length of the paragraph with specified index.

Declaration
getParagraphLength(index: number): number;
Parameters
Type Name Description
number index

index of the paragraph.

Returns
Type Description
number

getParagraphText()

Returns the text range of a paragraph by index.

Declaration
getParagraphText(): ITextRange;
Returns
Type Description
ITextRange

getPreviousParagraphLength()

Returns the previous paragraph text length.

Declaration
getPreviousParagraphLength(): number;
Returns
Type Description
number

getSelection()

Returns the currently selected text range.

Declaration
getSelection(): ITextRange;
Returns
Type Description
ITextRange

getSelectionLeftParagraphIndex()

Declaration
getSelectionLeftParagraphIndex(): number;
Returns
Type Description
number

getSelectionLeftParagraphLength()

Declaration
getSelectionLeftParagraphLength(): number;
Returns
Type Description
number

getSelectionLeftParagraphOffset()

Declaration
getSelectionLeftParagraphOffset(): number;
Returns
Type Description
number

getSelectionRightParagraphIndex()

Declaration
getSelectionRightParagraphIndex(): number;
Returns
Type Description
number

getSelectionRightParagraphLength()

Declaration
getSelectionRightParagraphLength(): number;
Returns
Type Description
number

getSelectionRightParagraphOffset()

Declaration
getSelectionRightParagraphOffset(): number;
Returns
Type Description
number

getTextFromStartOfParagraph()

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

Declaration
getTextFromStartOfParagraph(): ITextRange;
Returns
Type Description
ITextRange

getTextMetrics()

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

Declaration
getTextMetrics(): ITextMetrics;
Returns
Type Description
ITextMetrics
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2024 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback