ISequenceDeltaRange Interface
A range that has changed corresponding to a segment modification.
To use, import via @fluidframework/sequence/legacy
.
For more information about our API support guarantees, see here.
Signature
export interface ISequenceDeltaRange<TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes>
Type Parameters
Parameter | Constraint | Default | Description |
---|---|---|---|
TOperation | MergeTreeDeltaOperationTypes | MergeTreeDeltaOperationTypes |
Properties
Property | Alerts | Type | Description |
---|---|---|---|
operation | Alpha |
TOperation | The type of operation that changed this range. |
position | Alpha |
number | The index of the start of the range. |
propertyDeltas | Alpha |
PropertySet | Deltas object which contains all modified properties with their previous values. Since undefined doesn't survive a round-trip through JSON serialization, the old value being absent is instead encoded with null . |
segment | Alpha |
ISegment | The segment that corresponds to the range. |
Property Details
operation
The type of operation that changed this range.
To use, import via @fluidframework/sequence/alpha
.
For more information about our API support guarantees, see here.
Signature
operation: TOperation;
Type: TOperation
Remarks
Consuming code should typically compare this to the enum values defined in MergeTreeDeltaOperationTypes
.
position
The index of the start of the range.
To use, import via @fluidframework/sequence/alpha
.
For more information about our API support guarantees, see here.
Signature
position: number;
Type: number
propertyDeltas
Deltas object which contains all modified properties with their previous values. Since undefined
doesn't survive a round-trip through JSON serialization, the old value being absent is instead encoded with null
.
To use, import via @fluidframework/sequence/alpha
.
For more information about our API support guarantees, see here.
Signature
propertyDeltas: PropertySet;
Type: PropertySet
Remarks
This object is motivated by undo/redo scenarios, and provides a convenient "inverse op" to apply to undo a property change.
Example
If a segment initially had properties { foo: "1", bar: 2 }
and it was annotated with { foo: 3, baz: 5 }
, the corresponding event would have a propertyDeltas
of { foo: "1", baz: null }
.
segment
The segment that corresponds to the range.
To use, import via @fluidframework/sequence/alpha
.
For more information about our API support guarantees, see here.
Signature
segment: ISegment;
Type: ISegment