Packages > fluid-framework > 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, options) Constructs a new instance of the TreeConfiguration class

Properties

Property Modifiers Type Description
initialTree readonly () => InsertableTreeFieldFromImplicitField<TSchema>
options readonly Required<ITreeConfigurationOptions> Additional options that can be specified when schematizing a tree.
schema readonly TSchema

Constructor Details

(constructor)

Constructs a new instance of the TreeConfiguration class

Signature

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

Parameters

Parameter Modifiers 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.
options optional ITreeConfigurationOptions Additional options that can be specified when schematizing a tree.

Property Details

initialTree

Signature

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

Type: () => InsertableTreeFieldFromImplicitField <TSchema>

options

Additional options that can be specified when schematizing a tree.

Signature

readonly options: Required<ITreeConfigurationOptions>;

Type: Required<ITreeConfigurationOptions >

schema

Signature

readonly schema: TSchema;

Type: TSchema