-
Notifications
You must be signed in to change notification settings - Fork 561
Add serializable SharedTree change #25992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
7d9f0de
38cfdf7
a08032b
998d7fb
a19ece1
45d1039
a38d77a
edada8e
a2303cc
3b6b181
aa01747
9fae48b
96006be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ import type { IFluidLoadable, IDisposable, Listenable } from "@fluidframework/co | |
|
|
||
| import type { | ||
| CommitMetadata, | ||
| ChangeMetadata, | ||
| RevertibleAlphaFactory, | ||
| RevertibleFactory, | ||
| } from "../../core/index.js"; | ||
|
|
@@ -35,6 +36,7 @@ import type { | |
| VoidTransactionCallbackStatus, | ||
| } from "./transactionTypes.js"; | ||
| import type { VerboseTree } from "./verboseTree.js"; | ||
| import type { JsonCompatibleReadOnly } from "../../util/index.js"; | ||
|
|
||
| /** | ||
| * A tree from which a {@link TreeView} can be created. | ||
|
|
@@ -282,6 +284,15 @@ export interface TreeBranchAlpha extends TreeBranch { | |
| transaction: () => VoidTransactionCallbackStatus | void, | ||
| params?: RunTransactionParams, | ||
| ): TransactionResult; | ||
|
|
||
| /** | ||
| * Apply a serialized change to this branch. | ||
| * @param change - the change to apply. | ||
| * Changes are acquired via `getChange` in a branch's {@link TreeBranchEvents.changed | "changed"} event. | ||
| * @remarks Changes may only be applied to a SharedTree with the same IdCompressor session ID and the same branch state from which they were generated. | ||
|
||
| * They may be created by one branch and applied to another, but only if both branches share the same history at the time of creation and application. | ||
| */ | ||
| applyChange(change: JsonCompatibleReadOnly): void; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -508,7 +519,7 @@ export interface TreeBranchEvents extends Omit<TreeViewEvents, "commitApplied"> | |
| * @param getRevertible - a function that allows users to get a revertible for the change. If not provided, | ||
| * this change is not revertible. | ||
| */ | ||
| changed(data: CommitMetadata, getRevertible?: RevertibleAlphaFactory): void; | ||
| changed(data: ChangeMetadata, getRevertible?: RevertibleAlphaFactory): void; | ||
|
|
||
| /** | ||
| * Fired when: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.