Skip to main content

TreeRecordNode Interface

A TreeNode which models a TypeScript record.

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

To use, import via @fluidframework/tree/alpha.

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

Signature

export interface TreeRecordNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends TreeNode, Record<string, TreeNodeFromImplicitAllowedTypes<TAllowedTypes>>

Extends: TreeNode, Record<string, TreeNodeFromImplicitAllowedTypes<TAllowedTypes>>

Type Parameters

Parameter Constraint Default Description
TAllowedTypes ImplicitAllowedTypes ImplicitAllowedTypes

Remarks

Due to https://github.com/microsoft/TypeScript/issues/43826, we can't enable implicit construction of TreeNodes for setters. Therefore code assigning to these fields must explicitly construct nodes using the schema's constructor or create method, or using some other method like create(schema, data).

Methods

Method Alerts Return Type Description
[Symbol.iterator]() Alpha IterableIterator<[ string, TreeNodeFromImplicitAllowedTypes<TAllowedTypes> ]> Allows the record's entries to be iterated over, including in contexts like for...of loops.

Method Details

[Symbol.iterator]

Allows the record's entries to be iterated over, including in contexts like for...of loops.

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

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

Signature
[Symbol.iterator](): IterableIterator<[
string,
TreeNodeFromImplicitAllowedTypes<TAllowedTypes>
]>;

Returns

Return type: IterableIterator<[ string, TreeNodeFromImplicitAllowedTypes<TAllowedTypes> ]>