fluid-framework 2.1.1 → 2.2.1
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 +243 -0
- package/README.md +2 -2
- package/api-report/fluid-framework.beta.api.md +51 -18
- package/api-report/fluid-framework.legacy.alpha.api.md +56 -36
- package/api-report/fluid-framework.legacy.public.api.md +57 -18
- package/api-report/fluid-framework.public.api.md +51 -18
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +4 -1
- package/dist/public.d.ts +4 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +4 -1
- package/lib/public.d.ts +4 -1
- package/package.json +13 -12
- package/src/index.ts +2 -0
|
@@ -103,7 +103,8 @@ export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types exten
|
|
|
103
103
|
get allowedTypeSet(): ReadonlySet<TreeNodeSchema>;
|
|
104
104
|
readonly kind: Kind;
|
|
105
105
|
readonly props?: FieldProps | undefined;
|
|
106
|
-
|
|
106
|
+
readonly requiresValue: boolean;
|
|
107
|
+
protected _typeCheck: MakeNominal;
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
// @public
|
|
@@ -534,13 +535,7 @@ Unhydrated<NodeFromSchemaUnsafe<T>> | (T extends {
|
|
|
534
535
|
} ? NodeBuilderDataUnsafe<T> : never)
|
|
535
536
|
][_InlineTrick];
|
|
536
537
|
|
|
537
|
-
|
|
538
|
-
export interface InteriorSequencePlace {
|
|
539
|
-
// (undocumented)
|
|
540
|
-
pos: number;
|
|
541
|
-
// (undocumented)
|
|
542
|
-
side: Side;
|
|
543
|
-
}
|
|
538
|
+
export { InteriorSequencePlace }
|
|
544
539
|
|
|
545
540
|
// @public @sealed
|
|
546
541
|
export interface InternalTreeNode extends ErasedType<"@fluidframework/tree.InternalTreeNode"> {
|
|
@@ -573,6 +568,7 @@ declare namespace InternalTypes {
|
|
|
573
568
|
InsertableTypedNodeUnsafe,
|
|
574
569
|
NodeBuilderDataUnsafe,
|
|
575
570
|
NodeFromSchemaUnsafe,
|
|
571
|
+
ReadonlyMapInlined,
|
|
576
572
|
FlexList,
|
|
577
573
|
FlexListToUnion,
|
|
578
574
|
ExtractItemType,
|
|
@@ -642,11 +638,11 @@ export interface ISequenceDeltaRange<TOperation extends MergeTreeDeltaOperationT
|
|
|
642
638
|
|
|
643
639
|
// @alpha (undocumented)
|
|
644
640
|
export interface ISerializableInterval extends IInterval {
|
|
645
|
-
// (undocumented)
|
|
641
|
+
// @deprecated (undocumented)
|
|
646
642
|
addProperties(props: PropertySet, collaborating?: boolean, seq?: number): PropertySet | undefined;
|
|
647
643
|
getIntervalId(): string | undefined;
|
|
648
644
|
properties: PropertySet;
|
|
649
|
-
// (undocumented)
|
|
645
|
+
// @deprecated (undocumented)
|
|
650
646
|
propertyManager: PropertiesManager;
|
|
651
647
|
// (undocumented)
|
|
652
648
|
serialize(): ISerializedInterval;
|
|
@@ -682,6 +678,9 @@ export interface IServiceAudienceEvents<M extends IMember> extends IEvent {
|
|
|
682
678
|
(event: "memberRemoved", listener: MemberChangedListener<M>): void;
|
|
683
679
|
}
|
|
684
680
|
|
|
681
|
+
// @public
|
|
682
|
+
export function isFluidHandle(value: unknown): value is IFluidHandle;
|
|
683
|
+
|
|
685
684
|
// @alpha @sealed
|
|
686
685
|
export interface ISharedDirectory extends ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>, Omit<IDirectory, "on" | "once" | "off"> {
|
|
687
686
|
// (undocumented)
|
|
@@ -822,11 +821,11 @@ export interface ITree extends IFluidLoadable {
|
|
|
822
821
|
// @public
|
|
823
822
|
export interface ITreeConfigurationOptions {
|
|
824
823
|
enableSchemaValidation?: boolean;
|
|
824
|
+
readonly preventAmbiguity?: boolean;
|
|
825
825
|
}
|
|
826
826
|
|
|
827
827
|
// @public
|
|
828
|
-
export interface ITreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> {
|
|
829
|
-
readonly enableSchemaValidation?: boolean;
|
|
828
|
+
export interface ITreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> extends ITreeConfigurationOptions {
|
|
830
829
|
readonly schema: TSchema;
|
|
831
830
|
}
|
|
832
831
|
|
|
@@ -853,6 +852,9 @@ export type Listeners<T extends object> = {
|
|
|
853
852
|
export interface MakeNominal {
|
|
854
853
|
}
|
|
855
854
|
|
|
855
|
+
// @public
|
|
856
|
+
export type MapNodeInsertableData<T extends ImplicitAllowedTypes> = Iterable<readonly [string, InsertableTreeNodeFromImplicitAllowedTypes<T>]> | RestrictiveReadonlyRecord<string, InsertableTreeNodeFromImplicitAllowedTypes<T>>;
|
|
857
|
+
|
|
856
858
|
// @public
|
|
857
859
|
export type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
|
|
858
860
|
|
|
@@ -902,6 +904,22 @@ type ObjectFromSchemaRecordUnsafe<T extends Unenforced<RestrictiveReadonlyRecord
|
|
|
902
904
|
// @public
|
|
903
905
|
export type Off = () => void;
|
|
904
906
|
|
|
907
|
+
// @public @sealed
|
|
908
|
+
interface ReadonlyMapInlined<K, T extends Unenforced<ImplicitAllowedTypes>> {
|
|
909
|
+
[Symbol.iterator](): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
|
|
910
|
+
entries(): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
|
|
911
|
+
// (undocumented)
|
|
912
|
+
forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypesUnsafe<T>, key: K, map: ReadonlyMap<K, TreeNodeFromImplicitAllowedTypesUnsafe<T>>) => void, thisArg?: any): void;
|
|
913
|
+
// (undocumented)
|
|
914
|
+
get(key: K): TreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined;
|
|
915
|
+
// (undocumented)
|
|
916
|
+
has(key: K): boolean;
|
|
917
|
+
keys(): IterableIterator<K>;
|
|
918
|
+
// (undocumented)
|
|
919
|
+
readonly size: number;
|
|
920
|
+
values(): IterableIterator<TreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
921
|
+
}
|
|
922
|
+
|
|
905
923
|
// @public
|
|
906
924
|
export type ReplaceIEventThisPlaceHolder<L extends any[], TThis> = L extends any[] ? {
|
|
907
925
|
[K in keyof L]: L[K] extends IEventThisPlaceHolder ? TThis : L[K];
|
|
@@ -960,17 +978,17 @@ export interface SchemaCompatibilityStatus {
|
|
|
960
978
|
// @public @sealed
|
|
961
979
|
export class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> {
|
|
962
980
|
constructor(scope: TScope);
|
|
963
|
-
array<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchema<ScopedSchemaName<TScope, `Array<${string}>`>, NodeKind.Array, TreeArrayNode<T> & WithType<ScopedSchemaName<TScope, `Array<${string}
|
|
964
|
-
array<const Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNode<T> & WithType<ScopedSchemaName<TScope, Name
|
|
965
|
-
arrayRecursive<const Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name
|
|
981
|
+
array<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchema<ScopedSchemaName<TScope, `Array<${string}>`>, NodeKind.Array, TreeArrayNode<T> & WithType<ScopedSchemaName<TScope, `Array<${string}>`>, NodeKind.Array>, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>, true, T>;
|
|
982
|
+
array<const Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array>, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>, true, T>;
|
|
983
|
+
arrayRecursive<const Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array>, {
|
|
966
984
|
[Symbol.iterator](): Iterator<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
967
985
|
}, false, T>;
|
|
968
986
|
readonly boolean: TreeNodeSchema<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean>;
|
|
969
987
|
readonly handle: TreeNodeSchema<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>>;
|
|
970
988
|
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
971
|
-
map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchema<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}
|
|
972
|
-
map<Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name
|
|
973
|
-
mapRecursive<Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name
|
|
989
|
+
map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchema<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map>, MapNodeInsertableData<T>, true, T>;
|
|
990
|
+
map<Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>, MapNodeInsertableData<T>, true, T>;
|
|
991
|
+
mapRecursive<Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>, {
|
|
974
992
|
[Symbol.iterator](): Iterator<[
|
|
975
993
|
string,
|
|
976
994
|
InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>
|
|
@@ -1058,8 +1076,7 @@ export class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMaintenance
|
|
|
1058
1076
|
readonly opArgs: IMergeTreeDeltaOpArgs | undefined;
|
|
1059
1077
|
}
|
|
1060
1078
|
|
|
1061
|
-
|
|
1062
|
-
export type SequencePlace = number | "start" | "end" | InteriorSequencePlace;
|
|
1079
|
+
export { SequencePlace }
|
|
1063
1080
|
|
|
1064
1081
|
// @alpha
|
|
1065
1082
|
export const SharedDirectory: ISharedObjectKind<ISharedDirectory> & SharedObjectKind_2<ISharedDirectory>;
|
|
@@ -1090,13 +1107,7 @@ export type SharedStringSegment = TextSegment | Marker;
|
|
|
1090
1107
|
// @public
|
|
1091
1108
|
export const SharedTree: SharedObjectKind<ITree>;
|
|
1092
1109
|
|
|
1093
|
-
|
|
1094
|
-
export enum Side {
|
|
1095
|
-
// (undocumented)
|
|
1096
|
-
After = 1,
|
|
1097
|
-
// (undocumented)
|
|
1098
|
-
Before = 0
|
|
1099
|
-
}
|
|
1110
|
+
export { Side }
|
|
1100
1111
|
|
|
1101
1112
|
// @public
|
|
1102
1113
|
export interface Tagged<V, T extends string = string> {
|
|
@@ -1185,7 +1196,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
|
|
|
1185
1196
|
}
|
|
1186
1197
|
|
|
1187
1198
|
// @public @sealed
|
|
1188
|
-
export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> extends
|
|
1199
|
+
export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> extends ReadonlyMapInlined<string, T>, TreeNode {
|
|
1189
1200
|
delete(key: string): void;
|
|
1190
1201
|
set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined): void;
|
|
1191
1202
|
}
|
|
@@ -1194,8 +1205,10 @@ export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> e
|
|
|
1194
1205
|
export abstract class TreeNode implements WithType {
|
|
1195
1206
|
static [Symbol.hasInstance](value: unknown): value is TreeNode;
|
|
1196
1207
|
static [Symbol.hasInstance]<TSchema extends abstract new (...args: any[]) => TreeNode>(this: TSchema, value: unknown): value is InstanceType<TSchema>;
|
|
1208
|
+
// @deprecated
|
|
1197
1209
|
abstract get [typeNameSymbol](): string;
|
|
1198
|
-
|
|
1210
|
+
abstract get [typeSchemaSymbol](): TreeNodeSchemaClass;
|
|
1211
|
+
protected constructor(token: unknown);
|
|
1199
1212
|
}
|
|
1200
1213
|
|
|
1201
1214
|
// @public @sealed
|
|
@@ -1204,7 +1217,7 @@ export interface TreeNodeApi {
|
|
|
1204
1217
|
key(node: TreeNode): string | number;
|
|
1205
1218
|
on<K extends keyof TreeChangeEvents>(node: TreeNode, eventName: K, listener: TreeChangeEvents[K]): () => void;
|
|
1206
1219
|
parent(node: TreeNode): TreeNode | undefined;
|
|
1207
|
-
schema
|
|
1220
|
+
schema(node: TreeNode | TreeLeafValue): TreeNodeSchema;
|
|
1208
1221
|
shortId(node: TreeNode): number | string | undefined;
|
|
1209
1222
|
status(node: TreeNode): TreeStatus;
|
|
1210
1223
|
}
|
|
@@ -1226,7 +1239,6 @@ export interface TreeNodeSchemaClass<out Name extends string = string, out Kind
|
|
|
1226
1239
|
|
|
1227
1240
|
// @public @sealed
|
|
1228
1241
|
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown> {
|
|
1229
|
-
// (undocumented)
|
|
1230
1242
|
readonly identifier: Name;
|
|
1231
1243
|
readonly implicitlyConstructable: ImplicitlyConstructable;
|
|
1232
1244
|
readonly info: Info;
|
|
@@ -1241,10 +1253,10 @@ interface TreeNodeSchemaNonClass<out Name extends string = string, out Kind exte
|
|
|
1241
1253
|
}
|
|
1242
1254
|
|
|
1243
1255
|
// @public
|
|
1244
|
-
export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName>;
|
|
1256
|
+
export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object>;
|
|
1245
1257
|
|
|
1246
1258
|
// @public
|
|
1247
|
-
export type TreeObjectNodeUnsafe<T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName>;
|
|
1259
|
+
export type TreeObjectNodeUnsafe<T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName, NodeKind.Object>;
|
|
1248
1260
|
|
|
1249
1261
|
// @public
|
|
1250
1262
|
export enum TreeStatus {
|
|
@@ -1268,7 +1280,10 @@ export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposab
|
|
|
1268
1280
|
export class TreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
|
|
1269
1281
|
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
1270
1282
|
readonly enableSchemaValidation: boolean;
|
|
1283
|
+
readonly preventAmbiguity: boolean;
|
|
1271
1284
|
readonly schema: TSchema;
|
|
1285
|
+
// (undocumented)
|
|
1286
|
+
protected _typeCheck: MakeNominal;
|
|
1272
1287
|
}
|
|
1273
1288
|
|
|
1274
1289
|
// @public @sealed
|
|
@@ -1278,9 +1293,12 @@ export interface TreeViewEvents {
|
|
|
1278
1293
|
schemaChanged(): void;
|
|
1279
1294
|
}
|
|
1280
1295
|
|
|
1281
|
-
// @public
|
|
1296
|
+
// @public @deprecated
|
|
1282
1297
|
const typeNameSymbol: unique symbol;
|
|
1283
1298
|
|
|
1299
|
+
// @public
|
|
1300
|
+
export const typeSchemaSymbol: unique symbol;
|
|
1301
|
+
|
|
1284
1302
|
// @public
|
|
1285
1303
|
export type Unenforced<_DesiredExtendsConstraint> = unknown;
|
|
1286
1304
|
|
|
@@ -1288,7 +1306,7 @@ export type Unenforced<_DesiredExtendsConstraint> = unknown;
|
|
|
1288
1306
|
export type Unhydrated<T> = T;
|
|
1289
1307
|
|
|
1290
1308
|
// @public
|
|
1291
|
-
export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"]>, {
|
|
1309
|
+
export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
1292
1310
|
[NodeKind.Object]: T["info"] extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema> ? InsertableObjectFromSchemaRecord<T["info"]> : unknown;
|
|
1293
1311
|
[NodeKind.Array]: T["info"] extends ImplicitAllowedTypes ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>> : unknown;
|
|
1294
1312
|
[NodeKind.Map]: T["info"] extends ImplicitAllowedTypes ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]> : unknown;
|
|
@@ -1299,8 +1317,10 @@ export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKi
|
|
|
1299
1317
|
}[T["kind"]]>> = true;
|
|
1300
1318
|
|
|
1301
1319
|
// @public @sealed
|
|
1302
|
-
export interface WithType<TName extends string = string> {
|
|
1320
|
+
export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind> {
|
|
1321
|
+
// @deprecated
|
|
1303
1322
|
get [typeNameSymbol](): TName;
|
|
1323
|
+
get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind>;
|
|
1304
1324
|
}
|
|
1305
1325
|
|
|
1306
1326
|
```
|
|
@@ -100,7 +100,8 @@ export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types exten
|
|
|
100
100
|
get allowedTypeSet(): ReadonlySet<TreeNodeSchema>;
|
|
101
101
|
readonly kind: Kind;
|
|
102
102
|
readonly props?: FieldProps | undefined;
|
|
103
|
-
|
|
103
|
+
readonly requiresValue: boolean;
|
|
104
|
+
protected _typeCheck: MakeNominal;
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
// @public
|
|
@@ -462,6 +463,8 @@ Unhydrated<NodeFromSchemaUnsafe<T>> | (T extends {
|
|
|
462
463
|
} ? NodeBuilderDataUnsafe<T> : never)
|
|
463
464
|
][_InlineTrick];
|
|
464
465
|
|
|
466
|
+
export { InteriorSequencePlace }
|
|
467
|
+
|
|
465
468
|
// @public @sealed
|
|
466
469
|
export interface InternalTreeNode extends ErasedType<"@fluidframework/tree.InternalTreeNode"> {
|
|
467
470
|
}
|
|
@@ -493,6 +496,7 @@ declare namespace InternalTypes {
|
|
|
493
496
|
InsertableTypedNodeUnsafe,
|
|
494
497
|
NodeBuilderDataUnsafe,
|
|
495
498
|
NodeFromSchemaUnsafe,
|
|
499
|
+
ReadonlyMapInlined,
|
|
496
500
|
FlexList,
|
|
497
501
|
FlexListToUnion,
|
|
498
502
|
ExtractItemType,
|
|
@@ -523,6 +527,9 @@ export interface IServiceAudienceEvents<M extends IMember> extends IEvent {
|
|
|
523
527
|
(event: "memberRemoved", listener: MemberChangedListener<M>): void;
|
|
524
528
|
}
|
|
525
529
|
|
|
530
|
+
// @public
|
|
531
|
+
export function isFluidHandle(value: unknown): value is IFluidHandle;
|
|
532
|
+
|
|
526
533
|
// @public
|
|
527
534
|
export type IsListener<TListener> = TListener extends (...args: any[]) => void ? true : false;
|
|
528
535
|
|
|
@@ -544,11 +551,11 @@ export interface ITree extends IFluidLoadable {
|
|
|
544
551
|
// @public
|
|
545
552
|
export interface ITreeConfigurationOptions {
|
|
546
553
|
enableSchemaValidation?: boolean;
|
|
554
|
+
readonly preventAmbiguity?: boolean;
|
|
547
555
|
}
|
|
548
556
|
|
|
549
557
|
// @public
|
|
550
|
-
export interface ITreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> {
|
|
551
|
-
readonly enableSchemaValidation?: boolean;
|
|
558
|
+
export interface ITreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> extends ITreeConfigurationOptions {
|
|
552
559
|
readonly schema: TSchema;
|
|
553
560
|
}
|
|
554
561
|
|
|
@@ -575,6 +582,9 @@ export type Listeners<T extends object> = {
|
|
|
575
582
|
export interface MakeNominal {
|
|
576
583
|
}
|
|
577
584
|
|
|
585
|
+
// @public
|
|
586
|
+
export type MapNodeInsertableData<T extends ImplicitAllowedTypes> = Iterable<readonly [string, InsertableTreeNodeFromImplicitAllowedTypes<T>]> | RestrictiveReadonlyRecord<string, InsertableTreeNodeFromImplicitAllowedTypes<T>>;
|
|
587
|
+
|
|
578
588
|
// @public
|
|
579
589
|
export type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
|
|
580
590
|
|
|
@@ -624,6 +634,22 @@ type ObjectFromSchemaRecordUnsafe<T extends Unenforced<RestrictiveReadonlyRecord
|
|
|
624
634
|
// @public
|
|
625
635
|
export type Off = () => void;
|
|
626
636
|
|
|
637
|
+
// @public @sealed
|
|
638
|
+
interface ReadonlyMapInlined<K, T extends Unenforced<ImplicitAllowedTypes>> {
|
|
639
|
+
[Symbol.iterator](): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
|
|
640
|
+
entries(): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
|
|
641
|
+
// (undocumented)
|
|
642
|
+
forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypesUnsafe<T>, key: K, map: ReadonlyMap<K, TreeNodeFromImplicitAllowedTypesUnsafe<T>>) => void, thisArg?: any): void;
|
|
643
|
+
// (undocumented)
|
|
644
|
+
get(key: K): TreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined;
|
|
645
|
+
// (undocumented)
|
|
646
|
+
has(key: K): boolean;
|
|
647
|
+
keys(): IterableIterator<K>;
|
|
648
|
+
// (undocumented)
|
|
649
|
+
readonly size: number;
|
|
650
|
+
values(): IterableIterator<TreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
651
|
+
}
|
|
652
|
+
|
|
627
653
|
// @public
|
|
628
654
|
export type ReplaceIEventThisPlaceHolder<L extends any[], TThis> = L extends any[] ? {
|
|
629
655
|
[K in keyof L]: L[K] extends IEventThisPlaceHolder ? TThis : L[K];
|
|
@@ -682,17 +708,17 @@ export interface SchemaCompatibilityStatus {
|
|
|
682
708
|
// @public @sealed
|
|
683
709
|
export class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> {
|
|
684
710
|
constructor(scope: TScope);
|
|
685
|
-
array<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchema<ScopedSchemaName<TScope, `Array<${string}>`>, NodeKind.Array, TreeArrayNode<T> & WithType<ScopedSchemaName<TScope, `Array<${string}
|
|
686
|
-
array<const Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNode<T> & WithType<ScopedSchemaName<TScope, Name
|
|
687
|
-
arrayRecursive<const Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name
|
|
711
|
+
array<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchema<ScopedSchemaName<TScope, `Array<${string}>`>, NodeKind.Array, TreeArrayNode<T> & WithType<ScopedSchemaName<TScope, `Array<${string}>`>, NodeKind.Array>, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>, true, T>;
|
|
712
|
+
array<const Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array>, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>, true, T>;
|
|
713
|
+
arrayRecursive<const Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array>, {
|
|
688
714
|
[Symbol.iterator](): Iterator<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
689
715
|
}, false, T>;
|
|
690
716
|
readonly boolean: TreeNodeSchema<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean>;
|
|
691
717
|
readonly handle: TreeNodeSchema<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>>;
|
|
692
718
|
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
693
|
-
map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchema<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}
|
|
694
|
-
map<Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name
|
|
695
|
-
mapRecursive<Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name
|
|
719
|
+
map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchema<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map>, MapNodeInsertableData<T>, true, T>;
|
|
720
|
+
map<Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>, MapNodeInsertableData<T>, true, T>;
|
|
721
|
+
mapRecursive<Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>, {
|
|
696
722
|
[Symbol.iterator](): Iterator<[
|
|
697
723
|
string,
|
|
698
724
|
InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>
|
|
@@ -714,6 +740,8 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
714
740
|
// @public
|
|
715
741
|
type ScopedSchemaName<TScope extends string | undefined, TName extends number | string> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;
|
|
716
742
|
|
|
743
|
+
export { SequencePlace }
|
|
744
|
+
|
|
717
745
|
// @public @sealed
|
|
718
746
|
export interface SharedObjectKind<out TSharedObject = unknown> extends ErasedType<readonly ["SharedObjectKind", TSharedObject]> {
|
|
719
747
|
is(value: IFluidLoadable): value is IFluidLoadable & TSharedObject;
|
|
@@ -722,6 +750,8 @@ export interface SharedObjectKind<out TSharedObject = unknown> extends ErasedTyp
|
|
|
722
750
|
// @public
|
|
723
751
|
export const SharedTree: SharedObjectKind<ITree>;
|
|
724
752
|
|
|
753
|
+
export { Side }
|
|
754
|
+
|
|
725
755
|
// @public
|
|
726
756
|
export interface Tagged<V, T extends string = string> {
|
|
727
757
|
// (undocumented)
|
|
@@ -809,7 +839,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
|
|
|
809
839
|
}
|
|
810
840
|
|
|
811
841
|
// @public @sealed
|
|
812
|
-
export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> extends
|
|
842
|
+
export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> extends ReadonlyMapInlined<string, T>, TreeNode {
|
|
813
843
|
delete(key: string): void;
|
|
814
844
|
set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined): void;
|
|
815
845
|
}
|
|
@@ -818,8 +848,10 @@ export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> e
|
|
|
818
848
|
export abstract class TreeNode implements WithType {
|
|
819
849
|
static [Symbol.hasInstance](value: unknown): value is TreeNode;
|
|
820
850
|
static [Symbol.hasInstance]<TSchema extends abstract new (...args: any[]) => TreeNode>(this: TSchema, value: unknown): value is InstanceType<TSchema>;
|
|
851
|
+
// @deprecated
|
|
821
852
|
abstract get [typeNameSymbol](): string;
|
|
822
|
-
|
|
853
|
+
abstract get [typeSchemaSymbol](): TreeNodeSchemaClass;
|
|
854
|
+
protected constructor(token: unknown);
|
|
823
855
|
}
|
|
824
856
|
|
|
825
857
|
// @public @sealed
|
|
@@ -828,7 +860,7 @@ export interface TreeNodeApi {
|
|
|
828
860
|
key(node: TreeNode): string | number;
|
|
829
861
|
on<K extends keyof TreeChangeEvents>(node: TreeNode, eventName: K, listener: TreeChangeEvents[K]): () => void;
|
|
830
862
|
parent(node: TreeNode): TreeNode | undefined;
|
|
831
|
-
schema
|
|
863
|
+
schema(node: TreeNode | TreeLeafValue): TreeNodeSchema;
|
|
832
864
|
shortId(node: TreeNode): number | string | undefined;
|
|
833
865
|
status(node: TreeNode): TreeStatus;
|
|
834
866
|
}
|
|
@@ -850,7 +882,6 @@ export interface TreeNodeSchemaClass<out Name extends string = string, out Kind
|
|
|
850
882
|
|
|
851
883
|
// @public @sealed
|
|
852
884
|
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown> {
|
|
853
|
-
// (undocumented)
|
|
854
885
|
readonly identifier: Name;
|
|
855
886
|
readonly implicitlyConstructable: ImplicitlyConstructable;
|
|
856
887
|
readonly info: Info;
|
|
@@ -865,10 +896,10 @@ interface TreeNodeSchemaNonClass<out Name extends string = string, out Kind exte
|
|
|
865
896
|
}
|
|
866
897
|
|
|
867
898
|
// @public
|
|
868
|
-
export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName>;
|
|
899
|
+
export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object>;
|
|
869
900
|
|
|
870
901
|
// @public
|
|
871
|
-
export type TreeObjectNodeUnsafe<T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName>;
|
|
902
|
+
export type TreeObjectNodeUnsafe<T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName, NodeKind.Object>;
|
|
872
903
|
|
|
873
904
|
// @public
|
|
874
905
|
export enum TreeStatus {
|
|
@@ -892,7 +923,10 @@ export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposab
|
|
|
892
923
|
export class TreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
|
|
893
924
|
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
894
925
|
readonly enableSchemaValidation: boolean;
|
|
926
|
+
readonly preventAmbiguity: boolean;
|
|
895
927
|
readonly schema: TSchema;
|
|
928
|
+
// (undocumented)
|
|
929
|
+
protected _typeCheck: MakeNominal;
|
|
896
930
|
}
|
|
897
931
|
|
|
898
932
|
// @public @sealed
|
|
@@ -902,9 +936,12 @@ export interface TreeViewEvents {
|
|
|
902
936
|
schemaChanged(): void;
|
|
903
937
|
}
|
|
904
938
|
|
|
905
|
-
// @public
|
|
939
|
+
// @public @deprecated
|
|
906
940
|
const typeNameSymbol: unique symbol;
|
|
907
941
|
|
|
942
|
+
// @public
|
|
943
|
+
export const typeSchemaSymbol: unique symbol;
|
|
944
|
+
|
|
908
945
|
// @public
|
|
909
946
|
export type Unenforced<_DesiredExtendsConstraint> = unknown;
|
|
910
947
|
|
|
@@ -912,7 +949,7 @@ export type Unenforced<_DesiredExtendsConstraint> = unknown;
|
|
|
912
949
|
export type Unhydrated<T> = T;
|
|
913
950
|
|
|
914
951
|
// @public
|
|
915
|
-
export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"]>, {
|
|
952
|
+
export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
916
953
|
[NodeKind.Object]: T["info"] extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema> ? InsertableObjectFromSchemaRecord<T["info"]> : unknown;
|
|
917
954
|
[NodeKind.Array]: T["info"] extends ImplicitAllowedTypes ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>> : unknown;
|
|
918
955
|
[NodeKind.Map]: T["info"] extends ImplicitAllowedTypes ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]> : unknown;
|
|
@@ -923,8 +960,10 @@ export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKi
|
|
|
923
960
|
}[T["kind"]]>> = true;
|
|
924
961
|
|
|
925
962
|
// @public @sealed
|
|
926
|
-
export interface WithType<TName extends string = string> {
|
|
963
|
+
export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind> {
|
|
964
|
+
// @deprecated
|
|
927
965
|
get [typeNameSymbol](): TName;
|
|
966
|
+
get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind>;
|
|
928
967
|
}
|
|
929
968
|
|
|
930
969
|
```
|