---
title: "CurrentTextInfo | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/CurrentTextInfo/"
---

# CurrentTextInfo

> Information about the current cursor position and selected text.

## Classes

### CurrentTextInfo

#### Implements

- [`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo)

#### Constructors

##### Constructor

```ts
new CurrentTextInfo(textManager): CurrentTextInfo;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `textManager` | [`NewTextManager`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/NewTextManager.md#newtextmanager) |

###### Returns

[`CurrentTextInfo`](#currenttextinfo)

#### Accessors

##### isCaretAtTheEndOfParagraph

###### Get Signature

```ts
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`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`isCaretAtTheEndOfParagraph`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#iscaretattheendofparagraph)

##### isCursorAtTheBeginningOfParagraph

###### Get Signature

```ts
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`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`isCursorAtTheBeginningOfParagraph`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#iscursoratthebeginningofparagraph)

##### isParagraphAListItem

###### Get Signature

```ts
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`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`isParagraphAListItem`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#isparagraphalistitem)

##### isParagraphEmpty

###### Get Signature

```ts
get isParagraphEmpty(): boolean;
```

Indicates if the current paragraph is empty.

###### Returns

`boolean`

Indicates if the current paragraph is empty.

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`isParagraphEmpty`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#isparagraphempty)

##### isSelectionCollapsed

###### Get Signature

```ts
get isSelectionCollapsed(): boolean;
```

Indicates that current selection is collapsed.

###### Returns

`boolean`

Indicates that current selection is collapsed.

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`isSelectionCollapsed`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#isselectioncollapsed)

##### isSelectionMultiline

###### Get Signature

```ts
get isSelectionMultiline(): boolean;
```

Indicates that current selection is multiline.

###### Returns

`boolean`

Indicates that current selection is multiline.

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`isSelectionMultiline`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#isselectionmultiline)

#### Methods

##### findItemToContinueBulletedList()

```ts
findItemToContinueBulletedList(bulletCharCode): number;
```

Finds the previous list item to continue bulleted list.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `bulletCharCode` | `number` | character 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`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`findItemToContinueBulletedList`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#finditemtocontinuebulletedlist)

##### findItemToContinueNumberedList()

```ts
findItemToContinueNumberedList(format, itemNumber): number;
```

Finds the previous list item to continue bulleted list.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `format` | [`NumberingFormatType`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/NumberingFormatType.md#numberingformattype) | numbering format. |
| `itemNumber` | `number` | list item number (from 1). |

###### Returns

`number`

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

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`findItemToContinueNumberedList`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#finditemtocontinuenumberedlist)

##### getCursorPosition()

```ts
getCursorPosition(): IPositionInText;
```

Returns the current cursor position.

###### Returns

[`IPositionInText`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IPositionInText.md#ipositionintext)

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getCursorPosition`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getcursorposition)

##### getListItemLevel()

```ts
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`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getListItemLevel`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getlistitemlevel)

##### getNextParagraphLength()

```ts
getNextParagraphLength(): number;
```

Returns the next paragraph text length.

###### Returns

`number`

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getNextParagraphLength`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getnextparagraphlength)

##### getParagraphIndex()

```ts
getParagraphIndex(): number;
```

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

###### Returns

`number`

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getParagraphIndex`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getparagraphindex)

##### getParagraphLength()

```ts
getParagraphLength(index): number;
```

Returns the text length of the paragraph with specified index.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `index` | `number` | index of the paragraph. |

###### Returns

`number`

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getParagraphLength`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getparagraphlength)

##### getParagraphText()

```ts
getParagraphText(): ITextRange;
```

Returns the text range of a paragraph by index.

###### Returns

[`ITextRange`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ITextRange.md#itextrange)

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getParagraphText`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getparagraphtext)

##### getPreviousParagraphLength()

```ts
getPreviousParagraphLength(): number;
```

Returns the previous paragraph text length.

###### Returns

`number`

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getPreviousParagraphLength`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getpreviousparagraphlength)

##### getSelection()

```ts
getSelection(): ITextRange;
```

Returns the currently selected text range.

###### Returns

[`ITextRange`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ITextRange.md#itextrange)

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getSelection`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getselection)

##### getSelectionLeftParagraphIndex()

```ts
getSelectionLeftParagraphIndex(): number;
```

###### Returns

`number`

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getSelectionLeftParagraphIndex`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getselectionleftparagraphindex)

##### getSelectionLeftParagraphLength()

```ts
getSelectionLeftParagraphLength(): number;
```

###### Returns

`number`

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getSelectionLeftParagraphLength`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getselectionleftparagraphlength)

##### getSelectionLeftParagraphOffset()

```ts
getSelectionLeftParagraphOffset(): number;
```

###### Returns

`number`

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getSelectionLeftParagraphOffset`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getselectionleftparagraphoffset)

##### getSelectionRightParagraphIndex()

```ts
getSelectionRightParagraphIndex(): number;
```

###### Returns

`number`

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getSelectionRightParagraphIndex`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getselectionrightparagraphindex)

##### getSelectionRightParagraphLength()

```ts
getSelectionRightParagraphLength(): number;
```

###### Returns

`number`

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getSelectionRightParagraphLength`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getselectionrightparagraphlength)

##### getSelectionRightParagraphOffset()

```ts
getSelectionRightParagraphOffset(): number;
```

###### Returns

`number`

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getSelectionRightParagraphOffset`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#getselectionrightparagraphoffset)

##### getTextFromStartOfParagraph()

```ts
getTextFromStartOfParagraph(): ITextRange;
```

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

###### Returns

[`ITextRange`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ITextRange.md#itextrange)

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getTextFromStartOfParagraph`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#gettextfromstartofparagraph)

##### getTextMetrics()

```ts
getTextMetrics(): ITextMetrics;
```

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

###### Returns

[`ITextMetrics`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ITextMetrics.md#itextmetrics)

###### Implementation of

[`ICurrentTextInfo`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#icurrenttextinfo).[`getTextMetrics`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICurrentTextInfo.md#gettextmetrics)
