Report an issue
Class

AttributeDelta (engine/model/delta)

@ckeditor/ckeditor5-engine/src/model/delta/attributedelta

class

To provide specific OT behavior and better collisions solving, methods to change attributes (setAttribute and removeAttribute) use AttributeDelta 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
  • batch : Batch

    readonly inherited

    Batch which delta is a part of. This property is null by default and set by the addDelta method.

  • key : String | null

    readonly

    The attribute key that is changed by the delta or null if the delta has no operations.

  • operations : Array.<Operation>

    readonly inherited

    Array of operations which compose delta.

  • range : Range | null

    readonly

    The range on which delta operates or null if the delta has no operations.

  • type : String

    readonly inherited

    Delta type.

    Overrides: Delta#type
  • value : * | null

    readonly

    The attribute value that is set by the delta or null if the delta has no operations.

  • _reverseDeltaClass : function

    private inherited

    A class that will be used when creating reversed delta.

Static properties

  • className : String

    readonly inherited static

    Delta class name. Used by toJSON method for serialization and fromJSON during deserialization.

Methods

  • constructor()

    inherited

    Creates a delta instance.

  • addOperation( operation )

    inherited

    Add operation to the delta.

    Parameters

    operation : Operation

    Operation instance.

  • clone() → Delta

    inherited

    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.

    Keep in mind that tree model state may change since executing the original delta, so reverse delta may be "outdated". In that case you will need to transform it by all deltas that were executed after the original delta.

    Returns

    Delta

    Reversed delta.

  • toJSON() → Object

    inherited

    Custom toJSON method to make deltas serializable.

    Returns

    Object

    Clone of this delta with added class name.

    Overrides: Delta#toJSON