MoveDelta (engine/model/delta)
@ckeditor/ckeditor5-engine/src/model/delta/movedelta
To provide specific OT behavior and better collisions solving, move
method
uses the MoveDelta
class which inherits from the Delta
class and may overwrite some methods.
Filtering
Properties
-
baseVersion : Number | null
inherited
Returns delta base version which is equal to the base version of the first operation in delta. If there are no operations in delta, returns
null
.Overrides: Delta#baseVersion -
howMany : Number | null
Offset size of moved range or
null
if there are no operations in the delta. -
operations : Array.<Operation>
readonly inherited
Array of operations which compose delta.
-
sourcePosition : Position | null
Move operation source position or
null
if there are no operations in the delta. -
targetPosition : Position | null
Move operation target position or
null
if there are no operations in the delta. -
type : String
readonly inherited
Delta type.
Overrides: Delta#type -
_moveOperation : MoveOperation | null
protected
Move operation that is saved in this delta or
null
if there are no operations in the delta. -
_reverseDeltaClass : function
private inherited
A class that will be used when creating reversed delta.
Overrides: Delta#_reverseDeltaClass
Static properties
-
className : String
readonly inherited static
Methods
-
constructor()
inherited
Creates a delta instance.
-
addOperation( operation )
inherited
Add operation to the delta.
Parameters
operation : Operation
Operation instance.
-
Creates and returns a delta that has the same parameters as this delta.
Returns
Delta
Clone of this delta.
-
getReversed() → Delta
inherited
Creates and returns a reverse delta. Reverse delta when executed right after the original delta will bring back tree model state to the point before the original delta execution. In other words, it reverses changes done by the original delta.
-
toJSON() → Object
inherited
Custom toJSON method to make deltas serializable.
Returns
Object
Clone of this delta with added class name.