ArrayNodeDeltaOp TypeAlias
A single operation in an array node change delta. Used to efficiently sync an external representation of an array (e.g. a text editor or virtual list) with tree changes without needing to snapshot the old state or diff the entire array. Each op describes a contiguous run of positions in the array before the change. For inserts, read the new element values from the current tree at those positions.
To use, import via fluid-framework/alpha.
For more information about our API support guarantees, see here.
This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.
Signature
/** @sealed */
export type ArrayNodeDeltaOp = ArrayNodeRetainOp | ArrayNodeInsertOp | ArrayNodeRemoveOp;
Remarks
There is no dedicated "move" op. Moves are represented as "remove" + "insert". When an element is moved within the same array it appears as a "remove" at the source position followed by an "insert" at the destination position. When an element is moved across two different arrays, the source array's delta contains a "remove" and the destination array's delta contains an "insert" — they cannot be correlated without additional bookkeeping on the caller's side.