---
title: "ICommandHistory | Customer&#x27;s Canvas"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICommandHistory/"
archived: false
applies_to:
  - product: "Customer's Canvas On-Premises"
  - product: "Customer's Canvas Hub"
    versions: ["cloud"]
    entity_id: "https://customerscanvas.com/products/hub#software-application"
  - product: "Design Atoms JS"
    versions: ["7.4"]
---

# ICommandHistory

**Applies to:** Customer's Canvas On-Premises; Customer's Canvas Hub cloud; Design Atoms JS 7.4

> API reference for the ICommandHistory module in @aurigma/design-atoms-text.

## Interfaces

### ICommandHistory

History of executed commands.

#### Methods

##### addCommand()

```ts
addCommand(command): void;
```

Adds the executed command to history.

###### Parameters

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

###### Returns

`void`

##### clearHistory()

```ts
clearHistory(): void;
```

Clears the history of executed commands.

###### Returns

`void`

##### getCommandsCount()

```ts
getCommandsCount(): number;
```

Returns the number of commands in history.

###### Returns

`number`

##### getLastCommand()

```ts
getLastCommand(index?): ICommand;
```

Returns the last command executed from history by index.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `index?` | `number` | command index ('0' used for the most recent command). |

###### Returns

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