Skip to main content

TreeViewAlpha Interface

TreeView with proposed changes to the schema aware typing to allow use with UnsafeUnknownSchema.

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.

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 TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> extends Omit<TreeViewBeta<ReadSchema<TSchema>>, "root" | "initialize" | "fork" | "runTransaction" | "runTransactionAsync">, TreeBranchAlpha

Extends: Omit<TreeViewBeta<ReadSchema<TSchema>>, "root" | "initialize" | "fork" | "runTransaction" | "runTransactionAsync">, TreeBranchAlpha

Type Parameters

ParameterConstraintDescription
TSchemaImplicitFieldSchema | UnsafeUnknownSchema

Properties

PropertyAlertsModifiersTypeDescription
eventsAlphareadonlyListenable<TreeViewEvents & TreeBranchEvents>
rootAlphaReadableField<TSchema>

Methods

MethodAlertsReturn TypeDescription
fork()AlphaReturnType<TreeBranch["fork"]> & TreeViewAlpha<TSchema>
initialize(content)AlphavoidInitialize the tree, setting the stored schema to match this view's schema and setting the tree content.

Property Details

events

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

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

Signature

readonly events: Listenable<TreeViewEvents & TreeBranchEvents>;

Type: Listenable<TreeViewEvents & TreeBranchEvents>

root

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

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

Signature

get root(): ReadableField<TSchema>;

set root(newRoot: InsertableField<TSchema>);

Type: ReadableField<TSchema>

Method Details

fork

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

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

Signature

fork(): ReturnType<TreeBranch["fork"]> & TreeViewAlpha<TSchema>;

Returns

Return type: ReturnType<TreeBranch["fork"]> & TreeViewAlpha<TSchema>

initialize

Initialize the tree, setting the stored schema to match this view's schema and setting the tree content.

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

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

Signature

initialize(content: InsertableField<TSchema>): void;

Remarks

Only valid to call when this view's canInitialize is true.

Enables staged schema upgrades declared by stagedUpgradePolicy when generating the initial stored schema. Once a staged schema upgrade has been enabled in a document's stored schema, loading that document with a view that does not include equivalent staged members in its construction-time policy will cause a subsequent upgradeSchema call to throw a UsageError because the stored schema already contains the upgraded members and the new target would narrow it.

Applications should typically call this function before attaching a SharedTree.

Parameters

ParameterTypeDescription
contentInsertableField<TSchema>The content to initialize the tree with.