OperationReplayer
Operation replayer is a development tool created for easy replaying of operations on the document from stringified operations.
Properties
_logSeparator : stringprivatemodule:engine/dev-utils/operationreplayer~OperationReplayer#_logSeparatormodule:engine/dev-utils/operationreplayer~OperationReplayer#_model_operationsToReplay : Array<Operation>privatemodule:engine/dev-utils/operationreplayer~OperationReplayer#_operationsToReplay
Methods
constructor( model, logSeparator, stringifiedOperations )module:engine/dev-utils/operationreplayer~OperationReplayer#constructorParameters
model : ModelData model.
logSeparator : stringSeparator between operations.
stringifiedOperations : stringOperations to replay.
applyAllOperations() → Promise<void>module:engine/dev-utils/operationreplayer~OperationReplayer#applyAllOperationsapplyNextOperation() → Promise<boolean>module:engine/dev-utils/operationreplayer~OperationReplayer#applyNextOperationApplies the next operation to replay. Returns a promise with the
isFinishedparameter that istrueif the last operation in the replayer has been applied,falseotherwise.Returns
Promise<boolean>
applyOperations( numberOfOperations ) → undefined | Promise<void>module:engine/dev-utils/operationreplayer~OperationReplayer#applyOperationsApplies
numberOfOperationsoperations, beginning after the last applied operation (or first, if no operations were applied).Parameters
numberOfOperations : numberThe number of operations to apply.
Returns
undefined | Promise<void>
getOperationsToReplay() → Array<Operation>module:engine/dev-utils/operationreplayer~OperationReplayer#getOperationsToReplayplay( timeInterval ) → Promise<void>module:engine/dev-utils/operationreplayer~OperationReplayer#playApplies all operations with a delay between actions.
Parameters
timeInterval : numberTime between applying operations.
Defaults to
1000
Returns
Promise<void>
setStringifiedOperations( stringifiedOperations ) → voidmodule:engine/dev-utils/operationreplayer~OperationReplayer#setStringifiedOperationsParses the given string containing stringified operations and sets parsed operations as operations to replay.
Parameters
stringifiedOperations : stringStringified operations to replay.
Returns
void