ArrayPlaceAnchor Interface
A location in a TreeArrayNode.
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 interface ArrayPlaceAnchor
Remarks
Tracks a location even as the array is mutated. How this is adjusted for edits depends on the specific anchor being used. See createArrayInsertionAnchor(node, currentIndex) for one way to create such an anchor.
Properties
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| index | Alpha | readonly | number | The current index within the array that this anchor refers to. |
Property Details
index
The current index within the array that this anchor refers to.
For more information about our API support guarantees, see here.
Signature
get index(): number;
Type: number
Remarks
This value is updated as the array is edited in a way that depends on the specific anchor implementation. This index may take on a value from 0 to the length of the array (inclusive). If used as the index to insert content into the array, this means it can point to any location in the array, including just after the last child.