fluid-framework 2.90.0-378676 → 2.91.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 +342 -0
- package/api-report/fluid-framework.alpha.api.md +144 -40
- package/api-report/fluid-framework.beta.api.md +30 -0
- package/api-report/fluid-framework.legacy.beta.api.md +31 -1
- package/dist/alpha.d.ts +20 -6
- package/dist/beta.d.ts +4 -1
- package/dist/legacy.d.ts +4 -1
- package/lib/alpha.d.ts +20 -6
- package/lib/beta.d.ts +4 -1
- package/lib/legacy.d.ts +4 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,347 @@
|
|
|
1
1
|
# fluid-framework
|
|
2
2
|
|
|
3
|
+
## 2.91.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Adds withDefault API to allow defining default values for required and optional fields ([#26502](https://github.com/microsoft/FluidFramework/pull/26502)) [44fdd9421e4](https://github.com/microsoft/FluidFramework/commit/44fdd9421e4d0bfa3cdfa9ab3672ebf3c0ad20a6)
|
|
8
|
+
|
|
9
|
+
The `withDefault` API is now available on `SchemaFactoryAlpha`. It allows you to specify default values for fields,
|
|
10
|
+
making them optional in constructors even when the field is marked as required in the schema.
|
|
11
|
+
This provides a better developer experience by reducing boilerplate when creating objects.
|
|
12
|
+
|
|
13
|
+
The `withDefault` API wraps a field schema and defines a default value to use when the field is not provided during
|
|
14
|
+
construction. The default value must be of an allowed type of the field. You can provide defaults in two ways:
|
|
15
|
+
- **A value**: When a value is provided directly, the data is copied for each use to ensure independence between instances
|
|
16
|
+
- **A generator function**: A function that is called each time to produce a fresh value
|
|
17
|
+
|
|
18
|
+
Defaults are evaluated eagerly during node construction.
|
|
19
|
+
|
|
20
|
+
#### Required fields with defaults
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { SchemaFactoryAlpha, TreeAlpha } from "@fluidframework/tree/alpha";
|
|
24
|
+
|
|
25
|
+
const sf = new SchemaFactoryAlpha("example");
|
|
26
|
+
|
|
27
|
+
class Person extends sf.objectAlpha("Person", {
|
|
28
|
+
name: sf.required(sf.string),
|
|
29
|
+
age: sf.withDefault(sf.required(sf.number), -1),
|
|
30
|
+
role: sf.withDefault(sf.required(sf.string), "guest"),
|
|
31
|
+
}) {}
|
|
32
|
+
|
|
33
|
+
// Before: all fields were required
|
|
34
|
+
// const person = new Person({ name: "Alice", age: -1, role: "guest" });
|
|
35
|
+
|
|
36
|
+
// After: fields with defaults are optional
|
|
37
|
+
const person = new Person({ name: "Alice" });
|
|
38
|
+
// person.age === -1
|
|
39
|
+
// person.role === "guest"
|
|
40
|
+
|
|
41
|
+
// You can still provide values to override the defaults
|
|
42
|
+
const admin = new Person({ name: "Bob", age: 30, role: "admin" });
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Optional fields with custom defaults
|
|
46
|
+
|
|
47
|
+
Optional fields (`sf.optional`) already default to `undefined`, but `withDefault` allows you to specify a different
|
|
48
|
+
default value:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
class Config extends sf.object("Config", {
|
|
52
|
+
timeout: sf.withDefault(sf.optional(sf.number), 5000),
|
|
53
|
+
retries: sf.withDefault(sf.optional(sf.number), 3),
|
|
54
|
+
}) {}
|
|
55
|
+
|
|
56
|
+
// All fields are optional, using custom defaults when not provided
|
|
57
|
+
const config = new Config({});
|
|
58
|
+
// config.timeout === 5000
|
|
59
|
+
// config.retries === 3
|
|
60
|
+
|
|
61
|
+
const customConfig = new Config({ timeout: 10000 });
|
|
62
|
+
// customConfig.timeout === 10000
|
|
63
|
+
// customConfig.retries === 3
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Value defaults vs function defaults
|
|
67
|
+
|
|
68
|
+
When you provide a value directly, the data is copied for each use, ensuring each instance is independent:
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
class Metadata extends sf.object("Metadata", {
|
|
72
|
+
tags: sf.array(sf.string),
|
|
73
|
+
version: sf.number,
|
|
74
|
+
}) {}
|
|
75
|
+
|
|
76
|
+
class Article extends sf.object("Article", {
|
|
77
|
+
title: sf.required(sf.string),
|
|
78
|
+
|
|
79
|
+
// a node is provided directly, it is copied for each use
|
|
80
|
+
metadata: sf.withDefault(
|
|
81
|
+
sf.optional(Metadata),
|
|
82
|
+
new Metadata({ tags: [], version: 1 }),
|
|
83
|
+
),
|
|
84
|
+
|
|
85
|
+
// also works with arrays
|
|
86
|
+
authors: sf.withDefault(sf.optional(sf.array(sf.string)), []),
|
|
87
|
+
}) {}
|
|
88
|
+
|
|
89
|
+
const article1 = new Article({ title: "First" });
|
|
90
|
+
const article2 = new Article({ title: "Second" });
|
|
91
|
+
|
|
92
|
+
// each article gets its own independent copy
|
|
93
|
+
assert(article1.metadata !== article2.metadata);
|
|
94
|
+
article1.metadata.version = 2; // Doesn't affect article2
|
|
95
|
+
assert(article2.metadata.version === 1);
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Alternatively, you can use generator functions to explicitly create new instances:
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
class Article extends sf.object("Article", {
|
|
102
|
+
title: sf.required(sf.string),
|
|
103
|
+
|
|
104
|
+
// generators are called each time to create a new instance
|
|
105
|
+
metadata: sf.withDefault(
|
|
106
|
+
sf.optional(Metadata),
|
|
107
|
+
() => new Metadata({ tags: [], version: 1 }),
|
|
108
|
+
),
|
|
109
|
+
authors: sf.withDefault(sf.optional(sf.array(sf.string)), () => []),
|
|
110
|
+
}) {}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Insertable object literals, arrays, and map objects can be used in place of node instances in both static defaults
|
|
114
|
+
and generator functions:
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
class Article extends sf.object("Article", {
|
|
118
|
+
title: sf.required(sf.string),
|
|
119
|
+
|
|
120
|
+
// plain object literal instead of new Metadata(...)
|
|
121
|
+
metadata: sf.withDefault(sf.optional(Metadata), () => ({
|
|
122
|
+
tags: [],
|
|
123
|
+
version: 1,
|
|
124
|
+
})),
|
|
125
|
+
|
|
126
|
+
// plain array instead of new ArrayNode(...)
|
|
127
|
+
authors: sf.withDefault(sf.optional(sf.array(sf.string)), () => [
|
|
128
|
+
"anonymous",
|
|
129
|
+
]),
|
|
130
|
+
}) {}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
##### Dynamic defaults
|
|
134
|
+
|
|
135
|
+
Generator functions are called each time a new node is created, enabling dynamic defaults:
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
class Document extends sf.object("Document", {
|
|
139
|
+
id: sf.withDefault(sf.required(sf.string), () => crypto.randomUUID()),
|
|
140
|
+
title: sf.required(sf.string),
|
|
141
|
+
}) {}
|
|
142
|
+
|
|
143
|
+
const doc1 = new Document({ title: "First Document" });
|
|
144
|
+
const doc2 = new Document({ title: "Second Document" });
|
|
145
|
+
// doc1.id !== doc2.id (each gets a unique UUID)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Generator functions also work with primitive types:
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
let counter = 0;
|
|
152
|
+
|
|
153
|
+
class GameState extends sf.object("GameState", {
|
|
154
|
+
playerId: sf.withDefault(
|
|
155
|
+
sf.required(sf.string),
|
|
156
|
+
() => `player-${counter++}`,
|
|
157
|
+
),
|
|
158
|
+
score: sf.withDefault(sf.required(sf.number), () =>
|
|
159
|
+
Math.floor(Math.random() * 100),
|
|
160
|
+
),
|
|
161
|
+
isActive: sf.withDefault(sf.required(sf.boolean), () => counter % 2 === 0),
|
|
162
|
+
}) {}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
#### Recursive types
|
|
166
|
+
|
|
167
|
+
`withDefaultRecursive` is available for use inside recursive schemas. Use `objectRecursiveAlpha` (rather than
|
|
168
|
+
`objectRecursive`) when defining recursive schemas with defaults, as it correctly makes defaulted fields optional in
|
|
169
|
+
the constructor for all field kinds including `requiredRecursive`. It works the same as `withDefault` but is
|
|
170
|
+
necessary to avoid TypeScript's circular reference limitations.
|
|
171
|
+
|
|
172
|
+
```typescript
|
|
173
|
+
class TreeNode extends sf.objectRecursiveAlpha("TreeNode", {
|
|
174
|
+
value: sf.number,
|
|
175
|
+
label: SchemaFactoryAlpha.withDefaultRecursive(
|
|
176
|
+
sf.optional(sf.string),
|
|
177
|
+
"untitled",
|
|
178
|
+
),
|
|
179
|
+
child: sf.optionalRecursive([() => TreeNode]),
|
|
180
|
+
}) {}
|
|
181
|
+
|
|
182
|
+
// `label` is optional in the constructor — the default is used when omitted
|
|
183
|
+
const leaf = new TreeNode({ value: 1 });
|
|
184
|
+
// leaf.label === "untitled"
|
|
185
|
+
|
|
186
|
+
const root = new TreeNode({ value: 0, label: "root", child: leaf });
|
|
187
|
+
// root.label === "root"
|
|
188
|
+
// root.child.label === "untitled"
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
> **Warning:** Be careful about using the recursive type itself as a default value — this is likely to cause
|
|
192
|
+
> infinite recursion at construction time, since creating the default value would trigger the same default again.
|
|
193
|
+
> Instead, use a primitive or a separate node type as the default:
|
|
194
|
+
>
|
|
195
|
+
> ```typescript
|
|
196
|
+
> const DefaultTag = sf.objectRecursiveAlpha("Tag", {
|
|
197
|
+
> id: sf.number,
|
|
198
|
+
> child: sf.optionalRecursive([() => TreeNode]),
|
|
199
|
+
> });
|
|
200
|
+
>
|
|
201
|
+
> class TreeNode extends sf.objectRecursiveAlpha("TreeNode", {
|
|
202
|
+
> value: sf.number,
|
|
203
|
+
> // ✅ Safe: default is a non-recursive node
|
|
204
|
+
> tag: SchemaFactoryAlpha.withDefaultRecursive(
|
|
205
|
+
> sf.optional(DefaultTag),
|
|
206
|
+
> () => new DefaultTag({ id: 0, child: new DefaultTag({ id: 1 }) }),
|
|
207
|
+
> ),
|
|
208
|
+
> child: sf.optionalRecursive([() => TreeNode]),
|
|
209
|
+
> }) {}
|
|
210
|
+
> ```
|
|
211
|
+
>
|
|
212
|
+
> The following definition for child would cause infinite recursion at construction time:
|
|
213
|
+
>
|
|
214
|
+
> ```typescript
|
|
215
|
+
> child: SchemaFactoryAlpha.withDefaultRecursive(
|
|
216
|
+
> sf.optionalRecursive([() => TreeNode]),
|
|
217
|
+
> () => new TreeNode({ value: 0 }),
|
|
218
|
+
> );
|
|
219
|
+
> ```
|
|
220
|
+
|
|
221
|
+
> The infinite recursion can be solved by passing in undefined explicitly but it is
|
|
222
|
+
> recommended to not use defaults in this case:
|
|
223
|
+
>
|
|
224
|
+
> ```typescript
|
|
225
|
+
> child: SchemaFactoryAlpha.withDefaultRecursive(
|
|
226
|
+
> sf.optionalRecursive([() => TreeNode]),
|
|
227
|
+
> () => new TreeNode({ value: 0, child: undefined }),
|
|
228
|
+
> );
|
|
229
|
+
> ```
|
|
230
|
+
|
|
231
|
+
#### Type safety
|
|
232
|
+
|
|
233
|
+
The default value (or the value returned by a generator function) must be of an allowed type for the field. TypeScript
|
|
234
|
+
enforces this at compile time:
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
// ✅ Valid: number default for number field
|
|
238
|
+
sf.withDefault(sf.optional(sf.number), 8080);
|
|
239
|
+
|
|
240
|
+
// ✅ Valid: generator returns string for string field
|
|
241
|
+
sf.withDefault(sf.optional(sf.string), () => "localhost");
|
|
242
|
+
|
|
243
|
+
// ❌ TypeScript error: string default for number field
|
|
244
|
+
sf.withDefault(sf.optional(sf.number), "8080");
|
|
245
|
+
|
|
246
|
+
// ❌ TypeScript error: generator returns number for string field
|
|
247
|
+
sf.withDefault(sf.optional(sf.string), () => 8080);
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## 2.90.0
|
|
251
|
+
|
|
252
|
+
### Minor Changes
|
|
253
|
+
|
|
254
|
+
- Add alpha TextAsTree domain for collaboratively editable text ([#26568](https://github.com/microsoft/FluidFramework/pull/26568)) [06736bd81de](https://github.com/microsoft/FluidFramework/commit/06736bd81dea4c8e44cb13304f471a7b1bca42bd)
|
|
255
|
+
|
|
256
|
+
A newly exported `TextAsTree` alpha namespace has been added with an initial version of collaboratively editable text.
|
|
257
|
+
Users of SharedTree can add `TextAsTree.Tree` nodes to their tree to experiment with it.
|
|
258
|
+
|
|
259
|
+
- Added new TreeAlpha.context(node) API ([#26432](https://github.com/microsoft/FluidFramework/pull/26432)) [ffa62f45e2c](https://github.com/microsoft/FluidFramework/commit/ffa62f45e2ca6c6106c67ed94f69359336823516)
|
|
260
|
+
|
|
261
|
+
This release introduces a node-scoped context that works for both hydrated and [unhydrated](https://fluidframework.com/docs/api/fluid-framework/unhydrated-typealias) [TreeNodes](https://fluidframework.com/docs/api/fluid-framework/treenode-class).
|
|
262
|
+
The new `TreeContextAlpha` interface exposes `runTransaction` / `runTransactionAsync` methods and an `isBranch()` type guard.
|
|
263
|
+
`TreeBranchAlpha` now extends `TreeContextAlpha`, so you can keep using branch APIs when available.
|
|
264
|
+
|
|
265
|
+
#### Migration
|
|
266
|
+
|
|
267
|
+
If you previously used `TreeAlpha.branch(node)` to discover a branch, switch to `TreeAlpha.context(node)` and check `isBranch()`:
|
|
268
|
+
|
|
269
|
+
```ts
|
|
270
|
+
import { TreeAlpha } from "@fluidframework/tree/alpha";
|
|
271
|
+
|
|
272
|
+
const context = TreeAlpha.context(node);
|
|
273
|
+
if (context.isBranch()) {
|
|
274
|
+
// Same branch APIs as before
|
|
275
|
+
context.fork();
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
`TreeAlpha.branch(node)` is now deprecated.
|
|
280
|
+
Prefer the context API above.
|
|
281
|
+
|
|
282
|
+
#### New transaction entry point
|
|
283
|
+
|
|
284
|
+
You can now run transactions from a node context, regardless of whether the node is hydrated:
|
|
285
|
+
|
|
286
|
+
```ts
|
|
287
|
+
// A synchronous transaction without a return value
|
|
288
|
+
const context = TreeAlpha.context(node);
|
|
289
|
+
context.runTransaction(() => {
|
|
290
|
+
node.count += 1;
|
|
291
|
+
});
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
```ts
|
|
295
|
+
// An asynchronous transaction with a return value
|
|
296
|
+
const context = TreeAlpha.context(node);
|
|
297
|
+
const result = await context.runTransactionAsync(async () => {
|
|
298
|
+
await doWork(node);
|
|
299
|
+
return { value: node.foo };
|
|
300
|
+
});
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
- Promote checkSchemaCompatibilitySnapshots to beta ([#26288](https://github.com/microsoft/FluidFramework/pull/26288)) [eb4ef62672d](https://github.com/microsoft/FluidFramework/commit/eb4ef62672d33f6a903e3726b58d1f65c24d9150)
|
|
304
|
+
|
|
305
|
+
[`checkSchemaCompatibilitySnapshots`](https://fluidframework.com/docs/api/fluid-framework#checkschemacompatibilitysnapshots-function) has been promoted to `@beta`.
|
|
306
|
+
It is recommended that all SharedTree applications use this API to write schema compatibility tests.
|
|
307
|
+
|
|
308
|
+
Usage should look something like:
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
import fs from "node:fs";
|
|
312
|
+
import path from "node:path";
|
|
313
|
+
|
|
314
|
+
import { snapshotSchemaCompatibility } from "@fluidframework/tree/beta";
|
|
315
|
+
|
|
316
|
+
// The TreeViewConfiguration the application uses, which contains the application's schema.
|
|
317
|
+
import { treeViewConfiguration } from "./schema.js";
|
|
318
|
+
// The next version of the application which will be released.
|
|
319
|
+
import { packageVersion } from "./version.js";
|
|
320
|
+
|
|
321
|
+
// Provide some way to run the check in "update" mode when updating snapshots is intended.
|
|
322
|
+
const regenerateSnapshots = process.argv.includes("--snapshot");
|
|
323
|
+
|
|
324
|
+
// Setup the actual test. In this case using Mocha syntax.
|
|
325
|
+
describe("schema", () => {
|
|
326
|
+
it("schema compatibility", () => {
|
|
327
|
+
// Select a path to save the snapshots in.
|
|
328
|
+
// This will depend on how your application organizes its test data.
|
|
329
|
+
const snapshotDirectory = path.join(
|
|
330
|
+
import.meta.dirname,
|
|
331
|
+
"../../../src/test/snapshotCompatibilityCheckerExample/schema-snapshots",
|
|
332
|
+
);
|
|
333
|
+
snapshotSchemaCompatibility({
|
|
334
|
+
snapshotDirectory,
|
|
335
|
+
fileSystem: { ...fs, ...path },
|
|
336
|
+
version: packageVersion,
|
|
337
|
+
minVersionForCollaboration: "2.0.0",
|
|
338
|
+
schema: treeViewConfiguration,
|
|
339
|
+
mode: regenerateSnapshots ? "update" : "assert",
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
```
|
|
344
|
+
|
|
3
345
|
## 2.83.0
|
|
4
346
|
|
|
5
347
|
### Minor Changes
|
|
@@ -258,16 +258,16 @@ export type CreateIndependentTreeAlphaOptions = ForestOptions & ((IndependentVie
|
|
|
258
258
|
export function createIndependentTreeBeta<const TSchema extends ImplicitFieldSchema>(options?: ForestOptions): ViewableTree;
|
|
259
259
|
|
|
260
260
|
// @alpha
|
|
261
|
-
export function
|
|
261
|
+
export function createTreeIndex<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): TreeIndex<TKey, TValue>;
|
|
262
262
|
|
|
263
263
|
// @alpha
|
|
264
|
-
export function
|
|
264
|
+
export function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue, TSchema extends TreeNodeSchema>(view: TreeView<TFieldSchema>, indexer: (schema: TSchema) => string | undefined, getValue: (nodes: TreeIndexNodes<NodeFromSchema<TSchema>>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey, indexableSchema: readonly TSchema[]): TreeIndex<TKey, TValue>;
|
|
265
265
|
|
|
266
266
|
// @alpha
|
|
267
|
-
export function
|
|
267
|
+
export function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue>(view: TreeView<TFieldSchema>, indexer: Map<TreeNodeSchema, string>, getValue: (nodes: TreeIndexNodes<TreeNode>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey): TreeIndex<TKey, TValue>;
|
|
268
268
|
|
|
269
269
|
// @alpha
|
|
270
|
-
export function
|
|
270
|
+
export function createTreeIndex<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[]): TreeIndex<TKey, TValue>;
|
|
271
271
|
|
|
272
272
|
// @alpha
|
|
273
273
|
export function decodeSchemaCompatibilitySnapshot(encodedSchema: JsonCompatibleReadOnly, validator?: FormatValidator): SimpleTreeSchema;
|
|
@@ -307,6 +307,15 @@ export abstract class ErasedBaseType<out Name = unknown> {
|
|
|
307
307
|
protected abstract brand(dummy: never): Name;
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
+
// @alpha
|
|
311
|
+
export type ErasedNode<TExtra, Identifier extends string> = TExtra & TreeNode & WithType<Identifier>;
|
|
312
|
+
|
|
313
|
+
// @alpha
|
|
314
|
+
export type ErasedSchema<NodeType extends TreeNode> = TreeNodeSchema<NodeType extends WithType<infer Identifier> ? Identifier : string, NodeKind, NodeType, never, false>;
|
|
315
|
+
|
|
316
|
+
// @alpha
|
|
317
|
+
export type ErasedSchemaSubclassable<TExtra, Identifier extends string> = TreeNodeSchemaClass<Identifier, NodeKind, ErasedNode<TExtra, Identifier>, never, false>;
|
|
318
|
+
|
|
310
319
|
// @public @sealed
|
|
311
320
|
export abstract class ErasedType<out Name = unknown> {
|
|
312
321
|
static [Symbol.hasInstance](value: never): value is never;
|
|
@@ -356,6 +365,18 @@ type FieldHasDefault<T extends ImplicitFieldSchema> = [T] extends [
|
|
|
356
365
|
FieldSchema<FieldKind.Optional | FieldKind.Identifier>
|
|
357
366
|
] ? true : false;
|
|
358
367
|
|
|
368
|
+
// @alpha @system
|
|
369
|
+
export type FieldHasDefaultAlpha<T extends ImplicitFieldSchema> = [
|
|
370
|
+
T
|
|
371
|
+
] extends [FieldSchemaAlpha<infer Kind, infer _Types, infer _Meta, infer TProps>] ? Kind extends FieldKind.Optional | FieldKind.Identifier ? true : TProps extends {
|
|
372
|
+
defaultProvider: DefaultProvider;
|
|
373
|
+
} ? true : false : FieldHasDefault<T>;
|
|
374
|
+
|
|
375
|
+
// @alpha @sealed @system
|
|
376
|
+
export type FieldHasDefaultAlphaUnsafe<T extends System_Unsafe.ImplicitFieldSchemaUnsafe> = T extends FieldSchemaAlphaUnsafe<infer Kind, System_Unsafe.ImplicitAllowedTypesUnsafe, unknown, infer TProps> ? Kind extends FieldKind.Optional | FieldKind.Identifier ? true : TProps extends {
|
|
377
|
+
defaultProvider: DefaultProvider;
|
|
378
|
+
} ? true : false : System_Unsafe.FieldHasDefaultUnsafe<T>;
|
|
379
|
+
|
|
359
380
|
// @public
|
|
360
381
|
export enum FieldKind {
|
|
361
382
|
Identifier = 2,
|
|
@@ -391,7 +412,7 @@ export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types exten
|
|
|
391
412
|
}
|
|
392
413
|
|
|
393
414
|
// @alpha @sealed
|
|
394
|
-
export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, TCustomMetadata = unknown> extends FieldSchema<Kind, Types, TCustomMetadata> implements SimpleFieldSchema<SchemaType.View> {
|
|
415
|
+
export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, TCustomMetadata = unknown, TProps extends FieldPropsAlpha<TCustomMetadata> | undefined = FieldPropsAlpha<TCustomMetadata> | undefined> extends FieldSchema<Kind, Types, TCustomMetadata> implements SimpleFieldSchema<SchemaType.View> {
|
|
395
416
|
protected constructor(kind: Kind, types: Types, props?: FieldPropsAlpha<TCustomMetadata>);
|
|
396
417
|
readonly allowedTypesFull: AllowedTypesFull;
|
|
397
418
|
// (undocumented)
|
|
@@ -403,7 +424,7 @@ export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends
|
|
|
403
424
|
}
|
|
404
425
|
|
|
405
426
|
// @alpha @sealed @system
|
|
406
|
-
export interface FieldSchemaAlphaUnsafe<out Kind extends FieldKind, out Types extends System_Unsafe.ImplicitAllowedTypesUnsafe, out TCustomMetadata = unknown> extends FieldSchemaAlpha<Kind, any, TCustomMetadata>, System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata> {
|
|
427
|
+
export interface FieldSchemaAlphaUnsafe<out Kind extends FieldKind, out Types extends System_Unsafe.ImplicitAllowedTypesUnsafe, out TCustomMetadata = unknown, out TProps extends FieldPropsAlpha<TCustomMetadata> | undefined = undefined> extends FieldSchemaAlpha<Kind, any, TCustomMetadata, TProps>, System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata> {
|
|
407
428
|
readonly allowedTypes: Types;
|
|
408
429
|
}
|
|
409
430
|
|
|
@@ -533,7 +554,7 @@ export interface IConnection {
|
|
|
533
554
|
export type ICriticalContainerError = IErrorBase;
|
|
534
555
|
|
|
535
556
|
// @alpha
|
|
536
|
-
export type IdentifierIndex =
|
|
557
|
+
export type IdentifierIndex = TreeIndex<string, TreeNode>;
|
|
537
558
|
|
|
538
559
|
// @public @sealed
|
|
539
560
|
export interface IDisposable {
|
|
@@ -838,6 +859,22 @@ type InsertableObjectFromSchemaRecord<T extends RestrictiveStringRecord<Implicit
|
|
|
838
859
|
readonly [Property in keyof T as FieldHasDefault<T[Property & string]> extends false ? Property : never]: InsertableTreeFieldFromImplicitField<T[Property & string]>;
|
|
839
860
|
}>;
|
|
840
861
|
|
|
862
|
+
// @alpha @system
|
|
863
|
+
export type InsertableObjectFromSchemaRecordAlpha<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = RestrictiveStringRecord<ImplicitFieldSchema> extends T ? {
|
|
864
|
+
arbitraryKey: "arbitraryValue";
|
|
865
|
+
} extends T ? Record<string, never> : never : FlattenKeys<{
|
|
866
|
+
readonly [Property in keyof T]?: InsertableTreeFieldFromImplicitField<T[Property & string]>;
|
|
867
|
+
} & {
|
|
868
|
+
readonly [Property in keyof T as FieldHasDefaultAlpha<T[Property & string]> extends false ? Property : never]: InsertableTreeFieldFromImplicitField<T[Property & string]>;
|
|
869
|
+
}>;
|
|
870
|
+
|
|
871
|
+
// @alpha @system
|
|
872
|
+
export type InsertableObjectFromSchemaRecordAlphaUnsafe<T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>> = {
|
|
873
|
+
readonly [Property in keyof T as FieldHasDefaultAlphaUnsafe<T[Property & string]> extends false ? Property : never]: System_Unsafe.InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;
|
|
874
|
+
} & {
|
|
875
|
+
readonly [Property in keyof T as FieldHasDefaultAlphaUnsafe<T[Property & string]> extends true ? Property : never]?: System_Unsafe.InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;
|
|
876
|
+
};
|
|
877
|
+
|
|
841
878
|
// @public
|
|
842
879
|
export type InsertableTreeFieldFromImplicitField<TSchemaInput extends ImplicitFieldSchema, TSchema = UnionToIntersection<TSchemaInput>> = [TSchema] extends [FieldSchema<infer Kind, infer Types>] ? ApplyKindInput<InsertableTreeNodeFromImplicitAllowedTypes<Types>, Kind, true> : [TSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TSchema> : never;
|
|
843
880
|
|
|
@@ -1060,6 +1097,12 @@ export enum KeyEncodingOptions {
|
|
|
1060
1097
|
usePropertyKeys = "usePropertyKeys"
|
|
1061
1098
|
}
|
|
1062
1099
|
|
|
1100
|
+
// @alpha @sealed
|
|
1101
|
+
export interface LabelTree {
|
|
1102
|
+
label: unknown;
|
|
1103
|
+
sublabels: LabelTree[];
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1063
1106
|
// @public
|
|
1064
1107
|
export type LazyItem<Item = unknown> = Item | (() => Item);
|
|
1065
1108
|
|
|
@@ -1084,6 +1127,7 @@ export interface LocalChangeMetadata extends CommitMetadata {
|
|
|
1084
1127
|
getRevertible(onDisposed?: (revertible: RevertibleAlpha) => void): RevertibleAlpha | undefined;
|
|
1085
1128
|
readonly isLocal: true;
|
|
1086
1129
|
readonly label?: unknown;
|
|
1130
|
+
readonly labels: TransactionLabels;
|
|
1087
1131
|
}
|
|
1088
1132
|
|
|
1089
1133
|
// @public @sealed
|
|
@@ -1162,6 +1206,9 @@ export enum NodeKind {
|
|
|
1162
1206
|
Record = 4
|
|
1163
1207
|
}
|
|
1164
1208
|
|
|
1209
|
+
// @alpha @sealed
|
|
1210
|
+
export type NodeProvider<T> = T | (() => T);
|
|
1211
|
+
|
|
1165
1212
|
// @public @sealed
|
|
1166
1213
|
export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
1167
1214
|
readonly custom?: TCustomMetadata | undefined;
|
|
@@ -1192,7 +1239,7 @@ export type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFie
|
|
|
1192
1239
|
};
|
|
1193
1240
|
|
|
1194
1241
|
// @alpha @sealed
|
|
1195
|
-
export interface ObjectNodeSchema<out TName extends string = string, in out T extends RestrictiveStringRecord<ImplicitFieldSchema> = RestrictiveStringRecord<ImplicitFieldSchema>, ImplicitlyConstructable extends boolean = boolean, out TCustomMetadata = unknown> extends TreeNodeSchemaClass<TName, NodeKind.Object, TreeObjectNode<T, TName>,
|
|
1242
|
+
export interface ObjectNodeSchema<out TName extends string = string, in out T extends RestrictiveStringRecord<ImplicitFieldSchema> = RestrictiveStringRecord<ImplicitFieldSchema>, ImplicitlyConstructable extends boolean = boolean, out TCustomMetadata = unknown> extends TreeNodeSchemaClass<TName, NodeKind.Object, TreeObjectNode<T, TName>, object & InsertableObjectFromSchemaRecordAlpha<T>, ImplicitlyConstructable, T, never, TCustomMetadata>, SimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> {
|
|
1196
1243
|
readonly fields: ReadonlyMap<string, FieldSchemaAlpha & SimpleObjectFieldSchema>;
|
|
1197
1244
|
}
|
|
1198
1245
|
|
|
@@ -1201,6 +1248,11 @@ export const ObjectNodeSchema: {
|
|
|
1201
1248
|
readonly [Symbol.hasInstance]: (value: TreeNodeSchema) => value is ObjectNodeSchema<string, RestrictiveStringRecord<ImplicitFieldSchema>, boolean, unknown>;
|
|
1202
1249
|
};
|
|
1203
1250
|
|
|
1251
|
+
// @alpha @sealed
|
|
1252
|
+
export type ObjectNodeSchemaWorkaround<TName extends string = string, T extends RestrictiveStringRecord<ImplicitFieldSchema> = RestrictiveStringRecord<ImplicitFieldSchema>, ImplicitlyConstructable extends boolean = boolean, TCustomMetadata = unknown> = ObjectNodeSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> & {
|
|
1253
|
+
readonly createFromInsertable: unknown;
|
|
1254
|
+
};
|
|
1255
|
+
|
|
1204
1256
|
// @beta @input
|
|
1205
1257
|
export interface ObjectSchemaOptions<TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
|
|
1206
1258
|
readonly allowUnknownOptionalFields?: boolean;
|
|
@@ -1265,6 +1317,7 @@ export interface RemoteChangeMetadata extends CommitMetadata {
|
|
|
1265
1317
|
readonly getRevertible?: undefined;
|
|
1266
1318
|
readonly isLocal: false;
|
|
1267
1319
|
readonly label?: undefined;
|
|
1320
|
+
readonly labels: TransactionLabels;
|
|
1268
1321
|
}
|
|
1269
1322
|
|
|
1270
1323
|
// @alpha
|
|
@@ -1385,28 +1438,39 @@ export const SchemaFactory_base: SchemaStatics & (new () => SchemaStatics);
|
|
|
1385
1438
|
export class SchemaFactoryAlpha<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactoryBeta<TScope, TName> {
|
|
1386
1439
|
arrayAlpha<const Name extends TName, const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): ArrayNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
1387
1440
|
arrayRecursive<const Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): ArrayNodeCustomizableSchemaUnsafe<ScopedSchemaName<TScope, Name>, T, TCustomMetadata>;
|
|
1388
|
-
static readonly identifier: <const TCustomMetadata = unknown>(props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Identifier, LeafSchema<"string", string> & SimpleLeafNodeSchema<SchemaType>, TCustomMetadata
|
|
1441
|
+
static readonly identifier: <const TCustomMetadata = unknown>(props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Identifier, LeafSchema<"string", string> & SimpleLeafNodeSchema<SchemaType>, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1389
1442
|
static readonly leaves: readonly [LeafSchema<"string", string> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"number", number> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"boolean", boolean> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"null", null> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"handle", IFluidHandle_2<unknown>> & SimpleLeafNodeSchema<SchemaType>];
|
|
1390
1443
|
readonly leaves: readonly [LeafSchema<"string", string> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"number", number> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"boolean", boolean> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"null", null> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"handle", IFluidHandle_2<unknown>> & SimpleLeafNodeSchema<SchemaType>];
|
|
1391
1444
|
mapAlpha<Name extends TName, const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): MapNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
1392
1445
|
mapRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): MapNodeCustomizableSchemaUnsafe<ScopedSchemaName<TScope, Name>, T, TCustomMetadata>;
|
|
1393
|
-
objectAlpha<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>, const TCustomMetadata = unknown>(name: Name, fields: T, options?: ObjectSchemaOptionsAlpha<TCustomMetadata>):
|
|
1394
|
-
readonly createFromInsertable: unknown;
|
|
1395
|
-
};
|
|
1446
|
+
objectAlpha<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>, const TCustomMetadata = unknown>(name: Name, fields: T, options?: ObjectSchemaOptionsAlpha<TCustomMetadata>): ObjectNodeSchemaWorkaround<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
1396
1447
|
objectRecursive<const Name extends TName, const T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>, const TCustomMetadata = unknown>(name: Name, t: T, options?: ObjectSchemaOptionsAlpha<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, System_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & System_Unsafe.InsertableObjectFromSchemaRecordUnsafe<T>, false, T, never, TCustomMetadata> & SimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> & Pick<ObjectNodeSchema, "fields">;
|
|
1397
|
-
|
|
1398
|
-
readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata
|
|
1399
|
-
|
|
1400
|
-
readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata
|
|
1448
|
+
objectRecursiveAlpha<const Name extends TName, const T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>, const TCustomMetadata = unknown>(name: Name, t: T, options?: ObjectSchemaOptionsAlpha<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, System_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordAlphaUnsafe<T>, false, T, never, TCustomMetadata> & SimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> & Pick<ObjectNodeSchema, "fields">;
|
|
1449
|
+
static readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1450
|
+
readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1451
|
+
static readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1452
|
+
readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1401
1453
|
recordAlpha<const Name extends TName, const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): RecordNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
1402
1454
|
recordRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Record, TreeRecordNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Record, unknown>, {
|
|
1403
1455
|
readonly [x: string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
|
|
1404
1456
|
}, false, T, undefined, TCustomMetadata>;
|
|
1405
|
-
static readonly required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata
|
|
1406
|
-
readonly required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata
|
|
1407
|
-
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
|
|
1408
|
-
readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata
|
|
1457
|
+
static readonly required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1458
|
+
readonly required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1459
|
+
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, FieldPropsAlpha<TCustomMetadata>>;
|
|
1460
|
+
readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1409
1461
|
scopedFactoryAlpha<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryAlpha<ScopedSchemaName<TScope, T>, TNameInner>;
|
|
1462
|
+
readonly withDefault: <Kind extends FieldKind, Types extends ImplicitAllowedTypes, TCustomMetadata = unknown>(fieldSchema: FieldSchema<Kind, Types, TCustomMetadata>, defaultValue: NodeProvider<ApplyKindInput_2<InsertableTreeNodeFromImplicitAllowedTypes_2<Types>, Kind, true>>) => FieldSchemaAlpha<Kind, Types, TCustomMetadata, FieldPropsAlpha<TCustomMetadata> & {
|
|
1463
|
+
defaultProvider: DefaultProvider;
|
|
1464
|
+
}>;
|
|
1465
|
+
static readonly withDefault: <Kind extends FieldKind, Types extends ImplicitAllowedTypes, TCustomMetadata = unknown>(fieldSchema: FieldSchema<Kind, Types, TCustomMetadata>, defaultValue: NodeProvider<ApplyKindInput_2<InsertableTreeNodeFromImplicitAllowedTypes_2<Types>, Kind, true>>) => FieldSchemaAlpha<Kind, Types, TCustomMetadata, FieldPropsAlpha<TCustomMetadata> & {
|
|
1466
|
+
defaultProvider: DefaultProvider;
|
|
1467
|
+
}>;
|
|
1468
|
+
readonly withDefaultRecursive: <Kind extends FieldKind, Types extends System_Unsafe.ImplicitAllowedTypesUnsafe, TCustomMetadata = unknown>(fieldSchema: System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata>, defaultValue: unknown) => FieldSchemaAlphaUnsafe<Kind, Types, TCustomMetadata, FieldPropsAlpha<TCustomMetadata> & {
|
|
1469
|
+
defaultProvider: DefaultProvider;
|
|
1470
|
+
}>;
|
|
1471
|
+
static readonly withDefaultRecursive: <Kind extends FieldKind, Types extends System_Unsafe.ImplicitAllowedTypesUnsafe, TCustomMetadata = unknown>(fieldSchema: System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata>, defaultValue: unknown) => FieldSchemaAlphaUnsafe<Kind, Types, TCustomMetadata, FieldPropsAlpha<TCustomMetadata> & {
|
|
1472
|
+
defaultProvider: DefaultProvider;
|
|
1473
|
+
}>;
|
|
1410
1474
|
}
|
|
1411
1475
|
|
|
1412
1476
|
// @beta
|
|
@@ -1450,6 +1514,16 @@ export interface SchemaStatics {
|
|
|
1450
1514
|
readonly string: LeafSchema<"string", string>;
|
|
1451
1515
|
}
|
|
1452
1516
|
|
|
1517
|
+
// @alpha @sealed @system
|
|
1518
|
+
export interface SchemaStaticsAlpha {
|
|
1519
|
+
readonly withDefault: <Kind extends FieldKind, Types extends ImplicitAllowedTypes, TCustomMetadata = unknown>(fieldSchema: FieldSchema<Kind, Types, TCustomMetadata>, defaultValue: NodeProvider<InsertableTreeFieldFromImplicitField<FieldSchema<Kind, Types>>>) => FieldSchemaAlpha<Kind, Types, TCustomMetadata, FieldPropsAlpha<TCustomMetadata> & {
|
|
1520
|
+
defaultProvider: DefaultProvider;
|
|
1521
|
+
}>;
|
|
1522
|
+
withDefaultRecursive: <Kind extends FieldKind, Types extends System_Unsafe.ImplicitAllowedTypesUnsafe, TCustomMetadata = unknown>(fieldSchema: System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata>, defaultValue: Unenforced<NodeProvider<System_Unsafe.InsertableTreeFieldFromImplicitFieldUnsafe<System_Unsafe.FieldSchemaUnsafe<Kind, Types>>>>) => FieldSchemaAlphaUnsafe<Kind, Types, TCustomMetadata, FieldPropsAlpha<TCustomMetadata> & {
|
|
1523
|
+
defaultProvider: DefaultProvider;
|
|
1524
|
+
}>;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1453
1527
|
// @beta @sealed @system
|
|
1454
1528
|
export interface SchemaStaticsBeta {
|
|
1455
1529
|
readonly staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
|
|
@@ -1488,7 +1562,6 @@ export interface SharedTreeFormatOptions {
|
|
|
1488
1562
|
|
|
1489
1563
|
// @alpha @input
|
|
1490
1564
|
export interface SharedTreeOptions extends SharedTreeOptionsBeta, Partial<CodecWriteOptions>, Partial<SharedTreeFormatOptions> {
|
|
1491
|
-
readonly enableDetachedRootEditing?: boolean;
|
|
1492
1565
|
readonly enableSharedBranches?: boolean;
|
|
1493
1566
|
shouldEncodeIncrementally?: IncrementalEncodingPolicy;
|
|
1494
1567
|
}
|
|
@@ -1562,9 +1635,6 @@ export interface SimpleRecordNodeSchema<Type extends SchemaType = SchemaType, ou
|
|
|
1562
1635
|
readonly simpleAllowedTypes: ReadonlyMap<string, SimpleAllowedTypeAttributes<Type>>;
|
|
1563
1636
|
}
|
|
1564
1637
|
|
|
1565
|
-
// @alpha
|
|
1566
|
-
export type SimpleTreeIndex<TKey extends TreeIndexKey, TValue> = TreeIndex<TKey, TValue>;
|
|
1567
|
-
|
|
1568
1638
|
// @alpha @sealed
|
|
1569
1639
|
export interface SimpleTreeSchema<Type extends SchemaType = SchemaType> {
|
|
1570
1640
|
readonly definitions: ReadonlyMap<string, SimpleNodeSchema<Type>>;
|
|
@@ -1576,7 +1646,7 @@ export function singletonSchema<TScope extends string, TName extends string | nu
|
|
|
1576
1646
|
readonly value: TName;
|
|
1577
1647
|
}, Record<string, never>, true, Record<string, never>, undefined>;
|
|
1578
1648
|
|
|
1579
|
-
// @
|
|
1649
|
+
// @beta @input
|
|
1580
1650
|
export interface SnapshotFileSystem {
|
|
1581
1651
|
join(parentPath: string, childPath: string): string;
|
|
1582
1652
|
mkdirSync(dir: string, options: {
|
|
@@ -1589,10 +1659,10 @@ export interface SnapshotFileSystem {
|
|
|
1589
1659
|
}): void;
|
|
1590
1660
|
}
|
|
1591
1661
|
|
|
1592
|
-
// @
|
|
1662
|
+
// @beta
|
|
1593
1663
|
export function snapshotSchemaCompatibility(options: SnapshotSchemaCompatibilityOptions): void;
|
|
1594
1664
|
|
|
1595
|
-
// @
|
|
1665
|
+
// @beta @input
|
|
1596
1666
|
export interface SnapshotSchemaCompatibilityOptions {
|
|
1597
1667
|
readonly fileSystem: SnapshotFileSystem;
|
|
1598
1668
|
readonly minVersionForCollaboration: string;
|
|
@@ -1843,17 +1913,32 @@ export interface Tagged<V, T extends string = string> {
|
|
|
1843
1913
|
// @public
|
|
1844
1914
|
export type TelemetryBaseEventPropertyType = string | number | boolean | undefined;
|
|
1845
1915
|
|
|
1916
|
+
// @alpha
|
|
1917
|
+
export namespace TextAsTree {
|
|
1918
|
+
export interface Members {
|
|
1919
|
+
characterCount(): number;
|
|
1920
|
+
characters(): Iterable<string>;
|
|
1921
|
+
charactersCopy(): string[];
|
|
1922
|
+
fullString(): string;
|
|
1923
|
+
insertAt(index: number, additionalCharacters: string): void;
|
|
1924
|
+
removeRange(startIndex: number | undefined, endIndex: number | undefined): void;
|
|
1925
|
+
}
|
|
1926
|
+
export interface Statics {
|
|
1927
|
+
fromString(value: string): Tree;
|
|
1928
|
+
}
|
|
1929
|
+
const Tree: Statics & TreeNodeSchema<"com.fluidframework.text.Text", NodeKind, Members & TreeNode & WithType<"com.fluidframework.text.Text", NodeKind, unknown>, never, false>;
|
|
1930
|
+
export type Tree = Members & TreeNode & WithType<"com.fluidframework.text.Text">;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1846
1933
|
// @alpha
|
|
1847
1934
|
export function trackDirtyNodes(view: TreeViewAlpha<ImplicitFieldSchema>, dirty: DirtyTreeMap): () => void;
|
|
1848
1935
|
|
|
1849
1936
|
// @alpha
|
|
1850
|
-
export type TransactionCallbackStatus<TSuccessValue, TFailureValue> = ({
|
|
1937
|
+
export type TransactionCallbackStatus<TSuccessValue, TFailureValue> = ((WithValue<TSuccessValue> & {
|
|
1851
1938
|
rollback?: false;
|
|
1852
|
-
|
|
1853
|
-
} | {
|
|
1939
|
+
}) | (WithValue<TFailureValue> & {
|
|
1854
1940
|
rollback: true;
|
|
1855
|
-
|
|
1856
|
-
}) & {
|
|
1941
|
+
})) & {
|
|
1857
1942
|
preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
|
|
1858
1943
|
};
|
|
1859
1944
|
|
|
@@ -1863,6 +1948,11 @@ export type TransactionConstraint = NodeInDocumentConstraint;
|
|
|
1863
1948
|
// @alpha @sealed
|
|
1864
1949
|
export type TransactionConstraintAlpha = TransactionConstraint | NoChangeConstraint;
|
|
1865
1950
|
|
|
1951
|
+
// @alpha @sealed
|
|
1952
|
+
export type TransactionLabels = Set<unknown> & {
|
|
1953
|
+
tree?: LabelTree;
|
|
1954
|
+
};
|
|
1955
|
+
|
|
1866
1956
|
// @alpha
|
|
1867
1957
|
export type TransactionResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
|
|
1868
1958
|
|
|
@@ -1870,15 +1960,13 @@ export type TransactionResult = Omit<TransactionResultSuccess<unknown>, "value">
|
|
|
1870
1960
|
export type TransactionResultExt<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
|
|
1871
1961
|
|
|
1872
1962
|
// @alpha
|
|
1873
|
-
export interface TransactionResultFailed<TFailureValue> {
|
|
1963
|
+
export interface TransactionResultFailed<TFailureValue> extends WithValue<TFailureValue> {
|
|
1874
1964
|
success: false;
|
|
1875
|
-
value: TFailureValue;
|
|
1876
1965
|
}
|
|
1877
1966
|
|
|
1878
1967
|
// @alpha
|
|
1879
|
-
export interface TransactionResultSuccess<TSuccessValue> {
|
|
1968
|
+
export interface TransactionResultSuccess<TSuccessValue> extends WithValue<TSuccessValue> {
|
|
1880
1969
|
success: true;
|
|
1881
|
-
value: TSuccessValue;
|
|
1882
1970
|
}
|
|
1883
1971
|
|
|
1884
1972
|
// @public
|
|
@@ -1895,9 +1983,11 @@ export const Tree: Tree;
|
|
|
1895
1983
|
|
|
1896
1984
|
// @alpha @sealed
|
|
1897
1985
|
export interface TreeAlpha {
|
|
1986
|
+
// @deprecated
|
|
1898
1987
|
branch(node: TreeNode): TreeBranchAlpha | undefined;
|
|
1899
1988
|
child(node: TreeNode, key: string | number): TreeNode | TreeLeafValue | undefined;
|
|
1900
1989
|
children(node: TreeNode): Iterable<[propertyKey: string | number, child: TreeNode | TreeLeafValue]>;
|
|
1990
|
+
context(node: TreeNode): TreeContextAlpha;
|
|
1901
1991
|
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>;
|
|
1902
1992
|
exportCompressed(tree: TreeNode | TreeLeafValue, options: {
|
|
1903
1993
|
idCompressor?: IIdCompressor_2;
|
|
@@ -1970,7 +2060,7 @@ export interface TreeBranch extends IDisposable {
|
|
|
1970
2060
|
}
|
|
1971
2061
|
|
|
1972
2062
|
// @alpha @sealed
|
|
1973
|
-
export interface TreeBranchAlpha extends TreeBranch {
|
|
2063
|
+
export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
|
|
1974
2064
|
applyChange(change: JsonCompatibleReadOnly): void;
|
|
1975
2065
|
readonly events: Listenable<TreeBranchEvents>;
|
|
1976
2066
|
// (undocumented)
|
|
@@ -2011,6 +2101,15 @@ export enum TreeCompressionStrategy {
|
|
|
2011
2101
|
Uncompressed = 1
|
|
2012
2102
|
}
|
|
2013
2103
|
|
|
2104
|
+
// @alpha
|
|
2105
|
+
export interface TreeContextAlpha {
|
|
2106
|
+
isBranch(): this is TreeBranchAlpha;
|
|
2107
|
+
runTransaction<TValue>(transaction: () => WithValue<TValue>, params?: RunTransactionParams): TransactionResultExt<TValue, TValue>;
|
|
2108
|
+
runTransaction(transaction: () => void, params?: RunTransactionParams): TransactionResult;
|
|
2109
|
+
runTransactionAsync<TValue>(transaction: () => Promise<WithValue<TValue>>, params?: RunTransactionParams): Promise<TransactionResultExt<TValue, TValue>>;
|
|
2110
|
+
runTransactionAsync(transaction: () => Promise<void>, params?: RunTransactionParams): Promise<TransactionResult>;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2014
2113
|
// @beta @input
|
|
2015
2114
|
export interface TreeEncodingOptions<TKeyOptions = KeyEncodingOptions> {
|
|
2016
2115
|
readonly keys?: TKeyOptions;
|
|
@@ -2028,13 +2127,13 @@ export interface TreeIdentifierUtils {
|
|
|
2028
2127
|
shorten(branch: TreeBranch, nodeIdentifier: string): number | undefined;
|
|
2029
2128
|
}
|
|
2030
2129
|
|
|
2031
|
-
// @alpha
|
|
2032
|
-
export interface TreeIndex<TKey
|
|
2130
|
+
// @alpha @sealed
|
|
2131
|
+
export interface TreeIndex<TKey, TValue> extends ReadonlyMap<TKey, TValue> {
|
|
2033
2132
|
dispose(): void;
|
|
2034
2133
|
}
|
|
2035
2134
|
|
|
2036
2135
|
// @alpha
|
|
2037
|
-
export type TreeIndexKey =
|
|
2136
|
+
export type TreeIndexKey = TreeLeafValue;
|
|
2038
2137
|
|
|
2039
2138
|
// @alpha
|
|
2040
2139
|
export type TreeIndexNodes<TNode> = readonly [first: TNode, ...rest: TNode[]];
|
|
@@ -2308,4 +2407,9 @@ export interface WithType<out TName extends string = string, out TKind extends N
|
|
|
2308
2407
|
get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;
|
|
2309
2408
|
}
|
|
2310
2409
|
|
|
2410
|
+
// @alpha
|
|
2411
|
+
export interface WithValue<TValue> {
|
|
2412
|
+
value: TValue;
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2311
2415
|
```
|
|
@@ -964,6 +964,36 @@ export function singletonSchema<TScope extends string, TName extends string | nu
|
|
|
964
964
|
readonly value: TName;
|
|
965
965
|
}, Record<string, never>, true, Record<string, never>, undefined>;
|
|
966
966
|
|
|
967
|
+
// @beta @input
|
|
968
|
+
export interface SnapshotFileSystem {
|
|
969
|
+
join(parentPath: string, childPath: string): string;
|
|
970
|
+
mkdirSync(dir: string, options: {
|
|
971
|
+
recursive: true;
|
|
972
|
+
}): void;
|
|
973
|
+
readdirSync(dir: string): readonly string[];
|
|
974
|
+
readFileSync(file: string, encoding: "utf8"): string;
|
|
975
|
+
writeFileSync(file: string, data: string, options: {
|
|
976
|
+
encoding: "utf8";
|
|
977
|
+
}): void;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
// @beta
|
|
981
|
+
export function snapshotSchemaCompatibility(options: SnapshotSchemaCompatibilityOptions): void;
|
|
982
|
+
|
|
983
|
+
// @beta @input
|
|
984
|
+
export interface SnapshotSchemaCompatibilityOptions {
|
|
985
|
+
readonly fileSystem: SnapshotFileSystem;
|
|
986
|
+
readonly minVersionForCollaboration: string;
|
|
987
|
+
readonly mode: "assert" | "update";
|
|
988
|
+
readonly rejectSchemaChangesWithNoVersionChange?: true;
|
|
989
|
+
readonly rejectVersionsWithNoSchemaChange?: true;
|
|
990
|
+
readonly schema: TreeViewConfiguration;
|
|
991
|
+
readonly snapshotDirectory: string;
|
|
992
|
+
readonly snapshotUnchangedVersions?: true;
|
|
993
|
+
readonly version: string;
|
|
994
|
+
readonly versionComparer?: (a: string, b: string) => number;
|
|
995
|
+
}
|
|
996
|
+
|
|
967
997
|
// @beta @system
|
|
968
998
|
export namespace System_TableSchema {
|
|
969
999
|
// @sealed @system
|
|
@@ -853,7 +853,7 @@ export interface ISharedObjectEvents extends IErrorEvent {
|
|
|
853
853
|
export interface ISharedSegmentSequence<T extends ISegment> extends ISharedObject<ISharedSegmentSequenceEvents>, MergeTreeRevertibleDriver {
|
|
854
854
|
annotateAdjustRange(start: number, end: number, adjust: MapLike<AdjustParams>): void;
|
|
855
855
|
annotateRange(start: number, end: number, props: PropertySet): void;
|
|
856
|
-
createLocalReferencePosition(segment: T, offset: number, refType: ReferenceType, properties: PropertySet | undefined, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean): LocalReferencePosition;
|
|
856
|
+
createLocalReferencePosition(segment: T | "start" | "end", offset: number | undefined, refType: ReferenceType, properties: PropertySet | undefined, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean): LocalReferencePosition;
|
|
857
857
|
getContainingSegment(pos: number): {
|
|
858
858
|
segment: T | undefined;
|
|
859
859
|
offset: number | undefined;
|
|
@@ -1324,6 +1324,36 @@ export function singletonSchema<TScope extends string, TName extends string | nu
|
|
|
1324
1324
|
readonly value: TName;
|
|
1325
1325
|
}, Record<string, never>, true, Record<string, never>, undefined>;
|
|
1326
1326
|
|
|
1327
|
+
// @beta @input
|
|
1328
|
+
export interface SnapshotFileSystem {
|
|
1329
|
+
join(parentPath: string, childPath: string): string;
|
|
1330
|
+
mkdirSync(dir: string, options: {
|
|
1331
|
+
recursive: true;
|
|
1332
|
+
}): void;
|
|
1333
|
+
readdirSync(dir: string): readonly string[];
|
|
1334
|
+
readFileSync(file: string, encoding: "utf8"): string;
|
|
1335
|
+
writeFileSync(file: string, data: string, options: {
|
|
1336
|
+
encoding: "utf8";
|
|
1337
|
+
}): void;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
// @beta
|
|
1341
|
+
export function snapshotSchemaCompatibility(options: SnapshotSchemaCompatibilityOptions): void;
|
|
1342
|
+
|
|
1343
|
+
// @beta @input
|
|
1344
|
+
export interface SnapshotSchemaCompatibilityOptions {
|
|
1345
|
+
readonly fileSystem: SnapshotFileSystem;
|
|
1346
|
+
readonly minVersionForCollaboration: string;
|
|
1347
|
+
readonly mode: "assert" | "update";
|
|
1348
|
+
readonly rejectSchemaChangesWithNoVersionChange?: true;
|
|
1349
|
+
readonly rejectVersionsWithNoSchemaChange?: true;
|
|
1350
|
+
readonly schema: TreeViewConfiguration;
|
|
1351
|
+
readonly snapshotDirectory: string;
|
|
1352
|
+
readonly snapshotUnchangedVersions?: true;
|
|
1353
|
+
readonly version: string;
|
|
1354
|
+
readonly versionComparer?: (a: string, b: string) => number;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1327
1357
|
// @beta @system
|
|
1328
1358
|
export namespace System_TableSchema {
|
|
1329
1359
|
// @sealed @system
|
package/dist/alpha.d.ts
CHANGED
|
@@ -171,6 +171,8 @@ export {
|
|
|
171
171
|
SchemaStaticsBeta,
|
|
172
172
|
SchemaUpgrade,
|
|
173
173
|
SharedTreeOptionsBeta,
|
|
174
|
+
SnapshotFileSystem,
|
|
175
|
+
SnapshotSchemaCompatibilityOptions,
|
|
174
176
|
System_TableSchema,
|
|
175
177
|
TableSchema,
|
|
176
178
|
TreeBeta,
|
|
@@ -189,7 +191,8 @@ export {
|
|
|
189
191
|
configuredSharedTreeBeta,
|
|
190
192
|
createIndependentTreeBeta,
|
|
191
193
|
enumFromStrings,
|
|
192
|
-
singletonSchema,
|
|
194
|
+
singletonSchema,
|
|
195
|
+
snapshotSchemaCompatibility,
|
|
193
196
|
// #endregion
|
|
194
197
|
|
|
195
198
|
// #region @alpha APIs
|
|
@@ -206,8 +209,13 @@ export {
|
|
|
206
209
|
CreateIndependentTreeAlphaOptions,
|
|
207
210
|
DirtyTreeMap,
|
|
208
211
|
DirtyTreeStatus,
|
|
212
|
+
ErasedNode,
|
|
213
|
+
ErasedSchema,
|
|
214
|
+
ErasedSchemaSubclassable,
|
|
209
215
|
FactoryContent,
|
|
210
216
|
FactoryContentObject,
|
|
217
|
+
FieldHasDefaultAlpha,
|
|
218
|
+
FieldHasDefaultAlphaUnsafe,
|
|
211
219
|
FieldPropsAlpha,
|
|
212
220
|
FieldSchemaAlpha,
|
|
213
221
|
FieldSchemaAlphaUnsafe,
|
|
@@ -225,6 +233,8 @@ export {
|
|
|
225
233
|
Insertable,
|
|
226
234
|
InsertableContent,
|
|
227
235
|
InsertableField,
|
|
236
|
+
InsertableObjectFromSchemaRecordAlpha,
|
|
237
|
+
InsertableObjectFromSchemaRecordAlphaUnsafe,
|
|
228
238
|
JsonArrayNodeSchema,
|
|
229
239
|
JsonAsTree,
|
|
230
240
|
JsonCompatibleReadOnly,
|
|
@@ -243,14 +253,17 @@ export {
|
|
|
243
253
|
JsonSchemaType,
|
|
244
254
|
JsonStringKeyPatternProperties,
|
|
245
255
|
JsonTreeSchema,
|
|
256
|
+
LabelTree,
|
|
246
257
|
LocalChangeMetadata,
|
|
247
258
|
MapNodeCustomizableSchema,
|
|
248
259
|
MapNodeCustomizableSchemaUnsafe,
|
|
249
260
|
MapNodePojoEmulationSchema,
|
|
250
261
|
MapNodeSchema,
|
|
251
262
|
NoChangeConstraint,
|
|
263
|
+
NodeProvider,
|
|
252
264
|
NodeSchemaOptionsAlpha,
|
|
253
265
|
ObjectNodeSchema,
|
|
266
|
+
ObjectNodeSchemaWorkaround,
|
|
254
267
|
ObjectSchemaOptionsAlpha,
|
|
255
268
|
ObservationResults,
|
|
256
269
|
ReadSchema,
|
|
@@ -263,6 +276,7 @@ export {
|
|
|
263
276
|
RevertibleAlphaFactory,
|
|
264
277
|
RunTransactionParams,
|
|
265
278
|
SchemaFactoryAlpha,
|
|
279
|
+
SchemaStaticsAlpha,
|
|
266
280
|
SchemaType,
|
|
267
281
|
SharedTreeFormatOptions,
|
|
268
282
|
SharedTreeOptions,
|
|
@@ -276,12 +290,11 @@ export {
|
|
|
276
290
|
SimpleObjectFieldSchema,
|
|
277
291
|
SimpleObjectNodeSchema,
|
|
278
292
|
SimpleRecordNodeSchema,
|
|
279
|
-
SimpleTreeIndex,
|
|
280
293
|
SimpleTreeSchema,
|
|
281
|
-
|
|
282
|
-
SnapshotSchemaCompatibilityOptions,
|
|
294
|
+
TextAsTree,
|
|
283
295
|
TransactionCallbackStatus,
|
|
284
296
|
TransactionConstraintAlpha,
|
|
297
|
+
TransactionLabels,
|
|
285
298
|
TransactionResult,
|
|
286
299
|
TransactionResultExt,
|
|
287
300
|
TransactionResultFailed,
|
|
@@ -291,6 +304,7 @@ export {
|
|
|
291
304
|
TreeBranchEvents,
|
|
292
305
|
TreeBranchFork,
|
|
293
306
|
TreeCompressionStrategy,
|
|
307
|
+
TreeContextAlpha,
|
|
294
308
|
TreeIdentifierUtils,
|
|
295
309
|
TreeIndex,
|
|
296
310
|
TreeIndexKey,
|
|
@@ -306,6 +320,7 @@ export {
|
|
|
306
320
|
VerboseTreeNode,
|
|
307
321
|
ViewContent,
|
|
308
322
|
VoidTransactionCallbackStatus,
|
|
323
|
+
WithValue,
|
|
309
324
|
allowUnused,
|
|
310
325
|
asAlpha,
|
|
311
326
|
asTreeViewAlpha,
|
|
@@ -318,7 +333,7 @@ export {
|
|
|
318
333
|
createArrayInsertionAnchor,
|
|
319
334
|
createIdentifierIndex,
|
|
320
335
|
createIndependentTreeAlpha,
|
|
321
|
-
|
|
336
|
+
createTreeIndex,
|
|
322
337
|
decodeSchemaCompatibilitySnapshot,
|
|
323
338
|
encodeSchemaCompatibilitySnapshot,
|
|
324
339
|
eraseSchemaDetails,
|
|
@@ -341,7 +356,6 @@ export {
|
|
|
341
356
|
replaceConciseTreeHandles,
|
|
342
357
|
replaceHandles,
|
|
343
358
|
replaceVerboseTreeHandles,
|
|
344
|
-
snapshotSchemaCompatibility,
|
|
345
359
|
trackDirtyNodes
|
|
346
360
|
// #endregion
|
|
347
361
|
} from "./index.js";
|
package/dist/beta.d.ts
CHANGED
|
@@ -171,6 +171,8 @@ export {
|
|
|
171
171
|
SchemaStaticsBeta,
|
|
172
172
|
SchemaUpgrade,
|
|
173
173
|
SharedTreeOptionsBeta,
|
|
174
|
+
SnapshotFileSystem,
|
|
175
|
+
SnapshotSchemaCompatibilityOptions,
|
|
174
176
|
System_TableSchema,
|
|
175
177
|
TableSchema,
|
|
176
178
|
TreeBeta,
|
|
@@ -189,6 +191,7 @@ export {
|
|
|
189
191
|
configuredSharedTreeBeta,
|
|
190
192
|
createIndependentTreeBeta,
|
|
191
193
|
enumFromStrings,
|
|
192
|
-
singletonSchema
|
|
194
|
+
singletonSchema,
|
|
195
|
+
snapshotSchemaCompatibility
|
|
193
196
|
// #endregion
|
|
194
197
|
} from "./index.js";
|
package/dist/legacy.d.ts
CHANGED
|
@@ -178,6 +178,8 @@ export {
|
|
|
178
178
|
SchemaStaticsBeta,
|
|
179
179
|
SchemaUpgrade,
|
|
180
180
|
SharedTreeOptionsBeta,
|
|
181
|
+
SnapshotFileSystem,
|
|
182
|
+
SnapshotSchemaCompatibilityOptions,
|
|
181
183
|
System_TableSchema,
|
|
182
184
|
TableSchema,
|
|
183
185
|
TreeBeta,
|
|
@@ -196,7 +198,8 @@ export {
|
|
|
196
198
|
configuredSharedTreeBeta,
|
|
197
199
|
createIndependentTreeBeta,
|
|
198
200
|
enumFromStrings,
|
|
199
|
-
singletonSchema,
|
|
201
|
+
singletonSchema,
|
|
202
|
+
snapshotSchemaCompatibility,
|
|
200
203
|
// #endregion
|
|
201
204
|
|
|
202
205
|
// #region @legacyBeta APIs
|
package/lib/alpha.d.ts
CHANGED
|
@@ -171,6 +171,8 @@ export {
|
|
|
171
171
|
SchemaStaticsBeta,
|
|
172
172
|
SchemaUpgrade,
|
|
173
173
|
SharedTreeOptionsBeta,
|
|
174
|
+
SnapshotFileSystem,
|
|
175
|
+
SnapshotSchemaCompatibilityOptions,
|
|
174
176
|
System_TableSchema,
|
|
175
177
|
TableSchema,
|
|
176
178
|
TreeBeta,
|
|
@@ -189,7 +191,8 @@ export {
|
|
|
189
191
|
configuredSharedTreeBeta,
|
|
190
192
|
createIndependentTreeBeta,
|
|
191
193
|
enumFromStrings,
|
|
192
|
-
singletonSchema,
|
|
194
|
+
singletonSchema,
|
|
195
|
+
snapshotSchemaCompatibility,
|
|
193
196
|
// #endregion
|
|
194
197
|
|
|
195
198
|
// #region @alpha APIs
|
|
@@ -206,8 +209,13 @@ export {
|
|
|
206
209
|
CreateIndependentTreeAlphaOptions,
|
|
207
210
|
DirtyTreeMap,
|
|
208
211
|
DirtyTreeStatus,
|
|
212
|
+
ErasedNode,
|
|
213
|
+
ErasedSchema,
|
|
214
|
+
ErasedSchemaSubclassable,
|
|
209
215
|
FactoryContent,
|
|
210
216
|
FactoryContentObject,
|
|
217
|
+
FieldHasDefaultAlpha,
|
|
218
|
+
FieldHasDefaultAlphaUnsafe,
|
|
211
219
|
FieldPropsAlpha,
|
|
212
220
|
FieldSchemaAlpha,
|
|
213
221
|
FieldSchemaAlphaUnsafe,
|
|
@@ -225,6 +233,8 @@ export {
|
|
|
225
233
|
Insertable,
|
|
226
234
|
InsertableContent,
|
|
227
235
|
InsertableField,
|
|
236
|
+
InsertableObjectFromSchemaRecordAlpha,
|
|
237
|
+
InsertableObjectFromSchemaRecordAlphaUnsafe,
|
|
228
238
|
JsonArrayNodeSchema,
|
|
229
239
|
JsonAsTree,
|
|
230
240
|
JsonCompatibleReadOnly,
|
|
@@ -243,14 +253,17 @@ export {
|
|
|
243
253
|
JsonSchemaType,
|
|
244
254
|
JsonStringKeyPatternProperties,
|
|
245
255
|
JsonTreeSchema,
|
|
256
|
+
LabelTree,
|
|
246
257
|
LocalChangeMetadata,
|
|
247
258
|
MapNodeCustomizableSchema,
|
|
248
259
|
MapNodeCustomizableSchemaUnsafe,
|
|
249
260
|
MapNodePojoEmulationSchema,
|
|
250
261
|
MapNodeSchema,
|
|
251
262
|
NoChangeConstraint,
|
|
263
|
+
NodeProvider,
|
|
252
264
|
NodeSchemaOptionsAlpha,
|
|
253
265
|
ObjectNodeSchema,
|
|
266
|
+
ObjectNodeSchemaWorkaround,
|
|
254
267
|
ObjectSchemaOptionsAlpha,
|
|
255
268
|
ObservationResults,
|
|
256
269
|
ReadSchema,
|
|
@@ -263,6 +276,7 @@ export {
|
|
|
263
276
|
RevertibleAlphaFactory,
|
|
264
277
|
RunTransactionParams,
|
|
265
278
|
SchemaFactoryAlpha,
|
|
279
|
+
SchemaStaticsAlpha,
|
|
266
280
|
SchemaType,
|
|
267
281
|
SharedTreeFormatOptions,
|
|
268
282
|
SharedTreeOptions,
|
|
@@ -276,12 +290,11 @@ export {
|
|
|
276
290
|
SimpleObjectFieldSchema,
|
|
277
291
|
SimpleObjectNodeSchema,
|
|
278
292
|
SimpleRecordNodeSchema,
|
|
279
|
-
SimpleTreeIndex,
|
|
280
293
|
SimpleTreeSchema,
|
|
281
|
-
|
|
282
|
-
SnapshotSchemaCompatibilityOptions,
|
|
294
|
+
TextAsTree,
|
|
283
295
|
TransactionCallbackStatus,
|
|
284
296
|
TransactionConstraintAlpha,
|
|
297
|
+
TransactionLabels,
|
|
285
298
|
TransactionResult,
|
|
286
299
|
TransactionResultExt,
|
|
287
300
|
TransactionResultFailed,
|
|
@@ -291,6 +304,7 @@ export {
|
|
|
291
304
|
TreeBranchEvents,
|
|
292
305
|
TreeBranchFork,
|
|
293
306
|
TreeCompressionStrategy,
|
|
307
|
+
TreeContextAlpha,
|
|
294
308
|
TreeIdentifierUtils,
|
|
295
309
|
TreeIndex,
|
|
296
310
|
TreeIndexKey,
|
|
@@ -306,6 +320,7 @@ export {
|
|
|
306
320
|
VerboseTreeNode,
|
|
307
321
|
ViewContent,
|
|
308
322
|
VoidTransactionCallbackStatus,
|
|
323
|
+
WithValue,
|
|
309
324
|
allowUnused,
|
|
310
325
|
asAlpha,
|
|
311
326
|
asTreeViewAlpha,
|
|
@@ -318,7 +333,7 @@ export {
|
|
|
318
333
|
createArrayInsertionAnchor,
|
|
319
334
|
createIdentifierIndex,
|
|
320
335
|
createIndependentTreeAlpha,
|
|
321
|
-
|
|
336
|
+
createTreeIndex,
|
|
322
337
|
decodeSchemaCompatibilitySnapshot,
|
|
323
338
|
encodeSchemaCompatibilitySnapshot,
|
|
324
339
|
eraseSchemaDetails,
|
|
@@ -341,7 +356,6 @@ export {
|
|
|
341
356
|
replaceConciseTreeHandles,
|
|
342
357
|
replaceHandles,
|
|
343
358
|
replaceVerboseTreeHandles,
|
|
344
|
-
snapshotSchemaCompatibility,
|
|
345
359
|
trackDirtyNodes
|
|
346
360
|
// #endregion
|
|
347
361
|
} from "./index.js";
|
package/lib/beta.d.ts
CHANGED
|
@@ -171,6 +171,8 @@ export {
|
|
|
171
171
|
SchemaStaticsBeta,
|
|
172
172
|
SchemaUpgrade,
|
|
173
173
|
SharedTreeOptionsBeta,
|
|
174
|
+
SnapshotFileSystem,
|
|
175
|
+
SnapshotSchemaCompatibilityOptions,
|
|
174
176
|
System_TableSchema,
|
|
175
177
|
TableSchema,
|
|
176
178
|
TreeBeta,
|
|
@@ -189,6 +191,7 @@ export {
|
|
|
189
191
|
configuredSharedTreeBeta,
|
|
190
192
|
createIndependentTreeBeta,
|
|
191
193
|
enumFromStrings,
|
|
192
|
-
singletonSchema
|
|
194
|
+
singletonSchema,
|
|
195
|
+
snapshotSchemaCompatibility
|
|
193
196
|
// #endregion
|
|
194
197
|
} from "./index.js";
|
package/lib/legacy.d.ts
CHANGED
|
@@ -178,6 +178,8 @@ export {
|
|
|
178
178
|
SchemaStaticsBeta,
|
|
179
179
|
SchemaUpgrade,
|
|
180
180
|
SharedTreeOptionsBeta,
|
|
181
|
+
SnapshotFileSystem,
|
|
182
|
+
SnapshotSchemaCompatibilityOptions,
|
|
181
183
|
System_TableSchema,
|
|
182
184
|
TableSchema,
|
|
183
185
|
TreeBeta,
|
|
@@ -196,7 +198,8 @@ export {
|
|
|
196
198
|
configuredSharedTreeBeta,
|
|
197
199
|
createIndependentTreeBeta,
|
|
198
200
|
enumFromStrings,
|
|
199
|
-
singletonSchema,
|
|
201
|
+
singletonSchema,
|
|
202
|
+
snapshotSchemaCompatibility,
|
|
200
203
|
// #endregion
|
|
201
204
|
|
|
202
205
|
// #region @legacyBeta APIs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fluid-framework",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.91.0",
|
|
4
4
|
"description": "The main entry point into Fluid Framework public packages",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -57,32 +57,32 @@
|
|
|
57
57
|
"main": "lib/index.js",
|
|
58
58
|
"types": "lib/public.d.ts",
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@fluidframework/container-definitions": "2.
|
|
61
|
-
"@fluidframework/container-loader": "2.
|
|
62
|
-
"@fluidframework/core-interfaces": "2.
|
|
63
|
-
"@fluidframework/core-utils": "2.
|
|
64
|
-
"@fluidframework/driver-definitions": "2.
|
|
65
|
-
"@fluidframework/fluid-static": "2.
|
|
66
|
-
"@fluidframework/map": "2.
|
|
67
|
-
"@fluidframework/runtime-utils": "2.
|
|
68
|
-
"@fluidframework/sequence": "2.
|
|
69
|
-
"@fluidframework/shared-object-base": "2.
|
|
70
|
-
"@fluidframework/tree": "2.
|
|
60
|
+
"@fluidframework/container-definitions": "~2.91.0",
|
|
61
|
+
"@fluidframework/container-loader": "~2.91.0",
|
|
62
|
+
"@fluidframework/core-interfaces": "~2.91.0",
|
|
63
|
+
"@fluidframework/core-utils": "~2.91.0",
|
|
64
|
+
"@fluidframework/driver-definitions": "~2.91.0",
|
|
65
|
+
"@fluidframework/fluid-static": "~2.91.0",
|
|
66
|
+
"@fluidframework/map": "~2.91.0",
|
|
67
|
+
"@fluidframework/runtime-utils": "~2.91.0",
|
|
68
|
+
"@fluidframework/sequence": "~2.91.0",
|
|
69
|
+
"@fluidframework/shared-object-base": "~2.91.0",
|
|
70
|
+
"@fluidframework/tree": "~2.91.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
74
|
-
"@biomejs/biome": "~
|
|
74
|
+
"@biomejs/biome": "~2.4.5",
|
|
75
75
|
"@fluid-tools/build-cli": "^0.63.0",
|
|
76
76
|
"@fluidframework/build-common": "^2.0.3",
|
|
77
77
|
"@fluidframework/build-tools": "^0.63.0",
|
|
78
|
-
"@fluidframework/eslint-config-fluid": "2.
|
|
78
|
+
"@fluidframework/eslint-config-fluid": "~2.91.0",
|
|
79
79
|
"@microsoft/api-extractor": "7.52.11",
|
|
80
80
|
"@types/node": "~20.19.30",
|
|
81
81
|
"concurrently": "^9.2.1",
|
|
82
82
|
"copyfiles": "^2.4.1",
|
|
83
83
|
"eslint": "~9.39.1",
|
|
84
84
|
"jiti": "^2.6.1",
|
|
85
|
-
"rimraf": "^6.1.
|
|
85
|
+
"rimraf": "^6.1.3",
|
|
86
86
|
"typescript": "~5.4.5"
|
|
87
87
|
},
|
|
88
88
|
"fluidBuild": {
|