fluid-framework 2.53.1 → 2.61.0-355054
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 +73 -0
- package/alpha.d.ts +1 -1
- package/api-report/fluid-framework.alpha.api.md +51 -37
- package/api-report/fluid-framework.beta.api.md +16 -2
- package/api-report/{fluid-framework.legacy.alpha.api.md → fluid-framework.legacy.beta.api.md} +103 -61
- package/api-report/fluid-framework.legacy.public.api.md +2 -2
- package/api-report/fluid-framework.public.api.md +2 -2
- package/beta.d.ts +1 -1
- package/dist/alpha.d.ts +17 -7
- package/dist/beta.d.ts +10 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +27 -8
- package/dist/public.d.ts +5 -3
- package/legacy.d.ts +1 -1
- package/lib/alpha.d.ts +17 -7
- package/lib/beta.d.ts +10 -4
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +27 -8
- package/lib/public.d.ts +5 -3
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +18 -18
- package/src/index.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,78 @@
|
|
|
1
1
|
# fluid-framework
|
|
2
2
|
|
|
3
|
+
## 2.60.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- FormatValidator added to replace JsonValidator ([#25311](https://github.com/microsoft/FluidFramework/pull/25311)) [9db6e08ec12](https://github.com/microsoft/FluidFramework/commit/9db6e08ec12973e7cc4f7fe86fecd054bafcd1c0)
|
|
8
|
+
|
|
9
|
+
The existing `@alpha` type [`JsonValidator`](https://fluidframework.com/docs/api/fluid-framework/jsonvalidator-interface) has a new type-erased alternative, `FormatValidator`, which is planned to be stabilized to `@beta` in the future.
|
|
10
|
+
It replaces `JsonValidator` in `ICodecOptions`.
|
|
11
|
+
Existing code using `ICodecOptions` should migrate to use `FormatValidator`, but this is not required for adopting this release as `JsonValidator` is still supported.
|
|
12
|
+
|
|
13
|
+
- Single-node insertion/removal APIs have been removed from TableSchema (alpha) ([#25233](https://github.com/microsoft/FluidFramework/pull/25233)) [99281d2b24e](https://github.com/microsoft/FluidFramework/commit/99281d2b24ec406760c9029aad5aa72a9265a65d)
|
|
14
|
+
|
|
15
|
+
There is a significant performance benefit to inserting / removing rows / columns in batches.
|
|
16
|
+
To help encourage more performant usage patterns, single-node insertion and removal APIs have been removed.
|
|
17
|
+
The APIs that operate on batches should be used instead.
|
|
18
|
+
|
|
19
|
+
Specifically:
|
|
20
|
+
|
|
21
|
+
- `insertColumn`
|
|
22
|
+
- Use `insertColumns` instead
|
|
23
|
+
- `insertRow`
|
|
24
|
+
- Use `insertRows` instead
|
|
25
|
+
- `removeColumn`
|
|
26
|
+
- Use `removeColumns` instead
|
|
27
|
+
- `removeRow`
|
|
28
|
+
- Use `removeRows` instead
|
|
29
|
+
|
|
30
|
+
- Replace "TreeEncodingOptions.useStoredKeys" with "keys" and "KeyEncodingOptions" ([#25263](https://github.com/microsoft/FluidFramework/pull/25263)) [b65f2a86d44](https://github.com/microsoft/FluidFramework/commit/b65f2a86d44d690a675867600a0a7e3c1608a473)
|
|
31
|
+
|
|
32
|
+
The alpha API `TreeEncodingOptions` has had its `useStoredKeys` `boolean` replaced with `keys` that takes a `KeyEncodingOptions` allowing for three options instead of the previous two.
|
|
33
|
+
With the new API, it is now possible to control, for APIs which support it (like [`TreeAlpha.exportVerbose`](https://fluidframework.com/docs/api/fluid-framework/treealpha-interface#exportverbose-methodsignature)), if unknown optional fields will be included when exporting data using stored keys.
|
|
34
|
+
|
|
35
|
+
Additionally, the relevant options interfaces have been marked as `@input`, indicating that more options may be added as optional parameters in the future, and that should be considered non-breaking.
|
|
36
|
+
|
|
37
|
+
- 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)
|
|
38
|
+
|
|
39
|
+
The following APIs are now removed:
|
|
40
|
+
|
|
41
|
+
- `IInterval.clone`
|
|
42
|
+
- `IInterval.modify`
|
|
43
|
+
- `IInterval.union`
|
|
44
|
+
- `ISerializableInterval`
|
|
45
|
+
- `SequenceInterval.clone`
|
|
46
|
+
- `SequenceInterval.modify`
|
|
47
|
+
- `SequenceInterval.union`
|
|
48
|
+
- `SequenceInterval.serialize`
|
|
49
|
+
- `SequenceInterval.addPositionChangeListeners`
|
|
50
|
+
- `SequenceInterval.removePositionChangeListeners`
|
|
51
|
+
|
|
52
|
+
These APIs were never intended for public use. There is no migration path, and any usage is strongly discouraged, as it may result in severe errors or data corruption. Please remove any dependencies on these APIs as soon as possible.
|
|
53
|
+
|
|
54
|
+
- SchemaFactoryAlpha.recordRecursive now supports metadata ([#25289](https://github.com/microsoft/FluidFramework/pull/25289)) [83241702d5f](https://github.com/microsoft/FluidFramework/commit/83241702d5fb5608cfa0add569c7803837abcf82)
|
|
55
|
+
|
|
56
|
+
`SchemaFactoryAlpha.recordRecursive` now support metadata like `SchemaFactoryAlpha.recordAlpha` and the other `TreeNodeSchema` creation methods on `SchemaFactoryAlpha` (except for `SchemaFactoryAlpha.record` which does not support metadata).
|
|
57
|
+
|
|
58
|
+
- Range-based row/column removal methods have been added to TableSchema APIs (alpha) ([#25235](https://github.com/microsoft/FluidFramework/pull/25235)) [c803393cec6](https://github.com/microsoft/FluidFramework/commit/c803393cec6847f4294dc34b4a074ec93baf111c)
|
|
59
|
+
|
|
60
|
+
Adds range-based overloads to `removeColumns` and `removeRows` for removing contiguous ranges of rows and columns.
|
|
61
|
+
|
|
62
|
+
The `removeAllColumns` and `removeAllRows` methods have been removed, as they can be trivially implemented in terms of the new methods.
|
|
63
|
+
|
|
64
|
+
- Hoist runTransaction method from TreeViewAlpha to TreeBranch ([#25280](https://github.com/microsoft/FluidFramework/pull/25280)) [a66b3b77df3](https://github.com/microsoft/FluidFramework/commit/a66b3b77df346d1689ddedcefc16846eda45991a)
|
|
65
|
+
|
|
66
|
+
Transactions are not view-schema-dependent, so it isn't necessary for them to be exclusive to the view type.
|
|
67
|
+
`runTransaction` is now available on `TreeBranch` (alpha).
|
|
68
|
+
`TreeViewAlpha` extends `TreeBranch`, so this change strictly makes the API more accessible.
|
|
69
|
+
|
|
70
|
+
- Add SchemaFactoryBeta ([#25313](https://github.com/microsoft/FluidFramework/pull/25313)) [dca2361d33d](https://github.com/microsoft/FluidFramework/commit/dca2361d33dd959f5d913cbb59601685f85ff6f0)
|
|
71
|
+
|
|
72
|
+
`SchemaFactoryBeta` is added to provide a place to partially stabilize APIs from [`SchemaFactoryAlpha`](https://fluidframework.com/docs/api/fluid-framework/schemafactoryalpha-class).
|
|
73
|
+
Initially just one APIs is added as `@beta`: `scopedFactory`.
|
|
74
|
+
Users of the existing `@alpha` `scopedFactory` API on `SchemaFactoryAlpha` will need to update to use `scopedFactoryAlpha` if they require the returned factory to be a `SchemaFactoryAlpha` instance.
|
|
75
|
+
|
|
3
76
|
## 2.53.0
|
|
4
77
|
|
|
5
78
|
### Minor Changes
|
package/alpha.d.ts
CHANGED
|
@@ -264,6 +264,7 @@ export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends
|
|
|
264
264
|
// (undocumented)
|
|
265
265
|
readonly annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes;
|
|
266
266
|
get annotatedAllowedTypesNormalized(): NormalizedAnnotatedAllowedTypes;
|
|
267
|
+
// (undocumented)
|
|
267
268
|
get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined;
|
|
268
269
|
}
|
|
269
270
|
|
|
@@ -307,12 +308,12 @@ export type FluidObject<T = unknown> = {
|
|
|
307
308
|
// @public
|
|
308
309
|
export type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> = string extends TProp ? never : number extends TProp ? never : TProp extends keyof Required<T>[TProp] ? Required<T>[TProp] extends Required<Required<T>[TProp]>[TProp] ? TProp : never : never;
|
|
309
310
|
|
|
310
|
-
// @
|
|
311
|
+
// @beta @input
|
|
311
312
|
export interface ForestOptions {
|
|
312
313
|
readonly forest?: ForestType;
|
|
313
314
|
}
|
|
314
315
|
|
|
315
|
-
// @
|
|
316
|
+
// @beta @sealed
|
|
316
317
|
export interface ForestType extends ErasedType<"ForestType"> {
|
|
317
318
|
}
|
|
318
319
|
|
|
@@ -325,6 +326,16 @@ export const ForestTypeOptimized: ForestType;
|
|
|
325
326
|
// @alpha
|
|
326
327
|
export const ForestTypeReference: ForestType;
|
|
327
328
|
|
|
329
|
+
// @alpha @sealed
|
|
330
|
+
export interface FormatValidator extends ErasedType<"FormatValidator"> {
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// @alpha
|
|
334
|
+
export const FormatValidatorBasic: FormatValidator_2;
|
|
335
|
+
|
|
336
|
+
// @alpha
|
|
337
|
+
export const FormatValidatorNoOp: FormatValidator;
|
|
338
|
+
|
|
328
339
|
// @alpha
|
|
329
340
|
export function generateSchemaFromSimpleSchema(simple: SimpleTreeSchema): TreeSchema;
|
|
330
341
|
|
|
@@ -345,7 +356,7 @@ export type HandleConverter<TCustom> = (data: IFluidHandle) => TCustom;
|
|
|
345
356
|
|
|
346
357
|
// @alpha @input
|
|
347
358
|
export interface ICodecOptions {
|
|
348
|
-
readonly jsonValidator: JsonValidator;
|
|
359
|
+
readonly jsonValidator: JsonValidator | FormatValidator;
|
|
349
360
|
}
|
|
350
361
|
|
|
351
362
|
// @public
|
|
@@ -776,7 +787,7 @@ export namespace JsonAsTree {
|
|
|
776
787
|
const // @system
|
|
777
788
|
_APIExtractorWorkaroundObjectBase: TreeNodeSchemaClass<"com.fluidframework.json.object", NodeKind.Record, TreeRecordNodeUnsafe<readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.object", NodeKind.Record, unknown>, {
|
|
778
789
|
readonly [x: string]: string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null;
|
|
779
|
-
}, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>;
|
|
790
|
+
}, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined, unknown>;
|
|
780
791
|
export type Primitive = TreeNodeFromImplicitAllowedTypes<typeof Primitive>;
|
|
781
792
|
// @system
|
|
782
793
|
export type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<typeof Array>;
|
|
@@ -872,6 +883,13 @@ export interface JsonValidator {
|
|
|
872
883
|
compile<Schema extends TSchema>(schema: Schema): SchemaValidationFunction<Schema>;
|
|
873
884
|
}
|
|
874
885
|
|
|
886
|
+
// @alpha @input
|
|
887
|
+
export enum KeyEncodingOptions {
|
|
888
|
+
allStoredKeys = "allStoredKeys",
|
|
889
|
+
knownStoredKeys = "knownStoredKeys",
|
|
890
|
+
usePropertyKeys = "usePropertyKeys"
|
|
891
|
+
}
|
|
892
|
+
|
|
875
893
|
// @public
|
|
876
894
|
export type LazyItem<Item = unknown> = Item | (() => Item);
|
|
877
895
|
|
|
@@ -966,12 +984,12 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
|
966
984
|
readonly description?: string | undefined;
|
|
967
985
|
}
|
|
968
986
|
|
|
969
|
-
// @public @
|
|
987
|
+
// @public @input
|
|
970
988
|
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
971
989
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
972
990
|
}
|
|
973
991
|
|
|
974
|
-
// @alpha
|
|
992
|
+
// @alpha @input
|
|
975
993
|
export interface NodeSchemaOptionsAlpha<out TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
|
|
976
994
|
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
977
995
|
}
|
|
@@ -1112,7 +1130,7 @@ export interface RunTransaction {
|
|
|
1112
1130
|
readonly rollback: typeof rollback;
|
|
1113
1131
|
}
|
|
1114
1132
|
|
|
1115
|
-
// @alpha
|
|
1133
|
+
// @alpha @input
|
|
1116
1134
|
export interface RunTransactionParams {
|
|
1117
1135
|
readonly preconditions?: readonly TransactionConstraint[];
|
|
1118
1136
|
}
|
|
@@ -1172,7 +1190,7 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
1172
1190
|
}
|
|
1173
1191
|
|
|
1174
1192
|
// @alpha
|
|
1175
|
-
export class SchemaFactoryAlpha<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends
|
|
1193
|
+
export class SchemaFactoryAlpha<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactoryBeta<TScope, TName> {
|
|
1176
1194
|
arrayAlpha<const Name extends TName, const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): ArrayNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
1177
1195
|
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>;
|
|
1178
1196
|
static readonly identifier: <const TCustomMetadata = unknown>(props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Identifier, LeafSchema<"string", string> & SimpleLeafNodeSchema, TCustomMetadata>;
|
|
@@ -1197,9 +1215,9 @@ export class SchemaFactoryAlpha<out TScope extends string | undefined = string |
|
|
|
1197
1215
|
record<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchemaNonClass<ScopedSchemaName<TScope, `Record<${string}>`>, NodeKind.Record, TreeRecordNode<T> & WithType<ScopedSchemaName<TScope, `Record<${string}>`>, NodeKind.Record>, RecordNodeInsertableData<T>, true, T, undefined>;
|
|
1198
1216
|
record<const Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Record, TreeRecordNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Record>, RecordNodeInsertableData<T>, true, T, undefined>;
|
|
1199
1217
|
recordAlpha<const Name extends TName, const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): RecordNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
1200
|
-
recordRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Record, TreeRecordNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Record, unknown>, {
|
|
1218
|
+
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>, {
|
|
1201
1219
|
readonly [x: string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
|
|
1202
|
-
}, false, T, undefined>;
|
|
1220
|
+
}, false, T, undefined, TCustomMetadata>;
|
|
1203
1221
|
static readonly required: {
|
|
1204
1222
|
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined): FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata>;
|
|
1205
1223
|
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldPropsAlpha<TCustomMetadata_1>, "defaultProvider"> | undefined): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T_1>, TCustomMetadata_1>;
|
|
@@ -1210,14 +1228,19 @@ export class SchemaFactoryAlpha<out TScope extends string | undefined = string |
|
|
|
1210
1228
|
};
|
|
1211
1229
|
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>;
|
|
1212
1230
|
readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata>;
|
|
1213
|
-
|
|
1231
|
+
scopedFactoryAlpha<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryAlpha<ScopedSchemaName<TScope, T>, TNameInner>;
|
|
1214
1232
|
static staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
|
|
1215
1233
|
staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
|
|
1216
1234
|
}
|
|
1217
1235
|
|
|
1218
|
-
// @
|
|
1236
|
+
// @beta
|
|
1237
|
+
export class SchemaFactoryBeta<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactory<TScope, TName> {
|
|
1238
|
+
scopedFactory<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryBeta<ScopedSchemaName<TScope, T>, TNameInner>;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
// @alpha @input
|
|
1219
1242
|
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends NodeSchemaOptionsAlpha<TCustomMetadata> {
|
|
1220
|
-
allowUnknownOptionalFields?: boolean;
|
|
1243
|
+
readonly allowUnknownOptionalFields?: boolean;
|
|
1221
1244
|
}
|
|
1222
1245
|
|
|
1223
1246
|
// @public @sealed @system
|
|
@@ -1267,7 +1290,7 @@ export interface SharedObjectKind<out TSharedObject = unknown> extends ErasedTyp
|
|
|
1267
1290
|
// @public
|
|
1268
1291
|
export const SharedTree: SharedObjectKind<ITree>;
|
|
1269
1292
|
|
|
1270
|
-
// @alpha
|
|
1293
|
+
// @alpha @input
|
|
1271
1294
|
export interface SharedTreeFormatOptions {
|
|
1272
1295
|
formatVersion: SharedTreeFormatVersion[keyof SharedTreeFormatVersion];
|
|
1273
1296
|
treeEncodeType: TreeCompressionStrategy;
|
|
@@ -1522,18 +1545,10 @@ export namespace TableSchema {
|
|
|
1522
1545
|
export function column<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitAnnotatedFieldSchema>(params: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {
|
|
1523
1546
|
readonly props: TProps;
|
|
1524
1547
|
}): System_TableSchema.ColumnSchemaBase<TScope, TCell, TProps>;
|
|
1525
|
-
export interface InsertColumnParameters<TColumn extends ImplicitAllowedTypes> {
|
|
1526
|
-
readonly column: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>;
|
|
1527
|
-
readonly index?: number | undefined;
|
|
1528
|
-
}
|
|
1529
1548
|
export interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
|
|
1530
1549
|
readonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
1531
1550
|
readonly index?: number | undefined;
|
|
1532
1551
|
}
|
|
1533
|
-
export interface InsertRowParameters<TRow extends ImplicitAllowedTypes> {
|
|
1534
|
-
readonly index?: number | undefined;
|
|
1535
|
-
readonly row: InsertableTreeNodeFromImplicitAllowedTypes<TRow>;
|
|
1536
|
-
}
|
|
1537
1552
|
export interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
|
|
1538
1553
|
readonly index?: number | undefined;
|
|
1539
1554
|
readonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
@@ -1568,17 +1583,13 @@ export namespace TableSchema {
|
|
|
1568
1583
|
getCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
1569
1584
|
getColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
|
|
1570
1585
|
getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
|
|
1571
|
-
insertColumn(params: InsertColumnParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>;
|
|
1572
1586
|
insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
1573
|
-
insertRow(params: InsertRowParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>;
|
|
1574
1587
|
insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
1575
|
-
removeAllColumns(): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
1576
|
-
removeAllRows(): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
1577
1588
|
removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
|
|
1578
|
-
|
|
1589
|
+
removeColumns(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
1579
1590
|
removeColumns(columns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
1580
1591
|
removeColumns(columns: readonly string[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
|
|
1581
|
-
|
|
1592
|
+
removeRows(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
1582
1593
|
removeRows(rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
1583
1594
|
removeRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
|
|
1584
1595
|
readonly rows: TreeArrayNode<TRow>;
|
|
@@ -1669,7 +1680,7 @@ export interface TreeAlpha {
|
|
|
1669
1680
|
idCompressor?: IIdCompressor;
|
|
1670
1681
|
} & ICodecOptions): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
1671
1682
|
importConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(schema: UnsafeUnknownSchema extends TSchema ? ImplicitFieldSchema : TSchema & ImplicitFieldSchema, data: ConciseTree | undefined): Unhydrated<TSchema extends ImplicitFieldSchema ? TreeFieldFromImplicitField<TSchema> : TreeNode | TreeLeafValue | undefined>;
|
|
1672
|
-
importVerbose<const TSchema extends ImplicitFieldSchema>(schema: TSchema, data: VerboseTree | undefined, options?:
|
|
1683
|
+
importVerbose<const TSchema extends ImplicitFieldSchema>(schema: TSchema, data: VerboseTree | undefined, options?: TreeParsingOptions): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
1673
1684
|
key2(node: TreeNode): string | number | undefined;
|
|
1674
1685
|
}
|
|
1675
1686
|
|
|
@@ -1720,6 +1731,8 @@ export interface TreeBranch extends IDisposable {
|
|
|
1720
1731
|
hasRootSchema<TSchema extends ImplicitFieldSchema>(schema: TSchema): this is TreeViewAlpha<TSchema>;
|
|
1721
1732
|
merge(branch: TreeBranch, disposeMerged?: boolean): void;
|
|
1722
1733
|
rebaseOnto(branch: TreeBranch): void;
|
|
1734
|
+
runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>, params?: RunTransactionParams): TransactionResultExt<TSuccessValue, TFailureValue>;
|
|
1735
|
+
runTransaction(transaction: () => VoidTransactionCallbackStatus | void, params?: RunTransactionParams): TransactionResult;
|
|
1723
1736
|
}
|
|
1724
1737
|
|
|
1725
1738
|
// @alpha @sealed
|
|
@@ -1750,9 +1763,9 @@ export enum TreeCompressionStrategy {
|
|
|
1750
1763
|
Uncompressed = 1
|
|
1751
1764
|
}
|
|
1752
1765
|
|
|
1753
|
-
// @alpha
|
|
1754
|
-
export interface TreeEncodingOptions {
|
|
1755
|
-
readonly
|
|
1766
|
+
// @alpha @input
|
|
1767
|
+
export interface TreeEncodingOptions<TKeyOptions = KeyEncodingOptions> {
|
|
1768
|
+
readonly keys?: TKeyOptions;
|
|
1756
1769
|
}
|
|
1757
1770
|
|
|
1758
1771
|
// @public
|
|
@@ -1846,6 +1859,9 @@ export type TreeNodeSchemaNonClass<Name extends string = string, Kind extends No
|
|
|
1846
1859
|
// @public
|
|
1847
1860
|
export type TreeObjectNode<T extends RestrictiveStringRecord<ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object, T>;
|
|
1848
1861
|
|
|
1862
|
+
// @alpha @input
|
|
1863
|
+
export type TreeParsingOptions = TreeEncodingOptions<KeyEncodingOptions.usePropertyKeys | KeyEncodingOptions.knownStoredKeys>;
|
|
1864
|
+
|
|
1849
1865
|
// @alpha
|
|
1850
1866
|
export interface TreeRecordNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends TreeNode, Record<string, TreeNodeFromImplicitAllowedTypes<TAllowedTypes>> {
|
|
1851
1867
|
[Symbol.iterator](): IterableIterator<[
|
|
@@ -1869,8 +1885,8 @@ export interface TreeSchema extends SimpleTreeSchema {
|
|
|
1869
1885
|
readonly root: FieldSchemaAlpha;
|
|
1870
1886
|
}
|
|
1871
1887
|
|
|
1872
|
-
// @alpha
|
|
1873
|
-
export interface TreeSchemaEncodingOptions extends
|
|
1888
|
+
// @alpha @input
|
|
1889
|
+
export interface TreeSchemaEncodingOptions extends TreeParsingOptions {
|
|
1874
1890
|
readonly requireFieldsWithDefaults?: boolean;
|
|
1875
1891
|
}
|
|
1876
1892
|
|
|
@@ -1904,8 +1920,6 @@ export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | Unsa
|
|
|
1904
1920
|
// (undocumented)
|
|
1905
1921
|
get root(): ReadableField<TSchema>;
|
|
1906
1922
|
set root(newRoot: InsertableField<TSchema>);
|
|
1907
|
-
runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>, params?: RunTransactionParams): TransactionResultExt<TSuccessValue, TFailureValue>;
|
|
1908
|
-
runTransaction(transaction: () => VoidTransactionCallbackStatus | void, params?: RunTransactionParams): TransactionResult;
|
|
1909
1923
|
}
|
|
1910
1924
|
|
|
1911
1925
|
// @public @sealed
|
|
@@ -1986,7 +2000,7 @@ export type UnsafeUnknownSchema = typeof UnsafeUnknownSchema;
|
|
|
1986
2000
|
export type ValidateRecursiveSchema<T extends ValidateRecursiveSchemaTemplate<T>> = true;
|
|
1987
2001
|
|
|
1988
2002
|
// @public @system
|
|
1989
|
-
export type ValidateRecursiveSchemaTemplate<T extends
|
|
2003
|
+
export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchemaClass> = TreeNodeSchemaClass<string, NodeKind.Array | NodeKind.Map | NodeKind.Object | NodeKind.Record, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
1990
2004
|
[NodeKind.Object]: T["info"] extends RestrictiveStringRecord<ImplicitFieldSchema> ? InsertableObjectFromSchemaRecord<T["info"]> : unknown;
|
|
1991
2005
|
[NodeKind.Array]: T["info"] extends ImplicitAllowedTypes ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>> : unknown;
|
|
1992
2006
|
[NodeKind.Map]: T["info"] extends ImplicitAllowedTypes ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]> : unknown;
|
|
@@ -165,6 +165,15 @@ export type FluidObject<T = unknown> = {
|
|
|
165
165
|
// @public
|
|
166
166
|
export type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> = string extends TProp ? never : number extends TProp ? never : TProp extends keyof Required<T>[TProp] ? Required<T>[TProp] extends Required<Required<T>[TProp]>[TProp] ? TProp : never : never;
|
|
167
167
|
|
|
168
|
+
// @beta @input
|
|
169
|
+
export interface ForestOptions {
|
|
170
|
+
readonly forest?: ForestType;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// @beta @sealed
|
|
174
|
+
export interface ForestType extends ErasedType<"ForestType"> {
|
|
175
|
+
}
|
|
176
|
+
|
|
168
177
|
// @public
|
|
169
178
|
export interface IConnection {
|
|
170
179
|
readonly id: string;
|
|
@@ -605,7 +614,7 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
|
605
614
|
readonly description?: string | undefined;
|
|
606
615
|
}
|
|
607
616
|
|
|
608
|
-
// @public @
|
|
617
|
+
// @public @input
|
|
609
618
|
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
610
619
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
611
620
|
}
|
|
@@ -733,6 +742,11 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
733
742
|
static readonly string: LeafSchema<"string", string>;
|
|
734
743
|
}
|
|
735
744
|
|
|
745
|
+
// @beta
|
|
746
|
+
export class SchemaFactoryBeta<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactory<TScope, TName> {
|
|
747
|
+
scopedFactory<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryBeta<ScopedSchemaName<TScope, T>, TNameInner>;
|
|
748
|
+
}
|
|
749
|
+
|
|
736
750
|
// @public @sealed @system
|
|
737
751
|
export interface SchemaStatics {
|
|
738
752
|
readonly boolean: LeafSchema<"boolean", boolean>;
|
|
@@ -1061,7 +1075,7 @@ export type UnionToTuple<Union, A extends unknown[] = [], First = PopUnion<Union
|
|
|
1061
1075
|
export type ValidateRecursiveSchema<T extends ValidateRecursiveSchemaTemplate<T>> = true;
|
|
1062
1076
|
|
|
1063
1077
|
// @public @system
|
|
1064
|
-
export type ValidateRecursiveSchemaTemplate<T extends
|
|
1078
|
+
export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchemaClass> = TreeNodeSchemaClass<string, NodeKind.Array | NodeKind.Map | NodeKind.Object | NodeKind.Record, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
1065
1079
|
[NodeKind.Object]: T["info"] extends RestrictiveStringRecord<ImplicitFieldSchema> ? InsertableObjectFromSchemaRecord<T["info"]> : unknown;
|
|
1066
1080
|
[NodeKind.Array]: T["info"] extends ImplicitAllowedTypes ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>> : unknown;
|
|
1067
1081
|
[NodeKind.Map]: T["info"] extends ImplicitAllowedTypes ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]> : unknown;
|