fluid-framework 2.0.0-dev-rc.5.0.0.270401 → 2.0.0-dev-rc.5.0.0.271045

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.
@@ -35,7 +35,7 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
35
35
  export type AllowedTypes = readonly LazyItem<TreeNodeSchema>[];
36
36
 
37
37
  // @public
38
- export type ApplyKind<T, Kind extends FieldKind, DefaultsAreOptional extends boolean> = {
38
+ type ApplyKind<T, Kind extends FieldKind, DefaultsAreOptional extends boolean> = {
39
39
  [FieldKind.Required]: T;
40
40
  [FieldKind.Optional]: T | undefined;
41
41
  [FieldKind.Identifier]: DefaultsAreOptional extends true ? T | undefined : T;
@@ -103,7 +103,13 @@ export abstract class ErasedType<out Name = unknown> {
103
103
  }
104
104
 
105
105
  // @public
106
- export type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result ? Result : Item;
106
+ type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result ? Result : Item;
107
+
108
+ // @public
109
+ export type FieldHasDefault<T extends ImplicitFieldSchema> = T extends FieldSchema<FieldKind.Optional | FieldKind.Identifier> ? true : false;
110
+
111
+ // @public
112
+ export type FieldHasDefaultUnsafe<T extends Unenforced<ImplicitFieldSchema>> = T extends FieldSchemaUnsafe<FieldKind.Optional | FieldKind.Identifier, Unenforced<ImplicitAllowedTypes>> ? true : false;
107
113
 
108
114
  // @public
109
115
  export enum FieldKind {
@@ -134,11 +140,16 @@ export interface FieldSchemaUnsafe<out Kind extends FieldKind, out Types extends
134
140
  readonly kind: Kind;
135
141
  }
136
142
 
143
+ // @public
144
+ type FlattenKeys<T> = [{
145
+ [Property in keyof T]: T[Property];
146
+ }][_InlineTrick];
147
+
137
148
  // @public
138
149
  export type FlexList<Item = unknown> = readonly LazyItem<Item>[];
139
150
 
140
151
  // @public
141
- export type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
152
+ type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
142
153
 
143
154
  // @public
144
155
  export type FluidObject<T = unknown> = {
@@ -510,13 +521,20 @@ export type InitialObjects<T extends ContainerSchema> = {
510
521
  };
511
522
 
512
523
  // @public
513
- export type InsertableObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = {
514
- readonly [Property in keyof T]: InsertableTreeFieldFromImplicitField<T[Property]>;
515
- };
524
+ type _InlineTrick = 0;
525
+
526
+ // @public
527
+ export type InsertableObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = InternalUtilTypes.FlattenKeys<{
528
+ readonly [Property in keyof T]?: InsertableTreeFieldFromImplicitField<T[Property]>;
529
+ } & {
530
+ readonly [Property in keyof T as FieldHasDefault<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitField<T[Property]>;
531
+ }>;
516
532
 
517
533
  // @public
518
534
  export type InsertableObjectFromSchemaRecordUnsafe<T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>> = {
519
- readonly [Property in keyof T]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>;
535
+ readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>;
536
+ } & {
537
+ readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends true ? Property : never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>;
520
538
  };
521
539
 
522
540
  // @public
@@ -526,10 +544,10 @@ export type InsertableTreeFieldFromImplicitField<TSchema extends ImplicitFieldSc
526
544
  export type InsertableTreeFieldFromImplicitFieldUnsafe<TSchema extends Unenforced<ImplicitFieldSchema>> = TSchema extends FieldSchemaUnsafe<infer Kind, infer Types> ? ApplyKind<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind, true> : InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema>;
527
545
 
528
546
  // @public
529
- export type InsertableTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? InsertableTypedNode<TSchema> : TSchema extends AllowedTypes ? InsertableTypedNode<FlexListToUnion<TSchema>> : never;
547
+ export type InsertableTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? InsertableTypedNode<TSchema> : TSchema extends AllowedTypes ? InsertableTypedNode<InternalFlexListTypes.FlexListToUnion<TSchema>> : never;
530
548
 
531
549
  // @public
532
- export type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends AllowedTypes ? InsertableTypedNodeUnsafe<FlexListToUnion<TSchema>> : InsertableTypedNodeUnsafe<TSchema>;
550
+ export type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends AllowedTypes ? InsertableTypedNodeUnsafe<InternalFlexListTypes.FlexListToUnion<TSchema>> : InsertableTypedNodeUnsafe<TSchema>;
533
551
 
534
552
  // @public
535
553
  export type InsertableTypedNode<T extends TreeNodeSchema> = (T extends {
@@ -549,10 +567,33 @@ export interface InteriorSequencePlace {
549
567
  side: Side;
550
568
  }
551
569
 
570
+ declare namespace InternalFlexListTypes {
571
+ export {
572
+ FlexListToUnion,
573
+ ExtractItemType
574
+ }
575
+ }
576
+ export { InternalFlexListTypes }
577
+
578
+ declare namespace InternalSimpleTreeTypes {
579
+ export {
580
+ ApplyKind
581
+ }
582
+ }
583
+ export { InternalSimpleTreeTypes }
584
+
552
585
  // @public
553
586
  export interface InternalTreeNode extends ErasedType<"@fluidframework/tree.InternalTreeNode"> {
554
587
  }
555
588
 
589
+ declare namespace InternalUtilTypes {
590
+ export {
591
+ _InlineTrick,
592
+ FlattenKeys
593
+ }
594
+ }
595
+ export { InternalUtilTypes }
596
+
556
597
  // @alpha
557
598
  export interface IntervalIndex<TInterval extends ISerializableInterval> {
558
599
  add(interval: TInterval): void;
@@ -788,7 +829,9 @@ export interface ITrace {
788
829
 
789
830
  // @public
790
831
  export interface ITree extends IFluidLoadable {
832
+ // @deprecated
791
833
  schematize<TRoot extends ImplicitFieldSchema>(config: TreeConfiguration<TRoot>): TreeView<TRoot>;
834
+ viewWith<TRoot extends ImplicitFieldSchema>(config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
792
835
  }
793
836
 
794
837
  // @public
@@ -796,6 +839,12 @@ export interface ITreeConfigurationOptions {
796
839
  enableSchemaValidation?: boolean;
797
840
  }
798
841
 
842
+ // @public
843
+ export interface ITreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> {
844
+ readonly enableSchemaValidation?: boolean;
845
+ readonly schema: TSchema;
846
+ }
847
+
799
848
  // @alpha @sealed
800
849
  export interface IValueChanged {
801
850
  readonly key: string;
@@ -915,6 +964,14 @@ export interface RunTransaction {
915
964
  readonly rollback: typeof rollback;
916
965
  }
917
966
 
967
+ // @public
968
+ export interface SchemaCompatibilityStatus {
969
+ readonly canInitialize: boolean;
970
+ readonly canUpgrade: boolean;
971
+ readonly canView: boolean;
972
+ readonly isEquivalent: boolean;
973
+ }
974
+
918
975
  // @public @sealed
919
976
  export class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> {
920
977
  constructor(scope: TScope);
@@ -937,7 +994,7 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
937
994
  readonly null: TreeNodeSchema<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null>;
938
995
  readonly number: TreeNodeSchema<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
939
996
  object<const Name extends TName, const T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
940
- objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordUnsafe<T>, false, T>;
997
+ objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & { readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>; } & { readonly [Property_1 in keyof T as FieldHasDefaultUnsafe<T[Property_1]> extends true ? Property_1 : never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property_1]> | undefined; }, false, T>;
941
998
  optional<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchema<FieldKind.Optional, T>;
942
999
  optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
943
1000
  required<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchema<FieldKind.Required, T>;
@@ -947,11 +1004,6 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
947
1004
  readonly string: TreeNodeSchema<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string>;
948
1005
  }
949
1006
 
950
- // @public
951
- export interface SchemaIncompatible {
952
- readonly canUpgrade: boolean;
953
- }
954
-
955
1007
  // @public
956
1008
  export type ScopedSchemaName<TScope extends string | undefined, TName extends number | string> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;
957
1009
 
@@ -1126,12 +1178,12 @@ export interface TreeChangeEvents {
1126
1178
  treeChanged(): void;
1127
1179
  }
1128
1180
 
1129
- // @public
1181
+ // @public @deprecated
1130
1182
  export class TreeConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> {
1131
1183
  constructor(schema: TSchema, initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>, options?: ITreeConfigurationOptions);
1184
+ readonly enableSchemaValidation: boolean;
1132
1185
  // (undocumented)
1133
1186
  readonly initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>;
1134
- readonly options: Required<ITreeConfigurationOptions>;
1135
1187
  // (undocumented)
1136
1188
  readonly schema: TSchema;
1137
1189
  }
@@ -1179,10 +1231,10 @@ export interface TreeNodeApi {
1179
1231
  }
1180
1232
 
1181
1233
  // @public
1182
- export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<FlexListToUnion<TSchema>> : unknown;
1234
+ export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<InternalFlexListTypes.FlexListToUnion<TSchema>> : unknown;
1183
1235
 
1184
1236
  // @public
1185
- export type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<FlexListToUnion<TSchema>> : unknown;
1237
+ export type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<InternalFlexListTypes.FlexListToUnion<TSchema>> : unknown;
1186
1238
 
1187
1239
  // @public
1188
1240
  export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode = unknown, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown> = TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info> | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>;
@@ -1225,18 +1277,27 @@ export enum TreeStatus {
1225
1277
 
1226
1278
  // @public
1227
1279
  export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposable {
1228
- readonly error?: SchemaIncompatible;
1280
+ readonly compatibility: SchemaCompatibilityStatus;
1229
1281
  readonly events: Listenable<TreeViewEvents>;
1282
+ initialize(content: InsertableTreeFieldFromImplicitField<TSchema>): void;
1230
1283
  get root(): TreeFieldFromImplicitField<TSchema>;
1231
1284
  set root(newRoot: InsertableTreeFieldFromImplicitField<TSchema>);
1232
1285
  upgradeSchema(): void;
1233
1286
  }
1234
1287
 
1288
+ // @public
1289
+ export class TreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
1290
+ constructor(props: ITreeViewConfiguration<TSchema>);
1291
+ readonly enableSchemaValidation: boolean;
1292
+ readonly schema: TSchema;
1293
+ }
1294
+
1235
1295
  // @public
1236
1296
  export interface TreeViewEvents {
1237
1297
  afterBatch(): void;
1238
1298
  commitApplied(data: CommitMetadata, getRevertible?: RevertibleFactory): void;
1239
1299
  rootChanged(): void;
1300
+ schemaChanged(): void;
1240
1301
  }
1241
1302
 
1242
1303
  // @public
@@ -35,7 +35,7 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
35
35
  export type AllowedTypes = readonly LazyItem<TreeNodeSchema>[];
36
36
 
37
37
  // @public
38
- export type ApplyKind<T, Kind extends FieldKind, DefaultsAreOptional extends boolean> = {
38
+ type ApplyKind<T, Kind extends FieldKind, DefaultsAreOptional extends boolean> = {
39
39
  [FieldKind.Required]: T;
40
40
  [FieldKind.Optional]: T | undefined;
41
41
  [FieldKind.Identifier]: DefaultsAreOptional extends true ? T | undefined : T;
@@ -100,7 +100,13 @@ export abstract class ErasedType<out Name = unknown> {
100
100
  }
101
101
 
102
102
  // @public
103
- export type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result ? Result : Item;
103
+ type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result ? Result : Item;
104
+
105
+ // @public
106
+ export type FieldHasDefault<T extends ImplicitFieldSchema> = T extends FieldSchema<FieldKind.Optional | FieldKind.Identifier> ? true : false;
107
+
108
+ // @public
109
+ export type FieldHasDefaultUnsafe<T extends Unenforced<ImplicitFieldSchema>> = T extends FieldSchemaUnsafe<FieldKind.Optional | FieldKind.Identifier, Unenforced<ImplicitAllowedTypes>> ? true : false;
104
110
 
105
111
  // @public
106
112
  export enum FieldKind {
@@ -131,11 +137,16 @@ export interface FieldSchemaUnsafe<out Kind extends FieldKind, out Types extends
131
137
  readonly kind: Kind;
132
138
  }
133
139
 
140
+ // @public
141
+ type FlattenKeys<T> = [{
142
+ [Property in keyof T]: T[Property];
143
+ }][_InlineTrick];
144
+
134
145
  // @public
135
146
  export type FlexList<Item = unknown> = readonly LazyItem<Item>[];
136
147
 
137
148
  // @public
138
- export type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
149
+ type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
139
150
 
140
151
  // @public
141
152
  export type FluidObject<T = unknown> = {
@@ -410,13 +421,20 @@ export type InitialObjects<T extends ContainerSchema> = {
410
421
  };
411
422
 
412
423
  // @public
413
- export type InsertableObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = {
414
- readonly [Property in keyof T]: InsertableTreeFieldFromImplicitField<T[Property]>;
415
- };
424
+ type _InlineTrick = 0;
425
+
426
+ // @public
427
+ export type InsertableObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = InternalUtilTypes.FlattenKeys<{
428
+ readonly [Property in keyof T]?: InsertableTreeFieldFromImplicitField<T[Property]>;
429
+ } & {
430
+ readonly [Property in keyof T as FieldHasDefault<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitField<T[Property]>;
431
+ }>;
416
432
 
417
433
  // @public
418
434
  export type InsertableObjectFromSchemaRecordUnsafe<T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>> = {
419
- readonly [Property in keyof T]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>;
435
+ readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>;
436
+ } & {
437
+ readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends true ? Property : never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>;
420
438
  };
421
439
 
422
440
  // @public
@@ -426,10 +444,10 @@ export type InsertableTreeFieldFromImplicitField<TSchema extends ImplicitFieldSc
426
444
  export type InsertableTreeFieldFromImplicitFieldUnsafe<TSchema extends Unenforced<ImplicitFieldSchema>> = TSchema extends FieldSchemaUnsafe<infer Kind, infer Types> ? ApplyKind<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind, true> : InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema>;
427
445
 
428
446
  // @public
429
- export type InsertableTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? InsertableTypedNode<TSchema> : TSchema extends AllowedTypes ? InsertableTypedNode<FlexListToUnion<TSchema>> : never;
447
+ export type InsertableTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? InsertableTypedNode<TSchema> : TSchema extends AllowedTypes ? InsertableTypedNode<InternalFlexListTypes.FlexListToUnion<TSchema>> : never;
430
448
 
431
449
  // @public
432
- export type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends AllowedTypes ? InsertableTypedNodeUnsafe<FlexListToUnion<TSchema>> : InsertableTypedNodeUnsafe<TSchema>;
450
+ export type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends AllowedTypes ? InsertableTypedNodeUnsafe<InternalFlexListTypes.FlexListToUnion<TSchema>> : InsertableTypedNodeUnsafe<TSchema>;
433
451
 
434
452
  // @public
435
453
  export type InsertableTypedNode<T extends TreeNodeSchema> = (T extends {
@@ -441,10 +459,33 @@ export type InsertableTypedNodeUnsafe<T extends Unenforced<TreeNodeSchema>> = Un
441
459
  implicitlyConstructable: true;
442
460
  } ? NodeBuilderDataUnsafe<T> : never);
443
461
 
462
+ declare namespace InternalFlexListTypes {
463
+ export {
464
+ FlexListToUnion,
465
+ ExtractItemType
466
+ }
467
+ }
468
+ export { InternalFlexListTypes }
469
+
470
+ declare namespace InternalSimpleTreeTypes {
471
+ export {
472
+ ApplyKind
473
+ }
474
+ }
475
+ export { InternalSimpleTreeTypes }
476
+
444
477
  // @public
445
478
  export interface InternalTreeNode extends ErasedType<"@fluidframework/tree.InternalTreeNode"> {
446
479
  }
447
480
 
481
+ declare namespace InternalUtilTypes {
482
+ export {
483
+ _InlineTrick,
484
+ FlattenKeys
485
+ }
486
+ }
487
+ export { InternalUtilTypes }
488
+
448
489
  // @public (undocumented)
449
490
  export interface IProvideFluidLoadable {
450
491
  // (undocumented)
@@ -482,7 +523,9 @@ export class IterableTreeArrayContent<T> implements Iterable<T> {
482
523
 
483
524
  // @public
484
525
  export interface ITree extends IFluidLoadable {
526
+ // @deprecated
485
527
  schematize<TRoot extends ImplicitFieldSchema>(config: TreeConfiguration<TRoot>): TreeView<TRoot>;
528
+ viewWith<TRoot extends ImplicitFieldSchema>(config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
486
529
  }
487
530
 
488
531
  // @public
@@ -490,6 +533,12 @@ export interface ITreeConfigurationOptions {
490
533
  enableSchemaValidation?: boolean;
491
534
  }
492
535
 
536
+ // @public
537
+ export interface ITreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> {
538
+ readonly enableSchemaValidation?: boolean;
539
+ readonly schema: TSchema;
540
+ }
541
+
493
542
  // @public
494
543
  export type LazyItem<Item = unknown> = Item | (() => Item);
495
544
 
@@ -603,6 +652,14 @@ export interface RunTransaction {
603
652
  readonly rollback: typeof rollback;
604
653
  }
605
654
 
655
+ // @public
656
+ export interface SchemaCompatibilityStatus {
657
+ readonly canInitialize: boolean;
658
+ readonly canUpgrade: boolean;
659
+ readonly canView: boolean;
660
+ readonly isEquivalent: boolean;
661
+ }
662
+
606
663
  // @public @sealed
607
664
  export class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> {
608
665
  constructor(scope: TScope);
@@ -625,7 +682,7 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
625
682
  readonly null: TreeNodeSchema<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null>;
626
683
  readonly number: TreeNodeSchema<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
627
684
  object<const Name extends TName, const T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
628
- objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordUnsafe<T>, false, T>;
685
+ objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & { readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>; } & { readonly [Property_1 in keyof T as FieldHasDefaultUnsafe<T[Property_1]> extends true ? Property_1 : never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property_1]> | undefined; }, false, T>;
629
686
  optional<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchema<FieldKind.Optional, T>;
630
687
  optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
631
688
  required<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchema<FieldKind.Required, T>;
@@ -635,11 +692,6 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
635
692
  readonly string: TreeNodeSchema<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string>;
636
693
  }
637
694
 
638
- // @public
639
- export interface SchemaIncompatible {
640
- readonly canUpgrade: boolean;
641
- }
642
-
643
695
  // @public
644
696
  export type ScopedSchemaName<TScope extends string | undefined, TName extends number | string> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;
645
697
 
@@ -716,12 +768,12 @@ export interface TreeChangeEvents {
716
768
  treeChanged(): void;
717
769
  }
718
770
 
719
- // @public
771
+ // @public @deprecated
720
772
  export class TreeConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> {
721
773
  constructor(schema: TSchema, initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>, options?: ITreeConfigurationOptions);
774
+ readonly enableSchemaValidation: boolean;
722
775
  // (undocumented)
723
776
  readonly initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>;
724
- readonly options: Required<ITreeConfigurationOptions>;
725
777
  // (undocumented)
726
778
  readonly schema: TSchema;
727
779
  }
@@ -769,10 +821,10 @@ export interface TreeNodeApi {
769
821
  }
770
822
 
771
823
  // @public
772
- export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<FlexListToUnion<TSchema>> : unknown;
824
+ export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<InternalFlexListTypes.FlexListToUnion<TSchema>> : unknown;
773
825
 
774
826
  // @public
775
- export type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<FlexListToUnion<TSchema>> : unknown;
827
+ export type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<InternalFlexListTypes.FlexListToUnion<TSchema>> : unknown;
776
828
 
777
829
  // @public
778
830
  export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode = unknown, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown> = TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info> | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>;
@@ -815,18 +867,27 @@ export enum TreeStatus {
815
867
 
816
868
  // @public
817
869
  export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposable {
818
- readonly error?: SchemaIncompatible;
870
+ readonly compatibility: SchemaCompatibilityStatus;
819
871
  readonly events: Listenable<TreeViewEvents>;
872
+ initialize(content: InsertableTreeFieldFromImplicitField<TSchema>): void;
820
873
  get root(): TreeFieldFromImplicitField<TSchema>;
821
874
  set root(newRoot: InsertableTreeFieldFromImplicitField<TSchema>);
822
875
  upgradeSchema(): void;
823
876
  }
824
877
 
878
+ // @public
879
+ export class TreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
880
+ constructor(props: ITreeViewConfiguration<TSchema>);
881
+ readonly enableSchemaValidation: boolean;
882
+ readonly schema: TSchema;
883
+ }
884
+
825
885
  // @public
826
886
  export interface TreeViewEvents {
827
887
  afterBatch(): void;
828
888
  commitApplied(data: CommitMetadata, getRevertible?: RevertibleFactory): void;
829
889
  rootChanged(): void;
890
+ schemaChanged(): void;
830
891
  }
831
892
 
832
893
  // @public
@@ -35,7 +35,7 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
35
35
  export type AllowedTypes = readonly LazyItem<TreeNodeSchema>[];
36
36
 
37
37
  // @public
38
- export type ApplyKind<T, Kind extends FieldKind, DefaultsAreOptional extends boolean> = {
38
+ type ApplyKind<T, Kind extends FieldKind, DefaultsAreOptional extends boolean> = {
39
39
  [FieldKind.Required]: T;
40
40
  [FieldKind.Optional]: T | undefined;
41
41
  [FieldKind.Identifier]: DefaultsAreOptional extends true ? T | undefined : T;
@@ -100,7 +100,13 @@ export abstract class ErasedType<out Name = unknown> {
100
100
  }
101
101
 
102
102
  // @public
103
- export type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result ? Result : Item;
103
+ type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result ? Result : Item;
104
+
105
+ // @public
106
+ export type FieldHasDefault<T extends ImplicitFieldSchema> = T extends FieldSchema<FieldKind.Optional | FieldKind.Identifier> ? true : false;
107
+
108
+ // @public
109
+ export type FieldHasDefaultUnsafe<T extends Unenforced<ImplicitFieldSchema>> = T extends FieldSchemaUnsafe<FieldKind.Optional | FieldKind.Identifier, Unenforced<ImplicitAllowedTypes>> ? true : false;
104
110
 
105
111
  // @public
106
112
  export enum FieldKind {
@@ -131,11 +137,16 @@ export interface FieldSchemaUnsafe<out Kind extends FieldKind, out Types extends
131
137
  readonly kind: Kind;
132
138
  }
133
139
 
140
+ // @public
141
+ type FlattenKeys<T> = [{
142
+ [Property in keyof T]: T[Property];
143
+ }][_InlineTrick];
144
+
134
145
  // @public
135
146
  export type FlexList<Item = unknown> = readonly LazyItem<Item>[];
136
147
 
137
148
  // @public
138
- export type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
149
+ type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
139
150
 
140
151
  // @public
141
152
  export type FluidObject<T = unknown> = {
@@ -410,13 +421,20 @@ export type InitialObjects<T extends ContainerSchema> = {
410
421
  };
411
422
 
412
423
  // @public
413
- export type InsertableObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = {
414
- readonly [Property in keyof T]: InsertableTreeFieldFromImplicitField<T[Property]>;
415
- };
424
+ type _InlineTrick = 0;
425
+
426
+ // @public
427
+ export type InsertableObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = InternalUtilTypes.FlattenKeys<{
428
+ readonly [Property in keyof T]?: InsertableTreeFieldFromImplicitField<T[Property]>;
429
+ } & {
430
+ readonly [Property in keyof T as FieldHasDefault<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitField<T[Property]>;
431
+ }>;
416
432
 
417
433
  // @public
418
434
  export type InsertableObjectFromSchemaRecordUnsafe<T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>> = {
419
- readonly [Property in keyof T]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>;
435
+ readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>;
436
+ } & {
437
+ readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends true ? Property : never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>;
420
438
  };
421
439
 
422
440
  // @public
@@ -426,10 +444,10 @@ export type InsertableTreeFieldFromImplicitField<TSchema extends ImplicitFieldSc
426
444
  export type InsertableTreeFieldFromImplicitFieldUnsafe<TSchema extends Unenforced<ImplicitFieldSchema>> = TSchema extends FieldSchemaUnsafe<infer Kind, infer Types> ? ApplyKind<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind, true> : InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema>;
427
445
 
428
446
  // @public
429
- export type InsertableTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? InsertableTypedNode<TSchema> : TSchema extends AllowedTypes ? InsertableTypedNode<FlexListToUnion<TSchema>> : never;
447
+ export type InsertableTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? InsertableTypedNode<TSchema> : TSchema extends AllowedTypes ? InsertableTypedNode<InternalFlexListTypes.FlexListToUnion<TSchema>> : never;
430
448
 
431
449
  // @public
432
- export type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends AllowedTypes ? InsertableTypedNodeUnsafe<FlexListToUnion<TSchema>> : InsertableTypedNodeUnsafe<TSchema>;
450
+ export type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends AllowedTypes ? InsertableTypedNodeUnsafe<InternalFlexListTypes.FlexListToUnion<TSchema>> : InsertableTypedNodeUnsafe<TSchema>;
433
451
 
434
452
  // @public
435
453
  export type InsertableTypedNode<T extends TreeNodeSchema> = (T extends {
@@ -441,10 +459,33 @@ export type InsertableTypedNodeUnsafe<T extends Unenforced<TreeNodeSchema>> = Un
441
459
  implicitlyConstructable: true;
442
460
  } ? NodeBuilderDataUnsafe<T> : never);
443
461
 
462
+ declare namespace InternalFlexListTypes {
463
+ export {
464
+ FlexListToUnion,
465
+ ExtractItemType
466
+ }
467
+ }
468
+ export { InternalFlexListTypes }
469
+
470
+ declare namespace InternalSimpleTreeTypes {
471
+ export {
472
+ ApplyKind
473
+ }
474
+ }
475
+ export { InternalSimpleTreeTypes }
476
+
444
477
  // @public
445
478
  export interface InternalTreeNode extends ErasedType<"@fluidframework/tree.InternalTreeNode"> {
446
479
  }
447
480
 
481
+ declare namespace InternalUtilTypes {
482
+ export {
483
+ _InlineTrick,
484
+ FlattenKeys
485
+ }
486
+ }
487
+ export { InternalUtilTypes }
488
+
448
489
  // @public (undocumented)
449
490
  export interface IProvideFluidLoadable {
450
491
  // (undocumented)
@@ -482,7 +523,9 @@ export class IterableTreeArrayContent<T> implements Iterable<T> {
482
523
 
483
524
  // @public
484
525
  export interface ITree extends IFluidLoadable {
526
+ // @deprecated
485
527
  schematize<TRoot extends ImplicitFieldSchema>(config: TreeConfiguration<TRoot>): TreeView<TRoot>;
528
+ viewWith<TRoot extends ImplicitFieldSchema>(config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
486
529
  }
487
530
 
488
531
  // @public
@@ -490,6 +533,12 @@ export interface ITreeConfigurationOptions {
490
533
  enableSchemaValidation?: boolean;
491
534
  }
492
535
 
536
+ // @public
537
+ export interface ITreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> {
538
+ readonly enableSchemaValidation?: boolean;
539
+ readonly schema: TSchema;
540
+ }
541
+
493
542
  // @public
494
543
  export type LazyItem<Item = unknown> = Item | (() => Item);
495
544
 
@@ -603,6 +652,14 @@ export interface RunTransaction {
603
652
  readonly rollback: typeof rollback;
604
653
  }
605
654
 
655
+ // @public
656
+ export interface SchemaCompatibilityStatus {
657
+ readonly canInitialize: boolean;
658
+ readonly canUpgrade: boolean;
659
+ readonly canView: boolean;
660
+ readonly isEquivalent: boolean;
661
+ }
662
+
606
663
  // @public @sealed
607
664
  export class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> {
608
665
  constructor(scope: TScope);
@@ -625,7 +682,7 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
625
682
  readonly null: TreeNodeSchema<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null>;
626
683
  readonly number: TreeNodeSchema<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
627
684
  object<const Name extends TName, const T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
628
- objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordUnsafe<T>, false, T>;
685
+ objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & { readonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property]>; } & { readonly [Property_1 in keyof T as FieldHasDefaultUnsafe<T[Property_1]> extends true ? Property_1 : never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property_1]> | undefined; }, false, T>;
629
686
  optional<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchema<FieldKind.Optional, T>;
630
687
  optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
631
688
  required<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchema<FieldKind.Required, T>;
@@ -635,11 +692,6 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
635
692
  readonly string: TreeNodeSchema<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string>;
636
693
  }
637
694
 
638
- // @public
639
- export interface SchemaIncompatible {
640
- readonly canUpgrade: boolean;
641
- }
642
-
643
695
  // @public
644
696
  export type ScopedSchemaName<TScope extends string | undefined, TName extends number | string> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;
645
697
 
@@ -716,12 +768,12 @@ export interface TreeChangeEvents {
716
768
  treeChanged(): void;
717
769
  }
718
770
 
719
- // @public
771
+ // @public @deprecated
720
772
  export class TreeConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> {
721
773
  constructor(schema: TSchema, initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>, options?: ITreeConfigurationOptions);
774
+ readonly enableSchemaValidation: boolean;
722
775
  // (undocumented)
723
776
  readonly initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>;
724
- readonly options: Required<ITreeConfigurationOptions>;
725
777
  // (undocumented)
726
778
  readonly schema: TSchema;
727
779
  }
@@ -769,10 +821,10 @@ export interface TreeNodeApi {
769
821
  }
770
822
 
771
823
  // @public
772
- export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<FlexListToUnion<TSchema>> : unknown;
824
+ export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<InternalFlexListTypes.FlexListToUnion<TSchema>> : unknown;
773
825
 
774
826
  // @public
775
- export type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<FlexListToUnion<TSchema>> : unknown;
827
+ export type TreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends Unenforced<ImplicitAllowedTypes>> = TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<InternalFlexListTypes.FlexListToUnion<TSchema>> : unknown;
776
828
 
777
829
  // @public
778
830
  export type TreeNodeSchema<Name extends string = string, Kind extends NodeKind = NodeKind, TNode = unknown, TBuild = never, ImplicitlyConstructable extends boolean = boolean, Info = unknown> = TreeNodeSchemaClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info> | TreeNodeSchemaNonClass<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>;
@@ -815,18 +867,27 @@ export enum TreeStatus {
815
867
 
816
868
  // @public
817
869
  export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposable {
818
- readonly error?: SchemaIncompatible;
870
+ readonly compatibility: SchemaCompatibilityStatus;
819
871
  readonly events: Listenable<TreeViewEvents>;
872
+ initialize(content: InsertableTreeFieldFromImplicitField<TSchema>): void;
820
873
  get root(): TreeFieldFromImplicitField<TSchema>;
821
874
  set root(newRoot: InsertableTreeFieldFromImplicitField<TSchema>);
822
875
  upgradeSchema(): void;
823
876
  }
824
877
 
878
+ // @public
879
+ export class TreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
880
+ constructor(props: ITreeViewConfiguration<TSchema>);
881
+ readonly enableSchemaValidation: boolean;
882
+ readonly schema: TSchema;
883
+ }
884
+
825
885
  // @public
826
886
  export interface TreeViewEvents {
827
887
  afterBatch(): void;
828
888
  commitApplied(data: CommitMetadata, getRevertible?: RevertibleFactory): void;
829
889
  rootChanged(): void;
890
+ schemaChanged(): void;
830
891
  }
831
892
 
832
893
  // @public
package/biome.jsonc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3
+ "extends": ["../../../biome.jsonc"]
4
+ }
package/dist/legacy.d.ts CHANGED
@@ -9,9 +9,13 @@
9
9
  */
10
10
 
11
11
  export {
12
+ // Unrestricted APIs
13
+ InternalFlexListTypes,
14
+ InternalSimpleTreeTypes,
15
+ InternalUtilTypes,
16
+
12
17
  // @public APIs
13
18
  AllowedTypes,
14
- ApplyKind,
15
19
  AttachState,
16
20
  CommitKind,
17
21
  CommitMetadata,
@@ -21,13 +25,13 @@ export {
21
25
  ContainerSchema,
22
26
  DefaultProvider,
23
27
  ErasedType,
24
- ExtractItemType,
28
+ FieldHasDefault,
29
+ FieldHasDefaultUnsafe,
25
30
  FieldKind,
26
31
  FieldProps,
27
32
  FieldSchema,
28
33
  FieldSchemaUnsafe,
29
34
  FlexList,
30
- FlexListToUnion,
31
35
  FluidObject,
32
36
  FluidObjectProviderKeys,
33
37
  IConnection,
@@ -51,6 +55,7 @@ export {
51
55
  ITelemetryBaseProperties,
52
56
  ITree,
53
57
  ITreeConfigurationOptions,
58
+ ITreeViewConfiguration,
54
59
  ImplicitAllowedTypes,
55
60
  ImplicitFieldSchema,
56
61
  InitialObjects,
@@ -86,8 +91,8 @@ export {
86
91
  RevertibleFactory,
87
92
  RevertibleStatus,
88
93
  RunTransaction,
94
+ SchemaCompatibilityStatus,
89
95
  SchemaFactory,
90
- SchemaIncompatible,
91
96
  ScopedSchemaName,
92
97
  SharedObjectKind,
93
98
  SharedTree,
@@ -119,6 +124,7 @@ export {
119
124
  TreeObjectNodeUnsafe,
120
125
  TreeStatus,
121
126
  TreeView,
127
+ TreeViewConfiguration,
122
128
  TreeViewEvents,
123
129
  Unenforced,
124
130
  Unhydrated,
package/dist/public.d.ts CHANGED
@@ -9,9 +9,13 @@
9
9
  */
10
10
 
11
11
  export {
12
+ // Unrestricted APIs
13
+ InternalFlexListTypes,
14
+ InternalSimpleTreeTypes,
15
+ InternalUtilTypes,
16
+
12
17
  // @public APIs
13
18
  AllowedTypes,
14
- ApplyKind,
15
19
  AttachState,
16
20
  CommitKind,
17
21
  CommitMetadata,
@@ -21,13 +25,13 @@ export {
21
25
  ContainerSchema,
22
26
  DefaultProvider,
23
27
  ErasedType,
24
- ExtractItemType,
28
+ FieldHasDefault,
29
+ FieldHasDefaultUnsafe,
25
30
  FieldKind,
26
31
  FieldProps,
27
32
  FieldSchema,
28
33
  FieldSchemaUnsafe,
29
34
  FlexList,
30
- FlexListToUnion,
31
35
  FluidObject,
32
36
  FluidObjectProviderKeys,
33
37
  IConnection,
@@ -51,6 +55,7 @@ export {
51
55
  ITelemetryBaseProperties,
52
56
  ITree,
53
57
  ITreeConfigurationOptions,
58
+ ITreeViewConfiguration,
54
59
  ImplicitAllowedTypes,
55
60
  ImplicitFieldSchema,
56
61
  InitialObjects,
@@ -86,8 +91,8 @@ export {
86
91
  RevertibleFactory,
87
92
  RevertibleStatus,
88
93
  RunTransaction,
94
+ SchemaCompatibilityStatus,
89
95
  SchemaFactory,
90
- SchemaIncompatible,
91
96
  ScopedSchemaName,
92
97
  SharedObjectKind,
93
98
  SharedTree,
@@ -119,6 +124,7 @@ export {
119
124
  TreeObjectNodeUnsafe,
120
125
  TreeStatus,
121
126
  TreeView,
127
+ TreeViewConfiguration,
122
128
  TreeViewEvents,
123
129
  Unenforced,
124
130
  Unhydrated,
package/lib/legacy.d.ts CHANGED
@@ -9,9 +9,13 @@
9
9
  */
10
10
 
11
11
  export {
12
+ // Unrestricted APIs
13
+ InternalFlexListTypes,
14
+ InternalSimpleTreeTypes,
15
+ InternalUtilTypes,
16
+
12
17
  // @public APIs
13
18
  AllowedTypes,
14
- ApplyKind,
15
19
  AttachState,
16
20
  CommitKind,
17
21
  CommitMetadata,
@@ -21,13 +25,13 @@ export {
21
25
  ContainerSchema,
22
26
  DefaultProvider,
23
27
  ErasedType,
24
- ExtractItemType,
28
+ FieldHasDefault,
29
+ FieldHasDefaultUnsafe,
25
30
  FieldKind,
26
31
  FieldProps,
27
32
  FieldSchema,
28
33
  FieldSchemaUnsafe,
29
34
  FlexList,
30
- FlexListToUnion,
31
35
  FluidObject,
32
36
  FluidObjectProviderKeys,
33
37
  IConnection,
@@ -51,6 +55,7 @@ export {
51
55
  ITelemetryBaseProperties,
52
56
  ITree,
53
57
  ITreeConfigurationOptions,
58
+ ITreeViewConfiguration,
54
59
  ImplicitAllowedTypes,
55
60
  ImplicitFieldSchema,
56
61
  InitialObjects,
@@ -86,8 +91,8 @@ export {
86
91
  RevertibleFactory,
87
92
  RevertibleStatus,
88
93
  RunTransaction,
94
+ SchemaCompatibilityStatus,
89
95
  SchemaFactory,
90
- SchemaIncompatible,
91
96
  ScopedSchemaName,
92
97
  SharedObjectKind,
93
98
  SharedTree,
@@ -119,6 +124,7 @@ export {
119
124
  TreeObjectNodeUnsafe,
120
125
  TreeStatus,
121
126
  TreeView,
127
+ TreeViewConfiguration,
122
128
  TreeViewEvents,
123
129
  Unenforced,
124
130
  Unhydrated,
package/lib/public.d.ts CHANGED
@@ -9,9 +9,13 @@
9
9
  */
10
10
 
11
11
  export {
12
+ // Unrestricted APIs
13
+ InternalFlexListTypes,
14
+ InternalSimpleTreeTypes,
15
+ InternalUtilTypes,
16
+
12
17
  // @public APIs
13
18
  AllowedTypes,
14
- ApplyKind,
15
19
  AttachState,
16
20
  CommitKind,
17
21
  CommitMetadata,
@@ -21,13 +25,13 @@ export {
21
25
  ContainerSchema,
22
26
  DefaultProvider,
23
27
  ErasedType,
24
- ExtractItemType,
28
+ FieldHasDefault,
29
+ FieldHasDefaultUnsafe,
25
30
  FieldKind,
26
31
  FieldProps,
27
32
  FieldSchema,
28
33
  FieldSchemaUnsafe,
29
34
  FlexList,
30
- FlexListToUnion,
31
35
  FluidObject,
32
36
  FluidObjectProviderKeys,
33
37
  IConnection,
@@ -51,6 +55,7 @@ export {
51
55
  ITelemetryBaseProperties,
52
56
  ITree,
53
57
  ITreeConfigurationOptions,
58
+ ITreeViewConfiguration,
54
59
  ImplicitAllowedTypes,
55
60
  ImplicitFieldSchema,
56
61
  InitialObjects,
@@ -86,8 +91,8 @@ export {
86
91
  RevertibleFactory,
87
92
  RevertibleStatus,
88
93
  RunTransaction,
94
+ SchemaCompatibilityStatus,
89
95
  SchemaFactory,
90
- SchemaIncompatible,
91
96
  ScopedSchemaName,
92
97
  SharedObjectKind,
93
98
  SharedTree,
@@ -119,6 +124,7 @@ export {
119
124
  TreeObjectNodeUnsafe,
120
125
  TreeStatus,
121
126
  TreeView,
127
+ TreeViewConfiguration,
122
128
  TreeViewEvents,
123
129
  Unenforced,
124
130
  Unhydrated,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluid-framework",
3
- "version": "2.0.0-dev-rc.5.0.0.270401",
3
+ "version": "2.0.0-dev-rc.5.0.0.271045",
4
4
  "description": "The main entry point into Fluid Framework public packages",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -37,22 +37,22 @@
37
37
  "main": "lib/index.js",
38
38
  "types": "lib/public.d.ts",
39
39
  "dependencies": {
40
- "@fluidframework/container-definitions": "2.0.0-dev-rc.5.0.0.270401",
41
- "@fluidframework/container-loader": "2.0.0-dev-rc.5.0.0.270401",
42
- "@fluidframework/core-interfaces": "2.0.0-dev-rc.5.0.0.270401",
43
- "@fluidframework/driver-definitions": "2.0.0-dev-rc.5.0.0.270401",
44
- "@fluidframework/fluid-static": "2.0.0-dev-rc.5.0.0.270401",
45
- "@fluidframework/map": "2.0.0-dev-rc.5.0.0.270401",
46
- "@fluidframework/sequence": "2.0.0-dev-rc.5.0.0.270401",
47
- "@fluidframework/shared-object-base": "2.0.0-dev-rc.5.0.0.270401",
48
- "@fluidframework/tree": "2.0.0-dev-rc.5.0.0.270401"
40
+ "@fluidframework/container-definitions": "2.0.0-dev-rc.5.0.0.271045",
41
+ "@fluidframework/container-loader": "2.0.0-dev-rc.5.0.0.271045",
42
+ "@fluidframework/core-interfaces": "2.0.0-dev-rc.5.0.0.271045",
43
+ "@fluidframework/driver-definitions": "2.0.0-dev-rc.5.0.0.271045",
44
+ "@fluidframework/fluid-static": "2.0.0-dev-rc.5.0.0.271045",
45
+ "@fluidframework/map": "2.0.0-dev-rc.5.0.0.271045",
46
+ "@fluidframework/sequence": "2.0.0-dev-rc.5.0.0.271045",
47
+ "@fluidframework/shared-object-base": "2.0.0-dev-rc.5.0.0.271045",
48
+ "@fluidframework/tree": "2.0.0-dev-rc.5.0.0.271045"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@arethetypeswrong/cli": "^0.15.2",
52
52
  "@biomejs/biome": "^1.7.3",
53
- "@fluid-tools/build-cli": "^0.39.0-264124",
53
+ "@fluid-tools/build-cli": "^0.39.0",
54
54
  "@fluidframework/build-common": "^2.0.3",
55
- "@fluidframework/build-tools": "^0.39.0-264124",
55
+ "@fluidframework/build-tools": "^0.39.0",
56
56
  "@fluidframework/eslint-config-fluid": "^5.3.0",
57
57
  "@microsoft/api-extractor": "^7.45.1",
58
58
  "@types/node": "^18.19.0",
@@ -83,13 +83,16 @@
83
83
  "build:docs": "api-extractor run --local",
84
84
  "build:esnext": "tsc --project ./tsconfig.json",
85
85
  "check:are-the-types-wrong": "attw --pack .",
86
+ "check:biome": "biome check . --formatter-enabled=true",
87
+ "check:format": "npm run check:prettier",
86
88
  "check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
87
89
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
88
90
  "ci:build:docs": "api-extractor run",
89
91
  "clean": "rimraf --glob _api-extractor-temp dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\"",
90
92
  "eslint": "eslint --format stylish src",
91
93
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
92
- "format": "fluid-build --task format .",
94
+ "format": "npm run format:prettier",
95
+ "format:biome": "biome check . --formatter-enabled=true --apply",
93
96
  "format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
94
97
  "lint": "fluid-build . --task lint",
95
98
  "lint:fix": "fluid-build . --task eslint:fix --task format",