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

Methods

  • constructor( model, logSeparator, stringifiedOperations )

    Parameters

    model : Model

    Data model.

    logSeparator : String

    Separator between operations.

    stringifiedOperations : String

    Operations to replay.

  • applyAllOperations() → Promise

    Applies all operations to replay at once.

    Returns

    Promise
  • 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 ) → Promise

    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

    Promise
  • getOperationsToReplay() → Array.<Operation>

    Returns operations to replay.

    Returns

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

    Applies all operations with a delay between actions.

    Parameters

    timeInterval : Number

    Time between applying operations.

    Defaults to 1000

    Returns

    Promise
  • setStringifiedOperations( stringifiedOperations )

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

    Parameters

    stringifiedOperations : String

    Stringified operations to replay.