---
title: "History"
---
# History

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

The module monitors the status of the editor and creates / deletes the required number of Undo / Redo shots .

## Extends

- [`ViewComponent`](./component.ViewComponent.html)\<[`IJodit`](../interfaces/types.IJodit.html)\>

## Implements

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

### Constructor

**new History**(`editor`, `stack?`, `snapshot?`): `History`

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

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `editor` | [`IJodit`](../interfaces/types.IJodit.html) |
| `stack` | [`Stack`](./history.Stack.html) |
| `snapshot` | [`Snapshot`](./history.Snapshot.html) |

#### Returns

`History`

#### Overrides

[`ViewComponent`](./component.ViewComponent.html).[`constructor`](./component.ViewComponent.html#constructor)

### STATUSES

`static` **STATUSES**: `object`

Defined in: [src/core/component/component.ts:40](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L40)

#### beforeInit

`readonly` **beforeInit**: `"beforeInit"` = `'beforeInit'`

#### ready

`readonly` **ready**: `"ready"` = `'ready'`

#### beforeDestruct

`readonly` **beforeDestruct**: `"beforeDestruct"` = `'beforeDestruct'`

#### destructed

`readonly` **destructed**: `"destructed"` = `'destructed'`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`STATUSES`](./component.ViewComponent.html#statuses)

***

### async

**async**: [`IAsync`](../interfaces/types.IAsync.html)

Defined in: [src/core/component/component.ts:44](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L44)

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`async`](./component.ViewComponent.html#async)

***

### uid

`readonly` **uid**: `string`

Defined in: [src/core/component/component.ts:59](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L59)

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`uid`](./component.ViewComponent.html#uid)

***

### ownerWindow

**ownerWindow**: [`Window`](https://developer.mozilla.org/docs/Web/API/Window) = `window`

Defined in: [src/core/component/component.ts:109](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L109)

The window in which jodit was created

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`ownerWindow`](./component.ViewComponent.html#ownerwindow)

***

### jodit

**jodit**: [`IJodit`](../interfaces/types.IJodit.html)

Defined in: [src/core/component/view-component.ts:22](https://github.com/xdan/jodit/blob/main/src/core/component/view-component.ts#L22)

Parent View element

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`jodit`](./component.ViewComponent.html#jodit)

***

### snapshot

**snapshot**: [`ISnapshot`](../interfaces/types.ISnapshot.html) & [`IDestructible`](../interfaces/types.IDestructible.html)

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

#### Implementation of

[`IHistory`](../interfaces/types.IHistory.html).[`snapshot`](../interfaces/types.IHistory.html#snapshot)

#### Get Signature

**get** **componentName**(): `string`

Defined in: [src/core/component/component.ts:46](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L46)

##### Returns

`string`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`componentName`](./component.ViewComponent.html#componentname)

***

#### Get Signature

**get** **ownerDocument**(): [`Document`](https://developer.mozilla.org/docs/Web/API/Document)

Defined in: [src/core/component/component.ts:95](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L95)

The document in which jodit was created

##### Returns

[`Document`](https://developer.mozilla.org/docs/Web/API/Document)

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`ownerDocument`](./component.ViewComponent.html#ownerdocument)

***

#### Get Signature

**get** **od**(): [`Document`](https://developer.mozilla.org/docs/Web/API/Document)

Defined in: [src/core/component/component.ts:102](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L102)

Shortcut for `this.ownerDocument`

##### Returns

[`Document`](https://developer.mozilla.org/docs/Web/API/Document)

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`od`](./component.ViewComponent.html#od)

***

#### Get Signature

**get** **ow**(): [`Window`](https://developer.mozilla.org/docs/Web/API/Window)

Defined in: [src/core/component/component.ts:110](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L110)

##### Returns

[`Window`](https://developer.mozilla.org/docs/Web/API/Window)

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`ow`](./component.ViewComponent.html#ow)

***

#### Get Signature

**get** **isReady**(): `boolean`

Defined in: [src/core/component/component.ts:145](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L145)

Component is ready for work

##### Returns

`boolean`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`isReady`](./component.ViewComponent.html#isready)

***

#### Get Signature

**get** **isDestructed**(): `boolean`

Defined in: [src/core/component/component.ts:152](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L152)

Component was destructed

##### Returns

`boolean`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`isDestructed`](./component.ViewComponent.html#isdestructed)

***

#### Get Signature

**get** **isInDestruct**(): `boolean`

Defined in: [src/core/component/component.ts:160](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L160)

The component is currently undergoing destructuring or has already been destroyed.
Those. you should not the app froze new events on him now or do anything else with him.

##### Returns

`boolean`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`isInDestruct`](./component.ViewComponent.html#isindestruct)

***

#### Get Signature

**get** **componentStatus**(): [`ComponentStatus`](../modules/types.html#componentstatus)

Defined in: [src/core/component/component.ts:210](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L210)

Current component status

##### Returns

[`ComponentStatus`](../modules/types.html#componentstatus)

#### Set Signature

**set** **componentStatus**(`componentStatus`): `void`

Defined in: [src/core/component/component.ts:217](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L217)

Setter for current component status

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `componentStatus` | [`ComponentStatus`](../modules/types.html#componentstatus) |

##### Returns

`void`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`componentStatus`](./component.ViewComponent.html#componentstatus)

***

#### Get Signature

**get** **j**(): `T`

Defined in: [src/core/component/view-component.ts:27](https://github.com/xdan/jodit/blob/main/src/core/component/view-component.ts#L27)

Shortcut for `this.jodit`

##### Returns

`T`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`j`](./component.ViewComponent.html#j)

***

#### Get Signature

**get** **defaultTimeout**(): `number`

Defined in: [src/core/component/view-component.ts:31](https://github.com/xdan/jodit/blob/main/src/core/component/view-component.ts#L31)

##### Returns

`number`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`defaultTimeout`](./component.ViewComponent.html#defaulttimeout)

***

#### Get Signature

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

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

##### Returns

`number`

#### Implementation of

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

#### Call Signature

**getFullElName**(`elementName`): `string`

Defined in: [src/core/component/component.ts:65](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L65)

Calc BEM element class name

##### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `elementName` | `string` | element name in the bem classification |

##### Returns

`string`

##### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`getFullElName`](./component.ViewComponent.html#getfullelname)

#### Call Signature

**getFullElName**(`elementName`, `mod`): `string`

Defined in: [src/core/component/component.ts:66](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L66)

Calc BEM element class name

##### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `elementName` | `string` | element name in the bem classification |
| `mod` | `string` | - |

##### Returns

`string`

##### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`getFullElName`](./component.ViewComponent.html#getfullelname)

#### Call Signature

**getFullElName**(`elementName`, `mod`, `modValue`): `string`

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

Calc BEM element class name

##### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `elementName` | `string` | element name in the bem classification |
| `mod` | `string` | - |
| `modValue` | `string` \| `boolean` | - |

##### Returns

`string`

##### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`getFullElName`](./component.ViewComponent.html#getfullelname)

***

### get()

**get**\<`T`\>(`chain`, `obj?`): [`Nullable`](../modules/types.html#nullable)\<`T`\>

Defined in: [src/core/component/component.ts:138](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L138)

Safe get any field

#### Type Parameters

| Type Parameter |
| ------ |
| `T` |

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `chain` | `string` | the path to be traversed in the obj object |
| `obj?` | [`IDictionary`](../modules/types.html#idictionary) | the object in which the value is searched |

#### Returns

[`Nullable`](../modules/types.html#nullable)\<`T`\>

#### Example

```js
private a = {
  b: {
    c: {
      e: {
        g: {
          color: 'red'
        }
      }
    }
  }
}

this.get('a.b.c.e.g.color'); // Safe access to color
// instead using optionsl chaining
this?.a?.b?.c?.e?.g?.color
```

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`get`](./component.ViewComponent.html#get)

***

### bindDestruct()

**bindDestruct**(`component`): `this`

Defined in: [src/core/component/component.ts:170](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L170)

Bind destructor to some View

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `component` | [`IComponent`](../interfaces/types.IComponent.html) |

#### Returns

`this`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`bindDestruct`](./component.ViewComponent.html#binddestruct)

***

### setStatus()

**setStatus**(`componentStatus`): `void`

Defined in: [src/core/component/component.ts:226](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L226)

Set component status

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `componentStatus` | [`ComponentStatus`](../modules/types.html#componentstatus) | component status |

#### Returns

`void`

#### See

ComponentStatus

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`setStatus`](./component.ViewComponent.html#setstatus)

***

### hookStatus()

**hookStatus**(`status`, `callback`): `void`

Defined in: [src/core/component/component.ts:265](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L265)

Adds a handler for changing the component's status

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `status` | [`ComponentStatus`](../modules/types.html#componentstatus) | the status at which the callback is triggered |
| `callback` | (`component`) => `void` | a function that will be called when the status is `status` |

#### Returns

`void`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`hookStatus`](./component.ViewComponent.html#hookstatus)

***

### isInstanceOf()

`static` **isInstanceOf**\<`T`\>(`c`, `constructorFunc`): `c is T`

Defined in: [src/core/component/component.ts:283](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L283)

#### Type Parameters

| Type Parameter |
| ------ |
| `T` *extends* [`Component`](./component.Component.html) |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `c` | `unknown` |
| `constructorFunc` | [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) |

#### Returns

`c is T`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`isInstanceOf`](./component.ViewComponent.html#isinstanceof)

***

### i18n()

**i18n**(`text`, ...`params`): `string`

Defined in: [src/core/component/view-component.ts:35](https://github.com/xdan/jodit/blob/main/src/core/component/view-component.ts#L35)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `text` | `string` |
| ...`params` | (`string` \| `number`)[] |

#### Returns

`string`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`i18n`](./component.ViewComponent.html#i18n)

***

### setParentView()

**setParentView**(`jodit`): `this`

Defined in: [src/core/component/view-component.ts:42](https://github.com/xdan/jodit/blob/main/src/core/component/view-component.ts#L42)

Attach component to View

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `jodit` | [`IJodit`](../interfaces/types.IJodit.html) |

#### Returns

`this`

#### Inherited from

[`ViewComponent`](./component.ViewComponent.html).[`setParentView`](./component.ViewComponent.html#setparentview)

***

### className()

**className**(): `string`

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

#### Returns

`string`

#### Overrides

[`ViewComponent`](./component.ViewComponent.html).[`className`](./component.ViewComponent.html#classname)

***

### redo()

**redo**(): `void`

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

Return state of the WYSIWYG editor to step back

#### Returns

`void`

#### Implementation of

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

***

### canRedo()

**canRedo**(): `boolean`

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

#### Returns

`boolean`

#### Implementation of

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

***

### undo()

**undo**(): `void`

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

Return the state of the WYSIWYG editor to step forward

#### Returns

`void`

#### Implementation of

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

***

### canUndo()

**canUndo**(): `boolean`

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

#### Returns

`boolean`

#### Implementation of

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

***

### clear()

**clear**(): `void`

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

#### Returns

`void`

#### Implementation of

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

***

### destruct()

**destruct**(): `void`

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

#### Returns

`void`

#### Overrides

[`ViewComponent`](./component.ViewComponent.html).[`destruct`](./component.ViewComponent.html#destruct)
