fluid-framework 2.42.0 → 2.43.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 +189 -0
- package/api-report/fluid-framework.alpha.api.md +72 -25
- package/api-report/fluid-framework.beta.api.md +34 -0
- package/api-report/fluid-framework.legacy.alpha.api.md +16 -7
- package/api-report/fluid-framework.legacy.public.api.md +1 -0
- package/api-report/fluid-framework.public.api.md +1 -0
- package/dist/alpha.d.ts +12 -6
- package/dist/beta.d.ts +6 -1
- package/lib/alpha.d.ts +12 -6
- package/lib/beta.d.ts +6 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,194 @@
|
|
|
1
1
|
# fluid-framework
|
|
2
2
|
|
|
3
|
+
## 2.43.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Tree's enum schema utility are now beta ([#24749](https://github.com/microsoft/FluidFramework/pull/24749)) [a23bc9e4d02](https://github.com/microsoft/FluidFramework/commit/a23bc9e4d025f0925d09daadc2952bf0bfacc06b)
|
|
8
|
+
|
|
9
|
+
The functions [singletonSchema](https://fluidframework.com/docs/api/tree/#singletonschema-function), [adaptEnum](https://fluidframework.com/docs/api/tree/#adaptenum-function) and [enumFromStrings](https://fluidframework.com/docs/api/tree/#enumfromstrings-function) are now `@beta` instead of `@alpha`.
|
|
10
|
+
|
|
11
|
+
- Add TreeAlpha.child and TreeAlpha.children APIs for generic tree traversal ([#24723](https://github.com/microsoft/FluidFramework/pull/24723)) [87941b7fa05](https://github.com/microsoft/FluidFramework/commit/87941b7fa0575e030344079a25f65d25d8457367)
|
|
12
|
+
|
|
13
|
+
#### TreeAlpha.child
|
|
14
|
+
|
|
15
|
+
Access a child node or value of a `TreeNode` by its property key.
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
class MyObject extends schemaFactory.object("MyObject", {
|
|
19
|
+
foo: schemaFactory.string;
|
|
20
|
+
bar: schemaFactory.optional(schemaFactory.string);
|
|
21
|
+
}) {}
|
|
22
|
+
|
|
23
|
+
const myObject = new MyObject({
|
|
24
|
+
foo: "Hello world!"
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const foo = TreeAlpha.child(myObject, "foo"); // "Hello world!"
|
|
28
|
+
const bar = TreeAlpha.child(myObject, "bar"); // undefined
|
|
29
|
+
const baz = TreeAlpha.child(myObject, "baz"); // undefined
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
class MyArray extends schemaFactory.array("MyArray", schemaFactory.string) {}
|
|
34
|
+
|
|
35
|
+
const myArray = new MyArray("Hello", "World");
|
|
36
|
+
|
|
37
|
+
const child0 = TreeAlpha.child(myArray, 0); // "Hello"
|
|
38
|
+
const child1 = TreeAlpha.child(myArray, 1); // "World
|
|
39
|
+
const child2 = TreeAlpha.child(myArray, 2); // undefined
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
#### TreeAlpha.children
|
|
43
|
+
|
|
44
|
+
Get all child nodes / values of a `TreeNode`, keyed by their property keys.
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
class MyObject extends schemaFactory.object("MyObject", {
|
|
48
|
+
foo: schemaFactory.string;
|
|
49
|
+
bar: schemaFactory.optional(schemaFactory.string);
|
|
50
|
+
baz: schemaFactory.optional(schemaFactory.number);
|
|
51
|
+
}) {}
|
|
52
|
+
|
|
53
|
+
const myObject = new MyObject({
|
|
54
|
+
foo: "Hello world!",
|
|
55
|
+
baz: 42,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const children = TreeAlpha.children(myObject); // [["foo", "Hello world!"], ["baz", 42]]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
class MyArray extends schemaFactory.array("MyArray", schemaFactory.string) {}
|
|
63
|
+
|
|
64
|
+
const myArray = new MyArray("Hello", "World");
|
|
65
|
+
|
|
66
|
+
const children = TreeAlpha.children(myObject); // [[0, "Hello"], [1, "World"]]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- Rename and change type of annotatedAllowedTypeSet on FieldSchemaAlpha to more closely align with allowedTypesSet ([#24820](https://github.com/microsoft/FluidFramework/pull/24820)) [f4e8dc8cd09](https://github.com/microsoft/FluidFramework/commit/f4e8dc8cd09f052f21e436e2c0584a1a34d2be77)
|
|
70
|
+
|
|
71
|
+
This changes the `annotatedAllowedTypeSet` property on [`FieldSchemaAlpha`](https://fluidframework.com/docs/api/fluid-framework/fieldschemaalpha-class).
|
|
72
|
+
It is now called `annotatedAllowedTypesNormalized` and stores evaluated schemas along with their annotations in a list of objects rather than as a mapping from the schemas to their annotations. This makes the API easier to use and better aligns with the current public APIs.
|
|
73
|
+
|
|
74
|
+
- Persisted metadata for Shared Tree schemas (Alpha) ([#24812](https://github.com/microsoft/FluidFramework/pull/24812)) [3f81ab52ff7](https://github.com/microsoft/FluidFramework/commit/3f81ab52ff7265a8533c0e192c8b77d298b70eea)
|
|
75
|
+
|
|
76
|
+
The persisted metadata feature for Shared Tree allows an application author to write document-persisted metadata along with the schema. This feature is supported for both node and field schemas.
|
|
77
|
+
|
|
78
|
+
#### Using the persisted metadata feature
|
|
79
|
+
|
|
80
|
+
As of now, persisted metadata support is available via the SchemaFactoryAlpha API:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
// Construct a schema factory with alpha APIs
|
|
84
|
+
const schemaFactory = new SchemaFactoryAlpha("com.example");
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Persisted metadata can take the shape of any JSON-serializable object, e.g.:
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
const persistedMetadata = { a: 2 };
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### Feature flag
|
|
94
|
+
|
|
95
|
+
To enable persisted metadata, use `configuredSharedTree` to specify the format version. The tree that is returned can be substituted in place of the default `SharedTree` object exported by the Fluid Framework. For example:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
const tree = configuredSharedTree({
|
|
99
|
+
formatVersion: SharedTreeFormatVersion.v5,
|
|
100
|
+
}).create(runtime);
|
|
101
|
+
|
|
102
|
+
export const MyContainerSchema = {
|
|
103
|
+
initialObjects: {
|
|
104
|
+
appData: tree,
|
|
105
|
+
},
|
|
106
|
+
} satisfies ContainerSchema;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### Examples
|
|
110
|
+
|
|
111
|
+
##### Field schemas with persisted metadata
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
// Construct a schema factory with alpha APIs
|
|
115
|
+
const schemaFactory = new SchemaFactoryAlpha("com.example");
|
|
116
|
+
|
|
117
|
+
// Define metadata. This can take the shape of any JSON-serializable object.
|
|
118
|
+
const persistedMetadata = { a: 2 };
|
|
119
|
+
|
|
120
|
+
// Foo is an object type with metadata
|
|
121
|
+
class Foo extends schemaFactory.objectAlpha(
|
|
122
|
+
"Foo",
|
|
123
|
+
{
|
|
124
|
+
// Metadata for a required number field
|
|
125
|
+
bar: schemaFactory.required(schemaFactory.number, { persistedMetadata }),
|
|
126
|
+
|
|
127
|
+
// Metadata for an optional string field
|
|
128
|
+
baz: schemaFactory.optional(schemaFactory.string, { persistedMetadata }),
|
|
129
|
+
// Metadata for the object type Foo
|
|
130
|
+
},
|
|
131
|
+
{ persistedMetadata },
|
|
132
|
+
) {}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
##### Recursive field schemas
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
// Construct a schema factory with alpha APIs
|
|
139
|
+
const schemaFactory = new SchemaFactoryAlpha("com.example");
|
|
140
|
+
|
|
141
|
+
// Define metadata. This can take the shape of any JSON-serializable object.
|
|
142
|
+
const persistedMetadata = { a: 2 };
|
|
143
|
+
|
|
144
|
+
// Recursive object schema with persisted metadata
|
|
145
|
+
class RecursiveObject extends schemaFactory.objectRecursive(
|
|
146
|
+
"RecursiveObject",
|
|
147
|
+
{
|
|
148
|
+
x: [() => RecursiveObject, schemaFactory.number],
|
|
149
|
+
},
|
|
150
|
+
{ persistedMetadata },
|
|
151
|
+
) {}
|
|
152
|
+
|
|
153
|
+
// Recursive field schema with metadata
|
|
154
|
+
const recursiveField = schemaFactory.optionalRecursive(
|
|
155
|
+
[() => RecursiveObject, schemaFactory.number],
|
|
156
|
+
{ persistedMetadata },
|
|
157
|
+
);
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
##### Recursive object schemas
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
// Construct a schema factory with alpha APIs
|
|
164
|
+
const schemaFactory = new SchemaFactoryAlpha("com.example");
|
|
165
|
+
|
|
166
|
+
// Define metadata. This can take the shape of any JSON-serializable object.
|
|
167
|
+
const persistedMetadata = { a: 2 };
|
|
168
|
+
|
|
169
|
+
// Recursive array schema
|
|
170
|
+
class Foos extends schemaFactory.arrayRecursive("FooList", [() => Foo], {
|
|
171
|
+
persistedMetadata,
|
|
172
|
+
}) {}
|
|
173
|
+
|
|
174
|
+
// Recursive object schema
|
|
175
|
+
class Foo extends schemaFactory.objectRecursive(
|
|
176
|
+
"Foo",
|
|
177
|
+
{ fooList: Foos },
|
|
178
|
+
{ persistedMetadata },
|
|
179
|
+
) {}
|
|
180
|
+
|
|
181
|
+
// Recursive map schema
|
|
182
|
+
class FooMap extends schemaFactory.mapRecursive("FooMap", [() => Foo], {
|
|
183
|
+
persistedMetadata,
|
|
184
|
+
}) {}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
- Improved Schema Validation ([#24866](https://github.com/microsoft/FluidFramework/pull/24866)) [caae4ae15ed](https://github.com/microsoft/FluidFramework/commit/caae4ae15edeb8aeae33b0520b18dbb1993965f6)
|
|
188
|
+
|
|
189
|
+
When constructing a [`TreeViewConfiguration`](https://fluidframework.com/docs/api/fluid-framework/treeviewconfiguration-class), the same schema listed more than once in a given [`AllowedTypes`](https://fluidframework.com/docs/api/fluid-framework/allowedtypes-typealias) is now an error even when [`preventAmbiguity`](https://fluidframework.com/docs/api/fluid-framework/treeviewconfiguration-class#preventambiguity-property) is false.
|
|
190
|
+
Previously a bug resulted in this only being rejected when `preventAmbiguity` was true.
|
|
191
|
+
|
|
3
192
|
## 2.42.0
|
|
4
193
|
|
|
5
194
|
### Minor Changes
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
-
// @
|
|
7
|
+
// @beta
|
|
8
8
|
export function adaptEnum<TScope extends string, const TEnum extends Record<string, string | number>>(factory: SchemaFactory<TScope>, members: TEnum): (<TValue extends TEnum[keyof TEnum]>(value: TValue) => TValue extends unknown ? TreeNode & {
|
|
9
9
|
readonly value: TValue;
|
|
10
10
|
} : never) & { readonly [Property in keyof TEnum]: TreeNodeSchemaClass<ScopedSchemaName<TScope, TEnum[Property]>, NodeKind.Object, TreeNode & {
|
|
@@ -32,9 +32,9 @@ export interface AllowedTypesMetadata {
|
|
|
32
32
|
export function allowUnused<T>(t?: T): void;
|
|
33
33
|
|
|
34
34
|
// @alpha
|
|
35
|
-
export interface AnnotatedAllowedType<T
|
|
35
|
+
export interface AnnotatedAllowedType<T = LazyItem<TreeNodeSchema>> {
|
|
36
36
|
readonly metadata: AllowedTypeMetadata;
|
|
37
|
-
readonly type:
|
|
37
|
+
readonly type: T;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// @alpha
|
|
@@ -177,7 +177,7 @@ export function createSimpleTreeIndex<TFieldSchema extends ImplicitFieldSchema,
|
|
|
177
177
|
interface DefaultProvider extends ErasedType<"@fluidframework/tree.FieldProvider"> {
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
// @
|
|
180
|
+
// @beta
|
|
181
181
|
export function enumFromStrings<TScope extends string, const Members extends readonly string[]>(factory: SchemaFactory<TScope>, members: Members): (<TValue extends Members[number]>(value: TValue) => TValue extends unknown ? TreeNode & {
|
|
182
182
|
readonly value: TValue;
|
|
183
183
|
} : never) & { [Index in Extract<keyof Members, `${number}`> extends `${infer N extends number}` ? N : never as Members[Index]]: TreeNodeSchemaClass<ScopedSchemaName<TScope, Members[Index]>, NodeKind.Object, TreeNode & {
|
|
@@ -230,6 +230,11 @@ export interface FieldProps<TCustomMetadata = unknown> {
|
|
|
230
230
|
readonly metadata?: FieldSchemaMetadata<TCustomMetadata>;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
+
// @alpha @input
|
|
234
|
+
export interface FieldPropsAlpha<TCustomMetadata = unknown> extends FieldProps<TCustomMetadata> {
|
|
235
|
+
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
236
|
+
}
|
|
237
|
+
|
|
233
238
|
// @public @sealed
|
|
234
239
|
export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, out TCustomMetadata = unknown> {
|
|
235
240
|
protected constructor(
|
|
@@ -247,13 +252,14 @@ export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types exten
|
|
|
247
252
|
|
|
248
253
|
// @alpha @sealed
|
|
249
254
|
export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, TCustomMetadata = unknown> extends FieldSchema<Kind, Types, TCustomMetadata> implements SimpleFieldSchema {
|
|
250
|
-
protected constructor(kind: Kind, types: Types, annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes, props?:
|
|
255
|
+
protected constructor(kind: Kind, types: Types, annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes, props?: FieldPropsAlpha<TCustomMetadata>);
|
|
251
256
|
// (undocumented)
|
|
252
257
|
get allowedTypesIdentifiers(): ReadonlySet<string>;
|
|
253
258
|
readonly allowedTypesMetadata: AllowedTypesMetadata;
|
|
254
259
|
// (undocumented)
|
|
255
260
|
readonly annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes;
|
|
256
|
-
get
|
|
261
|
+
get annotatedAllowedTypesNormalized(): NormalizedAnnotatedAllowedTypes;
|
|
262
|
+
get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined;
|
|
257
263
|
}
|
|
258
264
|
|
|
259
265
|
// @alpha @sealed @system
|
|
@@ -787,6 +793,14 @@ export type JsonCompatibleObject<TExtra = never> = {
|
|
|
787
793
|
[P in string]?: JsonCompatible<TExtra>;
|
|
788
794
|
};
|
|
789
795
|
|
|
796
|
+
// @alpha
|
|
797
|
+
export type JsonCompatibleReadOnly = string | number | boolean | null | readonly JsonCompatibleReadOnly[] | JsonCompatibleReadOnlyObject;
|
|
798
|
+
|
|
799
|
+
// @alpha
|
|
800
|
+
export type JsonCompatibleReadOnlyObject = {
|
|
801
|
+
readonly [P in string]?: JsonCompatibleReadOnly;
|
|
802
|
+
};
|
|
803
|
+
|
|
790
804
|
// @alpha @sealed
|
|
791
805
|
export type JsonFieldSchema = {
|
|
792
806
|
readonly description?: string | undefined;
|
|
@@ -948,9 +962,20 @@ export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
|
948
962
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
949
963
|
}
|
|
950
964
|
|
|
965
|
+
// @alpha
|
|
966
|
+
export interface NodeSchemaOptionsAlpha<out TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
|
|
967
|
+
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
968
|
+
}
|
|
969
|
+
|
|
951
970
|
// @alpha
|
|
952
971
|
export const noopValidator: JsonValidator;
|
|
953
972
|
|
|
973
|
+
// @alpha
|
|
974
|
+
export interface NormalizedAnnotatedAllowedTypes {
|
|
975
|
+
readonly metadata: AllowedTypesMetadata;
|
|
976
|
+
readonly types: readonly AnnotatedAllowedType<TreeNodeSchema>[];
|
|
977
|
+
}
|
|
978
|
+
|
|
954
979
|
// @public @system
|
|
955
980
|
export type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = RestrictiveStringRecord<ImplicitFieldSchema> extends T ? {} : {
|
|
956
981
|
-readonly [Property in keyof T]: Property extends string ? TreeFieldFromImplicitField<T[Property]> : unknown;
|
|
@@ -975,7 +1000,7 @@ export function onAssertionFailure(handler: (error: Error) => void): () => void;
|
|
|
975
1000
|
// @alpha
|
|
976
1001
|
export function persistedToSimpleSchema(persisted: JsonCompatible, options: ICodecOptions): SimpleTreeSchema;
|
|
977
1002
|
|
|
978
|
-
// @
|
|
1003
|
+
// @beta @system
|
|
979
1004
|
export type PopUnion<Union, AsOverloadedFunction = UnionToIntersection<Union extends unknown ? (f: Union) => void : never>> = AsOverloadedFunction extends (a: infer First) => void ? First : never;
|
|
980
1005
|
|
|
981
1006
|
// @alpha @system
|
|
@@ -1121,30 +1146,42 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
1121
1146
|
|
|
1122
1147
|
// @alpha
|
|
1123
1148
|
export class SchemaFactoryAlpha<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactory<TScope, TName> {
|
|
1124
|
-
arrayAlpha<const Name extends TName, const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?:
|
|
1125
|
-
arrayRecursive<const Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?:
|
|
1149
|
+
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>;
|
|
1150
|
+
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>;
|
|
1126
1151
|
static readonly identifier: <const TCustomMetadata = unknown>(props?: Omit<FieldProps_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha_2<FieldKind_2.Identifier, LeafSchema_2<"string", string> & SimpleLeafNodeSchema_2, TCustomMetadata>;
|
|
1127
1152
|
static readonly leaves: readonly [LeafSchema_2<"string", string> & SimpleLeafNodeSchema_2, LeafSchema_2<"number", number> & SimpleLeafNodeSchema_2, LeafSchema_2<"boolean", boolean> & SimpleLeafNodeSchema_2, LeafSchema_2<"null", null> & SimpleLeafNodeSchema_2, LeafSchema_2<"handle", IFluidHandle_2<unknown>> & SimpleLeafNodeSchema_2];
|
|
1128
|
-
|
|
1129
|
-
|
|
1153
|
+
readonly leaves: readonly [LeafSchema_2<"string", string> & SimpleLeafNodeSchema_2, LeafSchema_2<"number", number> & SimpleLeafNodeSchema_2, LeafSchema_2<"boolean", boolean> & SimpleLeafNodeSchema_2, LeafSchema_2<"null", null> & SimpleLeafNodeSchema_2, LeafSchema_2<"handle", IFluidHandle_2<unknown>> & SimpleLeafNodeSchema_2];
|
|
1154
|
+
mapAlpha<Name extends TName, const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): MapNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
1155
|
+
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>;
|
|
1130
1156
|
objectAlpha<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitAnnotatedFieldSchema>, const TCustomMetadata = unknown>(name: Name, fields: T, options?: SchemaFactoryObjectOptions<TCustomMetadata>): ObjectNodeSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> & {
|
|
1131
1157
|
readonly createFromInsertable: unknown;
|
|
1132
1158
|
};
|
|
1133
1159
|
objectRecursive<const Name extends TName, const T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>, const TCustomMetadata = unknown>(name: Name, t: T, options?: SchemaFactoryObjectOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, System_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & System_Unsafe.InsertableObjectFromSchemaRecordUnsafe<T>, false, T, never, TCustomMetadata> & SimpleObjectNodeSchema<TCustomMetadata> & Pick<ObjectNodeSchema, "fields">;
|
|
1134
1160
|
static readonly optional: {
|
|
1135
|
-
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<
|
|
1136
|
-
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<
|
|
1161
|
+
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha_2<TCustomMetadata>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Optional, T, TCustomMetadata>;
|
|
1162
|
+
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldPropsAlpha_2<TCustomMetadata_1>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Optional, UnannotateImplicitAllowedTypes_2<T_1>, TCustomMetadata_1>;
|
|
1163
|
+
};
|
|
1164
|
+
readonly optional: {
|
|
1165
|
+
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha_2<TCustomMetadata>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Optional, T, TCustomMetadata>;
|
|
1166
|
+
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldPropsAlpha_2<TCustomMetadata_1>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Optional, UnannotateImplicitAllowedTypes_2<T_1>, TCustomMetadata_1>;
|
|
1137
1167
|
};
|
|
1138
|
-
static readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<
|
|
1168
|
+
static readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe_2<FieldKind_2.Optional, T, TCustomMetadata>;
|
|
1169
|
+
readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe_2<FieldKind_2.Optional, T, TCustomMetadata>;
|
|
1139
1170
|
static readonly required: {
|
|
1140
|
-
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<
|
|
1141
|
-
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<
|
|
1171
|
+
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha_2<TCustomMetadata>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Required, T, TCustomMetadata>;
|
|
1172
|
+
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldPropsAlpha_2<TCustomMetadata_1>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Required, UnannotateImplicitAllowedTypes_2<T_1>, TCustomMetadata_1>;
|
|
1173
|
+
};
|
|
1174
|
+
readonly required: {
|
|
1175
|
+
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha_2<TCustomMetadata>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Required, T, TCustomMetadata>;
|
|
1176
|
+
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldPropsAlpha_2<TCustomMetadata_1>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Required, UnannotateImplicitAllowedTypes_2<T_1>, TCustomMetadata_1>;
|
|
1142
1177
|
};
|
|
1178
|
+
static readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe_2<FieldKind_2.Required, T, TCustomMetadata>;
|
|
1179
|
+
readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe_2<FieldKind_2.Required, T, TCustomMetadata>;
|
|
1143
1180
|
scopedFactory<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryAlpha<ScopedSchemaName<TScope, T>, TNameInner>;
|
|
1144
1181
|
}
|
|
1145
1182
|
|
|
1146
1183
|
// @alpha
|
|
1147
|
-
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends
|
|
1184
|
+
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends NodeSchemaOptionsAlpha<TCustomMetadata> {
|
|
1148
1185
|
allowUnknownOptionalFields?: boolean;
|
|
1149
1186
|
}
|
|
1150
1187
|
|
|
@@ -1195,6 +1232,7 @@ export const SharedTreeFormatVersion: {
|
|
|
1195
1232
|
readonly v1: 1;
|
|
1196
1233
|
readonly v2: 2;
|
|
1197
1234
|
readonly v3: 3;
|
|
1235
|
+
readonly v5: 5;
|
|
1198
1236
|
};
|
|
1199
1237
|
|
|
1200
1238
|
// @alpha
|
|
@@ -1204,7 +1242,7 @@ export type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;
|
|
|
1204
1242
|
export type SharedTreeOptions = Partial<CodecWriteOptions> & Partial<SharedTreeFormatOptions> & ForestOptions;
|
|
1205
1243
|
|
|
1206
1244
|
// @alpha @sealed
|
|
1207
|
-
export interface SimpleArrayNodeSchema<out TCustomMetadata = unknown> extends
|
|
1245
|
+
export interface SimpleArrayNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Array, TCustomMetadata> {
|
|
1208
1246
|
readonly allowedTypesIdentifiers: ReadonlySet<string>;
|
|
1209
1247
|
}
|
|
1210
1248
|
|
|
@@ -1213,15 +1251,16 @@ export interface SimpleFieldSchema {
|
|
|
1213
1251
|
readonly allowedTypesIdentifiers: ReadonlySet<string>;
|
|
1214
1252
|
readonly kind: FieldKind;
|
|
1215
1253
|
readonly metadata: FieldSchemaMetadata;
|
|
1254
|
+
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
1216
1255
|
}
|
|
1217
1256
|
|
|
1218
1257
|
// @alpha @sealed
|
|
1219
|
-
export interface SimpleLeafNodeSchema extends
|
|
1258
|
+
export interface SimpleLeafNodeSchema extends SimpleNodeSchemaBaseAlpha<NodeKind.Leaf> {
|
|
1220
1259
|
readonly leafKind: ValueSchema;
|
|
1221
1260
|
}
|
|
1222
1261
|
|
|
1223
1262
|
// @alpha @sealed
|
|
1224
|
-
export interface SimpleMapNodeSchema<out TCustomMetadata = unknown> extends
|
|
1263
|
+
export interface SimpleMapNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Map, TCustomMetadata> {
|
|
1225
1264
|
readonly allowedTypesIdentifiers: ReadonlySet<string>;
|
|
1226
1265
|
}
|
|
1227
1266
|
|
|
@@ -1234,13 +1273,18 @@ export interface SimpleNodeSchemaBase<out TNodeKind extends NodeKind, out TCusto
|
|
|
1234
1273
|
readonly metadata: NodeSchemaMetadata<TCustomMetadata>;
|
|
1235
1274
|
}
|
|
1236
1275
|
|
|
1276
|
+
// @alpha @sealed @system
|
|
1277
|
+
export interface SimpleNodeSchemaBaseAlpha<out TNodeKind extends NodeKind, out TCustomMetadata = unknown> extends SimpleNodeSchemaBase<TNodeKind, TCustomMetadata> {
|
|
1278
|
+
readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1237
1281
|
// @alpha @sealed
|
|
1238
1282
|
export interface SimpleObjectFieldSchema extends SimpleFieldSchema {
|
|
1239
1283
|
readonly storedKey: string;
|
|
1240
1284
|
}
|
|
1241
1285
|
|
|
1242
1286
|
// @alpha @sealed
|
|
1243
|
-
export interface SimpleObjectNodeSchema<out TCustomMetadata = unknown> extends
|
|
1287
|
+
export interface SimpleObjectNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Object, TCustomMetadata> {
|
|
1244
1288
|
readonly fields: ReadonlyMap<string, SimpleObjectFieldSchema>;
|
|
1245
1289
|
}
|
|
1246
1290
|
|
|
@@ -1253,7 +1297,7 @@ export interface SimpleTreeSchema {
|
|
|
1253
1297
|
readonly root: SimpleFieldSchema;
|
|
1254
1298
|
}
|
|
1255
1299
|
|
|
1256
|
-
// @
|
|
1300
|
+
// @beta
|
|
1257
1301
|
export function singletonSchema<TScope extends string, TName extends string | number>(factory: SchemaFactory<TScope, TName>, name: TName): TreeNodeSchemaClass<ScopedSchemaName<TScope, TName>, NodeKind.Object, TreeNode & {
|
|
1258
1302
|
readonly value: TName;
|
|
1259
1303
|
}, Record<string, never>, true, Record<string, never>, undefined>;
|
|
@@ -1288,7 +1332,7 @@ export namespace System_TableSchema {
|
|
|
1288
1332
|
}), true, {
|
|
1289
1333
|
readonly props: TPropsSchema;
|
|
1290
1334
|
readonly id: FieldSchema_2<FieldKind_3.Identifier, LeafSchema_3<"string", string>, unknown>;
|
|
1291
|
-
readonly cells:
|
|
1335
|
+
readonly cells: FieldSchemaAlpha_3<FieldKind_3.Required, TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, TreeMapNode_2<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, MapNodeInsertableData_2<TCellSchema>, true, TCellSchema, undefined>, unknown>;
|
|
1292
1336
|
}>;
|
|
1293
1337
|
// @system
|
|
1294
1338
|
export function createTableSchema<const TInputScope extends string | undefined, const TCellSchema extends ImplicitAllowedTypes, const TColumnSchema extends ColumnSchemaBase<TInputScope, TCellSchema>, const TRowSchema extends RowSchemaBase<TInputScope, TCellSchema>>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, _cellSchema: TCellSchema, columnSchema: TColumnSchema, rowSchema: TRowSchema): TreeNodeSchemaCore_2<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table">, NodeKind.Object, true, {
|
|
@@ -1560,6 +1604,8 @@ export const Tree: Tree;
|
|
|
1560
1604
|
// @alpha @sealed @system
|
|
1561
1605
|
export interface TreeAlpha {
|
|
1562
1606
|
branch(node: TreeNode): TreeBranch | undefined;
|
|
1607
|
+
child(node: TreeNode, key: string | number): TreeNode | TreeLeafValue | undefined;
|
|
1608
|
+
children(node: TreeNode): Iterable<[propertyKey: string | number, child: TreeNode | TreeLeafValue]>;
|
|
1563
1609
|
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>;
|
|
1564
1610
|
exportCompressed(tree: TreeNode | TreeLeafValue, options: {
|
|
1565
1611
|
idCompressor?: IIdCompressor;
|
|
@@ -1797,6 +1843,7 @@ export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | Unsa
|
|
|
1797
1843
|
// @public @sealed
|
|
1798
1844
|
export class TreeViewConfiguration<const TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
|
|
1799
1845
|
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
1846
|
+
protected readonly definitionsInternal: ReadonlyMap<string, TreeNodeSchema>;
|
|
1800
1847
|
readonly enableSchemaValidation: boolean;
|
|
1801
1848
|
readonly preventAmbiguity: boolean;
|
|
1802
1849
|
readonly schema: TSchema;
|
|
@@ -1807,7 +1854,7 @@ export class TreeViewConfiguration<const TSchema extends ImplicitFieldSchema = I
|
|
|
1807
1854
|
// @alpha @sealed
|
|
1808
1855
|
export class TreeViewConfigurationAlpha<const TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> extends TreeViewConfiguration<TSchema> implements TreeSchema {
|
|
1809
1856
|
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
1810
|
-
|
|
1857
|
+
get definitions(): ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;
|
|
1811
1858
|
readonly root: FieldSchemaAlpha;
|
|
1812
1859
|
}
|
|
1813
1860
|
|
|
@@ -1861,7 +1908,7 @@ export type Unhydrated<T> = T;
|
|
|
1861
1908
|
// @public @system
|
|
1862
1909
|
export type UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) extends (k: infer U) => unknown ? U : never;
|
|
1863
1910
|
|
|
1864
|
-
// @
|
|
1911
|
+
// @beta @system
|
|
1865
1912
|
export type UnionToTuple<Union, A extends unknown[] = [], First = PopUnion<Union>> = IsUnion<Union> extends true ? UnionToTuple<Exclude<Union, First>, [First, ...A]> : [Union, ...A];
|
|
1866
1913
|
|
|
1867
1914
|
// @alpha
|
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
+
// @beta
|
|
8
|
+
export function adaptEnum<TScope extends string, const TEnum extends Record<string, string | number>>(factory: SchemaFactory<TScope>, members: TEnum): (<TValue extends TEnum[keyof TEnum]>(value: TValue) => TValue extends unknown ? TreeNode & {
|
|
9
|
+
readonly value: TValue;
|
|
10
|
+
} : never) & { readonly [Property in keyof TEnum]: TreeNodeSchemaClass<ScopedSchemaName<TScope, TEnum[Property]>, NodeKind.Object, TreeNode & {
|
|
11
|
+
readonly value: TEnum[Property];
|
|
12
|
+
}, Record<string, never>, true, Record<string, never>, undefined>; } & {
|
|
13
|
+
readonly schema: UnionToTuple<{ readonly [Property in keyof TEnum]: TreeNodeSchemaClass<ScopedSchemaName<TScope, TEnum[Property]>, NodeKind.Object, TreeNode & {
|
|
14
|
+
readonly value: TEnum[Property];
|
|
15
|
+
}, Record<string, never>, true, Record<string, never>, undefined>; }[keyof TEnum]>;
|
|
16
|
+
};
|
|
17
|
+
|
|
7
18
|
// @public @system
|
|
8
19
|
export type AllowedTypes = readonly LazyItem<TreeNodeSchema>[];
|
|
9
20
|
|
|
@@ -71,6 +82,17 @@ export interface ContainerSchema {
|
|
|
71
82
|
interface DefaultProvider extends ErasedType<"@fluidframework/tree.FieldProvider"> {
|
|
72
83
|
}
|
|
73
84
|
|
|
85
|
+
// @beta
|
|
86
|
+
export function enumFromStrings<TScope extends string, const Members extends readonly string[]>(factory: SchemaFactory<TScope>, members: Members): (<TValue extends Members[number]>(value: TValue) => TValue extends unknown ? TreeNode & {
|
|
87
|
+
readonly value: TValue;
|
|
88
|
+
} : never) & { [Index in Extract<keyof Members, `${number}`> extends `${infer N extends number}` ? N : never as Members[Index]]: TreeNodeSchemaClass<ScopedSchemaName<TScope, Members[Index]>, NodeKind.Object, TreeNode & {
|
|
89
|
+
readonly value: Members[Index];
|
|
90
|
+
}, Record<string, never>, true, Record<string, never>, undefined>; } & {
|
|
91
|
+
readonly schema: UnionToTuple<Members[number] extends unknown ? { [Index in Extract<keyof Members, `${number}`> extends `${infer N extends number}` ? N : never as Members[Index]]: TreeNodeSchemaClass<ScopedSchemaName<TScope, Members[Index]>, NodeKind.Object, TreeNode & {
|
|
92
|
+
readonly value: Members[Index];
|
|
93
|
+
}, Record<string, never>, true, Record<string, never>, undefined>; }[Members[number]] : never>;
|
|
94
|
+
};
|
|
95
|
+
|
|
74
96
|
// @public @sealed
|
|
75
97
|
export abstract class ErasedType<out Name = unknown> {
|
|
76
98
|
static [Symbol.hasInstance](value: never): value is never;
|
|
@@ -591,6 +613,9 @@ export type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFie
|
|
|
591
613
|
// @public
|
|
592
614
|
export type Off = () => void;
|
|
593
615
|
|
|
616
|
+
// @beta @system
|
|
617
|
+
export type PopUnion<Union, AsOverloadedFunction = UnionToIntersection<Union extends unknown ? (f: Union) => void : never>> = AsOverloadedFunction extends (a: infer First) => void ? First : never;
|
|
618
|
+
|
|
594
619
|
// @public @sealed @system
|
|
595
620
|
export interface ReadonlyArrayNode<out T = TreeNode | TreeLeafValue> extends ReadonlyArray<T>, Awaited<TreeNode & WithType<string, NodeKind.Array>> {
|
|
596
621
|
}
|
|
@@ -739,6 +764,11 @@ export interface SimpleNodeSchemaBase<out TNodeKind extends NodeKind, out TCusto
|
|
|
739
764
|
readonly metadata: NodeSchemaMetadata<TCustomMetadata>;
|
|
740
765
|
}
|
|
741
766
|
|
|
767
|
+
// @beta
|
|
768
|
+
export function singletonSchema<TScope extends string, TName extends string | number>(factory: SchemaFactory<TScope, TName>, name: TName): TreeNodeSchemaClass<ScopedSchemaName<TScope, TName>, NodeKind.Object, TreeNode & {
|
|
769
|
+
readonly value: TName;
|
|
770
|
+
}, Record<string, never>, true, Record<string, never>, undefined>;
|
|
771
|
+
|
|
742
772
|
// @public @system
|
|
743
773
|
export namespace System_Unsafe {
|
|
744
774
|
// @system
|
|
@@ -988,6 +1018,7 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
988
1018
|
// @public @sealed
|
|
989
1019
|
export class TreeViewConfiguration<const TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
|
|
990
1020
|
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
1021
|
+
protected readonly definitionsInternal: ReadonlyMap<string, TreeNodeSchema>;
|
|
991
1022
|
readonly enableSchemaValidation: boolean;
|
|
992
1023
|
readonly preventAmbiguity: boolean;
|
|
993
1024
|
readonly schema: TSchema;
|
|
@@ -1017,6 +1048,9 @@ export type Unhydrated<T> = T;
|
|
|
1017
1048
|
// @public @system
|
|
1018
1049
|
export type UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) extends (k: infer U) => unknown ? U : never;
|
|
1019
1050
|
|
|
1051
|
+
// @beta @system
|
|
1052
|
+
export type UnionToTuple<Union, A extends unknown[] = [], First = PopUnion<Union>> = IsUnion<Union> extends true ? UnionToTuple<Exclude<Union, First>, [First, ...A]> : [Union, ...A];
|
|
1053
|
+
|
|
1020
1054
|
// @public
|
|
1021
1055
|
export type ValidateRecursiveSchema<T extends ValidateRecursiveSchemaTemplate<T>> = true;
|
|
1022
1056
|
|
|
@@ -425,14 +425,16 @@ export interface IFluidLoadable extends IProvideFluidLoadable {
|
|
|
425
425
|
|
|
426
426
|
// @alpha @legacy
|
|
427
427
|
export interface IInterval {
|
|
428
|
-
// (undocumented)
|
|
428
|
+
// @deprecated (undocumented)
|
|
429
429
|
clone(): IInterval;
|
|
430
430
|
compare(b: IInterval): number;
|
|
431
431
|
compareEnd(b: IInterval): number;
|
|
432
432
|
compareStart(b: IInterval): number;
|
|
433
|
-
|
|
433
|
+
// @deprecated
|
|
434
|
+
modify(label: string, start: SequencePlace | undefined, end: SequencePlace | undefined, op?: ISequencedDocumentMessage, localSeq?: number, canSlideToEndpoint?: boolean): IInterval | undefined;
|
|
434
435
|
// (undocumented)
|
|
435
436
|
overlaps(b: IInterval): boolean;
|
|
437
|
+
// @deprecated
|
|
436
438
|
union(b: IInterval): IInterval;
|
|
437
439
|
}
|
|
438
440
|
|
|
@@ -571,7 +573,7 @@ export interface ISequenceIntervalCollection extends TypedEventEmitter<ISequence
|
|
|
571
573
|
end: SequencePlace;
|
|
572
574
|
props?: PropertySet;
|
|
573
575
|
}): SequenceInterval;
|
|
574
|
-
// (undocumented)
|
|
576
|
+
// @deprecated (undocumented)
|
|
575
577
|
attachDeserializer(onDeserialize: DeserializeCallback): void;
|
|
576
578
|
// (undocumented)
|
|
577
579
|
readonly attached: boolean;
|
|
@@ -611,11 +613,11 @@ export interface ISequenceIntervalCollectionEvents extends IEvent {
|
|
|
611
613
|
(event: "changed", listener: (interval: SequenceInterval, propertyDeltas: PropertySet, previousInterval: SequenceInterval | undefined, local: boolean, slide: boolean) => void): void;
|
|
612
614
|
}
|
|
613
615
|
|
|
614
|
-
// @alpha @legacy (undocumented)
|
|
616
|
+
// @alpha @deprecated @legacy (undocumented)
|
|
615
617
|
export interface ISerializableInterval extends IInterval {
|
|
616
618
|
getIntervalId(): string;
|
|
617
619
|
properties: PropertySet;
|
|
618
|
-
// (undocumented)
|
|
620
|
+
// @deprecated (undocumented)
|
|
619
621
|
serialize(): ISerializedInterval;
|
|
620
622
|
}
|
|
621
623
|
|
|
@@ -1031,8 +1033,9 @@ export interface SequenceEvent<TOperation extends MergeTreeDeltaOperationTypes =
|
|
|
1031
1033
|
|
|
1032
1034
|
// @alpha @legacy
|
|
1033
1035
|
export interface SequenceInterval extends ISerializableInterval {
|
|
1036
|
+
// @deprecated
|
|
1034
1037
|
addPositionChangeListeners(beforePositionChange: () => void, afterPositionChange: () => void): void;
|
|
1035
|
-
// (undocumented)
|
|
1038
|
+
// @deprecated (undocumented)
|
|
1036
1039
|
clone(): SequenceInterval;
|
|
1037
1040
|
compare(b: SequenceInterval): number;
|
|
1038
1041
|
compareEnd(b: SequenceInterval): number;
|
|
@@ -1040,13 +1043,17 @@ export interface SequenceInterval extends ISerializableInterval {
|
|
|
1040
1043
|
readonly end: LocalReferencePosition;
|
|
1041
1044
|
// (undocumented)
|
|
1042
1045
|
readonly endSide: Side;
|
|
1046
|
+
getIntervalId(): string;
|
|
1043
1047
|
// (undocumented)
|
|
1044
1048
|
readonly intervalType: IntervalType;
|
|
1045
|
-
|
|
1049
|
+
// @deprecated
|
|
1050
|
+
modify(label: string, start: SequencePlace | undefined, end: SequencePlace | undefined, op?: ISequencedDocumentMessage, localSeq?: number, canSlideToEndpoint?: boolean): SequenceInterval | undefined;
|
|
1046
1051
|
// (undocumented)
|
|
1047
1052
|
overlaps(b: SequenceInterval): boolean;
|
|
1048
1053
|
// (undocumented)
|
|
1049
1054
|
overlapsPos(bstart: number, bend: number): boolean;
|
|
1055
|
+
properties: PropertySet;
|
|
1056
|
+
// @deprecated
|
|
1050
1057
|
removePositionChangeListeners(): void;
|
|
1051
1058
|
// (undocumented)
|
|
1052
1059
|
readonly start: LocalReferencePosition;
|
|
@@ -1054,6 +1061,7 @@ export interface SequenceInterval extends ISerializableInterval {
|
|
|
1054
1061
|
readonly startSide: Side;
|
|
1055
1062
|
// (undocumented)
|
|
1056
1063
|
readonly stickiness: IntervalStickiness;
|
|
1064
|
+
// @deprecated
|
|
1057
1065
|
union(b: SequenceInterval): SequenceInterval;
|
|
1058
1066
|
}
|
|
1059
1067
|
|
|
@@ -1343,6 +1351,7 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
1343
1351
|
// @public @sealed
|
|
1344
1352
|
export class TreeViewConfiguration<const TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
|
|
1345
1353
|
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
1354
|
+
protected readonly definitionsInternal: ReadonlyMap<string, TreeNodeSchema>;
|
|
1346
1355
|
readonly enableSchemaValidation: boolean;
|
|
1347
1356
|
readonly preventAmbiguity: boolean;
|
|
1348
1357
|
readonly schema: TSchema;
|
|
@@ -1003,6 +1003,7 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
1003
1003
|
// @public @sealed
|
|
1004
1004
|
export class TreeViewConfiguration<const TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
|
|
1005
1005
|
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
1006
|
+
protected readonly definitionsInternal: ReadonlyMap<string, TreeNodeSchema>;
|
|
1006
1007
|
readonly enableSchemaValidation: boolean;
|
|
1007
1008
|
readonly preventAmbiguity: boolean;
|
|
1008
1009
|
readonly schema: TSchema;
|
|
@@ -969,6 +969,7 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
969
969
|
// @public @sealed
|
|
970
970
|
export class TreeViewConfiguration<const TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
|
|
971
971
|
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
972
|
+
protected readonly definitionsInternal: ReadonlyMap<string, TreeNodeSchema>;
|
|
972
973
|
readonly enableSchemaValidation: boolean;
|
|
973
974
|
readonly preventAmbiguity: boolean;
|
|
974
975
|
readonly schema: TSchema;
|
package/dist/alpha.d.ts
CHANGED
|
@@ -134,8 +134,13 @@ export {
|
|
|
134
134
|
|
|
135
135
|
// @beta APIs
|
|
136
136
|
NodeChangedData,
|
|
137
|
+
PopUnion,
|
|
137
138
|
TreeBeta,
|
|
138
|
-
TreeChangeEventsBeta,
|
|
139
|
+
TreeChangeEventsBeta,
|
|
140
|
+
UnionToTuple,
|
|
141
|
+
adaptEnum,
|
|
142
|
+
enumFromStrings,
|
|
143
|
+
singletonSchema,
|
|
139
144
|
|
|
140
145
|
// @alpha APIs
|
|
141
146
|
AllowedTypeMetadata,
|
|
@@ -151,6 +156,7 @@ export {
|
|
|
151
156
|
ConciseTree,
|
|
152
157
|
FactoryContent,
|
|
153
158
|
FactoryContentObject,
|
|
159
|
+
FieldPropsAlpha,
|
|
154
160
|
FieldSchemaAlpha,
|
|
155
161
|
FieldSchemaAlphaUnsafe,
|
|
156
162
|
FixRecursiveArraySchema,
|
|
@@ -174,6 +180,8 @@ export {
|
|
|
174
180
|
JsonAsTree,
|
|
175
181
|
JsonCompatible,
|
|
176
182
|
JsonCompatibleObject,
|
|
183
|
+
JsonCompatibleReadOnly,
|
|
184
|
+
JsonCompatibleReadOnlyObject,
|
|
177
185
|
JsonFieldSchema,
|
|
178
186
|
JsonLeafNodeSchema,
|
|
179
187
|
JsonLeafSchemaType,
|
|
@@ -191,8 +199,9 @@ export {
|
|
|
191
199
|
MapNodeCustomizableSchemaUnsafe,
|
|
192
200
|
MapNodePojoEmulationSchema,
|
|
193
201
|
MapNodeSchema,
|
|
202
|
+
NodeSchemaOptionsAlpha,
|
|
203
|
+
NormalizedAnnotatedAllowedTypes,
|
|
194
204
|
ObjectNodeSchema,
|
|
195
|
-
PopUnion,
|
|
196
205
|
ReadSchema,
|
|
197
206
|
ReadableField,
|
|
198
207
|
RevertibleAlpha,
|
|
@@ -209,6 +218,7 @@ export {
|
|
|
209
218
|
SimpleLeafNodeSchema,
|
|
210
219
|
SimpleMapNodeSchema,
|
|
211
220
|
SimpleNodeSchema,
|
|
221
|
+
SimpleNodeSchemaBaseAlpha,
|
|
212
222
|
SimpleObjectFieldSchema,
|
|
213
223
|
SimpleObjectNodeSchema,
|
|
214
224
|
SimpleTreeIndex,
|
|
@@ -241,14 +251,12 @@ export {
|
|
|
241
251
|
UnannotateImplicitAllowedTypes,
|
|
242
252
|
UnannotateImplicitFieldSchema,
|
|
243
253
|
UnannotateSchemaRecord,
|
|
244
|
-
UnionToTuple,
|
|
245
254
|
UnsafeUnknownSchema,
|
|
246
255
|
ValueSchema,
|
|
247
256
|
VerboseTree,
|
|
248
257
|
VerboseTreeNode,
|
|
249
258
|
ViewContent,
|
|
250
259
|
VoidTransactionCallbackStatus,
|
|
251
|
-
adaptEnum,
|
|
252
260
|
allowUnused,
|
|
253
261
|
asTreeViewAlpha,
|
|
254
262
|
cloneWithReplacements,
|
|
@@ -256,7 +264,6 @@ export {
|
|
|
256
264
|
configuredSharedTree,
|
|
257
265
|
createIdentifierIndex,
|
|
258
266
|
createSimpleTreeIndex,
|
|
259
|
-
enumFromStrings,
|
|
260
267
|
evaluateLazySchema,
|
|
261
268
|
extractPersistedSchema,
|
|
262
269
|
generateSchemaFromSimpleSchema,
|
|
@@ -271,6 +278,5 @@ export {
|
|
|
271
278
|
replaceConciseTreeHandles,
|
|
272
279
|
replaceHandles,
|
|
273
280
|
replaceVerboseTreeHandles,
|
|
274
|
-
singletonSchema,
|
|
275
281
|
typeboxValidator
|
|
276
282
|
} from "./index.js";
|
package/dist/beta.d.ts
CHANGED
package/lib/alpha.d.ts
CHANGED
|
@@ -134,8 +134,13 @@ export {
|
|
|
134
134
|
|
|
135
135
|
// @beta APIs
|
|
136
136
|
NodeChangedData,
|
|
137
|
+
PopUnion,
|
|
137
138
|
TreeBeta,
|
|
138
|
-
TreeChangeEventsBeta,
|
|
139
|
+
TreeChangeEventsBeta,
|
|
140
|
+
UnionToTuple,
|
|
141
|
+
adaptEnum,
|
|
142
|
+
enumFromStrings,
|
|
143
|
+
singletonSchema,
|
|
139
144
|
|
|
140
145
|
// @alpha APIs
|
|
141
146
|
AllowedTypeMetadata,
|
|
@@ -151,6 +156,7 @@ export {
|
|
|
151
156
|
ConciseTree,
|
|
152
157
|
FactoryContent,
|
|
153
158
|
FactoryContentObject,
|
|
159
|
+
FieldPropsAlpha,
|
|
154
160
|
FieldSchemaAlpha,
|
|
155
161
|
FieldSchemaAlphaUnsafe,
|
|
156
162
|
FixRecursiveArraySchema,
|
|
@@ -174,6 +180,8 @@ export {
|
|
|
174
180
|
JsonAsTree,
|
|
175
181
|
JsonCompatible,
|
|
176
182
|
JsonCompatibleObject,
|
|
183
|
+
JsonCompatibleReadOnly,
|
|
184
|
+
JsonCompatibleReadOnlyObject,
|
|
177
185
|
JsonFieldSchema,
|
|
178
186
|
JsonLeafNodeSchema,
|
|
179
187
|
JsonLeafSchemaType,
|
|
@@ -191,8 +199,9 @@ export {
|
|
|
191
199
|
MapNodeCustomizableSchemaUnsafe,
|
|
192
200
|
MapNodePojoEmulationSchema,
|
|
193
201
|
MapNodeSchema,
|
|
202
|
+
NodeSchemaOptionsAlpha,
|
|
203
|
+
NormalizedAnnotatedAllowedTypes,
|
|
194
204
|
ObjectNodeSchema,
|
|
195
|
-
PopUnion,
|
|
196
205
|
ReadSchema,
|
|
197
206
|
ReadableField,
|
|
198
207
|
RevertibleAlpha,
|
|
@@ -209,6 +218,7 @@ export {
|
|
|
209
218
|
SimpleLeafNodeSchema,
|
|
210
219
|
SimpleMapNodeSchema,
|
|
211
220
|
SimpleNodeSchema,
|
|
221
|
+
SimpleNodeSchemaBaseAlpha,
|
|
212
222
|
SimpleObjectFieldSchema,
|
|
213
223
|
SimpleObjectNodeSchema,
|
|
214
224
|
SimpleTreeIndex,
|
|
@@ -241,14 +251,12 @@ export {
|
|
|
241
251
|
UnannotateImplicitAllowedTypes,
|
|
242
252
|
UnannotateImplicitFieldSchema,
|
|
243
253
|
UnannotateSchemaRecord,
|
|
244
|
-
UnionToTuple,
|
|
245
254
|
UnsafeUnknownSchema,
|
|
246
255
|
ValueSchema,
|
|
247
256
|
VerboseTree,
|
|
248
257
|
VerboseTreeNode,
|
|
249
258
|
ViewContent,
|
|
250
259
|
VoidTransactionCallbackStatus,
|
|
251
|
-
adaptEnum,
|
|
252
260
|
allowUnused,
|
|
253
261
|
asTreeViewAlpha,
|
|
254
262
|
cloneWithReplacements,
|
|
@@ -256,7 +264,6 @@ export {
|
|
|
256
264
|
configuredSharedTree,
|
|
257
265
|
createIdentifierIndex,
|
|
258
266
|
createSimpleTreeIndex,
|
|
259
|
-
enumFromStrings,
|
|
260
267
|
evaluateLazySchema,
|
|
261
268
|
extractPersistedSchema,
|
|
262
269
|
generateSchemaFromSimpleSchema,
|
|
@@ -271,6 +278,5 @@ export {
|
|
|
271
278
|
replaceConciseTreeHandles,
|
|
272
279
|
replaceHandles,
|
|
273
280
|
replaceVerboseTreeHandles,
|
|
274
|
-
singletonSchema,
|
|
275
281
|
typeboxValidator
|
|
276
282
|
} from "./index.js";
|
package/lib/beta.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fluid-framework",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.43.0",
|
|
4
4
|
"description": "The main entry point into Fluid Framework public packages",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -57,24 +57,24 @@
|
|
|
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.43.0",
|
|
61
|
+
"@fluidframework/container-loader": "~2.43.0",
|
|
62
|
+
"@fluidframework/core-interfaces": "~2.43.0",
|
|
63
|
+
"@fluidframework/core-utils": "~2.43.0",
|
|
64
|
+
"@fluidframework/driver-definitions": "~2.43.0",
|
|
65
|
+
"@fluidframework/fluid-static": "~2.43.0",
|
|
66
|
+
"@fluidframework/map": "~2.43.0",
|
|
67
|
+
"@fluidframework/runtime-utils": "~2.43.0",
|
|
68
|
+
"@fluidframework/sequence": "~2.43.0",
|
|
69
|
+
"@fluidframework/shared-object-base": "~2.43.0",
|
|
70
|
+
"@fluidframework/tree": "~2.43.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
74
74
|
"@biomejs/biome": "~1.9.3",
|
|
75
|
-
"@fluid-tools/build-cli": "^0.
|
|
75
|
+
"@fluid-tools/build-cli": "^0.56.0",
|
|
76
76
|
"@fluidframework/build-common": "^2.0.3",
|
|
77
|
-
"@fluidframework/build-tools": "^0.
|
|
77
|
+
"@fluidframework/build-tools": "^0.56.0",
|
|
78
78
|
"@fluidframework/eslint-config-fluid": "^5.7.4",
|
|
79
79
|
"@microsoft/api-extractor": "7.52.8",
|
|
80
80
|
"@types/node": "^18.19.0",
|