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

# DeleteTextCmd

> The command to delete the selected text or character relative to the current cursor position.

## Classes

### DeleteTextCmd

#### Implements

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

#### Constructors

##### Constructor

```ts
new DeleteTextCmd(textManager, initData): DeleteTextCmd;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `textManager` | [`ITextManager`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ITextManager.md#itextmanager) |
| `initData` | [`DeleteTextCmdData`](#deletetextcmddata) |

###### Returns

[`DeleteTextCmd`](#deletetextcmd)

#### Methods

##### execute()

```ts
execute(): boolean;
```

Executes the command.

###### Returns

`boolean`

true if changes were made, false otherwise.

###### Implementation of

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

***

### DeleteTextCmdData

Data required to initialize the command.

#### Constructors

##### Constructor

```ts
new DeleteTextCmdData(direction): DeleteTextCmdData;
```

###### Parameters

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

###### Returns

[`DeleteTextCmdData`](#deletetextcmddata)

#### Properties

##### direction

```ts
direction: MoveDirectionType;
```

Direction of text deletion.
