OperationReplayer
Operation replayer is a development tool created for easy replaying of operations on the document from stringified operations.
Properties
-
_logSeparator : string
privatemodule:engine/dev-utils/operationreplayer~OperationReplayer#_logSeparator
-
module: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#constructor
Parameters
model : Model
Data model.
logSeparator : string
Separator between operations.
stringifiedOperations : string
Operations to replay.
-
applyAllOperations() → Promise<void>
module:engine/dev-utils/operationreplayer~OperationReplayer#applyAllOperations
-
applyNextOperation() → Promise<boolean>
module:engine/dev-utils/operationreplayer~OperationReplayer#applyNextOperation
Applies the next operation to replay. Returns a promise with the
isFinished
parameter that istrue
if the last operation in the replayer has been applied,false
otherwise.Returns
Promise<boolean>
-
applyOperations( numberOfOperations ) → undefined | Promise<void>
module:engine/dev-utils/operationreplayer~OperationReplayer#applyOperations
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>
module:engine/dev-utils/operationreplayer~OperationReplayer#getOperationsToReplay
-
play( timeInterval ) → Promise<void>
module:engine/dev-utils/operationreplayer~OperationReplayer#play
Applies all operations with a delay between actions.
Parameters
timeInterval : number
Time between applying operations.
Defaults to
1000
Returns
Promise<void>
-
setStringifiedOperations( stringifiedOperations ) → void
module:engine/dev-utils/operationreplayer~OperationReplayer#setStringifiedOperations
Parses the given string containing stringified operations and sets parsed operations as operations to replay.
Parameters
stringifiedOperations : string
Stringified operations to replay.
Returns
void