Skip to main content
Version: v2

ITreeAlpha Interface

ITree extended with some alpha APIs.

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

To use, import via fluid-framework/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 ITreeAlpha extends ITree

Extends: ITree

Methods​

MethodAlertsReturn TypeDescription
createSharedBranch(name)AlphastringCreates a fork of the current state of the main branch. This new branch will be shared with and editable by all clients.
exportSimpleSchema()AlphaSimpleTreeSchemaExports the SimpleTreeSchema that is stored in the tree, using stored keys for object fields.
exportVerbose()AlphaVerboseTree | undefinedExports root in the same format as exportVerbose(node, options) using stored keys.
getSharedBranchIds()Alphastring[]Returns a list of all shared branches that currently exist on this tree. Any one of them can be checked out using viewSharedBranchWith(branchId, config).
getSharedBranchName(branchId)Alphastring | undefinedRetrieves the name, if any, of the shared branch with the given ID.
viewSharedBranchWith(branchId, config)AlphaTreeView<TRoot>Returns a view of the tree on the specified shared branch, using the provided schema. See viewWith(config).

Method Details​

createSharedBranch​

Creates a fork of the current state of the main branch. This new branch will be shared with and editable by all clients.

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

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

Signature​

createSharedBranch(name?: string): string;

Parameters​

ParameterModifiersTypeDescription
nameoptionalstringOptional name for the new branch. This name is not guaranteed to be unique. (Maximum length: 1024)

Returns​

The ID of the new branch, which can be used to view the branch.

Return type: string

exportSimpleSchema​

Exports the SimpleTreeSchema that is stored in the tree, using stored keys for object fields.

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

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

Signature​

exportSimpleSchema(): SimpleTreeSchema;

Remarks​

To get the schema using property keys, use getSimpleSchema(schema) on the view schema.

Returns​

Return type: SimpleTreeSchema

exportVerbose​

Exports root in the same format as exportVerbose(node, options) using stored keys.

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

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

Signature​

exportVerbose(): VerboseTree | undefined;

Remarks​

This is undefined if and only if the root field is empty (this can only happen if the root field is optional).

Returns​

Return type: VerboseTree | undefined

getSharedBranchIds​

Returns a list of all shared branches that currently exist on this tree. Any one of them can be checked out using viewSharedBranchWith(branchId, config).

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

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

Signature​

getSharedBranchIds(): string[];

Returns​

Return type: string[]

getSharedBranchName​

Retrieves the name, if any, of the shared branch with the given ID.

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

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

Signature​

getSharedBranchName(branchId: string): string | undefined;

Parameters​

ParameterTypeDescription
branchIdstringThe ID of the shared branch to retrieve the name of.

Returns​

The name of the shared branch, or undefined if the branch has no assigned name.

Return type: string | undefined

Error Handling​

if the branch with the given ID does not exist.

viewSharedBranchWith​

Returns a view of the tree on the specified shared branch, using the provided schema. See viewWith(config).

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

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

Signature​

viewSharedBranchWith<TRoot extends ImplicitFieldSchema>(branchId: string, config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
Type Parameters​
ParameterConstraintDescription
TRootImplicitFieldSchema

Parameters​

ParameterTypeDescription
branchIdstring
configTreeViewConfiguration<TRoot>

Returns​

Return type: TreeView<TRoot>