fluid-framework 2.81.1 → 2.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +168 -0
- package/api-report/fluid-framework.alpha.api.md +79 -43
- package/api-report/fluid-framework.beta.api.md +164 -3
- package/api-report/fluid-framework.legacy.beta.api.md +164 -3
- package/api-report/fluid-framework.legacy.public.api.md +2 -1
- package/api-report/fluid-framework.public.api.md +2 -1
- package/dist/alpha.d.ts +10 -4
- package/dist/beta.d.ts +4 -0
- package/dist/legacy.d.ts +4 -0
- package/eslint.config.mts +1 -12
- package/lib/alpha.d.ts +10 -4
- package/lib/beta.d.ts +4 -0
- package/lib/legacy.d.ts +4 -0
- package/package.json +14 -14
- package/api-extractor-lint.json +0 -4
- package/biome.jsonc +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,173 @@
|
|
|
1
1
|
# fluid-framework
|
|
2
2
|
|
|
3
|
+
## 2.83.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Fix false positive error from FormatValidator ([#26372](https://github.com/microsoft/FluidFramework/pull/26372)) [adad917d30](https://github.com/microsoft/FluidFramework/commit/adad917d30e251f4bfd510e7a1ebc4a73bd1f7ee)
|
|
8
|
+
|
|
9
|
+
Users of the alpha API [FormatValidatorBasic](https://fluidframework.com/docs/api/fluid-framework/#formatvalidatorbasic-variable)
|
|
10
|
+
could hit an "Invalid JSON." error when parsing data.
|
|
11
|
+
This would occur where the result of evaluating "[MinimumVersionForCollab](https://fluidframework.com/docs/api/runtime-definitions/minimumversionforcollab-typealias) \< 2.74.0"
|
|
12
|
+
differed between the client encoding the data and the client decoding it.
|
|
13
|
+
For example opening an old document with a new client that sets `MinimumVersionForCollab = 2.74.0` would throw this error.
|
|
14
|
+
This has been fixed: this case will no longer throw.
|
|
15
|
+
|
|
16
|
+
- New beta ExtensibleUnionNode API ([#26438](https://github.com/microsoft/FluidFramework/pull/26438)) [05f716ffb5](https://github.com/microsoft/FluidFramework/commit/05f716ffb56e280624e65853dd9291411ee752ff)
|
|
17
|
+
|
|
18
|
+
The new `ExtensibleUnionNode` API allows for creation of unions which can tolerate future additions not yet known to the current code.
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
const sf = new SchemaFactoryBeta("extensibleUnionNodeExample.items");
|
|
22
|
+
class ItemA extends sf.object("A", { x: sf.string }) {}
|
|
23
|
+
class ItemB extends sf.object("B", { x: sf.number }) {}
|
|
24
|
+
|
|
25
|
+
class AnyItem extends ExtensibleUnionNode.createSchema(
|
|
26
|
+
[ItemA, ItemB], // Future versions may add more members here
|
|
27
|
+
sf,
|
|
28
|
+
"ExtensibleUnion",
|
|
29
|
+
) {}
|
|
30
|
+
// Instances of the union are created using `create`.
|
|
31
|
+
const anyItem = AnyItem.create(new ItemA({ x: "hello" }));
|
|
32
|
+
// Reading the content from the union is done via the `union` property,
|
|
33
|
+
// which can be `undefined` to handle the case where a future version of this schema allows a type unknown to the current version.
|
|
34
|
+
const childNode: ItemA | ItemB | undefined = anyItem.union;
|
|
35
|
+
// To determine which member of the union was present, its schema can be inspected:
|
|
36
|
+
const aSchema = Tree.schema(childNode ?? assert.fail("No child"));
|
|
37
|
+
assert.equal(aSchema, ItemA);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- Improve error messages when failing to construct nodes ([#26433](https://github.com/microsoft/FluidFramework/pull/26433)) [8c612c6f2b](https://github.com/microsoft/FluidFramework/commit/8c612c6f2bc04a1fc1cdc54e620c2180eb73b107)
|
|
41
|
+
|
|
42
|
+
The error messages when constructing tree nodes have been improved.
|
|
43
|
+
Several cases now list not only the schema identifiers, but also schema names which can help when there are identifier collisions and make it easier to find the implementations.
|
|
44
|
+
Additionally some cases which did not include what schema were encountered and which were allowed now include both.
|
|
45
|
+
|
|
46
|
+
## 2.82.0
|
|
47
|
+
|
|
48
|
+
### Minor Changes
|
|
49
|
+
|
|
50
|
+
- Promote MinimumVersionForCollab to beta ([#26342](https://github.com/microsoft/FluidFramework/pull/26342)) [2bb53c5c3f1](https://github.com/microsoft/FluidFramework/commit/2bb53c5c3f1aa9e3232d4a1f1e4a6a32d09248eb)
|
|
51
|
+
|
|
52
|
+
Promotes the [MinimumVersionForCollab](https://fluidframework.com/docs/api/runtime-definitions/minimumversionforcollab-typealias) type to beta, and adds option to [configuredSharedTreeBeta](https://fluidframework.com/docs/api/fluid-framework#configuredsharedtreebeta-function) for specifying it when creating a new `SharedTree`.
|
|
53
|
+
|
|
54
|
+
This allows users to opt into new features and optimizations that are only available when certain minimum version thresholds are guaranteed.
|
|
55
|
+
For more details, see [FluidClientVersion](https://fluidframework.com/docs/api/fluid-framework#fluidclientversion-variable)
|
|
56
|
+
|
|
57
|
+
#### Example usage
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// Configure SharedTree DDS to limit the features it requires of collaborators and future document users to only those available in version `2.80.0` and later, overriding the `MinimumVersionForCollab` provided by the runtime (default: "2.0.0").
|
|
61
|
+
// Edits made to this DDS by this client might cause clients older than the specified version to be unable to open the document and/or error out of collaboration sessions.
|
|
62
|
+
const SharedTree = configuredSharedTreeBeta({
|
|
63
|
+
minVersionForCollab: FluidClientVersion.v2_80,
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
- Add "push" as alias for insertAtEnd on TreeArrayNode ([#26260](https://github.com/microsoft/FluidFramework/pull/26260)) [e2ed71b014d](https://github.com/microsoft/FluidFramework/commit/e2ed71b014d44762e433841cada4667dd501e9c1)
|
|
68
|
+
|
|
69
|
+
Adds `push` as an alias to make the API more intuitive and reduce friction for both `LLM`-generated code and developers familiar with JavaScript array semantics.
|
|
70
|
+
|
|
71
|
+
#### Usage
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { TreeArrayNode } from "@fluidframework/tree";
|
|
75
|
+
|
|
76
|
+
// `inventory` is a TreeArrayNode from your schema.
|
|
77
|
+
inventory.push({ name: "Apples", quantity: 3 });
|
|
78
|
+
|
|
79
|
+
// Insert multiple items in one call.
|
|
80
|
+
inventory.push(
|
|
81
|
+
TreeArrayNode.spread([
|
|
82
|
+
{ name: "Oranges", quantity: 2 },
|
|
83
|
+
{ name: "Bananas", quantity: 5 },
|
|
84
|
+
]),
|
|
85
|
+
);
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
- Promote TableSchema APIs to beta ([#26339](https://github.com/microsoft/FluidFramework/pull/26339)) [36a625a3058](https://github.com/microsoft/FluidFramework/commit/36a625a305878a267d2010ace377ff0d80d3367d)
|
|
89
|
+
|
|
90
|
+
Promotes the `SharedTree` [TableSchema](https://fluidframework.com/docs/api/fluid-framework/tableschema-namespace) from alpha to beta.
|
|
91
|
+
These APIs can now be imported via `@fluidframework/tree/beta`.
|
|
92
|
+
Documents from before this are not supported with the beta version of the schema to ensure orphan cell invariants can be guaranteed.
|
|
93
|
+
|
|
94
|
+
- Fix bug in multi-step move of array elements ([#26344](https://github.com/microsoft/FluidFramework/pull/26344)) [1bca56c3fb2](https://github.com/microsoft/FluidFramework/commit/1bca56c3fb2ade3ad876e8761366053e5295490b)
|
|
95
|
+
|
|
96
|
+
A multi-step move can be authored by moving the same array element multiple times within the scope of a single transaction.
|
|
97
|
+
Such multi-step would lead to errors in the following scenarios:
|
|
98
|
+
- Reverting a multi-step move would fail with error code 0x92a on the peer attempting the revert, thus putting the peer in a broken read-only state without corrupting the document.
|
|
99
|
+
- If the set of pending edits generated by a peer included an edit with a multi-step move, followed by further edits to any of the moved items, reconciling these edits with concurrent edits sequenced earlier could lead to a document corruption with error code 0x9c7.
|
|
100
|
+
|
|
101
|
+
These operations are now safe.
|
|
102
|
+
|
|
103
|
+
- Adds optional "label" parameter to runTransaction for grouping changes ([#25938](https://github.com/microsoft/FluidFramework/pull/25938)) [cca4db29c72](https://github.com/microsoft/FluidFramework/commit/cca4db29c722aca3fbfa5c0b45a852cd8499a17a)
|
|
104
|
+
|
|
105
|
+
Transaction labels can be used to group multiple changes for undo/redo, where groups of changes with the same label can be undone together. When multiple labels are used in nested transactions, only the outermost label will be used.
|
|
106
|
+
|
|
107
|
+
The following example demonstrates how to implement label-based undo/redo grouping. It listens to the `changed` event on the checkout to collect all commits with the same label into a group. When `undoLatestGroup()` is called, all transactions in that group are reverted together with a single operation.
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
interface LabeledGroup {
|
|
111
|
+
label: unknown;
|
|
112
|
+
revertibles: { revert(): void }[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const undoGroups: LabeledGroup[] = [];
|
|
116
|
+
|
|
117
|
+
// The callback on the "changed" event can be used to group the commits.
|
|
118
|
+
view.checkout.events.on("changed", (meta, getRevertible) => {
|
|
119
|
+
// Only process local edits, not remote changes or Undo/Redo operations
|
|
120
|
+
if (getRevertible !== undefined && meta.kind === CommitKind.Default) {
|
|
121
|
+
const label = meta.label;
|
|
122
|
+
const revertible = getRevertible();
|
|
123
|
+
|
|
124
|
+
// Check if the latest group contains the same label.
|
|
125
|
+
const latestGroup = undoGroups[undoGroups.length - 1];
|
|
126
|
+
if (
|
|
127
|
+
label !== undefined &&
|
|
128
|
+
latestGroup !== undefined &&
|
|
129
|
+
label === latestGroup.label
|
|
130
|
+
) {
|
|
131
|
+
latestGroup.revertibles.push(revertible);
|
|
132
|
+
} else {
|
|
133
|
+
undoGroups.push({ label, revertibles: [revertible] });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
const undoLatestGroup = () => {
|
|
139
|
+
const latestGroup =
|
|
140
|
+
undoGroups.pop() ?? fail("There are currently no undo groups.");
|
|
141
|
+
for (const revertible of latestGroup.revertibles.reverse()) {
|
|
142
|
+
revertible.revert();
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
// Group multiple transactions with the same label
|
|
147
|
+
view.runTransaction(
|
|
148
|
+
() => {
|
|
149
|
+
view.root.content = 1;
|
|
150
|
+
},
|
|
151
|
+
{ label: "EditGroup" },
|
|
152
|
+
);
|
|
153
|
+
view.runTransaction(
|
|
154
|
+
() => {
|
|
155
|
+
view.root.content = 2;
|
|
156
|
+
},
|
|
157
|
+
{ label: "EditGroup" },
|
|
158
|
+
);
|
|
159
|
+
view.runTransaction(
|
|
160
|
+
() => {
|
|
161
|
+
view.root.content = 3;
|
|
162
|
+
},
|
|
163
|
+
{ label: "EditGroup" },
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
// This would undo all three transactions together.
|
|
167
|
+
undoLatestGroup();
|
|
168
|
+
// view.root.content is now back to 0 (the initial state).
|
|
169
|
+
```
|
|
170
|
+
|
|
3
171
|
## 2.81.0
|
|
4
172
|
|
|
5
173
|
### Minor Changes
|
|
@@ -114,6 +114,11 @@ export const ArrayNodeSchema: {
|
|
|
114
114
|
readonly [Symbol.hasInstance]: (value: TreeNodeSchema) => value is ArrayNodeSchema;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
+
// @alpha @sealed
|
|
118
|
+
export interface ArrayPlaceAnchor {
|
|
119
|
+
get index(): number;
|
|
120
|
+
}
|
|
121
|
+
|
|
117
122
|
// @alpha
|
|
118
123
|
export function asAlpha<TSchema extends ImplicitFieldSchema>(view: TreeView<TSchema>): TreeViewAlpha<TSchema>;
|
|
119
124
|
|
|
@@ -147,9 +152,6 @@ export type ChangeMetadata = LocalChangeMetadata | RemoteChangeMetadata;
|
|
|
147
152
|
// @alpha
|
|
148
153
|
export function checkCompatibility(viewWhichCreatedStoredSchema: TreeViewConfiguration, view: TreeViewConfiguration): Omit<SchemaCompatibilityStatus, "canInitialize">;
|
|
149
154
|
|
|
150
|
-
// @alpha
|
|
151
|
-
export function checkSchemaCompatibilitySnapshots(options: SchemaCompatibilitySnapshotsOptions): void;
|
|
152
|
-
|
|
153
155
|
// @alpha
|
|
154
156
|
export function cloneWithReplacements(root: unknown, rootKey: string, replacer: (key: string, value: unknown) => {
|
|
155
157
|
clone: boolean;
|
|
@@ -160,12 +162,16 @@ export function cloneWithReplacements(root: unknown, rootKey: string, replacer:
|
|
|
160
162
|
export type CodecName = string;
|
|
161
163
|
|
|
162
164
|
// @alpha @input
|
|
163
|
-
export interface CodecWriteOptions extends ICodecOptions {
|
|
165
|
+
export interface CodecWriteOptions extends ICodecOptions, CodecWriteOptionsBeta {
|
|
164
166
|
readonly allowPossiblyIncompatibleWriteVersionOverrides?: boolean;
|
|
165
|
-
readonly minVersionForCollab: MinimumVersionForCollab;
|
|
166
167
|
readonly writeVersionOverrides?: ReadonlyMap<CodecName, FormatVersion>;
|
|
167
168
|
}
|
|
168
169
|
|
|
170
|
+
// @beta @input
|
|
171
|
+
export interface CodecWriteOptionsBeta {
|
|
172
|
+
readonly minVersionForCollab: MinimumVersionForCollab;
|
|
173
|
+
}
|
|
174
|
+
|
|
169
175
|
// @public
|
|
170
176
|
export enum CommitKind {
|
|
171
177
|
Default = 0,
|
|
@@ -231,19 +237,22 @@ export interface ContainerSchema {
|
|
|
231
237
|
// @alpha
|
|
232
238
|
export const contentSchemaSymbol: unique symbol;
|
|
233
239
|
|
|
240
|
+
// @alpha
|
|
241
|
+
export function createArrayInsertionAnchor(node: TreeArrayNode, currentIndex: number): ArrayPlaceAnchor;
|
|
242
|
+
|
|
234
243
|
// @alpha
|
|
235
244
|
export function createIdentifierIndex<TSchema extends ImplicitFieldSchema>(view: TreeView<TSchema>): IdentifierIndex;
|
|
236
245
|
|
|
237
246
|
// @alpha
|
|
238
|
-
export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSchema>(options?:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
247
|
+
export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSchema>(options?: CreateIndependentTreeAlphaOptions): ViewableTree & Pick<ITreeAlpha, "exportVerbose" | "exportSimpleSchema">;
|
|
248
|
+
|
|
249
|
+
// @alpha
|
|
250
|
+
export type CreateIndependentTreeAlphaOptions = ForestOptions & ((IndependentViewOptions & {
|
|
251
|
+
content?: never;
|
|
242
252
|
}) | (ICodecOptions & {
|
|
243
253
|
content: ViewContent;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}))): ViewableTree & Pick<ITreeAlpha, "exportVerbose" | "exportSimpleSchema">;
|
|
254
|
+
idCompressor?: never;
|
|
255
|
+
}));
|
|
247
256
|
|
|
248
257
|
// @beta
|
|
249
258
|
export function createIndependentTreeBeta<const TSchema extends ImplicitFieldSchema>(options?: ForestOptions): ViewableTree;
|
|
@@ -316,6 +325,18 @@ export function evaluateLazySchema<T extends TreeNodeSchema>(value: LazyItem<T>)
|
|
|
316
325
|
// @alpha
|
|
317
326
|
export function exportCompatibilitySchemaSnapshot(config: Pick<TreeViewConfiguration, "schema">): JsonCompatibleReadOnly;
|
|
318
327
|
|
|
328
|
+
// @beta
|
|
329
|
+
export namespace ExtensibleUnionNode {
|
|
330
|
+
export function createSchema<const T extends readonly TreeNodeSchema[], const TScope extends string, const TName extends string>(types: T, inputSchemaFactory: SchemaFactoryBeta<TScope>, name: TName): Statics<T> & TreeNodeSchemaCore_2<ScopedSchemaName_2<`com.fluidframework.extensibleUnionNode<${TScope}>`, TName>, NodeKind_2, false, unknown, never, unknown> & (new (data: InternalTreeNode_2) => Members<TreeNodeFromImplicitAllowedTypes<T>> & TreeNode_2 & WithType_2<ScopedSchemaName_2<`com.fluidframework.extensibleUnionNode<${TScope}>`, TName>, NodeKind_2, unknown>);
|
|
331
|
+
export interface Members<T> {
|
|
332
|
+
isValid(): boolean;
|
|
333
|
+
readonly union: T | undefined;
|
|
334
|
+
}
|
|
335
|
+
export interface Statics<T extends readonly TreeNodeSchema[]> {
|
|
336
|
+
create<TThis extends TreeNodeSchema>(this: TThis, child: TreeNodeFromImplicitAllowedTypes<T>): TreeFieldFromImplicitField<TThis>;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
319
340
|
// @public @system
|
|
320
341
|
type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result ? Result : Item;
|
|
321
342
|
|
|
@@ -779,9 +800,12 @@ export const incrementalSummaryHint: unique symbol;
|
|
|
779
800
|
export function independentInitializedView<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options: ForestOptions & ICodecOptions, content: ViewContent): TreeViewAlpha<TSchema>;
|
|
780
801
|
|
|
781
802
|
// @alpha
|
|
782
|
-
export function independentView<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options?:
|
|
783
|
-
|
|
784
|
-
|
|
803
|
+
export function independentView<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options?: IndependentViewOptions): TreeViewAlpha<TSchema>;
|
|
804
|
+
|
|
805
|
+
// @alpha @input
|
|
806
|
+
export interface IndependentViewOptions extends ForestOptions, Partial<CodecWriteOptions> {
|
|
807
|
+
idCompressor?: IIdCompressor | undefined;
|
|
808
|
+
}
|
|
785
809
|
|
|
786
810
|
// @public
|
|
787
811
|
export type InitialObjects<T extends ContainerSchema> = {
|
|
@@ -1059,6 +1083,7 @@ export interface LocalChangeMetadata extends CommitMetadata {
|
|
|
1059
1083
|
getChange(): JsonCompatibleReadOnly;
|
|
1060
1084
|
getRevertible(onDisposed?: (revertible: RevertibleAlpha) => void): RevertibleAlpha | undefined;
|
|
1061
1085
|
readonly isLocal: true;
|
|
1086
|
+
readonly label?: unknown;
|
|
1062
1087
|
}
|
|
1063
1088
|
|
|
1064
1089
|
// @public @sealed
|
|
@@ -1239,6 +1264,7 @@ export interface RemoteChangeMetadata extends CommitMetadata {
|
|
|
1239
1264
|
readonly getChange?: undefined;
|
|
1240
1265
|
readonly getRevertible?: undefined;
|
|
1241
1266
|
readonly isLocal: false;
|
|
1267
|
+
readonly label?: undefined;
|
|
1242
1268
|
}
|
|
1243
1269
|
|
|
1244
1270
|
// @alpha
|
|
@@ -1314,20 +1340,10 @@ export interface RunTransaction {
|
|
|
1314
1340
|
|
|
1315
1341
|
// @alpha @input
|
|
1316
1342
|
export interface RunTransactionParams {
|
|
1343
|
+
readonly label?: unknown;
|
|
1317
1344
|
readonly preconditions?: readonly TransactionConstraintAlpha[];
|
|
1318
1345
|
}
|
|
1319
1346
|
|
|
1320
|
-
// @alpha @input
|
|
1321
|
-
export interface SchemaCompatibilitySnapshotsOptions {
|
|
1322
|
-
readonly fileSystem: SnapshotFileSystem;
|
|
1323
|
-
readonly minVersionForCollaboration: string;
|
|
1324
|
-
readonly mode: "test" | "update";
|
|
1325
|
-
readonly schema: TreeViewConfiguration;
|
|
1326
|
-
readonly snapshotDirectory: string;
|
|
1327
|
-
readonly snapshotUnchangedVersions?: true;
|
|
1328
|
-
readonly version: string;
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
1347
|
// @public @sealed
|
|
1332
1348
|
export interface SchemaCompatibilityStatus {
|
|
1333
1349
|
readonly canInitialize: boolean;
|
|
@@ -1477,7 +1493,7 @@ export interface SharedTreeOptions extends SharedTreeOptionsBeta, Partial<CodecW
|
|
|
1477
1493
|
}
|
|
1478
1494
|
|
|
1479
1495
|
// @beta @input
|
|
1480
|
-
export type SharedTreeOptionsBeta = ForestOptions
|
|
1496
|
+
export type SharedTreeOptionsBeta = ForestOptions & Partial<CodecWriteOptionsBeta>;
|
|
1481
1497
|
|
|
1482
1498
|
// @alpha @sealed
|
|
1483
1499
|
export interface SimpleAllowedTypeAttributes<out Type extends SchemaType = SchemaType> {
|
|
@@ -1572,14 +1588,31 @@ export interface SnapshotFileSystem {
|
|
|
1572
1588
|
}): void;
|
|
1573
1589
|
}
|
|
1574
1590
|
|
|
1575
|
-
// @alpha
|
|
1591
|
+
// @alpha
|
|
1592
|
+
export function snapshotSchemaCompatibility(options: SnapshotSchemaCompatibilityOptions): void;
|
|
1593
|
+
|
|
1594
|
+
// @alpha @input
|
|
1595
|
+
export interface SnapshotSchemaCompatibilityOptions {
|
|
1596
|
+
readonly fileSystem: SnapshotFileSystem;
|
|
1597
|
+
readonly minVersionForCollaboration: string;
|
|
1598
|
+
readonly mode: "assert" | "update";
|
|
1599
|
+
readonly rejectSchemaChangesWithNoVersionChange?: true;
|
|
1600
|
+
readonly rejectVersionsWithNoSchemaChange?: true;
|
|
1601
|
+
readonly schema: TreeViewConfiguration;
|
|
1602
|
+
readonly snapshotDirectory: string;
|
|
1603
|
+
readonly snapshotUnchangedVersions?: true;
|
|
1604
|
+
readonly version: string;
|
|
1605
|
+
readonly versionComparer?: (a: string, b: string) => number;
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
// @beta @system
|
|
1576
1609
|
export namespace System_TableSchema {
|
|
1577
1610
|
// @sealed @system
|
|
1578
1611
|
export type ColumnSchemaBase<TUserScope extends string = string, TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes, TPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema> = ReturnType<typeof createColumnSchema<TUserScope, TCellSchema, TPropsSchema>>;
|
|
1579
1612
|
// @system
|
|
1580
1613
|
export type CreateColumnOptionsBase<TUserScope extends string = string, TSchemaFactory extends SchemaFactoryBeta<TUserScope> = SchemaFactoryBeta<TUserScope>, TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCellSchema>;
|
|
1581
1614
|
// @system
|
|
1582
|
-
export function createColumnSchema<const TUserScope extends string, const TCellSchema extends ImplicitAllowedTypes, const TPropsSchema extends ImplicitFieldSchema>(inputSchemaFactory: SchemaFactoryBeta<TUserScope>, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.
|
|
1615
|
+
export function createColumnSchema<const TUserScope extends string, const TCellSchema extends ImplicitAllowedTypes, const TPropsSchema extends ImplicitFieldSchema>(inputSchemaFactory: SchemaFactoryBeta<TUserScope>, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Column">, NodeKind.Object, TreeNode & TableSchema.Column<TCellSchema, TPropsSchema> & WithType<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Column">, NodeKind, unknown>, object & {
|
|
1583
1616
|
readonly id?: string | undefined;
|
|
1584
1617
|
} & (FieldHasDefault<TPropsSchema> extends true ? {
|
|
1585
1618
|
props?: InsertableTreeFieldFromImplicitField<TPropsSchema> | undefined;
|
|
@@ -1591,10 +1624,10 @@ export namespace System_TableSchema {
|
|
|
1591
1624
|
}>;
|
|
1592
1625
|
// @system
|
|
1593
1626
|
export type CreateRowOptionsBase<TUserScope extends string = string, TSchemaFactory extends SchemaFactoryBeta<TUserScope> = SchemaFactoryBeta<TUserScope>, TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCellSchema>;
|
|
1594
|
-
// @
|
|
1595
|
-
export function createRowSchema<const TUserScope extends string, const TCellSchema extends ImplicitAllowedTypes, const TPropsSchema extends ImplicitFieldSchema>(inputSchemaFactory: SchemaFactoryBeta<TUserScope>, cellSchema: TCellSchema, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.
|
|
1627
|
+
// @system
|
|
1628
|
+
export function createRowSchema<const TUserScope extends string, const TCellSchema extends ImplicitAllowedTypes, const TPropsSchema extends ImplicitFieldSchema>(inputSchemaFactory: SchemaFactoryBeta<TUserScope>, cellSchema: TCellSchema, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Row">, NodeKind.Object, TreeNode & TableSchema.Row<TCellSchema, TPropsSchema> & WithType<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Row">, NodeKind, unknown>, object & {
|
|
1596
1629
|
readonly id?: string | undefined;
|
|
1597
|
-
readonly cells: (InsertableTypedNode_2<TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.
|
|
1630
|
+
readonly cells: (InsertableTypedNode_2<TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Row.cells">, NodeKind.Record, TreeRecordNode<TCellSchema> & WithType<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Row.cells">, NodeKind.Record, unknown>, RecordNodeInsertableData_2<TCellSchema>, true, TCellSchema, undefined, unknown>> | undefined) & InsertableTypedNode_2<TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Row.cells">, NodeKind.Record, TreeRecordNode<TCellSchema> & WithType<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Row.cells">, NodeKind.Record, unknown>, RecordNodeInsertableData_2<TCellSchema>, true, TCellSchema, undefined, unknown>>;
|
|
1598
1631
|
} & (FieldHasDefault<TPropsSchema> extends true ? {
|
|
1599
1632
|
props?: InsertableTreeFieldFromImplicitField<TPropsSchema> | undefined;
|
|
1600
1633
|
} : {
|
|
@@ -1602,12 +1635,12 @@ export namespace System_TableSchema {
|
|
|
1602
1635
|
}), true, {
|
|
1603
1636
|
readonly props: TPropsSchema;
|
|
1604
1637
|
readonly id: FieldSchema_2<FieldKind_2.Identifier, LeafSchema_2<"string", string>, unknown>;
|
|
1605
|
-
readonly cells: FieldSchema_2<FieldKind_2.Required, TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.
|
|
1638
|
+
readonly cells: FieldSchema_2<FieldKind_2.Required, TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Row.cells">, NodeKind.Record, TreeRecordNode<TCellSchema> & WithType<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Row.cells">, NodeKind.Record, unknown>, RecordNodeInsertableData_2<TCellSchema>, true, TCellSchema, undefined, unknown>, unknown>;
|
|
1606
1639
|
}>;
|
|
1607
1640
|
// @system
|
|
1608
1641
|
export function createTableSchema<const TUserScope extends string, const TCellSchema extends ImplicitAllowedTypes, const TColumnSchema extends ColumnSchemaBase<TUserScope, TCellSchema>, const TRowSchema extends RowSchemaBase<TUserScope, TCellSchema>>(inputSchemaFactory: SchemaFactoryBeta<TUserScope>, _cellSchema: TCellSchema, columnSchema: TColumnSchema, rowSchema: TRowSchema): {
|
|
1609
|
-
create<TThis extends new (data?: InternalTreeNode | undefined) => TreeNode & TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema> & WithType<ScopedSchemaName<`com.fluidframework.
|
|
1610
|
-
} & (new (data?: InternalTreeNode | undefined) => TreeNode & TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema> & WithType<ScopedSchemaName<`com.fluidframework.
|
|
1642
|
+
create<TThis extends new (data?: InternalTreeNode | undefined) => TreeNode & TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema> & WithType<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "TableRoot">, NodeKind, unknown>>(this: TThis, initialContents?: TableSchema.TableFactoryMethodParameters<TUserScope, TCellSchema, TColumnSchema, TRowSchema> | undefined): InstanceType<TThis>;
|
|
1643
|
+
} & (new (data?: InternalTreeNode | undefined) => TreeNode & TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema> & WithType<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "TableRoot">, NodeKind, unknown>) & TreeNodeSchemaCore<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "TableRoot"> & string, NodeKind, false, unknown, never, unknown> & (new (data: InternalTreeNode) => TreeNode & TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema> & WithType<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "TableRoot">, NodeKind, unknown> & WithType<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "TableRoot"> & string, NodeKind, unknown>);
|
|
1611
1644
|
// @system
|
|
1612
1645
|
export type DefaultPropsType = ReturnType<typeof SchemaFactory.optional<[]>>;
|
|
1613
1646
|
// @system
|
|
@@ -1718,7 +1751,7 @@ export namespace System_Unsafe {
|
|
|
1718
1751
|
export type TreeObjectNodeUnsafe<T extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName, NodeKind.Object, T>;
|
|
1719
1752
|
}
|
|
1720
1753
|
|
|
1721
|
-
// @
|
|
1754
|
+
// @beta
|
|
1722
1755
|
export namespace TableSchema {
|
|
1723
1756
|
// @input
|
|
1724
1757
|
export interface CellKey<TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
|
|
@@ -1850,7 +1883,7 @@ export interface TransactionResultSuccess<TSuccessValue> {
|
|
|
1850
1883
|
// @public
|
|
1851
1884
|
export type TransformedEvent<TThis, E, A extends any[]> = (event: E, listener: (...args: ReplaceIEventThisPlaceHolder<A, TThis>) => void) => TThis;
|
|
1852
1885
|
|
|
1853
|
-
// @public @sealed
|
|
1886
|
+
// @public @sealed
|
|
1854
1887
|
export interface Tree extends TreeNodeApi {
|
|
1855
1888
|
contains(node: TreeNode, other: TreeNode): boolean;
|
|
1856
1889
|
readonly runTransaction: RunTransaction;
|
|
@@ -1859,21 +1892,21 @@ export interface Tree extends TreeNodeApi {
|
|
|
1859
1892
|
// @public
|
|
1860
1893
|
export const Tree: Tree;
|
|
1861
1894
|
|
|
1862
|
-
// @alpha @sealed
|
|
1895
|
+
// @alpha @sealed
|
|
1863
1896
|
export interface TreeAlpha {
|
|
1864
1897
|
branch(node: TreeNode): TreeBranchAlpha | undefined;
|
|
1865
1898
|
child(node: TreeNode, key: string | number): TreeNode | TreeLeafValue | undefined;
|
|
1866
1899
|
children(node: TreeNode): Iterable<[propertyKey: string | number, child: TreeNode | TreeLeafValue]>;
|
|
1867
1900
|
create<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(schema: UnsafeUnknownSchema extends TSchema ? ImplicitFieldSchema : TSchema & ImplicitFieldSchema, data: InsertableField<TSchema>): Unhydrated<TSchema extends ImplicitFieldSchema ? TreeFieldFromImplicitField<TSchema> : TreeNode | TreeLeafValue | undefined>;
|
|
1868
1901
|
exportCompressed(tree: TreeNode | TreeLeafValue, options: {
|
|
1869
|
-
idCompressor?:
|
|
1902
|
+
idCompressor?: IIdCompressor_2;
|
|
1870
1903
|
} & Pick<CodecWriteOptions, "minVersionForCollab">): JsonCompatible<IFluidHandle>;
|
|
1871
1904
|
exportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;
|
|
1872
1905
|
exportConcise(node: TreeNode | TreeLeafValue | undefined, options?: TreeEncodingOptions): ConciseTree | undefined;
|
|
1873
1906
|
exportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree;
|
|
1874
1907
|
readonly identifier: TreeIdentifierUtils;
|
|
1875
1908
|
importCompressed<const TSchema extends ImplicitFieldSchema>(schema: TSchema, compressedData: JsonCompatible<IFluidHandle>, options: {
|
|
1876
|
-
idCompressor?:
|
|
1909
|
+
idCompressor?: IIdCompressor_2;
|
|
1877
1910
|
} & ICodecOptions): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
1878
1911
|
importConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(schema: UnsafeUnknownSchema extends TSchema ? ImplicitFieldSchema : TSchema & ImplicitFieldSchema, data: ConciseTree | undefined): Unhydrated<TSchema extends ImplicitFieldSchema ? TreeFieldFromImplicitField<TSchema> : TreeNode | TreeLeafValue | undefined>;
|
|
1879
1912
|
importVerbose<const TSchema extends ImplicitFieldSchema>(schema: TSchema, data: VerboseTree | undefined, options?: TreeParsingOptions): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
@@ -1903,6 +1936,7 @@ export interface TreeArrayNode<TAllowedTypes extends System_Unsafe.ImplicitAllow
|
|
|
1903
1936
|
moveToIndex(destinationGap: number, sourceIndex: number, source: TMoveFrom): void;
|
|
1904
1937
|
moveToStart(sourceIndex: number): void;
|
|
1905
1938
|
moveToStart(sourceIndex: number, source: TMoveFrom): void;
|
|
1939
|
+
push(...value: readonly (TNew | IterableTreeArrayContent<TNew>)[]): void;
|
|
1906
1940
|
removeAt(index: number): void;
|
|
1907
1941
|
removeRange(start?: number, end?: number): void;
|
|
1908
1942
|
values(): IterableIterator<T>;
|
|
@@ -1913,7 +1947,7 @@ export const TreeArrayNode: {
|
|
|
1913
1947
|
readonly spread: <T>(content: Iterable<T>) => IterableTreeArrayContent<T>;
|
|
1914
1948
|
};
|
|
1915
1949
|
|
|
1916
|
-
// @beta @sealed
|
|
1950
|
+
// @beta @sealed
|
|
1917
1951
|
export interface TreeBeta {
|
|
1918
1952
|
clone<const TSchema extends ImplicitFieldSchema>(node: TreeFieldFromImplicitField<TSchema>): TreeFieldFromImplicitField<TSchema>;
|
|
1919
1953
|
create<const TSchema extends ImplicitFieldSchema>(schema: TSchema, data: InsertableTreeFieldFromImplicitField<TSchema>): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
@@ -1943,12 +1977,14 @@ export interface TreeBranchAlpha extends TreeBranch {
|
|
|
1943
1977
|
hasRootSchema<TSchema extends ImplicitFieldSchema>(schema: TSchema): this is TreeViewAlpha<TSchema>;
|
|
1944
1978
|
runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>, params?: RunTransactionParams): TransactionResultExt<TSuccessValue, TFailureValue>;
|
|
1945
1979
|
runTransaction(transaction: () => VoidTransactionCallbackStatus | void, params?: RunTransactionParams): TransactionResult;
|
|
1980
|
+
runTransactionAsync<TSuccessValue, TFailureValue>(transaction: () => Promise<TransactionCallbackStatus<TSuccessValue, TFailureValue>>, params?: RunTransactionParams): Promise<TransactionResultExt<TSuccessValue, TFailureValue>>;
|
|
1981
|
+
runTransactionAsync(transaction: () => Promise<VoidTransactionCallbackStatus | void>, params?: RunTransactionParams): Promise<TransactionResult>;
|
|
1946
1982
|
}
|
|
1947
1983
|
|
|
1948
1984
|
// @alpha @sealed
|
|
1949
1985
|
export interface TreeBranchEvents extends Omit<TreeViewEvents, "commitApplied"> {
|
|
1950
1986
|
changed(data: ChangeMetadata, getRevertible?: RevertibleAlphaFactory): void;
|
|
1951
|
-
commitApplied(data:
|
|
1987
|
+
commitApplied(data: ChangeMetadata, getRevertible?: RevertibleAlphaFactory): void;
|
|
1952
1988
|
}
|
|
1953
1989
|
|
|
1954
1990
|
// @alpha @sealed
|
|
@@ -2256,7 +2292,7 @@ export interface ViewableTree {
|
|
|
2256
2292
|
|
|
2257
2293
|
// @alpha
|
|
2258
2294
|
export interface ViewContent {
|
|
2259
|
-
readonly idCompressor:
|
|
2295
|
+
readonly idCompressor: IIdCompressor;
|
|
2260
2296
|
readonly schema: JsonCompatible;
|
|
2261
2297
|
readonly tree: JsonCompatible<IFluidHandle>;
|
|
2262
2298
|
}
|