@fluidframework/tree 2.74.0-365691 → 2.74.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 (856) hide show
  1. package/.vscode/settings.json +4 -2
  2. package/CHANGELOG.md +11 -0
  3. package/api-report/tree.alpha.api.md +125 -87
  4. package/api-report/tree.beta.api.md +0 -1
  5. package/api-report/tree.legacy.beta.api.md +0 -1
  6. package/api-report/tree.legacy.public.api.md +0 -1
  7. package/api-report/tree.public.api.md +0 -1
  8. package/assertTagging.config.mjs +1 -1
  9. package/dist/alpha.d.ts +6 -2
  10. package/dist/codec/codec.d.ts +41 -13
  11. package/dist/codec/codec.d.ts.map +1 -1
  12. package/dist/codec/codec.js +46 -19
  13. package/dist/codec/codec.js.map +1 -1
  14. package/dist/codec/versioned/codec.d.ts +1 -1
  15. package/dist/codec/versioned/codec.d.ts.map +1 -1
  16. package/dist/codec/versioned/codec.js.map +1 -1
  17. package/dist/codec/versioned/format.d.ts +4 -1
  18. package/dist/codec/versioned/format.d.ts.map +1 -1
  19. package/dist/codec/versioned/format.js +4 -1
  20. package/dist/codec/versioned/format.js.map +1 -1
  21. package/dist/core/index.d.ts +2 -2
  22. package/dist/core/index.d.ts.map +1 -1
  23. package/dist/core/index.js +4 -3
  24. package/dist/core/index.js.map +1 -1
  25. package/dist/core/rebase/index.d.ts +1 -1
  26. package/dist/core/rebase/index.d.ts.map +1 -1
  27. package/dist/core/rebase/index.js.map +1 -1
  28. package/dist/core/rebase/types.d.ts +20 -1
  29. package/dist/core/rebase/types.d.ts.map +1 -1
  30. package/dist/core/rebase/types.js.map +1 -1
  31. package/dist/core/schema-stored/schema.d.ts +4 -7
  32. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  33. package/dist/core/schema-stored/schema.js +2 -2
  34. package/dist/core/schema-stored/schema.js.map +1 -1
  35. package/dist/core/tree/detachedFieldIndex.d.ts +34 -13
  36. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  37. package/dist/core/tree/detachedFieldIndex.js +12 -12
  38. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  39. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
  40. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  41. package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -2
  42. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  43. package/dist/core/tree/index.d.ts +3 -2
  44. package/dist/core/tree/index.d.ts.map +1 -1
  45. package/dist/core/tree/index.js +3 -0
  46. package/dist/core/tree/index.js.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  48. package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -2
  49. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  50. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
  51. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  52. package/dist/feature-libraries/chunked-forest/codec/format.js +4 -4
  53. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  54. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  55. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  56. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  58. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  59. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
  60. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  61. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +22 -26
  62. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  63. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  64. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  65. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
  66. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  67. package/dist/feature-libraries/forest-summary/codec.d.ts +7 -1
  68. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  69. package/dist/feature-libraries/forest-summary/codec.js +13 -11
  70. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  71. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -13
  72. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  73. package/dist/feature-libraries/forest-summary/forestSummarizer.js +35 -31
  74. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  75. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
  76. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
  77. package/dist/feature-libraries/forest-summary/formatCommon.js +27 -0
  78. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -0
  79. package/dist/feature-libraries/forest-summary/formatV1.d.ts +51 -0
  80. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
  81. package/dist/feature-libraries/forest-summary/formatV1.js +11 -0
  82. package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -0
  83. package/dist/feature-libraries/forest-summary/formatV2.d.ts +51 -0
  84. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
  85. package/dist/feature-libraries/forest-summary/formatV2.js +11 -0
  86. package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -0
  87. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +18 -24
  88. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  89. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +21 -43
  90. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  91. package/dist/feature-libraries/forest-summary/index.d.ts +2 -2
  92. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  93. package/dist/feature-libraries/forest-summary/index.js +3 -4
  94. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  95. package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
  96. package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
  97. package/dist/feature-libraries/forest-summary/summaryFormatCommon.js +43 -0
  98. package/dist/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
  99. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
  100. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
  101. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js +14 -0
  102. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
  103. package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
  104. package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
  105. package/dist/feature-libraries/forest-summary/summaryFormatV3.js +21 -0
  106. package/dist/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
  107. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +17 -0
  108. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  109. package/dist/feature-libraries/forest-summary/summaryTypes.js +35 -0
  110. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  111. package/dist/feature-libraries/index.d.ts +1 -1
  112. package/dist/feature-libraries/index.d.ts.map +1 -1
  113. package/dist/feature-libraries/index.js +3 -2
  114. package/dist/feature-libraries/index.js.map +1 -1
  115. package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
  116. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  117. package/dist/feature-libraries/modular-schema/comparison.js +54 -3
  118. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  119. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  120. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  121. package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
  122. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  123. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  124. package/dist/feature-libraries/modular-schema/genericFieldKind.js +4 -1
  125. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  126. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  127. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  128. package/dist/feature-libraries/modular-schema/index.js +2 -1
  129. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  130. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  131. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
  132. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  133. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  134. package/dist/feature-libraries/schema-index/codec.js +4 -4
  135. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  136. package/dist/feature-libraries/schema-index/formatV1.d.ts +1 -1
  137. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
  138. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  139. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  140. package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
  141. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  142. package/dist/index.d.ts +2 -2
  143. package/dist/index.d.ts.map +1 -1
  144. package/dist/index.js +5 -3
  145. package/dist/index.js.map +1 -1
  146. package/dist/packageVersion.d.ts +1 -1
  147. package/dist/packageVersion.d.ts.map +1 -1
  148. package/dist/packageVersion.js +1 -1
  149. package/dist/packageVersion.js.map +1 -1
  150. package/dist/shared-tree/independentView.d.ts +1 -1
  151. package/dist/shared-tree/independentView.d.ts.map +1 -1
  152. package/dist/shared-tree/independentView.js +1 -1
  153. package/dist/shared-tree/independentView.js.map +1 -1
  154. package/dist/shared-tree/schematizingTreeView.d.ts +2 -1
  155. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  156. package/dist/shared-tree/schematizingTreeView.js +3 -0
  157. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  158. package/dist/shared-tree/sharedTree.d.ts +2 -2
  159. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  160. package/dist/shared-tree/sharedTree.js +4 -4
  161. package/dist/shared-tree/sharedTree.js.map +1 -1
  162. package/dist/shared-tree/sharedTreeChangeCodecs.js +2 -2
  163. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  164. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  165. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  166. package/dist/shared-tree/sharedTreeChangeEnricher.js +25 -11
  167. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  168. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  169. package/dist/shared-tree/treeAlpha.js +1 -1
  170. package/dist/shared-tree/treeAlpha.js.map +1 -1
  171. package/dist/shared-tree/treeCheckout.d.ts +10 -5
  172. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  173. package/dist/shared-tree/treeCheckout.js +72 -17
  174. package/dist/shared-tree/treeCheckout.js.map +1 -1
  175. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  176. package/dist/shared-tree-core/editManagerCodecs.js +10 -8
  177. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  178. package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  179. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  180. package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
  181. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  182. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +8 -30
  183. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  184. package/dist/shared-tree-core/editManagerFormatCommons.js +18 -9
  185. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  186. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +1 -1
  187. package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  188. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  189. package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  190. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  191. package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  192. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  193. package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
  194. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  195. package/dist/shared-tree-core/index.d.ts +5 -2
  196. package/dist/shared-tree-core/index.d.ts.map +1 -1
  197. package/dist/shared-tree-core/index.js +7 -1
  198. package/dist/shared-tree-core/index.js.map +1 -1
  199. package/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  200. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  201. package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
  202. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  203. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  204. package/dist/shared-tree-core/messageCodecs.js +12 -10
  205. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  206. package/dist/shared-tree-core/messageFormat.d.ts +9 -36
  207. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  208. package/dist/shared-tree-core/messageFormat.js +19 -9
  209. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  210. package/{lib/shared-tree-core/messageFormatV5.d.ts → dist/shared-tree-core/messageFormatVSharedBranches.d.ts} +5 -7
  211. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  212. package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  213. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  214. package/dist/shared-tree-core/sharedTreeCore.d.ts +13 -47
  215. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  216. package/dist/shared-tree-core/sharedTreeCore.js +29 -17
  217. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  218. package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
  219. package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
  220. package/dist/shared-tree-core/summaryTypes.js +47 -0
  221. package/dist/shared-tree-core/summaryTypes.js.map +1 -0
  222. package/dist/shared-tree-core/versionedSummarizer.d.ts +72 -0
  223. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  224. package/dist/shared-tree-core/versionedSummarizer.js +64 -0
  225. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
  226. package/dist/simple-tree/api/configuration.d.ts +3 -26
  227. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  228. package/dist/simple-tree/api/configuration.js +10 -21
  229. package/dist/simple-tree/api/configuration.js.map +1 -1
  230. package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
  231. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  232. package/dist/simple-tree/api/dirtyIndex.js +7 -0
  233. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  234. package/dist/simple-tree/api/discrepancies.d.ts +1 -1
  235. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  236. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  237. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
  238. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
  239. package/dist/simple-tree/api/eraseSchemaDetails.js +97 -0
  240. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -0
  241. package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
  242. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  243. package/dist/simple-tree/api/getSimpleSchema.js +9 -3
  244. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  245. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  246. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  247. package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
  248. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  249. package/dist/simple-tree/api/index.d.ts +4 -4
  250. package/dist/simple-tree/api/index.d.ts.map +1 -1
  251. package/dist/simple-tree/api/index.js +8 -5
  252. package/dist/simple-tree/api/index.js.map +1 -1
  253. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  254. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  255. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  256. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  257. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  258. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  259. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  260. package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
  261. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  262. package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
  263. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  264. package/dist/simple-tree/api/schemaFromSimple.js +5 -0
  265. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  266. package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
  267. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  268. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  269. package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
  270. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  271. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  272. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  273. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  274. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  275. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  276. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
  277. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  278. package/dist/simple-tree/api/storedSchema.d.ts +1 -1
  279. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  280. package/dist/simple-tree/api/storedSchema.js +1 -2
  281. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  282. package/dist/simple-tree/api/tree.d.ts +15 -2
  283. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  284. package/dist/simple-tree/api/tree.js.map +1 -1
  285. package/dist/simple-tree/api/typesUnsafe.d.ts +3 -3
  286. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  287. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  288. package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
  289. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  290. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  291. package/dist/simple-tree/core/index.d.ts +1 -1
  292. package/dist/simple-tree/core/index.d.ts.map +1 -1
  293. package/dist/simple-tree/core/index.js +2 -3
  294. package/dist/simple-tree/core/index.js.map +1 -1
  295. package/dist/simple-tree/core/toStored.d.ts +17 -15
  296. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  297. package/dist/simple-tree/core/toStored.js +5 -40
  298. package/dist/simple-tree/core/toStored.js.map +1 -1
  299. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  300. package/dist/simple-tree/core/treeNode.js +1 -0
  301. package/dist/simple-tree/core/treeNode.js.map +1 -1
  302. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  303. package/dist/simple-tree/core/walkSchema.js +4 -0
  304. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  305. package/dist/simple-tree/createContext.d.ts.map +1 -1
  306. package/dist/simple-tree/createContext.js +20 -5
  307. package/dist/simple-tree/createContext.js.map +1 -1
  308. package/dist/simple-tree/fieldSchema.d.ts +3 -3
  309. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  310. package/dist/simple-tree/fieldSchema.js.map +1 -1
  311. package/dist/simple-tree/index.d.ts +6 -5
  312. package/dist/simple-tree/index.d.ts.map +1 -1
  313. package/dist/simple-tree/index.js +16 -11
  314. package/dist/simple-tree/index.js.map +1 -1
  315. package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
  316. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  317. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  318. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  319. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  320. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  321. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  322. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  323. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  324. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  325. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  326. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  327. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  328. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  329. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  330. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  331. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  332. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  333. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  334. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  335. package/dist/simple-tree/simpleSchema.d.ts +55 -23
  336. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  337. package/dist/simple-tree/simpleSchema.js +17 -0
  338. package/dist/simple-tree/simpleSchema.js.map +1 -1
  339. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  340. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  341. package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
  342. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  343. package/dist/simple-tree/toStoredSchema.d.ts +58 -11
  344. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  345. package/dist/simple-tree/toStoredSchema.js +205 -30
  346. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  347. package/dist/simple-tree/treeSchema.d.ts +23 -0
  348. package/dist/simple-tree/treeSchema.d.ts.map +1 -0
  349. package/dist/simple-tree/treeSchema.js +25 -0
  350. package/dist/simple-tree/treeSchema.js.map +1 -0
  351. package/dist/tableSchema.d.ts +107 -64
  352. package/dist/tableSchema.d.ts.map +1 -1
  353. package/dist/tableSchema.js +161 -60
  354. package/dist/tableSchema.js.map +1 -1
  355. package/dist/util/brand.d.ts +49 -0
  356. package/dist/util/brand.d.ts.map +1 -1
  357. package/dist/util/brand.js +47 -1
  358. package/dist/util/brand.js.map +1 -1
  359. package/dist/util/index.d.ts +2 -1
  360. package/dist/util/index.d.ts.map +1 -1
  361. package/dist/util/index.js +6 -2
  362. package/dist/util/index.js.map +1 -1
  363. package/dist/util/readSnapshotBlob.d.ts +13 -0
  364. package/dist/util/readSnapshotBlob.d.ts.map +1 -0
  365. package/dist/util/readSnapshotBlob.js +18 -0
  366. package/dist/util/readSnapshotBlob.js.map +1 -0
  367. package/eslint.config.mts +98 -0
  368. package/lib/alpha.d.ts +6 -2
  369. package/lib/codec/codec.d.ts +41 -13
  370. package/lib/codec/codec.d.ts.map +1 -1
  371. package/lib/codec/codec.js +40 -13
  372. package/lib/codec/codec.js.map +1 -1
  373. package/lib/codec/versioned/codec.d.ts +1 -1
  374. package/lib/codec/versioned/codec.d.ts.map +1 -1
  375. package/lib/codec/versioned/codec.js.map +1 -1
  376. package/lib/codec/versioned/format.d.ts +4 -1
  377. package/lib/codec/versioned/format.d.ts.map +1 -1
  378. package/lib/codec/versioned/format.js +4 -1
  379. package/lib/codec/versioned/format.js.map +1 -1
  380. package/lib/core/index.d.ts +2 -2
  381. package/lib/core/index.d.ts.map +1 -1
  382. package/lib/core/index.js +1 -1
  383. package/lib/core/index.js.map +1 -1
  384. package/lib/core/rebase/index.d.ts +1 -1
  385. package/lib/core/rebase/index.d.ts.map +1 -1
  386. package/lib/core/rebase/index.js.map +1 -1
  387. package/lib/core/rebase/types.d.ts +20 -1
  388. package/lib/core/rebase/types.d.ts.map +1 -1
  389. package/lib/core/rebase/types.js.map +1 -1
  390. package/lib/core/schema-stored/schema.d.ts +4 -7
  391. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  392. package/lib/core/schema-stored/schema.js +3 -3
  393. package/lib/core/schema-stored/schema.js.map +1 -1
  394. package/lib/core/tree/detachedFieldIndex.d.ts +34 -13
  395. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  396. package/lib/core/tree/detachedFieldIndex.js +12 -12
  397. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  398. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
  399. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  400. package/lib/core/tree/detachedFieldIndexFormatCommon.js +3 -3
  401. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  402. package/lib/core/tree/index.d.ts +3 -2
  403. package/lib/core/tree/index.d.ts.map +1 -1
  404. package/lib/core/tree/index.js +2 -1
  405. package/lib/core/tree/index.js.map +1 -1
  406. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  407. package/lib/feature-libraries/chunked-forest/codec/codecs.js +3 -3
  408. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  409. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
  410. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  411. package/lib/feature-libraries/chunked-forest/codec/format.js +5 -5
  412. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  413. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  414. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  415. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  416. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  417. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  418. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
  419. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  420. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +23 -27
  421. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  422. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  423. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  424. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
  425. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  426. package/lib/feature-libraries/forest-summary/codec.d.ts +7 -1
  427. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  428. package/lib/feature-libraries/forest-summary/codec.js +12 -11
  429. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  430. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -13
  431. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  432. package/lib/feature-libraries/forest-summary/forestSummarizer.js +33 -29
  433. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  434. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
  435. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
  436. package/lib/feature-libraries/forest-summary/formatCommon.js +23 -0
  437. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -0
  438. package/lib/feature-libraries/forest-summary/formatV1.d.ts +51 -0
  439. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
  440. package/lib/feature-libraries/forest-summary/formatV1.js +8 -0
  441. package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -0
  442. package/lib/feature-libraries/forest-summary/formatV2.d.ts +51 -0
  443. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
  444. package/lib/feature-libraries/forest-summary/formatV2.js +8 -0
  445. package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -0
  446. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +18 -24
  447. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  448. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +20 -42
  449. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  450. package/lib/feature-libraries/forest-summary/index.d.ts +2 -2
  451. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  452. package/lib/feature-libraries/forest-summary/index.js +2 -2
  453. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  454. package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
  455. package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
  456. package/lib/feature-libraries/forest-summary/summaryFormatCommon.js +40 -0
  457. package/lib/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
  458. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
  459. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
  460. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js +11 -0
  461. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
  462. package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
  463. package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
  464. package/lib/feature-libraries/forest-summary/summaryFormatV3.js +18 -0
  465. package/lib/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
  466. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +17 -0
  467. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  468. package/lib/feature-libraries/forest-summary/summaryTypes.js +30 -0
  469. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  470. package/lib/feature-libraries/index.d.ts +1 -1
  471. package/lib/feature-libraries/index.d.ts.map +1 -1
  472. package/lib/feature-libraries/index.js +1 -1
  473. package/lib/feature-libraries/index.js.map +1 -1
  474. package/lib/feature-libraries/modular-schema/comparison.d.ts +18 -2
  475. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  476. package/lib/feature-libraries/modular-schema/comparison.js +55 -5
  477. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  478. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  479. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  480. package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
  481. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  482. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  483. package/lib/feature-libraries/modular-schema/genericFieldKind.js +4 -1
  484. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  485. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  486. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  487. package/lib/feature-libraries/modular-schema/index.js +1 -1
  488. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  489. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  490. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
  491. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  492. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  493. package/lib/feature-libraries/schema-index/codec.js +5 -5
  494. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  495. package/lib/feature-libraries/schema-index/formatV1.d.ts +1 -1
  496. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
  497. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  498. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  499. package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
  500. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  501. package/lib/index.d.ts +2 -2
  502. package/lib/index.d.ts.map +1 -1
  503. package/lib/index.js +1 -1
  504. package/lib/index.js.map +1 -1
  505. package/lib/packageVersion.d.ts +1 -1
  506. package/lib/packageVersion.d.ts.map +1 -1
  507. package/lib/packageVersion.js +1 -1
  508. package/lib/packageVersion.js.map +1 -1
  509. package/lib/shared-tree/independentView.d.ts +1 -1
  510. package/lib/shared-tree/independentView.d.ts.map +1 -1
  511. package/lib/shared-tree/independentView.js +2 -2
  512. package/lib/shared-tree/independentView.js.map +1 -1
  513. package/lib/shared-tree/schematizingTreeView.d.ts +2 -1
  514. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  515. package/lib/shared-tree/schematizingTreeView.js +3 -0
  516. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  517. package/lib/shared-tree/sharedTree.d.ts +2 -2
  518. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  519. package/lib/shared-tree/sharedTree.js +4 -4
  520. package/lib/shared-tree/sharedTree.js.map +1 -1
  521. package/lib/shared-tree/sharedTreeChangeCodecs.js +2 -2
  522. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  523. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  524. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  525. package/lib/shared-tree/sharedTreeChangeEnricher.js +25 -11
  526. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  527. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  528. package/lib/shared-tree/treeAlpha.js +2 -2
  529. package/lib/shared-tree/treeAlpha.js.map +1 -1
  530. package/lib/shared-tree/treeCheckout.d.ts +10 -5
  531. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  532. package/lib/shared-tree/treeCheckout.js +73 -18
  533. package/lib/shared-tree/treeCheckout.js.map +1 -1
  534. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  535. package/lib/shared-tree-core/editManagerCodecs.js +11 -9
  536. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  537. package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  538. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  539. package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
  540. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  541. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +8 -30
  542. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  543. package/lib/shared-tree-core/editManagerFormatCommons.js +19 -10
  544. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  545. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +1 -1
  546. package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  547. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  548. package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  549. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  550. package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  551. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  552. package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
  553. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  554. package/lib/shared-tree-core/index.d.ts +5 -2
  555. package/lib/shared-tree-core/index.d.ts.map +1 -1
  556. package/lib/shared-tree-core/index.js +3 -1
  557. package/lib/shared-tree-core/index.js.map +1 -1
  558. package/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  559. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  560. package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
  561. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  562. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  563. package/lib/shared-tree-core/messageCodecs.js +13 -11
  564. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  565. package/lib/shared-tree-core/messageFormat.d.ts +9 -36
  566. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  567. package/lib/shared-tree-core/messageFormat.js +19 -9
  568. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  569. package/{dist/shared-tree-core/messageFormatV5.d.ts → lib/shared-tree-core/messageFormatVSharedBranches.d.ts} +5 -7
  570. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  571. package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  572. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  573. package/lib/shared-tree-core/sharedTreeCore.d.ts +13 -47
  574. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  575. package/lib/shared-tree-core/sharedTreeCore.js +27 -15
  576. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  577. package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
  578. package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
  579. package/lib/shared-tree-core/summaryTypes.js +43 -0
  580. package/lib/shared-tree-core/summaryTypes.js.map +1 -0
  581. package/lib/shared-tree-core/versionedSummarizer.d.ts +72 -0
  582. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  583. package/lib/shared-tree-core/versionedSummarizer.js +60 -0
  584. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
  585. package/lib/simple-tree/api/configuration.d.ts +3 -26
  586. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  587. package/lib/simple-tree/api/configuration.js +14 -25
  588. package/lib/simple-tree/api/configuration.js.map +1 -1
  589. package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
  590. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  591. package/lib/simple-tree/api/dirtyIndex.js +7 -0
  592. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  593. package/lib/simple-tree/api/discrepancies.d.ts +1 -1
  594. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  595. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  596. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
  597. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
  598. package/lib/simple-tree/api/eraseSchemaDetails.js +92 -0
  599. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -0
  600. package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
  601. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  602. package/lib/simple-tree/api/getSimpleSchema.js +9 -3
  603. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  604. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  605. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  606. package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
  607. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  608. package/lib/simple-tree/api/index.d.ts +4 -4
  609. package/lib/simple-tree/api/index.d.ts.map +1 -1
  610. package/lib/simple-tree/api/index.js +3 -3
  611. package/lib/simple-tree/api/index.js.map +1 -1
  612. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  613. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  614. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  615. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  616. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  617. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  618. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  619. package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
  620. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  621. package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
  622. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  623. package/lib/simple-tree/api/schemaFromSimple.js +5 -0
  624. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  625. package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
  626. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  627. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  628. package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
  629. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  630. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  631. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  632. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  633. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  634. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  635. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
  636. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  637. package/lib/simple-tree/api/storedSchema.d.ts +1 -1
  638. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  639. package/lib/simple-tree/api/storedSchema.js +1 -2
  640. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  641. package/lib/simple-tree/api/tree.d.ts +15 -2
  642. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  643. package/lib/simple-tree/api/tree.js.map +1 -1
  644. package/lib/simple-tree/api/typesUnsafe.d.ts +3 -3
  645. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  646. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  647. package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
  648. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  649. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  650. package/lib/simple-tree/core/index.d.ts +1 -1
  651. package/lib/simple-tree/core/index.d.ts.map +1 -1
  652. package/lib/simple-tree/core/index.js +1 -1
  653. package/lib/simple-tree/core/index.js.map +1 -1
  654. package/lib/simple-tree/core/toStored.d.ts +17 -15
  655. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  656. package/lib/simple-tree/core/toStored.js +4 -37
  657. package/lib/simple-tree/core/toStored.js.map +1 -1
  658. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  659. package/lib/simple-tree/core/treeNode.js +1 -0
  660. package/lib/simple-tree/core/treeNode.js.map +1 -1
  661. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  662. package/lib/simple-tree/core/walkSchema.js +5 -1
  663. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  664. package/lib/simple-tree/createContext.d.ts.map +1 -1
  665. package/lib/simple-tree/createContext.js +20 -5
  666. package/lib/simple-tree/createContext.js.map +1 -1
  667. package/lib/simple-tree/fieldSchema.d.ts +3 -3
  668. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  669. package/lib/simple-tree/fieldSchema.js.map +1 -1
  670. package/lib/simple-tree/index.d.ts +6 -5
  671. package/lib/simple-tree/index.d.ts.map +1 -1
  672. package/lib/simple-tree/index.js +5 -4
  673. package/lib/simple-tree/index.js.map +1 -1
  674. package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
  675. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  676. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  677. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  678. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  679. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  680. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  681. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  682. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  683. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  684. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  685. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  686. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  687. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  688. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  689. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  690. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  691. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  692. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  693. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  694. package/lib/simple-tree/simpleSchema.d.ts +55 -23
  695. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  696. package/lib/simple-tree/simpleSchema.js +16 -1
  697. package/lib/simple-tree/simpleSchema.js.map +1 -1
  698. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  699. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  700. package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
  701. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  702. package/lib/simple-tree/toStoredSchema.d.ts +58 -11
  703. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  704. package/lib/simple-tree/toStoredSchema.js +204 -31
  705. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  706. package/lib/simple-tree/treeSchema.d.ts +23 -0
  707. package/lib/simple-tree/treeSchema.d.ts.map +1 -0
  708. package/lib/simple-tree/treeSchema.js +21 -0
  709. package/lib/simple-tree/treeSchema.js.map +1 -0
  710. package/lib/tableSchema.d.ts +107 -64
  711. package/lib/tableSchema.d.ts.map +1 -1
  712. package/lib/tableSchema.js +162 -61
  713. package/lib/tableSchema.js.map +1 -1
  714. package/lib/util/brand.d.ts +49 -0
  715. package/lib/util/brand.d.ts.map +1 -1
  716. package/lib/util/brand.js +44 -0
  717. package/lib/util/brand.js.map +1 -1
  718. package/lib/util/index.d.ts +2 -1
  719. package/lib/util/index.d.ts.map +1 -1
  720. package/lib/util/index.js +2 -1
  721. package/lib/util/index.js.map +1 -1
  722. package/lib/util/readSnapshotBlob.d.ts +13 -0
  723. package/lib/util/readSnapshotBlob.d.ts.map +1 -0
  724. package/lib/util/readSnapshotBlob.js +14 -0
  725. package/lib/util/readSnapshotBlob.js.map +1 -0
  726. package/package.json +24 -23
  727. package/src/codec/codec.ts +44 -14
  728. package/src/codec/versioned/codec.ts +1 -1
  729. package/src/codec/versioned/format.ts +4 -1
  730. package/src/core/index.ts +4 -1
  731. package/src/core/rebase/index.ts +1 -0
  732. package/src/core/rebase/types.ts +25 -0
  733. package/src/core/schema-stored/schema.ts +5 -7
  734. package/src/core/tree/detachedFieldIndex.ts +54 -13
  735. package/src/core/tree/detachedFieldIndexFormatCommon.ts +4 -7
  736. package/src/core/tree/index.ts +7 -2
  737. package/src/feature-libraries/chunked-forest/codec/codecs.ts +3 -2
  738. package/src/feature-libraries/chunked-forest/codec/format.ts +6 -9
  739. package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
  740. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
  741. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +22 -33
  742. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
  743. package/src/feature-libraries/forest-summary/codec.ts +22 -10
  744. package/src/feature-libraries/forest-summary/forestSummarizer.ts +77 -44
  745. package/src/feature-libraries/forest-summary/{format.ts → formatCommon.ts} +12 -13
  746. package/src/feature-libraries/forest-summary/formatV1.ts +12 -0
  747. package/src/feature-libraries/forest-summary/formatV2.ts +12 -0
  748. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +37 -56
  749. package/src/feature-libraries/forest-summary/index.ts +2 -2
  750. package/src/feature-libraries/forest-summary/summaryFormatCommon.ts +41 -0
  751. package/src/feature-libraries/forest-summary/summaryFormatV1ToV2.ts +11 -0
  752. package/src/feature-libraries/forest-summary/summaryFormatV3.ts +18 -0
  753. package/src/feature-libraries/forest-summary/summaryTypes.ts +41 -0
  754. package/src/feature-libraries/index.ts +1 -1
  755. package/src/feature-libraries/modular-schema/comparison.ts +64 -5
  756. package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
  757. package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -1
  758. package/src/feature-libraries/modular-schema/index.ts +1 -0
  759. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +2 -3
  760. package/src/feature-libraries/schema-index/codec.ts +7 -9
  761. package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
  762. package/src/index.ts +6 -2
  763. package/src/packageVersion.ts +1 -1
  764. package/src/shared-tree/independentView.ts +2 -3
  765. package/src/shared-tree/schematizingTreeView.ts +5 -0
  766. package/src/shared-tree/sharedTree.ts +20 -9
  767. package/src/shared-tree/sharedTreeChangeCodecs.ts +2 -2
  768. package/src/shared-tree/sharedTreeChangeEnricher.ts +31 -11
  769. package/src/shared-tree/treeAlpha.ts +2 -3
  770. package/src/shared-tree/treeCheckout.ts +103 -20
  771. package/src/shared-tree-core/editManagerCodecs.ts +11 -9
  772. package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
  773. package/src/shared-tree-core/editManagerFormatCommons.ts +22 -16
  774. package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
  775. package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
  776. package/src/shared-tree-core/index.ts +12 -3
  777. package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
  778. package/src/shared-tree-core/messageCodecs.ts +13 -11
  779. package/src/shared-tree-core/messageFormat.ts +23 -16
  780. package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
  781. package/src/shared-tree-core/sharedTreeCore.ts +63 -75
  782. package/src/shared-tree-core/summaryTypes.ts +122 -0
  783. package/src/shared-tree-core/versionedSummarizer.ts +114 -0
  784. package/src/simple-tree/api/configuration.ts +21 -68
  785. package/src/simple-tree/api/dirtyIndex.ts +11 -0
  786. package/src/simple-tree/api/discrepancies.ts +1 -1
  787. package/src/simple-tree/api/eraseSchemaDetails.ts +123 -0
  788. package/src/simple-tree/api/getSimpleSchema.ts +13 -6
  789. package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
  790. package/src/simple-tree/api/index.ts +7 -4
  791. package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
  792. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
  793. package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
  794. package/src/simple-tree/api/schemaFromSimple.ts +11 -5
  795. package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
  796. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  797. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
  798. package/src/simple-tree/api/storedSchema.ts +2 -2
  799. package/src/simple-tree/api/tree.ts +16 -1
  800. package/src/simple-tree/api/typesUnsafe.ts +7 -3
  801. package/src/simple-tree/core/allowedTypes.ts +3 -3
  802. package/src/simple-tree/core/index.ts +2 -2
  803. package/src/simple-tree/core/toStored.ts +22 -55
  804. package/src/simple-tree/core/treeNode.ts +1 -0
  805. package/src/simple-tree/core/walkSchema.ts +6 -0
  806. package/src/simple-tree/createContext.ts +29 -11
  807. package/src/simple-tree/fieldSchema.ts +10 -3
  808. package/src/simple-tree/index.ts +12 -10
  809. package/src/simple-tree/node-kinds/array/arrayNode.ts +5 -2
  810. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
  811. package/src/simple-tree/node-kinds/map/mapNode.ts +5 -2
  812. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
  813. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
  814. package/src/simple-tree/node-kinds/record/recordNode.ts +5 -2
  815. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
  816. package/src/simple-tree/simpleSchema.ts +79 -32
  817. package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
  818. package/src/simple-tree/toStoredSchema.ts +319 -61
  819. package/src/simple-tree/treeSchema.ts +54 -0
  820. package/src/tableSchema.ts +487 -173
  821. package/src/util/brand.ts +61 -0
  822. package/src/util/index.ts +5 -0
  823. package/src/util/readSnapshotBlob.ts +23 -0
  824. package/dist/feature-libraries/forest-summary/format.d.ts +0 -23
  825. package/dist/feature-libraries/forest-summary/format.d.ts.map +0 -1
  826. package/dist/feature-libraries/forest-summary/format.js +0 -24
  827. package/dist/feature-libraries/forest-summary/format.js.map +0 -1
  828. package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  829. package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  830. package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  831. package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
  832. package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  833. package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
  834. package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  835. package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
  836. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  837. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  838. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
  839. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  840. package/lib/feature-libraries/forest-summary/format.d.ts +0 -23
  841. package/lib/feature-libraries/forest-summary/format.d.ts.map +0 -1
  842. package/lib/feature-libraries/forest-summary/format.js +0 -21
  843. package/lib/feature-libraries/forest-summary/format.js.map +0 -1
  844. package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  845. package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  846. package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  847. package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
  848. package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  849. package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
  850. package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  851. package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
  852. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  853. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  854. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
  855. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  856. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
@@ -2,29 +2,41 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type DetachedFieldIndex, type IEditableForest, type RevisionTag, type TreeStoredSchemaRepository } from "../core/index.js";
5
+ import { type DetachedFieldIndex, type IEditableForest, type IForestSubscription, type ReadOnlyDetachedFieldIndex, type RevisionTag, type TreeStoredSchemaRepository } from "../core/index.js";
6
6
  import { disposeSymbol } from "../util/index.js";
7
7
  import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
8
8
  import type { ChangeEnricherMutableCheckout, ChangeEnricherReadonlyCheckout } from "../shared-tree-core/index.js";
9
9
  import type { IIdCompressor } from "@fluidframework/id-compressor";
10
10
  export declare class SharedTreeReadonlyChangeEnricher implements ChangeEnricherReadonlyCheckout<SharedTreeChange> {
11
- protected readonly forest: IEditableForest;
11
+ protected readonly borrowedForest: IForestSubscription;
12
12
  private readonly schema;
13
- protected readonly removedRoots: DetachedFieldIndex;
13
+ protected readonly borrowedRemovedRoots: ReadOnlyDetachedFieldIndex;
14
14
  private readonly idCompressor?;
15
15
  /**
16
- * @param forest - The state based on which to enrich changes.
17
- * Exclusively owned by the constructed instance.
16
+ * @param borrowedForest - The state based on which to enrich changes.
17
+ * Not owned by the constructed instance.
18
18
  * @param schema - The schema that corresponds to the forest.
19
- * @param removedRoots - The set of removed roots based on which to enrich changes.
20
- * Exclusively owned by the constructed instance.
19
+ * @param borrowedRemovedRoots - The set of removed roots based on which to enrich changes.
20
+ * Not owned by the constructed instance.
21
+ * @param idCompressor - The id compressor to use when chunking trees.
21
22
  */
22
- constructor(forest: IEditableForest, schema: TreeStoredSchemaRepository, removedRoots: DetachedFieldIndex, idCompressor?: IIdCompressor | undefined);
23
+ constructor(borrowedForest: IForestSubscription, schema: TreeStoredSchemaRepository, borrowedRemovedRoots: ReadOnlyDetachedFieldIndex, idCompressor?: IIdCompressor | undefined);
23
24
  fork(): ChangeEnricherMutableCheckout<SharedTreeChange>;
24
25
  updateChangeEnrichments(change: SharedTreeChange): SharedTreeChange;
25
26
  private readonly getDetachedRoot;
26
27
  }
27
28
  export declare class SharedTreeMutableChangeEnricher extends SharedTreeReadonlyChangeEnricher implements ChangeEnricherMutableCheckout<SharedTreeChange> {
29
+ private readonly forest;
30
+ private readonly removedRoots;
31
+ /**
32
+ * @param forest - The state based on which to enrich changes.
33
+ * Owned by the constructed instance.
34
+ * @param schema - The schema that corresponds to the forest.
35
+ * @param removedRoots - The set of removed roots based on which to enrich changes.
36
+ * Owned by the constructed instance.
37
+ * @param idCompressor - The id compressor to use when chunking trees.
38
+ */
39
+ constructor(forest: IEditableForest, schema: TreeStoredSchemaRepository, removedRoots: DetachedFieldIndex, idCompressor?: IIdCompressor);
28
40
  applyTipChange(change: SharedTreeChange, revision?: RevisionTag): void;
29
41
  [disposeSymbol](): void;
30
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTreeChangeEnricher.d.ts","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeEnricher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAGN,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,0BAA0B,EAG/B,MAAM,kBAAkB,CAAC;AAS1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EACX,6BA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,6BAA6B,EAC7B,8BAA8B,EAC9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,qBAAa,gCACZ,YAAW,8BAA8B,CAAC,gBAAgB,CAAC;IAW1D,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,mBAAmB;IACtD,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,0BAA0B;IACnE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAZ/B;;;;;;;OAOG;gBAEiB,cAAc,EAAE,mBAAmB,EACrC,MAAM,EAAE,0BAA0B,EAChC,oBAAoB,EAAE,0BAA0B,EAClD,YAAY,CAAC,2BAAe;IAGvC,IAAI,IAAI,6BAA6B,CAAC,gBAAgB,CAAC;IAQvD,uBAAuB,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB;IAS1E,OAAO,CAAC,QAAQ,CAAC,eAAe,CAa9B;CACF;AAED,qBAAa,+BACZ,SAAQ,gCACR,YAAW,6BAA6B,CAAC,gBAAgB,CAAC;IAWzD,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAX9B;;;;;;;OAOG;gBAEe,MAAM,EAAE,eAAe,EACxC,MAAM,EAAE,0BAA0B,EACjB,YAAY,EAAE,kBAAkB,EACjD,YAAY,CAAC,EAAE,aAAa;IAKtB,cAAc,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,IAAI;IAuBtE,CAAC,aAAa,CAAC,IAAI,IAAI;CAG9B"}
@@ -9,22 +9,23 @@ import { disposeSymbol } from "../util/index.js";
9
9
  import { updateRefreshers } from "./sharedTreeChangeFamily.js";
10
10
  export class SharedTreeReadonlyChangeEnricher {
11
11
  /**
12
- * @param forest - The state based on which to enrich changes.
13
- * Exclusively owned by the constructed instance.
12
+ * @param borrowedForest - The state based on which to enrich changes.
13
+ * Not owned by the constructed instance.
14
14
  * @param schema - The schema that corresponds to the forest.
15
- * @param removedRoots - The set of removed roots based on which to enrich changes.
16
- * Exclusively owned by the constructed instance.
15
+ * @param borrowedRemovedRoots - The set of removed roots based on which to enrich changes.
16
+ * Not owned by the constructed instance.
17
+ * @param idCompressor - The id compressor to use when chunking trees.
17
18
  */
18
- constructor(forest, schema, removedRoots, idCompressor) {
19
- this.forest = forest;
19
+ constructor(borrowedForest, schema, borrowedRemovedRoots, idCompressor) {
20
+ this.borrowedForest = borrowedForest;
20
21
  this.schema = schema;
21
- this.removedRoots = removedRoots;
22
+ this.borrowedRemovedRoots = borrowedRemovedRoots;
22
23
  this.idCompressor = idCompressor;
23
24
  this.getDetachedRoot = (id) => {
24
- const root = this.removedRoots.tryGetEntry(id);
25
+ const root = this.borrowedRemovedRoots.tryGetEntry(id);
25
26
  if (root !== undefined) {
26
- const cursor = this.forest.getCursorAboveDetachedFields();
27
- const parentField = this.removedRoots.toFieldKey(root);
27
+ const cursor = this.borrowedForest.getCursorAboveDetachedFields();
28
+ const parentField = this.borrowedRemovedRoots.toFieldKey(root);
28
29
  cursor.enterField(parentField);
29
30
  cursor.enterNode(0);
30
31
  return chunkTree(cursor, {
@@ -36,13 +37,26 @@ export class SharedTreeReadonlyChangeEnricher {
36
37
  };
37
38
  }
38
39
  fork() {
39
- return new SharedTreeMutableChangeEnricher(this.forest.clone(this.schema, new AnchorSet()), this.schema, this.removedRoots.clone());
40
+ return new SharedTreeMutableChangeEnricher(this.borrowedForest.clone(this.schema, new AnchorSet()), this.schema, this.borrowedRemovedRoots.clone());
40
41
  }
41
42
  updateChangeEnrichments(change) {
42
43
  return updateRefreshers(change, this.getDetachedRoot, relevantRemovedRoots, updateDataChangeRefreshers);
43
44
  }
44
45
  }
45
46
  export class SharedTreeMutableChangeEnricher extends SharedTreeReadonlyChangeEnricher {
47
+ /**
48
+ * @param forest - The state based on which to enrich changes.
49
+ * Owned by the constructed instance.
50
+ * @param schema - The schema that corresponds to the forest.
51
+ * @param removedRoots - The set of removed roots based on which to enrich changes.
52
+ * Owned by the constructed instance.
53
+ * @param idCompressor - The id compressor to use when chunking trees.
54
+ */
55
+ constructor(forest, schema, removedRoots, idCompressor) {
56
+ super(forest, schema, removedRoots, idCompressor);
57
+ this.forest = forest;
58
+ this.removedRoots = removedRoots;
59
+ }
46
60
  applyTipChange(change, revision) {
47
61
  for (const dataOrSchemaChange of change.changes) {
48
62
  const type = dataOrSchemaChange.type;
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTreeChangeEnricher.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeEnricher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EACN,SAAS,EAMT,SAAS,EACT,UAAU,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEN,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,gBAAgB,IAAI,0BAA0B,GAC9C,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAQ/D,MAAM,OAAO,gCAAgC;IAG5C;;;;;;OAMG;IACH,YACoB,MAAuB,EACzB,MAAkC,EAChC,YAAgC,EAClC,YAA4B;QAH1B,WAAM,GAAN,MAAM,CAAiB;QACzB,WAAM,GAAN,MAAM,CAA4B;QAChC,iBAAY,GAAZ,YAAY,CAAoB;QAClC,iBAAY,GAAZ,YAAY,CAAgB;QAoB7B,oBAAe,GAAG,CAAC,EAAuB,EAAyB,EAAE;YACrF,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAC/C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACxB,MAAM,MAAM,GAAG,IAA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OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;oBACxD,OAAO,CAAC,IAAI,EAAE,CAAC;oBACf,MAAM;gBACP,CAAC;gBACD,KAAK,QAAQ;oBACZ,6DAA6D;oBAC7D,mGAAmG;oBACnG,+FAA+F;oBAC/F,wDAAwD;oBACxD,MAAM;gBACP;oBACC,eAAe,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;QACF,CAAC;IACF,CAAC;IAEM,CAAC,aAAa,CAAC;QACrB,yEAAyE;IAC1E,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tAnchorSet,\n\ttype DeltaDetachedNodeId,\n\ttype DetachedFieldIndex,\n\ttype IEditableForest,\n\ttype RevisionTag,\n\ttype TreeStoredSchemaRepository,\n\ttagChange,\n\tvisitDelta,\n} from \"../core/index.js\";\nimport {\n\ttype TreeChunk,\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tupdateRefreshers as updateDataChangeRefreshers,\n} from \"../feature-libraries/index.js\";\nimport { disposeSymbol } from \"../util/index.js\";\nimport { updateRefreshers } from \"./sharedTreeChangeFamily.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport type {\n\tChangeEnricherMutableCheckout,\n\tChangeEnricherReadonlyCheckout,\n} from \"../shared-tree-core/index.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nexport class SharedTreeReadonlyChangeEnricher\n\timplements ChangeEnricherReadonlyCheckout<SharedTreeChange>\n{\n\t/**\n\t * @param forest - The state based on which to enrich changes.\n\t * Exclusively owned by the constructed instance.\n\t * @param schema - The schema that corresponds to the forest.\n\t * @param removedRoots - The set of removed roots based on which to enrich changes.\n\t * Exclusively owned by the constructed instance.\n\t */\n\tpublic constructor(\n\t\tprotected readonly forest: IEditableForest,\n\t\tprivate readonly schema: TreeStoredSchemaRepository,\n\t\tprotected readonly removedRoots: DetachedFieldIndex,\n\t\tprivate readonly idCompressor?: IIdCompressor,\n\t) {}\n\n\tpublic fork(): ChangeEnricherMutableCheckout<SharedTreeChange> {\n\t\treturn new SharedTreeMutableChangeEnricher(\n\t\t\tthis.forest.clone(this.schema, new AnchorSet()),\n\t\t\tthis.schema,\n\t\t\tthis.removedRoots.clone(),\n\t\t);\n\t}\n\n\tpublic updateChangeEnrichments(change: SharedTreeChange): SharedTreeChange {\n\t\treturn updateRefreshers(\n\t\t\tchange,\n\t\t\tthis.getDetachedRoot,\n\t\t\trelevantRemovedRoots,\n\t\t\tupdateDataChangeRefreshers,\n\t\t);\n\t}\n\n\tprivate readonly getDetachedRoot = (id: DeltaDetachedNodeId): TreeChunk | undefined => {\n\t\tconst root = this.removedRoots.tryGetEntry(id);\n\t\tif (root !== undefined) {\n\t\t\tconst cursor = this.forest.getCursorAboveDetachedFields();\n\t\t\tconst parentField = this.removedRoots.toFieldKey(root);\n\t\t\tcursor.enterField(parentField);\n\t\t\tcursor.enterNode(0);\n\t\t\treturn chunkTree(cursor, {\n\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t};\n}\n\nexport class SharedTreeMutableChangeEnricher\n\textends SharedTreeReadonlyChangeEnricher\n\timplements ChangeEnricherMutableCheckout<SharedTreeChange>\n{\n\tpublic applyTipChange(change: SharedTreeChange, revision?: RevisionTag): void {\n\t\tfor (const dataOrSchemaChange of change.changes) {\n\t\t\tconst type = dataOrSchemaChange.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"data\": {\n\t\t\t\t\tconst delta = intoDelta(tagChange(dataOrSchemaChange.innerChange, revision));\n\t\t\t\t\tconst visitor = this.forest.acquireVisitor();\n\t\t\t\t\tvisitDelta(delta, visitor, this.removedRoots, revision);\n\t\t\t\t\tvisitor.free();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"schema\":\n\t\t\t\t\t// This enricher doesn't need to maintain schema information.\n\t\t\t\t\t// Note that the refreshers being generated through `updateChangeEnrichments` will be encoded using\n\t\t\t\t\t// the schema that was used in the input context of the data changeset these refreshers are on.\n\t\t\t\t\t// See the encoding logic in SharedTreeCore for details.\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\t// TODO: in the future, forest and/or its AnchorSet may require disposal.\n\t}\n}\n"]}
1
+ {"version":3,"file":"sharedTreeChangeEnricher.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeEnricher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EACN,SAAS,EAQT,SAAS,EACT,UAAU,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEN,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,gBAAgB,IAAI,0BAA0B,GAC9C,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAQ/D,MAAM,OAAO,gCAAgC;IAG5C;;;;;;;OAOG;IACH,YACoB,cAAmC,EACrC,MAAkC,EAChC,oBAAgD,EAClD,YAA4B;QAH1B,mBAAc,GAAd,cAAc,CAAqB;QACrC,WAAM,GAAN,MAAM,CAA4B;QAChC,yBAAoB,GAApB,oBAAoB,CAA4B;QAClD,iBAAY,GAAZ,YAAY,CAAgB;QAoB7B,oBAAe,GAAG,CAAC,EAAuB,EAAyB,EAAE;YACrF,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YACvD,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AG,kBAAkB,CAAC,IAAI,CAAC;YACrC,QAAQ,IAAI,EAAE,CAAC;gBACd,KAAK,MAAM,CAAC,CAAC,CAAC;oBACb,MAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,kBAAkB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;oBAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;oBAC7C,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;oBACxD,OAAO,CAAC,IAAI,EAAE,CAAC;oBACf,MAAM;gBACP,CAAC;gBACD,KAAK,QAAQ;oBACZ,6DAA6D;oBAC7D,mGAAmG;oBACnG,+FAA+F;oBAC/F,wDAAwD;oBACxD,MAAM;gBACP;oBACC,eAAe,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;QACF,CAAC;IACF,CAAC;IAEM,CAAC,aAAa,CAAC;QACrB,yEAAyE;IAC1E,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tAnchorSet,\n\ttype DeltaDetachedNodeId,\n\ttype DetachedFieldIndex,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype ReadOnlyDetachedFieldIndex,\n\ttype RevisionTag,\n\ttype TreeStoredSchemaRepository,\n\ttagChange,\n\tvisitDelta,\n} from \"../core/index.js\";\nimport {\n\ttype TreeChunk,\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tupdateRefreshers as updateDataChangeRefreshers,\n} from \"../feature-libraries/index.js\";\nimport { disposeSymbol } from \"../util/index.js\";\nimport { updateRefreshers } from \"./sharedTreeChangeFamily.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport type {\n\tChangeEnricherMutableCheckout,\n\tChangeEnricherReadonlyCheckout,\n} from \"../shared-tree-core/index.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nexport class SharedTreeReadonlyChangeEnricher\n\timplements ChangeEnricherReadonlyCheckout<SharedTreeChange>\n{\n\t/**\n\t * @param borrowedForest - The state based on which to enrich changes.\n\t * Not owned by the constructed instance.\n\t * @param schema - The schema that corresponds to the forest.\n\t * @param borrowedRemovedRoots - The set of removed roots based on which to enrich changes.\n\t * Not owned by the constructed instance.\n\t * @param idCompressor - The id compressor to use when chunking trees.\n\t */\n\tpublic constructor(\n\t\tprotected readonly borrowedForest: IForestSubscription,\n\t\tprivate readonly schema: TreeStoredSchemaRepository,\n\t\tprotected readonly borrowedRemovedRoots: ReadOnlyDetachedFieldIndex,\n\t\tprivate readonly idCompressor?: IIdCompressor,\n\t) {}\n\n\tpublic fork(): ChangeEnricherMutableCheckout<SharedTreeChange> {\n\t\treturn new SharedTreeMutableChangeEnricher(\n\t\t\tthis.borrowedForest.clone(this.schema, new AnchorSet()),\n\t\t\tthis.schema,\n\t\t\tthis.borrowedRemovedRoots.clone(),\n\t\t);\n\t}\n\n\tpublic updateChangeEnrichments(change: SharedTreeChange): SharedTreeChange {\n\t\treturn updateRefreshers(\n\t\t\tchange,\n\t\t\tthis.getDetachedRoot,\n\t\t\trelevantRemovedRoots,\n\t\t\tupdateDataChangeRefreshers,\n\t\t);\n\t}\n\n\tprivate readonly getDetachedRoot = (id: DeltaDetachedNodeId): TreeChunk | undefined => {\n\t\tconst root = this.borrowedRemovedRoots.tryGetEntry(id);\n\t\tif (root !== undefined) {\n\t\t\tconst cursor = this.borrowedForest.getCursorAboveDetachedFields();\n\t\t\tconst parentField = this.borrowedRemovedRoots.toFieldKey(root);\n\t\t\tcursor.enterField(parentField);\n\t\t\tcursor.enterNode(0);\n\t\t\treturn chunkTree(cursor, {\n\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t};\n}\n\nexport class SharedTreeMutableChangeEnricher\n\textends SharedTreeReadonlyChangeEnricher\n\timplements ChangeEnricherMutableCheckout<SharedTreeChange>\n{\n\t/**\n\t * @param forest - The state based on which to enrich changes.\n\t * Owned by the constructed instance.\n\t * @param schema - The schema that corresponds to the forest.\n\t * @param removedRoots - The set of removed roots based on which to enrich changes.\n\t * Owned by the constructed instance.\n\t * @param idCompressor - The id compressor to use when chunking trees.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IEditableForest,\n\t\tschema: TreeStoredSchemaRepository,\n\t\tprivate readonly removedRoots: DetachedFieldIndex,\n\t\tidCompressor?: IIdCompressor,\n\t) {\n\t\tsuper(forest, schema, removedRoots, idCompressor);\n\t}\n\n\tpublic applyTipChange(change: SharedTreeChange, revision?: RevisionTag): void {\n\t\tfor (const dataOrSchemaChange of change.changes) {\n\t\t\tconst type = dataOrSchemaChange.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"data\": {\n\t\t\t\t\tconst delta = intoDelta(tagChange(dataOrSchemaChange.innerChange, revision));\n\t\t\t\t\tconst visitor = this.forest.acquireVisitor();\n\t\t\t\t\tvisitDelta(delta, visitor, this.removedRoots, revision);\n\t\t\t\t\tvisitor.free();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"schema\":\n\t\t\t\t\t// This enricher doesn't need to maintain schema information.\n\t\t\t\t\t// Note that the refreshers being generated through `updateChangeEnrichments` will be encoded using\n\t\t\t\t\t// the schema that was used in the input context of the data changeset these refreshers are on.\n\t\t\t\t\t// See the encoding logic in SharedTreeCore for details.\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\t// TODO: in the future, forest and/or its AnchorSet may require disposal.\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"treeAlpha.d.ts","sourceRo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G;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC;CACjC;AA4JD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,SAkUvB,CAAC"}
@@ -5,7 +5,7 @@
5
5
  import { assert, debugAssert, fail, unreachableCase, } from "@fluidframework/core-utils/internal";
6
6
  import { createIdCompressor } from "@fluidframework/id-compressor/internal";
7
7
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
8
- import { asIndex, getKernel, TreeNode, TreeBeta, tryGetSchema, createFromCursor, FieldKind, normalizeFieldSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, extractPersistedSchema, TreeViewConfigurationAlpha, getStoredKey, getPropertyKeyFromStoredKey, treeNodeApi, getIdentifierFromNode, unhydratedFlexTreeFromInsertable, getOrCreateNodeFromInnerNode, getOrCreateNodeFromInnerUnboxedNode, getInnerNode, NodeKind, tryGetTreeNodeForField, isObjectNodeSchema, isTreeNode, toInitialSchema, convertField, toUnhydratedSchema, importConcise, exportConcise, borrowCursorFromTreeNodeOrValue, contentSchemaSymbol, } from "../simple-tree/index.js";
8
+ import { asIndex, getKernel, TreeNode, TreeBeta, tryGetSchema, createFromCursor, FieldKind, normalizeFieldSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, extractPersistedSchema, TreeViewConfigurationAlpha, getStoredKey, getPropertyKeyFromStoredKey, treeNodeApi, getIdentifierFromNode, unhydratedFlexTreeFromInsertable, getOrCreateNodeFromInnerNode, getOrCreateNodeFromInnerUnboxedNode, getInnerNode, NodeKind, tryGetTreeNodeForField, isObjectNodeSchema, isTreeNode, toInitialSchema, importConcise, exportConcise, borrowCursorFromTreeNodeOrValue, contentSchemaSymbol, getUnhydratedContext, } from "../simple-tree/index.js";
9
9
  import { brand, extractFromOpaque } from "../util/index.js";
10
10
  import { FluidClientVersion, FormatValidatorNoOp, } from "../codec/index.js";
11
11
  import { EmptyKey } from "../core/index.js";
@@ -216,7 +216,7 @@ export const TreeAlpha = {
216
216
  return undefined;
217
217
  }
218
218
  const cursor = cursorFromVerbose(data, schemalessConfig);
219
- return createFromCursor(schema, cursor, convertField(normalizeFieldSchema(schema), toUnhydratedSchema));
219
+ return createFromCursor(schema, cursor, getUnhydratedContext(schema).flexContext.schema.rootFieldSchema);
220
220
  },
221
221
  exportVerbose(node, options) {
222
222
  if (isTreeValue(node)) {
@@ -1 +1 @@
1
- {"version":3,"file":"treeAlpha.js","sourceRoot":"","sources":["../../src/shared-tree/treeAlpha.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,MAAM,EACN,WAAW,EACX,IAAI,EACJ,eAAe,GACf,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAItE,OAAO,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EAER,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EAMpB,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EAGjB,sBAAsB,EAEtB,0BAA0B,EAC1B,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,qBAAqB,EACrB,gCAAgC,EAChC,4BAA4B,EAC5B,mCAAmC,EACnC,YAAY,EACZ,QAAQ,EACR,sBAAsB,EACtB,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,kBAAkB,EAIlB,aAAa,EACb,aAAa,EACb,+BAA+B,EAC/B,mBAAmB,GAEnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAuB,MAAM,kBAAkB,CAAC;AACjF,OAAO,EACN,kBAAkB,EAGlB,mBAAmB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAA8C,MAAM,kBAAkB,CAAC;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served.\n * Licensed under the MIT License.\n */\n\nimport {\n\tassert,\n\tdebugAssert,\n\tfail,\n\tunreachableCase,\n} from \"@fluidframework/core-utils/internal\";\nimport { createIdCompressor } from \"@fluidframework/id-compressor/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tasIndex,\n\tgetKernel,\n\tTreeNode,\n\ttype Unhydrated,\n\tTreeBeta,\n\ttryGetSchema,\n\tcreateFromCursor,\n\tFieldKind,\n\tnormalizeFieldSchema,\n\ttype ImplicitFieldSchema,\n\ttype InsertableField,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeLeafValue,\n\ttype UnsafeUnknownSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\ttype TreeEncodingOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\ttype TreeBranch,\n\tTreeViewConfigurationAlpha,\n\tgetStoredKey,\n\tgetPropertyKeyFromStoredKey,\n\ttreeNodeApi,\n\tgetIdentifierFromNode,\n\tunhydratedFlexTreeFromInsertable,\n\tgetOrCreateNodeFromInnerNode,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n\tgetInnerNode,\n\tNodeKind,\n\ttryGetTreeNodeForField,\n\tisObjectNodeSchema,\n\tisTreeNode,\n\ttoInitialSchema,\n\tconvertField,\n\ttoUnhydratedSchema,\n\ttype TreeParsingOptions,\n\ttype NodeChangedData,\n\ttype ConciseTree,\n\timportConcise,\n\texportConcise,\n\tborrowCursorFromTreeNodeOrValue,\n\tcontentSchemaSymbol,\n\ttype TreeNodeSchema,\n} from \"../simple-tree/index.js\";\nimport { brand, extractFromOpaque, type JsonCompatible } from \"../util/index.js\";\nimport {\n\tFluidClientVersion,\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\tFormatValidatorNoOp,\n} from \"../codec/index.js\";\nimport { EmptyKey, type FieldKey, type ITreeCursorSynchronous } from \"../core/index.js\";\nimport {\n\tcursorForMapTreeField,\n\tdefaultSchemaPolicy,\n\tisTreeValue,\n\tmakeFieldBatchCodec,\n\tmapTreeFromCursor,\n\tTreeCompressionStrategy,\n\ttype FieldBatch,\n\ttype FieldBatchEncodingContext,\n\ttype LocalNodeIdentifier,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeNode,\n\ttype Observer,\n\twithObservation,\n} from \"../feature-libraries/index.js\";\nimport type { TreeBranchAlpha } from \"../simple-tree/index.js\";\nimport { independentInitializedView, type ViewContent } from \"./independentView.js\";\nimport { SchematizingSimpleTreeView, ViewSlot } from \"./schematizingTreeView.js\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils\";\n\nconst identifier: TreeIdentifierUtils = (node: TreeNode): string | undefined => {\n\tconst nodeIdentifier = getIdentifierFromNode(node, \"uncompressed\");\n\tif (typeof nodeIdentifier === \"number\") {\n\t\tthrow new TypeError(\"identifier should be uncompressed.\");\n\t}\n\treturn nodeIdentifier;\n};\n\nidentifier.shorten = (branch: TreeBranch, nodeIdentifier: string): number | undefined => {\n\tconst nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)\n\t\t.nodeKeyManager;\n\tconst localNodeKey = nodeKeyManager.tryLocalizeNodeIdentifier(nodeIdentifier);\n\treturn localNodeKey !== undefined ? extractFromOpaque(localNodeKey) : undefined;\n};\n\nidentifier.lengthen = (branch: TreeBranch, nodeIdentifier: number): string => {\n\tconst nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)\n\t\t.nodeKeyManager;\n\treturn nodeKeyManager.stabilizeNodeIdentifier(\n\t\tnodeIdentifier as unknown as LocalNodeIdentifier,\n\t);\n};\n\nidentifier.getShort = (node: TreeNode): number | undefined => {\n\tconst shortIdentifier = getIdentifierFromNode(node, \"compressed\");\n\treturn typeof shortIdentifier === \"number\" ? shortIdentifier : undefined;\n};\n\nidentifier.create = (branch: TreeBranch): string => {\n\tconst nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)\n\t\t.nodeKeyManager;\n\treturn nodeKeyManager.stabilizeNodeIdentifier(nodeKeyManager.generateLocalNodeIdentifier());\n};\n\nObject.freeze(identifier);\n\n/**\n * A utility interface for retrieving or converting node identifiers.\n *\n * @remarks\n * This provides methods to:\n *\n * - Retrieve long or short identifiers from nodes\n *\n * - Convert between long identifiers and short identifiers\n *\n * - Generates long identifiers\n *\n * @alpha @sealed\n */\nexport interface TreeIdentifierUtils {\n\t/**\n\t * Returns the contents of a node's {@link SchemaFactory.identifier} field as a stable identifier.\n\t * If the identifier field does not exist, returns undefined.\n\t *\n\t * @param node - The TreeNode you want to get the identifier from,\n\t */\n\t(node: TreeNode): string | undefined;\n\n\t/**\n\t * Returns the shortened identifier as a number given long identifier known by the id compressor on the branch if possible.\n\t * Otherwise, it will return the original string identifier provided.\n\t * If the id does not exist, or is unknown by the id compressor, it returns undefined.\n\t *\n\t * This method is the inverse of {@link TreeIdentifierUtils.lengthen}. If you shorten an identifier\n\t * and then immediately pass it to {@link TreeIdentifierUtils.lengthen}, you will get the original string back.\n\t *\n\t * @param branch - TreeBranch from where you get the idCompressor to do the decompression.\n\t * @param nodeIdentifier - the stable identifier that needs to be shortened.\n\t */\n\tshorten(branch: TreeBranch, nodeIdentifier: string): number | undefined;\n\n\t/**\n\t * Returns the stable id as a string if the identifier is decompressible and known by the id compressor. Otherwise, it will throw an error.\n\t *\n\t * This method is the inverse of {@link TreeIdentifierUtils.shorten}. If you lengthen an identifier\n\t * and then immediately pass it to {@link TreeIdentifierUtils.shorten}, you will get the original short identifier back.\n\t *\n\t * @param branch - TreeBranch from where you want to get the id compressor to do the decompression.\n\t * @param nodeIdentifier - The local identifier that needs to be expanded.\n\t */\n\tlengthen(branch: TreeBranch, nodeIdentifier: number): string;\n\n\t/**\n\t * Returns the {@link SchemaFactory.identifier | identifier} of the given node in the most compressed form possible.\n\t * @remarks\n\t * If the node is {@link Unhydrated | hydrated} and its identifier is a valid UUID that was automatically generated by the SharedTree it is part of (or something else using the same {@link @fluidframework/id-compressor#IIdCompressor}), then this will return a process-unique integer corresponding to that identifier.\n\t * This is useful for performance-sensitive scenarios involving many nodes with identifiers that need to be compactly retained in memory or used for efficient lookup.\n\t * Note that automatically generated identifiers that were accessed before the node was hydrated will return the generated UUID, not the process-unique integer.\n\t *\n\t * If the node's identifier is any other user-provided string, then this will return undefined.\n\t *\n\t * If the node has no identifier (that is, it has no {@link SchemaFactory.identifier | identifier} field), then this returns `undefined`.\n\t *\n\t * If the node has more than one identifier, then this will throw an error.\n\t *\n\t * The returned integer should not be serialized or preserved outside of the current process.\n\t * Its lifetime is that of the current in-memory instance of the FF container for this client, and it is not guaranteed to be unique or stable outside of that context.\n\t * The same node's identifier may, for example, be different across multiple sessions for the same client and document, or different across two clients in the same session.\n\t */\n\tgetShort(node: TreeNode): number | undefined;\n\n\t/**\n\t * Creates and returns a long identifier.\n\t * The long identifier is a compressible, stable identifier generated by the tree's ID compressor.\n\t *\n\t * @param branch - TreeBranch from where you want to get the id compressor to generate the identifier from.\n\t */\n\tcreate(branch: TreeBranch): string;\n}\n\n/**\n * Extensions to {@link (Tree:interface)} and {@link (TreeBeta:interface)} which are not yet stable.\n * @remarks\n * Use via the {@link (TreeAlpha:variable)} singleton.\n *\n * The unhydrated node creation APIs in this interface do not support {@link ObjectSchemaOptions.allowUnknownOptionalFields | unknown optional fields}.\n * This is because unknown optional fields still must have a schema: its just that the schema may come from the document's stored schema.\n * Unhydrated nodes created via this interface are not associated with any document, so there is nowhere for them to get schema for unknown optional fields.\n * Note that {@link (TreeBeta:interface).clone} can create an unhydrated node with unknown optional fields, as it uses the source node's stored schema (if any).\n *\n * Export APIs in this interface include {@link ObjectSchemaOptions.allowUnknownOptionalFields | unknown optional fields}\n * if they are using {@link KeyEncodingOptions.allStoredKeys}.\n *\n * @privateRemarks\n * TODO:\n * There should be a way to provide a source for defaulted identifiers for unhydrated node creation, either via these APIs or some way to add them to its output later.\n * If an option were added to these APIs, it could also be used to enable unknown optional fields.\n *\n * @system @sealed @alpha\n */\nexport interface TreeAlpha {\n\t/**\n\t * Retrieve the {@link TreeBranch | branch}, if any, for the given node.\n\t * @param node - The node to query\n\t * @remarks If the node has already been inserted into the tree, this will return the branch associated with that node's {@link TreeView | view}.\n\t * Otherwise, it will return `undefined` (because the node has not yet been inserted and is therefore not part of a branch or view).\n\t *\n\t * This does not fork a new branch, but rather retrieves the _existing_ branch for the node.\n\t * To create a new branch, use e.g. {@link TreeBranch.fork | `myBranch.fork()`}.\n\t */\n\tbranch(node: TreeNode): TreeBranchAlpha | undefined;\n\n\t/**\n\t * Construct tree content that is compatible with the field defined by the provided `schema`.\n\t * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.\n\t * @param data - The data used to construct the field content.\n\t * @remarks\n\t * When providing a {@link TreeNodeSchemaClass}, this is the same as invoking its constructor except that an unhydrated node can also be provided.\n\t * This function exists as a generalization that can be used in other cases as well,\n\t * such as when `undefined` might be allowed (for an optional field), or when the type should be inferred from the data when more than one type is possible.\n\t */\n\tcreate<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: InsertableField<TSchema>,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t>;\n\n\t/**\n\t * {@inheritDoc (TreeBeta:interface).importConcise}\n\t */\n\timportConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: ConciseTree | undefined,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t>;\n\n\t/**\n\t * {@inheritDoc (TreeBeta:interface).(exportConcise:1)}\n\t * @privateRemarks Note: this was retained on this interface because {@link (TreeAlpha:interface).importConcise} exists.\n\t * It should be removed if/when that is removed from this interface.\n\t */\n\texportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;\n\n\t/**\n\t * {@inheritDoc (TreeBeta:interface).(exportConcise:2)}\n\t * @privateRemarks Note: this was retained on this interface because {@link (TreeAlpha:interface).importConcise} exists.\n\t * It should be removed if/when that is removed from this interface.\n\t */\n\texportConcise(\n\t\tnode: TreeNode | TreeLeafValue | undefined,\n\t\toptions?: TreeEncodingOptions,\n\t): ConciseTree | undefined;\n\n\t/**\n\t * Construct tree content compatible with a field defined by the provided `schema`.\n\t * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.\n\t * @param data - The data used to construct the field content. See {@link (TreeAlpha:interface).(exportVerbose:1)}.\n\t * @remarks\n\t * This currently does not support input containing\n\t * {@link ObjectSchemaOptions.allowUnknownOptionalFields| unknown optional fields} but does support\n\t * {@link SchemaStaticsBeta.staged | staged} allowed types.\n\t * Non-empty default values for fields are currently not supported (must be provided in the input).\n\t * The content will be validated against the schema and an error will be thrown if out of schema.\n\t */\n\timportVerbose<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tdata: VerboseTree | undefined,\n\t\toptions?: TreeParsingOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\n\t/**\n\t * Copy a snapshot of the current version of a TreeNode into a JSON compatible plain old JavaScript Object (except for {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}).\n\t * Uses the {@link VerboseTree} format, with an explicit type on every node.\n\t *\n\t * @remarks\n\t * There are several cases this may be preferred to {@link (TreeBeta:interface).(exportConcise:1)}:\n\t *\n\t * 1. When not using {@link ITreeConfigurationOptions.preventAmbiguity} (or when using `useStableFieldKeys`), `exportConcise` can produce ambiguous data (the type may be unclear on some nodes).\n\t * `exportVerbose` will always be unambiguous and thus lossless.\n\t *\n\t * 2. When the data might be interpreted without access to the exact same view schema. In such cases, the types may be unknowable if not included.\n\t *\n\t * 3. When easy access to the type is desired.\n\t */\n\texportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree;\n\n\t/**\n\t * Export the content of the provided `tree` in a compressed JSON compatible format.\n\t * @remarks\n\t * If an `idCompressor` is provided, it will be used to compress identifiers and thus will be needed to decompress the data.\n\t *\n\t * Always uses \"stored\" keys.\n\t * See {@link KeyEncodingOptions.allStoredKeys} for details.\n\t * @privateRemarks\n\t * TODO: It is currently not clear how to work with the idCompressors correctly in the package API.\n\t * Better APIs should probably be provided as there is currently no way to associate an un-hydrated tree with an idCompressor,\n\t * Nor get the correct idCompressor from a subtree to use when exporting it.\n\t * Additionally using `createIdCompressor` to make an idCompressor is `@legacy` and thus not intended for use in this API surface.\n\t * It would probably make more sense if we provided a way to get an idCompressor from the context of a node,\n\t * which could be optional (and settable if missing) for un0hydrated nodes and required for hydrated ones.\n\t * Add in a stable public API for creating idCompressors, and a way to get them from a tree (without view schema), and that should address the anticipated use-cases.\n\t */\n\texportCompressed(\n\t\ttree: TreeNode | TreeLeafValue,\n\t\toptions: { idCompressor?: IIdCompressor } & Pick<CodecWriteOptions, \"minVersionForCollab\">,\n\t): JsonCompatible<IFluidHandle>;\n\n\t/**\n\t * Import data encoded by {@link (TreeAlpha:interface).exportCompressed}.\n\t *\n\t * @param schema - Schema with which the data must be compatible. This compatibility is not verified and must be ensured by the caller.\n\t * @param compressedData - Data compressed by {@link (TreeAlpha:interface).exportCompressed}.\n\t * @param options - If {@link (TreeAlpha:interface).exportCompressed} was given an `idCompressor`, it must be provided here.\n\t *\n\t * @remarks\n\t * If the data could have been encoded with a different schema, consider encoding the schema along side it using {@link extractPersistedSchema} and loading the data using {@link independentView}.\n\t *\n\t * @privateRemarks\n\t * This API could be improved:\n\t *\n\t * 1. It could validate that the schema is compatible, and return or throw an error in the invalid case (maybe add a \"try\" version).\n\t *\n\t * 2. A \"try\" version of this could return an error if the data isn't in a supported format (as determined by version and/or JasonValidator).\n\t *\n\t * 3. Requiring the caller provide a JsonValidator isn't the most friendly API. It might be practical to provide a default.\n\t */\n\timportCompressed<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tcompressedData: JsonCompatible<IFluidHandle>,\n\t\toptions: { idCompressor?: IIdCompressor } & ICodecOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\n\t/**\n\t * APIs for creating, converting, and retrieving identifiers.\n\t */\n\treadonly identifier: TreeIdentifierUtils;\n\n\t/**\n\t * The key of the given node under its parent.\n\t * @remarks\n\t * If `node` is an element in a {@link (TreeArrayNode:interface)}, this returns the index of `node` in the array node (a `number`).\n\t * If `node` is the root node, this returns undefined.\n\t * Otherwise, this returns the key of the field that it is under (a `string`).\n\t */\n\tkey2(node: TreeNode): string | number | undefined;\n\n\t/**\n\t * Gets the child of the given node with the given property key if a child exists under that key.\n\t *\n\t * @remarks {@link ObjectSchemaOptions.allowUnknownOptionalFields | Unknown optional fields} of Object nodes will not be returned by this method.\n\t *\n\t * @param node - The parent node whose child is being requested.\n\t * @param key - The property key under the node under which the child is being requested.\n\t * For Object nodes, this is the developer-facing \"property key\", not the \"{@link SimpleObjectFieldSchema.storedKey | stored keys}\".\n\t *\n\t * @returns The child node or leaf value under the given key, or `undefined` if no such child exists.\n\t *\n\t * @see {@link (TreeAlpha:interface).key2}\n\t * @see {@link (TreeNodeApi:interface).parent}\n\t */\n\tchild(node: TreeNode, key: string | number): TreeNode | TreeLeafValue | undefined;\n\n\t/**\n\t * Gets the children of the provided node, paired with their property keys under the node.\n\t *\n\t * @remarks\n\t * No guarantees are made regarding the order of the children in the returned array.\n\t *\n\t * Optional properties of Object nodes with no value are not included in the result.\n\t *\n\t * {@link ObjectSchemaOptions.allowUnknownOptionalFields | Unknown optional fields} of Object nodes are not included in the result.\n\t *\n\t * @param node - The node whose children are being requested.\n\t *\n\t * @returns\n\t * An array of pairs of the form `[propertyKey, child]`.\n\t *\n\t * For Array nodes, the `propertyKey` is the index of the child in the array.\n\t *\n\t * For Object nodes, the returned `propertyKey`s are the developer-facing \"property keys\", not the \"{@link SimpleObjectFieldSchema.storedKey | stored keys}\".\n\t *\n\t * @see {@link (TreeAlpha:interface).key2}\n\t * @see {@link (TreeNodeApi:interface).parent}\n\t */\n\tchildren(\n\t\tnode: TreeNode,\n\t): Iterable<[propertyKey: string | number, child: TreeNode | TreeLeafValue]>;\n\n\t/**\n\t * Track observations of any TreeNode content.\n\t * @remarks\n\t * This subscribes to changes to any nodes content observed during `trackDuring`.\n\t *\n\t * Currently this does not support tracking parentage (see {@link (TreeAlpha:interface).trackObservationsOnce} for a version which does):\n\t * if accessing parentage during `trackDuring`, this will throw a usage error.\n\t *\n\t * This also does not track node status changes (e.g. whether a node is attached to a view or not).\n\t * The current behavior of checking status is unspecified: future versions may track it, error, or ignore it.\n\t *\n\t * These subscriptions remain active until `unsubscribe` is called: `onInvalidation` may be called multiple times.\n\t * See {@link (TreeAlpha:interface).trackObservationsOnce} for a version which automatically unsubscribes on the first invalidation.\n\t * @privateRemarks\n\t * This version, while more general than {@link (TreeAlpha:interface).trackObservationsOnce}, might be unnecessary.\n\t * Maybe this should be removed and only `trackObservationsOnce` kept.\n\t * Reevaluate this before stabilizing.\n\t */\n\ttrackObservations<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult>;\n\n\t/**\n\t * {@link (TreeAlpha:interface).trackObservations} except automatically unsubscribes when the first invalidation occurs.\n\t * @remarks\n\t * This also supports tracking parentage, unlike {@link (TreeAlpha:interface).trackObservations}, as long as the parent is not undefined.\n\t *\n\t * @example Simple cached value invalidation\n\t * ```typescript\n\t * // Compute and cache this \"foo\" value, and clear the cache when the fields read in the callback to compute it change.\n\t * cachedFoo ??= TreeAlpha.trackObservationsOnce(\n\t * \t() => {\n\t * \t\tcachedFoo = undefined;\n\t * \t},\n\t * \t() => nodeA.someChild.bar + nodeB.someChild.baz,\n\t * ).result;\n\t * ```\n\t *\n\t * That is equivalent to doing the following:\n\t * ```typescript\n\t * if (cachedFoo === undefined) {\n\t * \tcachedFoo = nodeA.someChild.bar + nodeB.someChild.baz;\n\t * \tconst invalidate = (): void => {\n\t * \t\tcachedFoo = undefined;\n\t * \t\tfor (const u of unsubscribe) {\n\t * \t\t\tu();\n\t * \t\t}\n\t * \t};\n\t * \tconst unsubscribe: (() => void)[] = [\n\t * \t\tTreeBeta.on(nodeA, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"someChild\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t\tTreeBeta.on(nodeB, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"someChild\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t\tTreeBeta.on(nodeA.someChild, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"bar\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t\tTreeBeta.on(nodeB.someChild, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"baz\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t];\n\t * }\n\t * ```\n\t * @example Cached derived schema property\n\t * ```typescript\n\t * const factory = new SchemaFactory(\"com.example\");\n\t * class Vector extends factory.object(\"Vector\", {\n\t * \tx: SchemaFactory.number,\n\t * \ty: SchemaFactory.number,\n\t * }) {\n\t * \t#length: number | undefined = undefined;\n\t * \tpublic length(): number {\n\t * \t\tif (this.#length === undefined) {\n\t * \t\t\tconst result = TreeAlpha.trackObservationsOnce(\n\t * \t\t\t\t() => {\n\t * \t\t\t\t\tthis.#length = undefined;\n\t * \t\t\t\t},\n\t * \t\t\t\t() => Math.hypot(this.x, this.y),\n\t * \t\t\t);\n\t * \t\t\tthis.#length = result.result;\n\t * \t\t}\n\t * \t\treturn this.#length;\n\t * \t}\n\t * }\n\t * const vec = new Vector({ x: 3, y: 4 });\n\t * assert.equal(vec.length(), 5);\n\t * vec.x = 0;\n\t * assert.equal(vec.length(), 4);\n\t * ```\n\t */\n\ttrackObservationsOnce<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult>;\n\n\t/**\n\t * Ensures that the provided content will be interpreted as the given schema when inserting into the tree.\n\t * @returns `content`, for convenience.\n\t * @remarks\n\t * If applicable, this will tag the given content with a {@link contentSchemaSymbol | special property} that indicates its intended schema.\n\t * The `content` will be interpreted as the given `schema` when later inserted into the tree.\n\t *\n\t * This does not validate that the content actually conforms to the given schema (such validation will be done at insert time).\n\t * If the content is not compatible with the tagged schema, an error will be thrown when the content is inserted.\n\t *\n\t * This is particularly useful when the content's schema cannot be inferred from its structure alone because it is compatible with multiple schemas.\n\t * @example\n\t * ```typescript\n\t * const sf = new SchemaFactory(\"example\");\n\t * class Dog extends sf.object(\"Dog\", { name: sf.string() }) {}\n\t * class Cat extends sf.object(\"Cat\", { name: sf.string() }) {}\n\t * class Root extends sf.object(\"Root\", { pet: [Dog, Cat] }) {}\n\t * // ...\n\t * const pet = { name: \"Max\" };\n\t * view.root.pet = pet; // Error: ambiguous schema - is it a Dog or a Cat?\n\t * TreeAlpha.ensureSchema(Dog, pet); // Tags `pet` as a Dog.\n\t * view.root.pet = pet; // No error - it's a Dog.\n\t * ```\n\t */\n\ttagContentSchema<TSchema extends TreeNodeSchema, TContent extends InsertableField<TSchema>>(\n\t\tschema: TSchema,\n\t\tcontent: TContent,\n\t): TContent;\n}\n\n/**\n * Results from an operation with tracked observations.\n * @remarks\n * Results from {@link (TreeAlpha:interface).trackObservations} or {@link (TreeAlpha:interface).trackObservationsOnce}.\n * @sealed @alpha\n */\nexport interface ObservationResults<TResult> {\n\t/**\n\t * The result of the operation which had its observations tracked.\n\t */\n\treadonly result: TResult;\n\n\t/**\n\t * Call to unsubscribe from further invalidations.\n\t */\n\treadonly unsubscribe: () => void;\n}\n\n/**\n * Subscription to changes on a single node.\n * @remarks\n * Either tracks some set of fields, or all fields and can be updated to track more fields.\n */\nclass NodeSubscription {\n\t/**\n\t * If undefined, subscribes to all keys.\n\t * Otherwise only subscribes to the keys in the set.\n\t */\n\tprivate keys: Set<FieldKey> | undefined;\n\tprivate readonly unsubscribe: () => void;\n\tprivate constructor(\n\t\tprivate readonly onInvalidation: () => void,\n\t\tflexNode: FlexTreeNode,\n\t) {\n\t\t// TODO:Performance: It is possible to optimize this to not use the public TreeNode API.\n\t\tconst node = getOrCreateNodeFromInnerNode(flexNode);\n\t\tassert(node instanceof TreeNode, 0xc54 /* Unexpected leaf value */);\n\n\t\tconst handler = (data: NodeChangedData): void => {\n\t\t\tif (this.keys === undefined || data.changedProperties === undefined) {\n\t\t\t\tthis.onInvalidation();\n\t\t\t} else {\n\t\t\t\tlet keyMap: ReadonlyMap<FieldKey, string> | undefined;\n\t\t\t\tconst schema = treeNodeApi.schema(node);\n\t\t\t\tif (isObjectNodeSchema(schema)) {\n\t\t\t\t\tkeyMap = schema.storedKeyToPropertyKey;\n\t\t\t\t}\n\t\t\t\t// TODO:Performance: Ideally this would use Set.prototype.isDisjointFrom when available.\n\t\t\t\tfor (const flexKey of this.keys) {\n\t\t\t\t\t// TODO:Performance: doing everything at the flex tree layer could avoid this translation\n\t\t\t\t\tconst key = keyMap?.get(flexKey) ?? flexKey;\n\n\t\t\t\t\tif (data.changedProperties.has(key)) {\n\t\t\t\t\t\tthis.onInvalidation();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.unsubscribe = TreeBeta.on(node, \"nodeChanged\", handler);\n\t}\n\n\t/**\n\t * Create an {@link Observer} which subscribes to what was observed in {@link NodeSubscription}s.\n\t */\n\tpublic static createObserver(\n\t\tinvalidate: () => void,\n\t\tonlyOnce = false,\n\t): { observer: Observer; unsubscribe: () => void } {\n\t\tconst subscriptions = new Map<FlexTreeNode, NodeSubscription>();\n\t\tconst observer: Observer = {\n\t\t\tobserveNodeFields(flexNode: FlexTreeNode): void {\n\t\t\t\tif (flexNode.value !== undefined) {\n\t\t\t\t\t// Leaf value, nothing to observe.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst subscription = subscriptions.get(flexNode);\n\t\t\t\tif (subscription !== undefined) {\n\t\t\t\t\t// Already subscribed to this node.\n\t\t\t\t\tsubscription.keys = undefined; // Now subscribed to all keys.\n\t\t\t\t} else {\n\t\t\t\t\tconst newSubscription = new NodeSubscription(invalidate, flexNode);\n\t\t\t\t\tsubscriptions.set(flexNode, newSubscription);\n\t\t\t\t}\n\t\t\t},\n\t\t\tobserveNodeField(flexNode: FlexTreeNode, key: FieldKey): void {\n\t\t\t\tif (flexNode.value !== undefined) {\n\t\t\t\t\t// Leaf value, nothing to observe.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst subscription = subscriptions.get(flexNode);\n\t\t\t\tif (subscription !== undefined) {\n\t\t\t\t\t// Already subscribed to this node: if not subscribed to all keys, subscribe to this one.\n\t\t\t\t\t// TODO:Performance: due to how JavaScript set ordering works,\n\t\t\t\t\t// it might be faster to check `has` and only add if not present in case the same field is viewed many times.\n\t\t\t\t\tsubscription.keys?.add(key);\n\t\t\t\t} else {\n\t\t\t\t\tconst newSubscription = new NodeSubscription(invalidate, flexNode);\n\t\t\t\t\tnewSubscription.keys = new Set([key]);\n\t\t\t\t\tsubscriptions.set(flexNode, newSubscription);\n\t\t\t\t}\n\t\t\t},\n\t\t\tobserveParentOf(node: FlexTreeNode): void {\n\t\t\t\t// Supporting parent tracking is more difficult that it might seem at first.\n\t\t\t\t// There are two main complicating factors:\n\t\t\t\t// 1. The parent may be undefined (the node is a root).\n\t\t\t\t// 2. If tracking this by subscribing to the parent's changes, then which events are subscribed to needs to be updated after the parent changes.\n\t\t\t\t//\n\t\t\t\t// If not supporting the first case (undefined parents), the second case gets problematic: edits which un-parent a node could error due to being unable to update the event subscription.\n\t\t\t\t// For now this is mitigated by only supporting one of tracking (non-undefined) parents or maintaining event subscriptions across edits.\n\n\t\t\t\tif (!onlyOnce) {\n\t\t\t\t\t// TODO: better APIS should be provided which make handling this case practical.\n\t\t\t\t\tthrow new UsageError(\"Observation tracking for parents is currently not supported.\");\n\t\t\t\t}\n\n\t\t\t\tconst parent = withObservation(undefined, () => node.parentField.parent);\n\n\t\t\t\tif (parent.parent === undefined) {\n\t\t\t\t\t// TODO: better APIS should be provided which make handling this case practical.\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\"Observation tracking for parents is currently not supported when parent is undefined.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tobserver.observeNodeField(parent.parent, parent.key);\n\t\t\t},\n\t\t};\n\n\t\tlet subscribed = true;\n\n\t\treturn {\n\t\t\tobserver,\n\t\t\tunsubscribe: () => {\n\t\t\t\tif (!subscribed) {\n\t\t\t\t\tthrow new UsageError(\"Already unsubscribed\");\n\t\t\t\t}\n\t\t\t\tsubscribed = false;\n\t\t\t\tfor (const subscription of subscriptions.values()) {\n\t\t\t\t\tsubscription.unsubscribe();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n}\n\n/**\n * Handles both {@link (TreeAlpha:interface).trackObservations} and {@link (TreeAlpha:interface).trackObservationsOnce}.\n */\nfunction trackObservations<TResult>(\n\tonInvalidation: () => void,\n\ttrackDuring: () => TResult,\n\tonlyOnce = false,\n): ObservationResults<TResult> {\n\tlet observing = true;\n\n\tconst invalidate = (): void => {\n\t\tif (observing) {\n\t\t\tthrow new UsageError(\"Cannot invalidate while tracking observations\");\n\t\t}\n\t\tonInvalidation();\n\t};\n\n\tconst { observer, unsubscribe } = NodeSubscription.createObserver(invalidate, onlyOnce);\n\tconst result = withObservation(observer, trackDuring);\n\tobserving = false;\n\n\treturn {\n\t\tresult,\n\t\tunsubscribe,\n\t};\n}\n\n/**\n * Extensions to {@link (Tree:variable)} and {@link (TreeBeta:variable)} which are not yet stable.\n * @see {@link (TreeAlpha:interface)}.\n * @alpha\n */\nexport const TreeAlpha: TreeAlpha = {\n\ttrackObservations<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult> {\n\t\treturn trackObservations(onInvalidation, trackDuring);\n\t},\n\n\ttrackObservationsOnce<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult> {\n\t\tconst result = trackObservations(\n\t\t\t() => {\n\t\t\t\t// trackObservations ensures no invalidation occurs while its running,\n\t\t\t\t// so this callback can only run after trackObservations has returns and thus result is defined.\n\t\t\t\tresult.unsubscribe();\n\t\t\t\tonInvalidation();\n\t\t\t},\n\t\t\ttrackDuring,\n\t\t\ttrue,\n\t\t);\n\t\treturn result;\n\t},\n\n\tbranch(node: TreeNode): TreeBranchAlpha | undefined {\n\t\tconst kernel = getKernel(node);\n\t\tif (!kernel.isHydrated()) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst view = kernel.anchorNode.anchorSet.slots.get(ViewSlot);\n\t\tassert(\n\t\t\tview instanceof SchematizingSimpleTreeView,\n\t\t\t0xa5c /* Unexpected view implementation */,\n\t\t);\n\t\treturn view;\n\t},\n\n\tcreate<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: InsertableField<TSchema>,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t> {\n\t\tconst mapTree = unhydratedFlexTreeFromInsertable(\n\t\t\tdata as InsertableField<UnsafeUnknownSchema>,\n\t\t\tschema,\n\t\t);\n\t\tconst result = mapTree === undefined ? undefined : getOrCreateNodeFromInnerNode(mapTree);\n\t\treturn result as Unhydrated<\n\t\t\tTSchema extends ImplicitFieldSchema\n\t\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t\t: TreeNode | TreeLeafValue | undefined\n\t\t>;\n\t},\n\n\timportConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: ConciseTree | undefined,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t> {\n\t\treturn importConcise(schema, data);\n\t},\n\n\texportConcise,\n\n\timportVerbose<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tdata: VerboseTree | undefined,\n\t\toptions?: TreeParsingOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\t\tconst config: TreeEncodingOptions = { ...options };\n\t\t// Create a config which is standalone, and thus can be used without having to refer back to the schema.\n\t\tconst schemalessConfig = applySchemaToParserOptions(schema, config);\n\t\tif (data === undefined) {\n\t\t\tconst field = normalizeFieldSchema(schema);\n\t\t\tif (field.kind !== FieldKind.Optional) {\n\t\t\t\tthrow new UsageError(\"undefined provided for non-optional field.\");\n\t\t\t}\n\t\t\treturn undefined as Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\t\t}\n\t\tconst cursor = cursorFromVerbose(data, schemalessConfig);\n\t\treturn createFromCursor(\n\t\t\tschema,\n\t\t\tcursor,\n\t\t\tconvertField(normalizeFieldSchema(schema), toUnhydratedSchema),\n\t\t);\n\t},\n\n\texportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree {\n\t\tif (isTreeValue(node)) {\n\t\t\treturn node;\n\t\t}\n\t\tconst config: TreeEncodingOptions = { ...options };\n\n\t\tconst cursor = borrowCursorFromTreeNodeOrValue(node);\n\t\tconst kernel = getKernel(node);\n\t\treturn verboseFromCursor(cursor, kernel.context, config);\n\t},\n\n\texportCompressed(\n\t\tnode: TreeNode | TreeLeafValue,\n\t\toptions: { idCompressor?: IIdCompressor } & Pick<CodecWriteOptions, \"minVersionForCollab\">,\n\t): JsonCompatible<IFluidHandle> {\n\t\tconst schema = tryGetSchema(node) ?? fail(0xacf /* invalid input */);\n\t\tconst codec = makeFieldBatchCodec({\n\t\t\tjsonValidator: FormatValidatorNoOp,\n\t\t\tminVersionForCollab: options.minVersionForCollab,\n\t\t});\n\t\tconst cursor = borrowFieldCursorFromTreeNodeOrValue(node);\n\t\tconst batch: FieldBatch = [cursor];\n\t\t// If none provided, create a compressor which will not compress anything.\n\t\tconst idCompressor = options.idCompressor ?? createIdCompressor();\n\n\t\t// Grabbing an existing stored schema from the node is important to ensure that unknown optional fields can be preserved.\n\t\t// Note that if the node is unhydrated, this can result in all staged allowed types being included in the schema, which might be undesired.\n\t\tconst storedSchema = isTreeNode(node)\n\t\t\t? getKernel(node).context.flexContext.schema\n\t\t\t: toInitialSchema(schema);\n\n\t\tconst context: FieldBatchEncodingContext = {\n\t\t\tencodeType: TreeCompressionStrategy.Compressed,\n\t\t\tidCompressor,\n\t\t\toriginatorId: idCompressor.localSessionId, // TODO: Why is this needed?\n\t\t\tschema: { schema: storedSchema, policy: defaultSchemaPolicy },\n\t\t};\n\t\tconst result = codec.encode(batch, context);\n\t\treturn result;\n\t},\n\n\timportCompressed<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tcompressedData: JsonCompatible<IFluidHandle>,\n\t\toptions: {\n\t\t\tidCompressor?: IIdCompressor;\n\t\t} & CodecWriteOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\t\tconst config = new TreeViewConfigurationAlpha({ schema });\n\t\tconst content: ViewContent = {\n\t\t\t// Always use a v1 schema codec for consistency.\n\t\t\t// TODO: reevaluate how staged schema should behave in schema import/export APIs before stabilizing this.\n\t\t\tschema: extractPersistedSchema(config.schema, FluidClientVersion.v2_0, () => true),\n\t\t\ttree: compressedData,\n\t\t\tidCompressor: options.idCompressor ?? createIdCompressor(),\n\t\t};\n\t\tconst view = independentInitializedView(config, options, content);\n\t\treturn TreeBeta.clone<TSchema>(view.root);\n\t},\n\n\tidentifier,\n\n\tkey2(node: TreeNode): string | number | undefined {\n\t\t// If the parent is undefined, then this node is under the root field,\n\t\tconst parent = treeNodeApi.parent(node);\n\t\tif (parent === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// The flex-domain strictly operates in terms of \"stored keys\".\n\t\t// To find the associated developer-facing \"property key\", we need to look up the field associated with\n\t\t// the stored key from the flex-domain, and get property key its simple-domain counterpart was created with.\n\t\tconst storedKey = getStoredKey(node);\n\t\tconst parentSchema = treeNodeApi.schema(parent);\n\t\treturn getPropertyKeyFromStoredKey(parentSchema, storedKey);\n\t},\n\n\tchild: (\n\t\tnode: TreeNode,\n\t\tpropertyKey: string | number,\n\t): TreeNode | TreeLeafValue | undefined => {\n\t\tconst flexNode = getInnerNode(node);\n\t\tdebugAssert(\n\t\t\t() => !flexNode.context.isDisposed() || \"The provided tree node has been disposed.\",\n\t\t);\n\n\t\tconst schema = treeNodeApi.schema(node);\n\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Array: {\n\t\t\t\tconst sequence = flexNode.tryGetField(EmptyKey) as FlexTreeSequenceField | undefined;\n\n\t\t\t\t// Empty sequence - cannot have children.\n\t\t\t\tif (sequence === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst index =\n\t\t\t\t\ttypeof propertyKey === \"number\"\n\t\t\t\t\t\t? propertyKey\n\t\t\t\t\t\t: asIndex(propertyKey, Number.POSITIVE_INFINITY);\n\n\t\t\t\t// If the key is not a valid index, then there is no corresponding child.\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst childFlexTree = sequence.at(index);\n\n\t\t\t\t// No child at the given index.\n\t\t\t\tif (childFlexTree === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn getOrCreateNodeFromInnerUnboxedNode(childFlexTree);\n\t\t\t}\n\t\t\tcase NodeKind.Map:\n\t\t\t\tif (typeof propertyKey !== \"string\") {\n\t\t\t\t\t// Map nodes only support string keys.\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t// Fall through\n\t\t\tcase NodeKind.Record:\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tlet storedKey: string | number = propertyKey;\n\t\t\t\tif (isObjectNodeSchema(schema)) {\n\t\t\t\t\tconst fieldSchema = schema.fields.get(String(propertyKey));\n\t\t\t\t\tif (fieldSchema === undefined) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tstoredKey = fieldSchema.storedKey;\n\t\t\t\t}\n\n\t\t\t\tconst field = flexNode.tryGetField(brand(String(storedKey)));\n\t\t\t\tif (field !== undefined) {\n\t\t\t\t\treturn tryGetTreeNodeForField(field);\n\t\t\t\t}\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\tfail(0xbc3 /* Leaf schema associated with non-leaf tree node. */);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(schema.kind);\n\t\t\t}\n\t\t}\n\t},\n\n\tchildren(node: TreeNode): [propertyKey: string | number, child: TreeNode | TreeLeafValue][] {\n\t\tconst flexNode = getInnerNode(node);\n\t\tdebugAssert(\n\t\t\t() => !flexNode.context.isDisposed() || \"The provided tree node has been disposed.\",\n\t\t);\n\n\t\tconst schema = treeNodeApi.schema(node);\n\n\t\tconst result: [string | number, TreeNode | TreeLeafValue][] = [];\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Array: {\n\t\t\t\tconst sequence = flexNode.tryGetField(EmptyKey) as FlexTreeSequenceField | undefined;\n\t\t\t\tif (sequence === undefined) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tfor (let index = 0; index < sequence.length; index++) {\n\t\t\t\t\tconst childFlexTree = sequence.at(index);\n\t\t\t\t\tassert(childFlexTree !== undefined, 0xbc4 /* Sequence child was undefined. */);\n\t\t\t\t\tconst childTree = getOrCreateNodeFromInnerUnboxedNode(childFlexTree);\n\t\t\t\t\tresult.push([index, childTree]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Map:\n\t\t\tcase NodeKind.Record: {\n\t\t\t\tfor (const [key, flexField] of flexNode.fields) {\n\t\t\t\t\tconst childTreeNode = tryGetTreeNodeForField(flexField);\n\t\t\t\t\tif (childTreeNode !== undefined) {\n\t\t\t\t\t\tresult.push([key, childTreeNode]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tassert(isObjectNodeSchema(schema), 0xbc5 /* Expected object schema. */);\n\t\t\t\tfor (const [propertyKey, fieldSchema] of schema.fields) {\n\t\t\t\t\tconst storedKey = fieldSchema.storedKey;\n\t\t\t\t\tconst flexField = flexNode.tryGetField(brand(String(storedKey)));\n\t\t\t\t\tif (flexField !== undefined) {\n\t\t\t\t\t\tconst childTreeNode = tryGetTreeNodeForField(flexField);\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tchildTreeNode !== undefined,\n\t\t\t\t\t\t\t0xbc6 /* Expected child tree node for field. */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tresult.push([propertyKey, childTreeNode]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\tfail(0xbc7 /* Leaf schema associated with non-leaf tree node. */);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(schema.kind);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t},\n\n\ttagContentSchema<TSchema extends TreeNodeSchema, TNode extends InsertableField<TSchema>>(\n\t\tschema: TSchema,\n\t\tnode: TNode,\n\t): TNode {\n\t\tif (typeof node === \"object\" && node !== null && !isFluidHandle(node)) {\n\t\t\tReflect.defineProperty(node, contentSchemaSymbol, {\n\t\t\t\tconfigurable: false,\n\t\t\t\tenumerable: false,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: schema.identifier,\n\t\t\t});\n\t\t}\n\t\treturn node;\n\t},\n};\n\n/**\n * Borrow a cursor from a field.\n * @remarks\n * The cursor must be put back to its original location before the node is used again.\n */\nfunction borrowFieldCursorFromTreeNodeOrValue(\n\tnode: TreeNode | TreeLeafValue | undefined,\n): ITreeCursorSynchronous {\n\tif (node === undefined) {\n\t\treturn cursorForMapTreeField([]);\n\t}\n\tconst cursor = borrowCursorFromTreeNodeOrValue(node);\n\t// TODO: avoid copy: borrow cursor from field instead.\n\tconst mapTree = mapTreeFromCursor(cursor);\n\treturn cursorForMapTreeField([mapTree]);\n}\n"]}
1
+ {"version":3,"file":"treeAlpha.js","sourceRoot":"","sources":["../../src/shared-tree/treeAlpha.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,MAAM,EACN,WAAW,EACX,IAAI,EACJ,eAAe,GACf,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAItE,OAAO,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EAER,QAAQ,EACR,YAAY,EACZ,gBAAgB,EACh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AK;gBACnB,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,MAAM,CAAC,UAAU;aACxB,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC;AAEF;;;;GAIG;AACH,SAAS,oCAAoC,CAC5C,IAA0C;IAE1C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,qBAAqB,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IACD,MAAM,MAAM,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAC;IACrD,sDAAsD;IACtD,MAAM,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1C,OAAO,qBAAqB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACzC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tassert,\n\tdebugAssert,\n\tfail,\n\tunreachableCase,\n} from \"@fluidframework/core-utils/internal\";\nimport { createIdCompressor } from \"@fluidframework/id-compressor/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tasIndex,\n\tgetKernel,\n\tTreeNode,\n\ttype Unhydrated,\n\tTreeBeta,\n\ttryGetSchema,\n\tcreateFromCursor,\n\tFieldKind,\n\tnormalizeFieldSchema,\n\ttype ImplicitFieldSchema,\n\ttype InsertableField,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeLeafValue,\n\ttype UnsafeUnknownSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\ttype TreeEncodingOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\ttype TreeBranch,\n\tTreeViewConfigurationAlpha,\n\tgetStoredKey,\n\tgetPropertyKeyFromStoredKey,\n\ttreeNodeApi,\n\tgetIdentifierFromNode,\n\tunhydratedFlexTreeFromInsertable,\n\tgetOrCreateNodeFromInnerNode,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n\tgetInnerNode,\n\tNodeKind,\n\ttryGetTreeNodeForField,\n\tisObjectNodeSchema,\n\tisTreeNode,\n\ttoInitialSchema,\n\ttype TreeParsingOptions,\n\ttype NodeChangedData,\n\ttype ConciseTree,\n\timportConcise,\n\texportConcise,\n\tborrowCursorFromTreeNodeOrValue,\n\tcontentSchemaSymbol,\n\ttype TreeNodeSchema,\n\tgetUnhydratedContext,\n} from \"../simple-tree/index.js\";\nimport { brand, extractFromOpaque, type JsonCompatible } from \"../util/index.js\";\nimport {\n\tFluidClientVersion,\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\tFormatValidatorNoOp,\n} from \"../codec/index.js\";\nimport { EmptyKey, type FieldKey, type ITreeCursorSynchronous } from \"../core/index.js\";\nimport {\n\tcursorForMapTreeField,\n\tdefaultSchemaPolicy,\n\tisTreeValue,\n\tmakeFieldBatchCodec,\n\tmapTreeFromCursor,\n\tTreeCompressionStrategy,\n\ttype FieldBatch,\n\ttype FieldBatchEncodingContext,\n\ttype LocalNodeIdentifier,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeNode,\n\ttype Observer,\n\twithObservation,\n} from \"../feature-libraries/index.js\";\nimport type { TreeBranchAlpha } from \"../simple-tree/index.js\";\nimport { independentInitializedView, type ViewContent } from \"./independentView.js\";\nimport { SchematizingSimpleTreeView, ViewSlot } from \"./schematizingTreeView.js\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils\";\n\nconst identifier: TreeIdentifierUtils = (node: TreeNode): string | undefined => {\n\tconst nodeIdentifier = getIdentifierFromNode(node, \"uncompressed\");\n\tif (typeof nodeIdentifier === \"number\") {\n\t\tthrow new TypeError(\"identifier should be uncompressed.\");\n\t}\n\treturn nodeIdentifier;\n};\n\nidentifier.shorten = (branch: TreeBranch, nodeIdentifier: string): number | undefined => {\n\tconst nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)\n\t\t.nodeKeyManager;\n\tconst localNodeKey = nodeKeyManager.tryLocalizeNodeIdentifier(nodeIdentifier);\n\treturn localNodeKey !== undefined ? extractFromOpaque(localNodeKey) : undefined;\n};\n\nidentifier.lengthen = (branch: TreeBranch, nodeIdentifier: number): string => {\n\tconst nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)\n\t\t.nodeKeyManager;\n\treturn nodeKeyManager.stabilizeNodeIdentifier(\n\t\tnodeIdentifier as unknown as LocalNodeIdentifier,\n\t);\n};\n\nidentifier.getShort = (node: TreeNode): number | undefined => {\n\tconst shortIdentifier = getIdentifierFromNode(node, \"compressed\");\n\treturn typeof shortIdentifier === \"number\" ? shortIdentifier : undefined;\n};\n\nidentifier.create = (branch: TreeBranch): string => {\n\tconst nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)\n\t\t.nodeKeyManager;\n\treturn nodeKeyManager.stabilizeNodeIdentifier(nodeKeyManager.generateLocalNodeIdentifier());\n};\n\nObject.freeze(identifier);\n\n/**\n * A utility interface for retrieving or converting node identifiers.\n *\n * @remarks\n * This provides methods to:\n *\n * - Retrieve long or short identifiers from nodes\n *\n * - Convert between long identifiers and short identifiers\n *\n * - Generates long identifiers\n *\n * @alpha @sealed\n */\nexport interface TreeIdentifierUtils {\n\t/**\n\t * Returns the contents of a node's {@link SchemaFactory.identifier} field as a stable identifier.\n\t * If the identifier field does not exist, returns undefined.\n\t *\n\t * @param node - The TreeNode you want to get the identifier from,\n\t */\n\t(node: TreeNode): string | undefined;\n\n\t/**\n\t * Returns the shortened identifier as a number given long identifier known by the id compressor on the branch if possible.\n\t * Otherwise, it will return the original string identifier provided.\n\t * If the id does not exist, or is unknown by the id compressor, it returns undefined.\n\t *\n\t * This method is the inverse of {@link TreeIdentifierUtils.lengthen}. If you shorten an identifier\n\t * and then immediately pass it to {@link TreeIdentifierUtils.lengthen}, you will get the original string back.\n\t *\n\t * @param branch - TreeBranch from where you get the idCompressor to do the decompression.\n\t * @param nodeIdentifier - the stable identifier that needs to be shortened.\n\t */\n\tshorten(branch: TreeBranch, nodeIdentifier: string): number | undefined;\n\n\t/**\n\t * Returns the stable id as a string if the identifier is decompressible and known by the id compressor. Otherwise, it will throw an error.\n\t *\n\t * This method is the inverse of {@link TreeIdentifierUtils.shorten}. If you lengthen an identifier\n\t * and then immediately pass it to {@link TreeIdentifierUtils.shorten}, you will get the original short identifier back.\n\t *\n\t * @param branch - TreeBranch from where you want to get the id compressor to do the decompression.\n\t * @param nodeIdentifier - The local identifier that needs to be expanded.\n\t */\n\tlengthen(branch: TreeBranch, nodeIdentifier: number): string;\n\n\t/**\n\t * Returns the {@link SchemaFactory.identifier | identifier} of the given node in the most compressed form possible.\n\t * @remarks\n\t * If the node is {@link Unhydrated | hydrated} and its identifier is a valid UUID that was automatically generated by the SharedTree it is part of (or something else using the same {@link @fluidframework/id-compressor#IIdCompressor}), then this will return a process-unique integer corresponding to that identifier.\n\t * This is useful for performance-sensitive scenarios involving many nodes with identifiers that need to be compactly retained in memory or used for efficient lookup.\n\t * Note that automatically generated identifiers that were accessed before the node was hydrated will return the generated UUID, not the process-unique integer.\n\t *\n\t * If the node's identifier is any other user-provided string, then this will return undefined.\n\t *\n\t * If the node has no identifier (that is, it has no {@link SchemaFactory.identifier | identifier} field), then this returns `undefined`.\n\t *\n\t * If the node has more than one identifier, then this will throw an error.\n\t *\n\t * The returned integer should not be serialized or preserved outside of the current process.\n\t * Its lifetime is that of the current in-memory instance of the FF container for this client, and it is not guaranteed to be unique or stable outside of that context.\n\t * The same node's identifier may, for example, be different across multiple sessions for the same client and document, or different across two clients in the same session.\n\t */\n\tgetShort(node: TreeNode): number | undefined;\n\n\t/**\n\t * Creates and returns a long identifier.\n\t * The long identifier is a compressible, stable identifier generated by the tree's ID compressor.\n\t *\n\t * @param branch - TreeBranch from where you want to get the id compressor to generate the identifier from.\n\t */\n\tcreate(branch: TreeBranch): string;\n}\n\n/**\n * Extensions to {@link (Tree:interface)} and {@link (TreeBeta:interface)} which are not yet stable.\n * @remarks\n * Use via the {@link (TreeAlpha:variable)} singleton.\n *\n * The unhydrated node creation APIs in this interface do not support {@link ObjectSchemaOptions.allowUnknownOptionalFields | unknown optional fields}.\n * This is because unknown optional fields still must have a schema: its just that the schema may come from the document's stored schema.\n * Unhydrated nodes created via this interface are not associated with any document, so there is nowhere for them to get schema for unknown optional fields.\n * Note that {@link (TreeBeta:interface).clone} can create an unhydrated node with unknown optional fields, as it uses the source node's stored schema (if any).\n *\n * Export APIs in this interface include {@link ObjectSchemaOptions.allowUnknownOptionalFields | unknown optional fields}\n * if they are using {@link KeyEncodingOptions.allStoredKeys}.\n *\n * @privateRemarks\n * TODO:\n * There should be a way to provide a source for defaulted identifiers for unhydrated node creation, either via these APIs or some way to add them to its output later.\n * If an option were added to these APIs, it could also be used to enable unknown optional fields.\n *\n * @system @sealed @alpha\n */\nexport interface TreeAlpha {\n\t/**\n\t * Retrieve the {@link TreeBranch | branch}, if any, for the given node.\n\t * @param node - The node to query\n\t * @remarks If the node has already been inserted into the tree, this will return the branch associated with that node's {@link TreeView | view}.\n\t * Otherwise, it will return `undefined` (because the node has not yet been inserted and is therefore not part of a branch or view).\n\t *\n\t * This does not fork a new branch, but rather retrieves the _existing_ branch for the node.\n\t * To create a new branch, use e.g. {@link TreeBranch.fork | `myBranch.fork()`}.\n\t */\n\tbranch(node: TreeNode): TreeBranchAlpha | undefined;\n\n\t/**\n\t * Construct tree content that is compatible with the field defined by the provided `schema`.\n\t * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.\n\t * @param data - The data used to construct the field content.\n\t * @remarks\n\t * When providing a {@link TreeNodeSchemaClass}, this is the same as invoking its constructor except that an unhydrated node can also be provided.\n\t * This function exists as a generalization that can be used in other cases as well,\n\t * such as when `undefined` might be allowed (for an optional field), or when the type should be inferred from the data when more than one type is possible.\n\t */\n\tcreate<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: InsertableField<TSchema>,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t>;\n\n\t/**\n\t * {@inheritDoc (TreeBeta:interface).importConcise}\n\t */\n\timportConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: ConciseTree | undefined,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t>;\n\n\t/**\n\t * {@inheritDoc (TreeBeta:interface).(exportConcise:1)}\n\t * @privateRemarks Note: this was retained on this interface because {@link (TreeAlpha:interface).importConcise} exists.\n\t * It should be removed if/when that is removed from this interface.\n\t */\n\texportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;\n\n\t/**\n\t * {@inheritDoc (TreeBeta:interface).(exportConcise:2)}\n\t * @privateRemarks Note: this was retained on this interface because {@link (TreeAlpha:interface).importConcise} exists.\n\t * It should be removed if/when that is removed from this interface.\n\t */\n\texportConcise(\n\t\tnode: TreeNode | TreeLeafValue | undefined,\n\t\toptions?: TreeEncodingOptions,\n\t): ConciseTree | undefined;\n\n\t/**\n\t * Construct tree content compatible with a field defined by the provided `schema`.\n\t * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.\n\t * @param data - The data used to construct the field content. See {@link (TreeAlpha:interface).(exportVerbose:1)}.\n\t * @remarks\n\t * This currently does not support input containing\n\t * {@link ObjectSchemaOptions.allowUnknownOptionalFields| unknown optional fields} but does support\n\t * {@link SchemaStaticsBeta.staged | staged} allowed types.\n\t * Non-empty default values for fields are currently not supported (must be provided in the input).\n\t * The content will be validated against the schema and an error will be thrown if out of schema.\n\t */\n\timportVerbose<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tdata: VerboseTree | undefined,\n\t\toptions?: TreeParsingOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\n\t/**\n\t * Copy a snapshot of the current version of a TreeNode into a JSON compatible plain old JavaScript Object (except for {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}).\n\t * Uses the {@link VerboseTree} format, with an explicit type on every node.\n\t *\n\t * @remarks\n\t * There are several cases this may be preferred to {@link (TreeBeta:interface).(exportConcise:1)}:\n\t *\n\t * 1. When not using {@link ITreeConfigurationOptions.preventAmbiguity} (or when using `useStableFieldKeys`), `exportConcise` can produce ambiguous data (the type may be unclear on some nodes).\n\t * `exportVerbose` will always be unambiguous and thus lossless.\n\t *\n\t * 2. When the data might be interpreted without access to the exact same view schema. In such cases, the types may be unknowable if not included.\n\t *\n\t * 3. When easy access to the type is desired.\n\t */\n\texportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree;\n\n\t/**\n\t * Export the content of the provided `tree` in a compressed JSON compatible format.\n\t * @remarks\n\t * If an `idCompressor` is provided, it will be used to compress identifiers and thus will be needed to decompress the data.\n\t *\n\t * Always uses \"stored\" keys.\n\t * See {@link KeyEncodingOptions.allStoredKeys} for details.\n\t * @privateRemarks\n\t * TODO: It is currently not clear how to work with the idCompressors correctly in the package API.\n\t * Better APIs should probably be provided as there is currently no way to associate an un-hydrated tree with an idCompressor,\n\t * Nor get the correct idCompressor from a subtree to use when exporting it.\n\t * Additionally using `createIdCompressor` to make an idCompressor is `@legacy` and thus not intended for use in this API surface.\n\t * It would probably make more sense if we provided a way to get an idCompressor from the context of a node,\n\t * which could be optional (and settable if missing) for un0hydrated nodes and required for hydrated ones.\n\t * Add in a stable public API for creating idCompressors, and a way to get them from a tree (without view schema), and that should address the anticipated use-cases.\n\t */\n\texportCompressed(\n\t\ttree: TreeNode | TreeLeafValue,\n\t\toptions: { idCompressor?: IIdCompressor } & Pick<CodecWriteOptions, \"minVersionForCollab\">,\n\t): JsonCompatible<IFluidHandle>;\n\n\t/**\n\t * Import data encoded by {@link (TreeAlpha:interface).exportCompressed}.\n\t *\n\t * @param schema - Schema with which the data must be compatible. This compatibility is not verified and must be ensured by the caller.\n\t * @param compressedData - Data compressed by {@link (TreeAlpha:interface).exportCompressed}.\n\t * @param options - If {@link (TreeAlpha:interface).exportCompressed} was given an `idCompressor`, it must be provided here.\n\t *\n\t * @remarks\n\t * If the data could have been encoded with a different schema, consider encoding the schema along side it using {@link extractPersistedSchema} and loading the data using {@link independentView}.\n\t *\n\t * @privateRemarks\n\t * This API could be improved:\n\t *\n\t * 1. It could validate that the schema is compatible, and return or throw an error in the invalid case (maybe add a \"try\" version).\n\t *\n\t * 2. A \"try\" version of this could return an error if the data isn't in a supported format (as determined by version and/or JasonValidator).\n\t *\n\t * 3. Requiring the caller provide a JsonValidator isn't the most friendly API. It might be practical to provide a default.\n\t */\n\timportCompressed<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tcompressedData: JsonCompatible<IFluidHandle>,\n\t\toptions: { idCompressor?: IIdCompressor } & ICodecOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\n\t/**\n\t * APIs for creating, converting, and retrieving identifiers.\n\t */\n\treadonly identifier: TreeIdentifierUtils;\n\n\t/**\n\t * The key of the given node under its parent.\n\t * @remarks\n\t * If `node` is an element in a {@link (TreeArrayNode:interface)}, this returns the index of `node` in the array node (a `number`).\n\t * If `node` is the root node, this returns undefined.\n\t * Otherwise, this returns the key of the field that it is under (a `string`).\n\t */\n\tkey2(node: TreeNode): string | number | undefined;\n\n\t/**\n\t * Gets the child of the given node with the given property key if a child exists under that key.\n\t *\n\t * @remarks {@link ObjectSchemaOptions.allowUnknownOptionalFields | Unknown optional fields} of Object nodes will not be returned by this method.\n\t *\n\t * @param node - The parent node whose child is being requested.\n\t * @param key - The property key under the node under which the child is being requested.\n\t * For Object nodes, this is the developer-facing \"property key\", not the \"{@link SimpleObjectFieldSchema.storedKey | stored keys}\".\n\t *\n\t * @returns The child node or leaf value under the given key, or `undefined` if no such child exists.\n\t *\n\t * @see {@link (TreeAlpha:interface).key2}\n\t * @see {@link (TreeNodeApi:interface).parent}\n\t */\n\tchild(node: TreeNode, key: string | number): TreeNode | TreeLeafValue | undefined;\n\n\t/**\n\t * Gets the children of the provided node, paired with their property keys under the node.\n\t *\n\t * @remarks\n\t * No guarantees are made regarding the order of the children in the returned array.\n\t *\n\t * Optional properties of Object nodes with no value are not included in the result.\n\t *\n\t * {@link ObjectSchemaOptions.allowUnknownOptionalFields | Unknown optional fields} of Object nodes are not included in the result.\n\t *\n\t * @param node - The node whose children are being requested.\n\t *\n\t * @returns\n\t * An array of pairs of the form `[propertyKey, child]`.\n\t *\n\t * For Array nodes, the `propertyKey` is the index of the child in the array.\n\t *\n\t * For Object nodes, the returned `propertyKey`s are the developer-facing \"property keys\", not the \"{@link SimpleObjectFieldSchema.storedKey | stored keys}\".\n\t *\n\t * @see {@link (TreeAlpha:interface).key2}\n\t * @see {@link (TreeNodeApi:interface).parent}\n\t */\n\tchildren(\n\t\tnode: TreeNode,\n\t): Iterable<[propertyKey: string | number, child: TreeNode | TreeLeafValue]>;\n\n\t/**\n\t * Track observations of any TreeNode content.\n\t * @remarks\n\t * This subscribes to changes to any nodes content observed during `trackDuring`.\n\t *\n\t * Currently this does not support tracking parentage (see {@link (TreeAlpha:interface).trackObservationsOnce} for a version which does):\n\t * if accessing parentage during `trackDuring`, this will throw a usage error.\n\t *\n\t * This also does not track node status changes (e.g. whether a node is attached to a view or not).\n\t * The current behavior of checking status is unspecified: future versions may track it, error, or ignore it.\n\t *\n\t * These subscriptions remain active until `unsubscribe` is called: `onInvalidation` may be called multiple times.\n\t * See {@link (TreeAlpha:interface).trackObservationsOnce} for a version which automatically unsubscribes on the first invalidation.\n\t * @privateRemarks\n\t * This version, while more general than {@link (TreeAlpha:interface).trackObservationsOnce}, might be unnecessary.\n\t * Maybe this should be removed and only `trackObservationsOnce` kept.\n\t * Reevaluate this before stabilizing.\n\t */\n\ttrackObservations<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult>;\n\n\t/**\n\t * {@link (TreeAlpha:interface).trackObservations} except automatically unsubscribes when the first invalidation occurs.\n\t * @remarks\n\t * This also supports tracking parentage, unlike {@link (TreeAlpha:interface).trackObservations}, as long as the parent is not undefined.\n\t *\n\t * @example Simple cached value invalidation\n\t * ```typescript\n\t * // Compute and cache this \"foo\" value, and clear the cache when the fields read in the callback to compute it change.\n\t * cachedFoo ??= TreeAlpha.trackObservationsOnce(\n\t * \t() => {\n\t * \t\tcachedFoo = undefined;\n\t * \t},\n\t * \t() => nodeA.someChild.bar + nodeB.someChild.baz,\n\t * ).result;\n\t * ```\n\t *\n\t * That is equivalent to doing the following:\n\t * ```typescript\n\t * if (cachedFoo === undefined) {\n\t * \tcachedFoo = nodeA.someChild.bar + nodeB.someChild.baz;\n\t * \tconst invalidate = (): void => {\n\t * \t\tcachedFoo = undefined;\n\t * \t\tfor (const u of unsubscribe) {\n\t * \t\t\tu();\n\t * \t\t}\n\t * \t};\n\t * \tconst unsubscribe: (() => void)[] = [\n\t * \t\tTreeBeta.on(nodeA, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"someChild\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t\tTreeBeta.on(nodeB, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"someChild\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t\tTreeBeta.on(nodeA.someChild, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"bar\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t\tTreeBeta.on(nodeB.someChild, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"baz\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t];\n\t * }\n\t * ```\n\t * @example Cached derived schema property\n\t * ```typescript\n\t * const factory = new SchemaFactory(\"com.example\");\n\t * class Vector extends factory.object(\"Vector\", {\n\t * \tx: SchemaFactory.number,\n\t * \ty: SchemaFactory.number,\n\t * }) {\n\t * \t#length: number | undefined = undefined;\n\t * \tpublic length(): number {\n\t * \t\tif (this.#length === undefined) {\n\t * \t\t\tconst result = TreeAlpha.trackObservationsOnce(\n\t * \t\t\t\t() => {\n\t * \t\t\t\t\tthis.#length = undefined;\n\t * \t\t\t\t},\n\t * \t\t\t\t() => Math.hypot(this.x, this.y),\n\t * \t\t\t);\n\t * \t\t\tthis.#length = result.result;\n\t * \t\t}\n\t * \t\treturn this.#length;\n\t * \t}\n\t * }\n\t * const vec = new Vector({ x: 3, y: 4 });\n\t * assert.equal(vec.length(), 5);\n\t * vec.x = 0;\n\t * assert.equal(vec.length(), 4);\n\t * ```\n\t */\n\ttrackObservationsOnce<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult>;\n\n\t/**\n\t * Ensures that the provided content will be interpreted as the given schema when inserting into the tree.\n\t * @returns `content`, for convenience.\n\t * @remarks\n\t * If applicable, this will tag the given content with a {@link contentSchemaSymbol | special property} that indicates its intended schema.\n\t * The `content` will be interpreted as the given `schema` when later inserted into the tree.\n\t *\n\t * This does not validate that the content actually conforms to the given schema (such validation will be done at insert time).\n\t * If the content is not compatible with the tagged schema, an error will be thrown when the content is inserted.\n\t *\n\t * This is particularly useful when the content's schema cannot be inferred from its structure alone because it is compatible with multiple schemas.\n\t * @example\n\t * ```typescript\n\t * const sf = new SchemaFactory(\"example\");\n\t * class Dog extends sf.object(\"Dog\", { name: sf.string() }) {}\n\t * class Cat extends sf.object(\"Cat\", { name: sf.string() }) {}\n\t * class Root extends sf.object(\"Root\", { pet: [Dog, Cat] }) {}\n\t * // ...\n\t * const pet = { name: \"Max\" };\n\t * view.root.pet = pet; // Error: ambiguous schema - is it a Dog or a Cat?\n\t * TreeAlpha.ensureSchema(Dog, pet); // Tags `pet` as a Dog.\n\t * view.root.pet = pet; // No error - it's a Dog.\n\t * ```\n\t */\n\ttagContentSchema<TSchema extends TreeNodeSchema, TContent extends InsertableField<TSchema>>(\n\t\tschema: TSchema,\n\t\tcontent: TContent,\n\t): TContent;\n}\n\n/**\n * Results from an operation with tracked observations.\n * @remarks\n * Results from {@link (TreeAlpha:interface).trackObservations} or {@link (TreeAlpha:interface).trackObservationsOnce}.\n * @sealed @alpha\n */\nexport interface ObservationResults<TResult> {\n\t/**\n\t * The result of the operation which had its observations tracked.\n\t */\n\treadonly result: TResult;\n\n\t/**\n\t * Call to unsubscribe from further invalidations.\n\t */\n\treadonly unsubscribe: () => void;\n}\n\n/**\n * Subscription to changes on a single node.\n * @remarks\n * Either tracks some set of fields, or all fields and can be updated to track more fields.\n */\nclass NodeSubscription {\n\t/**\n\t * If undefined, subscribes to all keys.\n\t * Otherwise only subscribes to the keys in the set.\n\t */\n\tprivate keys: Set<FieldKey> | undefined;\n\tprivate readonly unsubscribe: () => void;\n\tprivate constructor(\n\t\tprivate readonly onInvalidation: () => void,\n\t\tflexNode: FlexTreeNode,\n\t) {\n\t\t// TODO:Performance: It is possible to optimize this to not use the public TreeNode API.\n\t\tconst node = getOrCreateNodeFromInnerNode(flexNode);\n\t\tassert(node instanceof TreeNode, 0xc54 /* Unexpected leaf value */);\n\n\t\tconst handler = (data: NodeChangedData): void => {\n\t\t\tif (this.keys === undefined || data.changedProperties === undefined) {\n\t\t\t\tthis.onInvalidation();\n\t\t\t} else {\n\t\t\t\tlet keyMap: ReadonlyMap<FieldKey, string> | undefined;\n\t\t\t\tconst schema = treeNodeApi.schema(node);\n\t\t\t\tif (isObjectNodeSchema(schema)) {\n\t\t\t\t\tkeyMap = schema.storedKeyToPropertyKey;\n\t\t\t\t}\n\t\t\t\t// TODO:Performance: Ideally this would use Set.prototype.isDisjointFrom when available.\n\t\t\t\tfor (const flexKey of this.keys) {\n\t\t\t\t\t// TODO:Performance: doing everything at the flex tree layer could avoid this translation\n\t\t\t\t\tconst key = keyMap?.get(flexKey) ?? flexKey;\n\n\t\t\t\t\tif (data.changedProperties.has(key)) {\n\t\t\t\t\t\tthis.onInvalidation();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.unsubscribe = TreeBeta.on(node, \"nodeChanged\", handler);\n\t}\n\n\t/**\n\t * Create an {@link Observer} which subscribes to what was observed in {@link NodeSubscription}s.\n\t */\n\tpublic static createObserver(\n\t\tinvalidate: () => void,\n\t\tonlyOnce = false,\n\t): { observer: Observer; unsubscribe: () => void } {\n\t\tconst subscriptions = new Map<FlexTreeNode, NodeSubscription>();\n\t\tconst observer: Observer = {\n\t\t\tobserveNodeFields(flexNode: FlexTreeNode): void {\n\t\t\t\tif (flexNode.value !== undefined) {\n\t\t\t\t\t// Leaf value, nothing to observe.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst subscription = subscriptions.get(flexNode);\n\t\t\t\tif (subscription !== undefined) {\n\t\t\t\t\t// Already subscribed to this node.\n\t\t\t\t\tsubscription.keys = undefined; // Now subscribed to all keys.\n\t\t\t\t} else {\n\t\t\t\t\tconst newSubscription = new NodeSubscription(invalidate, flexNode);\n\t\t\t\t\tsubscriptions.set(flexNode, newSubscription);\n\t\t\t\t}\n\t\t\t},\n\t\t\tobserveNodeField(flexNode: FlexTreeNode, key: FieldKey): void {\n\t\t\t\tif (flexNode.value !== undefined) {\n\t\t\t\t\t// Leaf value, nothing to observe.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst subscription = subscriptions.get(flexNode);\n\t\t\t\tif (subscription !== undefined) {\n\t\t\t\t\t// Already subscribed to this node: if not subscribed to all keys, subscribe to this one.\n\t\t\t\t\t// TODO:Performance: due to how JavaScript set ordering works,\n\t\t\t\t\t// it might be faster to check `has` and only add if not present in case the same field is viewed many times.\n\t\t\t\t\tsubscription.keys?.add(key);\n\t\t\t\t} else {\n\t\t\t\t\tconst newSubscription = new NodeSubscription(invalidate, flexNode);\n\t\t\t\t\tnewSubscription.keys = new Set([key]);\n\t\t\t\t\tsubscriptions.set(flexNode, newSubscription);\n\t\t\t\t}\n\t\t\t},\n\t\t\tobserveParentOf(node: FlexTreeNode): void {\n\t\t\t\t// Supporting parent tracking is more difficult that it might seem at first.\n\t\t\t\t// There are two main complicating factors:\n\t\t\t\t// 1. The parent may be undefined (the node is a root).\n\t\t\t\t// 2. If tracking this by subscribing to the parent's changes, then which events are subscribed to needs to be updated after the parent changes.\n\t\t\t\t//\n\t\t\t\t// If not supporting the first case (undefined parents), the second case gets problematic: edits which un-parent a node could error due to being unable to update the event subscription.\n\t\t\t\t// For now this is mitigated by only supporting one of tracking (non-undefined) parents or maintaining event subscriptions across edits.\n\n\t\t\t\tif (!onlyOnce) {\n\t\t\t\t\t// TODO: better APIS should be provided which make handling this case practical.\n\t\t\t\t\tthrow new UsageError(\"Observation tracking for parents is currently not supported.\");\n\t\t\t\t}\n\n\t\t\t\tconst parent = withObservation(undefined, () => node.parentField.parent);\n\n\t\t\t\tif (parent.parent === undefined) {\n\t\t\t\t\t// TODO: better APIS should be provided which make handling this case practical.\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\"Observation tracking for parents is currently not supported when parent is undefined.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tobserver.observeNodeField(parent.parent, parent.key);\n\t\t\t},\n\t\t};\n\n\t\tlet subscribed = true;\n\n\t\treturn {\n\t\t\tobserver,\n\t\t\tunsubscribe: () => {\n\t\t\t\tif (!subscribed) {\n\t\t\t\t\tthrow new UsageError(\"Already unsubscribed\");\n\t\t\t\t}\n\t\t\t\tsubscribed = false;\n\t\t\t\tfor (const subscription of subscriptions.values()) {\n\t\t\t\t\tsubscription.unsubscribe();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n}\n\n/**\n * Handles both {@link (TreeAlpha:interface).trackObservations} and {@link (TreeAlpha:interface).trackObservationsOnce}.\n */\nfunction trackObservations<TResult>(\n\tonInvalidation: () => void,\n\ttrackDuring: () => TResult,\n\tonlyOnce = false,\n): ObservationResults<TResult> {\n\tlet observing = true;\n\n\tconst invalidate = (): void => {\n\t\tif (observing) {\n\t\t\tthrow new UsageError(\"Cannot invalidate while tracking observations\");\n\t\t}\n\t\tonInvalidation();\n\t};\n\n\tconst { observer, unsubscribe } = NodeSubscription.createObserver(invalidate, onlyOnce);\n\tconst result = withObservation(observer, trackDuring);\n\tobserving = false;\n\n\treturn {\n\t\tresult,\n\t\tunsubscribe,\n\t};\n}\n\n/**\n * Extensions to {@link (Tree:variable)} and {@link (TreeBeta:variable)} which are not yet stable.\n * @see {@link (TreeAlpha:interface)}.\n * @alpha\n */\nexport const TreeAlpha: TreeAlpha = {\n\ttrackObservations<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult> {\n\t\treturn trackObservations(onInvalidation, trackDuring);\n\t},\n\n\ttrackObservationsOnce<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult> {\n\t\tconst result = trackObservations(\n\t\t\t() => {\n\t\t\t\t// trackObservations ensures no invalidation occurs while its running,\n\t\t\t\t// so this callback can only run after trackObservations has returns and thus result is defined.\n\t\t\t\tresult.unsubscribe();\n\t\t\t\tonInvalidation();\n\t\t\t},\n\t\t\ttrackDuring,\n\t\t\ttrue,\n\t\t);\n\t\treturn result;\n\t},\n\n\tbranch(node: TreeNode): TreeBranchAlpha | undefined {\n\t\tconst kernel = getKernel(node);\n\t\tif (!kernel.isHydrated()) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst view = kernel.anchorNode.anchorSet.slots.get(ViewSlot);\n\t\tassert(\n\t\t\tview instanceof SchematizingSimpleTreeView,\n\t\t\t0xa5c /* Unexpected view implementation */,\n\t\t);\n\t\treturn view;\n\t},\n\n\tcreate<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: InsertableField<TSchema>,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t> {\n\t\tconst mapTree = unhydratedFlexTreeFromInsertable(\n\t\t\tdata as InsertableField<UnsafeUnknownSchema>,\n\t\t\tschema,\n\t\t);\n\t\tconst result = mapTree === undefined ? undefined : getOrCreateNodeFromInnerNode(mapTree);\n\t\treturn result as Unhydrated<\n\t\t\tTSchema extends ImplicitFieldSchema\n\t\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t\t: TreeNode | TreeLeafValue | undefined\n\t\t>;\n\t},\n\n\timportConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: ConciseTree | undefined,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t> {\n\t\treturn importConcise(schema, data);\n\t},\n\n\texportConcise,\n\n\timportVerbose<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tdata: VerboseTree | undefined,\n\t\toptions?: TreeParsingOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\t\tconst config: TreeEncodingOptions = { ...options };\n\t\t// Create a config which is standalone, and thus can be used without having to refer back to the schema.\n\t\tconst schemalessConfig = applySchemaToParserOptions(schema, config);\n\t\tif (data === undefined) {\n\t\t\tconst field = normalizeFieldSchema(schema);\n\t\t\tif (field.kind !== FieldKind.Optional) {\n\t\t\t\tthrow new UsageError(\"undefined provided for non-optional field.\");\n\t\t\t}\n\t\t\treturn undefined as Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\t\t}\n\t\tconst cursor = cursorFromVerbose(data, schemalessConfig);\n\t\treturn createFromCursor(\n\t\t\tschema,\n\t\t\tcursor,\n\t\t\tgetUnhydratedContext(schema).flexContext.schema.rootFieldSchema,\n\t\t);\n\t},\n\n\texportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree {\n\t\tif (isTreeValue(node)) {\n\t\t\treturn node;\n\t\t}\n\t\tconst config: TreeEncodingOptions = { ...options };\n\n\t\tconst cursor = borrowCursorFromTreeNodeOrValue(node);\n\t\tconst kernel = getKernel(node);\n\t\treturn verboseFromCursor(cursor, kernel.context, config);\n\t},\n\n\texportCompressed(\n\t\tnode: TreeNode | TreeLeafValue,\n\t\toptions: { idCompressor?: IIdCompressor } & Pick<CodecWriteOptions, \"minVersionForCollab\">,\n\t): JsonCompatible<IFluidHandle> {\n\t\tconst schema = tryGetSchema(node) ?? fail(0xacf /* invalid input */);\n\t\tconst codec = makeFieldBatchCodec({\n\t\t\tjsonValidator: FormatValidatorNoOp,\n\t\t\tminVersionForCollab: options.minVersionForCollab,\n\t\t});\n\t\tconst cursor = borrowFieldCursorFromTreeNodeOrValue(node);\n\t\tconst batch: FieldBatch = [cursor];\n\t\t// If none provided, create a compressor which will not compress anything.\n\t\tconst idCompressor = options.idCompressor ?? createIdCompressor();\n\n\t\t// Grabbing an existing stored schema from the node is important to ensure that unknown optional fields can be preserved.\n\t\t// Note that if the node is unhydrated, this can result in all staged allowed types being included in the schema, which might be undesired.\n\t\tconst storedSchema = isTreeNode(node)\n\t\t\t? getKernel(node).context.flexContext.schema\n\t\t\t: toInitialSchema(schema);\n\n\t\tconst context: FieldBatchEncodingContext = {\n\t\t\tencodeType: TreeCompressionStrategy.Compressed,\n\t\t\tidCompressor,\n\t\t\toriginatorId: idCompressor.localSessionId, // TODO: Why is this needed?\n\t\t\tschema: { schema: storedSchema, policy: defaultSchemaPolicy },\n\t\t};\n\t\tconst result = codec.encode(batch, context);\n\t\treturn result;\n\t},\n\n\timportCompressed<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tcompressedData: JsonCompatible<IFluidHandle>,\n\t\toptions: {\n\t\t\tidCompressor?: IIdCompressor;\n\t\t} & CodecWriteOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\t\tconst config = new TreeViewConfigurationAlpha({ schema });\n\t\tconst content: ViewContent = {\n\t\t\t// Always use a v1 schema codec for consistency.\n\t\t\t// TODO: reevaluate how staged schema should behave in schema import/export APIs before stabilizing this.\n\t\t\tschema: extractPersistedSchema(config.schema, FluidClientVersion.v2_0, () => true),\n\t\t\ttree: compressedData,\n\t\t\tidCompressor: options.idCompressor ?? createIdCompressor(),\n\t\t};\n\t\tconst view = independentInitializedView(config, options, content);\n\t\treturn TreeBeta.clone<TSchema>(view.root);\n\t},\n\n\tidentifier,\n\n\tkey2(node: TreeNode): string | number | undefined {\n\t\t// If the parent is undefined, then this node is under the root field,\n\t\tconst parent = treeNodeApi.parent(node);\n\t\tif (parent === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// The flex-domain strictly operates in terms of \"stored keys\".\n\t\t// To find the associated developer-facing \"property key\", we need to look up the field associated with\n\t\t// the stored key from the flex-domain, and get property key its simple-domain counterpart was created with.\n\t\tconst storedKey = getStoredKey(node);\n\t\tconst parentSchema = treeNodeApi.schema(parent);\n\t\treturn getPropertyKeyFromStoredKey(parentSchema, storedKey);\n\t},\n\n\tchild: (\n\t\tnode: TreeNode,\n\t\tpropertyKey: string | number,\n\t): TreeNode | TreeLeafValue | undefined => {\n\t\tconst flexNode = getInnerNode(node);\n\t\tdebugAssert(\n\t\t\t() => !flexNode.context.isDisposed() || \"The provided tree node has been disposed.\",\n\t\t);\n\n\t\tconst schema = treeNodeApi.schema(node);\n\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Array: {\n\t\t\t\tconst sequence = flexNode.tryGetField(EmptyKey) as FlexTreeSequenceField | undefined;\n\n\t\t\t\t// Empty sequence - cannot have children.\n\t\t\t\tif (sequence === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst index =\n\t\t\t\t\ttypeof propertyKey === \"number\"\n\t\t\t\t\t\t? propertyKey\n\t\t\t\t\t\t: asIndex(propertyKey, Number.POSITIVE_INFINITY);\n\n\t\t\t\t// If the key is not a valid index, then there is no corresponding child.\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst childFlexTree = sequence.at(index);\n\n\t\t\t\t// No child at the given index.\n\t\t\t\tif (childFlexTree === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn getOrCreateNodeFromInnerUnboxedNode(childFlexTree);\n\t\t\t}\n\t\t\tcase NodeKind.Map:\n\t\t\t\tif (typeof propertyKey !== \"string\") {\n\t\t\t\t\t// Map nodes only support string keys.\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t// Fall through\n\t\t\tcase NodeKind.Record:\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tlet storedKey: string | number = propertyKey;\n\t\t\t\tif (isObjectNodeSchema(schema)) {\n\t\t\t\t\tconst fieldSchema = schema.fields.get(String(propertyKey));\n\t\t\t\t\tif (fieldSchema === undefined) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tstoredKey = fieldSchema.storedKey;\n\t\t\t\t}\n\n\t\t\t\tconst field = flexNode.tryGetField(brand(String(storedKey)));\n\t\t\t\tif (field !== undefined) {\n\t\t\t\t\treturn tryGetTreeNodeForField(field);\n\t\t\t\t}\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\tfail(0xbc3 /* Leaf schema associated with non-leaf tree node. */);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(schema.kind);\n\t\t\t}\n\t\t}\n\t},\n\n\tchildren(node: TreeNode): [propertyKey: string | number, child: TreeNode | TreeLeafValue][] {\n\t\tconst flexNode = getInnerNode(node);\n\t\tdebugAssert(\n\t\t\t() => !flexNode.context.isDisposed() || \"The provided tree node has been disposed.\",\n\t\t);\n\n\t\tconst schema = treeNodeApi.schema(node);\n\n\t\tconst result: [string | number, TreeNode | TreeLeafValue][] = [];\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Array: {\n\t\t\t\tconst sequence = flexNode.tryGetField(EmptyKey) as FlexTreeSequenceField | undefined;\n\t\t\t\tif (sequence === undefined) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tfor (let index = 0; index < sequence.length; index++) {\n\t\t\t\t\tconst childFlexTree = sequence.at(index);\n\t\t\t\t\tassert(childFlexTree !== undefined, 0xbc4 /* Sequence child was undefined. */);\n\t\t\t\t\tconst childTree = getOrCreateNodeFromInnerUnboxedNode(childFlexTree);\n\t\t\t\t\tresult.push([index, childTree]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Map:\n\t\t\tcase NodeKind.Record: {\n\t\t\t\tfor (const [key, flexField] of flexNode.fields) {\n\t\t\t\t\tconst childTreeNode = tryGetTreeNodeForField(flexField);\n\t\t\t\t\tif (childTreeNode !== undefined) {\n\t\t\t\t\t\tresult.push([key, childTreeNode]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tassert(isObjectNodeSchema(schema), 0xbc5 /* Expected object schema. */);\n\t\t\t\tfor (const [propertyKey, fieldSchema] of schema.fields) {\n\t\t\t\t\tconst storedKey = fieldSchema.storedKey;\n\t\t\t\t\tconst flexField = flexNode.tryGetField(brand(String(storedKey)));\n\t\t\t\t\tif (flexField !== undefined) {\n\t\t\t\t\t\tconst childTreeNode = tryGetTreeNodeForField(flexField);\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tchildTreeNode !== undefined,\n\t\t\t\t\t\t\t0xbc6 /* Expected child tree node for field. */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tresult.push([propertyKey, childTreeNode]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\tfail(0xbc7 /* Leaf schema associated with non-leaf tree node. */);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(schema.kind);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t},\n\n\ttagContentSchema<TSchema extends TreeNodeSchema, TNode extends InsertableField<TSchema>>(\n\t\tschema: TSchema,\n\t\tnode: TNode,\n\t): TNode {\n\t\tif (typeof node === \"object\" && node !== null && !isFluidHandle(node)) {\n\t\t\tReflect.defineProperty(node, contentSchemaSymbol, {\n\t\t\t\tconfigurable: false,\n\t\t\t\tenumerable: false,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: schema.identifier,\n\t\t\t});\n\t\t}\n\t\treturn node;\n\t},\n};\n\n/**\n * Borrow a cursor from a field.\n * @remarks\n * The cursor must be put back to its original location before the node is used again.\n */\nfunction borrowFieldCursorFromTreeNodeOrValue(\n\tnode: TreeNode | TreeLeafValue | undefined,\n): ITreeCursorSynchronous {\n\tif (node === undefined) {\n\t\treturn cursorForMapTreeField([]);\n\t}\n\tconst cursor = borrowCursorFromTreeNodeOrValue(node);\n\t// TODO: avoid copy: borrow cursor from field instead.\n\tconst mapTree = mapTreeFromCursor(cursor);\n\treturn cursorForMapTreeField([mapTree]);\n}\n"]}
@@ -5,10 +5,10 @@
5
5
  import type { Listenable } from "@fluidframework/core-interfaces/internal";
6
6
  import type { IIdCompressor } from "@fluidframework/id-compressor";
7
7
  import { type ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
8
- import { type Anchor, type AnchorLocator, type AnchorNode, type AnchorSetRootEvents, type ChangeFamily, type CommitMetadata, type DetachedFieldIndex, type IEditableForest, type IForestSubscription, type JsonableTree, type RevisionTag, type RevisionTagCodec, type TreeStoredSchema, TreeStoredSchemaRepository, type TreeStoredSchemaSubscription, type RevertibleAlphaFactory, type GraphCommit } from "../core/index.js";
8
+ import { type Anchor, type AnchorLocator, type AnchorNode, type AnchorSetRootEvents, type ChangeFamily, type DetachedFieldIndex, type IEditableForest, type IForestSubscription, type JsonableTree, type RevisionTag, type RevisionTagCodec, type TreeStoredSchema, TreeStoredSchemaRepository, type TreeStoredSchemaSubscription, type RevertibleAlphaFactory, type GraphCommit, type ChangeMetadata, type ReadOnlyDetachedFieldIndex } from "../core/index.js";
9
9
  import { type FieldBatchCodec, type TreeCompressionStrategy } from "../feature-libraries/index.js";
10
10
  import { SharedTreeBranch, type SharedTreeBranchChange, type Transactor } from "../shared-tree-core/index.js";
11
- import { Breakable, disposeSymbol, type WithBreakable } from "../util/index.js";
11
+ import { Breakable, disposeSymbol, type JsonCompatibleReadOnly, type WithBreakable } from "../util/index.js";
12
12
  import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
13
13
  import type { ISharedTreeEditor, SharedTreeEditBuilder } from "./sharedTreeEditBuilder.js";
14
14
  import type { IDisposable } from "@fluidframework/core-interfaces";
@@ -44,7 +44,7 @@ export interface CheckoutEvents {
44
44
  * @param getRevertible - a function provided that allows users to get a revertible for the change. If not provided,
45
45
  * this change is not revertible.
46
46
  */
47
- changed(data: CommitMetadata, getRevertible?: RevertibleAlphaFactory): void;
47
+ changed(data: ChangeMetadata, getRevertible?: RevertibleAlphaFactory): void;
48
48
  /**
49
49
  * Fired when a new branch is created from this checkout.
50
50
  */
@@ -223,7 +223,7 @@ export declare class TreeCheckout implements ITreeCheckoutFork {
223
223
  private readonly mintRevisionTag;
224
224
  private readonly revisionTagCodec;
225
225
  private readonly idCompressor;
226
- removedRoots: DetachedFieldIndex;
226
+ private readonly _removedRoots;
227
227
  /** Optional logger for telemetry. */
228
228
  private readonly logger?;
229
229
  readonly breaker: Breakable;
@@ -249,15 +249,20 @@ export declare class TreeCheckout implements ITreeCheckoutFork {
249
249
  events: Listenable<CheckoutEvents>;
250
250
  constructor(branch: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>,
251
251
  /** True if and only if this checkout is for a branch which is persisted and shared with other clients. */
252
- isSharedBranch: boolean, changeFamily: ChangeFamily<SharedTreeEditBuilder, SharedTreeChange>, storedSchema: TreeStoredSchemaRepository, forest: IEditableForest, mintRevisionTag: () => RevisionTag, revisionTagCodec: RevisionTagCodec, idCompressor: IIdCompressor, removedRoots?: DetachedFieldIndex,
252
+ isSharedBranch: boolean, changeFamily: ChangeFamily<SharedTreeEditBuilder, SharedTreeChange>, storedSchema: TreeStoredSchemaRepository, forest: IEditableForest, mintRevisionTag: () => RevisionTag, revisionTagCodec: RevisionTagCodec, idCompressor: IIdCompressor, _removedRoots?: DetachedFieldIndex,
253
253
  /** Optional logger for telemetry. */
254
254
  logger?: ITelemetryLoggerExt | undefined, breaker?: Breakable, disposeForksAfterTransaction?: boolean);
255
+ get removedRoots(): ReadOnlyDetachedFieldIndex;
255
256
  private registerForBranchEvents;
256
257
  private unregisterFromBranchEvents;
257
258
  private createTransactionStack;
258
259
  exportVerbose(): VerboseTree | undefined;
259
260
  private readonly onAfterBranchChange;
260
261
  private readonly onAfterChange;
262
+ /**
263
+ * Applies the given serialized change (as was produced via a `"changed"` event of another checkout) to this checkout.
264
+ */
265
+ applySerializedChange(serializedChange: JsonCompatibleReadOnly): void;
261
266
  private applyChange;
262
267
  private readonly onAncestryTrimmed;
263
268
  private withCombinedVisitor;
@@ -1 +1 @@
1
- {"version":3,"file":"treeCheckout.d.ts","sourceRoot":"","sources":["../../src/shared-tree/treeCheckout.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAgB,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAEN,KAAK,mBAAmB,EACxB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EACN,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,UAAU,EAEf,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAEjB,KAAK,cAAc,EAEnB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAEjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,0BAA0B,EAC1B,KAAK,4BAA4B,EAOjC,KAAK,sBAAsB,EAE3B,KAAK,WAAW,EAQhB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAQ5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEN,gBAAgB,EAGhB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAe,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,KAAK,EAAE,WAAW,EAAE,MAA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