fluid-framework 2.70.0 → 2.72.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 +72 -45
- package/api-report/fluid-framework.alpha.api.md +53 -22
- package/api-report/fluid-framework.beta.api.md +46 -0
- package/api-report/fluid-framework.legacy.beta.api.md +46 -0
- package/api-report/fluid-framework.legacy.public.api.md +1 -0
- package/api-report/fluid-framework.public.api.md +1 -0
- package/dist/alpha.d.ts +12 -7
- package/dist/beta.d.ts +8 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +8 -0
- package/lib/alpha.d.ts +12 -7
- package/lib/beta.d.ts +8 -0
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +8 -0
- package/package.json +17 -17
- package/src/index.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# fluid-framework
|
|
2
2
|
|
|
3
|
+
## 2.72.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- `formatVersion` removed from the options passed to `configuredSharedTree` ([#25752](https://github.com/microsoft/FluidFramework/pull/25752)) [df533906e3](https://github.com/microsoft/FluidFramework/commit/df533906e3a8e5d54024009704ca0c0eedb95e95)
|
|
8
|
+
|
|
9
|
+
Note: this change may break users of alpha APIs. See below for details.
|
|
10
|
+
|
|
11
|
+
`SharedTreeOptions` (which is passed to `configuredSharedTree`) no longer includes a `formatVersion: SharedTreeFormatVersion[keyof SharedTreeFormatVersion]` field.
|
|
12
|
+
The concept of `SharedTreeFormatVersion` has been removed altogether.
|
|
13
|
+
Instead, users are expected to leverage the already existing `minVersionForCollab` field.
|
|
14
|
+
|
|
15
|
+
For migration purposes, the mapping from `SharedTreeFormatVersion` to `minVersionForCollab` is as follows:
|
|
16
|
+
- `SharedTreeFormatVersion.v1`: no supported equivalent
|
|
17
|
+
- `SharedTreeFormatVersion.v2`: no supported equivalent
|
|
18
|
+
- `SharedTreeFormatVersion.v3`: `minVersionForCollab: FluidClientVersion.v2_0`
|
|
19
|
+
- `SharedTreeFormatVersion.v5`: `minVersionForCollab: FluidClientVersion.v2_43`
|
|
20
|
+
- `SharedTreeFormatVersion.vSharedBranches`: `minVersionForCollab: FluidClientVersion.v2_43` + `SharedTreeOptions.enableSharedBranches`
|
|
21
|
+
|
|
22
|
+
The values for which there is no supported equivalent `minVersionForCollab` were never given official support.
|
|
23
|
+
[Contact](https://github.com/microsoft/FluidFramework/issues) the Fluid Framework team if you need help migrating away from them.
|
|
24
|
+
|
|
25
|
+
## 2.71.0
|
|
26
|
+
|
|
27
|
+
### Minor Changes
|
|
28
|
+
|
|
29
|
+
- Add IndependentTree API ([#25785](https://github.com/microsoft/FluidFramework/pull/25785)) [21c4245a25](https://github.com/microsoft/FluidFramework/commit/21c4245a25f60f939434b65c5555b13a4d54ea17)
|
|
30
|
+
|
|
31
|
+
New `IndependentTreeAlpha` and `IndependentTreeBeta` APIs provide similar utility to the existing alpha [`IndependentView`](https://fluidframework.com/docs/api/tree#independentview-function) API, except providing access to the [`ViewableTree`](https://fluidframework.com/docs/api/fluid-framework/viewabletree-interface).
|
|
32
|
+
|
|
33
|
+
This allows for multiple views (in sequence, not concurrently) to be created to test things like schema upgrades and incompatible view schema much more easily (see example below).
|
|
34
|
+
For `IndependentTreeAlpha`, this also provides access to `exportVerbose` and `exportSimpleSchema` from [`ITreeAlpha`](https://fluidframework.com/docs/api/tree/itreealpha-interface).
|
|
35
|
+
|
|
36
|
+
An example of how to use `createIndependentTreeBeta` to create multiple views to test a schema upgrade:
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
const tree = createIndependentTreeBeta();
|
|
40
|
+
|
|
41
|
+
const stagedConfig = new TreeViewConfiguration({
|
|
42
|
+
schema: SchemaFactoryAlpha.types([
|
|
43
|
+
SchemaFactory.number,
|
|
44
|
+
SchemaFactoryAlpha.staged(SchemaFactory.string),
|
|
45
|
+
]),
|
|
46
|
+
});
|
|
47
|
+
const afterConfig = new TreeViewConfigurationAlpha({
|
|
48
|
+
schema: [SchemaFactory.number, SchemaFactory.string],
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Initialize tree
|
|
52
|
+
{
|
|
53
|
+
const view = tree.viewWith(stagedConfig);
|
|
54
|
+
view.initialize(1);
|
|
55
|
+
view.dispose();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Do schema upgrade
|
|
59
|
+
{
|
|
60
|
+
const view = tree.viewWith(afterConfig);
|
|
61
|
+
view.upgradeSchema();
|
|
62
|
+
view.root = "A";
|
|
63
|
+
view.dispose();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Can still view tree with staged schema
|
|
67
|
+
{
|
|
68
|
+
const view = tree.viewWith(stagedConfig);
|
|
69
|
+
assert.equal(view.root, "A");
|
|
70
|
+
view.dispose();
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
3
74
|
## 2.70.0
|
|
4
75
|
|
|
5
76
|
### Minor Changes
|
|
@@ -12,7 +83,6 @@
|
|
|
12
83
|
- A minimal set of branching APIs has been promoted to beta. ([#25744](https://github.com/microsoft/FluidFramework/pull/25744)) [32cc2c75d8](https://github.com/microsoft/FluidFramework/commit/32cc2c75d82c35403caa91e67e81f71baee5d092)
|
|
13
84
|
|
|
14
85
|
The following APIs have been promoted to beta in `@fluidframework/tree`:
|
|
15
|
-
|
|
16
86
|
- `TreeBranch.fork()`
|
|
17
87
|
- `TreeBranch.merge()`
|
|
18
88
|
- `TreeBranch.rebaseOnto()`
|
|
@@ -137,7 +207,6 @@
|
|
|
137
207
|
The `@alpha` API `JsonValidator` has been removed: its replacement `FormatValidator` must now be used.
|
|
138
208
|
|
|
139
209
|
As part of this:
|
|
140
|
-
|
|
141
210
|
- `typeboxValidator` has been replaced with `FormatValidatorBasic`.
|
|
142
211
|
- `noopValidator` has been replaced with `FormatValidatorNoOp`.
|
|
143
212
|
|
|
@@ -293,7 +362,6 @@ Dependency updates only.
|
|
|
293
362
|
The APIs that operate on batches should be used instead.
|
|
294
363
|
|
|
295
364
|
Specifically:
|
|
296
|
-
|
|
297
365
|
- `insertColumn`
|
|
298
366
|
- Use `insertColumns` instead
|
|
299
367
|
- `insertRow`
|
|
@@ -313,7 +381,6 @@ Dependency updates only.
|
|
|
313
381
|
- Remove unnecessary and internal APIs in ISequenceIntervalCollection and related interval types ([#25244](https://github.com/microsoft/FluidFramework/pull/25244)) [15d476ea706](https://github.com/microsoft/FluidFramework/commit/15d476ea7069eb4de317a726733aa8fb9e8486e8)
|
|
314
382
|
|
|
315
383
|
The following APIs are now removed:
|
|
316
|
-
|
|
317
384
|
- `IInterval.clone`
|
|
318
385
|
- `IInterval.modify`
|
|
319
386
|
- `IInterval.union`
|
|
@@ -459,7 +526,6 @@ Dependency updates only.
|
|
|
459
526
|
- Allow edits in arrays to be concurrent to dependent edits of transactions with violated constraints ([#25191](https://github.com/microsoft/FluidFramework/pull/25191)) [ef64bae6ab2](https://github.com/microsoft/FluidFramework/commit/ef64bae6ab2848c67d778d14ad56ae021f54ac7a)
|
|
460
527
|
|
|
461
528
|
Before this release, making concurrent edits to an array could lead to assertion error `0x8a2` being thrown if the following conditions were met:
|
|
462
|
-
|
|
463
529
|
- Some edit `e1` was a transaction with a constraint that turned out to be violated by edits concurrent to (and sequenced before) `e1`
|
|
464
530
|
- Some edit `e2` was dependent on `e1` (from before the violation of its constraint)
|
|
465
531
|
- Some edit `e3` was concurrent to and sequenced after both `e1` and `e2`
|
|
@@ -509,7 +575,6 @@ Dependency updates only.
|
|
|
509
575
|
(This is the case when nodes are removed before attaching and there is a local branch that forks from a commit that made such a removal or from an earlier commit. This is also the case when retaining `Revertible` objects for those commits).
|
|
510
576
|
|
|
511
577
|
After this release, the behavior depends on the `CodecWriteOptions.oldestCompatibleClient` value:
|
|
512
|
-
|
|
513
578
|
- For values < `FluidClientVersion.v2_52`, the behavior is the same.
|
|
514
579
|
- For values >= `FluidClientVersion.v2_52`, the attach will succeed, but use a newer storage format.
|
|
515
580
|
|
|
@@ -605,7 +670,6 @@ Dependency updates only.
|
|
|
605
670
|
We recommend updating your code to be more tolerant of unknown node kinds going forward.
|
|
606
671
|
|
|
607
672
|
Also see alternative options for schema-agnostic tree traversal if needed:
|
|
608
|
-
|
|
609
673
|
- [Tree.parent](https://fluidframework.com/docs/api/fluid-framework/treenodeapi-interface#parent-methodsignature)
|
|
610
674
|
- [TreeAlpha.child](https://fluidframework.com/docs/api/fluid-framework/treealpha-interface#child-methodsignature)
|
|
611
675
|
- [TreeAlpha.children](https://fluidframework.com/docs/api/fluid-framework/treealpha-interface#children-methodsignature)
|
|
@@ -1017,7 +1081,6 @@ Dependency updates only.
|
|
|
1017
1081
|
|
|
1018
1082
|
Table trees created using `TableSchema` offer various APIs to make working with tabular data easy.
|
|
1019
1083
|
These include:
|
|
1020
|
-
|
|
1021
1084
|
- Insertion and removal of columns, rows, and cells.
|
|
1022
1085
|
- Cell access by column/row.
|
|
1023
1086
|
|
|
@@ -1163,7 +1226,6 @@ Dependency updates only.
|
|
|
1163
1226
|
You can retrieve the long identifier with `TreeAlpha.identifier(node)`, where `node` is a `TreeNode`. The long identifier is a stable, compressible UUID generated by the tree.
|
|
1164
1227
|
In cases where the node does not yet have an identifier assigned, this will return `undefined`.
|
|
1165
1228
|
These cases include:
|
|
1166
|
-
|
|
1167
1229
|
- The node does not contain an identifier field.
|
|
1168
1230
|
- The node is a non-hydrated node with a user provided identifier. Note that if it is a non-hydrated node without an identifier provided, it will throw an error.
|
|
1169
1231
|
|
|
@@ -1174,7 +1236,6 @@ Dependency updates only.
|
|
|
1174
1236
|
to get the original valid long `identifier` back.
|
|
1175
1237
|
In the cases where it's not possible to shorten the `identifier`, it will return `undefined`.
|
|
1176
1238
|
These cases include:
|
|
1177
|
-
|
|
1178
1239
|
- A compressible long identifier, but it is unrecognized by the tree that the node belongs to. This can occur if the identifier is not generated from the tree.
|
|
1179
1240
|
- An identifier which is not compressible by the tree. This can occur if the node's identifier was a user provided string.
|
|
1180
1241
|
|
|
@@ -1184,7 +1245,6 @@ Dependency updates only.
|
|
|
1184
1245
|
If the method returns a valid long identifier, this identifier can be passed into `TreeAlpha.identifier.shorten` to get the original `identifier` back.
|
|
1185
1246
|
In the cases where it's not possible to lengthen the `identifier`, this method will throw an error.
|
|
1186
1247
|
These cases include:
|
|
1187
|
-
|
|
1188
1248
|
- An unrecognized short identifier. This can occur if the identifier is not generated from the tree.
|
|
1189
1249
|
|
|
1190
1250
|
#### TreeAlpha.identifier.getShort
|
|
@@ -1205,7 +1265,6 @@ Dependency updates only.
|
|
|
1205
1265
|
|
|
1206
1266
|
In cases where the node provided does not contain an identifier that is recognized or compressible by the tree that the node belongs to, this method will return undefined.
|
|
1207
1267
|
This will occur in the following cases:
|
|
1208
|
-
|
|
1209
1268
|
- The node is an non-hydrated node with a user provided identifier. Note that if it is an non-hydrated node without an identifier provided, it will throw an error.
|
|
1210
1269
|
- The node does not contain an identifier field.
|
|
1211
1270
|
- The node contains a compressible long identifier, but it is unrecognized by the tree that the node belongs to. This can occur if the identifier is not generated from the tree.
|
|
@@ -1340,7 +1399,6 @@ Dependency updates only.
|
|
|
1340
1399
|
|
|
1341
1400
|
[TreeNodes](https://fluidframework.com/docs/api/fluid-framework/treenode-class) which are [deleted](https://fluidframework.com/docs/api/fluid-framework/treestatus-enum#deleted-enummember) were not handled correctly.
|
|
1342
1401
|
This has been improved in two ways:
|
|
1343
|
-
|
|
1344
1402
|
1. Accessing fields of deleted nodes now consistently throws a usage error indicating that doing so is invalid.
|
|
1345
1403
|
Previously, this would throw an assertion error, which was a bug.
|
|
1346
1404
|
2. When a `TreeNode` is deleted, but that node still exists within the [`ITree`](https://fluidframework.com/docs/api/driver-definitions/itree-interface), then becomes accessible again later, a new `TreeNode` is now allocated instead of trying to reuse the deleted one.
|
|
@@ -1350,7 +1408,6 @@ Dependency updates only.
|
|
|
1350
1408
|
- Generic types for IntervalCollections have been replaced with non-generic types ([#24411](https://github.com/microsoft/FluidFramework/pull/24411)) [1c743e825ed](https://github.com/microsoft/FluidFramework/commit/1c743e825ed29a81b0e66775ce3553477361d335)
|
|
1351
1409
|
|
|
1352
1410
|
This change deprecates the following generic types and provides non-generic alternatives where necessary:
|
|
1353
|
-
|
|
1354
1411
|
- `IIntervalCollection` is replaced by `ISequenceIntervalCollection`
|
|
1355
1412
|
- `IIntervalCollectionEvent` is replaced by `ISequenceIntervalCollectionEvents`
|
|
1356
1413
|
- `IntervalIndex` is replaced by `SequenceIntervalIndex`
|
|
@@ -1418,7 +1475,6 @@ Dependency updates only.
|
|
|
1418
1475
|
As a side effect of this work, some schema which violated the documented allowed patterns specified by [SchemaFactory](https://fluidframework.com/docs/api/fluid-framework/schemafactory-class#schemafactory-remarks) but used to work (as long as they were not package exported) no longer compile.
|
|
1419
1476
|
|
|
1420
1477
|
The specific case known to break is when:
|
|
1421
|
-
|
|
1422
1478
|
1. An Object node schema is co-recursive with an Array node schema.
|
|
1423
1479
|
2. The Array does not declare a named subclass.
|
|
1424
1480
|
3. The schema reference from the Object to the Array is not using the [lazy syntax](https://fluidframework.com/docs/api/fluid-framework/lazyitem-typealias).
|
|
@@ -1468,7 +1524,6 @@ Dependency updates only.
|
|
|
1468
1524
|
trunk commits and 100 peer commits, the performance increases by 97%.
|
|
1469
1525
|
|
|
1470
1526
|
Some example scenarios where the performance will be improved:
|
|
1471
|
-
|
|
1472
1527
|
- A client makes some local changes and another client simultaneously makes a large number of changes in a single JavaScript turn.
|
|
1473
1528
|
For example, a client is typing into a canvas while another client pastes a large amount of content into a table.
|
|
1474
1529
|
- A client makes a local branch with some changes and rebases it into the trunk. For example, an AI agent makes changes
|
|
@@ -1489,7 +1544,6 @@ Dependency updates only.
|
|
|
1489
1544
|
Additionally an alpha `ObjectNodeSchema` object is added to enable support for `schema instanceof ObjectNodeSchema` to safely narrow `TreeNodeSchema` to this new type.
|
|
1490
1545
|
|
|
1491
1546
|
In support of this work, several typing details were fixed including:
|
|
1492
|
-
|
|
1493
1547
|
- `info` field of `[typeSchemaSymbol]` type brand on recursive object schema was specified to match non-recursive variants.
|
|
1494
1548
|
- Type of field metadata was correctly plumbed through `optionalReclusive` and `requiredRecursive`.
|
|
1495
1549
|
- When fields object provided to [SchemaFactory.object](https://fluidframework.com/docs/api/fluid-framework/schemafactory-class#object-method) is typed as `RestrictiveStringRecord<ImplicitFieldSchema>` the resulting [TreeObjectNode](https://fluidframework.com/docs/api/fluid-framework/treeobjectnode-typealias) no longer gets a `Record<string, TreeNode | TreeLeafValue>` signature which could incorrectly conflict with custom members added to the object. Instead `{}` is used to provide no information about felids on the type when the schema provides no information about them. Additionally this case is explicitly made non-constructable: the constructor takes in `never` instead of a `Record<string,never>` which could be erroneously satisfied with an empty object due to how TypeScript assignability rules consider records to have all allowed fields, but also allow objects missing those fields to be assigned to them.
|
|
@@ -1516,7 +1570,6 @@ Dependency updates only.
|
|
|
1516
1570
|
The various import and export [`VerboseTree`](https://fluidframework.com/docs/api/fluid-framework/verbosetree-typealias) and [`ConciseTree`](https://fluidframework.com/docs/api/fluid-framework/concisetree-typealias) APIs no longer include `valueConverter` options.
|
|
1517
1571
|
Instead the resulting tree can be further processed to do any desired replacements.
|
|
1518
1572
|
The following `@alpha` APIs have been added to assist with this:
|
|
1519
|
-
|
|
1520
1573
|
1. `cloneWithReplacements`
|
|
1521
1574
|
2. `replaceHandles`
|
|
1522
1575
|
3. `replaceConciseTreeHandles`
|
|
@@ -1567,7 +1620,6 @@ Dependency updates only.
|
|
|
1567
1620
|
For example, with 10 local ops + 10 incoming ops, the performance increases by 70%; with 100 local ops + 100 incoming ops, the performance increases by 94%.
|
|
1568
1621
|
|
|
1569
1622
|
This will help improve performance in the following scenarios:
|
|
1570
|
-
|
|
1571
1623
|
- A client makes a large number of changes in a single JS turn. For example, copy pasting large data like a table.
|
|
1572
1624
|
- A client has a large number of local changes. For example, slow clients whose changes are slow to ack or clients with
|
|
1573
1625
|
a local branch with large number of changes.
|
|
@@ -1644,7 +1696,6 @@ Dependency updates only.
|
|
|
1644
1696
|
These properties will not be used by the system by default, but can be used to associate common application-specific properties with Node Schema.
|
|
1645
1697
|
|
|
1646
1698
|
#### `SchemaFactoryAlpha` Updates
|
|
1647
|
-
|
|
1648
1699
|
- `object` and `objectRecursive`, `arrayRecursive`, and `mapRecursive` now support `metadata` in their `options` parameter.
|
|
1649
1700
|
- (new) `arrayAlpha` - Variant of `array` that accepts an options parameter which supports `metadata`
|
|
1650
1701
|
- (new) `mapAlpha` - Variant of `map` that accepts an options parameter which supports `metadata`
|
|
@@ -1697,7 +1748,6 @@ Dependency updates only.
|
|
|
1697
1748
|
One of these checks verifies that the view schema (defined in application's code) aligns with the document schema (determined by the document data at rest).
|
|
1698
1749
|
This helps to ensure that clients running incompatible versions of the application's code don't collaborate at the same time on some document, which could cause data loss or disrupt application invariants.
|
|
1699
1750
|
One general solution application authors can perform is to stage the rollout of a feature which changes document schema into multiple phases:
|
|
1700
|
-
|
|
1701
1751
|
1. Release an application version which understands documents written with the new format but doesn't attempt to upgrade any documents
|
|
1702
1752
|
2. Wait for this application version to saturate in the app's ecosystem
|
|
1703
1753
|
3. Release an application version which upgrades documents to start leveraging the new format.
|
|
@@ -1814,7 +1864,6 @@ Dependency updates only.
|
|
|
1814
1864
|
As part of ongoing improvements, several internal types and related APIs have been removed. These types are unnecessary for any supported scenarios and could lead to errors if used. Since directly using these types would likely result in errors, these changes are not likely to impact any Fluid Framework consumers.
|
|
1815
1865
|
|
|
1816
1866
|
Removed types:
|
|
1817
|
-
|
|
1818
1867
|
- IMergeTreeTextHelper
|
|
1819
1868
|
- MergeNode
|
|
1820
1869
|
- ObliterateInfo
|
|
@@ -1826,12 +1875,10 @@ Dependency updates only.
|
|
|
1826
1875
|
In addition to removing the above types, they are no longer exposed through the following interfaces and their implementations: `ISegment`, `ReferencePosition`, and `ISerializableInterval`.
|
|
1827
1876
|
|
|
1828
1877
|
Removed functions:
|
|
1829
|
-
|
|
1830
1878
|
- addProperties
|
|
1831
1879
|
- ack
|
|
1832
1880
|
|
|
1833
1881
|
Removed properties:
|
|
1834
|
-
|
|
1835
1882
|
- propertyManager
|
|
1836
1883
|
- segmentGroups
|
|
1837
1884
|
|
|
@@ -1914,7 +1961,6 @@ Dependency updates only.
|
|
|
1914
1961
|
An adjustment is a modification applied to a property value within a specified range. Adjustments can be used to increment or decrement property values dynamically. They are particularly useful in scenarios where property values need to be updated based on user interactions or other events. For example, in a rich text editor, adjustments can be used for modifying indentation levels or font sizes, where multiple users could apply differing numerical adjustments.
|
|
1915
1962
|
|
|
1916
1963
|
### Key Features and Use Cases:
|
|
1917
|
-
|
|
1918
1964
|
- **Adjustments with Constraints**: Adjustments can include optional minimum and maximum constraints to ensure the final value falls within specified bounds. This is particularly useful for maintaining consistent formatting in rich text editors.
|
|
1919
1965
|
- **Consistent Property Changes**: The feature ensures that property changes are consistent, managing both local and remote changes effectively. This is essential for collaborative rich text editing where multiple users may be making adjustments simultaneously.
|
|
1920
1966
|
- **Rich Text Formatting**: Adjustments can be used to modify text properties such as font size, indentation, or other formatting attributes dynamically based on user actions.
|
|
@@ -1936,7 +1982,6 @@ Dependency updates only.
|
|
|
1936
1982
|
The `Client` class in the merge-tree package has been removed. Types that directly or indirectly expose the merge-tree `Client` class have also been removed.
|
|
1937
1983
|
|
|
1938
1984
|
The removed types were not meant to be used directly, and direct usage was not supported:
|
|
1939
|
-
|
|
1940
1985
|
- AttributionPolicy
|
|
1941
1986
|
- IClientEvents
|
|
1942
1987
|
- IMergeTreeAttributionOptions
|
|
@@ -1944,7 +1989,6 @@ Dependency updates only.
|
|
|
1944
1989
|
- SharedStringClass
|
|
1945
1990
|
|
|
1946
1991
|
Some classes that referenced the `Client` class have been transitioned to interfaces. Direct instantiation of these classes was not supported or necessary for any supported scenario, so the change to an interface should not impact usage. This applies to the following types:
|
|
1947
|
-
|
|
1948
1992
|
- SequenceInterval
|
|
1949
1993
|
- SequenceEvent
|
|
1950
1994
|
- SequenceDeltaEvent
|
|
@@ -1969,7 +2013,6 @@ Dependency updates only.
|
|
|
1969
2013
|
`independentView` has also been added, which is similar but handles the case of creating a new view without an existing schema or tree.
|
|
1970
2014
|
|
|
1971
2015
|
Together these APIs address several use-cases:
|
|
1972
|
-
|
|
1973
2016
|
1. Using SharedTree as an in-memory non-collaborative datastore.
|
|
1974
2017
|
2. Importing and exporting data from a SharedTree to and from other services or storage locations (such as locally saved files).
|
|
1975
2018
|
3. Testing various scenarios without relying on a service.
|
|
@@ -2464,7 +2507,6 @@ Dependency updates only.
|
|
|
2464
2507
|
|
|
2465
2508
|
The `PropertyManager` class, along with the `propertyManager` properties and `addProperties` functions on segments and intervals, are not intended for external use.
|
|
2466
2509
|
These elements will be removed in a future release for the following reasons:
|
|
2467
|
-
|
|
2468
2510
|
- There are no scenarios where they need to be used directly.
|
|
2469
2511
|
- Using them directly will cause eventual consistency problems.
|
|
2470
2512
|
- Upcoming features will require modifications to these mechanisms.
|
|
@@ -2567,7 +2609,6 @@ Dependency updates only.
|
|
|
2567
2609
|
The runtime behavior is unaffected: any code which worked and still compiles is fine and does not need changes.
|
|
2568
2610
|
|
|
2569
2611
|
`Tree.schema` was changed to mitigate two different issues:
|
|
2570
|
-
|
|
2571
2612
|
1. It tried to give a more specific type based on the type of the passed in value.
|
|
2572
2613
|
When the type of the input is not known precisely (for example it is a union of node types like `Foo | Bar`, or `TreeNode` or even `TreeNode | TreeLeafValue`), this was fine since schema are covariant over their node type.
|
|
2573
2614
|
However when the input was more specific that the schema type, for example the type is simply `0`, this would result in unsound typing, since the create function could actually return values that did not conform with that schema (for example `schema.create(1)` for the number schema typed with `0` would return `1` with type `0`).
|
|
@@ -2694,7 +2735,6 @@ Dependency updates only.
|
|
|
2694
2735
|
```
|
|
2695
2736
|
|
|
2696
2737
|
Skipping the constructor causes the following problems:
|
|
2697
|
-
|
|
2698
2738
|
1. `TreeViewConfiguration` does validation in its constructor, so skipping it also skips the validation which leads to much less friendly error messages for invalid schema.
|
|
2699
2739
|
2. Skipping the constructor also discards any default values for options like `enableSchemaValidation`.
|
|
2700
2740
|
This means that code written in that style would break if more options were added. Since such changes are planned,
|
|
@@ -2729,7 +2769,6 @@ Dependency updates only.
|
|
|
2729
2769
|
already the case, but the documentation was not clear.
|
|
2730
2770
|
|
|
2731
2771
|
Updated APIs:
|
|
2732
|
-
|
|
2733
2772
|
- [IDirectory](https://fluidframework.com/docs/api/v2/fluid-framework/idirectory-interface) sealed
|
|
2734
2773
|
- [IDirectoryEvents](https://fluidframework.com/docs/api/v2/fluid-framework/idirectoryevents-interface) sealed
|
|
2735
2774
|
- [IDirectoryValueChanged](https://fluidframework.com/docs/api/v2/fluid-framework/idirectoryvaluechanged-interface) sealed and path property is readonly
|
|
@@ -2754,7 +2793,6 @@ Dependency updates only.
|
|
|
2754
2793
|
|
|
2755
2794
|
Several cases of invalid usage patterns for tree APIs have gained improved error reporting, as well as improved documentation on the APIs detailing what usage is supported.
|
|
2756
2795
|
These improvements include:
|
|
2757
|
-
|
|
2758
2796
|
- Unsupported usages of schema classes: using more than one schema class derived from a single SchemaFactory generated base class. This used to hit internal asserts, but now has a descriptive user-facing UsageError. Most of this work was done in [9fb3dcf](https://github.com/microsoft/FluidFramework/commit/9fb3dcf491a7f0d66f4abbdc64ab97ccabef4707).
|
|
2759
2797
|
- Improved detection of when prior exception may have left SharedTree in an invalid state.
|
|
2760
2798
|
These cases now report a UsageError including a reference to the prior exception. This was mainly done in [9fb3dcf](https://github.com/microsoft/FluidFramework/commit/9fb3dcf491a7f0d66f4abbdc64ab97ccabef4707) and [b77d530](https://github.com/microsoft/FluidFramework/commit/b77d530b9252201c40a90d1a2a6315f76f1a4a4b).
|
|
@@ -2773,7 +2811,6 @@ Dependency updates only.
|
|
|
2773
2811
|
|
|
2774
2812
|
Access to these now less public types should not be required for users of the `@public` "declarative API" exposed in the `fluid-framework` package, but can still be accessed for those who need them under the `/legacy` import paths.
|
|
2775
2813
|
The full list of such types is:
|
|
2776
|
-
|
|
2777
2814
|
- `SharedTree` as exported from `@fluidframwork/tree`: It is still exported as `@public` from `fluid-framework` as `SharedObjectKind`.
|
|
2778
2815
|
- `ISharedObjectKind`: See new `SharedObjectKind` type for use in `@public` APIs.
|
|
2779
2816
|
`ISharedObject`
|
|
@@ -2791,7 +2828,6 @@ Dependency updates only.
|
|
|
2791
2828
|
- `IProvideFluidHandleContext`
|
|
2792
2829
|
|
|
2793
2830
|
Removed APIs:
|
|
2794
|
-
|
|
2795
2831
|
- `DataObjectClass`: Usages replaced with `SharedObjectKind`.
|
|
2796
2832
|
- `LoadableObjectClass`: Replaced with `SharedObjectKind`.
|
|
2797
2833
|
- `LoadableObjectClassRecord`: Replaced with `Record<string, SharedObjectKind>`.
|
|
@@ -2815,7 +2851,6 @@ Dependency updates only.
|
|
|
2815
2851
|
- fluid-framework: Remove some types from `@public` that are not needed ([#21326](https://github.com/microsoft/FluidFramework/pull/21326)) [b629cb80b0](https://github.com/microsoft/FluidFramework/commit/b629cb80b0e5ecdc750270807f77a0e30fab4559)
|
|
2816
2852
|
|
|
2817
2853
|
Mark the following APIs `@alpha` instead of `@public`:
|
|
2818
|
-
|
|
2819
2854
|
- IBranchOrigin
|
|
2820
2855
|
- ISequencedDocumentMessage
|
|
2821
2856
|
- ISignalMessage
|
|
@@ -2830,7 +2865,6 @@ Dependency updates only.
|
|
|
2830
2865
|
- fluid-framework: Remove several types from `@public` scope ([#21142](https://github.com/microsoft/FluidFramework/pull/21142)) [983e9f09f7](https://github.com/microsoft/FluidFramework/commit/983e9f09f7b10fef9ffa1e9af86166f0ccda7e14)
|
|
2831
2866
|
|
|
2832
2867
|
The following types have been moved from `@public` to `@alpha`:
|
|
2833
|
-
|
|
2834
2868
|
- `IFluidSerializer`
|
|
2835
2869
|
- `ISharedObjectEvents`
|
|
2836
2870
|
- `IChannelServices`
|
|
@@ -2854,7 +2888,6 @@ Dependency updates only.
|
|
|
2854
2888
|
|
|
2855
2889
|
The stable public API surface for Tree has been reduced.
|
|
2856
2890
|
Several types have been moved into InternalTypes, indicating that they are not fully stable nor intended to be referenced by users of Tree.
|
|
2857
|
-
|
|
2858
2891
|
- NodeBuilderData
|
|
2859
2892
|
- FieldHasDefault
|
|
2860
2893
|
- TreeNodeSchemaNonClass
|
|
@@ -2881,7 +2914,6 @@ Dependency updates only.
|
|
|
2881
2914
|
- TreeApi
|
|
2882
2915
|
|
|
2883
2916
|
Additionally a few more types which could not be moved due to technically limitations have been documented that they should be treated similarly.
|
|
2884
|
-
|
|
2885
2917
|
- TreeNodeApi
|
|
2886
2918
|
- TreeNodeSchemaCore
|
|
2887
2919
|
- All \*Unsafe type (use for construction of recursive schema).
|
|
@@ -2957,7 +2989,6 @@ Dependency updates only.
|
|
|
2957
2989
|
- Make several driver types no longer public [b7ad7d0b55](https://github.com/microsoft/FluidFramework/commit/b7ad7d0b55884dd8954abf7c398e518838b9bda0)
|
|
2958
2990
|
|
|
2959
2991
|
Move the following types from `@public` to `@alpha`:
|
|
2960
|
-
|
|
2961
2992
|
- ITokenClaims
|
|
2962
2993
|
- IDocumentMessage
|
|
2963
2994
|
- IClientConfiguration
|
|
@@ -2968,7 +2999,6 @@ Dependency updates only.
|
|
|
2968
2999
|
`DriverErrorTypes` is no longer exported from the `fluid-framework` package.
|
|
2969
3000
|
|
|
2970
3001
|
- Rename `AzureMember.userName` to `AzureMember.name` and `IMember.userId` to `IMember.id` [96872186d0](https://github.com/microsoft/FluidFramework/commit/96872186d0d0f245c1fece7d19b3743e501679b6)
|
|
2971
|
-
|
|
2972
3002
|
1. Renamed `AzureMember.userName` to `AzureMember.name` to establish uniform naming across odsp-client and azure-client.
|
|
2973
3003
|
2. Renamed `IMember.userId` to `IMember.id` to align with the properties received from AFR.
|
|
2974
3004
|
|
|
@@ -2992,7 +3022,6 @@ Dependency updates only.
|
|
|
2992
3022
|
TypeScript types and implementation code.
|
|
2993
3023
|
|
|
2994
3024
|
This means that using Fluid Framework packages require the following TypeScript settings in tsconfig.json:
|
|
2995
|
-
|
|
2996
3025
|
- `"moduleResolution": "Node16"` with `"module": "Node16"`
|
|
2997
3026
|
- `"moduleResolution": "Bundler"` with `"module": "ESNext"`
|
|
2998
3027
|
|
|
@@ -3056,7 +3085,7 @@ Dependency updates only.
|
|
|
3056
3085
|
become build errors. The fix is to use only public APIs from @fluidframework/foo.
|
|
3057
3086
|
|
|
3058
3087
|
**Coming soon:** Build resolutions (`moduleResolution` in tsconfig compilerOptions) will need to be resolved with
|
|
3059
|
-
Node16, NodeNext, or a bundler that supports resolution of named import/export paths. Internally, some FF packages will
|
|
3088
|
+
Node16, NodeNext, or a bundler that supports resolution of named import-x/export paths. Internally, some FF packages will
|
|
3060
3089
|
use `@fluidframework/foo/internal` import paths that allow packages to talk to each other using non-public APIs.
|
|
3061
3090
|
|
|
3062
3091
|
**Final stage:** APIs that are not tagged @public will be removed from @fluidframework/foo imports.
|
|
@@ -3099,7 +3128,6 @@ Dependency updates only.
|
|
|
3099
3128
|
Several FluidStatic classes were unnecessarily exposed and were deprecated in an earlier release. They have been replaced with creation functions. This helps us
|
|
3100
3129
|
keep implementations decoupled from usage which is easier to maintain and extend. It has very minimal impact on the
|
|
3101
3130
|
public surface area of downstream packages. The removed classes are as follows:
|
|
3102
|
-
|
|
3103
3131
|
- `AzureAudience` (use `IAzureAudience` instead)
|
|
3104
3132
|
- `TinyliciousAudience` (use `ITinyliciousAudience` instead)
|
|
3105
3133
|
- `DOProviderContainerRuntimeFactory`
|
|
@@ -3115,7 +3143,6 @@ Dependency updates only.
|
|
|
3115
3143
|
Several FluidStatic classes were unnecessarily exposed. They have been replaced with creation functions. This helps us
|
|
3116
3144
|
keep implementations decoupled from usage which is easier to maintain and extend. It has very minimal impact on the
|
|
3117
3145
|
public surface area of downstream packages. The deprecated classes are as follows:
|
|
3118
|
-
|
|
3119
3146
|
- `AzureAudience` (use `IAzureAudience` instead)
|
|
3120
3147
|
- `TinyliciousAudience` (use `ITinyliciousAudience` instead)
|
|
3121
3148
|
- `DOProviderContainerRuntimeFactory`
|
|
@@ -33,7 +33,7 @@ export type AllowedTypesFullEvaluated = AllowedTypesFull<readonly AnnotatedAllow
|
|
|
33
33
|
// @beta @sealed @system
|
|
34
34
|
export type AllowedTypesFullFromMixed<T extends readonly (AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[]> = UnannotateAllowedTypesList<T> & AnnotatedAllowedTypes<AnnotateAllowedTypesList<T>>;
|
|
35
35
|
|
|
36
|
-
// @
|
|
36
|
+
// @beta @sealed @system
|
|
37
37
|
export type AllowedTypesFullFromMixedUnsafe<T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[]> = UnannotateAllowedTypesListUnsafe<T> & AnnotatedAllowedTypes<AnnotateAllowedTypesListUnsafe<T>>;
|
|
38
38
|
|
|
39
39
|
// @alpha @sealed @system
|
|
@@ -52,7 +52,7 @@ export type AnnotateAllowedTypesList<T extends readonly (AnnotatedAllowedType |
|
|
|
52
52
|
[I in keyof T]: T[I] extends AnnotatedAllowedType<unknown> ? T[I] : AnnotatedAllowedType<T[I]>;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
// @
|
|
55
|
+
// @beta @sealed @system
|
|
56
56
|
export type AnnotateAllowedTypesListUnsafe<T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[]> = {
|
|
57
57
|
[I in keyof T]: T[I] extends AnnotatedAllowedTypeUnsafe ? T[I] : AnnotatedAllowedTypeUnsafe<T[I]>;
|
|
58
58
|
};
|
|
@@ -72,11 +72,11 @@ export interface AnnotatedAllowedTypes<T = readonly AnnotatedAllowedType[]> exte
|
|
|
72
72
|
readonly types: T;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
// @
|
|
75
|
+
// @beta @sealed @system
|
|
76
76
|
export interface AnnotatedAllowedTypesUnsafe extends AnnotatedAllowedTypes<LazyItem<System_Unsafe.TreeNodeSchemaUnsafe>> {
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
// @
|
|
79
|
+
// @beta @sealed @system
|
|
80
80
|
export interface AnnotatedAllowedTypeUnsafe<T = Unenforced<LazyItem<TreeNodeSchema>>> extends AnnotatedAllowedType<T> {
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -214,6 +214,20 @@ export const contentSchemaSymbol: unique symbol;
|
|
|
214
214
|
// @alpha
|
|
215
215
|
export function createIdentifierIndex<TSchema extends ImplicitFieldSchema>(view: TreeView<TSchema>): IdentifierIndex;
|
|
216
216
|
|
|
217
|
+
// @alpha
|
|
218
|
+
export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSchema>(options?: ForestOptions & (({
|
|
219
|
+
idCompressor?: IIdCompressor_2 | undefined;
|
|
220
|
+
} & {
|
|
221
|
+
content?: undefined;
|
|
222
|
+
}) | (ICodecOptions & {
|
|
223
|
+
content: ViewContent;
|
|
224
|
+
} & {
|
|
225
|
+
idCompressor?: undefined;
|
|
226
|
+
}))): ViewableTree & Pick<ITreeAlpha, "exportVerbose" | "exportSimpleSchema">;
|
|
227
|
+
|
|
228
|
+
// @beta
|
|
229
|
+
export function createIndependentTreeBeta<const TSchema extends ImplicitFieldSchema>(options?: ForestOptions): ViewableTree;
|
|
230
|
+
|
|
217
231
|
// @alpha
|
|
218
232
|
export function createSimpleTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue>(view: TreeView<TFieldSchema>, indexer: (schema: TreeNodeSchema) => string | undefined, getValue: (nodes: TreeIndexNodes<TreeNode>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey): SimpleTreeIndex<TKey, TValue>;
|
|
219
233
|
|
|
@@ -226,6 +240,9 @@ export function createSimpleTreeIndex<TFieldSchema extends ImplicitFieldSchema,
|
|
|
226
240
|
// @alpha
|
|
227
241
|
export function createSimpleTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue, TSchema extends TreeNodeSchema>(view: TreeView<TFieldSchema>, indexer: Map<TreeNodeSchema, string>, getValue: (nodes: TreeIndexNodes<NodeFromSchema<TSchema>>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey, indexableSchema: readonly TSchema[]): SimpleTreeIndex<TKey, TValue>;
|
|
228
242
|
|
|
243
|
+
// @alpha
|
|
244
|
+
export function decodeSimpleSchema(encodedSchema: JsonCompatibleReadOnly, validator?: FormatValidator): SimpleTreeSchema;
|
|
245
|
+
|
|
229
246
|
// @public @sealed @system
|
|
230
247
|
interface DefaultProvider extends ErasedType<"@fluidframework/tree.FieldProvider"> {
|
|
231
248
|
}
|
|
@@ -241,6 +258,9 @@ export interface DirtyTreeMap {
|
|
|
241
258
|
// @alpha
|
|
242
259
|
export type DirtyTreeStatus = "new" | "changed" | "moved";
|
|
243
260
|
|
|
261
|
+
// @alpha
|
|
262
|
+
export function encodeSimpleSchema(simpleSchema: SimpleTreeSchema): JsonCompatibleReadOnly;
|
|
263
|
+
|
|
244
264
|
// @beta
|
|
245
265
|
export function enumFromStrings<TScope extends string, const Members extends readonly string[]>(factory: SchemaFactory<TScope>, members: Members): (<TValue extends Members[number]>(value: TValue) => TValue extends unknown ? TreeNode & {
|
|
246
266
|
readonly value: TValue;
|
|
@@ -328,6 +348,8 @@ export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends
|
|
|
328
348
|
get allowedTypesIdentifiers(): ReadonlySet<string>;
|
|
329
349
|
// (undocumented)
|
|
330
350
|
get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined;
|
|
351
|
+
// (undocumented)
|
|
352
|
+
get simpleAllowedTypes(): ReadonlyMap<string, SimpleAllowedTypeAttributes>;
|
|
331
353
|
}
|
|
332
354
|
|
|
333
355
|
// @alpha @sealed @system
|
|
@@ -358,6 +380,7 @@ type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
|
|
|
358
380
|
// @alpha
|
|
359
381
|
export const FluidClientVersion: {
|
|
360
382
|
readonly v2_0: "2.0.0";
|
|
383
|
+
readonly v2_43: "2.43.0";
|
|
361
384
|
readonly v2_52: "2.52.0";
|
|
362
385
|
};
|
|
363
386
|
|
|
@@ -976,6 +999,7 @@ export interface LeafSchema<Name extends string, T extends TreeLeafValue> extend
|
|
|
976
999
|
// @public @sealed
|
|
977
1000
|
export interface Listenable<TListeners extends object> {
|
|
978
1001
|
off<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;
|
|
1002
|
+
// (undocumented)
|
|
979
1003
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
980
1004
|
}
|
|
981
1005
|
|
|
@@ -1290,14 +1314,6 @@ export class SchemaFactoryAlpha<out TScope extends string | undefined = string |
|
|
|
1290
1314
|
static readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata>;
|
|
1291
1315
|
readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata>;
|
|
1292
1316
|
scopedFactoryAlpha<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryAlpha<ScopedSchemaName<TScope, T>, TNameInner>;
|
|
1293
|
-
static staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
|
|
1294
|
-
staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
|
|
1295
|
-
static stagedRecursive: <const T extends unknown>(t: T) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
|
|
1296
|
-
stagedRecursive: <const T extends unknown>(t: T) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
|
|
1297
|
-
static types: <const T extends readonly (LazyItem<TreeNodeSchema> | AnnotatedAllowedType<LazyItem<TreeNodeSchema>>)[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixed<T>;
|
|
1298
|
-
types: <const T extends readonly (LazyItem<TreeNodeSchema> | AnnotatedAllowedType<LazyItem<TreeNodeSchema>>)[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixed<T>;
|
|
1299
|
-
static typesRecursive: <const T extends readonly unknown[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixedUnsafe<T>;
|
|
1300
|
-
typesRecursive: <const T extends readonly unknown[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixedUnsafe<T>;
|
|
1301
1317
|
}
|
|
1302
1318
|
|
|
1303
1319
|
// @beta
|
|
@@ -1311,6 +1327,14 @@ export class SchemaFactoryBeta<out TScope extends string | undefined = string |
|
|
|
1311
1327
|
readonly [x: string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
|
|
1312
1328
|
}, false, T, undefined, TCustomMetadata>;
|
|
1313
1329
|
scopedFactory<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryBeta<ScopedSchemaName<TScope, T>, TNameInner>;
|
|
1330
|
+
static staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
|
|
1331
|
+
staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
|
|
1332
|
+
static stagedRecursive: <const T extends unknown>(t: T) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
|
|
1333
|
+
stagedRecursive: <const T extends unknown>(t: T) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
|
|
1334
|
+
static types: <const T extends readonly (LazyItem<TreeNodeSchema> | AnnotatedAllowedType<LazyItem<TreeNodeSchema>>)[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixed<T>;
|
|
1335
|
+
types: <const T extends readonly (LazyItem<TreeNodeSchema> | AnnotatedAllowedType<LazyItem<TreeNodeSchema>>)[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixed<T>;
|
|
1336
|
+
static typesRecursive: <const T extends readonly unknown[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixedUnsafe<T>;
|
|
1337
|
+
typesRecursive: <const T extends readonly unknown[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixedUnsafe<T>;
|
|
1314
1338
|
}
|
|
1315
1339
|
|
|
1316
1340
|
// @public @sealed @system
|
|
@@ -1333,8 +1357,8 @@ export interface SchemaStatics {
|
|
|
1333
1357
|
readonly string: LeafSchema<"string", string>;
|
|
1334
1358
|
}
|
|
1335
1359
|
|
|
1336
|
-
// @
|
|
1337
|
-
export interface
|
|
1360
|
+
// @beta @sealed @system
|
|
1361
|
+
export interface SchemaStaticsBeta {
|
|
1338
1362
|
readonly staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
|
|
1339
1363
|
stagedRecursive: <const T extends Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>>(t: T) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
|
|
1340
1364
|
readonly types: <const T extends readonly (AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[]>(t: T, metadata?: AllowedTypesMetadata) => AllowedTypesFullFromMixed<T>;
|
|
@@ -1360,7 +1384,6 @@ export const SharedTree: SharedObjectKind<ITree>;
|
|
|
1360
1384
|
|
|
1361
1385
|
// @alpha @input
|
|
1362
1386
|
export interface SharedTreeFormatOptions {
|
|
1363
|
-
formatVersion: SharedTreeFormatVersion[keyof SharedTreeFormatVersion];
|
|
1364
1387
|
treeEncodeType: TreeCompressionStrategy;
|
|
1365
1388
|
}
|
|
1366
1389
|
|
|
@@ -1377,22 +1400,29 @@ export const SharedTreeFormatVersion: {
|
|
|
1377
1400
|
export type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;
|
|
1378
1401
|
|
|
1379
1402
|
// @alpha @input
|
|
1380
|
-
export
|
|
1403
|
+
export interface SharedTreeOptions extends Partial<CodecWriteOptions>, Partial<SharedTreeFormatOptions>, SharedTreeOptionsBeta {
|
|
1404
|
+
readonly enableSharedBranches?: boolean;
|
|
1405
|
+
}
|
|
1381
1406
|
|
|
1382
1407
|
// @beta @input
|
|
1383
1408
|
export type SharedTreeOptionsBeta = ForestOptions;
|
|
1384
1409
|
|
|
1410
|
+
// @alpha @sealed
|
|
1411
|
+
export interface SimpleAllowedTypeAttributes {
|
|
1412
|
+
readonly isStaged: boolean | undefined;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1385
1415
|
// @alpha @sealed
|
|
1386
1416
|
export interface SimpleArrayNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Array, TCustomMetadata> {
|
|
1387
|
-
readonly
|
|
1417
|
+
readonly simpleAllowedTypes: ReadonlyMap<string, SimpleAllowedTypeAttributes>;
|
|
1388
1418
|
}
|
|
1389
1419
|
|
|
1390
1420
|
// @alpha @sealed
|
|
1391
1421
|
export interface SimpleFieldSchema {
|
|
1392
|
-
readonly allowedTypesIdentifiers: ReadonlySet<string>;
|
|
1393
1422
|
readonly kind: FieldKind;
|
|
1394
1423
|
readonly metadata: FieldSchemaMetadata;
|
|
1395
1424
|
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
1425
|
+
readonly simpleAllowedTypes: ReadonlyMap<string, SimpleAllowedTypeAttributes>;
|
|
1396
1426
|
}
|
|
1397
1427
|
|
|
1398
1428
|
// @alpha @sealed
|
|
@@ -1402,7 +1432,7 @@ export interface SimpleLeafNodeSchema extends SimpleNodeSchemaBaseAlpha<NodeKind
|
|
|
1402
1432
|
|
|
1403
1433
|
// @alpha @sealed
|
|
1404
1434
|
export interface SimpleMapNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Map, TCustomMetadata> {
|
|
1405
|
-
readonly
|
|
1435
|
+
readonly simpleAllowedTypes: ReadonlyMap<string, SimpleAllowedTypeAttributes>;
|
|
1406
1436
|
}
|
|
1407
1437
|
|
|
1408
1438
|
// @alpha
|
|
@@ -1426,12 +1456,13 @@ export interface SimpleObjectFieldSchema extends SimpleFieldSchema {
|
|
|
1426
1456
|
|
|
1427
1457
|
// @alpha @sealed
|
|
1428
1458
|
export interface SimpleObjectNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Object, TCustomMetadata> {
|
|
1459
|
+
readonly allowUnknownOptionalFields: boolean | undefined;
|
|
1429
1460
|
readonly fields: ReadonlyMap<string, SimpleObjectFieldSchema>;
|
|
1430
1461
|
}
|
|
1431
1462
|
|
|
1432
1463
|
// @alpha @sealed
|
|
1433
1464
|
export interface SimpleRecordNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Record, TCustomMetadata> {
|
|
1434
|
-
readonly
|
|
1465
|
+
readonly simpleAllowedTypes: ReadonlyMap<string, SimpleAllowedTypeAttributes>;
|
|
1435
1466
|
}
|
|
1436
1467
|
|
|
1437
1468
|
// @alpha
|
|
@@ -2054,14 +2085,14 @@ export type UnannotateAllowedTypesList<T extends readonly (AnnotatedAllowedType
|
|
|
2054
2085
|
[I in keyof T]: T[I] extends AnnotatedAllowedType<infer X> ? X : T[I];
|
|
2055
2086
|
};
|
|
2056
2087
|
|
|
2057
|
-
// @
|
|
2088
|
+
// @beta @sealed @system
|
|
2058
2089
|
export type UnannotateAllowedTypesListUnsafe<T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[]> = {
|
|
2059
2090
|
readonly [I in keyof T]: T[I] extends {
|
|
2060
2091
|
type: infer X;
|
|
2061
2092
|
} ? X : T[I];
|
|
2062
2093
|
};
|
|
2063
2094
|
|
|
2064
|
-
// @
|
|
2095
|
+
// @beta @sealed @system
|
|
2065
2096
|
export type UnannotateAllowedTypeUnsafe<T extends Unenforced<AnnotatedAllowedTypeUnsafe | LazyItem<System_Unsafe.TreeNodeSchemaUnsafe>>> = T extends AnnotatedAllowedTypeUnsafe<infer X> ? X : T;
|
|
2066
2097
|
|
|
2067
2098
|
// @public
|