TreeViewAlpha Interface
TreeView with proposed changes to the schema aware typing to allow use with UnsafeUnknownSchema.
To use, import via fluid-framework/alpha.
For more information about our API support guarantees, see here.
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">, UntypedTreeViewAlpha
Extends: Omit<TreeViewBeta<ReadSchema<TSchema>>, "root" | "initialize" | "fork" | "runTransaction" | "runTransactionAsync">, UntypedTreeViewAlpha
Type Parameters
| Parameter | Constraint | Description |
|---|---|---|
| TSchema | ImplicitFieldSchema | UnsafeUnknownSchema |
Properties
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| events | Alpha | readonly | Listenable<TreeViewEvents & TreeBranchEvents> | |
| root | Alpha | ReadableField<TSchema> |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| fork() | Alpha | ReturnType<UntypedTreeView["fork"]> & TreeViewAlpha<TSchema> | |
| initialize(content) | Alpha | void | Initialize the tree, setting the stored schema to match this view's schema and setting the tree content. |
| isStagedUpgradeEnabled(upgrade) | Alpha | StagedUpgradeStatus | Checks whether a staged schema upgrade has been applied to the document's stored schema. |
Property Details
events
For more information about our API support guarantees, see here.
Signature
readonly events: Listenable<TreeViewEvents & TreeBranchEvents>;
Type: Listenable<TreeViewEvents & TreeBranchEvents>
root
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
For more information about our API support guarantees, see here.
Signature
fork(): ReturnType<UntypedTreeView["fork"]> & TreeViewAlpha<TSchema>;
Returns
Return type: ReturnType<UntypedTreeView["fork"]> & TreeViewAlpha<TSchema>
initialize
Initialize the tree, setting the stored schema to match this view's schema and setting the tree content.
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.
Applications should typically call this function before attaching a SharedTree.
Parameters
| Parameter | Type | Description |
|---|---|---|
| content | InsertableField<TSchema> | The content to initialize the tree with. |
isStagedUpgradeEnabled
Checks whether a staged schema upgrade has been applied to the document's stored schema.
For more information about our API support guarantees, see here.
Signature
isStagedUpgradeEnabled(upgrade: SchemaUpgrade): StagedUpgradeStatus;
Remarks
Use this to determine whether a document has already been upgraded, for example when deciding whether to include an upgrade token in the view configuration after a feature flag rollback.
Results are derived from this view's schema and the current stored schema. The full schema is checked even when the view is incompatible with the stored schema, so the result includes all locations declared by the view schema.
Parameters
| Parameter | Type | Description |
|---|---|---|
| upgrade | SchemaUpgrade | The upgrade token to check. |
Returns
The StagedUpgradeStatus of the upgrade.
Return type: StagedUpgradeStatus