@fluidframework/tree 2.31.1 → 2.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/.vscode/settings.json +1 -1
  2. package/CHANGELOG.md +44 -0
  3. package/api-extractor/api-extractor.current.json +5 -1
  4. package/api-report/tree.alpha.api.md +44 -20
  5. package/dist/alpha.d.ts +6 -2
  6. package/dist/feature-libraries/flex-tree/context.d.ts +1 -1
  7. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  8. package/dist/feature-libraries/flex-tree/context.js +1 -2
  9. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  10. package/dist/feature-libraries/flex-tree/index.d.ts +1 -1
  11. package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
  12. package/dist/feature-libraries/flex-tree/index.js +1 -2
  13. package/dist/feature-libraries/flex-tree/index.js.map +1 -1
  14. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +6 -15
  15. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  16. package/dist/feature-libraries/flex-tree/lazyEntity.js +9 -18
  17. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  18. package/dist/feature-libraries/flex-tree/lazyField.d.ts +3 -3
  19. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  20. package/dist/feature-libraries/flex-tree/lazyField.js +14 -14
  21. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  22. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +4 -4
  23. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  24. package/dist/feature-libraries/flex-tree/lazyNode.js +12 -12
  25. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  26. package/dist/feature-libraries/index.d.ts +1 -1
  27. package/dist/feature-libraries/index.d.ts.map +1 -1
  28. package/dist/feature-libraries/index.js +1 -2
  29. package/dist/feature-libraries/index.js.map +1 -1
  30. package/dist/index.d.ts +2 -1
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +5 -2
  33. package/dist/index.js.map +1 -1
  34. package/dist/packageVersion.d.ts +1 -1
  35. package/dist/packageVersion.js +1 -1
  36. package/dist/packageVersion.js.map +1 -1
  37. package/dist/shared-tree/sharedTree.js +2 -2
  38. package/dist/shared-tree/sharedTree.js.map +1 -1
  39. package/dist/shared-tree/treeApiAlpha.d.ts +6 -6
  40. package/dist/shared-tree/treeApiAlpha.d.ts.map +1 -1
  41. package/dist/shared-tree/treeApiAlpha.js.map +1 -1
  42. package/dist/shared-tree-core/sharedTreeCore.d.ts +0 -6
  43. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  44. package/dist/shared-tree-core/sharedTreeCore.js +0 -17
  45. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  46. package/dist/simple-tree/api/conciseTree.d.ts +2 -2
  47. package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
  48. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  49. package/dist/simple-tree/api/customTree.d.ts +14 -12
  50. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  51. package/dist/simple-tree/api/customTree.js.map +1 -1
  52. package/dist/simple-tree/api/getJsonSchema.d.ts +21 -7
  53. package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  54. package/dist/simple-tree/api/getJsonSchema.js +8 -16
  55. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  56. package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -10
  57. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  58. package/dist/simple-tree/api/getSimpleSchema.js +4 -16
  59. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  60. package/dist/simple-tree/api/index.d.ts +4 -3
  61. package/dist/simple-tree/api/index.d.ts.map +1 -1
  62. package/dist/simple-tree/api/index.js +2 -1
  63. package/dist/simple-tree/api/index.js.map +1 -1
  64. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +17 -1
  65. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  66. package/dist/simple-tree/api/schemaFactoryAlpha.js +4 -0
  67. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  68. package/dist/simple-tree/api/schemaFromSimple.d.ts +5 -2
  69. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  70. package/dist/simple-tree/api/schemaFromSimple.js +24 -8
  71. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  72. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +11 -3
  73. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  74. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +40 -28
  75. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  76. package/dist/simple-tree/api/tree.d.ts +32 -5
  77. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  78. package/dist/simple-tree/api/tree.js +17 -1
  79. package/dist/simple-tree/api/tree.js.map +1 -1
  80. package/dist/simple-tree/api/verboseTree.d.ts +4 -28
  81. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  82. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  83. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  84. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +7 -3
  85. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  86. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  87. package/dist/simple-tree/core/treeNodeKernel.js +7 -6
  88. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  89. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  90. package/dist/simple-tree/core/unhydratedFlexTree.js +12 -1
  91. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  92. package/dist/simple-tree/index.d.ts +1 -1
  93. package/dist/simple-tree/index.d.ts.map +1 -1
  94. package/dist/simple-tree/index.js +3 -2
  95. package/dist/simple-tree/index.js.map +1 -1
  96. package/dist/simple-tree/simpleSchema.d.ts +4 -11
  97. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  98. package/dist/simple-tree/simpleSchema.js.map +1 -1
  99. package/dist/tableSchema.d.ts +227 -0
  100. package/dist/tableSchema.d.ts.map +1 -0
  101. package/dist/tableSchema.js +234 -0
  102. package/dist/tableSchema.js.map +1 -0
  103. package/dist/treeFactory.d.ts +4 -4
  104. package/dist/treeFactory.d.ts.map +1 -1
  105. package/dist/treeFactory.js.map +1 -1
  106. package/dist/util/breakable.d.ts.map +1 -1
  107. package/dist/util/breakable.js +9 -7
  108. package/dist/util/breakable.js.map +1 -1
  109. package/lib/alpha.d.ts +6 -2
  110. package/lib/feature-libraries/flex-tree/context.d.ts +1 -1
  111. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  112. package/lib/feature-libraries/flex-tree/context.js +1 -2
  113. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  114. package/lib/feature-libraries/flex-tree/index.d.ts +1 -1
  115. package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
  116. package/lib/feature-libraries/flex-tree/index.js +1 -1
  117. package/lib/feature-libraries/flex-tree/index.js.map +1 -1
  118. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +6 -15
  119. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  120. package/lib/feature-libraries/flex-tree/lazyEntity.js +8 -17
  121. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  122. package/lib/feature-libraries/flex-tree/lazyField.d.ts +3 -3
  123. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  124. package/lib/feature-libraries/flex-tree/lazyField.js +15 -15
  125. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  126. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +4 -4
  127. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  128. package/lib/feature-libraries/flex-tree/lazyNode.js +13 -13
  129. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  130. package/lib/feature-libraries/index.d.ts +1 -1
  131. package/lib/feature-libraries/index.d.ts.map +1 -1
  132. package/lib/feature-libraries/index.js +1 -1
  133. package/lib/feature-libraries/index.js.map +1 -1
  134. package/lib/index.d.ts +2 -1
  135. package/lib/index.d.ts.map +1 -1
  136. package/lib/index.js +2 -1
  137. package/lib/index.js.map +1 -1
  138. package/lib/packageVersion.d.ts +1 -1
  139. package/lib/packageVersion.js +1 -1
  140. package/lib/packageVersion.js.map +1 -1
  141. package/lib/shared-tree/sharedTree.js +2 -2
  142. package/lib/shared-tree/sharedTree.js.map +1 -1
  143. package/lib/shared-tree/treeApiAlpha.d.ts +6 -6
  144. package/lib/shared-tree/treeApiAlpha.d.ts.map +1 -1
  145. package/lib/shared-tree/treeApiAlpha.js.map +1 -1
  146. package/lib/shared-tree-core/sharedTreeCore.d.ts +0 -6
  147. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  148. package/lib/shared-tree-core/sharedTreeCore.js +0 -17
  149. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  150. package/lib/simple-tree/api/conciseTree.d.ts +2 -2
  151. package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
  152. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  153. package/lib/simple-tree/api/customTree.d.ts +14 -12
  154. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  155. package/lib/simple-tree/api/customTree.js.map +1 -1
  156. package/lib/simple-tree/api/getJsonSchema.d.ts +21 -7
  157. package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  158. package/lib/simple-tree/api/getJsonSchema.js +8 -16
  159. package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
  160. package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -10
  161. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  162. package/lib/simple-tree/api/getSimpleSchema.js +4 -16
  163. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  164. package/lib/simple-tree/api/index.d.ts +4 -3
  165. package/lib/simple-tree/api/index.d.ts.map +1 -1
  166. package/lib/simple-tree/api/index.js +1 -1
  167. package/lib/simple-tree/api/index.js.map +1 -1
  168. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +17 -1
  169. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  170. package/lib/simple-tree/api/schemaFactoryAlpha.js +4 -0
  171. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  172. package/lib/simple-tree/api/schemaFromSimple.d.ts +5 -2
  173. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  174. package/lib/simple-tree/api/schemaFromSimple.js +24 -8
  175. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  176. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +11 -3
  177. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  178. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +41 -29
  179. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  180. package/lib/simple-tree/api/tree.d.ts +32 -5
  181. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  182. package/lib/simple-tree/api/tree.js +16 -1
  183. package/lib/simple-tree/api/tree.js.map +1 -1
  184. package/lib/simple-tree/api/verboseTree.d.ts +4 -28
  185. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  186. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  187. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  188. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +7 -3
  189. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  190. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  191. package/lib/simple-tree/core/treeNodeKernel.js +8 -7
  192. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  193. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  194. package/lib/simple-tree/core/unhydratedFlexTree.js +12 -1
  195. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  196. package/lib/simple-tree/index.d.ts +1 -1
  197. package/lib/simple-tree/index.d.ts.map +1 -1
  198. package/lib/simple-tree/index.js +1 -1
  199. package/lib/simple-tree/index.js.map +1 -1
  200. package/lib/simple-tree/simpleSchema.d.ts +4 -11
  201. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  202. package/lib/simple-tree/simpleSchema.js.map +1 -1
  203. package/lib/tableSchema.d.ts +227 -0
  204. package/lib/tableSchema.d.ts.map +1 -0
  205. package/lib/tableSchema.js +231 -0
  206. package/lib/tableSchema.js.map +1 -0
  207. package/lib/treeFactory.d.ts +4 -4
  208. package/lib/treeFactory.d.ts.map +1 -1
  209. package/lib/treeFactory.js.map +1 -1
  210. package/lib/util/breakable.d.ts.map +1 -1
  211. package/lib/util/breakable.js +9 -7
  212. package/lib/util/breakable.js.map +1 -1
  213. package/package.json +23 -22
  214. package/src/feature-libraries/flex-tree/context.ts +2 -2
  215. package/src/feature-libraries/flex-tree/index.ts +0 -1
  216. package/src/feature-libraries/flex-tree/lazyEntity.ts +11 -21
  217. package/src/feature-libraries/flex-tree/lazyField.ts +17 -26
  218. package/src/feature-libraries/flex-tree/lazyNode.ts +13 -19
  219. package/src/feature-libraries/index.ts +0 -1
  220. package/src/index.ts +6 -2
  221. package/src/packageVersion.ts +1 -1
  222. package/src/shared-tree/sharedTree.ts +2 -2
  223. package/src/shared-tree/treeApiAlpha.ts +17 -15
  224. package/src/shared-tree-core/sharedTreeCore.ts +0 -23
  225. package/src/simple-tree/api/conciseTree.ts +4 -4
  226. package/src/simple-tree/api/customTree.ts +16 -14
  227. package/src/simple-tree/api/getJsonSchema.ts +25 -16
  228. package/src/simple-tree/api/getSimpleSchema.ts +4 -18
  229. package/src/simple-tree/api/index.ts +4 -2
  230. package/src/simple-tree/api/schemaFactoryAlpha.ts +18 -1
  231. package/src/simple-tree/api/schemaFromSimple.ts +45 -16
  232. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +53 -34
  233. package/src/simple-tree/api/tree.ts +51 -4
  234. package/src/simple-tree/api/verboseTree.ts +7 -32
  235. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +8 -3
  236. package/src/simple-tree/core/treeNodeKernel.ts +11 -7
  237. package/src/simple-tree/core/unhydratedFlexTree.ts +17 -4
  238. package/src/simple-tree/index.ts +4 -2
  239. package/src/simple-tree/simpleSchema.ts +4 -12
  240. package/src/tableSchema.ts +609 -0
  241. package/src/treeFactory.ts +4 -3
  242. package/src/util/breakable.ts +9 -6
@@ -7,7 +7,7 @@
7
7
  // "pruneFiles" is disabled because it causesd "source-map-support/register" to give `Unknown file extension ".ts"` errors.
8
8
  // "mochaExplorer.pruneFiles": true,
9
9
  "mochaExplorer.require": [
10
- "node_modules/@fluid-internal/mocha-test-setup",
10
+ "node_modules/@fluid-internal/mocha-test-setup/dist/index.js",
11
11
  "source-map-support/register",
12
12
  ],
13
13
  "mochaExplorer.configFile": ".mocharc.cjs",
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @fluidframework/tree
2
2
 
3
+ ## 2.32.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Cleanup of several tree and schema alpha APIs for content import and export ([#24350](https://github.com/microsoft/FluidFramework/pull/24350)) [fe924a173b](https://github.com/microsoft/FluidFramework/commit/fe924a173b71abd96ba76da787eec3b4c077d32b)
8
+
9
+ A new `TreeSchema` type has been introduced which extends `SimpleTreeSchema` but contains `TreeNodeSchema` instead of `SimpleNodeSchema`.
10
+
11
+ `TreeViewConfigurationAlpha` is added which is just `TreeViewConfiguration` but implementing `TreeSchema`.
12
+
13
+ `SimpleTreeSchema` was modified to have a `root` property instead of implementing `SimpleFieldSchema` directly:
14
+ this makes it possible for `TreeViewConfigurationAlpha` to implement `TreeSchema` which extends `SimpleTreeSchema`.
15
+
16
+ `generateSchemaFromSimpleSchema` now returns the new `TreeSchema` type.
17
+
18
+ `EncodeOptions` and `ParseOptions` have been unified as `TreeEncodingOptions` which covers both the encoding and parsing cases.
19
+
20
+ `getJsonSchema` now takes in `ImplicitAllowedTypes` instead of `ImplicitFieldSchema` since it can't handle optional roots.
21
+ `getJsonSchema` also takes in the new `TreeSchemaEncodingOptions` to provide options for how to handle stored keys vs property keys, and fields with defaults.
22
+
23
+ Now that `getJsonSchema` takes in configuration options, its results are no longer cached.
24
+
25
+ - Provide alpha APIs for accessing tree content and stored schema without requiring a compatible view schema ([#24350](https://github.com/microsoft/FluidFramework/pull/24350)) [fe924a173b](https://github.com/microsoft/FluidFramework/commit/fe924a173b71abd96ba76da787eec3b4c077d32b)
26
+
27
+ Adds an `ITreeAlpha` interface (which `ITree` can be down-casted to) that provides access to both the tree content and the schema.
28
+ This allows inspecting the content saved in a SharedTree in a generic way that can work on any SharedTree.
29
+
30
+ This can be combined with the existing `generateSchemaFromSimpleSchema` to generate a schema that can be used with [`IIree.viewWith`](https://fluidframework.com/docs/api/fluid-framework/viewabletree-interface#viewwith-methodsignature) to allow constructing a [`TreeView`](https://fluidframework.com/docs/api/fluid-framework/treeview-interface) for any SharedTree, regardless of its schema.
31
+
32
+ Note that the resulting TypeScript typing for such a view will not be friendly: the `TreeView` APIs are designed for statically known schema. Using them is possible with care and a lot of type casts but not recommended if it can be avoided: see disclaimer on `generateSchemaFromSimpleSchema`.
33
+ Example using `ITreeAlpha` and `generateSchemaFromSimpleSchema`:
34
+
35
+ ```typescript
36
+ const viewAlpha = tree as ITreeAlpha;
37
+ const treeSchema = generateSchemaFromSimpleSchema(
38
+ viewAlpha.exportSimpleSchema(),
39
+ );
40
+ const config = new TreeViewConfiguration({ schema: treeSchema.root });
41
+ const view = viewAlpha.viewWith(config);
42
+ ```
43
+
44
+ `getSimpleSchema` is also added as an `@alpha` API to provide a way to clone schema into the simple schema formats.
45
+ Note that when using (or copying) a view schema as a simple schema, more metadata will be preserved than when deriving one from the stored schema using `ITreeAlpha`.
46
+
3
47
  ## 2.31.0
4
48
 
5
49
  ### Minor Changes
@@ -1,5 +1,9 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
3
  "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.current.json",
4
- "mainEntryPointFilePath": "<projectFolder>/lib/alpha.d.ts"
4
+ "mainEntryPointFilePath": "<projectFolder>/lib/alpha.d.ts",
5
+ "apiReport": {
6
+ // The base config omits alpha. Explicitly opt into alpha reports (in addition to public/beta) for this package.
7
+ "reportVariants": ["public", "beta", "alpha"]
8
+ }
5
9
  }
@@ -112,11 +112,6 @@ export function createSimpleTreeIndex<TFieldSchema extends ImplicitFieldSchema,
112
112
  interface DefaultProvider extends ErasedType<"@fluidframework/tree.FieldProvider"> {
113
113
  }
114
114
 
115
- // @alpha
116
- export interface EncodeOptions {
117
- readonly useStoredKeys?: boolean;
118
- }
119
-
120
115
  // @alpha
121
116
  export function enumFromStrings<TScope extends string, const Members extends readonly string[]>(factory: SchemaFactory<TScope>, members: Members): (<TValue extends Members[number]>(value: TValue) => TValue extends unknown ? TreeNode & {
122
117
  readonly value: TValue;
@@ -246,7 +241,7 @@ export const ForestTypeOptimized: ForestType;
246
241
  export const ForestTypeReference: ForestType;
247
242
 
248
243
  // @alpha
249
- export function generateSchemaFromSimpleSchema(simple: SimpleTreeSchema): FieldSchemaAlpha;
244
+ export function generateSchemaFromSimpleSchema(simple: SimpleTreeSchema): TreeSchema;
250
245
 
251
246
  // @alpha @deprecated
252
247
  export function getBranch(tree: ITree): BranchableTree;
@@ -255,7 +250,10 @@ export function getBranch(tree: ITree): BranchableTree;
255
250
  export function getBranch<T extends ImplicitFieldSchema | UnsafeUnknownSchema>(view: TreeViewAlpha<T>): BranchableTree;
256
251
 
257
252
  // @alpha
258
- export function getJsonSchema(schema: ImplicitFieldSchema): JsonTreeSchema;
253
+ export function getJsonSchema(schema: ImplicitAllowedTypes, options: Required<TreeSchemaEncodingOptions>): JsonTreeSchema;
254
+
255
+ // @alpha
256
+ export function getSimpleSchema(schema: ImplicitFieldSchema): SimpleTreeSchema;
259
257
 
260
258
  // @alpha
261
259
  export type HandleConverter<TCustom> = (data: IFluidHandle) => TCustom;
@@ -410,6 +408,12 @@ export class IterableTreeArrayContent<T> implements Iterable<T> {
410
408
  export interface ITree extends ViewableTree, IFluidLoadable {
411
409
  }
412
410
 
411
+ // @alpha @sealed
412
+ export interface ITreeAlpha extends ITree {
413
+ exportSimpleSchema(): SimpleTreeSchema;
414
+ exportVerbose(): VerboseTree | undefined;
415
+ }
416
+
413
417
  // @public
414
418
  export interface ITreeConfigurationOptions {
415
419
  enableSchemaValidation?: boolean;
@@ -639,11 +643,6 @@ export const ObjectNodeSchema: {
639
643
  // @public @deprecated
640
644
  export type Off = Off_2;
641
645
 
642
- // @alpha
643
- export interface ParseOptions {
644
- readonly useStoredKeys?: boolean;
645
- }
646
-
647
646
  // @alpha
648
647
  export type PopUnion<Union, AsOverloadedFunction = UnionToIntersection<Union extends unknown ? (f: Union) => void : never>> = AsOverloadedFunction extends (a: infer First) => void ? First : never;
649
648
 
@@ -804,9 +803,12 @@ export class SchemaFactoryAlpha<out TScope extends string | undefined = string |
804
803
  arrayAlpha<const Name extends TName, const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): ArrayNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
805
804
  arrayRecursive<const Name extends TName, const T extends ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): ArrayNodeCustomizableSchemaUnsafe<ScopedSchemaName<TScope, Name>, T, TCustomMetadata>;
806
805
  static readonly identifier: <const TCustomMetadata = unknown>(props?: Omit<FieldProps_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha_2<FieldKind_2.Identifier, LeafSchema_2<"string", string> & SimpleLeafNodeSchema_2, TCustomMetadata>;
806
+ static readonly leaves: readonly [LeafSchema_2<"string", string> & SimpleLeafNodeSchema_2, LeafSchema_2<"number", number> & SimpleLeafNodeSchema_2, LeafSchema_2<"boolean", boolean> & SimpleLeafNodeSchema_2, LeafSchema_2<"null", null> & SimpleLeafNodeSchema_2, LeafSchema_2<"handle", IFluidHandle<unknown>> & SimpleLeafNodeSchema_2];
807
807
  mapAlpha<Name extends TName, const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): MapNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
808
808
  mapRecursive<Name extends TName, const T extends ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): MapNodeCustomizableSchemaUnsafe<ScopedSchemaName<TScope, Name>, T, TCustomMetadata>;
809
- object<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>, const TCustomMetadata = unknown>(name: Name, fields: T, options?: SchemaFactoryObjectOptions<TCustomMetadata>): ObjectNodeSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
809
+ object<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>, const TCustomMetadata = unknown>(name: Name, fields: T, options?: SchemaFactoryObjectOptions<TCustomMetadata>): ObjectNodeSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> & {
810
+ readonly createFromInsertable: unknown;
811
+ };
810
812
  objectRecursive<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>, const TCustomMetadata = unknown>(name: Name, t: T, options?: SchemaFactoryObjectOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordUnsafe<T>, false, T, never, TCustomMetadata> & SimpleObjectNodeSchema<TCustomMetadata> & Pick<ObjectNodeSchema, "fields">;
811
813
  static readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha_2<FieldKind_2.Optional, T, TCustomMetadata>;
812
814
  static readonly optionalRecursive: <const T extends ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe_2<FieldKind_2.Optional, T, TCustomMetadata>;
@@ -911,10 +913,9 @@ export interface SimpleObjectNodeSchema<out TCustomMetadata = unknown> extends S
911
913
  export type SimpleTreeIndex<TKey extends TreeIndexKey, TValue> = TreeIndex<TKey, TValue>;
912
914
 
913
915
  // @alpha @sealed
914
- export interface SimpleTreeSchema extends SimpleFieldSchema {
915
- readonly allowedTypesIdentifiers: ReadonlySet<string>;
916
+ export interface SimpleTreeSchema {
916
917
  readonly definitions: ReadonlyMap<string, SimpleNodeSchema>;
917
- readonly kind: FieldKind;
918
+ readonly root: SimpleFieldSchema;
918
919
  }
919
920
 
920
921
  // @alpha
@@ -962,10 +963,10 @@ export const TreeAlpha: {
962
963
  branch(node: TreeNode): TreeBranch | undefined;
963
964
  create<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(schema: UnsafeUnknownSchema extends TSchema ? ImplicitFieldSchema : TSchema & ImplicitFieldSchema, data: InsertableField<TSchema>): Unhydrated<TSchema extends ImplicitFieldSchema ? TreeFieldFromImplicitField<TSchema> : TreeNode | TreeLeafValue | undefined>;
964
965
  importConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(schema: UnsafeUnknownSchema extends TSchema ? ImplicitFieldSchema : TSchema & ImplicitFieldSchema, data: ConciseTree | undefined): Unhydrated<TSchema extends ImplicitFieldSchema ? TreeFieldFromImplicitField<TSchema> : TreeNode | TreeLeafValue | undefined>;
965
- importVerbose<const TSchema extends ImplicitFieldSchema>(schema: TSchema, data: VerboseTree | undefined, options?: Partial<ParseOptions>): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
966
- exportConcise(node: TreeNode | TreeLeafValue, options?: EncodeOptions): ConciseTree;
967
- exportConcise(node: TreeNode | TreeLeafValue | undefined, options?: EncodeOptions): ConciseTree | undefined;
968
- exportVerbose(node: TreeNode | TreeLeafValue, options?: EncodeOptions): VerboseTree;
966
+ importVerbose<const TSchema extends ImplicitFieldSchema>(schema: TSchema, data: VerboseTree | undefined, options?: Partial<TreeEncodingOptions>): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
967
+ exportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;
968
+ exportConcise(node: TreeNode | TreeLeafValue | undefined, options?: TreeEncodingOptions): ConciseTree | undefined;
969
+ exportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree;
969
970
  exportCompressed(tree: TreeNode | TreeLeafValue, options: {
970
971
  oldestCompatibleClient: FluidClientVersion;
971
972
  idCompressor?: IIdCompressor;
@@ -1056,6 +1057,11 @@ export enum TreeCompressionStrategy {
1056
1057
  Uncompressed = 1
1057
1058
  }
1058
1059
 
1060
+ // @alpha
1061
+ export interface TreeEncodingOptions {
1062
+ readonly useStoredKeys?: boolean;
1063
+ }
1064
+
1059
1065
  // @public
1060
1066
  export type TreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = FieldSchema> = TSchema extends FieldSchema<infer Kind, infer Types> ? ApplyKind<TreeNodeFromImplicitAllowedTypes<Types>, Kind> : TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : TreeNode | TreeLeafValue | undefined;
1061
1067
 
@@ -1167,6 +1173,17 @@ export type TreeObjectNode<T extends RestrictiveStringRecord<ImplicitFieldSchema
1167
1173
  // @public
1168
1174
  export type TreeObjectNodeUnsafe<T extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName, NodeKind.Object, T>;
1169
1175
 
1176
+ // @alpha @sealed (undocumented)
1177
+ export interface TreeSchema extends SimpleTreeSchema {
1178
+ readonly definitions: ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;
1179
+ readonly root: FieldSchemaAlpha;
1180
+ }
1181
+
1182
+ // @alpha
1183
+ export interface TreeSchemaEncodingOptions extends TreeEncodingOptions {
1184
+ readonly requireFieldsWithDefaults?: boolean;
1185
+ }
1186
+
1170
1187
  // @public
1171
1188
  export enum TreeStatus {
1172
1189
  Deleted = 2,
@@ -1211,6 +1228,13 @@ export class TreeViewConfiguration<const TSchema extends ImplicitFieldSchema = I
1211
1228
  protected _typeCheck: MakeNominal;
1212
1229
  }
1213
1230
 
1231
+ // @alpha @sealed
1232
+ export class TreeViewConfigurationAlpha<const TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> extends TreeViewConfiguration<TSchema> implements TreeSchema {
1233
+ constructor(props: ITreeViewConfiguration<TSchema>);
1234
+ readonly definitions: ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;
1235
+ readonly root: FieldSchemaAlpha;
1236
+ }
1237
+
1214
1238
  // @public @sealed
1215
1239
  export interface TreeViewEvents {
1216
1240
  commitApplied(data: CommitMetadata, getRevertible?: RevertibleFactory): void;
package/dist/alpha.d.ts CHANGED
@@ -107,7 +107,6 @@ export {
107
107
  ArrayNodeSchema,
108
108
  BranchableTree,
109
109
  ConciseTree,
110
- EncodeOptions,
111
110
  FactoryContent,
112
111
  FactoryContentObject,
113
112
  FieldSchemaAlpha,
@@ -121,6 +120,7 @@ export {
121
120
  ForestTypeReference,
122
121
  HandleConverter,
123
122
  ICodecOptions,
123
+ ITreeAlpha,
124
124
  IdentifierIndex,
125
125
  Insertable,
126
126
  InsertableContent,
@@ -148,7 +148,6 @@ export {
148
148
  MapNodePojoEmulationSchema,
149
149
  MapNodeSchema,
150
150
  ObjectNodeSchema,
151
- ParseOptions,
152
151
  PopUnion,
153
152
  ReadSchema,
154
153
  ReadableField,
@@ -180,10 +179,14 @@ export {
180
179
  TreeBranchEvents,
181
180
  TreeBranchFork,
182
181
  TreeCompressionStrategy,
182
+ TreeEncodingOptions,
183
183
  TreeIndex,
184
184
  TreeIndexKey,
185
185
  TreeIndexNodes,
186
+ TreeSchema,
187
+ TreeSchemaEncodingOptions,
186
188
  TreeViewAlpha,
189
+ TreeViewConfigurationAlpha,
187
190
  UnionToTuple,
188
191
  UnsafeUnknownSchema,
189
192
  ValueSchema,
@@ -203,6 +206,7 @@ export {
203
206
  generateSchemaFromSimpleSchema,
204
207
  getBranch,
205
208
  getJsonSchema,
209
+ getSimpleSchema,
206
210
  independentInitializedView,
207
211
  independentView,
208
212
  noopValidator,
@@ -7,7 +7,7 @@ import type { Listenable } from "@fluidframework/core-interfaces";
7
7
  import { type IDisposable, disposeSymbol } from "../../util/index.js";
8
8
  import type { NodeIdentifierManager } from "../node-identifier/index.js";
9
9
  import type { FlexTreeField } from "./flexTreeTypes.js";
10
- import { type LazyEntity } from "./lazyEntity.js";
10
+ import type { LazyEntity } from "./lazyEntity.js";
11
11
  import type { ITreeCheckout } from "../../shared-tree/index.js";
12
12
  /**
13
13
  * Context for FlexTrees.
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAGrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CA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,CAAC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAC1C;;OAEG;IACH,IAAI,IAAI,IAAI,aAAa,CAAC;IAE1B,QAAQ,CAAC,cAAc,EAAE,qBAAqB,CAAC;IAE/C;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;CACjC;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,mDAAwB,CAAC;AAEjD;;;;GAIG;AACH,qBAAa,OAAQ,YAAW,uBAAuB,EAAE,WAAW;aAalD,YAAY,EAAE,YAAY;aAC1B,QAAQ,EAAE,aAAa;aACvB,cAAc,EAAE,qBAAqB;IAdtD,SAAgB,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,CAAa;IACzD,SAAgB,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,CAAa;IAEzD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IACjD,OAAO,CAAC,QAAQ,CAAS;IAEzB;;;;OAIG;gBAEc,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,aAAa,EACvB,cAAc,EAAE,qBAAqB;IAe/C,UAAU,IAAI,IAAI,IAAI,uBAAuB;IAIpD,IAAW,MAAM,IAAI,gBAAgB,CAEpC;IAED;;;OAGG;IACH,OAAO,CAAC,cAAc;IAQf,CAAC,aAAa,CAAC,IAAI,IAAI;IAa9B;;;;;OAKG;IACI,KAAK,IAAI,IAAI;IAQpB,IAAW,IAAI,IAAI,aAAa,CAO/B;IAED,IAAW,MAAM,IAAI,UAAU,CAAC,YAAY,CAAC,CAE5C;CACD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,aAAa,EACvB,cAAc,EAAE,qBAAqB,GACnC,OAAO,CAET"}
@@ -8,7 +8,6 @@ exports.getTreeContext = exports.Context = exports.ContextSlot = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../core/index.js");
10
10
  const index_js_2 = require("../../util/index.js");
11
- const lazyEntity_js_1 = require("./lazyEntity.js");
12
11
  const lazyField_js_1 = require("./lazyField.js");
13
12
  /**
14
13
  * Creating multiple flex tree contexts for the same branch, and thus with the same underlying AnchorSet does not work due to how TreeNode caching works.
@@ -54,7 +53,7 @@ class Context {
54
53
  prepareForEdit() {
55
54
  (0, internal_1.assert)(this.disposed === false, 0x802 /* use after dispose */);
56
55
  for (const target of this.withCursors) {
57
- target[lazyEntity_js_1.prepareForEditSymbol]();
56
+ target.prepareForEdit();
58
57
  }
59
58
  (0, internal_1.assert)(this.withCursors.size === 0, 0x773 /* prepareForEdit should remove all cursors */);
60
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/context.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,kDAM6B;AAE7B,kDAAsE;AAItE,mDAAwE;AACxE,iDAA2C;AA8C3C;;;GAGG;AACU,QAAA,WAAW,GAAG,IAAA,qBAAU,GAAW,CAAC;AAEjD;;;;GAIG;AACH,MAAa,OAAO;IAOnB;;;;OAIG;IACH,YACiB,YAA0B,EAC1B,QAAuB,EACvB,cAAqC;QAFrC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,aAAQ,GAAR,QAAQ,CAAe;QACvB,mBAAc,GAAd,cAAc,CAAuB;QAdtC,gBAAW,GAAoB,IAAI,GAAG,EAAE,CAAC;QACzC,gBAAW,GAAoB,IAAI,GAAG,EAAE,CAAC;QAGjD,aAAQ,GAAG,KAAK,CAAC;QAYxB,IAAI,CAAC,eAAe,GAAG;YACtB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;gBACnD,IAAI,CAAC,cAAc,EAAE,CAAC;YACvB,CAAC,CAAC;SACF,CAAC;QAEF,IAAA,iBAAM,EACL,CAAC,IAAI,CAAC,QAAQ,CAAC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C,CAAC;IACjD,CAAC;IAED;;;;;OAKG;IACI,KAAK;QACX,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACvC,MAAM,CAAC,wBAAa,CAAC,EAAE,CAAC;QACzB,CAAC;QACD,IAAA,iBAAM,EAAC,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,EAAE,KAAK,CAAC,oCAAoC,CAAC,CAAC;QAChF,IAAA,iBAAM,EAAC,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,EAAE,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACjF,CAAC;IAED,IAAW,IAAI;QACd,IAAA,iBAAM,EAAC,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC3D,IAAA,8BAAmB,EAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAClD,MAAM,KAAK,GAAG,IAAA,wBAAS,EAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACxE,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,CAAC;CACD;AAzFD,0BAyFC;AAED;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC7B,MAAoB,EACpB,QAAuB,EACvB,cAAqC;IAErC,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AACtD,CAAC;AAND,wCAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ForestEvents,\n\ttype SchemaPolicy,\n\ttype TreeStoredSchema,\n\tanchorSlot,\n\tmoveToDetachedField,\n} from \"../../core/index.js\";\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport { type IDisposable, disposeSymbol } from \"../../util/index.js\";\nimport type { NodeIdentifierManager } from \"../node-identifier/index.js\";\n\nimport type { FlexTreeField } from \"./flexTreeTypes.js\";\nimport { type LazyEntity, prepareForEditSymbol } from \"./lazyEntity.js\";\nimport { makeField } from \"./lazyField.js\";\nimport type { ITreeCheckout } from \"../../shared-tree/index.js\";\n\n/**\n * Context for FlexTrees.\n */\nexport interface FlexTreeContext {\n\t/**\n\t * Schema used within this context.\n\t * All data must conform to these schema.\n\t */\n\treadonly schema: TreeStoredSchema;\n\n\t/**\n\t * SchemaPolicy used within this context.\n\t */\n\treadonly schemaPolicy: SchemaPolicy;\n\n\t/**\n\t * If true, this context is the canonical context instance for a given view,\n\t * and its schema include all schema from the document.\n\t *\n\t * If false, this context was created for use in a unhydrated tree, and the full document schema is unknown.\n\t */\n\tisHydrated(): this is FlexTreeHydratedContext;\n}\n\n/**\n * A common context of a \"forest\" of FlexTrees.\n * It handles group operations like transforming cursors into anchors for edits.\n */\nexport interface FlexTreeHydratedContext extends FlexTreeContext {\n\treadonly events: Listenable<ForestEvents>;\n\t/**\n\t * Gets the root field of the tree.\n\t */\n\tget root(): FlexTreeField;\n\n\treadonly nodeKeyManager: NodeIdentifierManager;\n\n\t/**\n\t * The checkout object associated with this context.\n\t */\n\treadonly checkout: ITreeCheckout;\n}\n\n/**\n * Creating multiple flex tree contexts for the same branch, and thus with the same underlying AnchorSet does not work due to how TreeNode caching works.\n * This slot is used to detect if one already exists and error if creating a second.\n */\nexport const ContextSlot = anchorSlot<Context>();\n\n/**\n * Implementation of `FlexTreeContext`.\n *\n * @remarks An editor is required to edit the FlexTree.\n */\nexport class Context implements FlexTreeHydratedContext, IDisposable {\n\tpublic readonly withCursors: Set<LazyEntity> = new Set();\n\tpublic readonly withAnchors: Set<LazyEntity> = new Set();\n\n\tprivate readonly eventUnregister: (() => void)[];\n\tprivate disposed = false;\n\n\t/**\n\t * @param flexSchema - Schema to use when working with the tree.\n\t * @param checkout - The checkout.\n\t * @param nodeKeyManager - An object which handles node key generation and conversion\n\t */\n\tpublic constructor(\n\t\tpublic readonly schemaPolicy: SchemaPolicy,\n\t\tpublic readonly checkout: ITreeCheckout,\n\t\tpublic readonly nodeKeyManager: NodeIdentifierManager,\n\t) {\n\t\tthis.eventUnregister = [\n\t\t\tthis.checkout.forest.events.on(\"beforeChange\", () => {\n\t\t\t\tthis.prepareForEdit();\n\t\t\t}),\n\t\t];\n\n\t\tassert(\n\t\t\t!this.checkout.forest.anchors.slots.has(ContextSlot),\n\t\t\t0x92b /* Cannot create second flex-tree from checkout */,\n\t\t);\n\t\tthis.checkout.forest.anchors.slots.set(ContextSlot, this);\n\t}\n\n\tpublic isHydrated(): this is FlexTreeHydratedContext {\n\t\treturn true;\n\t}\n\n\tpublic get schema(): TreeStoredSchema {\n\t\treturn this.checkout.storedSchema;\n\t}\n\n\t/**\n\t * Called before editing.\n\t * Clears all cursors so editing can proceed.\n\t */\n\tprivate prepareForEdit(): void {\n\t\tassert(this.disposed === false, 0x802 /* use after dispose */);\n\t\tfor (const target of this.withCursors) {\n\t\t\ttarget[prepareForEditSymbol]();\n\t\t}\n\t\tassert(this.withCursors.size === 0, 0x773 /* prepareForEdit should remove all cursors */);\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\tassert(this.disposed === false, 0x803 /* double dispose */);\n\t\tthis.disposed = true;\n\t\tthis.clear();\n\t\tfor (const unregister of this.eventUnregister) {\n\t\t\tunregister();\n\t\t}\n\t\tthis.eventUnregister.length = 0;\n\n\t\tconst deleted = this.checkout.forest.anchors.slots.delete(ContextSlot);\n\t\tassert(deleted, 0x8c4 /* unexpected dispose */);\n\t}\n\n\t/**\n\t * Release any cursors and anchors held by tree entities created in this context.\n\t * Ensures the cashed references to those entities on the Anchors are also cleared.\n\t * The tree entities are invalid to use after this, but the context may still be used\n\t * to create new trees starting from the root.\n\t */\n\tpublic clear(): void {\n\t\tfor (const target of this.withAnchors) {\n\t\t\ttarget[disposeSymbol]();\n\t\t}\n\t\tassert(this.withCursors.size === 0, 0x774 /* free should remove all cursors */);\n\t\tassert(this.withAnchors.size === 0, 0x775 /* free should remove all anchors */);\n\t}\n\n\tpublic get root(): FlexTreeField {\n\t\tassert(this.disposed === false, 0x804 /* use after dispose */);\n\t\tconst cursor = this.checkout.forest.allocateCursor(\"root\");\n\t\tmoveToDetachedField(this.checkout.forest, cursor);\n\t\tconst field = makeField(this, this.schema.rootFieldSchema.kind, cursor);\n\t\tcursor.free();\n\t\treturn field;\n\t}\n\n\tpublic get events(): Listenable<ForestEvents> {\n\t\treturn this.checkout.forest.events;\n\t}\n}\n\n/**\n * A simple API for a Forest to interact with the tree.\n *\n * @param forest - the Forest\n * @param editor - an editor that makes changes to the forest.\n * @param nodeKeyManager - an object which handles node key generation and conversion.\n * @returns {@link FlexTreeContext} which is used to manage the cursors and anchors within the FlexTrees:\n * This is necessary for supporting using this tree across edits to the forest, and not leaking memory.\n */\nexport function getTreeContext(\n\tschema: SchemaPolicy,\n\tcheckout: ITreeCheckout,\n\tnodeKeyManager: NodeIdentifierManager,\n): Context {\n\treturn new Context(schema, checkout, nodeKeyManager);\n}\n"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/context.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,kDAM6B;AAE7B,kDAAsE;AAKtE,iDAA2C;AA8C3C;;;GAGG;AACU,QAAA,WAAW,GAAG,IAAA,qBAAU,GAAW,CAAC;AAEjD;;;;GAIG;AACH,MAAa,OAAO;IAOnB;;;;OAIG;IACH,YACiB,YAA0B,EAC1B,QAAuB,EACvB,cAAqC;QAFrC,iBAAY,GAAZ,YAAY,CA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AAC,IAAI,EAAE,CAAC;QACd,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,CAAC;CACD;AAzFD,0BAyFC;AAED;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC7B,MAAoB,EACpB,QAAuB,EACvB,cAAqC;IAErC,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AACtD,CAAC;AAND,wCAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ForestEvents,\n\ttype SchemaPolicy,\n\ttype TreeStoredSchema,\n\tanchorSlot,\n\tmoveToDetachedField,\n} from \"../../core/index.js\";\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport { type IDisposable, disposeSymbol } from \"../../util/index.js\";\nimport type { NodeIdentifierManager } from \"../node-identifier/index.js\";\n\nimport type { FlexTreeField } from \"./flexTreeTypes.js\";\nimport type { LazyEntity } from \"./lazyEntity.js\";\nimport { makeField } from \"./lazyField.js\";\nimport type { ITreeCheckout } from \"../../shared-tree/index.js\";\n\n/**\n * Context for FlexTrees.\n */\nexport interface FlexTreeContext {\n\t/**\n\t * Schema used within this context.\n\t * All data must conform to these schema.\n\t */\n\treadonly schema: TreeStoredSchema;\n\n\t/**\n\t * SchemaPolicy used within this context.\n\t */\n\treadonly schemaPolicy: SchemaPolicy;\n\n\t/**\n\t * If true, this context is the canonical context instance for a given view,\n\t * and its schema include all schema from the document.\n\t *\n\t * If false, this context was created for use in a unhydrated tree, and the full document schema is unknown.\n\t */\n\tisHydrated(): this is FlexTreeHydratedContext;\n}\n\n/**\n * A common context of a \"forest\" of FlexTrees.\n * It handles group operations like transforming cursors into anchors for edits.\n */\nexport interface FlexTreeHydratedContext extends FlexTreeContext {\n\treadonly events: Listenable<ForestEvents>;\n\t/**\n\t * Gets the root field of the tree.\n\t */\n\tget root(): FlexTreeField;\n\n\treadonly nodeKeyManager: NodeIdentifierManager;\n\n\t/**\n\t * The checkout object associated with this context.\n\t */\n\treadonly checkout: ITreeCheckout;\n}\n\n/**\n * Creating multiple flex tree contexts for the same branch, and thus with the same underlying AnchorSet does not work due to how TreeNode caching works.\n * This slot is used to detect if one already exists and error if creating a second.\n */\nexport const ContextSlot = anchorSlot<Context>();\n\n/**\n * Implementation of `FlexTreeContext`.\n *\n * @remarks An editor is required to edit the FlexTree.\n */\nexport class Context implements FlexTreeHydratedContext, IDisposable {\n\tpublic readonly withCursors: Set<LazyEntity> = new Set();\n\tpublic readonly withAnchors: Set<LazyEntity> = new Set();\n\n\tprivate readonly eventUnregister: (() => void)[];\n\tprivate disposed = false;\n\n\t/**\n\t * @param flexSchema - Schema to use when working with the tree.\n\t * @param checkout - The checkout.\n\t * @param nodeKeyManager - An object which handles node key generation and conversion\n\t */\n\tpublic constructor(\n\t\tpublic readonly schemaPolicy: SchemaPolicy,\n\t\tpublic readonly checkout: ITreeCheckout,\n\t\tpublic readonly nodeKeyManager: NodeIdentifierManager,\n\t) {\n\t\tthis.eventUnregister = [\n\t\t\tthis.checkout.forest.events.on(\"beforeChange\", () => {\n\t\t\t\tthis.prepareForEdit();\n\t\t\t}),\n\t\t];\n\n\t\tassert(\n\t\t\t!this.checkout.forest.anchors.slots.has(ContextSlot),\n\t\t\t0x92b /* Cannot create second flex-tree from checkout */,\n\t\t);\n\t\tthis.checkout.forest.anchors.slots.set(ContextSlot, this);\n\t}\n\n\tpublic isHydrated(): this is FlexTreeHydratedContext {\n\t\treturn true;\n\t}\n\n\tpublic get schema(): TreeStoredSchema {\n\t\treturn this.checkout.storedSchema;\n\t}\n\n\t/**\n\t * Called before editing.\n\t * Clears all cursors so editing can proceed.\n\t */\n\tprivate prepareForEdit(): void {\n\t\tassert(this.disposed === false, 0x802 /* use after dispose */);\n\t\tfor (const target of this.withCursors) {\n\t\t\ttarget.prepareForEdit();\n\t\t}\n\t\tassert(this.withCursors.size === 0, 0x773 /* prepareForEdit should remove all cursors */);\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\tassert(this.disposed === false, 0x803 /* double dispose */);\n\t\tthis.disposed = true;\n\t\tthis.clear();\n\t\tfor (const unregister of this.eventUnregister) {\n\t\t\tunregister();\n\t\t}\n\t\tthis.eventUnregister.length = 0;\n\n\t\tconst deleted = this.checkout.forest.anchors.slots.delete(ContextSlot);\n\t\tassert(deleted, 0x8c4 /* unexpected dispose */);\n\t}\n\n\t/**\n\t * Release any cursors and anchors held by tree entities created in this context.\n\t * Ensures the cashed references to those entities on the Anchors are also cleared.\n\t * The tree entities are invalid to use after this, but the context may still be used\n\t * to create new trees starting from the root.\n\t */\n\tpublic clear(): void {\n\t\tfor (const target of this.withAnchors) {\n\t\t\ttarget[disposeSymbol]();\n\t\t}\n\t\tassert(this.withCursors.size === 0, 0x774 /* free should remove all cursors */);\n\t\tassert(this.withAnchors.size === 0, 0x775 /* free should remove all anchors */);\n\t}\n\n\tpublic get root(): FlexTreeField {\n\t\tassert(this.disposed === false, 0x804 /* use after dispose */);\n\t\tconst cursor = this.checkout.forest.allocateCursor(\"root\");\n\t\tmoveToDetachedField(this.checkout.forest, cursor);\n\t\tconst field = makeField(this, this.schema.rootFieldSchema.kind, cursor);\n\t\tcursor.free();\n\t\treturn field;\n\t}\n\n\tpublic get events(): Listenable<ForestEvents> {\n\t\treturn this.checkout.forest.events;\n\t}\n}\n\n/**\n * A simple API for a Forest to interact with the tree.\n *\n * @param forest - the Forest\n * @param editor - an editor that makes changes to the forest.\n * @param nodeKeyManager - an object which handles node key generation and conversion.\n * @returns {@link FlexTreeContext} which is used to manage the cursors and anchors within the FlexTrees:\n * This is necessary for supporting using this tree across edits to the forest, and not leaking memory.\n */\nexport function getTreeContext(\n\tschema: SchemaPolicy,\n\tcheckout: ITreeCheckout,\n\tnodeKeyManager: NodeIdentifierManager,\n): Context {\n\treturn new Context(schema, checkout, nodeKeyManager);\n}\n"]}
@@ -6,7 +6,7 @@ export { type FlexTreeField, type FlexTreeNode, type FlexTreeEntity, type FlexTr
6
6
  export { visitBipartiteIterableTree, Skip, visitBipartiteIterableTreeWithState, visitIterableTree, visitIterableTreeWithState, } from "./navigation.js";
7
7
  export { getTreeContext, type FlexTreeContext, type FlexTreeHydratedContext, Context, ContextSlot, } from "./context.js";
8
8
  export { type FlexTreeNodeEvents } from "./treeEvents.js";
9
- export { assertFlexTreeEntityNotFreed, isFreedSymbol, LazyEntity, } from "./lazyEntity.js";
9
+ export { assertFlexTreeEntityNotFreed, LazyEntity, } from "./lazyEntity.js";
10
10
  export { getSchemaAndPolicy, indexForAt } from "./utilities.js";
11
11
  export { treeStatusFromAnchorCache } from "./utilities.js";
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,UAAU,EACV,KAAK,sBAAsB,EAC3B,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,YAAY,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,0BAA0B,EAC1B,IAAI,EACJ,mCAAmC,EACnC,iBAAiB,EACjB,0BAA0B,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,OAAO,EACP,WAAW,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EACN,4BAA4B,EAC5B,aAAa,EACb,UAAU,GACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,UAAU,EACV,KAAK,sBAAsB,EAC3B,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,YAAY,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,0BAA0B,EAC1B,IAAI,EACJ,mCAAmC,EACnC,iBAAiB,EACjB,0BAA0B,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,OAAO,EACP,WAAW,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EACN,4BAA4B,EAC5B,UAAU,GACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.treeStatusFromAnchorCache = exports.indexForAt = exports.getSchemaAndPolicy = exports.LazyEntity = exports.isFreedSymbol = exports.assertFlexTreeEntityNotFreed = exports.ContextSlot = exports.Context = exports.getTreeContext = exports.visitIterableTreeWithState = exports.visitIterableTree = exports.visitBipartiteIterableTreeWithState = exports.Skip = exports.visitBipartiteIterableTree = exports.flexTreeSlot = exports.isFlexTreeNode = exports.FlexTreeEntityKind = exports.flexTreeMarker = exports.TreeStatus = void 0;
7
+ exports.treeStatusFromAnchorCache = exports.indexForAt = exports.getSchemaAndPolicy = exports.LazyEntity = exports.assertFlexTreeEntityNotFreed = exports.ContextSlot = exports.Context = exports.getTreeContext = exports.visitIterableTreeWithState = exports.visitIterableTree = exports.visitBipartiteIterableTreeWithState = exports.Skip = exports.visitBipartiteIterableTree = exports.flexTreeSlot = exports.isFlexTreeNode = exports.FlexTreeEntityKind = exports.flexTreeMarker = exports.TreeStatus = void 0;
8
8
  var flexTreeTypes_js_1 = require("./flexTreeTypes.js");
9
9
  Object.defineProperty(exports, "TreeStatus", { enumerable: true, get: function () { return flexTreeTypes_js_1.TreeStatus; } });
10
10
  Object.defineProperty(exports, "flexTreeMarker", { enumerable: true, get: function () { return flexTreeTypes_js_1.flexTreeMarker; } });
@@ -23,7 +23,6 @@ Object.defineProperty(exports, "Context", { enumerable: true, get: function () {
23
23
  Object.defineProperty(exports, "ContextSlot", { enumerable: true, get: function () { return context_js_1.ContextSlot; } });
24
24
  var lazyEntity_js_1 = require("./lazyEntity.js");
25
25
  Object.defineProperty(exports, "assertFlexTreeEntityNotFreed", { enumerable: true, get: function () { return lazyEntity_js_1.assertFlexTreeEntityNotFreed; } });
26
- Object.defineProperty(exports, "isFreedSymbol", { enumerable: true, get: function () { return lazyEntity_js_1.isFreedSymbol; } });
27
26
  Object.defineProperty(exports, "LazyEntity", { enumerable: true, get: function () { return lazyEntity_js_1.LazyEntity; } });
28
27
  var utilities_js_1 = require("./utilities.js");
29
28
  Object.defineProperty(exports, "getSchemaAndPolicy", { enumerable: true, get: function () { return utilities_js_1.getSchemaAndPolicy; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAc4B;AAN3B,8GAAA,UAAU,OAAA;AAEV,kHAAA,cAAc,OAAA;AACd,sHAAA,kBAAkB,OAAA;AAClB,kHAAA,cAAc,OAAA;AACd,gHAAA,YAAY,OAAA;AAGb,iDAMyB;AALxB,2HAAA,0BAA0B,OAAA;AAC1B,qGAAA,IAAI,OAAA;AACJ,oIAAA,mCAAmC,OAAA;AACnC,kHAAA,iBAAiB,OAAA;AACjB,2HAAA,0BAA0B,OAAA;AAG3B,2CAMsB;AALrB,4GAAA,cAAc,OAAA;AAGd,qGAAA,OAAO,OAAA;AACP,yGAAA,WAAW,OAAA;AAKZ,iDAIyB;AAHxB,6HAAA,4BAA4B,OAAA;AAC5B,8GAAA,aAAa,OAAA;AACb,2GAAA,UAAU,OAAA;AAGX,+CAAgE;AAAvD,kHAAA,kBAAkB,OAAA;AAAE,0GAAA,UAAU,OAAA;AAEvC,+CAA2D;AAAlD,yHAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeEntity,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\tTreeStatus,\n\ttype FlexTreeUnknownUnboxed,\n\tflexTreeMarker,\n\tFlexTreeEntityKind,\n\tisFlexTreeNode,\n\tflexTreeSlot,\n} from \"./flexTreeTypes.js\";\n\nexport {\n\tvisitBipartiteIterableTree,\n\tSkip,\n\tvisitBipartiteIterableTreeWithState,\n\tvisitIterableTree,\n\tvisitIterableTreeWithState,\n} from \"./navigation.js\";\n\nexport {\n\tgetTreeContext,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\tContext,\n\tContextSlot,\n} from \"./context.js\";\n\nexport { type FlexTreeNodeEvents } from \"./treeEvents.js\";\n\nexport {\n\tassertFlexTreeEntityNotFreed,\n\tisFreedSymbol,\n\tLazyEntity,\n} from \"./lazyEntity.js\";\n\nexport { getSchemaAndPolicy, indexForAt } from \"./utilities.js\";\n\nexport { treeStatusFromAnchorCache } from \"./utilities.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAc4B;AAN3B,8GAAA,UAAU,OAAA;AAEV,kHAAA,cAAc,OAAA;AACd,sHAAA,kBAAkB,OAAA;AAClB,kHAAA,cAAc,OAAA;AACd,gHAAA,YAAY,OAAA;AAGb,iDAMyB;AALxB,2HAAA,0BAA0B,OAAA;AAC1B,qGAAA,IAAI,OAAA;AACJ,oIAAA,mCAAmC,OAAA;AACnC,kHAAA,iBAAiB,OAAA;AACjB,2HAAA,0BAA0B,OAAA;AAG3B,2CAMsB;AALrB,4GAAA,cAAc,OAAA;AAGd,qGAAA,OAAO,OAAA;AACP,yGAAA,WAAW,OAAA;AAKZ,iDAGyB;AAFxB,6HAAA,4BAA4B,OAAA;AAC5B,2GAAA,UAAU,OAAA;AAGX,+CAAgE;AAAvD,kHAAA,kBAAkB,OAAA;AAAE,0GAAA,UAAU,OAAA;AAEvC,+CAA2D;AAAlD,yHAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeEntity,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\tTreeStatus,\n\ttype FlexTreeUnknownUnboxed,\n\tflexTreeMarker,\n\tFlexTreeEntityKind,\n\tisFlexTreeNode,\n\tflexTreeSlot,\n} from \"./flexTreeTypes.js\";\n\nexport {\n\tvisitBipartiteIterableTree,\n\tSkip,\n\tvisitBipartiteIterableTreeWithState,\n\tvisitIterableTree,\n\tvisitIterableTreeWithState,\n} from \"./navigation.js\";\n\nexport {\n\tgetTreeContext,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\tContext,\n\tContextSlot,\n} from \"./context.js\";\n\nexport { type FlexTreeNodeEvents } from \"./treeEvents.js\";\n\nexport {\n\tassertFlexTreeEntityNotFreed,\n\tLazyEntity,\n} from \"./lazyEntity.js\";\n\nexport { getSchemaAndPolicy, indexForAt } from \"./utilities.js\";\n\nexport { treeStatusFromAnchorCache } from \"./utilities.js\";\n"]}
@@ -6,15 +6,6 @@ import { type ITreeSubscriptionCursor, TreeNavigationResult } from "../../core/i
6
6
  import { type IDisposable, disposeSymbol } from "../../util/index.js";
7
7
  import type { Context } from "./context.js";
8
8
  import { type FlexTreeEntity, type FlexTreeEntityKind, flexTreeMarker } from "./flexTreeTypes.js";
9
- export declare const prepareForEditSymbol: unique symbol;
10
- export declare const isFreedSymbol: unique symbol;
11
- export declare const tryMoveCursorToAnchorSymbol: unique symbol;
12
- export declare const forgetAnchorSymbol: unique symbol;
13
- export declare const cursorSymbol: unique symbol;
14
- /**
15
- * Symbol used to access the (generic) anchor of a {@link LazyEntity}.
16
- */
17
- export declare const anchorSymbol: unique symbol;
18
9
  /**
19
10
  * Assert `entity` is not deleted.
20
11
  * @privateRemarks
@@ -28,18 +19,18 @@ export declare function assertFlexTreeEntityNotFreed(entity: FlexTreeEntity): vo
28
19
  export declare abstract class LazyEntity<TAnchor = unknown> implements FlexTreeEntity, IDisposable {
29
20
  #private;
30
21
  readonly context: Context;
31
- readonly [anchorSymbol]: TAnchor;
22
+ readonly anchor: TAnchor;
32
23
  protected constructor(context: Context, cursor: ITreeSubscriptionCursor, anchor: TAnchor);
33
24
  abstract boxedIterator(): IterableIterator<FlexTreeEntity>;
34
25
  abstract get [flexTreeMarker](): FlexTreeEntityKind;
35
26
  [disposeSymbol](): void;
36
- [prepareForEditSymbol](): void;
37
- [isFreedSymbol](): boolean;
38
- get [cursorSymbol](): ITreeSubscriptionCursor;
39
- protected abstract [tryMoveCursorToAnchorSymbol](cursor: ITreeSubscriptionCursor): TreeNavigationResult;
27
+ prepareForEdit(): void;
28
+ isFreed(): boolean;
29
+ get cursor(): ITreeSubscriptionCursor;
30
+ protected abstract tryMoveCursorToAnchor(cursor: ITreeSubscriptionCursor): TreeNavigationResult;
40
31
  /**
41
32
  * Called when disposing of this target, iff it has an anchor.
42
33
  */
43
- protected abstract [forgetAnchorSymbol](): void;
34
+ protected abstract forgetAnchor(): void;
44
35
  }
45
36
  //# sourceMappingURL=lazyEntity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lazyEntity.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyEntity.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,uBAAuB,EAE5B,oBAAoB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,cAAc,EACd,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,oBAAoB,eAA2B,CAAC;AAC7D,eAAO,MAAM,aAAa,eAAoB,CAAC;AAC/C,eAAO,MAAM,2BAA2B,eAAkC,CAAC;AAC3E,eAAO,MAAM,kBAAkB,eAAyB,CAAC;AACzD,eAAO,MAAM,YAAY,eAAmB,CAAC;AAC7C;;GAEG;AACH,eAAO,MAAM,YAAY,eAAmB,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAGzE;AAED;;GAEG;AACH,8BAAsB,UAAU,CAAC,OAAO,GAAG,OAAO,CAAE,YAAW,cAAc,EAAE,WAAW;;aAKxE,OAAO,EAAE,OAAO;IAHjC,SAAgB,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AO,EAChC,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,OAAO;aAQA,aAAa,IAAI,gBAAgB,CAAC,cAAc,CAAC;IACjE,aAAoB,CAAC,cAAc,CAAC,IAAI,kBAAkB,CAAC;IAEpD,CAAC,aAAa,CAAC,IAAI,IAAI;IAOvB,cAAc,IAAI,IAAI;IAKtB,OAAO,IAAI,OAAO;IAIzB,IAAW,MAAM,IAAI,uBAAuB,CAkB3C;IAED,SAAS,CAAC,QAAQ,CAAC,qBAAqB,CACvC,MAAM,EAAE,uBAAuB,GAC7B,oBAAoB;IAEvB;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,YAAY,IAAI,IAAI;CACvC"}
@@ -16,20 +16,11 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
16
16
  };
17
17
  var _LazyEntity_lazyCursor;
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.LazyEntity = exports.assertFlexTreeEntityNotFreed = exports.anchorSymbol = exports.cursorSymbol = exports.forgetAnchorSymbol = exports.tryMoveCursorToAnchorSymbol = exports.isFreedSymbol = exports.prepareForEditSymbol = void 0;
19
+ exports.LazyEntity = exports.assertFlexTreeEntityNotFreed = void 0;
20
20
  const internal_1 = require("@fluidframework/core-utils/internal");
21
21
  const index_js_1 = require("../../core/index.js");
22
22
  const index_js_2 = require("../../util/index.js");
23
23
  const flexTreeTypes_js_1 = require("./flexTreeTypes.js");
24
- exports.prepareForEditSymbol = Symbol("prepareForEdit");
25
- exports.isFreedSymbol = Symbol("isFreed");
26
- exports.tryMoveCursorToAnchorSymbol = Symbol("tryMoveCursorToAnchor");
27
- exports.forgetAnchorSymbol = Symbol("forgetAnchor");
28
- exports.cursorSymbol = Symbol("cursor");
29
- /**
30
- * Symbol used to access the (generic) anchor of a {@link LazyEntity}.
31
- */
32
- exports.anchorSymbol = Symbol("anchor");
33
24
  /**
34
25
  * Assert `entity` is not deleted.
35
26
  * @privateRemarks
@@ -38,7 +29,7 @@ exports.anchorSymbol = Symbol("anchor");
38
29
  */
39
30
  function assertFlexTreeEntityNotFreed(entity) {
40
31
  (0, internal_1.assert)(entity instanceof LazyEntity, 0x8c9 /* unexpected implementation */);
41
- (0, internal_1.assert)(!entity[exports.isFreedSymbol](), 0x8ca /* Use after free */);
32
+ (0, internal_1.assert)(!entity.isFreed(), 0x8ca /* Use after free */);
42
33
  }
43
34
  exports.assertFlexTreeEntityNotFreed = assertFlexTreeEntityNotFreed;
44
35
  /**
@@ -48,7 +39,7 @@ class LazyEntity {
48
39
  constructor(context, cursor, anchor) {
49
40
  this.context = context;
50
41
  _LazyEntity_lazyCursor.set(this, void 0);
51
- this[exports.anchorSymbol] = anchor;
42
+ this.anchor = anchor;
52
43
  __classPrivateFieldSet(this, _LazyEntity_lazyCursor, cursor.fork("LazyEntity Fork"), "f");
53
44
  context.withCursors.add(this);
54
45
  this.context.withAnchors.add(this);
@@ -56,21 +47,21 @@ class LazyEntity {
56
47
  [(_LazyEntity_lazyCursor = new WeakMap(), index_js_2.disposeSymbol)]() {
57
48
  __classPrivateFieldGet(this, _LazyEntity_lazyCursor, "f").free();
58
49
  this.context.withCursors.delete(this);
59
- this[exports.forgetAnchorSymbol]();
50
+ this.forgetAnchor();
60
51
  this.context.withAnchors.delete(this);
61
52
  }
62
- [exports.prepareForEditSymbol]() {
53
+ prepareForEdit() {
63
54
  __classPrivateFieldGet(this, _LazyEntity_lazyCursor, "f").clear();
64
55
  this.context.withCursors.delete(this);
65
56
  }
66
- [exports.isFreedSymbol]() {
57
+ isFreed() {
67
58
  return __classPrivateFieldGet(this, _LazyEntity_lazyCursor, "f").state === index_js_1.ITreeSubscriptionCursorState.Freed;
68
59
  }
69
- get [exports.cursorSymbol]() {
60
+ get cursor() {
70
61
  if (__classPrivateFieldGet(this, _LazyEntity_lazyCursor, "f").state !== index_js_1.ITreeSubscriptionCursorState.Current) {
71
62
  (0, internal_1.assert)(__classPrivateFieldGet(this, _LazyEntity_lazyCursor, "f").state === index_js_1.ITreeSubscriptionCursorState.Cleared, 0x778 /* Unset cursor should be in cleared state */);
72
- (0, internal_1.assert)(this[exports.anchorSymbol] !== undefined, 0x779 /* FlexTree should have an anchor if it does not have a cursor */);
73
- const result = this[exports.tryMoveCursorToAnchorSymbol](__classPrivateFieldGet(this, _LazyEntity_lazyCursor, "f"));
63
+ (0, internal_1.assert)(this.anchor !== undefined, 0x779 /* FlexTree should have an anchor if it does not have a cursor */);
64
+ const result = this.tryMoveCursorToAnchor(__classPrivateFieldGet(this, _LazyEntity_lazyCursor, "f"));
74
65
  (0, internal_1.assert)(result === 1 /* TreeNavigationResult.Ok */, 0x77a /* It is invalid to access a FlexTree node which no longer exists */);
75
66
  this.context.withCursors.add(this);
76
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"lazyEntity.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyEntity.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAEH,kEAA6D;AAE7D,kDAI6B;AAC7B,kDAAsE;AAGtE,yDAI4B;AAEf,QAAA,oBAAoB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAChD,QAAA,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAClC,QAAA,2BAA2B,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAC9D,QAAA,kBAAkB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAC5C,QAAA,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC7C;;GAEG;AACU,QAAA,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAE7C;;;;;GAKG;AACH,SAAgB,4BAA4B,CAAC,MAAsB;IAClE,IAAA,iBAAM,EAAC,MAAM,YAAY,UAAU,EAAE,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC5E,IAAA,iBAAM,EAAC,CAAC,MAAM,CAAC,qBAAa,CAAC,EAAE,EAAE,KAAK,CAAC,oBA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;YACF,IAAA,iBAAM,EACL,IAAI,CAAC,oBAAY,CAAC,KAAK,SAAS,EAChC,KAAK,CAAC,iEAAiE,CACvE,CAAC;YACF,MAAM,MAAM,GAAG,IAAI,CAAC,mCAA2B,CAAC,CAAC,uBAAA,IAAI,8BAAY,CAAC,CAAC;YACnE,IAAA,iBAAM,EACL,MAAM,oCAA4B,EAClC,KAAK,CAAC,oEAAoE,CAC1E,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,uBAAA,IAAI,8BAAY,CAAC;IACzB,CAAC;CAUD;AA9DD,gCA8DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\tTreeNavigationResult,\n} from \"../../core/index.js\";\nimport { type IDisposable, disposeSymbol } from \"../../util/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport {\n\ttype FlexTreeEntity,\n\ttype FlexTreeEntityKind,\n\tflexTreeMarker,\n} from \"./flexTreeTypes.js\";\n\nexport const prepareForEditSymbol = Symbol(\"prepareForEdit\");\nexport const isFreedSymbol = Symbol(\"isFreed\");\nexport const tryMoveCursorToAnchorSymbol = Symbol(\"tryMoveCursorToAnchor\");\nexport const forgetAnchorSymbol = Symbol(\"forgetAnchor\");\nexport const cursorSymbol = Symbol(\"cursor\");\n/**\n * Symbol used to access the (generic) anchor of a {@link LazyEntity}.\n */\nexport const anchorSymbol = Symbol(\"anchor\");\n\n/**\n * Assert `entity` is not deleted.\n * @privateRemarks\n * This can be faster than getting the tree status and checking that since that can require computing removed vs deleted.\n * TODO: provide a non implementation dependent way to leverage this optimization.\n */\nexport function assertFlexTreeEntityNotFreed(entity: FlexTreeEntity): void {\n\tassert(entity instanceof LazyEntity, 0x8c9 /* unexpected implementation */);\n\tassert(!entity[isFreedSymbol](), 0x8ca /* Use after free */);\n}\n\n/**\n * This is a base class for lazy (cursor based) UntypedEntity implementations, which uniformly handles cursors and anchors.\n */\nexport abstract class LazyEntity<TAnchor = unknown> implements FlexTreeEntity, IDisposable {\n\treadonly #lazyCursor: ITreeSubscriptionCursor;\n\tpublic readonly [anchorSymbol]: TAnchor;\n\n\tprotected constructor(\n\t\tpublic readonly context: Context,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tanchor: TAnchor,\n\t) {\n\t\tthis[anchorSymbol] = anchor;\n\t\tthis.#lazyCursor = cursor.fork(\"LazyEntity Fork\");\n\t\tcontext.withCursors.add(this);\n\t\tthis.context.withAnchors.add(this);\n\t}\n\n\tpublic abstract boxedIterator(): IterableIterator<FlexTreeEntity>;\n\tpublic abstract get [flexTreeMarker](): FlexTreeEntityKind;\n\n\tpublic [disposeSymbol](): void {\n\t\tthis.#lazyCursor.free();\n\t\tthis.context.withCursors.delete(this);\n\t\tthis[forgetAnchorSymbol]();\n\t\tthis.context.withAnchors.delete(this);\n\t}\n\n\tpublic [prepareForEditSymbol](): void {\n\t\tthis.#lazyCursor.clear();\n\t\tthis.context.withCursors.delete(this);\n\t}\n\n\tpublic [isFreedSymbol](): boolean {\n\t\treturn this.#lazyCursor.state === ITreeSubscriptionCursorState.Freed;\n\t}\n\n\tpublic get [cursorSymbol](): ITreeSubscriptionCursor {\n\t\tif (this.#lazyCursor.state !== ITreeSubscriptionCursorState.Current) {\n\t\t\tassert(\n\t\t\t\tthis.#lazyCursor.state === ITreeSubscriptionCursorState.Cleared,\n\t\t\t\t0x778 /* Unset cursor should be in cleared state */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tthis[anchorSymbol] !== undefined,\n\t\t\t\t0x779 /* FlexTree should have an anchor if it does not have a cursor */,\n\t\t\t);\n\t\t\tconst result = this[tryMoveCursorToAnchorSymbol](this.#lazyCursor);\n\t\t\tassert(\n\t\t\t\tresult === TreeNavigationResult.Ok,\n\t\t\t\t0x77a /* It is invalid to access a FlexTree node which no longer exists */,\n\t\t\t);\n\t\t\tthis.context.withCursors.add(this);\n\t\t}\n\t\treturn this.#lazyCursor;\n\t}\n\n\tprotected abstract [tryMoveCursorToAnchorSymbol](\n\t\tcursor: ITreeSubscriptionCursor,\n\t): TreeNavigationResult;\n\n\t/**\n\t * Called when disposing of this target, iff it has an anchor.\n\t */\n\tprotected abstract [forgetAnchorSymbol](): void;\n}\n"]}
1
+ {"version":3,"file":"lazyEntity.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyEntity.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAEH,kEAA6D;AAE7D,kDAI6B;AAC7B,kDAAsE;AAGtE,yDAI4B;AAE5B;;;;;GAKG;AACH,SAAgB,4BAA4B,CAAC,MAAsB;IAClE,IAAA,iBAAM,EAAC,MAAM,YAAY,UAAU,EAAE,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC5E,IAAA,iBAAM,EAAC,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACvD,CAAC;AAHD,oEAGC;AAED;;GAEG;AACH,MAAsB,UAAU;IAI/B,YACiB,OAAgB,EAChC,MAA+B,EAC/B,MAAe;QAFC,YAAO,GAAP,OAAO,CAAS;QAJxB,yCAAqC;QAQ7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,uBAAA,IAAI,0BAAe,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAA,CAAC;QAClD,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAKM,0CAAC,wBAAa,EAAC;QACrB,uBAAA,IAAI,8BAAY,CAAC,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAEM,cAAc;QACpB,uBAAA,IAAI,8BAAY,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAEM,OAAO;QACb,OAAO,uBAAA,IAAI,8BAAY,CAAC,KAAK,KAAK,uCAA4B,CAAC,KAAK,CAAC;IACtE,CAAC;IAED,IAAW,MAAM;QAChB,IAAI,uBAAA,IAAI,8BAAY,CAAC,KAAK,KAAK,uCAA4B,CAAC,OAAO,EAAE,CAAC;YACrE,IAAA,iBAAM,EACL,uBAAA,IAAI,8BAAY,CAAC,KAAK,KAAK,uCAA4B,CAAC,OAAO,EAC/D,KAAK,CAAC,6CAA6C,CACnD,CAAC;YACF,IAAA,iBAAM,EACL,IAAI,CAAC,MAAM,KAAK,SAAS,EACzB,KAAK,CAAC,iEAAiE,CACvE,CAAC;YACF,MAAM,MAAM,GAAG,IAAI,CAAC,qBAAqB,CAAC,uBAAA,IAAI,8BAAY,CAAC,CAAC;YAC5D,IAAA,iBAAM,EACL,MAAM,oCAA4B,EAClC,KAAK,CAAC,oEAAoE,CAC1E,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,uBAAA,IAAI,8BAAY,CAAC;IACzB,CAAC;CAUD;AA9DD,gCA8DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\tTreeNavigationResult,\n} from \"../../core/index.js\";\nimport { type IDisposable, disposeSymbol } from \"../../util/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport {\n\ttype FlexTreeEntity,\n\ttype FlexTreeEntityKind,\n\tflexTreeMarker,\n} from \"./flexTreeTypes.js\";\n\n/**\n * Assert `entity` is not deleted.\n * @privateRemarks\n * This can be faster than getting the tree status and checking that since that can require computing removed vs deleted.\n * TODO: provide a non implementation dependent way to leverage this optimization.\n */\nexport function assertFlexTreeEntityNotFreed(entity: FlexTreeEntity): void {\n\tassert(entity instanceof LazyEntity, 0x8c9 /* unexpected implementation */);\n\tassert(!entity.isFreed(), 0x8ca /* Use after free */);\n}\n\n/**\n * This is a base class for lazy (cursor based) UntypedEntity implementations, which uniformly handles cursors and anchors.\n */\nexport abstract class LazyEntity<TAnchor = unknown> implements FlexTreeEntity, IDisposable {\n\treadonly #lazyCursor: ITreeSubscriptionCursor;\n\tpublic readonly anchor: TAnchor;\n\n\tprotected constructor(\n\t\tpublic readonly context: Context,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tanchor: TAnchor,\n\t) {\n\t\tthis.anchor = anchor;\n\t\tthis.#lazyCursor = cursor.fork(\"LazyEntity Fork\");\n\t\tcontext.withCursors.add(this);\n\t\tthis.context.withAnchors.add(this);\n\t}\n\n\tpublic abstract boxedIterator(): IterableIterator<FlexTreeEntity>;\n\tpublic abstract get [flexTreeMarker](): FlexTreeEntityKind;\n\n\tpublic [disposeSymbol](): void {\n\t\tthis.#lazyCursor.free();\n\t\tthis.context.withCursors.delete(this);\n\t\tthis.forgetAnchor();\n\t\tthis.context.withAnchors.delete(this);\n\t}\n\n\tpublic prepareForEdit(): void {\n\t\tthis.#lazyCursor.clear();\n\t\tthis.context.withCursors.delete(this);\n\t}\n\n\tpublic isFreed(): boolean {\n\t\treturn this.#lazyCursor.state === ITreeSubscriptionCursorState.Freed;\n\t}\n\n\tpublic get cursor(): ITreeSubscriptionCursor {\n\t\tif (this.#lazyCursor.state !== ITreeSubscriptionCursorState.Current) {\n\t\t\tassert(\n\t\t\t\tthis.#lazyCursor.state === ITreeSubscriptionCursorState.Cleared,\n\t\t\t\t0x778 /* Unset cursor should be in cleared state */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tthis.anchor !== undefined,\n\t\t\t\t0x779 /* FlexTree should have an anchor if it does not have a cursor */,\n\t\t\t);\n\t\t\tconst result = this.tryMoveCursorToAnchor(this.#lazyCursor);\n\t\t\tassert(\n\t\t\t\tresult === TreeNavigationResult.Ok,\n\t\t\t\t0x77a /* It is invalid to access a FlexTree node which no longer exists */,\n\t\t\t);\n\t\t\tthis.context.withCursors.add(this);\n\t\t}\n\t\treturn this.#lazyCursor;\n\t}\n\n\tprotected abstract tryMoveCursorToAnchor(\n\t\tcursor: ITreeSubscriptionCursor,\n\t): TreeNavigationResult;\n\n\t/**\n\t * Called when disposing of this target, iff it has an anchor.\n\t */\n\tprotected abstract forgetAnchor(): void;\n}\n"]}
@@ -7,7 +7,7 @@ import { type IDefaultEditBuilder, type OptionalFieldEditBuilder, type SequenceF
7
7
  import type { FlexFieldKind } from "../modular-schema/index.js";
8
8
  import type { Context } from "./context.js";
9
9
  import { FlexTreeEntityKind, type FlexTreeField, type FlexTreeNode, type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeTypedField, type FlexTreeUnknownUnboxed, flexTreeMarker } from "./flexTreeTypes.js";
10
- import { LazyEntity, forgetAnchorSymbol, tryMoveCursorToAnchorSymbol } from "./lazyEntity.js";
10
+ import { LazyEntity } from "./lazyEntity.js";
11
11
  export declare function makeField(context: Context, schema: FieldKindIdentifier, cursor: ITreeSubscriptionCursor): FlexTreeField;
12
12
  /**
13
13
  * Base type for fields implementing {@link FlexTreeField} using cursors.
@@ -24,8 +24,8 @@ export declare abstract class LazyField extends LazyEntity<FieldAnchor> implemen
24
24
  constructor(context: Context, schema: FieldKindIdentifier, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
25
25
  is<TKind2 extends FlexFieldKind>(kind: TKind2): this is FlexTreeTypedField<TKind2>;
26
26
  get parent(): FlexTreeNode | undefined;
27
- protected [tryMoveCursorToAnchorSymbol](cursor: ITreeSubscriptionCursor): TreeNavigationResult;
28
- protected [forgetAnchorSymbol](): void;
27
+ protected tryMoveCursorToAnchor(cursor: ITreeSubscriptionCursor): TreeNavigationResult;
28
+ protected forgetAnchor(): void;
29
29
  get length(): number;
30
30
  atIndex(index: number): FlexTreeUnknownUnboxed;
31
31
  boxedAt(index: number): FlexTreeNode | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"lazyField.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAGN,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAIzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAGN,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACN,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAE3B,cAAc,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,UAAU,EAGV,kBAAkB,EAElB,2BAA2B,EAC3B,MAAM,iBAAiB,CAAC;AAqBzB,wBAAgB,SAAS,CACxB,OAAO,EAAE,OAAO,EAChB,MAAM,EAA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