Skip to main content

TreeBranchHistory Interface

Provides APIs for querying information about the history of a UntypedTreeViewAlpha.

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 TreeBranchHistory

Remarks

The history of a branch is the sequence of commits leading up to its current state.

Properties

PropertyAlertsModifiersTypeDescription
lengthAlphareadonlynumberThe number of commits in this branch's history.

Methods

MethodAlertsReturn TypeDescription
getHead()AlphaTreeBranchCommitMetadata | undefinedReturns metadata for the current head commit of this branch.

Property Details

length

The number of commits in this branch's history.

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 length: number;

Type: number

Remarks

This number grows when any of the following occurs: - A new edit is made on this branch (either through editing or by reverting an existing commit on this branch). - A branch that contains commits not already on this branch is merged into this branch. - The branch is rebased onto another branch that contains commits not already on this branch. This number shrinks when past commits are trimmed from the history.

Method Details

getHead

Returns metadata for the current head commit of this branch.

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

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

Signature

getHead(): TreeBranchCommitMetadata | undefined;

Returns

The metadata for the head commit, or undefined if the branch has no commits.

Return type: TreeBranchCommitMetadata | undefined