Packages > @fluidframework/tree > ITree

ITree Interface

Channel for a Fluid Tree DDS.

Signature

export interface ITree extends IChannel

Extends: IChannel

Remarks

Allows storing and collaboratively editing schema-aware hierarchial data.

Methods

Method Return Type Description
schematize(config) TreeView<TRoot> Returns a TreeView using the provided schema. If the tree's stored schema is compatible, this will provide a schema-aware API for accessing the tree's content. If the provided schema is incompatible with the stored data, the view will instead expose an error indicating the incompatibility.

Method Details

schematize

Returns a TreeView using the provided schema. If the tree’s stored schema is compatible, this will provide a schema-aware API for accessing the tree’s content. If the provided schema is incompatible with the stored data, the view will instead expose an error indicating the incompatibility.

Signature

schematize<TRoot extends ImplicitFieldSchema>(config: TreeConfiguration<TRoot>): TreeView<TRoot>;
Type Parameters
Parameter Constraint Description
TRoot ImplicitFieldSchema

Remarks

If the tree is uninitialized (has no schema and no content), the tree is initialized with the initialTree and view schema in the provided config.

The tree (now known to have been initialized) has its stored schema checked against the provided view schema.

If the schemas are compatible, the returned TreeView will expose the root with a schema-aware API based on the provided view schema.

If the schemas are not compatible, the view will indicate the error.

Note that other clients can modify the document at any time, causing the view to enter or leave this error state: see events for how to handle invalidation in these cases.

Only one schematized view may exist for a given ITree at a time. If creating a second, the first must be disposed before calling schematize again.

Parameters

Parameter Type Description
config TreeConfiguration<TRoot>

Returns

Return type: TreeView <TRoot>