TreeBranchHistory Interface
Provides APIs for querying information about the history of a UntypedTreeViewAlpha.
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 TreeBranchHistory
Remarks
The history of a branch is the sequence of commits leading up to its current state.
Properties
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| length | Alpha | readonly | number | The number of commits in this branch's history. |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| getHead() | Alpha | TreeBranchCommitMetadata | undefined | Returns metadata for the current head commit of this branch. |
Property Details
length
The number of commits in this branch's history.
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.
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