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

# ITextRange

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

## Interfaces

### ITextRange

#### Properties

##### isEmpty

```ts
isEmpty: boolean;
```

##### isValid

```ts
isValid: boolean;
```

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

#### Methods

##### getEndPosition()

```ts
getEndPosition(): IPositionInText;
```

Returns the end position of text range.

###### Returns

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

##### getFormattedText()

```ts
getFormattedText(): string;
```

Returns the formatted text of text range.

###### Returns

`string`

##### getLeftPosition()

```ts
getLeftPosition(): IPositionInText;
```

Returns the left position of text range.

###### Returns

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

##### getParagraphIndexes()

```ts
getParagraphIndexes(): number[];
```

Returns the indexes of paragraphs within a text range.

###### Returns

`number`[]

###### Remarks

Indexes are ordered from lowest to highest.

##### getPlainText()

```ts
getPlainText(): string;
```

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

###### Returns

`string`

##### getRightPosition()

```ts
getRightPosition(): IPositionInText;
```

Returns the right position of text range.

###### Returns

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

##### getStartPosition()

```ts
getStartPosition(): IPositionInText;
```

Returns the start position of text range.

###### Returns

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

##### isEqualTo()

```ts
isEqualTo(textRange): boolean;
```

Compares the current text range with another.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `textRange` | [`ITextRange`](#itextrange) | another text range. |

###### Returns

`boolean`

true if the ranges match, false otherwise.
