fluid-framework 2.1.0 → 2.3.0-288113
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 +59 -21
- package/api-report/fluid-framework.legacy.alpha.api.md +64 -39
- package/api-report/fluid-framework.legacy.public.api.md +65 -21
- package/api-report/fluid-framework.public.api.md +59 -21
- 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 +5 -1
- package/dist/public.d.ts +5 -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 +5 -1
- package/lib/public.d.ts +5 -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
|
|
|
@@ -867,6 +869,11 @@ type NodeBuilderData<T extends TreeNodeSchema> = T extends TreeNodeSchema<string
|
|
|
867
869
|
// @public
|
|
868
870
|
type NodeBuilderDataUnsafe<T extends Unenforced<TreeNodeSchema>> = T extends TreeNodeSchema<string, NodeKind, unknown, infer TBuild> ? TBuild : never;
|
|
869
871
|
|
|
872
|
+
// @public
|
|
873
|
+
export interface NodeChangedData {
|
|
874
|
+
readonly changedProperties?: ReadonlySet<string>;
|
|
875
|
+
}
|
|
876
|
+
|
|
870
877
|
// @public
|
|
871
878
|
export type NodeFromSchema<T extends TreeNodeSchema> = T extends TreeNodeSchema<string, NodeKind, infer TNode> ? TNode : never;
|
|
872
879
|
|
|
@@ -902,6 +909,22 @@ type ObjectFromSchemaRecordUnsafe<T extends Unenforced<RestrictiveReadonlyRecord
|
|
|
902
909
|
// @public
|
|
903
910
|
export type Off = () => void;
|
|
904
911
|
|
|
912
|
+
// @public @sealed
|
|
913
|
+
interface ReadonlyMapInlined<K, T extends Unenforced<ImplicitAllowedTypes>> {
|
|
914
|
+
[Symbol.iterator](): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
|
|
915
|
+
entries(): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
|
|
916
|
+
// (undocumented)
|
|
917
|
+
forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypesUnsafe<T>, key: K, map: ReadonlyMap<K, TreeNodeFromImplicitAllowedTypesUnsafe<T>>) => void, thisArg?: any): void;
|
|
918
|
+
// (undocumented)
|
|
919
|
+
get(key: K): TreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined;
|
|
920
|
+
// (undocumented)
|
|
921
|
+
has(key: K): boolean;
|
|
922
|
+
keys(): IterableIterator<K>;
|
|
923
|
+
// (undocumented)
|
|
924
|
+
readonly size: number;
|
|
925
|
+
values(): IterableIterator<TreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
926
|
+
}
|
|
927
|
+
|
|
905
928
|
// @public
|
|
906
929
|
export type ReplaceIEventThisPlaceHolder<L extends any[], TThis> = L extends any[] ? {
|
|
907
930
|
[K in keyof L]: L[K] extends IEventThisPlaceHolder ? TThis : L[K];
|
|
@@ -960,17 +983,17 @@ export interface SchemaCompatibilityStatus {
|
|
|
960
983
|
// @public @sealed
|
|
961
984
|
export class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> {
|
|
962
985
|
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
|
|
986
|
+
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>;
|
|
987
|
+
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>;
|
|
988
|
+
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
989
|
[Symbol.iterator](): Iterator<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
967
990
|
}, false, T>;
|
|
968
991
|
readonly boolean: TreeNodeSchema<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean>;
|
|
969
992
|
readonly handle: TreeNodeSchema<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>>;
|
|
970
993
|
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
|
|
994
|
+
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>;
|
|
995
|
+
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>;
|
|
996
|
+
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
997
|
[Symbol.iterator](): Iterator<[
|
|
975
998
|
string,
|
|
976
999
|
InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>
|
|
@@ -1058,8 +1081,7 @@ export class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMaintenance
|
|
|
1058
1081
|
readonly opArgs: IMergeTreeDeltaOpArgs | undefined;
|
|
1059
1082
|
}
|
|
1060
1083
|
|
|
1061
|
-
|
|
1062
|
-
export type SequencePlace = number | "start" | "end" | InteriorSequencePlace;
|
|
1084
|
+
export { SequencePlace }
|
|
1063
1085
|
|
|
1064
1086
|
// @alpha
|
|
1065
1087
|
export const SharedDirectory: ISharedObjectKind<ISharedDirectory> & SharedObjectKind_2<ISharedDirectory>;
|
|
@@ -1090,13 +1112,7 @@ export type SharedStringSegment = TextSegment | Marker;
|
|
|
1090
1112
|
// @public
|
|
1091
1113
|
export const SharedTree: SharedObjectKind<ITree>;
|
|
1092
1114
|
|
|
1093
|
-
|
|
1094
|
-
export enum Side {
|
|
1095
|
-
// (undocumented)
|
|
1096
|
-
After = 1,
|
|
1097
|
-
// (undocumented)
|
|
1098
|
-
Before = 0
|
|
1099
|
-
}
|
|
1115
|
+
export { Side }
|
|
1100
1116
|
|
|
1101
1117
|
// @public
|
|
1102
1118
|
export interface Tagged<V, T extends string = string> {
|
|
@@ -1160,8 +1176,8 @@ export interface TreeArrayNodeUnsafe<TAllowedTypes extends Unenforced<ImplicitAl
|
|
|
1160
1176
|
}
|
|
1161
1177
|
|
|
1162
1178
|
// @public @sealed
|
|
1163
|
-
export interface TreeChangeEvents {
|
|
1164
|
-
nodeChanged(): void;
|
|
1179
|
+
export interface TreeChangeEvents<TNode = TreeNode> {
|
|
1180
|
+
nodeChanged(data: NodeChangedData & (TNode extends WithType<string, NodeKind.Map | NodeKind.Object> ? Required<Pick<NodeChangedData, "changedProperties">> : unknown)): void;
|
|
1165
1181
|
treeChanged(): void;
|
|
1166
1182
|
}
|
|
1167
1183
|
|
|
@@ -1185,7 +1201,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
|
|
|
1185
1201
|
}
|
|
1186
1202
|
|
|
1187
1203
|
// @public @sealed
|
|
1188
|
-
export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> extends
|
|
1204
|
+
export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> extends ReadonlyMapInlined<string, T>, TreeNode {
|
|
1189
1205
|
delete(key: string): void;
|
|
1190
1206
|
set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined): void;
|
|
1191
1207
|
}
|
|
@@ -1194,17 +1210,19 @@ export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> e
|
|
|
1194
1210
|
export abstract class TreeNode implements WithType {
|
|
1195
1211
|
static [Symbol.hasInstance](value: unknown): value is TreeNode;
|
|
1196
1212
|
static [Symbol.hasInstance]<TSchema extends abstract new (...args: any[]) => TreeNode>(this: TSchema, value: unknown): value is InstanceType<TSchema>;
|
|
1213
|
+
// @deprecated
|
|
1197
1214
|
abstract get [typeNameSymbol](): string;
|
|
1198
|
-
|
|
1215
|
+
abstract get [typeSchemaSymbol](): TreeNodeSchemaClass;
|
|
1216
|
+
protected constructor(token: unknown);
|
|
1199
1217
|
}
|
|
1200
1218
|
|
|
1201
1219
|
// @public @sealed
|
|
1202
1220
|
export interface TreeNodeApi {
|
|
1203
1221
|
is<TSchema extends ImplicitAllowedTypes>(value: unknown, schema: TSchema): value is TreeNodeFromImplicitAllowedTypes<TSchema>;
|
|
1204
1222
|
key(node: TreeNode): string | number;
|
|
1205
|
-
on<K extends keyof TreeChangeEvents>(node:
|
|
1223
|
+
on<K extends keyof TreeChangeEvents<TNode>, TNode extends TreeNode>(node: TNode, eventName: K, listener: TreeChangeEvents<TNode>[K]): () => void;
|
|
1206
1224
|
parent(node: TreeNode): TreeNode | undefined;
|
|
1207
|
-
schema
|
|
1225
|
+
schema(node: TreeNode | TreeLeafValue): TreeNodeSchema;
|
|
1208
1226
|
shortId(node: TreeNode): number | string | undefined;
|
|
1209
1227
|
status(node: TreeNode): TreeStatus;
|
|
1210
1228
|
}
|
|
@@ -1226,7 +1244,6 @@ export interface TreeNodeSchemaClass<out Name extends string = string, out Kind
|
|
|
1226
1244
|
|
|
1227
1245
|
// @public @sealed
|
|
1228
1246
|
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown> {
|
|
1229
|
-
// (undocumented)
|
|
1230
1247
|
readonly identifier: Name;
|
|
1231
1248
|
readonly implicitlyConstructable: ImplicitlyConstructable;
|
|
1232
1249
|
readonly info: Info;
|
|
@@ -1241,10 +1258,10 @@ interface TreeNodeSchemaNonClass<out Name extends string = string, out Kind exte
|
|
|
1241
1258
|
}
|
|
1242
1259
|
|
|
1243
1260
|
// @public
|
|
1244
|
-
export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName>;
|
|
1261
|
+
export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object>;
|
|
1245
1262
|
|
|
1246
1263
|
// @public
|
|
1247
|
-
export type TreeObjectNodeUnsafe<T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName>;
|
|
1264
|
+
export type TreeObjectNodeUnsafe<T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName, NodeKind.Object>;
|
|
1248
1265
|
|
|
1249
1266
|
// @public
|
|
1250
1267
|
export enum TreeStatus {
|
|
@@ -1268,7 +1285,10 @@ export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposab
|
|
|
1268
1285
|
export class TreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
|
|
1269
1286
|
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
1270
1287
|
readonly enableSchemaValidation: boolean;
|
|
1288
|
+
readonly preventAmbiguity: boolean;
|
|
1271
1289
|
readonly schema: TSchema;
|
|
1290
|
+
// (undocumented)
|
|
1291
|
+
protected _typeCheck: MakeNominal;
|
|
1272
1292
|
}
|
|
1273
1293
|
|
|
1274
1294
|
// @public @sealed
|
|
@@ -1278,9 +1298,12 @@ export interface TreeViewEvents {
|
|
|
1278
1298
|
schemaChanged(): void;
|
|
1279
1299
|
}
|
|
1280
1300
|
|
|
1281
|
-
// @public
|
|
1301
|
+
// @public @deprecated
|
|
1282
1302
|
const typeNameSymbol: unique symbol;
|
|
1283
1303
|
|
|
1304
|
+
// @public
|
|
1305
|
+
export const typeSchemaSymbol: unique symbol;
|
|
1306
|
+
|
|
1284
1307
|
// @public
|
|
1285
1308
|
export type Unenforced<_DesiredExtendsConstraint> = unknown;
|
|
1286
1309
|
|
|
@@ -1288,7 +1311,7 @@ export type Unenforced<_DesiredExtendsConstraint> = unknown;
|
|
|
1288
1311
|
export type Unhydrated<T> = T;
|
|
1289
1312
|
|
|
1290
1313
|
// @public
|
|
1291
|
-
export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"]>, {
|
|
1314
|
+
export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
1292
1315
|
[NodeKind.Object]: T["info"] extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema> ? InsertableObjectFromSchemaRecord<T["info"]> : unknown;
|
|
1293
1316
|
[NodeKind.Array]: T["info"] extends ImplicitAllowedTypes ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>> : unknown;
|
|
1294
1317
|
[NodeKind.Map]: T["info"] extends ImplicitAllowedTypes ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]> : unknown;
|
|
@@ -1299,8 +1322,10 @@ export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKi
|
|
|
1299
1322
|
}[T["kind"]]>> = true;
|
|
1300
1323
|
|
|
1301
1324
|
// @public @sealed
|
|
1302
|
-
export interface WithType<TName extends string = string> {
|
|
1325
|
+
export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind> {
|
|
1326
|
+
// @deprecated
|
|
1303
1327
|
get [typeNameSymbol](): TName;
|
|
1328
|
+
get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind>;
|
|
1304
1329
|
}
|
|
1305
1330
|
|
|
1306
1331
|
```
|
|
@@ -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
|
|
|
@@ -589,6 +599,11 @@ type NodeBuilderData<T extends TreeNodeSchema> = T extends TreeNodeSchema<string
|
|
|
589
599
|
// @public
|
|
590
600
|
type NodeBuilderDataUnsafe<T extends Unenforced<TreeNodeSchema>> = T extends TreeNodeSchema<string, NodeKind, unknown, infer TBuild> ? TBuild : never;
|
|
591
601
|
|
|
602
|
+
// @public
|
|
603
|
+
export interface NodeChangedData {
|
|
604
|
+
readonly changedProperties?: ReadonlySet<string>;
|
|
605
|
+
}
|
|
606
|
+
|
|
592
607
|
// @public
|
|
593
608
|
export type NodeFromSchema<T extends TreeNodeSchema> = T extends TreeNodeSchema<string, NodeKind, infer TNode> ? TNode : never;
|
|
594
609
|
|
|
@@ -624,6 +639,22 @@ type ObjectFromSchemaRecordUnsafe<T extends Unenforced<RestrictiveReadonlyRecord
|
|
|
624
639
|
// @public
|
|
625
640
|
export type Off = () => void;
|
|
626
641
|
|
|
642
|
+
// @public @sealed
|
|
643
|
+
interface ReadonlyMapInlined<K, T extends Unenforced<ImplicitAllowedTypes>> {
|
|
644
|
+
[Symbol.iterator](): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
|
|
645
|
+
entries(): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
|
|
646
|
+
// (undocumented)
|
|
647
|
+
forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypesUnsafe<T>, key: K, map: ReadonlyMap<K, TreeNodeFromImplicitAllowedTypesUnsafe<T>>) => void, thisArg?: any): void;
|
|
648
|
+
// (undocumented)
|
|
649
|
+
get(key: K): TreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined;
|
|
650
|
+
// (undocumented)
|
|
651
|
+
has(key: K): boolean;
|
|
652
|
+
keys(): IterableIterator<K>;
|
|
653
|
+
// (undocumented)
|
|
654
|
+
readonly size: number;
|
|
655
|
+
values(): IterableIterator<TreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
656
|
+
}
|
|
657
|
+
|
|
627
658
|
// @public
|
|
628
659
|
export type ReplaceIEventThisPlaceHolder<L extends any[], TThis> = L extends any[] ? {
|
|
629
660
|
[K in keyof L]: L[K] extends IEventThisPlaceHolder ? TThis : L[K];
|
|
@@ -682,17 +713,17 @@ export interface SchemaCompatibilityStatus {
|
|
|
682
713
|
// @public @sealed
|
|
683
714
|
export class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> {
|
|
684
715
|
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
|
|
716
|
+
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>;
|
|
717
|
+
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>;
|
|
718
|
+
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
719
|
[Symbol.iterator](): Iterator<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
689
720
|
}, false, T>;
|
|
690
721
|
readonly boolean: TreeNodeSchema<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean>;
|
|
691
722
|
readonly handle: TreeNodeSchema<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>>;
|
|
692
723
|
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
|
|
724
|
+
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>;
|
|
725
|
+
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>;
|
|
726
|
+
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
727
|
[Symbol.iterator](): Iterator<[
|
|
697
728
|
string,
|
|
698
729
|
InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>
|
|
@@ -714,6 +745,8 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
714
745
|
// @public
|
|
715
746
|
type ScopedSchemaName<TScope extends string | undefined, TName extends number | string> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;
|
|
716
747
|
|
|
748
|
+
export { SequencePlace }
|
|
749
|
+
|
|
717
750
|
// @public @sealed
|
|
718
751
|
export interface SharedObjectKind<out TSharedObject = unknown> extends ErasedType<readonly ["SharedObjectKind", TSharedObject]> {
|
|
719
752
|
is(value: IFluidLoadable): value is IFluidLoadable & TSharedObject;
|
|
@@ -722,6 +755,8 @@ export interface SharedObjectKind<out TSharedObject = unknown> extends ErasedTyp
|
|
|
722
755
|
// @public
|
|
723
756
|
export const SharedTree: SharedObjectKind<ITree>;
|
|
724
757
|
|
|
758
|
+
export { Side }
|
|
759
|
+
|
|
725
760
|
// @public
|
|
726
761
|
export interface Tagged<V, T extends string = string> {
|
|
727
762
|
// (undocumented)
|
|
@@ -784,8 +819,8 @@ export interface TreeArrayNodeUnsafe<TAllowedTypes extends Unenforced<ImplicitAl
|
|
|
784
819
|
}
|
|
785
820
|
|
|
786
821
|
// @public @sealed
|
|
787
|
-
export interface TreeChangeEvents {
|
|
788
|
-
nodeChanged(): void;
|
|
822
|
+
export interface TreeChangeEvents<TNode = TreeNode> {
|
|
823
|
+
nodeChanged(data: NodeChangedData & (TNode extends WithType<string, NodeKind.Map | NodeKind.Object> ? Required<Pick<NodeChangedData, "changedProperties">> : unknown)): void;
|
|
789
824
|
treeChanged(): void;
|
|
790
825
|
}
|
|
791
826
|
|
|
@@ -809,7 +844,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
|
|
|
809
844
|
}
|
|
810
845
|
|
|
811
846
|
// @public @sealed
|
|
812
|
-
export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> extends
|
|
847
|
+
export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> extends ReadonlyMapInlined<string, T>, TreeNode {
|
|
813
848
|
delete(key: string): void;
|
|
814
849
|
set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined): void;
|
|
815
850
|
}
|
|
@@ -818,17 +853,19 @@ export interface TreeMapNodeUnsafe<T extends Unenforced<ImplicitAllowedTypes>> e
|
|
|
818
853
|
export abstract class TreeNode implements WithType {
|
|
819
854
|
static [Symbol.hasInstance](value: unknown): value is TreeNode;
|
|
820
855
|
static [Symbol.hasInstance]<TSchema extends abstract new (...args: any[]) => TreeNode>(this: TSchema, value: unknown): value is InstanceType<TSchema>;
|
|
856
|
+
// @deprecated
|
|
821
857
|
abstract get [typeNameSymbol](): string;
|
|
822
|
-
|
|
858
|
+
abstract get [typeSchemaSymbol](): TreeNodeSchemaClass;
|
|
859
|
+
protected constructor(token: unknown);
|
|
823
860
|
}
|
|
824
861
|
|
|
825
862
|
// @public @sealed
|
|
826
863
|
export interface TreeNodeApi {
|
|
827
864
|
is<TSchema extends ImplicitAllowedTypes>(value: unknown, schema: TSchema): value is TreeNodeFromImplicitAllowedTypes<TSchema>;
|
|
828
865
|
key(node: TreeNode): string | number;
|
|
829
|
-
on<K extends keyof TreeChangeEvents>(node:
|
|
866
|
+
on<K extends keyof TreeChangeEvents<TNode>, TNode extends TreeNode>(node: TNode, eventName: K, listener: TreeChangeEvents<TNode>[K]): () => void;
|
|
830
867
|
parent(node: TreeNode): TreeNode | undefined;
|
|
831
|
-
schema
|
|
868
|
+
schema(node: TreeNode | TreeLeafValue): TreeNodeSchema;
|
|
832
869
|
shortId(node: TreeNode): number | string | undefined;
|
|
833
870
|
status(node: TreeNode): TreeStatus;
|
|
834
871
|
}
|
|
@@ -850,7 +887,6 @@ export interface TreeNodeSchemaClass<out Name extends string = string, out Kind
|
|
|
850
887
|
|
|
851
888
|
// @public @sealed
|
|
852
889
|
export interface TreeNodeSchemaCore<out Name extends string, out Kind extends NodeKind, out ImplicitlyConstructable extends boolean, out Info = unknown> {
|
|
853
|
-
// (undocumented)
|
|
854
890
|
readonly identifier: Name;
|
|
855
891
|
readonly implicitlyConstructable: ImplicitlyConstructable;
|
|
856
892
|
readonly info: Info;
|
|
@@ -865,10 +901,10 @@ interface TreeNodeSchemaNonClass<out Name extends string = string, out Kind exte
|
|
|
865
901
|
}
|
|
866
902
|
|
|
867
903
|
// @public
|
|
868
|
-
export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName>;
|
|
904
|
+
export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object>;
|
|
869
905
|
|
|
870
906
|
// @public
|
|
871
|
-
export type TreeObjectNodeUnsafe<T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName>;
|
|
907
|
+
export type TreeObjectNodeUnsafe<T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName, NodeKind.Object>;
|
|
872
908
|
|
|
873
909
|
// @public
|
|
874
910
|
export enum TreeStatus {
|
|
@@ -892,7 +928,10 @@ export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposab
|
|
|
892
928
|
export class TreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
|
|
893
929
|
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
894
930
|
readonly enableSchemaValidation: boolean;
|
|
931
|
+
readonly preventAmbiguity: boolean;
|
|
895
932
|
readonly schema: TSchema;
|
|
933
|
+
// (undocumented)
|
|
934
|
+
protected _typeCheck: MakeNominal;
|
|
896
935
|
}
|
|
897
936
|
|
|
898
937
|
// @public @sealed
|
|
@@ -902,9 +941,12 @@ export interface TreeViewEvents {
|
|
|
902
941
|
schemaChanged(): void;
|
|
903
942
|
}
|
|
904
943
|
|
|
905
|
-
// @public
|
|
944
|
+
// @public @deprecated
|
|
906
945
|
const typeNameSymbol: unique symbol;
|
|
907
946
|
|
|
947
|
+
// @public
|
|
948
|
+
export const typeSchemaSymbol: unique symbol;
|
|
949
|
+
|
|
908
950
|
// @public
|
|
909
951
|
export type Unenforced<_DesiredExtendsConstraint> = unknown;
|
|
910
952
|
|
|
@@ -912,7 +954,7 @@ export type Unenforced<_DesiredExtendsConstraint> = unknown;
|
|
|
912
954
|
export type Unhydrated<T> = T;
|
|
913
955
|
|
|
914
956
|
// @public
|
|
915
|
-
export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"]>, {
|
|
957
|
+
export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKind.Array | NodeKind.Map | NodeKind.Object, TreeNode & WithType<T["identifier"], T["kind"]>, {
|
|
916
958
|
[NodeKind.Object]: T["info"] extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema> ? InsertableObjectFromSchemaRecord<T["info"]> : unknown;
|
|
917
959
|
[NodeKind.Array]: T["info"] extends ImplicitAllowedTypes ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>> : unknown;
|
|
918
960
|
[NodeKind.Map]: T["info"] extends ImplicitAllowedTypes ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]> : unknown;
|
|
@@ -923,8 +965,10 @@ export type ValidateRecursiveSchema<T extends TreeNodeSchemaClass<string, NodeKi
|
|
|
923
965
|
}[T["kind"]]>> = true;
|
|
924
966
|
|
|
925
967
|
// @public @sealed
|
|
926
|
-
export interface WithType<TName extends string = string> {
|
|
968
|
+
export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind> {
|
|
969
|
+
// @deprecated
|
|
927
970
|
get [typeNameSymbol](): TName;
|
|
971
|
+
get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind>;
|
|
928
972
|
}
|
|
929
973
|
|
|
930
974
|
```
|