@fluidframework/tree 2.0.0-dev-rc.1.0.0.228517 → 2.0.0-rc.1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/api-report/tree.api.md +11 -6
  2. package/dist/class-tree/index.d.ts +1 -1
  3. package/dist/class-tree/index.d.ts.map +1 -1
  4. package/dist/class-tree/index.js.map +1 -1
  5. package/dist/class-tree/tree.d.ts +13 -3
  6. package/dist/class-tree/tree.d.ts.map +1 -1
  7. package/dist/class-tree/tree.js.map +1 -1
  8. package/dist/core/revertible/revertible.d.ts +4 -4
  9. package/dist/core/revertible/revertible.js +3 -3
  10. package/dist/core/revertible/revertible.js.map +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/packageVersion.d.ts +1 -1
  15. package/dist/packageVersion.d.ts.map +1 -1
  16. package/dist/packageVersion.js +1 -1
  17. package/dist/packageVersion.js.map +1 -1
  18. package/dist/shared-tree/treeCheckout.d.ts +2 -2
  19. package/dist/shared-tree/treeCheckout.js.map +1 -1
  20. package/dist/tree-alpha.d.ts +17 -91
  21. package/dist/tree-beta.d.ts +17 -91
  22. package/dist/tree-public.d.ts +17 -91
  23. package/dist/tree-untrimmed.d.ts +18 -7
  24. package/lib/class-tree/index.d.ts +1 -1
  25. package/lib/class-tree/index.d.ts.map +1 -1
  26. package/lib/class-tree/index.js.map +1 -1
  27. package/lib/class-tree/tree.d.ts +13 -3
  28. package/lib/class-tree/tree.d.ts.map +1 -1
  29. package/lib/class-tree/tree.js.map +1 -1
  30. package/lib/core/revertible/revertible.d.ts +4 -4
  31. package/lib/core/revertible/revertible.js +3 -3
  32. package/lib/core/revertible/revertible.js.map +1 -1
  33. package/lib/index.d.ts +1 -1
  34. package/lib/index.d.ts.map +1 -1
  35. package/lib/index.js.map +1 -1
  36. package/lib/packageVersion.d.ts +1 -1
  37. package/lib/packageVersion.d.ts.map +1 -1
  38. package/lib/packageVersion.js +1 -1
  39. package/lib/packageVersion.js.map +1 -1
  40. package/lib/shared-tree/treeCheckout.d.ts +2 -2
  41. package/lib/shared-tree/treeCheckout.js.map +1 -1
  42. package/package.json +19 -19
  43. package/src/class-tree/index.ts +1 -1
  44. package/src/class-tree/tree.ts +14 -3
  45. package/src/core/revertible/revertible.ts +4 -4
  46. package/src/index.ts +1 -0
  47. package/src/packageVersion.ts +1 -1
  48. package/src/shared-tree/treeCheckout.ts +2 -2
@@ -202,7 +202,7 @@ export function buildTreeConfiguration<T extends TreeFieldSchema>(config: Initia
202
202
  // @internal
203
203
  export type ChangesetLocalId = Brand<number, "ChangesetLocalId">;
204
204
 
205
- // @public
205
+ // @internal
206
206
  export interface CheckoutEvents {
207
207
  afterBatch(): void;
208
208
  revertible(revertible: Revertible): void;
@@ -395,7 +395,7 @@ export type DetachedPlaceUpPath = Brand<Omit<PlaceUpPath, "parent">, "DetachedRa
395
395
  // @internal
396
396
  export type DetachedRangeUpPath = Brand<Omit<RangeUpPath, "parent">, "DetachedRangeUpPath">;
397
397
 
398
- // @public
398
+ // @internal
399
399
  export enum DiscardResult {
400
400
  Failure = 1,
401
401
  Success = 0
@@ -1368,7 +1368,7 @@ export type RestrictiveReadonlyRecord<K extends symbol | string, T> = {
1368
1368
  readonly [P in symbol | string]: P extends K ? T : never;
1369
1369
  };
1370
1370
 
1371
- // @public
1371
+ // @internal
1372
1372
  export interface Revertible {
1373
1373
  discard(): DiscardResult;
1374
1374
  readonly kind: RevertibleKind;
@@ -1378,7 +1378,7 @@ export interface Revertible {
1378
1378
  revert(): RevertResult;
1379
1379
  }
1380
1380
 
1381
- // @public
1381
+ // @internal
1382
1382
  export enum RevertibleKind {
1383
1383
  Default = 0,
1384
1384
  Rebase = 3,
@@ -1386,7 +1386,7 @@ export enum RevertibleKind {
1386
1386
  Undo = 1
1387
1387
  }
1388
1388
 
1389
- // @public
1389
+ // @internal
1390
1390
  export enum RevertResult {
1391
1391
  Failure = 1,
1392
1392
  Success = 0
@@ -1893,10 +1893,15 @@ export type TreeValue<TSchema extends ValueSchema = ValueSchema> = [
1893
1893
 
1894
1894
  // @public
1895
1895
  export interface TreeView<in out TRoot> extends IDisposable {
1896
- readonly events: ISubscribable<CheckoutEvents>;
1896
+ readonly events: ISubscribable<TreeViewEvents>;
1897
1897
  readonly root: TRoot;
1898
1898
  }
1899
1899
 
1900
+ // @public
1901
+ export interface TreeViewEvents {
1902
+ afterBatch(): void;
1903
+ }
1904
+
1900
1905
  // @public
1901
1906
  export const type: unique symbol;
1902
1907
 
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { ITree, TreeView, TreeConfiguration, WrapperTreeView } from "./tree";
5
+ export { ITree, TreeView, TreeViewEvents, TreeConfiguration, WrapperTreeView } from "./tree";
6
6
  export { TreeNodeSchema, NodeFromSchema, NodeKind, TreeNodeSchemaClass, TreeNodeSchemaNonClass, TreeNodeSchemaCore, ImplicitFieldSchema, TreeFieldFromImplicitField, ImplicitAllowedTypes, TreeNodeFromImplicitAllowedTypes, InsertableTreeNodeFromImplicitAllowedTypes, TreeMapNode, TreeLeafValue, type, WithType, AllowedTypes, ApplyKind, FieldKind, FieldSchema, InsertableObjectFromSchemaRecord, InsertableTreeFieldFromImplicitField, InsertableTypedNode, NodeBuilderData, ObjectFromSchemaRecord, } from "./schemaTypes";
7
7
  export { SchemaFactory } from "./schemaFactory";
8
8
  export { nodeApi as Tree, TreeApi, TreeNodeEvents } from "./treeApi";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/class-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC7E,OAAO,EACN,cAAc,EACd,cAAc,EACd,QAAQ,EACR,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,gCAAgC,EAChC,0CAA0C,EAC1C,WAAW,EACX,aAAa,EACb,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,SAAS,EACT,WAAW,EACX,gCAAgC,EAChC,oCAAoC,EACpC,mBAAmB,EACnB,eAAe,EACf,sBAAsB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,EACf,iBAAiB,GACjB,MAAM,2BAA2B,CAAC;AAInC,OAAO,EACN,eAAe,IAAI,oBAAoB,EACvC,IAAI,IAAI,yBAAyB,GACjC,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/class-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC7F,OAAO,EACN,cAAc,EACd,cAAc,EACd,QAAQ,EACR,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,gCAAgC,EAChC,0CAA0C,EAC1C,WAAW,EACX,aAAa,EACb,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,SAAS,EACT,WAAW,EACX,gCAAgC,EAChC,oCAAoC,EACpC,mBAAmB,EACnB,eAAe,EACf,sBAAsB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,EACf,iBAAiB,GACjB,MAAM,2BAA2B,CAAC;AAInC,OAAO,EACN,eAAe,IAAI,oBAAoB,EACvC,IAAI,IAAI,yBAAyB,GACjC,MAAM,uBAAuB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/class-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAA6E;AAAnD,yGAAA,iBAAiB,OAAA;AAAE,uGAAA,eAAe,OAAA;AAC5D,6CAyBuB;AAtBtB,uGAAA,QAAQ,OAAA;AAWR,mGAAA,IAAI,OAAA;AAIJ,wGAAA,SAAS,OAAA;AACT,0GAAA,WAAW,OAAA;AAOZ,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,qCAAqE;AAA5D,+FAAA,OAAO,OAAQ;AACxB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAE/B,qEAKmC;AAJlC,oHAAA,SAAS,OAAA;AACT,0HAAA,eAAe,OAAA;AACf,0HAAA,eAAe,OAAA;AACf,4HAAA,iBAAiB,OAAA;AAGlB,6FAA6F;AAC7F,4IAA4I;AAC5I,6DAG+B;AAF9B,2HAAA,eAAe,OAAwB;AACvC,gIAAA,IAAI,OAA6B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ITree, TreeView, TreeConfiguration, WrapperTreeView } from \"./tree\";\nexport {\n\tTreeNodeSchema,\n\tNodeFromSchema,\n\tNodeKind,\n\tTreeNodeSchemaClass,\n\tTreeNodeSchemaNonClass,\n\tTreeNodeSchemaCore,\n\tImplicitFieldSchema,\n\tTreeFieldFromImplicitField,\n\tImplicitAllowedTypes,\n\tTreeNodeFromImplicitAllowedTypes,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n\tTreeMapNode,\n\tTreeLeafValue,\n\ttype,\n\tWithType,\n\tAllowedTypes,\n\tApplyKind,\n\tFieldKind,\n\tFieldSchema,\n\tInsertableObjectFromSchemaRecord,\n\tInsertableTreeFieldFromImplicitField,\n\tInsertableTypedNode,\n\tNodeBuilderData,\n\tObjectFromSchemaRecord,\n} from \"./schemaTypes\";\nexport { SchemaFactory } from \"./schemaFactory\";\nexport { nodeApi as Tree, TreeApi, TreeNodeEvents } from \"./treeApi\";\nexport { toFlexConfig } from \"./toFlexSchema\";\nexport { SchemaFactoryRecursive } from \"./schemaFactoryRecursive\";\n\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttypedObjectValues,\n} from \"./schemaCreationUtilities\";\n\n// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.\n// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\tRecursiveObject as test_RecursiveObject,\n\tbase as test_RecursiveObject_base,\n} from \"./testRecursiveDomain\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/class-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAA6F;AAAnD,yGAAA,iBAAiB,OAAA;AAAE,uGAAA,eAAe,OAAA;AAC5E,6CAyBuB;AAtBtB,uGAAA,QAAQ,OAAA;AAWR,mGAAA,IAAI,OAAA;AAIJ,wGAAA,SAAS,OAAA;AACT,0GAAA,WAAW,OAAA;AAOZ,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,qCAAqE;AAA5D,+FAAA,OAAO,OAAQ;AACxB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAE/B,qEAKmC;AAJlC,oHAAA,SAAS,OAAA;AACT,0HAAA,eAAe,OAAA;AACf,0HAAA,eAAe,OAAA;AACf,4HAAA,iBAAiB,OAAA;AAGlB,6FAA6F;AAC7F,4IAA4I;AAC5I,6DAG+B;AAF9B,2HAAA,eAAe,OAAwB;AACvC,gIAAA,IAAI,OAA6B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ITree, TreeView, TreeViewEvents, TreeConfiguration, WrapperTreeView } from \"./tree\";\nexport {\n\tTreeNodeSchema,\n\tNodeFromSchema,\n\tNodeKind,\n\tTreeNodeSchemaClass,\n\tTreeNodeSchemaNonClass,\n\tTreeNodeSchemaCore,\n\tImplicitFieldSchema,\n\tTreeFieldFromImplicitField,\n\tImplicitAllowedTypes,\n\tTreeNodeFromImplicitAllowedTypes,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n\tTreeMapNode,\n\tTreeLeafValue,\n\ttype,\n\tWithType,\n\tAllowedTypes,\n\tApplyKind,\n\tFieldKind,\n\tFieldSchema,\n\tInsertableObjectFromSchemaRecord,\n\tInsertableTreeFieldFromImplicitField,\n\tInsertableTypedNode,\n\tNodeBuilderData,\n\tObjectFromSchemaRecord,\n} from \"./schemaTypes\";\nexport { SchemaFactory } from \"./schemaFactory\";\nexport { nodeApi as Tree, TreeApi, TreeNodeEvents } from \"./treeApi\";\nexport { toFlexConfig } from \"./toFlexSchema\";\nexport { SchemaFactoryRecursive } from \"./schemaFactoryRecursive\";\n\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttypedObjectValues,\n} from \"./schemaCreationUtilities\";\n\n// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.\n// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\tRecursiveObject as test_RecursiveObject,\n\tbase as test_RecursiveObject_base,\n} from \"./testRecursiveDomain\";\n"]}
@@ -5,7 +5,7 @@
5
5
  import { IChannel } from "@fluidframework/datastore-definitions";
6
6
  import { ISubscribable } from "../events";
7
7
  import { IDisposable, disposeSymbol } from "../util";
8
- import { FlexTreeView, type CheckoutEvents } from "../shared-tree";
8
+ import { FlexTreeView } from "../shared-tree";
9
9
  import { TreeFieldSchema as FlexTreeFieldSchema } from "../feature-libraries";
10
10
  import { ImplicitFieldSchema, InsertableTreeFieldFromImplicitField, TreeFieldFromImplicitField } from "./schemaTypes";
11
11
  /**
@@ -83,7 +83,17 @@ export interface TreeView<in out TRoot> extends IDisposable {
83
83
  /**
84
84
  * Events for the tree.
85
85
  */
86
- readonly events: ISubscribable<CheckoutEvents>;
86
+ readonly events: ISubscribable<TreeViewEvents>;
87
+ }
88
+ /**
89
+ * Events for {@link TreeView}.
90
+ * @public
91
+ */
92
+ export interface TreeViewEvents {
93
+ /**
94
+ * A batch of changes has finished processing and the view has been updated.
95
+ */
96
+ afterBatch(): void;
87
97
  }
88
98
  /**
89
99
  * Implementation of TreeView wrapping a FlexTreeView.
@@ -92,7 +102,7 @@ export declare class WrapperTreeView<in out TSchema extends ImplicitFieldSchema,
92
102
  readonly view: TView;
93
103
  constructor(view: TView);
94
104
  [disposeSymbol](): void;
95
- get events(): ISubscribable<CheckoutEvents>;
105
+ get events(): ISubscribable<TreeViewEvents>;
96
106
  get root(): TreeFieldFromImplicitField<TSchema>;
97
107
  }
98
108
  //# sourceMappingURL=tree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/class-tree/tree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OA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AAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAwC,CAAC;IACxF,CAAC;CACD;AAlBD,0CAkBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IChannel } from \"@fluidframework/datastore-definitions\";\nimport { ISubscribable } from \"../events\";\nimport { IDisposable, disposeSymbol } from \"../util\";\nimport { FlexTreeView, type CheckoutEvents } from \"../shared-tree\";\nimport { getProxyForField } from \"../simple-tree\";\nimport { TreeFieldSchema as FlexTreeFieldSchema } from \"../feature-libraries\";\nimport {\n\tImplicitFieldSchema,\n\tInsertableTreeFieldFromImplicitField,\n\tTreeFieldFromImplicitField,\n} from \"./schemaTypes\";\n\n/**\n * Channel for a Fluid Tree DDS.\n * @remarks\n * Allows storing and collaboratively editing schema-aware hierarchial data.\n * @public\n */\nexport interface ITree extends IChannel {\n\t/**\n\t * Returns a tree that is known to be compatible with the provided schema. The returned tree exposes an API that is schema-aware.\n\t *\n\t * @remarks\n\t * If the tree is uninitialized (has no schema and no content), the tree is initialized with the `initialTree` and\n\t * view `schema` in the provided `config`.\n\t *\n\t * The tree (now known to have been initialized) has its stored schema checked against the provided view schema.\n\t *\n\t * If the schemas are compatible (including updating the stored schema if permitted via `allowedSchemaModifications`),\n\t * a {@link TreeView} is returned, with a schema-aware API based on the provided view schema.\n\t *\n\t * If the schemas are not compatible, an exception is thrown.\n\t *\n\t * @privateRemarks\n\t * TODO: make the mismatch case recoverable.\n\t * - Provide a way to make a generic view schema for any document.\n\t * - Produce/throw the error in a document-recoverable way (ex: specific exception type or return value).\n\t * TODO: Document and handle what happens when the stored schema changes after schematize has returned. Is some invalidation contract needed? How does editable tree behave?\n\t * TODO: Clarify lifetimes. Ensure calling schematize multiple times does not leak.\n\t * TODO: Support adapters for handling out-of-schema data.\n\t *\n\t * Doing initialization here, regardless of `AllowedUpdateType`, allows a small API that is hard to use incorrectly.\n\t * Other approaches tend to have easy-to-make mistakes.\n\t * For example, having a separate initialization function means apps can forget to call it, making an app that can only open existing documents,\n\t * or call it unconditionally leaving an app that can only create new documents.\n\t * It also would require the schema to be passed into separate places and could cause issues if they didn't match.\n\t * Since the initialization function couldn't return a typed tree, the type checking wouldn't help catch that.\n\t * Also, if an app manages to create a document, but the initialization fails to get persisted, an app that only calls the initialization function\n\t * on the create code-path (for example how a schematized factory might do it),\n\t * would leave the document in an unusable state which could not be repaired when it is reopened (by the same or other clients).\n\t * Additionally, once out of schema content adapters are properly supported (with lazy document updates),\n\t * this initialization could become just another out of schema content adapter: at that point it clearly belongs here in schematize.\n\t */\n\tschematize<TRoot extends ImplicitFieldSchema>(\n\t\tconfig: TreeConfiguration<TRoot>,\n\t): TreeView<TreeFieldFromImplicitField<TRoot>>;\n}\n\n/**\n * Configuration for how to {@link ITree.schematize|schematize} a tree.\n * @public\n */\nexport class TreeConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> {\n\t/**\n\t * @param schema - The schema which the application wants to view the tree with.\n\t * @param initialTree - A function that returns the default tree content to initialize the tree with iff the tree is uninitialized\n\t * (meaning it does not even have any schema set at all).\n\t * If `initialTree` returns any actual node instances, they should be recreated each time `initialTree` runs.\n\t * This is because if the config is used a second time any nodes that were not recreated could error since nodes cannot be inserted into the tree multiple times.\n\t */\n\tpublic constructor(\n\t\tpublic readonly schema: TSchema,\n\t\tpublic readonly initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>,\n\t) {}\n}\n\n/**\n * An editable view of a (version control style) branch of a shared tree.\n * @privateRemarks\n * This is a wrapper around ITreeView that adjusted it for the public package API.\n * TODO:\n * Establish a naming conversion between these internal and wrapper types.\n * @public\n */\nexport interface TreeView<in out TRoot> extends IDisposable {\n\t/**\n\t * The current root of the tree.\n\t */\n\treadonly root: TRoot;\n\n\t/**\n\t * Events for the tree.\n\t */\n\treadonly events: ISubscribable<CheckoutEvents>;\n}\n\n/**\n * Implementation of TreeView wrapping a FlexTreeView.\n */\nexport class WrapperTreeView<\n\tin out TSchema extends ImplicitFieldSchema,\n\tTView extends FlexTreeView<FlexTreeFieldSchema>,\n> implements TreeView<TreeFieldFromImplicitField<TSchema>>\n{\n\tpublic constructor(public readonly view: TView) {}\n\n\tpublic [disposeSymbol](): void {\n\t\tthis.view[disposeSymbol]();\n\t}\n\n\tpublic get events(): ISubscribable<CheckoutEvents> {\n\t\treturn this.view.checkout.events;\n\t}\n\n\tpublic get root(): TreeFieldFromImplicitField<TSchema> {\n\t\treturn getProxyForField(this.view.editableTree) as TreeFieldFromImplicitField<TSchema>;\n\t}\n}\n"]}
1
+ {"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/class-tree/tree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,kCAAqD;AAErD,gDAAkD;AAsDlD;;;GAGG;AACH,MAAa,iBAAiB;IAC7B;;;;;;OAMG;IACH,YACiB,MAAe,EACf,WAAgE;QADhE,WAAM,GAAN,MAAM,CAAS;QACf,gBAAW,GAAX,WAAW,CAAqD;IAC9E,CAAC;CACJ;AAZD,8CAYC;AAiCD;;GAEG;AACH,MAAa,eAAe;IAK3B,YAAmC,IAAW;QAAX,SAAI,GAAJ,IAAI,CAAO;IAAG,CAAC;IAE3C,CAAC,oBAAa,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,oBAAa,CAAC,EAAE,CAAC;IAC5B,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;IAClC,CAAC;IAED,IAAW,IAAI;QACd,OAAO,IAAA,8BAAgB,EAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAwC,CAAC;IACxF,CAAC;CACD;AAlBD,0CAkBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IChannel } from \"@fluidframework/datastore-definitions\";\nimport { ISubscribable } from \"../events\";\nimport { IDisposable, disposeSymbol } from \"../util\";\nimport { FlexTreeView } from \"../shared-tree\";\nimport { getProxyForField } from \"../simple-tree\";\nimport { TreeFieldSchema as FlexTreeFieldSchema } from \"../feature-libraries\";\nimport {\n\tImplicitFieldSchema,\n\tInsertableTreeFieldFromImplicitField,\n\tTreeFieldFromImplicitField,\n} from \"./schemaTypes\";\n\n/**\n * Channel for a Fluid Tree DDS.\n * @remarks\n * Allows storing and collaboratively editing schema-aware hierarchial data.\n * @public\n */\nexport interface ITree extends IChannel {\n\t/**\n\t * Returns a tree that is known to be compatible with the provided schema. The returned tree exposes an API that is schema-aware.\n\t *\n\t * @remarks\n\t * If the tree is uninitialized (has no schema and no content), the tree is initialized with the `initialTree` and\n\t * view `schema` in the provided `config`.\n\t *\n\t * The tree (now known to have been initialized) has its stored schema checked against the provided view schema.\n\t *\n\t * If the schemas are compatible (including updating the stored schema if permitted via `allowedSchemaModifications`),\n\t * a {@link TreeView} is returned, with a schema-aware API based on the provided view schema.\n\t *\n\t * If the schemas are not compatible, an exception is thrown.\n\t *\n\t * @privateRemarks\n\t * TODO: make the mismatch case recoverable.\n\t * - Provide a way to make a generic view schema for any document.\n\t * - Produce/throw the error in a document-recoverable way (ex: specific exception type or return value).\n\t * TODO: Document and handle what happens when the stored schema changes after schematize has returned. Is some invalidation contract needed? How does editable tree behave?\n\t * TODO: Clarify lifetimes. Ensure calling schematize multiple times does not leak.\n\t * TODO: Support adapters for handling out-of-schema data.\n\t *\n\t * Doing initialization here, regardless of `AllowedUpdateType`, allows a small API that is hard to use incorrectly.\n\t * Other approaches tend to have easy-to-make mistakes.\n\t * For example, having a separate initialization function means apps can forget to call it, making an app that can only open existing documents,\n\t * or call it unconditionally leaving an app that can only create new documents.\n\t * It also would require the schema to be passed into separate places and could cause issues if they didn't match.\n\t * Since the initialization function couldn't return a typed tree, the type checking wouldn't help catch that.\n\t * Also, if an app manages to create a document, but the initialization fails to get persisted, an app that only calls the initialization function\n\t * on the create code-path (for example how a schematized factory might do it),\n\t * would leave the document in an unusable state which could not be repaired when it is reopened (by the same or other clients).\n\t * Additionally, once out of schema content adapters are properly supported (with lazy document updates),\n\t * this initialization could become just another out of schema content adapter: at that point it clearly belongs here in schematize.\n\t */\n\tschematize<TRoot extends ImplicitFieldSchema>(\n\t\tconfig: TreeConfiguration<TRoot>,\n\t): TreeView<TreeFieldFromImplicitField<TRoot>>;\n}\n\n/**\n * Configuration for how to {@link ITree.schematize|schematize} a tree.\n * @public\n */\nexport class TreeConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> {\n\t/**\n\t * @param schema - The schema which the application wants to view the tree with.\n\t * @param initialTree - A function that returns the default tree content to initialize the tree with iff the tree is uninitialized\n\t * (meaning it does not even have any schema set at all).\n\t * If `initialTree` returns any actual node instances, they should be recreated each time `initialTree` runs.\n\t * This is because if the config is used a second time any nodes that were not recreated could error since nodes cannot be inserted into the tree multiple times.\n\t */\n\tpublic constructor(\n\t\tpublic readonly schema: TSchema,\n\t\tpublic readonly initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>,\n\t) {}\n}\n\n/**\n * An editable view of a (version control style) branch of a shared tree.\n * @privateRemarks\n * This is a wrapper around ITreeView that adjusted it for the public package API.\n * TODO:\n * Establish a naming conversion between these internal and wrapper types.\n * @public\n */\nexport interface TreeView<in out TRoot> extends IDisposable {\n\t/**\n\t * The current root of the tree.\n\t */\n\treadonly root: TRoot;\n\n\t/**\n\t * Events for the tree.\n\t */\n\treadonly events: ISubscribable<TreeViewEvents>;\n}\n\n/**\n * Events for {@link TreeView}.\n * @public\n */\nexport interface TreeViewEvents {\n\t/**\n\t * A batch of changes has finished processing and the view has been updated.\n\t */\n\tafterBatch(): void;\n}\n\n/**\n * Implementation of TreeView wrapping a FlexTreeView.\n */\nexport class WrapperTreeView<\n\tin out TSchema extends ImplicitFieldSchema,\n\tTView extends FlexTreeView<FlexTreeFieldSchema>,\n> implements TreeView<TreeFieldFromImplicitField<TSchema>>\n{\n\tpublic constructor(public readonly view: TView) {}\n\n\tpublic [disposeSymbol](): void {\n\t\tthis.view[disposeSymbol]();\n\t}\n\n\tpublic get events(): ISubscribable<TreeViewEvents> {\n\t\treturn this.view.checkout.events;\n\t}\n\n\tpublic get root(): TreeFieldFromImplicitField<TSchema> {\n\t\treturn getProxyForField(this.view.editableTree) as TreeFieldFromImplicitField<TSchema>;\n\t}\n}\n"]}
@@ -6,7 +6,7 @@
6
6
  * Allows reversion of a change made to SharedTree.
7
7
  *
8
8
  * Applications wanting to implement undo/redo support might typically maintain two stacks of Revertibles, with optional eviction policy to free up memory.
9
- * @public
9
+ * @internal
10
10
  */
11
11
  export interface Revertible {
12
12
  /** Indicates the type of edit that produced this revertible. */
@@ -32,7 +32,7 @@ export interface Revertible {
32
32
  /**
33
33
  * The type of revertible commit.
34
34
  *
35
- * @public
35
+ * @internal
36
36
  */
37
37
  export declare enum RevertibleKind {
38
38
  /** A typical local commit */
@@ -50,7 +50,7 @@ export declare enum RevertibleKind {
50
50
  /**
51
51
  * The result of a revert operation.
52
52
  *
53
- * @public
53
+ * @internal
54
54
  */
55
55
  export declare enum RevertResult {
56
56
  /** The revert was successful. */
@@ -61,7 +61,7 @@ export declare enum RevertResult {
61
61
  /**
62
62
  * The result of a discard operation.
63
63
  *
64
- * @public
64
+ * @internal
65
65
  */
66
66
  export declare enum DiscardResult {
67
67
  /** The discard was successful. */
@@ -8,7 +8,7 @@ exports.DiscardResult = exports.RevertResult = exports.RevertibleKind = void 0;
8
8
  /**
9
9
  * The type of revertible commit.
10
10
  *
11
- * @public
11
+ * @internal
12
12
  */
13
13
  var RevertibleKind;
14
14
  (function (RevertibleKind) {
@@ -27,7 +27,7 @@ var RevertibleKind;
27
27
  /**
28
28
  * The result of a revert operation.
29
29
  *
30
- * @public
30
+ * @internal
31
31
  */
32
32
  var RevertResult;
33
33
  (function (RevertResult) {
@@ -39,7 +39,7 @@ var RevertResult;
39
39
  /**
40
40
  * The result of a discard operation.
41
41
  *
42
- * @public
42
+ * @internal
43
43
  */
44
44
  var DiscardResult;
45
45
  (function (DiscardResult) {
@@ -1 +1 @@
1
- {"version":3,"file":"revertible.js","sourceRoot":"","sources":["../../../src/core/revertible/revertible.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA8BH;;;;GAIG;AACH,IAAY,cAYX;AAZD,WAAY,cAAc;IACzB,6BAA6B;IAC7B,yDAAO,CAAA;IACP,kDAAkD;IAClD,mDAAI,CAAA;IACJ,iDAAiD;IACjD,mDAAI,CAAA;IACJ;;;OAGG;IACH,uDAAM,CAAA;AACP,CAAC,EAZW,cAAc,8BAAd,cAAc,QAYzB;AAED;;;;GAIG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACvB,iCAAiC;IACjC,qDAAO,CAAA;IACP,yBAAyB;IACzB,qDAAO,CAAA;AACR,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED;;;;GAIG;AACH,IAAY,aAKX;AALD,WAAY,aAAa;IACxB,kCAAkC;IAClC,uDAAO,CAAA;IACP,0BAA0B;IAC1B,uDAAO,CAAA;AACR,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Allows reversion of a change made to SharedTree.\n *\n * Applications wanting to implement undo/redo support might typically maintain two stacks of Revertibles, with optional eviction policy to free up memory.\n * @public\n */\nexport interface Revertible {\n\t/** Indicates the type of edit that produced this revertible. */\n\treadonly kind: RevertibleKind;\n\t/**\n\t * Information about which client created the edit.\n\t */\n\treadonly origin: {\n\t\t/**\n\t\t * Indicates if the {@link Revertible} is from the local client (true) or a remote client (false).\n\t\t */\n\t\treadonly isLocal: boolean;\n\t};\n\t/**\n\t * Can be called in order to revert a change. A successful revert will automatically discard resources.\n\t */\n\trevert(): RevertResult;\n\t/**\n\t * Should be called to garbage collect any resources associated with the revertible.\n\t */\n\tdiscard(): DiscardResult;\n}\n\n/**\n * The type of revertible commit.\n *\n * @public\n */\nexport enum RevertibleKind {\n\t/** A typical local commit */\n\tDefault,\n\t/** A revertible that is the result of an undo. */\n\tUndo,\n\t/** A revertible that is the result of a redo. */\n\tRedo,\n\t/**\n\t * A revertible that is the result of a rebase and should replace a previously generated revertible.\n\t * todo: improve error reporting in this case\n\t */\n\tRebase,\n}\n\n/**\n * The result of a revert operation.\n *\n * @public\n */\nexport enum RevertResult {\n\t/** The revert was successful. */\n\tSuccess,\n\t/** The revert failed. */\n\tFailure,\n}\n\n/**\n * The result of a discard operation.\n *\n * @public\n */\nexport enum DiscardResult {\n\t/** The discard was successful. */\n\tSuccess,\n\t/** The discard failed. */\n\tFailure,\n}\n"]}
1
+ {"version":3,"file":"revertible.js","sourceRoot":"","sources":["../../../src/core/revertible/revertible.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA8BH;;;;GAIG;AACH,IAAY,cAYX;AAZD,WAAY,cAAc;IACzB,6BAA6B;IAC7B,yDAAO,CAAA;IACP,kDAAkD;IAClD,mDAAI,CAAA;IACJ,iDAAiD;IACjD,mDAAI,CAAA;IACJ;;;OAGG;IACH,uDAAM,CAAA;AACP,CAAC,EAZW,cAAc,8BAAd,cAAc,QAYzB;AAED;;;;GAIG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACvB,iCAAiC;IACjC,qDAAO,CAAA;IACP,yBAAyB;IACzB,qDAAO,CAAA;AACR,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED;;;;GAIG;AACH,IAAY,aAKX;AALD,WAAY,aAAa;IACxB,kCAAkC;IAClC,uDAAO,CAAA;IACP,0BAA0B;IAC1B,uDAAO,CAAA;AACR,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Allows reversion of a change made to SharedTree.\n *\n * Applications wanting to implement undo/redo support might typically maintain two stacks of Revertibles, with optional eviction policy to free up memory.\n * @internal\n */\nexport interface Revertible {\n\t/** Indicates the type of edit that produced this revertible. */\n\treadonly kind: RevertibleKind;\n\t/**\n\t * Information about which client created the edit.\n\t */\n\treadonly origin: {\n\t\t/**\n\t\t * Indicates if the {@link Revertible} is from the local client (true) or a remote client (false).\n\t\t */\n\t\treadonly isLocal: boolean;\n\t};\n\t/**\n\t * Can be called in order to revert a change. A successful revert will automatically discard resources.\n\t */\n\trevert(): RevertResult;\n\t/**\n\t * Should be called to garbage collect any resources associated with the revertible.\n\t */\n\tdiscard(): DiscardResult;\n}\n\n/**\n * The type of revertible commit.\n *\n * @internal\n */\nexport enum RevertibleKind {\n\t/** A typical local commit */\n\tDefault,\n\t/** A revertible that is the result of an undo. */\n\tUndo,\n\t/** A revertible that is the result of a redo. */\n\tRedo,\n\t/**\n\t * A revertible that is the result of a rebase and should replace a previously generated revertible.\n\t * todo: improve error reporting in this case\n\t */\n\tRebase,\n}\n\n/**\n * The result of a revert operation.\n *\n * @internal\n */\nexport enum RevertResult {\n\t/** The revert was successful. */\n\tSuccess,\n\t/** The revert failed. */\n\tFailure,\n}\n\n/**\n * The result of a discard operation.\n *\n * @internal\n */\nexport enum DiscardResult {\n\t/** The discard was successful. */\n\tSuccess,\n\t/** The discard failed. */\n\tFailure,\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export { leaf } from "./domains";
9
9
  export { FieldKind as FlexFieldKind, Multiplicity, isNeverField, FullSchemaPolicy, typeNameSymbol, valueSymbol, ContextuallyTypedNodeDataObject, ContextuallyTypedNodeData, MarkedArrayLike, isContextuallyTypedNodeDataObject, defaultSchemaPolicy, jsonableTreeFromCursor, StableNodeKey, LocalNodeKey, compareLocalNodeKeys, IDefaultEditBuilder, ValueFieldEditBuilder, OptionalFieldEditBuilder, SequenceFieldEditBuilder, prefixPath, prefixFieldPath, cursorForJsonableTreeNode as singleTextCursor, stackTreeNodeCursor, CursorAdapter, CursorWithNode, EditableTreeEvents, ArrayLikeMut, FieldKinds, ContextuallyTypedFieldData, cursorFromContextualData, AllowedTypes as FlexAllowedTypes, TreeNodeSchema as FlexTreeNodeSchema, FlexTreeSchema, SchemaLibrary, SchemaLibraryData, TreeFieldSchema, Any, NewFieldContent, NodeExistsConstraint, cursorForTypedTreeData, LazyTreeNodeSchema, FieldGenerator, TreeDataContext, nodeKeyFieldKey, SchemaLintConfiguration, TreeStatus, FlexTreeFieldNode, FlexibleFieldContent, FlexibleNodeContent, FlexTreeLeafNode, FlexTreeMapNode, FlexTreeOptionalField, FlexTreeRequiredField, FlexTreeSequenceField, FlexTreeObjectNode, FlexTreeObjectNodeTyped, AssignableFieldKinds, FlexTreeContext as TreeContext, FlexTreeTypedField, FlexTreeTypedNode, FlexTreeTypedNodeUnion, FlexTreeEntity, FlexTreeField, FlexTreeNode, TreeNodeSchemaBase, FieldNodeSchema, LeafNodeSchema, MapNodeSchema, ObjectNodeSchema, CheckTypesOverlap, SchemaBuilderBase, ImplicitFieldSchema as FlexImplicitFieldSchema, ImplicitAllowedTypes as FlexImplicitAllowedTypes, Unenforced, schemaIsFieldNode, schemaIsLeaf, schemaIsMap, schemaIsObjectNode, AllowedTypeSet, SchemaBuilderOptions, TreeEvent, SchemaCollection, TreeCompressionStrategy, treeSchemaFromStoredSchema, encodeTreeSchema, stackTreeFieldCursor, FlexTreeUnknownUnboxed, InsertableFlexNode, InsertableFlexField, AllowedTypesToFlexInsertableTree, ApplyMultiplicity, NormalizeObjectNodeFields, NormalizeFieldSchema, Fields, MapFieldSchema, ArrayToUnion, ExtractItemType, LazyItem, } from "./feature-libraries";
10
10
  export { TreeArrayNode, TreeMapNodeBase, Unhydrated, IterableTreeListContent, TreeNode, TreeArrayNodeBase, create, } from "./simple-tree";
11
11
  export { ISharedTree, ITreeCheckout, ITransaction, runSynchronous, SharedTreeFactory, SharedTreeOptions, ITreeCheckoutFork, CheckoutEvents, SchematizeConfiguration, TreeContent, InitializeAndSchematizeConfiguration, SchemaConfiguration, ForestType, SharedTreeContentSnapshot, FlexTreeView, ITreeViewFork, buildTreeConfiguration, ISharedTreeEditor, ISchemaEditor, } from "./shared-tree";
12
- export { ITree, TreeNodeSchema, TreeConfiguration, TreeView, SchemaFactory, Tree, TreeApi, ImplicitFieldSchema, TreeFieldFromImplicitField, TreeNodeEvents, NodeFromSchema, TreeMapNode, InsertableTreeNodeFromImplicitAllowedTypes, TreeLeafValue, type, WithType, AllowedTypes, ApplyKind, FieldKind, FieldSchema, ImplicitAllowedTypes, InsertableObjectFromSchemaRecord, InsertableTreeFieldFromImplicitField, InsertableTypedNode, NodeBuilderData, NodeKind, ObjectFromSchemaRecord, TreeNodeFromImplicitAllowedTypes, TreeNodeSchemaClass, TreeNodeSchemaCore, TreeNodeSchemaNonClass, adaptEnum, enumFromStrings, singletonSchema, typedObjectValues, test_RecursiveObject, test_RecursiveObject_base, } from "./class-tree";
12
+ export { ITree, TreeNodeSchema, TreeConfiguration, TreeView, TreeViewEvents, SchemaFactory, Tree, TreeApi, ImplicitFieldSchema, TreeFieldFromImplicitField, TreeNodeEvents, NodeFromSchema, TreeMapNode, InsertableTreeNodeFromImplicitAllowedTypes, TreeLeafValue, type, WithType, AllowedTypes, ApplyKind, FieldKind, FieldSchema, ImplicitAllowedTypes, InsertableObjectFromSchemaRecord, InsertableTreeFieldFromImplicitField, InsertableTypedNode, NodeBuilderData, NodeKind, ObjectFromSchemaRecord, TreeNodeFromImplicitAllowedTypes, TreeNodeSchemaClass, TreeNodeSchemaCore, TreeNodeSchemaNonClass, adaptEnum, enumFromStrings, singletonSchema, typedObjectValues, test_RecursiveObject, test_RecursiveObject_base, } from "./class-tree";
13
13
  export { SharedTree, TreeFactory } from "./treeFactory";
14
14
  export type { ICodecOptions, JsonValidator, SchemaValidationFunction } from "./codec";
15
15
  export { noopValidator } from "./codec";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,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,EACT,eAAe,EACf,eAAe,EACf,iBAAiB,EAGjB,oBAAoB,EACpB,yBAAyB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAExD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EACN,SAAS,EACT,aAAa,EACb,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,MAAM,EACN,aAAa,EACb,cAAc,EACd,cAAc,EACd,YAAY,EACZ,eAAe,EACf,WAAW,EACX,yBAAyB,EACzB,KAAK,EACL,iBAAiB,EACjB,UAAU,EACV,MAAM,EACN,yBAAyB,EACzB,WAAW,GACX,MAAM,QAAQ,CAAC;AAEhB,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,YAAY,EACZ,uBAAuB,EACvB,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,QAAQ,EACR,eAAe,EAIf,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,QAAQ,GACR,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,SAAS,EACT,SAAS,EACT,aAAa,EACb,MAAM,EACN,KAAK,EACL,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,WAAW,EACX,MAAM,E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AAM,eAAe,CAAC;AAExD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EACN,SAAS,EACT,aAAa,EACb,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,MAAM,EACN,aAAa,EACb,cAAc,EACd,cAAc,EACd,YAAY,EACZ,eAAe,EACf,WAAW,EACX,yBAAyB,EACzB,KAAK,EACL,iBAAiB,EACjB,UAAU,EACV,MAAM,EACN,yBAAyB,EACzB,WAAW,GACX,MAAM,QAAQ,CAAC;AAEhB,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,YAAY,EACZ,uBAAuB,EACvB,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,QAAQ,EACR,eAAe,EAIf,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,QAAQ,GACR,MAAM,qBAAqB,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,+BAsFgB;AArFf,gGAAA,QAAQ,OAAA;AAKR,iGAAA,SAAS,OAAA;AAiCT,oGAAA,YAAY,OAAA;AACZ,iGAAA,SAAS,OAAA;AAET,0GAAA,kBAAkB,OAAA;AAIlB,4GAAA,oBAAoB,OAAA;AAOpB,oHAAA,4BAA4B,OAAA;AAG5B,mGAAA,WAAW,OAAA;AACX,4GAAA,oBAAoB,OAAA;AAYpB,kGAAA,UAAU,OAAA;AAKV,yGAAA,iBAAiB,OAAA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1B,qHAAA,gBAAgB,OAAA;AAChB,yHAAA,oBAAoB,OAAA;AAerB,6CAQuB;AAPtB,4GAAA,aAAa,OAAA;AAGb,sHAAA,uBAAuB,OAAA;AACvB,uGAAA,QAAQ,OAAA;AAER,qGAAA,MAAM,OAAA;AAGP,6CAoBuB;AAhBtB,6GAAA,cAAc,OAAA;AACd,gHAAA,iBAAiB,OAAA;AAQjB,yGAAA,UAAU,OAAA;AAIV,qHAAA,sBAAsB,OAAA;AAKvB,2CA0CsB;AAvCrB,+GAAA,iBAAiB,OAAA;AAEjB,2GAAA,aAAa,OAAA;AACb,kGAAA,IAAI,OAAA;AASJ,kGAAA,IAAI,OAAA;AAIJ,uGAAA,SAAS,OAAA;AACT,yGAAA,WAAW,OAAA;AAMX,sGAAA,QAAQ,OAAA;AAOR,+BAA+B;AAC/B,uGAAA,SAAS,OAAA;AACT,6GAAA,eAAe,OAAA;AACf,6GAAA,eAAe,OAAA;AACf,+GAAA,iBAAiB,OAAA;AAEjB,8EAA8E;AAC9E,kHAAA,oBAAoB,OAAA;AACpB,uHAAA,yBAAyB,OAAA;AAE1B,6CAAwD;AAA/C,yGAAA,UAAU,OAAA;AAAE,0GAAA,WAAW,OAAA;AAGhC,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AAEzB,oKAAoK;AACpK,+BAoBgB;AAhBf,mGAAA,WAAW,OAAA;AAYX,kGAAA,UAAU,OAAA;AAMX,yDA6B6B;AAjB5B,mHAAA,cAAc,OAAA;AACd,uHAAA,kBAAkB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\tFieldKey,\n\tTreeType,\n\tValue,\n\tTreeValue,\n\tAnchorSet,\n\tDetachedField,\n\tUpPath,\n\tRange,\n\tRangeUpPath,\n\tPlaceUpPath,\n\tDetachedRangeUpPath,\n\tDetachedPlaceUpPath,\n\tPlaceIndex,\n\tNodeIndex,\n\tFieldUpPath,\n\tAnchor,\n\tRootField,\n\tChildCollection,\n\tChildLocation,\n\tDeltaVisitor,\n\tAnnouncedVisitor,\n\tFieldMapObject,\n\tNodeData,\n\tGenericTreeNode,\n\tJsonableTree,\n\tProtoNodes,\n\tDeltaRoot,\n\tDeltaProtoNode,\n\tDeltaMark,\n\tDeltaDetachedNodeId,\n\tDeltaFieldMap,\n\tDeltaDetachedNodeChanges,\n\tDeltaDetachedNodeBuild,\n\tDeltaDetachedNodeDestruction,\n\tDeltaDetachedNodeRename,\n\tDeltaFieldChanges,\n\tRevisionTag,\n\trootFieldKey,\n\trootField,\n\tITreeCursor,\n\tCursorLocationType,\n\tITreeCursorSynchronous,\n\tGenericFieldsNode,\n\tAnchorLocator,\n\tTreeNavigationResult,\n\tIEditableForest,\n\tIForestSubscription,\n\tTreeLocation,\n\tFieldLocation,\n\tForestLocation,\n\tITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\tTreeNodeSchemaIdentifier,\n\tTreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\tTreeStoredSchemaSubscription,\n\tFieldKindIdentifier,\n\tTreeTypeSet,\n\tTreeStoredSchema,\n\tFieldAnchor,\n\tSchemaEvents,\n\tChangesetLocalId,\n\tForestEvents,\n\tPathRootPrefix,\n\tAnchorSlot,\n\tAnchorNode,\n\tanchorSlot,\n\tUpPathDefault,\n\tAnchorEvents,\n\tAnchorSetRootEvents,\n\tFieldKindSpecifier,\n\tAllowedUpdateType,\n\tPathVisitor,\n\tAdapters,\n\tTreeAdapter,\n\tMapTree,\n\tRevertible,\n\tRevertibleKind,\n\tRevertResult,\n\tDiscardResult,\n\tforbiddenFieldKindIdentifier,\n\tStoredSchemaCollection,\n\tErasedTreeNodeSchemaDataFormat,\n} from \"./core\";\n\nexport {\n\tBrand,\n\tOpaque,\n\textractFromOpaque,\n\tbrand,\n\tValueFromBranded,\n\tNameFromBranded,\n\tJsonCompatibleReadOnly,\n\tJsonCompatible,\n\tJsonCompatibleObject,\n\tNestedMap,\n\tfail,\n\tIdAllocator,\n\tTransactionResult,\n\tBrandedKey,\n\tBrandedMapSubset,\n\tRangeQueryResult,\n\tNamed,\n\toneFromSet,\n\tdisposeSymbol,\n\tIDisposable,\n} from \"./util\";\n\nexport {\n\tEvents,\n\tIsEvent,\n\tISubscribable,\n\tcreateEmitter,\n\tIEmitter,\n\tNoListenersCallback,\n\tHasListeners,\n} from \"./events\";\n\nexport { leaf } from \"./domains\";\n\nexport {\n\tFieldKind as FlexFieldKind,\n\tMultiplicity,\n\tisNeverField,\n\tFullSchemaPolicy,\n\ttypeNameSymbol,\n\tvalueSymbol,\n\tContextuallyTypedNodeDataObject,\n\tContextuallyTypedNodeData,\n\tMarkedArrayLike,\n\tisContextuallyTypedNodeDataObject,\n\tdefaultSchemaPolicy,\n\tjsonableTreeFromCursor,\n\tStableNodeKey,\n\tLocalNodeKey,\n\tcompareLocalNodeKeys,\n\tIDefaultEditBuilder,\n\tValueFieldEditBuilder,\n\tOptionalFieldEditBuilder,\n\tSequenceFieldEditBuilder,\n\tprefixPath,\n\tprefixFieldPath,\n\tcursorForJsonableTreeNode as singleTextCursor,\n\tstackTreeNodeCursor,\n\tCursorAdapter,\n\tCursorWithNode,\n\tEditableTreeEvents,\n\tArrayLikeMut,\n\tFieldKinds,\n\tContextuallyTypedFieldData,\n\tcursorFromContextualData,\n\tAllowedTypes as FlexAllowedTypes,\n\tTreeNodeSchema as FlexTreeNodeSchema,\n\tFlexTreeSchema,\n\tSchemaLibrary,\n\tSchemaLibraryData,\n\tTreeFieldSchema,\n\tAny,\n\tNewFieldContent,\n\tNodeExistsConstraint,\n\tcursorForTypedTreeData,\n\tLazyTreeNodeSchema,\n\tFieldGenerator,\n\tTreeDataContext,\n\tnodeKeyFieldKey,\n\tSchemaLintConfiguration,\n\tTreeStatus,\n\tFlexTreeFieldNode,\n\tFlexibleFieldContent,\n\tFlexibleNodeContent,\n\tFlexTreeLeafNode,\n\tFlexTreeMapNode,\n\tFlexTreeOptionalField,\n\tFlexTreeRequiredField,\n\tFlexTreeSequenceField,\n\tFlexTreeObjectNode,\n\tFlexTreeObjectNodeTyped,\n\tAssignableFieldKinds,\n\tFlexTreeContext as TreeContext,\n\tFlexTreeTypedField,\n\tFlexTreeTypedNode,\n\tFlexTreeTypedNodeUnion,\n\tFlexTreeEntity,\n\tFlexTreeField,\n\tFlexTreeNode,\n\tTreeNodeSchemaBase,\n\tFieldNodeSchema,\n\tLeafNodeSchema,\n\tMapNodeSchema,\n\tObjectNodeSchema,\n\tCheckTypesOverlap,\n\tSchemaBuilderBase,\n\tImplicitFieldSchema as FlexImplicitFieldSchema,\n\tImplicitAllowedTypes as FlexImplicitAllowedTypes,\n\tUnenforced,\n\tschemaIsFieldNode,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n\tAllowedTypeSet,\n\tSchemaBuilderOptions,\n\tTreeEvent,\n\tSchemaCollection,\n\tTreeCompressionStrategy,\n\ttreeSchemaFromStoredSchema,\n\tencodeTreeSchema,\n\tstackTreeFieldCursor,\n\tFlexTreeUnknownUnboxed,\n\tInsertableFlexNode,\n\tInsertableFlexField,\n\tAllowedTypesToFlexInsertableTree,\n\tApplyMultiplicity,\n\tNormalizeObjectNodeFields,\n\tNormalizeFieldSchema,\n\tFields,\n\tMapFieldSchema,\n\tArrayToUnion,\n\tExtractItemType,\n\tLazyItem,\n} from \"./feature-libraries\";\n\nexport {\n\tTreeArrayNode,\n\tTreeMapNodeBase,\n\tUnhydrated,\n\tIterableTreeListContent,\n\tTreeNode,\n\tTreeArrayNodeBase,\n\tcreate,\n} from \"./simple-tree\";\n\nexport {\n\tISharedTree,\n\tITreeCheckout,\n\tITransaction,\n\trunSynchronous,\n\tSharedTreeFactory,\n\tSharedTreeOptions,\n\tITreeCheckoutFork,\n\tCheckoutEvents,\n\tSchematizeConfiguration,\n\tTreeContent,\n\tInitializeAndSchematizeConfiguration,\n\tSchemaConfiguration,\n\tForestType,\n\tSharedTreeContentSnapshot,\n\tFlexTreeView,\n\tITreeViewFork,\n\tbuildTreeConfiguration,\n\tISharedTreeEditor,\n\tISchemaEditor,\n} from \"./shared-tree\";\n\nexport {\n\tITree,\n\tTreeNodeSchema,\n\tTreeConfiguration,\n\tTreeView,\n\tSchemaFactory,\n\tTree,\n\tTreeApi,\n\tImplicitFieldSchema,\n\tTreeFieldFromImplicitField,\n\tTreeNodeEvents,\n\tNodeFromSchema,\n\tTreeMapNode,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n\tTreeLeafValue,\n\ttype,\n\tWithType,\n\tAllowedTypes,\n\tApplyKind,\n\tFieldKind,\n\tFieldSchema,\n\tImplicitAllowedTypes,\n\tInsertableObjectFromSchemaRecord,\n\tInsertableTreeFieldFromImplicitField,\n\tInsertableTypedNode,\n\tNodeBuilderData,\n\tNodeKind,\n\tObjectFromSchemaRecord,\n\tTreeNodeFromImplicitAllowedTypes,\n\tTreeNodeSchemaClass,\n\tTreeNodeSchemaCore,\n\tTreeNodeSchemaNonClass,\n\n\t// experimental @internal APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttypedObjectValues,\n\n\t// test recursive schema for checking that d.ts files handles schema correctly\n\ttest_RecursiveObject,\n\ttest_RecursiveObject_base,\n} from \"./class-tree\";\nexport { SharedTree, TreeFactory } from \"./treeFactory\";\n\nexport type { ICodecOptions, JsonValidator, SchemaValidationFunction } from \"./codec\";\nexport { noopValidator } from \"./codec\";\nexport { typeboxValidator } from \"./external-utilities\";\n\n// TODO: When previously tagged '@internal', these types could not be included in `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\tInvariant,\n\tContravariant,\n\tCovariant,\n\tBrandedType,\n\tExtractFromOpaque,\n\tAssume,\n\tAllowOptional,\n\tRequiredFields,\n\tOptionalFields,\n\t_InlineTrick,\n\t_RecursiveTrick,\n\tFlattenKeys,\n\tAllowOptionalNotFlattened,\n\tisAny,\n\tBrandedKeyContent,\n\tErasedType,\n\tErased,\n\tRestrictiveReadonlyRecord,\n\tMakeNominal,\n} from \"./util\";\n\nexport {\n\tNormalizeField,\n\tNormalizeAllowedTypes,\n\tFlexTreeTypedFieldInner,\n\tFlexTreeUnboxFieldInner,\n\tFlexTreeObjectNodeFields,\n\tFlexTreeUnboxField,\n\tFlexTreeUnboxNode,\n\tFlexTreeUnboxNodeUnion,\n\tFlexTreeNodeKeyField,\n\tIsArrayOfOne,\n\tFlexibleNodeSubSequence,\n\tflexTreeMarker,\n\tFlexTreeEntityKind,\n\tNodeKeys,\n\tCollectOptions,\n\tTypedFields,\n\tUnbrandedName,\n\tEmptyObject,\n\tFlexList,\n\tFlexListToUnion,\n\n\t// These field kind types really only need to show up via FieldKinds.name, and not as top level names in the package.\n\t// These names also are collision prone.\n\tRequired,\n\tOptional,\n\tNodeKeyFieldKind,\n\tForbidden,\n\tSequence,\n} from \"./feature-libraries\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,+BAsFgB;AArFf,gGAAA,QAAQ,OAAA;AAKR,iGAAA,SAAS,OAAA;AAiCT,oGAAA,YAAY,OAAA;AACZ,iGAAA,SAAS,OAAA;AAET,0GAAA,kBAAkB,OAAA;AAIlB,4GAAA,oBAAoB,OAAA;AAOpB,oHAAA,4BAA4B,OAAA;AAG5B,mGAAA,WAAW,OAAA;AACX,4GAAA,oBAAoB,OAAA;AAYpB,kGAAA,UAAU,OAAA;AAKV,yGAAA,iBAAiB,OAAA;AAMjB,sGAAA,cAAc,OAAA;AACd,oGAAA,YAAY,OAAA;AACZ,qGAAA,aAAa,OAAA;AACb,oHAAA,4BAA4B,OAAA;AAK7B,+BAqBgB;AAlBf,yGAAA,iBAAiB,OAAA;AACjB,6FAAA,KAAK,OAAA;AAOL,4FAAA,IAAI,OAAA;AAEJ,yGAAA,iB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ACd,gHAAA,iBAAiB,OAAA;AAQjB,yGAAA,UAAU,OAAA;AAIV,qHAAA,sBAAsB,OAAA;AAKvB,2CA2CsB;AAxCrB,+GAAA,iBAAiB,OAAA;AAGjB,2GAAA,aAAa,OAAA;AACb,kGAAA,IAAI,OAAA;AASJ,kGAAA,IAAI,OAAA;AAIJ,uGAAA,SAAS,OAAA;AACT,yGAAA,WAAW,OAAA;AAMX,sGAAA,QAAQ,OAAA;AAOR,+BAA+B;AAC/B,uGAAA,SAAS,OAAA;AACT,6GAAA,eAAe,OAAA;AACf,6GAAA,eAAe,OAAA;AACf,+GAAA,iBAAiB,OAAA;AAEjB,8EAA8E;AAC9E,kHAAA,oBAAoB,OAAA;AACpB,uHAAA,yBAAyB,OAAA;AAE1B,6CAAwD;AAA/C,yGAAA,UAAU,OAAA;AAAE,0GAAA,WAAW,OAAA;AAGhC,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AAEzB,oKAAoK;AACpK,+BAoBgB;AAhBf,mGAAA,WAAW,OAAA;AAYX,kGAAA,UAAU,OAAA;AAMX,yDA6B6B;AAjB5B,mHAAA,cAAc,OAAA;AACd,uHAAA,kBAAkB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\tFieldKey,\n\tTreeType,\n\tValue,\n\tTreeValue,\n\tAnchorSet,\n\tDetachedField,\n\tUpPath,\n\tRange,\n\tRangeUpPath,\n\tPlaceUpPath,\n\tDetachedRangeUpPath,\n\tDetachedPlaceUpPath,\n\tPlaceIndex,\n\tNodeIndex,\n\tFieldUpPath,\n\tAnchor,\n\tRootField,\n\tChildCollection,\n\tChildLocation,\n\tDeltaVisitor,\n\tAnnouncedVisitor,\n\tFieldMapObject,\n\tNodeData,\n\tGenericTreeNode,\n\tJsonableTree,\n\tProtoNodes,\n\tDeltaRoot,\n\tDeltaProtoNode,\n\tDeltaMark,\n\tDeltaDetachedNodeId,\n\tDeltaFieldMap,\n\tDeltaDetachedNodeChanges,\n\tDeltaDetachedNodeBuild,\n\tDeltaDetachedNodeDestruction,\n\tDeltaDetachedNodeRename,\n\tDeltaFieldChanges,\n\tRevisionTag,\n\trootFieldKey,\n\trootField,\n\tITreeCursor,\n\tCursorLocationType,\n\tITreeCursorSynchronous,\n\tGenericFieldsNode,\n\tAnchorLocator,\n\tTreeNavigationResult,\n\tIEditableForest,\n\tIForestSubscription,\n\tTreeLocation,\n\tFieldLocation,\n\tForestLocation,\n\tITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\tTreeNodeSchemaIdentifier,\n\tTreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\tTreeStoredSchemaSubscription,\n\tFieldKindIdentifier,\n\tTreeTypeSet,\n\tTreeStoredSchema,\n\tFieldAnchor,\n\tSchemaEvents,\n\tChangesetLocalId,\n\tForestEvents,\n\tPathRootPrefix,\n\tAnchorSlot,\n\tAnchorNode,\n\tanchorSlot,\n\tUpPathDefault,\n\tAnchorEvents,\n\tAnchorSetRootEvents,\n\tFieldKindSpecifier,\n\tAllowedUpdateType,\n\tPathVisitor,\n\tAdapters,\n\tTreeAdapter,\n\tMapTree,\n\tRevertible,\n\tRevertibleKind,\n\tRevertResult,\n\tDiscardResult,\n\tforbiddenFieldKindIdentifier,\n\tStoredSchemaCollection,\n\tErasedTreeNodeSchemaDataFormat,\n} from \"./core\";\n\nexport {\n\tBrand,\n\tOpaque,\n\textractFromOpaque,\n\tbrand,\n\tValueFromBranded,\n\tNameFromBranded,\n\tJsonCompatibleReadOnly,\n\tJsonCompatible,\n\tJsonCompatibleObject,\n\tNestedMap,\n\tfail,\n\tIdAllocator,\n\tTransactionResult,\n\tBrandedKey,\n\tBrandedMapSubset,\n\tRangeQueryResult,\n\tNamed,\n\toneFromSet,\n\tdisposeSymbol,\n\tIDisposable,\n} from \"./util\";\n\nexport {\n\tEvents,\n\tIsEvent,\n\tISubscribable,\n\tcreateEmitter,\n\tIEmitter,\n\tNoListenersCallback,\n\tHasListeners,\n} from \"./events\";\n\nexport { leaf } from \"./domains\";\n\nexport {\n\tFieldKind as FlexFieldKind,\n\tMultiplicity,\n\tisNeverField,\n\tFullSchemaPolicy,\n\ttypeNameSymbol,\n\tvalueSymbol,\n\tContextuallyTypedNodeDataObject,\n\tContextuallyTypedNodeData,\n\tMarkedArrayLike,\n\tisContextuallyTypedNodeDataObject,\n\tdefaultSchemaPolicy,\n\tjsonableTreeFromCursor,\n\tStableNodeKey,\n\tLocalNodeKey,\n\tcompareLocalNodeKeys,\n\tIDefaultEditBuilder,\n\tValueFieldEditBuilder,\n\tOptionalFieldEditBuilder,\n\tSequenceFieldEditBuilder,\n\tprefixPath,\n\tprefixFieldPath,\n\tcursorForJsonableTreeNode as singleTextCursor,\n\tstackTreeNodeCursor,\n\tCursorAdapter,\n\tCursorWithNode,\n\tEditableTreeEvents,\n\tArrayLikeMut,\n\tFieldKinds,\n\tContextuallyTypedFieldData,\n\tcursorFromContextualData,\n\tAllowedTypes as FlexAllowedTypes,\n\tTreeNodeSchema as FlexTreeNodeSchema,\n\tFlexTreeSchema,\n\tSchemaLibrary,\n\tSchemaLibraryData,\n\tTreeFieldSchema,\n\tAny,\n\tNewFieldContent,\n\tNodeExistsConstraint,\n\tcursorForTypedTreeData,\n\tLazyTreeNodeSchema,\n\tFieldGenerator,\n\tTreeDataContext,\n\tnodeKeyFieldKey,\n\tSchemaLintConfiguration,\n\tTreeStatus,\n\tFlexTreeFieldNode,\n\tFlexibleFieldContent,\n\tFlexibleNodeContent,\n\tFlexTreeLeafNode,\n\tFlexTreeMapNode,\n\tFlexTreeOptionalField,\n\tFlexTreeRequiredField,\n\tFlexTreeSequenceField,\n\tFlexTreeObjectNode,\n\tFlexTreeObjectNodeTyped,\n\tAssignableFieldKinds,\n\tFlexTreeContext as TreeContext,\n\tFlexTreeTypedField,\n\tFlexTreeTypedNode,\n\tFlexTreeTypedNodeUnion,\n\tFlexTreeEntity,\n\tFlexTreeField,\n\tFlexTreeNode,\n\tTreeNodeSchemaBase,\n\tFieldNodeSchema,\n\tLeafNodeSchema,\n\tMapNodeSchema,\n\tObjectNodeSchema,\n\tCheckTypesOverlap,\n\tSchemaBuilderBase,\n\tImplicitFieldSchema as FlexImplicitFieldSchema,\n\tImplicitAllowedTypes as FlexImplicitAllowedTypes,\n\tUnenforced,\n\tschemaIsFieldNode,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n\tAllowedTypeSet,\n\tSchemaBuilderOptions,\n\tTreeEvent,\n\tSchemaCollection,\n\tTreeCompressionStrategy,\n\ttreeSchemaFromStoredSchema,\n\tencodeTreeSchema,\n\tstackTreeFieldCursor,\n\tFlexTreeUnknownUnboxed,\n\tInsertableFlexNode,\n\tInsertableFlexField,\n\tAllowedTypesToFlexInsertableTree,\n\tApplyMultiplicity,\n\tNormalizeObjectNodeFields,\n\tNormalizeFieldSchema,\n\tFields,\n\tMapFieldSchema,\n\tArrayToUnion,\n\tExtractItemType,\n\tLazyItem,\n} from \"./feature-libraries\";\n\nexport {\n\tTreeArrayNode,\n\tTreeMapNodeBase,\n\tUnhydrated,\n\tIterableTreeListContent,\n\tTreeNode,\n\tTreeArrayNodeBase,\n\tcreate,\n} from \"./simple-tree\";\n\nexport {\n\tISharedTree,\n\tITreeCheckout,\n\tITransaction,\n\trunSynchronous,\n\tSharedTreeFactory,\n\tSharedTreeOptions,\n\tITreeCheckoutFork,\n\tCheckoutEvents,\n\tSchematizeConfiguration,\n\tTreeContent,\n\tInitializeAndSchematizeConfiguration,\n\tSchemaConfiguration,\n\tForestType,\n\tSharedTreeContentSnapshot,\n\tFlexTreeView,\n\tITreeViewFork,\n\tbuildTreeConfiguration,\n\tISharedTreeEditor,\n\tISchemaEditor,\n} from \"./shared-tree\";\n\nexport {\n\tITree,\n\tTreeNodeSchema,\n\tTreeConfiguration,\n\tTreeView,\n\tTreeViewEvents,\n\tSchemaFactory,\n\tTree,\n\tTreeApi,\n\tImplicitFieldSchema,\n\tTreeFieldFromImplicitField,\n\tTreeNodeEvents,\n\tNodeFromSchema,\n\tTreeMapNode,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n\tTreeLeafValue,\n\ttype,\n\tWithType,\n\tAllowedTypes,\n\tApplyKind,\n\tFieldKind,\n\tFieldSchema,\n\tImplicitAllowedTypes,\n\tInsertableObjectFromSchemaRecord,\n\tInsertableTreeFieldFromImplicitField,\n\tInsertableTypedNode,\n\tNodeBuilderData,\n\tNodeKind,\n\tObjectFromSchemaRecord,\n\tTreeNodeFromImplicitAllowedTypes,\n\tTreeNodeSchemaClass,\n\tTreeNodeSchemaCore,\n\tTreeNodeSchemaNonClass,\n\n\t// experimental @internal APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttypedObjectValues,\n\n\t// test recursive schema for checking that d.ts files handles schema correctly\n\ttest_RecursiveObject,\n\ttest_RecursiveObject_base,\n} from \"./class-tree\";\nexport { SharedTree, TreeFactory } from \"./treeFactory\";\n\nexport type { ICodecOptions, JsonValidator, SchemaValidationFunction } from \"./codec\";\nexport { noopValidator } from \"./codec\";\nexport { typeboxValidator } from \"./external-utilities\";\n\n// TODO: When previously tagged '@internal', these types could not be included in `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\tInvariant,\n\tContravariant,\n\tCovariant,\n\tBrandedType,\n\tExtractFromOpaque,\n\tAssume,\n\tAllowOptional,\n\tRequiredFields,\n\tOptionalFields,\n\t_InlineTrick,\n\t_RecursiveTrick,\n\tFlattenKeys,\n\tAllowOptionalNotFlattened,\n\tisAny,\n\tBrandedKeyContent,\n\tErasedType,\n\tErased,\n\tRestrictiveReadonlyRecord,\n\tMakeNominal,\n} from \"./util\";\n\nexport {\n\tNormalizeField,\n\tNormalizeAllowedTypes,\n\tFlexTreeTypedFieldInner,\n\tFlexTreeUnboxFieldInner,\n\tFlexTreeObjectNodeFields,\n\tFlexTreeUnboxField,\n\tFlexTreeUnboxNode,\n\tFlexTreeUnboxNodeUnion,\n\tFlexTreeNodeKeyField,\n\tIsArrayOfOne,\n\tFlexibleNodeSubSequence,\n\tflexTreeMarker,\n\tFlexTreeEntityKind,\n\tNodeKeys,\n\tCollectOptions,\n\tTypedFields,\n\tUnbrandedName,\n\tEmptyObject,\n\tFlexList,\n\tFlexListToUnion,\n\n\t// These field kind types really only need to show up via FieldKinds.name, and not as top level names in the package.\n\t// These names also are collision prone.\n\tRequired,\n\tOptional,\n\tNodeKeyFieldKind,\n\tForbidden,\n\tSequence,\n} from \"./feature-libraries\";\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/tree";
8
- export declare const pkgVersion = "2.0.0-dev-rc.1.0.0.228517";
8
+ export declare const pkgVersion = "2.0.0-rc.1.0.1";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yBAAyB,CAAC;AAC9C,eAAO,MAAM,UAAU,8BAA8B,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yBAAyB,CAAC;AAC9C,eAAO,MAAM,UAAU,mBAAmB,CAAC"}
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/tree";
11
- exports.pkgVersion = "2.0.0-dev-rc.1.0.0.228517";
11
+ exports.pkgVersion = "2.0.0-rc.1.0.1";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.0.0-dev-rc.1.0.0.228517\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.0.0-rc.1.0.1\";\n"]}
@@ -7,8 +7,8 @@ import { TransactionResult } from "../util";
7
7
  import { SharedTreeChange } from "./sharedTreeChangeTypes";
8
8
  import { ISharedTreeEditor, SharedTreeEditBuilder } from "./sharedTreeEditBuilder";
9
9
  /**
10
- * Events for {@link TreeView}.
11
- * @public
10
+ * Events for {@link ITreeCheckout}.
11
+ * @internal
12
12
  */
13
13
  export interface CheckoutEvents {
14
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"treeCheckout.js","sourceRoot":"","sources":["../../src/shared-tree/treeCheckout.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2DAAoD;AAEpD,kCAoBiB;AACjB,sCAAiF;AACjF,4DAO8B;AAC9B,0DAA6E;AAC7E,kCAAkD;AACl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EAAE,CAAC,EAAE,EAClD,MAAM,CACN,CAAC;YACF,MAAM,IAAI,GAAG,IAAA,0CAAsB,EAAC,MAAM,CAAC,CAAC;YAC5C,IAAI,IAAI,KAAK,SAAS,EAAE;gBACvB,uDAAuD;gBACvD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;gBAC5B,MAAM,cAAc,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;gBACpF,KAAK,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;aAC1C;SACD;QACD,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AArJD,oCAqJC;AAED;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC7B,IAAmB,EACnB,WAA8D;IAE9D,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,MAAM,KAAK,wBAAiB,CAAC,KAAK;QACxC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE;QAC1B,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;AAC9B,CAAC;AATD,wCASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IIdCompressor } from \"@fluidframework/runtime-definitions\";\nimport {\n\tAnchorLocator,\n\tIForestSubscription,\n\tAnchorSetRootEvents,\n\tAnchor,\n\tAnchorNode,\n\tAnchorSet,\n\tIEditableForest,\n\tTreeStoredSchemaRepository,\n\tcombineVisitors,\n\tvisitDelta,\n\tDetachedFieldIndex,\n\tmakeDetachedFieldIndex,\n\tRevertible,\n\tChangeFamily,\n\ttagChange,\n\tTreeStoredSchema,\n\tTreeStoredSchemaSubscription,\n\tJsonableTree,\n\tRevisionTagCodec,\n} from \"../core\";\nimport { HasListeners, IEmitter, ISubscribable, createEmitter } from \"../events\";\nimport {\n\tbuildForest,\n\tintoDelta,\n\tFieldBatchCodec,\n\tjsonableTreeFromCursor,\n\tmakeFieldBatchCodec,\n\tTreeCompressionStrategy,\n} from \"../feature-libraries\";\nimport { SharedTreeBranch, getChangeReplaceType } from \"../shared-tree-core\";\nimport { TransactionResult, fail } from \"../util\";\nimport { noopValidator } from \"../codec\";\nimport { SharedTreeChange } from \"./sharedTreeChangeTypes\";\nimport { SharedTreeChangeFamily } from \"./sharedTreeChangeFamily\";\nimport { ISharedTreeEditor, SharedTreeEditBuilder } from \"./sharedTreeEditBuilder\";\n\n/**\n * Events for {@link TreeView}.\n * @public\n */\nexport interface CheckoutEvents {\n\t/**\n\t * A batch of changes has finished processing and the view is in a consistent state.\n\t * It is once again safe to access the EditableTree, Forest and AnchorSet.\n\t *\n\t * @remarks\n\t * This is mainly useful for knowing when to do followup work scheduled during events from Anchors.\n\t */\n\tafterBatch(): void;\n\n\t/**\n\t * A revertible change has been made to this view.\n\t * Applications which subscribe to this event are expected to revert or discard revertibles they acquire, if they so choose (failure to do so will leak memory).\n\t * The provided revertible is inherently bound to the view that raised the event, calling `revert` won't apply to forked views.\n\t *\n\t * @remarks\n\t * This event provides a {@link Revertible} object that can be used to revert the change.\n\t */\n\trevertible(revertible: Revertible): void;\n}\n\n/**\n * Provides a means for interacting with a SharedTree.\n * This includes reading data from the tree and running transactions to mutate the tree.\n * @remarks This interface should not have any implementations other than those provided by the SharedTree package libraries.\n * @privateRemarks\n * API for interacting with a {@link SharedTreeBranch}.\n * Implementations of this interface must implement the {@link branchKey} property.\n * @internal\n */\nexport interface ITreeCheckout extends AnchorLocator {\n\t/**\n\t * Read and Write access for schema stored in the document.\n\t *\n\t * These APIs are temporary and will be replaced with different abstractions (View Schema based) in a different place later.\n\t *\n\t * TODO:\n\t * Editing of this should be moved into transactions with the rest of tree editing to they can be intermixed.\n\t * This will be done after the relations between views, branches and Indexes are figured out.\n\t *\n\t * TODO:\n\t * Public APIs for dealing with schema should be in terms of View Schema, and schema update policies.\n\t * The actual stored schema should be hidden (or ar least not be the most prominent way to interact with schema).\n\t *\n\t * TODO:\n\t * Something should ensure the document contents are always in schema.\n\t */\n\treadonly storedSchema: TreeStoredSchemaSubscription;\n\t/**\n\t * Current contents.\n\t * Updated by edits (local and remote).\n\t * Use `editor` to create a local edit.\n\t */\n\treadonly forest: IForestSubscription;\n\n\t/**\n\t * Used to edit the state of the tree. Edits will be immediately applied locally to the tree.\n\t * If there is no transaction currently ongoing, then the edits will be submitted to Fluid immediately as well.\n\t */\n\treadonly editor: ISharedTreeEditor;\n\n\t/**\n\t * A collection of functions for managing transactions.\n\t */\n\treadonly transaction: ITransaction;\n\n\t/**\n\t * Spawn a new view which is based off of the current state of this view.\n\t * Any mutations of the new view will not apply to this view until the new view is merged back into this view via `merge()`.\n\t */\n\tfork(): ITreeCheckoutFork;\n\n\t/**\n\t * Apply all the new changes on the given view to this view.\n\t * @param view - a view which was created by a call to `fork()`.\n\t * It is automatically disposed after the merge completes.\n\t * @remarks All ongoing transactions (if any) in `view` will be committed before the merge.\n\t */\n\tmerge(view: ITreeCheckoutFork): void;\n\n\t/**\n\t * Apply all the new changes on the given view to this view.\n\t * @param view - a view which was created by a call to `fork()`.\n\t * @param disposeView - whether or not to dispose `view` after the merge completes.\n\t * @remarks All ongoing transactions (if any) in `view` will be committed before the merge.\n\t */\n\tmerge(view: ITreeCheckoutFork, disposeView: boolean): void;\n\n\t/**\n\t * Rebase the given view onto this view.\n\t * @param view - a view which was created by a call to `fork()`. It is modified by this operation.\n\t */\n\trebase(view: ITreeCheckoutFork): void;\n\n\t/**\n\t * Replaces all schema with the provided schema.\n\t * Can over-write preexisting schema, and removes unmentioned schema.\n\t */\n\tupdateSchema(newSchema: TreeStoredSchema): void;\n\n\t/**\n\t * Events about this view.\n\t */\n\treadonly events: ISubscribable<CheckoutEvents>;\n\n\t/**\n\t * Events about the root of the tree in this view.\n\t */\n\treadonly rootEvents: ISubscribable<AnchorSetRootEvents>;\n\n\t/**\n\t * Returns a JsonableTree for each tree that was removed from (and not restored to) the document.\n\t * This list is guaranteed to contain all nodes that are recoverable through undo/redo on this checkout.\n\t * The list may also contain additional nodes.\n\t *\n\t * This is only intended for use in testing and exceptional code paths: it is not performant.\n\t */\n\tgetRemovedRoots(): [string | number | undefined, number, JsonableTree][];\n}\n\n/**\n * Creates a {@link TreeCheckout}.\n * @param args - an object containing optional components that will be used to build the view.\n * Any components not provided will be created by default.\n * @remarks This does not create a {@link SharedTree}, but rather a view with the minimal state\n * and functionality required to implement {@link ITreeCheckout}.\n */\nexport function createTreeCheckout(\n\tidCompressor: IIdCompressor,\n\targs?: {\n\t\tbranch?: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>;\n\t\tchangeFamily?: ChangeFamily<SharedTreeEditBuilder, SharedTreeChange>;\n\t\tschema?: TreeStoredSchemaRepository;\n\t\tforest?: IEditableForest;\n\t\tfieldBatchCodec?: FieldBatchCodec;\n\t\tevents?: ISubscribable<CheckoutEvents> &\n\t\t\tIEmitter<CheckoutEvents> &\n\t\t\tHasListeners<CheckoutEvents>;\n\t\tremovedRoots?: DetachedFieldIndex;\n\t},\n): TreeCheckout {\n\tconst forest = args?.forest ?? buildForest();\n\tconst schema = args?.schema ?? new TreeStoredSchemaRepository();\n\tconst defaultCodecOptions = { jsonValidator: noopValidator };\n\tconst changeFamily =\n\t\targs?.changeFamily ??\n\t\tnew SharedTreeChangeFamily(\n\t\t\tidCompressor,\n\t\t\targs?.fieldBatchCodec ??\n\t\t\t\tmakeFieldBatchCodec(defaultCodecOptions, {\n\t\t\t\t\t// TODO: provide schema here to enable schema based compression.\n\t\t\t\t\tencodeType: TreeCompressionStrategy.Compressed,\n\t\t\t\t}),\n\t\t\t{ jsonValidator: noopValidator },\n\t\t);\n\tconst branch =\n\t\targs?.branch ??\n\t\tnew SharedTreeBranch(\n\t\t\t{\n\t\t\t\tchange: changeFamily.rebaser.compose([]),\n\t\t\t\trevision: \"root\",\n\t\t\t},\n\t\t\tchangeFamily,\n\t\t\t() => idCompressor.generateCompressedId(),\n\t\t);\n\tconst events = args?.events ?? createEmitter();\n\n\tconst transaction = new Transaction(branch);\n\n\treturn new TreeCheckout(\n\t\ttransaction,\n\t\tbranch,\n\t\tchangeFamily,\n\t\tschema,\n\t\tforest,\n\t\tevents,\n\t\tidCompressor,\n\t\targs?.removedRoots,\n\t);\n}\n\n/**\n * A collection of functions for managing transactions.\n * Transactions allow edits to be batched into atomic units.\n * Edits made during a transaction will update the local state of the tree immediately, but will be squashed into a single edit when the transaction is committed.\n * If the transaction is aborted, the local state will be reset to what it was before the transaction began.\n * Transactions may nest, meaning that a transaction may be started while a transaction is already ongoing.\n *\n * To avoid updating observers of the view state with intermediate results during a transaction,\n * use {@link ITreeCheckout#fork} and {@link ISharedTreeFork#merge}.\n * @internal\n */\nexport interface ITransaction {\n\t/**\n\t * Start a new transaction.\n\t * If a transaction is already in progress when this new transaction starts, then this transaction will be \"nested\" inside of it,\n\t * i.e. the outer transaction will still be in progress after this new transaction is committed or aborted.\n\t *\n\t * @remarks - Asynchronous transactions are not supported on the root checkout,\n\t * since it is always kept up-to-date with the latest remote edits and the results of this rebasing (which might invalidate\n\t * the transaction) is not visible to the application author.\n\t * Instead,\n\t *\n\t * 1. fork the root checkout\n\t * 2. run the transaction on the fork\n\t * 3. merge the fork back into the root checkout\n\t *\n\t * @privateRemarks - There is currently no enforcement that asynchronous transactions don't happen on the root checkout.\n\t * AB#6488 tracks adding some enforcement to make it more clear to application authors that this is not supported.\n\t */\n\tstart(): void;\n\t/**\n\t * Close this transaction by squashing its edits and committing them as a single edit.\n\t * If this is the root checkout and there are no ongoing transactions remaining, the squashed edit will be submitted to Fluid.\n\t */\n\tcommit(): TransactionResult.Commit;\n\t/**\n\t * Close this transaction and revert the state of the tree to what it was before this transaction began.\n\t */\n\tabort(): TransactionResult.Abort;\n\t/**\n\t * True if there is at least one transaction currently in progress on this view, otherwise false.\n\t */\n\tinProgress(): boolean;\n}\n\nclass Transaction implements ITransaction {\n\tpublic constructor(\n\t\tprivate readonly branch: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>,\n\t) {}\n\n\tpublic start(): void {\n\t\tthis.branch.startTransaction();\n\t\tthis.branch.editor.enterTransaction();\n\t}\n\tpublic commit(): TransactionResult.Commit {\n\t\tthis.branch.commitTransaction();\n\t\tthis.branch.editor.exitTransaction();\n\t\treturn TransactionResult.Commit;\n\t}\n\tpublic abort(): TransactionResult.Abort {\n\t\tthis.branch.abortTransaction();\n\t\tthis.branch.editor.exitTransaction();\n\t\treturn TransactionResult.Abort;\n\t}\n\tpublic inProgress(): boolean {\n\t\treturn this.branch.isTransacting();\n\t}\n}\n\n/**\n * Branch (like in a version control system) of SharedTree.\n *\n * {@link ITreeCheckout} that has forked off of the main trunk/branch.\n * @internal\n */\nexport interface ITreeCheckoutFork extends ITreeCheckout {\n\t/**\n\t * Rebase the changes that have been applied to this view over all the new changes in the given view.\n\t * @param view - Either the root view or a view that was created by a call to `fork()`. It is not modified by this operation.\n\t */\n\trebaseOnto(view: ITreeCheckout): void;\n}\n\n/**\n * An implementation of {@link ITreeCheckoutFork}.\n */\nexport class TreeCheckout implements ITreeCheckoutFork {\n\tpublic constructor(\n\t\tpublic readonly transaction: ITransaction,\n\t\tprivate readonly branch: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>,\n\t\tprivate readonly changeFamily: ChangeFamily<SharedTreeEditBuilder, SharedTreeChange>,\n\t\tpublic readonly storedSchema: TreeStoredSchemaRepository,\n\t\tpublic readonly forest: IEditableForest,\n\t\tpublic readonly events: ISubscribable<CheckoutEvents> &\n\t\t\tIEmitter<CheckoutEvents> &\n\t\t\tHasListeners<CheckoutEvents>,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t\tprivate readonly removedRoots: DetachedFieldIndex = makeDetachedFieldIndex(\n\t\t\t\"repair\",\n\t\t\tidCompressor,\n\t\t),\n\t) {\n\t\t// We subscribe to `beforeChange` rather than `afterChange` here because it's possible that the change is invalid WRT our forest.\n\t\t// For example, a bug in the editor might produce a malformed change object and thus applying the change to the forest will throw an error.\n\t\t// In such a case we will crash here, preventing the change from being added to the commit graph, and preventing `afterChange` from firing.\n\t\t// One important consequence of this is that we will not submit the op containing the invalid change, since op submissions happens in response to `afterChange`.\n\t\tbranch.on(\"beforeChange\", (event) => {\n\t\t\tif (event.change !== undefined) {\n\t\t\t\t// Conflicts due to schema will be empty and thus are not applied.\n\t\t\t\tfor (const change of event.change.change.changes) {\n\t\t\t\t\tif (change.type === \"data\") {\n\t\t\t\t\t\tconst delta = intoDelta(\n\t\t\t\t\t\t\ttagChange(change.innerChange, event.change.revision),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst anchorVisitor = this.forest.anchors.acquireVisitor();\n\t\t\t\t\t\tconst combinedVisitor = combineVisitors(\n\t\t\t\t\t\t\t[this.forest.acquireVisitor(), anchorVisitor],\n\t\t\t\t\t\t\t[anchorVisitor],\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvisitDelta(delta, combinedVisitor, this.removedRoots);\n\t\t\t\t\t\tcombinedVisitor.free();\n\t\t\t\t\t} else if (change.type === \"schema\") {\n\t\t\t\t\t\tif (change.innerChange.schema !== undefined) {\n\t\t\t\t\t\t\tstoredSchema.apply(change.innerChange.schema.new);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfail(\"Unknown Shared Tree change type.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.events.emit(\"afterBatch\");\n\t\t\t}\n\t\t\tif (event.type === \"replace\" && getChangeReplaceType(event) === \"transactionCommit\") {\n\t\t\t\tconst transactionRevision = event.newCommits[0].revision;\n\t\t\t\tfor (const transactionStep of event.removedCommits) {\n\t\t\t\t\tthis.removedRoots.updateMajor(transactionStep.revision, transactionRevision);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbranch.on(\"revertible\", (revertible) => {\n\t\t\t// if there are no listeners, discard the revertible to avoid memory leaks\n\t\t\tif (!this.events.hasListeners(\"revertible\")) {\n\t\t\t\trevertible.discard();\n\t\t\t} else {\n\t\t\t\tthis.events.emit(\"revertible\", revertible);\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic get rootEvents(): ISubscribable<AnchorSetRootEvents> {\n\t\treturn this.forest.anchors;\n\t}\n\n\tpublic get editor(): ISharedTreeEditor {\n\t\treturn this.branch.editor;\n\t}\n\n\tpublic locate(anchor: Anchor): AnchorNode | undefined {\n\t\treturn this.forest.anchors.locate(anchor);\n\t}\n\n\tpublic fork(): TreeCheckout {\n\t\tconst anchors = new AnchorSet();\n\t\tconst branch = this.branch.fork();\n\t\tconst storedSchema = this.storedSchema.clone();\n\t\tconst forest = this.forest.clone(storedSchema, anchors);\n\t\tconst transaction = new Transaction(branch);\n\t\treturn new TreeCheckout(\n\t\t\ttransaction,\n\t\t\tbranch,\n\t\t\tthis.changeFamily,\n\t\t\tstoredSchema,\n\t\t\tforest,\n\t\t\tcreateEmitter(),\n\t\t\tthis.idCompressor,\n\t\t\tthis.removedRoots.clone(),\n\t\t);\n\t}\n\n\tpublic rebase(view: TreeCheckout): void {\n\t\tview.branch.rebaseOnto(this.branch);\n\t}\n\n\tpublic rebaseOnto(view: ITreeCheckout): void {\n\t\tview.rebase(this);\n\t}\n\n\tpublic merge(view: TreeCheckout): void;\n\tpublic merge(view: TreeCheckout, disposeView: boolean): void;\n\tpublic merge(view: TreeCheckout, disposeView = true): void {\n\t\tassert(\n\t\t\t!this.transaction.inProgress() || disposeView,\n\t\t\t0x710 /* A view that is merged into an in-progress transaction must be disposed */,\n\t\t);\n\t\twhile (view.transaction.inProgress()) {\n\t\t\tview.transaction.commit();\n\t\t}\n\t\tthis.branch.merge(view.branch);\n\t\tif (disposeView) {\n\t\t\tview.dispose();\n\t\t}\n\t}\n\n\tpublic updateSchema(newSchema: TreeStoredSchema): void {\n\t\tthis.editor.schema.setStoredSchema(this.storedSchema.clone(), newSchema);\n\t}\n\n\t/**\n\t * Dispose this view, freezing its state and allowing the SharedTree to release resources required by it.\n\t * Attempts to further mutate or dispose this view will error.\n\t */\n\tpublic dispose(): void {\n\t\tthis.branch.dispose();\n\t}\n\n\tpublic getRemovedRoots(): [string | number | undefined, number, JsonableTree][] {\n\t\tconst revisionTagCodec = new RevisionTagCodec(this.idCompressor);\n\t\tconst trees: [string | number | undefined, number, JsonableTree][] = [];\n\t\tconst cursor = this.forest.allocateCursor();\n\t\tfor (const { id, root } of this.removedRoots.entries()) {\n\t\t\tconst parentField = this.removedRoots.toFieldKey(root);\n\t\t\tthis.forest.moveCursorToPath(\n\t\t\t\t{ parent: undefined, parentField, parentIndex: 0 },\n\t\t\t\tcursor,\n\t\t\t);\n\t\t\tconst tree = jsonableTreeFromCursor(cursor);\n\t\t\tif (tree !== undefined) {\n\t\t\t\t// This method is used for tree consistency comparison.\n\t\t\t\tconst { major, minor } = id;\n\t\t\t\tconst finalizedMajor = major !== undefined ? revisionTagCodec.encode(major) : major;\n\t\t\t\ttrees.push([finalizedMajor, minor, tree]);\n\t\t\t}\n\t\t}\n\t\tcursor.free();\n\t\treturn trees;\n\t}\n}\n\n/**\n * Run a synchronous transaction on the given shared tree view.\n * This is a convenience helper around the {@link SharedTreeFork#transaction} APIs.\n * @param view - the view on which to run the transaction\n * @param transaction - the transaction function. This will be executed immediately. It is passed `view` as an argument for convenience.\n * If this function returns an `Abort` result then the transaction will be aborted. Otherwise, it will be committed.\n * @returns whether or not the transaction was committed or aborted\n * @internal\n */\nexport function runSynchronous(\n\tview: ITreeCheckout,\n\ttransaction: (view: ITreeCheckout) => TransactionResult | void,\n): TransactionResult {\n\tview.transaction.start();\n\tconst result = transaction(view);\n\treturn result === TransactionResult.Abort\n\t\t? view.transaction.abort()\n\t\t: view.transaction.commit();\n}\n"]}
1
+ {"version":3,"file":"treeCheckout.js","sourceRoot":"","sources":["../../src/shared-tree/treeCheckout.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2DAAoD;AAEpD,kCAoBiB;AACjB,sCAAiF;AACjF,4DAO8B;AAC9B,0DAA6E;AAC7E,kCAAkD;AAClD,oCAAyC;AAEzC,qEAAkE;AA+HlE;;;;;;GAMG;AACH,SAAgB,kBAAkB,CACjC,YAA2B,EAC3B,IAUC;IAED,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,IAAA,+BAAW,GAAE,CAAC;IAC7C,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,IAAI,iCAA0B,EAAE,CAAC;IAChE,MAAM,mBAAmB,GAAG,EAAE,aAAa,EAAE,qBAAa,EAAE,CAAC;IAC7D,MAAM,YAAY,GACjB,IAAI,EAAE,YAAY;QAClB,IAAI,+CAAsB,CACzB,YAAY,EACZ,IAAI,EAAE,eAAe;YACpB,IAAA,uCAAmB,EAAC,mBAAmB,EAAE;gBACxC,gEAAgE;gBAChE,UAAU,EAAE,2CAAuB,CAAC,UAAU;aAC9C,CAAC,EACH,EAAE,aAAa,EAAE,qBAAa,EAAE,CAChC,CAAC;IACH,MAAM,MAAM,GACX,IAAI,EAAE,MAAM;QACZ,IAAI,mCAAgB,CACnB;YACC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACxC,QAAQ,EAAE,MAAM;SAChB,EACD,YAAY,EACZ,GAAG,EAAE,CAAC,YAAY,CAAC,oBAAoB,EAAE,CACzC,CAAC;IACH,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,IAAA,sBAAa,GAAE,CAAC;IAE/C,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;IAE5C,OAAO,IAAI,YAAY,CACtB,WAAW,EACX,MAAM,EACN,YAAY,EACZ,MAAM,EACN,MAAM,EAC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,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE;YACvD,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACvD,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAC3B,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,EAAE,EAClD,MAAM,CACN,CAAC;YACF,MAAM,IAAI,GAAG,IAAA,0CAAsB,EAAC,MAAM,CAAC,CAAC;YAC5C,IAAI,IAAI,KAAK,SAAS,EAAE;gBACvB,uDAAuD;gBACvD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;gBAC5B,MAAM,cAAc,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;gBACpF,KAAK,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;aAC1C;SACD;QACD,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AArJD,oCAqJC;AAED;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC7B,IAAmB,EACnB,WAA8D;IAE9D,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,MAAM,KAAK,wBAAiB,CAAC,KAAK;QACxC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE;QAC1B,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;AAC9B,CAAC;AATD,wCASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IIdCompressor } from \"@fluidframework/runtime-definitions\";\nimport {\n\tAnchorLocator,\n\tIForestSubscription,\n\tAnchorSetRootEvents,\n\tAnchor,\n\tAnchorNode,\n\tAnchorSet,\n\tIEditableForest,\n\tTreeStoredSchemaRepository,\n\tcombineVisitors,\n\tvisitDelta,\n\tDetachedFieldIndex,\n\tmakeDetachedFieldIndex,\n\tRevertible,\n\tChangeFamily,\n\ttagChange,\n\tTreeStoredSchema,\n\tTreeStoredSchemaSubscription,\n\tJsonableTree,\n\tRevisionTagCodec,\n} from \"../core\";\nimport { HasListeners, IEmitter, ISubscribable, createEmitter } from \"../events\";\nimport {\n\tbuildForest,\n\tintoDelta,\n\tFieldBatchCodec,\n\tjsonableTreeFromCursor,\n\tmakeFieldBatchCodec,\n\tTreeCompressionStrategy,\n} from \"../feature-libraries\";\nimport { SharedTreeBranch, getChangeReplaceType } from \"../shared-tree-core\";\nimport { TransactionResult, fail } from \"../util\";\nimport { noopValidator } from \"../codec\";\nimport { SharedTreeChange } from \"./sharedTreeChangeTypes\";\nimport { SharedTreeChangeFamily } from \"./sharedTreeChangeFamily\";\nimport { ISharedTreeEditor, SharedTreeEditBuilder } from \"./sharedTreeEditBuilder\";\n\n/**\n * Events for {@link ITreeCheckout}.\n * @internal\n */\nexport interface CheckoutEvents {\n\t/**\n\t * A batch of changes has finished processing and the view is in a consistent state.\n\t * It is once again safe to access the EditableTree, Forest and AnchorSet.\n\t *\n\t * @remarks\n\t * This is mainly useful for knowing when to do followup work scheduled during events from Anchors.\n\t */\n\tafterBatch(): void;\n\n\t/**\n\t * A revertible change has been made to this view.\n\t * Applications which subscribe to this event are expected to revert or discard revertibles they acquire, if they so choose (failure to do so will leak memory).\n\t * The provided revertible is inherently bound to the view that raised the event, calling `revert` won't apply to forked views.\n\t *\n\t * @remarks\n\t * This event provides a {@link Revertible} object that can be used to revert the change.\n\t */\n\trevertible(revertible: Revertible): void;\n}\n\n/**\n * Provides a means for interacting with a SharedTree.\n * This includes reading data from the tree and running transactions to mutate the tree.\n * @remarks This interface should not have any implementations other than those provided by the SharedTree package libraries.\n * @privateRemarks\n * API for interacting with a {@link SharedTreeBranch}.\n * Implementations of this interface must implement the {@link branchKey} property.\n * @internal\n */\nexport interface ITreeCheckout extends AnchorLocator {\n\t/**\n\t * Read and Write access for schema stored in the document.\n\t *\n\t * These APIs are temporary and will be replaced with different abstractions (View Schema based) in a different place later.\n\t *\n\t * TODO:\n\t * Editing of this should be moved into transactions with the rest of tree editing to they can be intermixed.\n\t * This will be done after the relations between views, branches and Indexes are figured out.\n\t *\n\t * TODO:\n\t * Public APIs for dealing with schema should be in terms of View Schema, and schema update policies.\n\t * The actual stored schema should be hidden (or ar least not be the most prominent way to interact with schema).\n\t *\n\t * TODO:\n\t * Something should ensure the document contents are always in schema.\n\t */\n\treadonly storedSchema: TreeStoredSchemaSubscription;\n\t/**\n\t * Current contents.\n\t * Updated by edits (local and remote).\n\t * Use `editor` to create a local edit.\n\t */\n\treadonly forest: IForestSubscription;\n\n\t/**\n\t * Used to edit the state of the tree. Edits will be immediately applied locally to the tree.\n\t * If there is no transaction currently ongoing, then the edits will be submitted to Fluid immediately as well.\n\t */\n\treadonly editor: ISharedTreeEditor;\n\n\t/**\n\t * A collection of functions for managing transactions.\n\t */\n\treadonly transaction: ITransaction;\n\n\t/**\n\t * Spawn a new view which is based off of the current state of this view.\n\t * Any mutations of the new view will not apply to this view until the new view is merged back into this view via `merge()`.\n\t */\n\tfork(): ITreeCheckoutFork;\n\n\t/**\n\t * Apply all the new changes on the given view to this view.\n\t * @param view - a view which was created by a call to `fork()`.\n\t * It is automatically disposed after the merge completes.\n\t * @remarks All ongoing transactions (if any) in `view` will be committed before the merge.\n\t */\n\tmerge(view: ITreeCheckoutFork): void;\n\n\t/**\n\t * Apply all the new changes on the given view to this view.\n\t * @param view - a view which was created by a call to `fork()`.\n\t * @param disposeView - whether or not to dispose `view` after the merge completes.\n\t * @remarks All ongoing transactions (if any) in `view` will be committed before the merge.\n\t */\n\tmerge(view: ITreeCheckoutFork, disposeView: boolean): void;\n\n\t/**\n\t * Rebase the given view onto this view.\n\t * @param view - a view which was created by a call to `fork()`. It is modified by this operation.\n\t */\n\trebase(view: ITreeCheckoutFork): void;\n\n\t/**\n\t * Replaces all schema with the provided schema.\n\t * Can over-write preexisting schema, and removes unmentioned schema.\n\t */\n\tupdateSchema(newSchema: TreeStoredSchema): void;\n\n\t/**\n\t * Events about this view.\n\t */\n\treadonly events: ISubscribable<CheckoutEvents>;\n\n\t/**\n\t * Events about the root of the tree in this view.\n\t */\n\treadonly rootEvents: ISubscribable<AnchorSetRootEvents>;\n\n\t/**\n\t * Returns a JsonableTree for each tree that was removed from (and not restored to) the document.\n\t * This list is guaranteed to contain all nodes that are recoverable through undo/redo on this checkout.\n\t * The list may also contain additional nodes.\n\t *\n\t * This is only intended for use in testing and exceptional code paths: it is not performant.\n\t */\n\tgetRemovedRoots(): [string | number | undefined, number, JsonableTree][];\n}\n\n/**\n * Creates a {@link TreeCheckout}.\n * @param args - an object containing optional components that will be used to build the view.\n * Any components not provided will be created by default.\n * @remarks This does not create a {@link SharedTree}, but rather a view with the minimal state\n * and functionality required to implement {@link ITreeCheckout}.\n */\nexport function createTreeCheckout(\n\tidCompressor: IIdCompressor,\n\targs?: {\n\t\tbranch?: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>;\n\t\tchangeFamily?: ChangeFamily<SharedTreeEditBuilder, SharedTreeChange>;\n\t\tschema?: TreeStoredSchemaRepository;\n\t\tforest?: IEditableForest;\n\t\tfieldBatchCodec?: FieldBatchCodec;\n\t\tevents?: ISubscribable<CheckoutEvents> &\n\t\t\tIEmitter<CheckoutEvents> &\n\t\t\tHasListeners<CheckoutEvents>;\n\t\tremovedRoots?: DetachedFieldIndex;\n\t},\n): TreeCheckout {\n\tconst forest = args?.forest ?? buildForest();\n\tconst schema = args?.schema ?? new TreeStoredSchemaRepository();\n\tconst defaultCodecOptions = { jsonValidator: noopValidator };\n\tconst changeFamily =\n\t\targs?.changeFamily ??\n\t\tnew SharedTreeChangeFamily(\n\t\t\tidCompressor,\n\t\t\targs?.fieldBatchCodec ??\n\t\t\t\tmakeFieldBatchCodec(defaultCodecOptions, {\n\t\t\t\t\t// TODO: provide schema here to enable schema based compression.\n\t\t\t\t\tencodeType: TreeCompressionStrategy.Compressed,\n\t\t\t\t}),\n\t\t\t{ jsonValidator: noopValidator },\n\t\t);\n\tconst branch =\n\t\targs?.branch ??\n\t\tnew SharedTreeBranch(\n\t\t\t{\n\t\t\t\tchange: changeFamily.rebaser.compose([]),\n\t\t\t\trevision: \"root\",\n\t\t\t},\n\t\t\tchangeFamily,\n\t\t\t() => idCompressor.generateCompressedId(),\n\t\t);\n\tconst events = args?.events ?? createEmitter();\n\n\tconst transaction = new Transaction(branch);\n\n\treturn new TreeCheckout(\n\t\ttransaction,\n\t\tbranch,\n\t\tchangeFamily,\n\t\tschema,\n\t\tforest,\n\t\tevents,\n\t\tidCompressor,\n\t\targs?.removedRoots,\n\t);\n}\n\n/**\n * A collection of functions for managing transactions.\n * Transactions allow edits to be batched into atomic units.\n * Edits made during a transaction will update the local state of the tree immediately, but will be squashed into a single edit when the transaction is committed.\n * If the transaction is aborted, the local state will be reset to what it was before the transaction began.\n * Transactions may nest, meaning that a transaction may be started while a transaction is already ongoing.\n *\n * To avoid updating observers of the view state with intermediate results during a transaction,\n * use {@link ITreeCheckout#fork} and {@link ISharedTreeFork#merge}.\n * @internal\n */\nexport interface ITransaction {\n\t/**\n\t * Start a new transaction.\n\t * If a transaction is already in progress when this new transaction starts, then this transaction will be \"nested\" inside of it,\n\t * i.e. the outer transaction will still be in progress after this new transaction is committed or aborted.\n\t *\n\t * @remarks - Asynchronous transactions are not supported on the root checkout,\n\t * since it is always kept up-to-date with the latest remote edits and the results of this rebasing (which might invalidate\n\t * the transaction) is not visible to the application author.\n\t * Instead,\n\t *\n\t * 1. fork the root checkout\n\t * 2. run the transaction on the fork\n\t * 3. merge the fork back into the root checkout\n\t *\n\t * @privateRemarks - There is currently no enforcement that asynchronous transactions don't happen on the root checkout.\n\t * AB#6488 tracks adding some enforcement to make it more clear to application authors that this is not supported.\n\t */\n\tstart(): void;\n\t/**\n\t * Close this transaction by squashing its edits and committing them as a single edit.\n\t * If this is the root checkout and there are no ongoing transactions remaining, the squashed edit will be submitted to Fluid.\n\t */\n\tcommit(): TransactionResult.Commit;\n\t/**\n\t * Close this transaction and revert the state of the tree to what it was before this transaction began.\n\t */\n\tabort(): TransactionResult.Abort;\n\t/**\n\t * True if there is at least one transaction currently in progress on this view, otherwise false.\n\t */\n\tinProgress(): boolean;\n}\n\nclass Transaction implements ITransaction {\n\tpublic constructor(\n\t\tprivate readonly branch: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>,\n\t) {}\n\n\tpublic start(): void {\n\t\tthis.branch.startTransaction();\n\t\tthis.branch.editor.enterTransaction();\n\t}\n\tpublic commit(): TransactionResult.Commit {\n\t\tthis.branch.commitTransaction();\n\t\tthis.branch.editor.exitTransaction();\n\t\treturn TransactionResult.Commit;\n\t}\n\tpublic abort(): TransactionResult.Abort {\n\t\tthis.branch.abortTransaction();\n\t\tthis.branch.editor.exitTransaction();\n\t\treturn TransactionResult.Abort;\n\t}\n\tpublic inProgress(): boolean {\n\t\treturn this.branch.isTransacting();\n\t}\n}\n\n/**\n * Branch (like in a version control system) of SharedTree.\n *\n * {@link ITreeCheckout} that has forked off of the main trunk/branch.\n * @internal\n */\nexport interface ITreeCheckoutFork extends ITreeCheckout {\n\t/**\n\t * Rebase the changes that have been applied to this view over all the new changes in the given view.\n\t * @param view - Either the root view or a view that was created by a call to `fork()`. It is not modified by this operation.\n\t */\n\trebaseOnto(view: ITreeCheckout): void;\n}\n\n/**\n * An implementation of {@link ITreeCheckoutFork}.\n */\nexport class TreeCheckout implements ITreeCheckoutFork {\n\tpublic constructor(\n\t\tpublic readonly transaction: ITransaction,\n\t\tprivate readonly branch: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>,\n\t\tprivate readonly changeFamily: ChangeFamily<SharedTreeEditBuilder, SharedTreeChange>,\n\t\tpublic readonly storedSchema: TreeStoredSchemaRepository,\n\t\tpublic readonly forest: IEditableForest,\n\t\tpublic readonly events: ISubscribable<CheckoutEvents> &\n\t\t\tIEmitter<CheckoutEvents> &\n\t\t\tHasListeners<CheckoutEvents>,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t\tprivate readonly removedRoots: DetachedFieldIndex = makeDetachedFieldIndex(\n\t\t\t\"repair\",\n\t\t\tidCompressor,\n\t\t),\n\t) {\n\t\t// We subscribe to `beforeChange` rather than `afterChange` here because it's possible that the change is invalid WRT our forest.\n\t\t// For example, a bug in the editor might produce a malformed change object and thus applying the change to the forest will throw an error.\n\t\t// In such a case we will crash here, preventing the change from being added to the commit graph, and preventing `afterChange` from firing.\n\t\t// One important consequence of this is that we will not submit the op containing the invalid change, since op submissions happens in response to `afterChange`.\n\t\tbranch.on(\"beforeChange\", (event) => {\n\t\t\tif (event.change !== undefined) {\n\t\t\t\t// Conflicts due to schema will be empty and thus are not applied.\n\t\t\t\tfor (const change of event.change.change.changes) {\n\t\t\t\t\tif (change.type === \"data\") {\n\t\t\t\t\t\tconst delta = intoDelta(\n\t\t\t\t\t\t\ttagChange(change.innerChange, event.change.revision),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst anchorVisitor = this.forest.anchors.acquireVisitor();\n\t\t\t\t\t\tconst combinedVisitor = combineVisitors(\n\t\t\t\t\t\t\t[this.forest.acquireVisitor(), anchorVisitor],\n\t\t\t\t\t\t\t[anchorVisitor],\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvisitDelta(delta, combinedVisitor, this.removedRoots);\n\t\t\t\t\t\tcombinedVisitor.free();\n\t\t\t\t\t} else if (change.type === \"schema\") {\n\t\t\t\t\t\tif (change.innerChange.schema !== undefined) {\n\t\t\t\t\t\t\tstoredSchema.apply(change.innerChange.schema.new);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfail(\"Unknown Shared Tree change type.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.events.emit(\"afterBatch\");\n\t\t\t}\n\t\t\tif (event.type === \"replace\" && getChangeReplaceType(event) === \"transactionCommit\") {\n\t\t\t\tconst transactionRevision = event.newCommits[0].revision;\n\t\t\t\tfor (const transactionStep of event.removedCommits) {\n\t\t\t\t\tthis.removedRoots.updateMajor(transactionStep.revision, transactionRevision);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbranch.on(\"revertible\", (revertible) => {\n\t\t\t// if there are no listeners, discard the revertible to avoid memory leaks\n\t\t\tif (!this.events.hasListeners(\"revertible\")) {\n\t\t\t\trevertible.discard();\n\t\t\t} else {\n\t\t\t\tthis.events.emit(\"revertible\", revertible);\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic get rootEvents(): ISubscribable<AnchorSetRootEvents> {\n\t\treturn this.forest.anchors;\n\t}\n\n\tpublic get editor(): ISharedTreeEditor {\n\t\treturn this.branch.editor;\n\t}\n\n\tpublic locate(anchor: Anchor): AnchorNode | undefined {\n\t\treturn this.forest.anchors.locate(anchor);\n\t}\n\n\tpublic fork(): TreeCheckout {\n\t\tconst anchors = new AnchorSet();\n\t\tconst branch = this.branch.fork();\n\t\tconst storedSchema = this.storedSchema.clone();\n\t\tconst forest = this.forest.clone(storedSchema, anchors);\n\t\tconst transaction = new Transaction(branch);\n\t\treturn new TreeCheckout(\n\t\t\ttransaction,\n\t\t\tbranch,\n\t\t\tthis.changeFamily,\n\t\t\tstoredSchema,\n\t\t\tforest,\n\t\t\tcreateEmitter(),\n\t\t\tthis.idCompressor,\n\t\t\tthis.removedRoots.clone(),\n\t\t);\n\t}\n\n\tpublic rebase(view: TreeCheckout): void {\n\t\tview.branch.rebaseOnto(this.branch);\n\t}\n\n\tpublic rebaseOnto(view: ITreeCheckout): void {\n\t\tview.rebase(this);\n\t}\n\n\tpublic merge(view: TreeCheckout): void;\n\tpublic merge(view: TreeCheckout, disposeView: boolean): void;\n\tpublic merge(view: TreeCheckout, disposeView = true): void {\n\t\tassert(\n\t\t\t!this.transaction.inProgress() || disposeView,\n\t\t\t0x710 /* A view that is merged into an in-progress transaction must be disposed */,\n\t\t);\n\t\twhile (view.transaction.inProgress()) {\n\t\t\tview.transaction.commit();\n\t\t}\n\t\tthis.branch.merge(view.branch);\n\t\tif (disposeView) {\n\t\t\tview.dispose();\n\t\t}\n\t}\n\n\tpublic updateSchema(newSchema: TreeStoredSchema): void {\n\t\tthis.editor.schema.setStoredSchema(this.storedSchema.clone(), newSchema);\n\t}\n\n\t/**\n\t * Dispose this view, freezing its state and allowing the SharedTree to release resources required by it.\n\t * Attempts to further mutate or dispose this view will error.\n\t */\n\tpublic dispose(): void {\n\t\tthis.branch.dispose();\n\t}\n\n\tpublic getRemovedRoots(): [string | number | undefined, number, JsonableTree][] {\n\t\tconst revisionTagCodec = new RevisionTagCodec(this.idCompressor);\n\t\tconst trees: [string | number | undefined, number, JsonableTree][] = [];\n\t\tconst cursor = this.forest.allocateCursor();\n\t\tfor (const { id, root } of this.removedRoots.entries()) {\n\t\t\tconst parentField = this.removedRoots.toFieldKey(root);\n\t\t\tthis.forest.moveCursorToPath(\n\t\t\t\t{ parent: undefined, parentField, parentIndex: 0 },\n\t\t\t\tcursor,\n\t\t\t);\n\t\t\tconst tree = jsonableTreeFromCursor(cursor);\n\t\t\tif (tree !== undefined) {\n\t\t\t\t// This method is used for tree consistency comparison.\n\t\t\t\tconst { major, minor } = id;\n\t\t\t\tconst finalizedMajor = major !== undefined ? revisionTagCodec.encode(major) : major;\n\t\t\t\ttrees.push([finalizedMajor, minor, tree]);\n\t\t\t}\n\t\t}\n\t\tcursor.free();\n\t\treturn trees;\n\t}\n}\n\n/**\n * Run a synchronous transaction on the given shared tree view.\n * This is a convenience helper around the {@link SharedTreeFork#transaction} APIs.\n * @param view - the view on which to run the transaction\n * @param transaction - the transaction function. This will be executed immediately. It is passed `view` as an argument for convenience.\n * If this function returns an `Abort` result then the transaction will be aborted. Otherwise, it will be committed.\n * @returns whether or not the transaction was committed or aborted\n * @internal\n */\nexport function runSynchronous(\n\tview: ITreeCheckout,\n\ttransaction: (view: ITreeCheckout) => TransactionResult | void,\n): TransactionResult {\n\tview.transaction.start();\n\tconst result = transaction(view);\n\treturn result === TransactionResult.Abort\n\t\t? view.transaction.abort()\n\t\t: view.transaction.commit();\n}\n"]}