Skip to main content

TreeArrayNodeAlpha Interface

TreeArrayNode with additional alpha APIs.

This API is provided as an alpha preview and may change without notice.

To use, import via fluid-framework/alpha.

For more information about our API support guarantees, see here.

Sealed

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 TreeArrayNodeAlpha<TAllowedTypes extends System_Unsafe.ImplicitAllowedTypesUnsafe = ImplicitAllowedTypes, out T = [TAllowedTypes] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TAllowedTypes> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, in TNew = [TAllowedTypes] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes> : InsertableTreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>> extends TreeArrayNode<TAllowedTypes, T, TNew>

Extends: TreeArrayNode<TAllowedTypes, T, TNew>

Type Parameters

ParameterConstraintDefaultDescription
TAllowedTypesSystem_Unsafe.ImplicitAllowedTypesUnsafeImplicitAllowedTypes
T[TAllowedTypes] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TAllowedTypes> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>
TNew[TAllowedTypes] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes> : InsertableTreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>

Methods

MethodAlertsReturn TypeDescription
splice(start, deleteCount, items)AlphaT[]Removes existing item(s) and/or adds new item(s).

Method Details

splice

Removes existing item(s) and/or adds new item(s).

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

splice(start: number, deleteCount?: number, ...items: readonly (TNew | IterableTreeArrayContent<TNew>)[]): T[];

Parameters

ParameterModifiersTypeDescription
startnumberThe index at which to start changing the array. If negative, it is treated as array.length + start. Must be a positive in bounds index or a negative index such that array.length + start is a positive in bounds index.
deleteCountoptionalnumberThe number of item(s) to remove. If not provided, it defaults to the end of the array. Must be a non-negative integer no greater than the number of items from start to the end of the array.
itemsreadonly (TNew | IterableTreeArrayContent<TNew>)[]The item(s) to insert at start.

Returns

An array containing the item(s) that were removed.

Return type: T[]