Packages > @fluidframework/tree > TreeConfiguration

TreeConfiguration Class

Configuration for how to schematize a tree.

Signature

export declare class TreeConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema>

Type Parameters

Parameter Constraint Default Description
TSchema ImplicitFieldSchema ImplicitFieldSchema

Constructors

Constructor Description
(constructor)(schema, initialTree) Constructs a new instance of the TreeConfiguration class

Properties

Property Modifiers Type Description
initialTree readonly () => InsertableTreeFieldFromImplicitField<TSchema>
schema readonly TSchema

Constructor Details

(constructor)

Constructs a new instance of the TreeConfiguration class

Signature

constructor(schema: TSchema, initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>);

Parameters

Parameter Type Description
schema TSchema The schema which the application wants to view the tree with.
initialTree () => InsertableTreeFieldFromImplicitField<TSchema> A function that returns the default tree content to initialize the tree with iff the tree is uninitialized (meaning it does not even have any schema set at all). If initialTree returns any actual node instances, they should be recreated each time initialTree runs. This is because if the config is used a second time any nodes that were not recreated could error since nodes cannot be inserted into the tree multiple times.

Property Details

initialTree

Signature

readonly initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>;

schema

Signature

readonly schema: TSchema;