Class

OperationReplayer (engine/dev-utils)

@ckeditor/ckeditor5-engine/src/dev-utils/operationreplayer

class

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

Filtering

Properties

Methods

  • constructor( model, logSeparator, stringifiedOperations )

    Parameters

    model : Model

    Data model.

    logSeparator : string

    Separator between operations.

    stringifiedOperations : string

    Operations to replay.

  • applyAllOperations() → Promise<void>

    Applies all operations to replay at once.

    Returns

    Promise<void>
  • 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.

    Returns

    Promise<boolean>
  • applyOperations( numberOfOperations ) → undefined | Promise<void>

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

    Parameters

    numberOfOperations : number

    The number of operations to apply.

    Returns

    undefined | Promise<void>
  • getOperationsToReplay() → Array<Operation>

    Returns operations to replay.

    Returns

    Array<Operation>
  • play( timeInterval ) → Promise<void>

    Applies all operations with a delay between actions.

    Parameters

    timeInterval : number

    Time between applying operations.

    Defaults to 1000

    Returns

    Promise<void>
  • setStringifiedOperations( stringifiedOperations ) → void

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

    Parameters

    stringifiedOperations : string

    Stringified operations to replay.

    Returns

    void