---
title: "Stack"
---
# Stack

Defined in: [src/modules/history/stack.ts:15](https://github.com/xdan/jodit/blob/main/src/modules/history/stack.ts#L15)

## Implements

- [`IStack`](../interfaces/types.IStack.html)

### Constructor

**new Stack**(`size`): `Stack`

Defined in: [src/modules/history/stack.ts:19](https://github.com/xdan/jodit/blob/main/src/modules/history/stack.ts#L19)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `size` | `number` |

#### Returns

`Stack`

#### Get Signature

**get** **length**(): `number`

Defined in: [src/modules/history/stack.ts:21](https://github.com/xdan/jodit/blob/main/src/modules/history/stack.ts#L21)

##### Returns

`number`

#### Implementation of

[`IStack`](../interfaces/types.IStack.html).[`length`](../interfaces/types.IStack.html#length)

### clear()

**clear**(): `void`

Defined in: [src/modules/history/stack.ts:29](https://github.com/xdan/jodit/blob/main/src/modules/history/stack.ts#L29)

#### Returns

`void`

#### Implementation of

[`IStack`](../interfaces/types.IStack.html).[`clear`](../interfaces/types.IStack.html#clear)

***

### push()

**push**(`command`): `void`

Defined in: [src/modules/history/stack.ts:34](https://github.com/xdan/jodit/blob/main/src/modules/history/stack.ts#L34)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `command` | [`Command`](./history.Command.html) |

#### Returns

`void`

#### Implementation of

[`IStack`](../interfaces/types.IStack.html).[`push`](../interfaces/types.IStack.html#push)

***

### replace()

**replace**(`command`): `void`

Defined in: [src/modules/history/stack.ts:45](https://github.com/xdan/jodit/blob/main/src/modules/history/stack.ts#L45)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `command` | [`Command`](./history.Command.html) |

#### Returns

`void`

#### Implementation of

[`IStack`](../interfaces/types.IStack.html).[`replace`](../interfaces/types.IStack.html#replace)

***

### current()

**current**(): [`CanUndef`](../modules/types.html#canundef)\<[`Command`](./history.Command.html)\>

Defined in: [src/modules/history/stack.ts:49](https://github.com/xdan/jodit/blob/main/src/modules/history/stack.ts#L49)

#### Returns

[`CanUndef`](../modules/types.html#canundef)\<[`Command`](./history.Command.html)\>

#### Implementation of

[`IStack`](../interfaces/types.IStack.html).[`current`](../interfaces/types.IStack.html#current)

***

### undo()

**undo**(): `boolean`

Defined in: [src/modules/history/stack.ts:53](https://github.com/xdan/jodit/blob/main/src/modules/history/stack.ts#L53)

#### Returns

`boolean`

#### Implementation of

[`IStack`](../interfaces/types.IStack.html).[`undo`](../interfaces/types.IStack.html#undo)

***

### redo()

**redo**(): `boolean`

Defined in: [src/modules/history/stack.ts:67](https://github.com/xdan/jodit/blob/main/src/modules/history/stack.ts#L67)

#### Returns

`boolean`

#### Implementation of

[`IStack`](../interfaces/types.IStack.html).[`redo`](../interfaces/types.IStack.html#redo)

***

### canUndo()

**canUndo**(): `boolean`

Defined in: [src/modules/history/stack.ts:81](https://github.com/xdan/jodit/blob/main/src/modules/history/stack.ts#L81)

#### Returns

`boolean`

#### Implementation of

[`IStack`](../interfaces/types.IStack.html).[`canUndo`](../interfaces/types.IStack.html#canundo)

***

### canRedo()

**canRedo**(): `boolean`

Defined in: [src/modules/history/stack.ts:85](https://github.com/xdan/jodit/blob/main/src/modules/history/stack.ts#L85)

#### Returns

`boolean`

#### Implementation of

[`IStack`](../interfaces/types.IStack.html).[`canRedo`](../interfaces/types.IStack.html#canredo)
