fluid-framework 2.118.0 → 3.0.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.
@@ -5,9 +5,7 @@
5
5
  ```ts
6
6
 
7
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 & {
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 ? NodeFromSchema<ReturnType<typeof singletonSchema<TScope, TValue>>> : never) & { readonly [Property in keyof TEnum]: TreeNodeSchemaClass<ScopedSchemaName<TScope, TEnum[Property]>, NodeKind.Object, TreeNode & {
11
9
  readonly value: TEnum[Property];
12
10
  }, Record<string, never>, true, Record<string, never>, undefined>; } & {
13
11
  readonly schema: UnionToTuple<{ readonly [Property in keyof TEnum]: TreeNodeSchemaClass<ScopedSchemaName<TScope, TEnum[Property]>, NodeKind.Object, TreeNode & {
@@ -86,6 +84,41 @@ type ApplyKindInput<T, Kind extends FieldKind, DefaultsAreOptional extends boole
86
84
  Kind
87
85
  ] extends [FieldKind.Required] ? T : [Kind] extends [FieldKind.Optional] ? T | undefined : [Kind] extends [FieldKind.Identifier] ? DefaultsAreOptional extends true ? T | undefined : T : never;
88
86
 
87
+ // @beta @sealed
88
+ export type ArrayNodeDeltaOp = ArrayNodeRetainOp | ArrayNodeInsertOp | ArrayNodeRemoveOp;
89
+
90
+ // @beta @sealed
91
+ export interface ArrayNodeInsertOp {
92
+ // (undocumented)
93
+ readonly count: number;
94
+ // (undocumented)
95
+ readonly type: "insert";
96
+ }
97
+
98
+ // @beta @sealed
99
+ export interface ArrayNodeRemoveOp {
100
+ // (undocumented)
101
+ readonly count: number;
102
+ // (undocumented)
103
+ readonly type: "remove";
104
+ }
105
+
106
+ // @beta @sealed
107
+ export interface ArrayNodeRetainOp {
108
+ // (undocumented)
109
+ readonly count: number;
110
+ // (undocumented)
111
+ readonly type: "retain";
112
+ }
113
+
114
+ // @beta
115
+ export type ArrayNodeTreeChangedDeltaOp = ArrayNodeTreeChangedRetainOp | ArrayNodeInsertOp | ArrayNodeRemoveOp;
116
+
117
+ // @beta @sealed
118
+ export interface ArrayNodeTreeChangedRetainOp extends ArrayNodeRetainOp {
119
+ readonly subtreeChanged: boolean;
120
+ }
121
+
89
122
  // @beta
90
123
  export function asBeta<TSchema extends ImplicitFieldSchema>(view: TreeView<TSchema>): TreeViewBeta<TSchema>;
91
124
 
@@ -160,6 +193,9 @@ export function createIdentifierIndex<TSchema extends ImplicitFieldSchema>(view:
160
193
  // @beta
161
194
  export function createIndependentTreeBeta<const TSchema extends ImplicitFieldSchema>(options?: ForestOptions): ViewableTree;
162
195
 
196
+ // @beta
197
+ export function createIndependentTreeView<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options?: ForestOptions): TreeViewBeta<TSchema>;
198
+
163
199
  // @beta
164
200
  export function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue>(view: TreeView<TFieldSchema>, indexer: (schema: TreeNodeSchema) => string | undefined, getValue: (nodes: TreeIndexNodes<TreeNode>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey): TreeIndex<TKey, TValue>;
165
201
 
@@ -177,9 +213,7 @@ interface DefaultProvider extends ErasedType<"@fluidframework/tree.FieldProvider
177
213
  }
178
214
 
179
215
  // @beta
180
- 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 & {
181
- readonly value: TValue;
182
- } : 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 & {
216
+ 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 ? NodeFromSchema<ReturnType<typeof singletonSchema<TScope, TValue>>> : 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 & {
183
217
  readonly value: Members[Index];
184
218
  }, Record<string, never>, true, Record<string, never>, undefined>; } & {
185
219
  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 & {
@@ -373,7 +407,7 @@ export namespace FluidSerializableAsTree {
373
407
  export type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<typeof Array>;
374
408
  const // @system
375
409
  _APIExtractorWorkaroundArrayBase: TreeNodeSchemaClass<"com.fluidframework.serializable.array", NodeKind.Array, System_Unsafe.TreeArrayNodeUnsafe<readonly [() => typeof FluidSerializableObject, () => typeof Array, LeafSchema<"string", string>, LeafSchema<"number", number>, LeafSchema<"boolean", boolean>, LeafSchema<"null", null>, LeafSchema<"handle", IFluidHandle<unknown>>]> & WithType<"com.fluidframework.serializable.array", NodeKind.Array, unknown>, {
376
- [Symbol.iterator](): Iterator<string | number | IFluidHandle<unknown> | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | FluidSerializableObject | Array | null, any, undefined>;
410
+ [Symbol.iterator](): Iterator<string | number | IFluidHandle<unknown> | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | FluidSerializableObject | Array | null, any, any>;
377
411
  }, false, readonly [() => typeof FluidSerializableObject, () => typeof Array, LeafSchema<"string", string>, LeafSchema<"number", number>, LeafSchema<"boolean", boolean>, LeafSchema<"null", null>, LeafSchema<"handle", IFluidHandle<unknown>>], undefined>;
378
412
  // (undocumented)
379
413
  export type Tree = TreeNodeFromImplicitAllowedTypes<typeof Tree>;
@@ -713,7 +747,7 @@ declare namespace InternalTypes {
713
747
  FieldHasDefault,
714
748
  ScopedSchemaName,
715
749
  DefaultProvider,
716
- typeNameSymbol,
750
+ schemaIdentifierBrand,
717
751
  InsertableObjectFromSchemaRecord,
718
752
  FlexList,
719
753
  FlexListToUnion,
@@ -761,10 +795,10 @@ export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
761
795
  eventName: string;
762
796
  }
763
797
 
764
- // @public
798
+ // @public @input
765
799
  export interface ITelemetryBaseLogger {
766
800
  minLogLevel?: LogLevel | undefined;
767
- send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
801
+ send(event: ITelemetryBaseEvent, logLevel: LogLevel): void;
768
802
  }
769
803
 
770
804
  // @public
@@ -833,10 +867,6 @@ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
833
867
 
834
868
  // @public
835
869
  export interface LogLevelConst {
836
- // @deprecated
837
- readonly default: 20;
838
- // @deprecated
839
- readonly error: 30;
840
870
  readonly essential: 30;
841
871
  readonly info: 20;
842
872
  readonly verbose: 10;
@@ -863,6 +893,22 @@ type NodeBuilderData<T extends TreeNodeSchemaCore<string, NodeKind, boolean>> =
863
893
  // @beta @sealed
864
894
  export interface NodeChangedData<TNode extends TreeNode = TreeNode> {
865
895
  readonly changedProperties?: ReadonlySet<TNode extends WithType<string, NodeKind.Object, infer TInfo> ? string & keyof TInfo : string>;
896
+ readonly delta?: readonly ArrayNodeDeltaOp[] | undefined;
897
+ }
898
+
899
+ // @beta @sealed
900
+ export interface NodeChangedDataDelta extends NodeChangedData {
901
+ readonly delta: readonly ArrayNodeDeltaOp[] | undefined;
902
+ }
903
+
904
+ // @beta @sealed
905
+ export interface NodeChangedDataProperties<TNode extends TreeNode = TreeNode> extends NodeChangedData<TNode> {
906
+ readonly changedProperties: ReadonlySet<TNode extends WithType<string, NodeKind.Object, infer TInfo> ? string & keyof TInfo : string>;
907
+ }
908
+
909
+ // @beta @sealed
910
+ export interface NodeChangedDataTreeDelta {
911
+ readonly delta: readonly ArrayNodeTreeChangedDeltaOp[] | undefined;
866
912
  }
867
913
 
868
914
  // @public
@@ -921,7 +967,7 @@ export function onAssertionFailure(handler: (error: Error) => void): () => void;
921
967
  export type PopUnion<Union, AsOverloadedFunction = UnionToIntersection<Union extends unknown ? (f: Union) => void : never>> = AsOverloadedFunction extends (a: infer First) => void ? First : never;
922
968
 
923
969
  // @public @sealed @system
924
- export interface ReadonlyArrayNode<out T = TreeNode | TreeLeafValue> extends ReadonlyArray<T>, Awaited<TreeNode & WithType<string, NodeKind.Array>> {
970
+ export interface ReadonlyArrayNode<out T = TreeNode | TreeLeafValue> extends FluidReadonlyArray<T>, Awaited<TreeNode & WithType<string, NodeKind.Array>> {
925
971
  }
926
972
 
927
973
  // @beta @system
@@ -1037,21 +1083,16 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
1037
1083
  scope: TScope);
1038
1084
  array<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchemaNonClass<ScopedSchemaName<TScope, `Array<${string}>`>, NodeKind.Array, TreeArrayNode<T> & WithType<ScopedSchemaName<TScope, `Array<${string}>`>, NodeKind.Array>, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>, true, T, undefined>;
1039
1085
  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, undefined>;
1040
- arrayRecursive<const Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, System_Unsafe.TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array, unknown>, {
1086
+ arrayRecursive<const Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, System_Unsafe.TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array>, {
1041
1087
  [Symbol.iterator](): Iterator<System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
1042
1088
  }, false, T, undefined>;
1043
1089
  protected getStructuralType(fullName: string, types: TreeNodeSchema | readonly TreeNodeSchema[], builder: () => TreeNodeSchema): TreeNodeSchema;
1044
1090
  get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
1045
1091
  map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchemaNonClass<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map>, MapNodeInsertableData<T>, true, T, undefined>;
1046
1092
  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, undefined>;
1047
- mapRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, System_Unsafe.TreeMapNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map, unknown>, {
1048
- [Symbol.iterator](): Iterator<[
1049
- string,
1050
- System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>
1051
- ]>;
1052
- } | {
1053
- readonly [x: string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
1054
- }, false, T, undefined>;
1093
+ mapRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, System_Unsafe.TreeMapNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>, {
1094
+ [Symbol.iterator](): Iterator<[string, System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
1095
+ } | { readonly [P in string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>; }, false, T, undefined>;
1055
1096
  object<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
1056
1097
  objectRecursive<const Name extends TName, const T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, System_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & System_Unsafe.InsertableObjectFromSchemaRecordUnsafe<T>, false, T>;
1057
1098
  readonly scope: TScope;
@@ -1067,20 +1108,21 @@ export class SchemaFactoryBeta<out TScope extends string | undefined = string |
1067
1108
  objectRecursive<const Name extends TName, const T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>, const TCustomMetadata = unknown>(name: Name, t: T, options?: ObjectSchemaOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, System_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & System_Unsafe.InsertableObjectFromSchemaRecordUnsafe<T>, false, T, never, TCustomMetadata>;
1068
1109
  record<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchemaNonClass<ScopedSchemaName<TScope, `Record<${string}>`>, NodeKind.Record, TreeRecordNode<T> & WithType<ScopedSchemaName<TScope, `Record<${string}>`>, NodeKind.Record>, RecordNodeInsertableData<T>, true, T, undefined>;
1069
1110
  record<const Name extends TName, const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Record, TreeRecordNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Record>, RecordNodeInsertableData<T>, true, T, undefined, TCustomMetadata>;
1070
- recordRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Record, TreeRecordNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Record, unknown>, {
1071
- readonly [x: string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
1072
- }, false, T, undefined, TCustomMetadata>;
1111
+ recordRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Record, TreeRecordNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Record>, { readonly [P in string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>; }, false, T, undefined, TCustomMetadata>;
1073
1112
  scopedFactory<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryBeta<ScopedSchemaName<TScope, T>, TNameInner>;
1074
1113
  static staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
1075
1114
  staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
1076
- static stagedRecursive: <const T extends unknown>(t: T) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
1077
- stagedRecursive: <const T extends unknown>(t: T) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
1078
- static types: <const T extends readonly (LazyItem<TreeNodeSchema> | AnnotatedAllowedType<LazyItem<TreeNodeSchema>>)[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixed<T>;
1079
- types: <const T extends readonly (LazyItem<TreeNodeSchema> | AnnotatedAllowedType<LazyItem<TreeNodeSchema>>)[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixed<T>;
1080
- static typesRecursive: <const T extends readonly unknown[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixedUnsafe<T>;
1081
- typesRecursive: <const T extends readonly unknown[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixedUnsafe<T>;
1115
+ static stagedRecursive: <const T extends Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>>(t: T) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
1116
+ stagedRecursive: <const T extends Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>>(t: T) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
1117
+ static types: <const T extends readonly (AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[]>(t: T, metadata?: AllowedTypesMetadata) => AllowedTypesFullFromMixed<T>;
1118
+ types: <const T extends readonly (AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[]>(t: T, metadata?: AllowedTypesMetadata) => AllowedTypesFullFromMixed<T>;
1119
+ static typesRecursive: <const T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[]>(t: T, metadata?: AllowedTypesMetadata) => AllowedTypesFullFromMixedUnsafe<T>;
1120
+ typesRecursive: <const T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[]>(t: T, metadata?: AllowedTypesMetadata) => AllowedTypesFullFromMixedUnsafe<T>;
1082
1121
  }
1083
1122
 
1123
+ // @public @system
1124
+ const schemaIdentifierBrand: unique symbol;
1125
+
1084
1126
  // @public @sealed @system
1085
1127
  export interface SchemaStatics {
1086
1128
  readonly boolean: LeafSchema<"boolean", boolean>;
@@ -1167,6 +1209,10 @@ export interface SnapshotSchemaCompatibilityOptions {
1167
1209
  readonly rejectVersionsWithNoSchemaChange?: true;
1168
1210
  readonly schema: TreeViewConfiguration;
1169
1211
  readonly snapshotDirectory: string;
1212
+ readonly snapshotFileNameFormat?: {
1213
+ readonly prefix?: string;
1214
+ readonly suffix?: string;
1215
+ };
1170
1216
  readonly snapshotUnchangedVersions?: true;
1171
1217
  readonly version: string;
1172
1218
  readonly versionComparer?: (a: string, b: string) => number;
@@ -1182,7 +1228,7 @@ export namespace System_TableSchema {
1182
1228
  export function createColumnSchema<const TUserScope extends string, const TCellSchema extends ImplicitAllowedTypes, const TPropsSchema extends ImplicitFieldSchema>(inputSchemaFactory: SchemaFactoryBeta<TUserScope>, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Column">, NodeKind.Object, TreeNode & TableSchema.Column<TCellSchema, TPropsSchema> & WithType<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Column">, NodeKind, unknown>, object & {
1183
1229
  readonly id?: string | undefined;
1184
1230
  } & (FieldHasDefault<TPropsSchema> extends true ? {
1185
- props?: InsertableTreeFieldFromImplicitField<TPropsSchema> | undefined;
1231
+ props?: InsertableTreeFieldFromImplicitField<TPropsSchema>;
1186
1232
  } : {
1187
1233
  props: InsertableTreeFieldFromImplicitField<TPropsSchema>;
1188
1234
  }), true, {
@@ -1196,7 +1242,7 @@ export namespace System_TableSchema {
1196
1242
  readonly id?: string | undefined;
1197
1243
  readonly cells: (InsertableTypedNode<TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Row.cells">, NodeKind.Record, TreeRecordNode<TCellSchema> & WithType<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Row.cells">, NodeKind.Record, unknown>, RecordNodeInsertableData<TCellSchema>, true, TCellSchema, undefined, unknown>> | undefined) & InsertableTypedNode<TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Row.cells">, NodeKind.Record, TreeRecordNode<TCellSchema> & WithType<ScopedSchemaName<`com.fluidframework.tableV2<${TUserScope}>`, "Row.cells">, NodeKind.Record, unknown>, RecordNodeInsertableData<TCellSchema>, true, TCellSchema, undefined, unknown>>;
1198
1244
  } & (FieldHasDefault<TPropsSchema> extends true ? {
1199
- props?: InsertableTreeFieldFromImplicitField<TPropsSchema> | undefined;
1245
+ props?: InsertableTreeFieldFromImplicitField<TPropsSchema>;
1200
1246
  } : {
1201
1247
  props: InsertableTreeFieldFromImplicitField<TPropsSchema>;
1202
1248
  }), true, {
@@ -1277,18 +1323,20 @@ export namespace System_Unsafe {
1277
1323
  };
1278
1324
  // @sealed @system
1279
1325
  export interface ReadonlyMapInlined<K, T extends ImplicitAllowedTypesUnsafe> {
1280
- [Symbol.iterator](): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
1281
- entries(): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
1326
+ [Symbol.iterator](): FluidIterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
1327
+ // (undocumented)
1328
+ readonly [Symbol.toStringTag]: string;
1329
+ entries(): FluidIterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;
1282
1330
  // (undocumented)
1283
- forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypesUnsafe<T>, key: K, map: ReadonlyMap<K, TreeNodeFromImplicitAllowedTypesUnsafe<T>>) => void, thisArg?: any): void;
1331
+ forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypesUnsafe<T>, key: K, map: FluidReadonlyMap<K, TreeNodeFromImplicitAllowedTypesUnsafe<T>>) => void, thisArg?: any): void;
1284
1332
  // (undocumented)
1285
1333
  get(key: K): TreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined;
1286
1334
  // (undocumented)
1287
1335
  has(key: K): boolean;
1288
- keys(): IterableIterator<K>;
1336
+ keys(): FluidIterableIterator<K>;
1289
1337
  // (undocumented)
1290
1338
  readonly size: number;
1291
- values(): IterableIterator<TreeNodeFromImplicitAllowedTypesUnsafe<T>>;
1339
+ values(): FluidIterableIterator<TreeNodeFromImplicitAllowedTypesUnsafe<T>>;
1292
1340
  }
1293
1341
  // @sealed @system
1294
1342
  export interface TreeArrayNodeUnsafe<TAllowedTypes extends ImplicitAllowedTypesUnsafe> extends TreeArrayNode<TAllowedTypes, TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>, InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>> {
@@ -1335,16 +1383,6 @@ export namespace TableSchema {
1335
1383
  export function column<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateColumnOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
1336
1384
  readonly props: TProps;
1337
1385
  }): System_TableSchema.ColumnSchemaBase<TUserScope, TCell, TProps>;
1338
- // @deprecated @input
1339
- export interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
1340
- readonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];
1341
- readonly index?: number | undefined;
1342
- }
1343
- // @deprecated @input
1344
- export interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
1345
- readonly index?: number | undefined;
1346
- readonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];
1347
- }
1348
1386
  // @sealed
1349
1387
  export interface Row<TCell extends ImplicitAllowedTypes, TProps extends ImplicitFieldSchema = ImplicitFieldSchema> {
1350
1388
  readonly id: string;
@@ -1355,11 +1393,6 @@ export namespace TableSchema {
1355
1393
  export function row<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateRowOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
1356
1394
  readonly props: TProps;
1357
1395
  }): System_TableSchema.RowSchemaBase<TUserScope, TCell, TProps>;
1358
- // @deprecated @input
1359
- export interface SetCellParameters<TCell extends ImplicitAllowedTypes, TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
1360
- readonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;
1361
- readonly key: CellKey<TColumn, TRow>;
1362
- }
1363
1396
  // @sealed
1364
1397
  export interface Table<TUserScope extends string, TCell extends ImplicitAllowedTypes, TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>, TRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>> {
1365
1398
  readonly columns: System_TableSchema.RearrangeableList<TColumn>;
@@ -1369,14 +1402,8 @@ export namespace TableSchema {
1369
1402
  getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
1370
1403
  getRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
1371
1404
  insertColumns(columns: readonly InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[], index?: number): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1372
- // @deprecated
1373
- insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1374
1405
  insertRows(rows: readonly InsertableTreeNodeFromImplicitAllowedTypes<TRow>[], index?: number): TreeNodeFromImplicitAllowedTypes<TRow>[];
1375
- // @deprecated
1376
- insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];
1377
1406
  removeCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1378
- // @deprecated
1379
- removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1380
1407
  removeColumns(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1381
1408
  removeColumns(columns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1382
1409
  removeColumns(columns: readonly string[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
@@ -1385,8 +1412,6 @@ export namespace TableSchema {
1385
1412
  removeRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
1386
1413
  readonly rows: System_TableSchema.RearrangeableList<TRow>;
1387
1414
  setCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>, cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
1388
- // @deprecated
1389
- setCell(params: SetCellParameters<TCell, TColumn, TRow>): void;
1390
1415
  }
1391
1416
  export function table<const TUserScope extends string, const TCell extends ImplicitAllowedTypes>(params: System_TableSchema.TableFactoryOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell>): System_TableSchema.TableSchemaBase<TUserScope, TCell, System_TableSchema.ColumnSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>, System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>>;
1392
1417
  export function table<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>>(params: System_TableSchema.TableFactoryOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
@@ -1475,7 +1500,7 @@ export interface TreeArrayNode<TAllowedTypes extends System_Unsafe.ImplicitAllow
1475
1500
  push(...value: readonly (TNew | IterableTreeArrayContent<TNew>)[]): void;
1476
1501
  removeAt(index: number): void;
1477
1502
  removeRange(start?: number, end?: number): void;
1478
- values(): IterableIterator<T>;
1503
+ values(): FluidIterableIterator<T>;
1479
1504
  }
1480
1505
 
1481
1506
  // @public
@@ -1486,6 +1511,7 @@ export const TreeArrayNode: {
1486
1511
  // @beta @sealed
1487
1512
  export interface TreeBeta {
1488
1513
  clone<const TSchema extends ImplicitFieldSchema>(node: TreeFieldFromImplicitField<TSchema>): TreeFieldFromImplicitField<TSchema>;
1514
+ context(node: TreeNode): TreeContextBeta;
1489
1515
  create<const TSchema extends ImplicitFieldSchema>(schema: TSchema, data: InsertableTreeFieldFromImplicitField<TSchema>): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
1490
1516
  exportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;
1491
1517
  exportConcise(node: TreeNode | TreeLeafValue | undefined, options?: TreeEncodingOptions): ConciseTree | undefined;
@@ -1502,12 +1528,22 @@ export type TreeBranch = UntypedTreeView;
1502
1528
  // @public @sealed
1503
1529
  export interface TreeChangeEvents {
1504
1530
  nodeChanged(unstable?: unknown): void;
1505
- treeChanged(): void;
1531
+ treeChanged(unstable?: unknown): void;
1532
+ }
1533
+
1534
+ // @beta @sealed
1535
+ export interface TreeChangeEventsBeta<TNode extends TreeNode = TreeNode> extends Omit<TreeChangeEvents, "nodeChanged" | "treeChanged"> {
1536
+ nodeChanged: (data: TNode extends WithType<string, NodeKind.Array> ? NodeChangedDataDelta : TNode extends WithType<string, NodeKind.Map | NodeKind.Object | NodeKind.Record> ? NodeChangedDataProperties<TNode> : NodeChangedData<TNode>) => void;
1537
+ treeChanged: TNode extends WithType<string, NodeKind.Array> ? (data: NodeChangedDataTreeDelta) => void : TreeChangeEvents["treeChanged"];
1506
1538
  }
1507
1539
 
1508
1540
  // @beta @sealed
1509
- export interface TreeChangeEventsBeta<TNode extends TreeNode = TreeNode> extends TreeChangeEvents {
1510
- nodeChanged: (data: NodeChangedData<TNode> & (TNode extends WithType<string, NodeKind.Map | NodeKind.Object | NodeKind.Record> ? Required<Pick<NodeChangedData<TNode>, "changedProperties">> : unknown)) => void;
1541
+ export interface TreeContextBeta {
1542
+ isView(): this is UntypedTreeView;
1543
+ runTransaction<TValue>(transaction: () => WithValue<TValue>, params?: RunTransactionParamsBeta): TransactionValueResult<TValue, TValue>;
1544
+ runTransaction(transaction: () => void, params?: RunTransactionParamsBeta): TransactionVoidResult;
1545
+ runTransactionAsync<TValue>(transaction: () => Promise<WithValue<TValue>>, params?: RunTransactionParamsBeta): Promise<TransactionValueResult<TValue, TValue>>;
1546
+ runTransactionAsync(transaction: () => Promise<void>, params?: RunTransactionParamsBeta): Promise<TransactionVoidResult>;
1511
1547
  }
1512
1548
 
1513
1549
  // @beta @input
@@ -1533,21 +1569,20 @@ export type TreeIndexNodes<TNode> = readonly [first: TNode, ...rest: TNode[]];
1533
1569
  export type TreeLeafValue = number | string | boolean | IFluidHandle | null;
1534
1570
 
1535
1571
  // @public @sealed
1536
- export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>, TreeNode {
1572
+ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends FluidReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>, TreeNode {
1537
1573
  delete(key: string): void;
1538
- entries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;
1539
- forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>) => void, thisArg?: any): void;
1540
- keys(): IterableIterator<string>;
1574
+ entries(): FluidIterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;
1575
+ forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: FluidReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>) => void, thisArg?: any): void;
1576
+ keys(): FluidIterableIterator<string>;
1541
1577
  set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T> | undefined): void;
1542
- values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;
1578
+ values(): FluidIterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;
1543
1579
  }
1544
1580
 
1545
1581
  // @public @sealed
1546
1582
  export abstract class TreeNode implements WithType {
1583
+ abstract get [schemaIdentifierBrand](): string;
1547
1584
  static [Symbol.hasInstance](value: unknown): value is TreeNode;
1548
1585
  static [Symbol.hasInstance]<TSchema extends abstract new (...args: any[]) => TreeNode>(this: TSchema, value: unknown): value is InstanceType<TSchema>;
1549
- // @deprecated
1550
- abstract get [typeNameSymbol](): string;
1551
1586
  abstract get [typeSchemaSymbol](): TreeNodeSchemaClass;
1552
1587
  protected constructor(token: unknown);
1553
1588
  }
@@ -1599,7 +1634,7 @@ export type TreeObjectNode<T extends RestrictiveStringRecord<ImplicitFieldSchema
1599
1634
 
1600
1635
  // @beta
1601
1636
  export interface TreeRecordNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends TreeNode, Record<string, TreeNodeFromImplicitAllowedTypes<TAllowedTypes>> {
1602
- [Symbol.iterator](): IterableIterator<[
1637
+ [Symbol.iterator](): FluidIterableIterator<[
1603
1638
  string,
1604
1639
  TreeNodeFromImplicitAllowedTypes<TAllowedTypes>
1605
1640
  ]>;
@@ -1608,7 +1643,7 @@ export interface TreeRecordNode<TAllowedTypes extends ImplicitAllowedTypes = Imp
1608
1643
  // @beta @sealed @system
1609
1644
  export interface TreeRecordNodeUnsafe<TAllowedTypes extends System_Unsafe.ImplicitAllowedTypesUnsafe> extends Record<string, System_Unsafe.TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>>, TreeNode {
1610
1645
  // (undocumented)
1611
- [Symbol.iterator](): IterableIterator<[
1646
+ [Symbol.iterator](): FluidIterableIterator<[
1612
1647
  string,
1613
1648
  System_Unsafe.TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>
1614
1649
  ]>;
@@ -1638,8 +1673,6 @@ export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extend
1638
1673
  readonly compatibility: SchemaCompatibilityStatusBeta;
1639
1674
  // (undocumented)
1640
1675
  fork(): ReturnType<UntypedTreeView["fork"]> & TreeViewBeta<TSchema>;
1641
- runTransaction<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => TOut, params?: RunTransactionParamsBeta): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult;
1642
- runTransactionAsync<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => Promise<TOut>, params?: RunTransactionParamsBeta): Promise<TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult>;
1643
1676
  }
1644
1677
 
1645
1678
  // @public @sealed
@@ -1659,9 +1692,6 @@ export interface TreeViewEvents {
1659
1692
  schemaChanged(): void;
1660
1693
  }
1661
1694
 
1662
- // @public @deprecated @system
1663
- const typeNameSymbol: unique symbol;
1664
-
1665
1695
  // @public @system
1666
1696
  export const typeSchemaSymbol: unique symbol;
1667
1697
 
@@ -1693,11 +1723,21 @@ export type UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) e
1693
1723
  export type UnionToTuple<Union, A extends unknown[] = [], First = PopUnion<Union>> = IsUnion<Union> extends true ? UnionToTuple<Exclude<Union, First>, [First, ...A]> : [Union, ...A];
1694
1724
 
1695
1725
  // @beta @sealed
1696
- export interface UntypedTreeView extends IDisposable {
1726
+ export interface UntypedTreeView extends IDisposable, TreeContextBeta {
1697
1727
  dispose(error?: Error): void;
1698
1728
  fork(): UntypedTreeView;
1699
1729
  merge(view: UntypedTreeView, disposeMerged?: boolean): void;
1700
1730
  rebaseOnto(view: UntypedTreeView): void;
1731
+ // (undocumented)
1732
+ runTransaction<TValue>(transaction: () => WithValue<TValue>, params?: RunTransactionParamsBeta): TransactionValueResult<TValue, TValue>;
1733
+ // (undocumented)
1734
+ runTransaction(transaction: () => void, params?: RunTransactionParamsBeta): TransactionVoidResult;
1735
+ runTransaction<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => TOut, params?: RunTransactionParamsBeta): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult;
1736
+ // (undocumented)
1737
+ runTransactionAsync<TValue>(transaction: () => Promise<WithValue<TValue>>, params?: RunTransactionParamsBeta): Promise<TransactionValueResult<TValue, TValue>>;
1738
+ // (undocumented)
1739
+ runTransactionAsync(transaction: () => Promise<void>, params?: RunTransactionParamsBeta): Promise<TransactionVoidResult>;
1740
+ runTransactionAsync<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => Promise<TOut>, params?: RunTransactionParamsBeta): Promise<TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult>;
1701
1741
  }
1702
1742
 
1703
1743
  // @public
@@ -1730,8 +1770,7 @@ export type VoidTransactionCallbackStatusBeta = Omit<TransactionCallbackStatusBe
1730
1770
 
1731
1771
  // @public @sealed
1732
1772
  export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind, out TInfo = unknown> {
1733
- // @deprecated
1734
- get [typeNameSymbol](): TName;
1773
+ get [schemaIdentifierBrand](): TName;
1735
1774
  get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;
1736
1775
  }
1737
1776