# OperationReplayer

class

Operation replayer is a development tool created for easy replaying of operations on the document from stringified operations.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dev-utils/operationreplayer.ts#L20)

<a id="properties">

## Properties

<a id="member-_logSeparator">

### `_logSeparator: string` _(private)_

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dev-utils/operationreplayer.ts#L22)

<a id="member-_model">

### `_model: Model` _(private)_

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dev-utils/operationreplayer.ts#L21)

<a id="member-_operationsToReplay">

### `_operationsToReplay: Array<Operation>` _(private)_

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dev-utils/operationreplayer.ts#L23)

<a id="methods">

## Methods

<a id="function-constructor">

### `constructor( model, logSeparator, stringifiedOperations )`

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dev-utils/operationreplayer.ts#L30)

#### Parameters

* `model: Model`

  Data model.

* `logSeparator: string`

  Separator between operations.

* `stringifiedOperations: string`

  Operations to replay.

<a id="function-applyAllOperations">

### `applyAllOperations() → Promise<void>`

Applies all operations to replay at once.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dev-utils/operationreplayer.ts#L107)

#### Returns

* `Promise<void>`

<a id="function-applyNextOperation">

### `applyNextOperation() → Promise<boolean>`

Applies the next operation to replay. Returns a promise with the `isFinished` parameter that is `true` if the last operation in the replayer has been applied, `false` otherwise.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dev-utils/operationreplayer.ts#L120)

#### Returns

* `Promise<boolean>`

<a id="function-applyOperations">

### `applyOperations( numberOfOperations ) → Promise<void> | undefined`

Applies `numberOfOperations` operations, beginning after the last applied operation (or first, if no operations were applied).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dev-utils/operationreplayer.ts#L91)

#### Parameters

* `numberOfOperations: number`

  The number of operations to apply.

#### Returns

* `Promise<void> | undefined`

<a id="function-getOperationsToReplay">

### `getOperationsToReplay() → Array<Operation>`

Returns operations to replay.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dev-utils/operationreplayer.ts#L56)

#### Returns

* `Array<Operation>`

<a id="function-play">

### `play( timeInterval ) → Promise<void>`

Applies all operations with a delay between actions.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dev-utils/operationreplayer.ts#L65)

#### Parameters

* `timeInterval: number`

  Time between applying operations.

  Defaults to `1000`

#### Returns

* `Promise<void>`

<a id="function-setStringifiedOperations">

### `setStringifiedOperations( stringifiedOperations ) → void`

Parses the given string containing stringified operations and sets parsed operations as operations to replay.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dev-utils/operationreplayer.ts#L41)

#### Parameters

* `stringifiedOperations: string`

  Stringified operations to replay.

#### Returns

* `void`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
