@fluidframework/tree 2.3.0-288113 → 2.3.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 (869) hide show
  1. package/.dependency-cruiser-known-violations.json +28 -40
  2. package/.vscode/Tree.code-workspace +0 -2
  3. package/CHANGELOG.md +92 -0
  4. package/README.md +6 -0
  5. package/alpha.d.ts +11 -0
  6. package/api-extractor/api-extractor-lint-alpha.cjs.json +5 -0
  7. package/api-extractor/api-extractor-lint-alpha.esm.json +5 -0
  8. package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
  9. package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
  10. package/api-extractor/api-extractor.current.json +8 -0
  11. package/api-extractor/api-extractor.legacy.json +4 -0
  12. package/api-extractor.json +1 -1
  13. package/api-report/tree.alpha.api.md +21 -42
  14. package/api-report/tree.beta.api.md +21 -11
  15. package/api-report/tree.legacy.alpha.api.md +562 -0
  16. package/api-report/tree.legacy.public.api.md +559 -0
  17. package/api-report/tree.public.api.md +8 -13
  18. package/dist/alpha.d.ts +102 -0
  19. package/dist/beta.d.ts +6 -2
  20. package/dist/core/index.d.ts +1 -1
  21. package/dist/core/index.d.ts.map +1 -1
  22. package/dist/core/index.js +2 -2
  23. package/dist/core/index.js.map +1 -1
  24. package/dist/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
  25. package/dist/core/revertible.d.ts.map +1 -0
  26. package/dist/core/revertible.js.map +1 -0
  27. package/dist/core/schema-stored/format.d.ts +3 -3
  28. package/dist/core/schema-stored/format.js +1 -1
  29. package/dist/core/schema-stored/format.js.map +1 -1
  30. package/dist/core/schema-stored/schema.d.ts +2 -7
  31. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  32. package/dist/core/schema-stored/schema.js +4 -6
  33. package/dist/core/schema-stored/schema.js.map +1 -1
  34. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  35. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  36. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  37. package/dist/core/tree/anchorSet.js +6 -2
  38. package/dist/core/tree/anchorSet.js.map +1 -1
  39. package/dist/core/tree/detachedFieldIndex.d.ts +0 -1
  40. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  41. package/dist/core/tree/detachedFieldIndex.js +1 -0
  42. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  43. package/dist/core/tree/visitDelta.d.ts +7 -2
  44. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  45. package/dist/core/tree/visitDelta.js.map +1 -1
  46. package/dist/events/emitter.d.ts +127 -0
  47. package/dist/events/emitter.d.ts.map +1 -0
  48. package/dist/events/{events.js → emitter.js} +48 -30
  49. package/dist/events/emitter.js.map +1 -0
  50. package/dist/events/index.d.ts +2 -1
  51. package/dist/events/index.d.ts.map +1 -1
  52. package/dist/events/index.js +4 -5
  53. package/dist/events/index.js.map +1 -1
  54. package/dist/events/interop.d.ts +36 -0
  55. package/dist/events/interop.d.ts.map +1 -0
  56. package/dist/{core/revertible/index.d.ts → events/interop.js} +3 -2
  57. package/dist/events/interop.js.map +1 -0
  58. package/dist/events/listeners.d.ts +65 -0
  59. package/dist/events/listeners.d.ts.map +1 -0
  60. package/{lib/core/revertible/index.d.ts → dist/events/listeners.js} +3 -2
  61. package/dist/events/listeners.js.map +1 -0
  62. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
  63. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/chunkTree.js +36 -15
  65. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
  67. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/chunkedForest.js +12 -5
  69. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
  71. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/uniformChunk.js +28 -2
  73. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  74. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
  75. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  76. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
  77. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  78. package/dist/feature-libraries/flex-map-tree/index.d.ts +1 -1
  79. package/dist/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
  80. package/dist/feature-libraries/flex-map-tree/index.js +2 -1
  81. package/dist/feature-libraries/flex-map-tree/index.js.map +1 -1
  82. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -33
  83. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  84. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +82 -103
  85. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  86. package/dist/feature-libraries/flex-tree/context.d.ts +30 -14
  87. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  88. package/dist/feature-libraries/flex-tree/context.js +10 -7
  89. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  90. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -190
  91. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  92. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +15 -3
  93. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  94. package/dist/feature-libraries/flex-tree/index.d.ts +2 -3
  95. package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
  96. package/dist/feature-libraries/flex-tree/index.js.map +1 -1
  97. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
  98. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  99. package/dist/feature-libraries/flex-tree/lazyEntity.js +2 -10
  100. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  101. package/dist/feature-libraries/flex-tree/lazyField.d.ts +26 -28
  102. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  103. package/dist/feature-libraries/flex-tree/lazyField.js +11 -14
  104. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  105. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +5 -26
  106. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  107. package/dist/feature-libraries/flex-tree/lazyNode.js +23 -74
  108. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  109. package/dist/feature-libraries/flex-tree/unboxed.d.ts +4 -16
  110. package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  111. package/dist/feature-libraries/flex-tree/unboxed.js +7 -41
  112. package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
  113. package/dist/feature-libraries/flex-tree/utilities.d.ts +2 -2
  114. package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  115. package/dist/feature-libraries/flex-tree/utilities.js +3 -6
  116. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  118. package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -1
  119. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  120. package/dist/feature-libraries/index.d.ts +3 -5
  121. package/dist/feature-libraries/index.d.ts.map +1 -1
  122. package/dist/feature-libraries/index.js +5 -11
  123. package/dist/feature-libraries/index.js.map +1 -1
  124. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  125. package/dist/feature-libraries/modular-schema/comparison.js +3 -6
  126. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  127. package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  128. package/dist/feature-libraries/modular-schema/discrepancies.js +3 -13
  129. package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  130. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
  131. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  132. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
  133. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  134. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
  135. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  136. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
  137. package/dist/feature-libraries/schema-index/format.d.ts +3 -3
  138. package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  139. package/dist/feature-libraries/storedToViewSchema.js +2 -4
  140. package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
  141. package/dist/feature-libraries/typed-schema/flexList.d.ts +3 -3
  142. package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
  143. package/dist/feature-libraries/typed-schema/index.d.ts +2 -2
  144. package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
  145. package/dist/feature-libraries/typed-schema/index.js +2 -2
  146. package/dist/feature-libraries/typed-schema/index.js.map +1 -1
  147. package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  148. package/dist/feature-libraries/typed-schema/schemaCollection.js +8 -10
  149. package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  150. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
  151. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  152. package/dist/feature-libraries/typed-schema/typedTreeSchema.js +5 -37
  153. package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  154. package/dist/feature-libraries/typed-schema/view.d.ts +4 -6
  155. package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
  156. package/dist/feature-libraries/typed-schema/view.js +5 -4
  157. package/dist/feature-libraries/typed-schema/view.js.map +1 -1
  158. package/dist/index.d.ts +4 -4
  159. package/dist/index.d.ts.map +1 -1
  160. package/dist/index.js +33 -36
  161. package/dist/index.js.map +1 -1
  162. package/dist/legacy.d.ts +83 -0
  163. package/dist/packageVersion.d.ts +1 -1
  164. package/dist/packageVersion.d.ts.map +1 -1
  165. package/dist/packageVersion.js +1 -1
  166. package/dist/packageVersion.js.map +1 -1
  167. package/dist/public.d.ts +0 -1
  168. package/dist/shared-tree/checkoutFlexTreeView.d.ts +53 -0
  169. package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
  170. package/dist/shared-tree/{treeView.js → checkoutFlexTreeView.js} +28 -6
  171. package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -0
  172. package/dist/shared-tree/index.d.ts +3 -3
  173. package/dist/shared-tree/index.d.ts.map +1 -1
  174. package/dist/shared-tree/index.js +2 -2
  175. package/dist/shared-tree/index.js.map +1 -1
  176. package/dist/shared-tree/schematizeTree.d.ts +15 -4
  177. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  178. package/dist/shared-tree/schematizeTree.js +7 -8
  179. package/dist/shared-tree/schematizeTree.js.map +1 -1
  180. package/dist/shared-tree/schematizingTreeView.d.ts +9 -4
  181. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  182. package/dist/shared-tree/schematizingTreeView.js +25 -12
  183. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  184. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  185. package/dist/shared-tree/sharedTree.js +2 -2
  186. package/dist/shared-tree/sharedTree.js.map +1 -1
  187. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
  188. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  189. package/dist/shared-tree/sharedTreeChangeEnricher.js +6 -2
  190. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  191. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
  192. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  193. package/dist/shared-tree/sharedTreeChangeFamily.js +3 -2
  194. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  195. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
  196. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  197. package/dist/shared-tree/sharedTreeEditBuilder.js +2 -2
  198. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  199. package/dist/shared-tree/treeApi.d.ts +1 -3
  200. package/dist/shared-tree/treeApi.d.ts.map +1 -1
  201. package/dist/shared-tree/treeApi.js +6 -4
  202. package/dist/shared-tree/treeApi.js.map +1 -1
  203. package/dist/shared-tree/treeCheckout.d.ts +2 -13
  204. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  205. package/dist/shared-tree/treeCheckout.js +17 -1
  206. package/dist/shared-tree/treeCheckout.js.map +1 -1
  207. package/dist/shared-tree-core/branch.js +1 -1
  208. package/dist/shared-tree-core/branch.js.map +1 -1
  209. package/dist/simple-tree/api/create.d.ts.map +1 -1
  210. package/dist/simple-tree/api/create.js +1 -1
  211. package/dist/simple-tree/api/create.js.map +1 -1
  212. package/{lib/simple-tree → dist/simple-tree/api}/getJsonSchema.d.ts +1 -1
  213. package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -0
  214. package/dist/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
  215. package/dist/simple-tree/api/getJsonSchema.js.map +1 -0
  216. package/{lib/simple-tree → dist/simple-tree/api}/getSimpleSchema.d.ts +1 -1
  217. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
  218. package/dist/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
  219. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -0
  220. package/dist/simple-tree/api/index.d.ts +5 -0
  221. package/dist/simple-tree/api/index.d.ts.map +1 -1
  222. package/dist/simple-tree/api/index.js +7 -1
  223. package/dist/simple-tree/api/index.js.map +1 -1
  224. package/{lib/simple-tree → dist/simple-tree/api}/jsonSchema.d.ts +1 -1
  225. package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -0
  226. package/dist/simple-tree/api/jsonSchema.js.map +1 -0
  227. package/dist/simple-tree/api/schemaFactory.d.ts +45 -14
  228. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  229. package/dist/simple-tree/api/schemaFactory.js +43 -12
  230. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  231. package/dist/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
  232. package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -0
  233. package/dist/simple-tree/api/simpleSchema.js.map +1 -0
  234. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
  235. package/dist/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
  236. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
  237. package/dist/simple-tree/api/tree.d.ts +1 -21
  238. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  239. package/dist/simple-tree/api/tree.js +3 -38
  240. package/dist/simple-tree/api/tree.js.map +1 -1
  241. package/dist/simple-tree/api/treeApiBeta.d.ts +79 -0
  242. package/dist/simple-tree/api/treeApiBeta.d.ts.map +1 -0
  243. package/dist/simple-tree/api/treeApiBeta.js +26 -0
  244. package/dist/simple-tree/api/treeApiBeta.js.map +1 -0
  245. package/dist/simple-tree/api/treeNodeApi.d.ts +1 -1
  246. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  247. package/dist/simple-tree/api/treeNodeApi.js +21 -19
  248. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  249. package/dist/simple-tree/api/verboseTree.js +2 -2
  250. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  251. package/dist/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
  252. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
  253. package/dist/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
  254. package/{lib/simple-tree → dist/simple-tree/api}/viewSchemaToSimpleSchema.js.map +1 -1
  255. package/dist/simple-tree/arrayNode.d.ts +2 -2
  256. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  257. package/dist/simple-tree/arrayNode.js +30 -21
  258. package/dist/simple-tree/arrayNode.js.map +1 -1
  259. package/dist/simple-tree/core/index.d.ts +3 -3
  260. package/dist/simple-tree/core/index.d.ts.map +1 -1
  261. package/dist/simple-tree/core/index.js +4 -1
  262. package/dist/simple-tree/core/index.js.map +1 -1
  263. package/dist/simple-tree/core/schemaCaching.d.ts +5 -0
  264. package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -1
  265. package/dist/simple-tree/core/schemaCaching.js +10 -1
  266. package/dist/simple-tree/core/schemaCaching.js.map +1 -1
  267. package/dist/simple-tree/core/treeNodeKernel.d.ts +61 -3
  268. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  269. package/dist/simple-tree/core/treeNodeKernel.js +166 -13
  270. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  271. package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -1
  272. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  273. package/dist/simple-tree/core/types.d.ts +17 -20
  274. package/dist/simple-tree/core/types.d.ts.map +1 -1
  275. package/dist/simple-tree/core/types.js.map +1 -1
  276. package/dist/simple-tree/core/withType.d.ts +3 -2
  277. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  278. package/dist/simple-tree/core/withType.js.map +1 -1
  279. package/dist/simple-tree/index.d.ts +7 -9
  280. package/dist/simple-tree/index.d.ts.map +1 -1
  281. package/dist/simple-tree/index.js +15 -6
  282. package/dist/simple-tree/index.js.map +1 -1
  283. package/dist/simple-tree/leafNodeSchema.d.ts +7 -9
  284. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  285. package/dist/simple-tree/leafNodeSchema.js +13 -11
  286. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  287. package/dist/simple-tree/mapNode.d.ts +1 -1
  288. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  289. package/dist/simple-tree/mapNode.js +38 -29
  290. package/dist/simple-tree/mapNode.js.map +1 -1
  291. package/dist/simple-tree/objectNode.d.ts +9 -7
  292. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  293. package/dist/simple-tree/objectNode.js +37 -31
  294. package/dist/simple-tree/objectNode.js.map +1 -1
  295. package/dist/simple-tree/proxies.d.ts +1 -14
  296. package/dist/simple-tree/proxies.d.ts.map +1 -1
  297. package/dist/simple-tree/proxies.js +12 -15
  298. package/dist/simple-tree/proxies.js.map +1 -1
  299. package/dist/simple-tree/proxyBinding.d.ts +2 -62
  300. package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
  301. package/dist/simple-tree/proxyBinding.js +8 -181
  302. package/dist/simple-tree/proxyBinding.js.map +1 -1
  303. package/dist/simple-tree/schemaTypes.d.ts +7 -7
  304. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  305. package/dist/simple-tree/schemaTypes.js +4 -4
  306. package/dist/simple-tree/schemaTypes.js.map +1 -1
  307. package/dist/simple-tree/toFlexSchema.d.ts +11 -1
  308. package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
  309. package/dist/simple-tree/toFlexSchema.js +54 -31
  310. package/dist/simple-tree/toFlexSchema.js.map +1 -1
  311. package/dist/simple-tree/toMapTree.d.ts +25 -37
  312. package/dist/simple-tree/toMapTree.d.ts.map +1 -1
  313. package/dist/simple-tree/toMapTree.js +53 -16
  314. package/dist/simple-tree/toMapTree.js.map +1 -1
  315. package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
  316. package/dist/simple-tree/treeNodeValid.js +7 -10
  317. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  318. package/dist/simple-tree/typesUnsafe.d.ts +13 -13
  319. package/dist/simple-tree/typesUnsafe.js.map +1 -1
  320. package/dist/simple-tree/walkSchema.d.ts +26 -0
  321. package/dist/simple-tree/walkSchema.d.ts.map +1 -0
  322. package/dist/simple-tree/walkSchema.js +49 -0
  323. package/dist/simple-tree/walkSchema.js.map +1 -0
  324. package/dist/treeFactory.d.ts +2 -1
  325. package/dist/treeFactory.d.ts.map +1 -1
  326. package/dist/treeFactory.js +2 -1
  327. package/dist/treeFactory.js.map +1 -1
  328. package/dist/util/typeUtils.d.ts +2 -2
  329. package/dist/util/typeUtils.js.map +1 -1
  330. package/legacy.d.ts +11 -0
  331. package/lib/alpha.d.ts +102 -0
  332. package/lib/beta.d.ts +6 -2
  333. package/lib/core/index.d.ts +1 -1
  334. package/lib/core/index.d.ts.map +1 -1
  335. package/lib/core/index.js +1 -1
  336. package/lib/core/index.js.map +1 -1
  337. package/lib/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
  338. package/lib/core/revertible.d.ts.map +1 -0
  339. package/lib/core/revertible.js.map +1 -0
  340. package/lib/core/schema-stored/format.d.ts +3 -3
  341. package/lib/core/schema-stored/format.js +1 -1
  342. package/lib/core/schema-stored/format.js.map +1 -1
  343. package/lib/core/schema-stored/schema.d.ts +2 -7
  344. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  345. package/lib/core/schema-stored/schema.js +4 -6
  346. package/lib/core/schema-stored/schema.js.map +1 -1
  347. package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  348. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  349. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  350. package/lib/core/tree/anchorSet.js +6 -2
  351. package/lib/core/tree/anchorSet.js.map +1 -1
  352. package/lib/core/tree/detachedFieldIndex.d.ts +0 -1
  353. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  354. package/lib/core/tree/detachedFieldIndex.js +1 -0
  355. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  356. package/lib/core/tree/visitDelta.d.ts +7 -2
  357. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  358. package/lib/core/tree/visitDelta.js.map +1 -1
  359. package/lib/events/emitter.d.ts +127 -0
  360. package/lib/events/emitter.d.ts.map +1 -0
  361. package/lib/events/{events.js → emitter.js} +48 -29
  362. package/lib/events/emitter.js.map +1 -0
  363. package/lib/events/index.d.ts +2 -1
  364. package/lib/events/index.d.ts.map +1 -1
  365. package/lib/events/index.js +1 -1
  366. package/lib/events/index.js.map +1 -1
  367. package/lib/events/interop.d.ts +36 -0
  368. package/lib/events/interop.d.ts.map +1 -0
  369. package/{src/core/revertible/index.ts → lib/events/interop.js} +2 -2
  370. package/lib/events/interop.js.map +1 -0
  371. package/lib/events/listeners.d.ts +65 -0
  372. package/lib/events/listeners.d.ts.map +1 -0
  373. package/lib/{core/revertible/index.js → events/listeners.js} +2 -2
  374. package/lib/events/listeners.js.map +1 -0
  375. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
  376. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  377. package/lib/feature-libraries/chunked-forest/chunkTree.js +37 -16
  378. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  379. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
  380. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  381. package/lib/feature-libraries/chunked-forest/chunkedForest.js +12 -5
  382. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  383. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
  384. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  385. package/lib/feature-libraries/chunked-forest/uniformChunk.js +28 -2
  386. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  387. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
  388. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  389. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
  390. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  391. package/lib/feature-libraries/flex-map-tree/index.d.ts +1 -1
  392. package/lib/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
  393. package/lib/feature-libraries/flex-map-tree/index.js +1 -1
  394. package/lib/feature-libraries/flex-map-tree/index.js.map +1 -1
  395. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -33
  396. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  397. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +83 -104
  398. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  399. package/lib/feature-libraries/flex-tree/context.d.ts +30 -14
  400. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  401. package/lib/feature-libraries/flex-tree/context.js +10 -7
  402. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  403. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -190
  404. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  405. package/lib/feature-libraries/flex-tree/flexTreeTypes.js +15 -2
  406. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  407. package/lib/feature-libraries/flex-tree/index.d.ts +2 -3
  408. package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
  409. package/lib/feature-libraries/flex-tree/index.js +1 -1
  410. package/lib/feature-libraries/flex-tree/index.js.map +1 -1
  411. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
  412. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  413. package/lib/feature-libraries/flex-tree/lazyEntity.js +2 -10
  414. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  415. package/lib/feature-libraries/flex-tree/lazyField.d.ts +26 -28
  416. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  417. package/lib/feature-libraries/flex-tree/lazyField.js +11 -13
  418. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  419. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +5 -26
  420. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  421. package/lib/feature-libraries/flex-tree/lazyNode.js +23 -72
  422. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  423. package/lib/feature-libraries/flex-tree/unboxed.d.ts +4 -16
  424. package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  425. package/lib/feature-libraries/flex-tree/unboxed.js +5 -37
  426. package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
  427. package/lib/feature-libraries/flex-tree/utilities.d.ts +2 -2
  428. package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  429. package/lib/feature-libraries/flex-tree/utilities.js +3 -6
  430. package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
  431. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  432. package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -1
  433. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  434. package/lib/feature-libraries/index.d.ts +3 -5
  435. package/lib/feature-libraries/index.d.ts.map +1 -1
  436. package/lib/feature-libraries/index.js +5 -5
  437. package/lib/feature-libraries/index.js.map +1 -1
  438. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  439. package/lib/feature-libraries/modular-schema/comparison.js +3 -6
  440. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  441. package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  442. package/lib/feature-libraries/modular-schema/discrepancies.js +3 -13
  443. package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  444. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
  445. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  446. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
  447. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  448. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
  449. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  450. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
  451. package/lib/feature-libraries/schema-index/format.d.ts +3 -3
  452. package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  453. package/lib/feature-libraries/storedToViewSchema.js +3 -5
  454. package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
  455. package/lib/feature-libraries/typed-schema/flexList.d.ts +3 -3
  456. package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
  457. package/lib/feature-libraries/typed-schema/index.d.ts +2 -2
  458. package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
  459. package/lib/feature-libraries/typed-schema/index.js +2 -2
  460. package/lib/feature-libraries/typed-schema/index.js.map +1 -1
  461. package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  462. package/lib/feature-libraries/typed-schema/schemaCollection.js +9 -11
  463. package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  464. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
  465. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  466. package/lib/feature-libraries/typed-schema/typedTreeSchema.js +5 -36
  467. package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  468. package/lib/feature-libraries/typed-schema/view.d.ts +4 -6
  469. package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
  470. package/lib/feature-libraries/typed-schema/view.js +5 -4
  471. package/lib/feature-libraries/typed-schema/view.js.map +1 -1
  472. package/lib/index.d.ts +4 -4
  473. package/lib/index.d.ts.map +1 -1
  474. package/lib/index.js +3 -5
  475. package/lib/index.js.map +1 -1
  476. package/lib/legacy.d.ts +83 -0
  477. package/lib/packageVersion.d.ts +1 -1
  478. package/lib/packageVersion.d.ts.map +1 -1
  479. package/lib/packageVersion.js +1 -1
  480. package/lib/packageVersion.js.map +1 -1
  481. package/lib/public.d.ts +0 -1
  482. package/lib/shared-tree/checkoutFlexTreeView.d.ts +53 -0
  483. package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
  484. package/lib/shared-tree/{treeView.js → checkoutFlexTreeView.js} +26 -5
  485. package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -0
  486. package/lib/shared-tree/index.d.ts +3 -3
  487. package/lib/shared-tree/index.d.ts.map +1 -1
  488. package/lib/shared-tree/index.js +1 -1
  489. package/lib/shared-tree/index.js.map +1 -1
  490. package/lib/shared-tree/schematizeTree.d.ts +15 -4
  491. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  492. package/lib/shared-tree/schematizeTree.js +8 -9
  493. package/lib/shared-tree/schematizeTree.js.map +1 -1
  494. package/lib/shared-tree/schematizingTreeView.d.ts +9 -4
  495. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  496. package/lib/shared-tree/schematizingTreeView.js +26 -13
  497. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  498. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  499. package/lib/shared-tree/sharedTree.js +2 -2
  500. package/lib/shared-tree/sharedTree.js.map +1 -1
  501. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
  502. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  503. package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -2
  504. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  505. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
  506. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  507. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -2
  508. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  509. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
  510. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  511. package/lib/shared-tree/sharedTreeEditBuilder.js +2 -2
  512. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  513. package/lib/shared-tree/treeApi.d.ts +1 -3
  514. package/lib/shared-tree/treeApi.d.ts.map +1 -1
  515. package/lib/shared-tree/treeApi.js +7 -5
  516. package/lib/shared-tree/treeApi.js.map +1 -1
  517. package/lib/shared-tree/treeCheckout.d.ts +2 -13
  518. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  519. package/lib/shared-tree/treeCheckout.js +18 -2
  520. package/lib/shared-tree/treeCheckout.js.map +1 -1
  521. package/lib/shared-tree-core/branch.js +1 -1
  522. package/lib/shared-tree-core/branch.js.map +1 -1
  523. package/lib/simple-tree/api/create.d.ts.map +1 -1
  524. package/lib/simple-tree/api/create.js +2 -2
  525. package/lib/simple-tree/api/create.js.map +1 -1
  526. package/{dist/simple-tree → lib/simple-tree/api}/getJsonSchema.d.ts +1 -1
  527. package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -0
  528. package/lib/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
  529. package/lib/simple-tree/api/getJsonSchema.js.map +1 -0
  530. package/{dist/simple-tree → lib/simple-tree/api}/getSimpleSchema.d.ts +1 -1
  531. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
  532. package/lib/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
  533. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -0
  534. package/lib/simple-tree/api/index.d.ts +5 -0
  535. package/lib/simple-tree/api/index.d.ts.map +1 -1
  536. package/lib/simple-tree/api/index.js +3 -0
  537. package/lib/simple-tree/api/index.js.map +1 -1
  538. package/{dist/simple-tree → lib/simple-tree/api}/jsonSchema.d.ts +1 -1
  539. package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -0
  540. package/lib/simple-tree/api/jsonSchema.js.map +1 -0
  541. package/lib/simple-tree/api/schemaFactory.d.ts +45 -14
  542. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  543. package/lib/simple-tree/api/schemaFactory.js +43 -12
  544. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  545. package/lib/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
  546. package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -0
  547. package/lib/simple-tree/api/simpleSchema.js.map +1 -0
  548. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
  549. package/lib/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
  550. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
  551. package/lib/simple-tree/api/tree.d.ts +1 -21
  552. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  553. package/lib/simple-tree/api/tree.js +2 -34
  554. package/lib/simple-tree/api/tree.js.map +1 -1
  555. package/lib/simple-tree/api/treeApiBeta.d.ts +79 -0
  556. package/lib/simple-tree/api/treeApiBeta.d.ts.map +1 -0
  557. package/lib/simple-tree/api/treeApiBeta.js +23 -0
  558. package/lib/simple-tree/api/treeApiBeta.js.map +1 -0
  559. package/lib/simple-tree/api/treeNodeApi.d.ts +1 -1
  560. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  561. package/lib/simple-tree/api/treeNodeApi.js +23 -21
  562. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  563. package/lib/simple-tree/api/verboseTree.js +1 -1
  564. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  565. package/lib/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
  566. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
  567. package/lib/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
  568. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -0
  569. package/lib/simple-tree/arrayNode.d.ts +2 -2
  570. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  571. package/lib/simple-tree/arrayNode.js +33 -24
  572. package/lib/simple-tree/arrayNode.js.map +1 -1
  573. package/lib/simple-tree/core/index.d.ts +3 -3
  574. package/lib/simple-tree/core/index.d.ts.map +1 -1
  575. package/lib/simple-tree/core/index.js +2 -2
  576. package/lib/simple-tree/core/index.js.map +1 -1
  577. package/lib/simple-tree/core/schemaCaching.d.ts +5 -0
  578. package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -1
  579. package/lib/simple-tree/core/schemaCaching.js +8 -0
  580. package/lib/simple-tree/core/schemaCaching.js.map +1 -1
  581. package/lib/simple-tree/core/treeNodeKernel.d.ts +61 -3
  582. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  583. package/lib/simple-tree/core/treeNodeKernel.js +156 -5
  584. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  585. package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -1
  586. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  587. package/lib/simple-tree/core/types.d.ts +17 -20
  588. package/lib/simple-tree/core/types.d.ts.map +1 -1
  589. package/lib/simple-tree/core/types.js.map +1 -1
  590. package/lib/simple-tree/core/withType.d.ts +3 -2
  591. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  592. package/lib/simple-tree/core/withType.js.map +1 -1
  593. package/lib/simple-tree/index.d.ts +7 -9
  594. package/lib/simple-tree/index.d.ts.map +1 -1
  595. package/lib/simple-tree/index.js +5 -5
  596. package/lib/simple-tree/index.js.map +1 -1
  597. package/lib/simple-tree/leafNodeSchema.d.ts +7 -9
  598. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  599. package/lib/simple-tree/leafNodeSchema.js +14 -12
  600. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  601. package/lib/simple-tree/mapNode.d.ts +1 -1
  602. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  603. package/lib/simple-tree/mapNode.js +38 -29
  604. package/lib/simple-tree/mapNode.js.map +1 -1
  605. package/lib/simple-tree/objectNode.d.ts +9 -7
  606. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  607. package/lib/simple-tree/objectNode.js +40 -34
  608. package/lib/simple-tree/objectNode.js.map +1 -1
  609. package/lib/simple-tree/proxies.d.ts +1 -14
  610. package/lib/simple-tree/proxies.d.ts.map +1 -1
  611. package/lib/simple-tree/proxies.js +11 -14
  612. package/lib/simple-tree/proxies.js.map +1 -1
  613. package/lib/simple-tree/proxyBinding.d.ts +2 -62
  614. package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
  615. package/lib/simple-tree/proxyBinding.js +6 -174
  616. package/lib/simple-tree/proxyBinding.js.map +1 -1
  617. package/lib/simple-tree/schemaTypes.d.ts +7 -7
  618. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  619. package/lib/simple-tree/schemaTypes.js +4 -4
  620. package/lib/simple-tree/schemaTypes.js.map +1 -1
  621. package/lib/simple-tree/toFlexSchema.d.ts +11 -1
  622. package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
  623. package/lib/simple-tree/toFlexSchema.js +29 -8
  624. package/lib/simple-tree/toFlexSchema.js.map +1 -1
  625. package/lib/simple-tree/toMapTree.d.ts +25 -37
  626. package/lib/simple-tree/toMapTree.d.ts.map +1 -1
  627. package/lib/simple-tree/toMapTree.js +54 -17
  628. package/lib/simple-tree/toMapTree.js.map +1 -1
  629. package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
  630. package/lib/simple-tree/treeNodeValid.js +8 -11
  631. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  632. package/lib/simple-tree/typesUnsafe.d.ts +13 -13
  633. package/lib/simple-tree/typesUnsafe.js.map +1 -1
  634. package/lib/simple-tree/walkSchema.d.ts +26 -0
  635. package/lib/simple-tree/walkSchema.d.ts.map +1 -0
  636. package/lib/simple-tree/walkSchema.js +43 -0
  637. package/lib/simple-tree/walkSchema.js.map +1 -0
  638. package/lib/treeFactory.d.ts +2 -1
  639. package/lib/treeFactory.d.ts.map +1 -1
  640. package/lib/treeFactory.js +2 -1
  641. package/lib/treeFactory.js.map +1 -1
  642. package/lib/tsdoc-metadata.json +1 -1
  643. package/lib/util/typeUtils.d.ts +2 -2
  644. package/lib/util/typeUtils.js.map +1 -1
  645. package/package.json +57 -25
  646. package/src/core/index.ts +1 -1
  647. package/src/core/{revertible/revertible.ts → revertible.ts} +15 -0
  648. package/src/core/schema-stored/format.ts +1 -1
  649. package/src/core/schema-stored/schema.ts +6 -13
  650. package/src/core/tree/anchorSet.ts +18 -3
  651. package/src/core/tree/detachedFieldIndex.ts +6 -5
  652. package/src/core/tree/visitDelta.ts +7 -2
  653. package/src/events/{events.ts → emitter.ts} +52 -139
  654. package/src/events/index.ts +7 -7
  655. package/src/events/interop.ts +49 -0
  656. package/src/events/listeners.ts +68 -0
  657. package/src/feature-libraries/chunked-forest/chunkTree.ts +63 -18
  658. package/src/feature-libraries/chunked-forest/chunkedForest.ts +18 -4
  659. package/src/feature-libraries/chunked-forest/uniformChunk.ts +33 -0
  660. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -3
  661. package/src/feature-libraries/flex-map-tree/index.ts +1 -0
  662. package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +135 -210
  663. package/src/feature-libraries/flex-tree/README.md +4 -75
  664. package/src/feature-libraries/flex-tree/context.ts +37 -16
  665. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +69 -291
  666. package/src/feature-libraries/flex-tree/index.ts +7 -13
  667. package/src/feature-libraries/flex-tree/lazyEntity.ts +2 -11
  668. package/src/feature-libraries/flex-tree/lazyField.ts +49 -73
  669. package/src/feature-libraries/flex-tree/lazyNode.ts +25 -154
  670. package/src/feature-libraries/flex-tree/unboxed.ts +9 -68
  671. package/src/feature-libraries/flex-tree/utilities.ts +4 -8
  672. package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -1
  673. package/src/feature-libraries/index.ts +2 -27
  674. package/src/feature-libraries/modular-schema/comparison.ts +4 -6
  675. package/src/feature-libraries/modular-schema/discrepancies.ts +7 -16
  676. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -1
  677. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -4
  678. package/src/feature-libraries/storedToViewSchema.ts +5 -6
  679. package/src/feature-libraries/typed-schema/flexList.ts +3 -3
  680. package/src/feature-libraries/typed-schema/index.ts +1 -3
  681. package/src/feature-libraries/typed-schema/schemaCollection.ts +15 -17
  682. package/src/feature-libraries/typed-schema/typedTreeSchema.ts +35 -127
  683. package/src/feature-libraries/typed-schema/view.ts +4 -13
  684. package/src/index.ts +4 -8
  685. package/src/packageVersion.ts +1 -1
  686. package/src/shared-tree/checkoutFlexTreeView.ts +89 -0
  687. package/src/shared-tree/index.ts +2 -7
  688. package/src/shared-tree/schematizeTree.ts +23 -12
  689. package/src/shared-tree/schematizingTreeView.ts +34 -24
  690. package/src/shared-tree/sharedTree.ts +6 -1
  691. package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -1
  692. package/src/shared-tree/sharedTreeChangeFamily.ts +7 -1
  693. package/src/shared-tree/sharedTreeEditBuilder.ts +9 -4
  694. package/src/shared-tree/treeApi.ts +10 -10
  695. package/src/shared-tree/treeCheckout.ts +26 -15
  696. package/src/shared-tree-core/branch.ts +1 -1
  697. package/src/simple-tree/ProxyBinding.md +23 -23
  698. package/src/simple-tree/api/create.ts +8 -3
  699. package/src/simple-tree/{getJsonSchema.ts → api/getJsonSchema.ts} +3 -3
  700. package/src/simple-tree/{getSimpleSchema.ts → api/getSimpleSchema.ts} +3 -3
  701. package/src/simple-tree/api/index.ts +20 -0
  702. package/src/simple-tree/{jsonSchema.ts → api/jsonSchema.ts} +1 -1
  703. package/src/simple-tree/api/schemaFactory.ts +44 -13
  704. package/src/simple-tree/{simpleSchema.ts → api/simpleSchema.ts} +4 -4
  705. package/src/simple-tree/{simpleSchemaToJsonSchema.ts → api/simpleSchemaToJsonSchema.ts} +4 -4
  706. package/src/simple-tree/api/tree.ts +2 -71
  707. package/src/simple-tree/api/treeApiBeta.ts +101 -0
  708. package/src/simple-tree/api/treeNodeApi.ts +32 -23
  709. package/src/simple-tree/api/verboseTree.ts +1 -1
  710. package/src/simple-tree/{viewSchemaToSimpleSchema.ts → api/viewSchemaToSimpleSchema.ts} +5 -5
  711. package/src/simple-tree/arrayNode.ts +37 -31
  712. package/src/simple-tree/core/index.ts +4 -1
  713. package/src/simple-tree/core/schemaCaching.ts +10 -0
  714. package/src/simple-tree/core/treeNodeKernel.ts +198 -5
  715. package/src/simple-tree/core/treeNodeSchema.ts +1 -1
  716. package/src/simple-tree/core/types.ts +16 -27
  717. package/src/simple-tree/core/withType.ts +3 -1
  718. package/src/simple-tree/index.ts +29 -21
  719. package/src/simple-tree/leafNodeSchema.ts +24 -28
  720. package/src/simple-tree/mapNode.ts +47 -29
  721. package/src/simple-tree/objectNode.ts +51 -46
  722. package/src/simple-tree/proxies.ts +22 -51
  723. package/src/simple-tree/proxyBinding.ts +3 -254
  724. package/src/simple-tree/schemaTypes.ts +8 -8
  725. package/src/simple-tree/toFlexSchema.ts +40 -7
  726. package/src/simple-tree/toMapTree.ts +113 -79
  727. package/src/simple-tree/treeNodeValid.ts +10 -13
  728. package/src/simple-tree/typesUnsafe.ts +13 -13
  729. package/src/simple-tree/walkSchema.ts +81 -0
  730. package/src/treeFactory.ts +2 -1
  731. package/src/util/typeUtils.ts +2 -2
  732. package/dist/core/revertible/index.d.ts.map +0 -1
  733. package/dist/core/revertible/index.js +0 -10
  734. package/dist/core/revertible/index.js.map +0 -1
  735. package/dist/core/revertible/revertible.d.ts.map +0 -1
  736. package/dist/core/revertible/revertible.js.map +0 -1
  737. package/dist/domains/index.d.ts +0 -8
  738. package/dist/domains/index.d.ts.map +0 -1
  739. package/dist/domains/index.js +0 -20
  740. package/dist/domains/index.js.map +0 -1
  741. package/dist/domains/json/index.d.ts +0 -7
  742. package/dist/domains/json/index.d.ts.map +0 -1
  743. package/dist/domains/json/index.js +0 -17
  744. package/dist/domains/json/index.js.map +0 -1
  745. package/dist/domains/json/jsonCursor.d.ts +0 -52
  746. package/dist/domains/json/jsonCursor.d.ts.map +0 -1
  747. package/dist/domains/json/jsonCursor.js +0 -197
  748. package/dist/domains/json/jsonCursor.js.map +0 -1
  749. package/dist/domains/json/jsonDomainSchema.d.ts +0 -24
  750. package/dist/domains/json/jsonDomainSchema.d.ts.map +0 -1
  751. package/dist/domains/json/jsonDomainSchema.js +0 -32
  752. package/dist/domains/json/jsonDomainSchema.js.map +0 -1
  753. package/dist/domains/leafDomain.d.ts +0 -72
  754. package/dist/domains/leafDomain.d.ts.map +0 -1
  755. package/dist/domains/leafDomain.js +0 -88
  756. package/dist/domains/leafDomain.js.map +0 -1
  757. package/dist/domains/schemaBuilder.d.ts +0 -103
  758. package/dist/domains/schemaBuilder.d.ts.map +0 -1
  759. package/dist/domains/schemaBuilder.js +0 -121
  760. package/dist/domains/schemaBuilder.js.map +0 -1
  761. package/dist/domains/testRecursiveDomain.d.ts +0 -17
  762. package/dist/domains/testRecursiveDomain.d.ts.map +0 -1
  763. package/dist/domains/testRecursiveDomain.js +0 -35
  764. package/dist/domains/testRecursiveDomain.js.map +0 -1
  765. package/dist/events/events.d.ts +0 -207
  766. package/dist/events/events.d.ts.map +0 -1
  767. package/dist/events/events.js.map +0 -1
  768. package/dist/feature-libraries/schemaBuilder.d.ts +0 -31
  769. package/dist/feature-libraries/schemaBuilder.d.ts.map +0 -1
  770. package/dist/feature-libraries/schemaBuilder.js +0 -40
  771. package/dist/feature-libraries/schemaBuilder.js.map +0 -1
  772. package/dist/feature-libraries/schemaBuilderBase.d.ts +0 -191
  773. package/dist/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
  774. package/dist/feature-libraries/schemaBuilderBase.js +0 -201
  775. package/dist/feature-libraries/schemaBuilderBase.js.map +0 -1
  776. package/dist/shared-tree/treeView.d.ts +0 -73
  777. package/dist/shared-tree/treeView.d.ts.map +0 -1
  778. package/dist/shared-tree/treeView.js.map +0 -1
  779. package/dist/simple-tree/getJsonSchema.d.ts.map +0 -1
  780. package/dist/simple-tree/getJsonSchema.js.map +0 -1
  781. package/dist/simple-tree/getSimpleSchema.d.ts.map +0 -1
  782. package/dist/simple-tree/getSimpleSchema.js.map +0 -1
  783. package/dist/simple-tree/jsonSchema.d.ts.map +0 -1
  784. package/dist/simple-tree/jsonSchema.js.map +0 -1
  785. package/dist/simple-tree/simpleSchema.d.ts.map +0 -1
  786. package/dist/simple-tree/simpleSchema.js.map +0 -1
  787. package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
  788. package/dist/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
  789. package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
  790. package/dist/simple-tree/viewSchemaToSimpleSchema.js.map +0 -1
  791. package/lib/core/revertible/index.d.ts.map +0 -1
  792. package/lib/core/revertible/index.js.map +0 -1
  793. package/lib/core/revertible/revertible.d.ts.map +0 -1
  794. package/lib/core/revertible/revertible.js.map +0 -1
  795. package/lib/domains/index.d.ts +0 -8
  796. package/lib/domains/index.d.ts.map +0 -1
  797. package/lib/domains/index.js +0 -8
  798. package/lib/domains/index.js.map +0 -1
  799. package/lib/domains/json/index.d.ts +0 -7
  800. package/lib/domains/json/index.d.ts.map +0 -1
  801. package/lib/domains/json/index.js +0 -7
  802. package/lib/domains/json/index.js.map +0 -1
  803. package/lib/domains/json/jsonCursor.d.ts +0 -52
  804. package/lib/domains/json/jsonCursor.d.ts.map +0 -1
  805. package/lib/domains/json/jsonCursor.js +0 -192
  806. package/lib/domains/json/jsonCursor.js.map +0 -1
  807. package/lib/domains/json/jsonDomainSchema.d.ts +0 -24
  808. package/lib/domains/json/jsonDomainSchema.d.ts.map +0 -1
  809. package/lib/domains/json/jsonDomainSchema.js +0 -29
  810. package/lib/domains/json/jsonDomainSchema.js.map +0 -1
  811. package/lib/domains/leafDomain.d.ts +0 -72
  812. package/lib/domains/leafDomain.d.ts.map +0 -1
  813. package/lib/domains/leafDomain.js +0 -85
  814. package/lib/domains/leafDomain.js.map +0 -1
  815. package/lib/domains/schemaBuilder.d.ts +0 -103
  816. package/lib/domains/schemaBuilder.d.ts.map +0 -1
  817. package/lib/domains/schemaBuilder.js +0 -117
  818. package/lib/domains/schemaBuilder.js.map +0 -1
  819. package/lib/domains/testRecursiveDomain.d.ts +0 -17
  820. package/lib/domains/testRecursiveDomain.d.ts.map +0 -1
  821. package/lib/domains/testRecursiveDomain.js +0 -32
  822. package/lib/domains/testRecursiveDomain.js.map +0 -1
  823. package/lib/events/events.d.ts +0 -207
  824. package/lib/events/events.d.ts.map +0 -1
  825. package/lib/events/events.js.map +0 -1
  826. package/lib/feature-libraries/schemaBuilder.d.ts +0 -31
  827. package/lib/feature-libraries/schemaBuilder.d.ts.map +0 -1
  828. package/lib/feature-libraries/schemaBuilder.js +0 -36
  829. package/lib/feature-libraries/schemaBuilder.js.map +0 -1
  830. package/lib/feature-libraries/schemaBuilderBase.d.ts +0 -191
  831. package/lib/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
  832. package/lib/feature-libraries/schemaBuilderBase.js +0 -195
  833. package/lib/feature-libraries/schemaBuilderBase.js.map +0 -1
  834. package/lib/shared-tree/treeView.d.ts +0 -73
  835. package/lib/shared-tree/treeView.d.ts.map +0 -1
  836. package/lib/shared-tree/treeView.js.map +0 -1
  837. package/lib/simple-tree/getJsonSchema.d.ts.map +0 -1
  838. package/lib/simple-tree/getJsonSchema.js.map +0 -1
  839. package/lib/simple-tree/getSimpleSchema.d.ts.map +0 -1
  840. package/lib/simple-tree/getSimpleSchema.js.map +0 -1
  841. package/lib/simple-tree/jsonSchema.d.ts.map +0 -1
  842. package/lib/simple-tree/jsonSchema.js.map +0 -1
  843. package/lib/simple-tree/simpleSchema.d.ts.map +0 -1
  844. package/lib/simple-tree/simpleSchema.js.map +0 -1
  845. package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
  846. package/lib/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
  847. package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
  848. package/src/domains/README.md +0 -6
  849. package/src/domains/fence.json +0 -5
  850. package/src/domains/index.ts +0 -19
  851. package/src/domains/json/fence.json +0 -5
  852. package/src/domains/json/index.ts +0 -13
  853. package/src/domains/json/jsonCursor.ts +0 -247
  854. package/src/domains/json/jsonDomainSchema.ts +0 -47
  855. package/src/domains/leafDomain.ts +0 -97
  856. package/src/domains/schemaBuilder.ts +0 -153
  857. package/src/domains/testRecursiveDomain.ts +0 -38
  858. package/src/events/fence.json +0 -5
  859. package/src/feature-libraries/schemaBuilder.ts +0 -45
  860. package/src/feature-libraries/schemaBuilderBase.ts +0 -393
  861. package/src/shared-tree/treeView.ts +0 -113
  862. /package/dist/core/{revertible/revertible.js → revertible.js} +0 -0
  863. /package/dist/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
  864. /package/dist/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
  865. /package/dist/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
  866. /package/lib/core/{revertible/revertible.js → revertible.js} +0 -0
  867. /package/lib/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
  868. /package/lib/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
  869. /package/lib/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"branch.js","sourceRoot":"","sources":["../../src/shared-tree-core/branch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM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,CAAC,CAAC,CACF,CAAC;IACF,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\nimport { type TelemetryEventBatcher, measure } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype BranchRebaseResult,\n\ttype ChangeFamily,\n\ttype ChangeFamilyEditor,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype GraphCommit,\n\ttype RevisionTag,\n\ttype TaggedChange,\n\tfindAncestor,\n\tmakeAnonChange,\n\tmintCommit,\n\trebaseBranch,\n\ttagChange,\n\ttagRollbackInverse,\n\ttype RebaseStatsWithDuration,\n} from \"../core/index.js\";\nimport { EventEmitter, type Listenable } from \"../events/index.js\";\n\nimport { TransactionStack } from \"./transactionStack.js\";\nimport { fail } from \"../util/index.js\";\n\n/**\n * Describes a change to a `SharedTreeBranch`. Various operations can mutate the head of the branch;\n * this change format describes each in terms of the \"removed commits\" (all commits which were present\n * on the branch before the operation but are no longer present after) and the \"new commits\" (all\n * commits which are present on the branch after the operation that were not present before). Each of\n * the following event types also provides a `change` which contains the net change to the branch\n * (or is undefined if there was no net change):\n * * Append - when one or more commits are appended to the head of the branch, for example via\n * a change applied by the branch's editor, or as a result of merging another branch into this one\n * * Remove - when one or more commits are removed from the head of the branch. This occurs\n * when a transaction is aborted and all commits pending in that transaction are removed.\n * * Replace - when an operation simultaneously removes and appends commits. For example, when this\n * branch is rebased and some commits are removed and replaced with rebased versions, or when a\n * transaction completes and all pending commits are replaced with a single squash commit.\n */\nexport type SharedTreeBranchChange<TChange> =\n\t| {\n\t\t\ttype: \"append\";\n\t\t\tchange: TaggedChange<TChange>;\n\t\t\tnewCommits: readonly GraphCommit<TChange>[];\n\t }\n\t| {\n\t\t\ttype: \"remove\";\n\t\t\tchange: TaggedChange<TChange> | undefined;\n\t\t\tremovedCommits: readonly GraphCommit<TChange>[];\n\t }\n\t| {\n\t\t\ttype: \"replace\";\n\t\t\tchange: TaggedChange<TChange> | undefined;\n\t\t\tremovedCommits: readonly GraphCommit<TChange>[];\n\t\t\tnewCommits: readonly GraphCommit<TChange>[];\n\t };\n\n/**\n * Returns the operation that caused the given {@link SharedTreeBranchChange}.\n */\nexport function getChangeReplaceType(\n\tchange: SharedTreeBranchChange<unknown> & { type: \"replace\" },\n): \"transactionCommit\" | \"rebase\" {\n\t// The \"replace\" variant of the change event is emitted by two operations: committing a transaction and doing a rebase.\n\t// Committing a transaction will always remove one or more commits (the commits that were squashed),\n\t// and will add exactly one new commit (the squash commit).\n\tif (change.removedCommits.length === 0 || change.newCommits.length !== 1) {\n\t\treturn \"rebase\";\n\t}\n\n\t// There is only one case in which a rebase both removes commits and adds exactly one new commit.\n\t// This occurs when there is exactly one divergent, but equivalent, commit on each branch:\n\t//\n\t// A ─ B (branch X)\t -- rebase Y onto X --> A ─ B (branch X)\n\t// └─ B' (branch Y) └─ (branch Y)\n\t//\n\t// B' is removed and replaced by B because both have the same revision.\n\tassert(\n\t\tchange.removedCommits[0] !== undefined,\n\t\t0x9e4 /* This wont run due to the length check above */,\n\t);\n\tassert(\n\t\tchange.newCommits[0] !== undefined,\n\t\t0x9e5 /* This wont run because a replace operation always has new commits */,\n\t);\n\tif (\n\t\tchange.removedCommits.length === 1 &&\n\t\tchange.removedCommits[0].revision === change.newCommits[0].revision\n\t) {\n\t\treturn \"rebase\";\n\t}\n\n\treturn \"transactionCommit\";\n}\n\n/**\n * The events emitted by a `SharedTreeBranch`\n */\nexport interface SharedTreeBranchEvents<TEditor extends ChangeFamilyEditor, TChange>\n\textends BranchTrimmingEvents {\n\t/**\n\t * Fired just before the head of this branch changes.\n\t * @param change - the change to this branch's state and commits\n\t */\n\tbeforeChange(change: SharedTreeBranchChange<TChange>): void;\n\n\t/**\n\t * Fired just after the head of this branch changes.\n\t * @param change - the change to this branch's state and commits\n\t */\n\tafterChange(change: SharedTreeBranchChange<TChange>): void;\n\n\t/**\n\t * {@inheritdoc TreeViewEvents.commitApplied}\n\t */\n\tcommitApplied(data: CommitMetadata): void;\n\n\t/**\n\t * Fired when this branch forks\n\t * @param fork - the new branch that forked off of this branch\n\t */\n\tfork(fork: SharedTreeBranch<TEditor, TChange>): void;\n\n\t/**\n\t * Fired after this branch is disposed\n\t */\n\tdispose(): void;\n\n\t/**\n\t * Fired after a new transaction is started.\n\t * @param isOuterTransaction - true iff the transaction being started is the outermost transaction\n\t * as opposed to a nested transaction.\n\t */\n\ttransactionStarted(isOuterTransaction: boolean): void;\n\n\t/**\n\t * Fired after the current transaction is aborted.\n\t * @param isOuterTransaction - true iff the transaction being aborted is the outermost transaction\n\t * as opposed to a nested transaction.\n\t */\n\ttransactionAborted(isOuterTransaction: boolean): void;\n\n\t/**\n\t * Fired after the current transaction is completely rolled back.\n\t * @param isOuterTransaction - true iff the transaction being aborted is the outermost transaction\n\t * as opposed to a nested transaction.\n\t */\n\ttransactionRolledBack(isOuterTransaction: boolean): void;\n\n\t/**\n\t * Fired after the current transaction is committed.\n\t * @param isOuterTransaction - true iff the transaction being committed is the outermost transaction\n\t * as opposed to a nested transaction.\n\t */\n\ttransactionCommitted(isOuterTransaction: boolean): void;\n}\n\n/**\n * Events related to branch trimming.\n *\n * @remarks\n * Trimming is a very specific kind of mutation which is the only allowed mutations to branches.\n * References to commits from other commits are removed so that the commit objects can be GC'd by the JS engine.\n * This happens by changing a commit's parent property to undefined, which drops all commits that are in its \"ancestry\".\n * It is done as a performance optimization when it is determined that commits are no longer needed for future computation.\n */\nexport interface BranchTrimmingEvents {\n\t/**\n\t * Fired when some contiguous range of commits beginning with the \"global tail\" of this branch are trimmed from the branch.\n\t * This happens by deleting the parent pointer to the last commit in that range. This event can be fired at any time.\n\t */\n\tancestryTrimmed(trimmedRevisions: RevisionTag[]): void;\n}\n\n/**\n * A branch of changes that can be applied to a SharedTree.\n */\nexport class SharedTreeBranch<\n\tTEditor extends ChangeFamilyEditor,\n\tTChange,\n> extends EventEmitter<SharedTreeBranchEvents<TEditor, TChange>> {\n\tpublic readonly editor: TEditor;\n\tprivate readonly transactions = new TransactionStack();\n\t/**\n\t * After pushing a starting revision to the transaction stack, this branch might be rebased\n\t * over commits which are children of that starting revision. When the transaction is committed,\n\t * those rebased-over commits should not be included in the transaction's squash commit, even though\n\t * they exist between the starting revision and the final commit within the transaction.\n\t *\n\t * Whenever `rebaseOnto` is called during a transaction, this map is augmented with an entry from the\n\t * original merge-base to the new merge-base.\n\t *\n\t * This state need only be retained for the lifetime of the transaction.\n\t *\n\t * TODO: This strategy might need to be revisited when adding better support for async transactions.\n\t * Since:\n\t *\n\t * 1. Transactionality is guaranteed primarily by squashing at commit time\n\t * 2. Branches may be rebased with an ongoing transaction\n\t *\n\t * a rebase operation might invalidate only a portion of a transaction's commits, thus defeating the\n\t * purpose of transactionality.\n\t *\n\t * AB#6483 and children items track this work.\n\t */\n\tprivate readonly initialTransactionRevToRebasedRev = new Map<RevisionTag, RevisionTag>();\n\tprivate disposed = false;\n\tprivate readonly unsubscribeBranchTrimmer?: () => void;\n\t/**\n\t * Construct a new branch.\n\t * @param head - the head of the branch\n\t * @param changeFamily - determines the set of changes that this branch can commit\n\t * @param branchTrimmer - an optional event emitter that informs the branch it has been trimmed. If this is not supplied, then the branch must\n\t * never be trimmed. See {@link BranchTrimmingEvents} for details on trimming.\n\t */\n\tpublic constructor(\n\t\tprivate head: GraphCommit<TChange>,\n\t\tpublic readonly changeFamily: ChangeFamily<TEditor, TChange>,\n\t\tprivate readonly mintRevisionTag: () => RevisionTag,\n\t\tprivate readonly branchTrimmer?: Listenable<BranchTrimmingEvents>,\n\t\tprivate readonly telemetryEventBatcher?: TelemetryEventBatcher<\n\t\t\tkeyof RebaseStatsWithDuration\n\t\t>,\n\t) {\n\t\tsuper();\n\t\tthis.editor = this.changeFamily.buildEditor((change) =>\n\t\t\tthis.apply(change, mintRevisionTag()),\n\t\t);\n\t\tthis.unsubscribeBranchTrimmer = branchTrimmer?.on(\"ancestryTrimmed\", (commit) => {\n\t\t\tthis.emit(\"ancestryTrimmed\", commit);\n\t\t});\n\t}\n\n\t/**\n\t * Sets the head of this branch. Emits no change events.\n\t */\n\tpublic setHead(head: GraphCommit<TChange>): void {\n\t\tthis.assertNotDisposed();\n\t\tassert(!this.isTransacting(), 0x685 /* Cannot set head during a transaction */);\n\t\tthis.head = head;\n\t}\n\n\t/**\n\t * Apply a change to this branch.\n\t * @param change - the change to apply\n\t * @param revision - the revision of the new head commit of the branch that contains `change`\n\t * @param changeKind - the kind of change to apply\n\t * @returns the change that was applied and the new head commit of the branch\n\t */\n\tpublic apply(\n\t\tchange: TChange,\n\t\trevision: RevisionTag,\n\t\tchangeKind: CommitKind = CommitKind.Default,\n\t): [change: TChange, newCommit: GraphCommit<TChange>] {\n\t\tthis.assertNotDisposed();\n\n\t\t// TODO: This should not be necessary when receiving changes from other clients.\n\t\tconst changeWithRevision = this.changeFamily.rebaser.changeRevision(change, revision);\n\n\t\tconst newHead = mintCommit(this.head, {\n\t\t\trevision,\n\t\t\tchange: changeWithRevision,\n\t\t});\n\n\t\tconst changeEvent = {\n\t\t\ttype: \"append\",\n\t\t\tchange: tagChange(changeWithRevision, revision),\n\t\t\tnewCommits: [newHead],\n\t\t} as const;\n\n\t\tthis.emit(\"beforeChange\", changeEvent);\n\t\tthis.head = newHead;\n\n\t\t// If this is not part of a transaction, emit a commitApplied event\n\t\tif (!this.isTransacting()) {\n\t\t\tthis.emit(\"commitApplied\", { isLocal: true, kind: changeKind });\n\t\t}\n\n\t\tthis.emit(\"afterChange\", changeEvent);\n\t\treturn [changeWithRevision, newHead];\n\t}\n\n\t/**\n\t * @returns the commit at the head of this branch.\n\t */\n\tpublic getHead(): GraphCommit<TChange> {\n\t\treturn this.head;\n\t}\n\n\t/**\n\t * Begin a transaction on this branch. If the transaction is committed via {@link commitTransaction},\n\t * all commits made since this call will be squashed into a single head commit.\n\t */\n\tpublic startTransaction(): void {\n\t\tthis.assertNotDisposed();\n\t\tconst forks = new Set<SharedTreeBranch<TEditor, TChange>>();\n\t\tconst onDisposeUnSubscribes: (() => void)[] = [];\n\t\tconst onForkUnSubscribe = onForkTransitive(this, (fork) => {\n\t\t\tforks.add(fork);\n\t\t\tonDisposeUnSubscribes.push(fork.on(\"dispose\", () => forks.delete(fork)));\n\t\t});\n\t\tthis.transactions.push(this.head.revision, () => {\n\t\t\tforks.forEach((fork) => fork.dispose());\n\t\t\tonDisposeUnSubscribes.forEach((unsubscribe) => unsubscribe());\n\t\t\tonForkUnSubscribe();\n\t\t});\n\t\tthis.editor.enterTransaction();\n\t\tthis.emit(\"transactionStarted\", this.transactions.size === 1);\n\t}\n\n\t/**\n\t * Commit the current transaction. There must be a transaction in progress that was begun via {@link startTransaction}.\n\t * If there are commits in the current transaction, they will be squashed into a new single head commit.\n\t * @returns the commits that were squashed and the new squash commit if a squash occurred, otherwise `undefined`.\n\t * @remarks If the transaction had no changes applied during its lifetime, then no squash occurs (i.e. this method is a no-op).\n\t * Even if the transaction contained only one change, it will still be replaced with an (equivalent) squash change.\n\t */\n\tpublic commitTransaction():\n\t\t| [squashedCommits: GraphCommit<TChange>[], newCommit: GraphCommit<TChange>]\n\t\t| undefined {\n\t\tthis.assertNotDisposed();\n\t\tconst [startCommit, commits] = this.popTransaction();\n\t\tthis.editor.exitTransaction();\n\n\t\tthis.emit(\"transactionCommitted\", this.transactions.size === 0);\n\t\tif (commits.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Squash the changes and make the squash commit the new head of this branch\n\t\tconst squashedChange = this.changeFamily.rebaser.compose(commits);\n\t\tconst revision = this.mintRevisionTag();\n\n\t\tconst newHead = mintCommit(startCommit, {\n\t\t\trevision,\n\t\t\tchange: this.changeFamily.rebaser.changeRevision(squashedChange, revision),\n\t\t});\n\n\t\tconst changeEvent = {\n\t\t\ttype: \"replace\",\n\t\t\tchange: undefined,\n\t\t\tremovedCommits: commits,\n\t\t\tnewCommits: [newHead],\n\t\t} as const;\n\n\t\tthis.emit(\"beforeChange\", changeEvent);\n\t\tthis.head = newHead;\n\n\t\t// If this transaction is not nested, emit a commitApplied event\n\t\tif (!this.isTransacting()) {\n\t\t\tthis.emit(\"commitApplied\", { isLocal: true, kind: CommitKind.Default });\n\t\t}\n\n\t\tthis.emit(\"afterChange\", changeEvent);\n\t\treturn [commits, newHead];\n\t}\n\n\t/**\n\t * Cancel the current transaction. There must be a transaction in progress that was begun via\n\t * {@link startTransaction}. All commits made during the transaction will be removed.\n\t * @returns the change to this branch resulting in the removal of the commits, and a list of the\n\t * commits that were removed.\n\t */\n\tpublic abortTransaction(): [\n\t\tchange: TChange | undefined,\n\t\tabortedCommits: GraphCommit<TChange>[],\n\t] {\n\t\tthis.assertNotDisposed();\n\t\tconst [startCommit, commits] = this.popTransaction();\n\t\tthis.editor.exitTransaction();\n\n\t\tthis.emit(\"transactionAborted\", this.transactions.size === 0);\n\t\tif (commits.length === 0) {\n\t\t\tthis.emit(\"transactionRolledBack\", this.transactions.size === 0);\n\t\t\treturn [undefined, []];\n\t\t}\n\n\t\tconst inverses: TaggedChange<TChange>[] = [];\n\t\tfor (let i = commits.length - 1; i >= 0; i--) {\n\t\t\tconst revision = this.mintRevisionTag();\n\t\t\tconst commit =\n\t\t\t\tcommits[i] ?? fail(\"This wont run because we are iterating through commits\");\n\t\t\tconst inverse = this.changeFamily.rebaser.changeRevision(\n\t\t\t\tthis.changeFamily.rebaser.invert(commit, false),\n\t\t\t\trevision,\n\t\t\t\tcommit.revision,\n\t\t\t);\n\n\t\t\tinverses.push(tagRollbackInverse(inverse, revision, commit.revision));\n\t\t}\n\t\tconst change =\n\t\t\tinverses.length > 0 ? this.changeFamily.rebaser.compose(inverses) : undefined;\n\n\t\tconst changeEvent = {\n\t\t\ttype: \"remove\",\n\t\t\tchange: change === undefined ? undefined : makeAnonChange(change),\n\t\t\tremovedCommits: commits,\n\t\t} as const;\n\n\t\tthis.emit(\"beforeChange\", changeEvent);\n\t\tthis.head = startCommit;\n\t\tthis.emit(\"afterChange\", changeEvent);\n\t\tthis.emit(\"transactionRolledBack\", this.transactions.size === 0);\n\t\treturn [change, commits];\n\t}\n\n\t/**\n\t * True iff this branch is in the middle of a transaction that was begin via {@link startTransaction}\n\t */\n\tpublic isTransacting(): boolean {\n\t\treturn this.transactions.size !== 0;\n\t}\n\n\tprivate popTransaction(): [GraphCommit<TChange>, GraphCommit<TChange>[]] {\n\t\tconst { startRevision: startRevisionOriginal } = this.transactions.pop();\n\t\tlet startRevision = startRevisionOriginal;\n\t\twhile (this.initialTransactionRevToRebasedRev.has(startRevision)) {\n\t\t\tstartRevision = this.initialTransactionRevToRebasedRev.get(startRevision) ?? oob();\n\t\t}\n\n\t\tif (!this.isTransacting()) {\n\t\t\tthis.initialTransactionRevToRebasedRev.clear();\n\t\t}\n\n\t\tconst commits: GraphCommit<TChange>[] = [];\n\t\tconst startCommit = findAncestor(\n\t\t\t[this.head, commits],\n\t\t\t(c) => c.revision === startRevision,\n\t\t);\n\t\tassert(\n\t\t\tstartCommit !== undefined,\n\t\t\t0x593 /* Expected branch to be ahead of transaction start revision */,\n\t\t);\n\t\treturn [startCommit, commits];\n\t}\n\n\t/**\n\t * Spawn a new branch that is based off of the current state of this branch.\n\t * Changes made to the new branch will not be applied to this branch until the new branch is merged back in.\n\t *\n\t * @remarks Forks created during a transaction will be disposed when the transaction ends.\n\t */\n\tpublic fork(): SharedTreeBranch<TEditor, TChange> {\n\t\tthis.assertNotDisposed();\n\t\tconst fork = new SharedTreeBranch(\n\t\t\tthis.head,\n\t\t\tthis.changeFamily,\n\t\t\tthis.mintRevisionTag,\n\t\t\tthis.branchTrimmer,\n\t\t);\n\t\tthis.emit(\"fork\", fork);\n\t\treturn fork;\n\t}\n\n\t/**\n\t * Rebase the changes that have been applied to this branch over divergent changes in the given branch.\n\t * After this operation completes, this branch will be based off of `branch`.\n\t *\n\t * @param branch - the branch to rebase onto\n\t * @param upTo - the furthest commit on `branch` over which to rebase (inclusive). Defaults to the head commit of `branch`.\n\t * @returns the result of the rebase or undefined if nothing changed\n\t */\n\tpublic rebaseOnto(\n\t\tbranch: SharedTreeBranch<TEditor, TChange>,\n\t\tupTo = branch.getHead(),\n\t): BranchRebaseResult<TChange> | undefined {\n\t\tthis.assertNotDisposed();\n\n\t\t// Rebase this branch onto the given branch\n\t\tconst rebaseResult = this.rebaseBranch(this, branch, upTo);\n\t\tif (rebaseResult === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// The net change to this branch is provided by the `rebaseBranch` API\n\t\tconst { newSourceHead, commits } = rebaseResult;\n\t\tconst { deletedSourceCommits, targetCommits, sourceCommits } = commits;\n\n\t\tconst newCommits = targetCommits.concat(sourceCommits);\n\t\tif (this.isTransacting()) {\n\t\t\tconst firstCommit = targetCommits[0] ?? oob();\n\t\t\tconst lastCommit = targetCommits[targetCommits.length - 1] ?? oob();\n\t\t\tconst src = firstCommit.parent?.revision;\n\t\t\tconst dst = lastCommit.revision;\n\t\t\tif (src !== undefined && dst !== undefined) {\n\t\t\t\tthis.initialTransactionRevToRebasedRev.set(src, dst);\n\t\t\t}\n\t\t}\n\t\tconst changeEvent = {\n\t\t\ttype: \"replace\",\n\t\t\tget change() {\n\t\t\t\tconst change = rebaseResult.sourceChange;\n\t\t\t\treturn change === undefined ? undefined : makeAnonChange(change);\n\t\t\t},\n\t\t\tremovedCommits: deletedSourceCommits,\n\t\t\tnewCommits,\n\t\t} as const;\n\t\tthis.emit(\"beforeChange\", changeEvent);\n\t\tthis.head = newSourceHead;\n\n\t\tthis.emit(\"afterChange\", changeEvent);\n\t\treturn rebaseResult;\n\t}\n\n\t/**\n\t * Apply all the divergent changes on the given branch to this branch.\n\t *\n\t * @param branch - the branch to merge into this branch\n\t * @returns the net change to this branch and the commits that were added to this branch by the merge,\n\t * or undefined if nothing changed\n\t */\n\tpublic merge(\n\t\tbranch: SharedTreeBranch<TEditor, TChange>,\n\t): [change: TChange, newCommits: GraphCommit<TChange>[]] | undefined {\n\t\tthis.assertNotDisposed();\n\t\tbranch.assertNotDisposed();\n\t\tassert(\n\t\t\t!branch.isTransacting(),\n\t\t\t0x597 /* Branch may not be merged while transaction is in progress */,\n\t\t);\n\n\t\t// Rebase the given branch onto this branch\n\t\tconst rebaseResult = this.rebaseBranch(branch, this);\n\t\tif (rebaseResult === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Compute the net change to this branch\n\t\tconst sourceCommits = rebaseResult.commits.sourceCommits;\n\t\tconst change = this.changeFamily.rebaser.compose(sourceCommits);\n\t\tconst taggedChange = makeAnonChange(change);\n\t\tconst changeEvent = {\n\t\t\ttype: \"append\",\n\t\t\tget change(): TaggedChange<TChange> {\n\t\t\t\treturn taggedChange;\n\t\t\t},\n\t\t\tnewCommits: sourceCommits,\n\t\t} as const;\n\n\t\tthis.emit(\"beforeChange\", changeEvent);\n\t\tthis.head = rebaseResult.newSourceHead;\n\t\tthis.emit(\"afterChange\", changeEvent);\n\t\treturn [change, sourceCommits];\n\t}\n\n\t/** Rebase `branchHead` onto `onto`, but return undefined if nothing changed */\n\tprivate rebaseBranch(\n\t\tbranch: SharedTreeBranch<TEditor, TChange>,\n\t\tonto: SharedTreeBranch<TEditor, TChange>,\n\t\tupTo = onto.getHead(),\n\t): BranchRebaseResult<TChange> | undefined {\n\t\tconst { head } = branch;\n\t\tif (head === upTo) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst { duration, output } = measure(() =>\n\t\t\trebaseBranch(\n\t\t\t\tthis.mintRevisionTag,\n\t\t\t\tthis.changeFamily.rebaser,\n\t\t\t\thead,\n\t\t\t\tupTo,\n\t\t\t\tonto.getHead(),\n\t\t\t),\n\t\t);\n\n\t\tthis.telemetryEventBatcher?.accumulateAndLog({ duration, ...output.telemetryProperties });\n\n\t\tif (this.head === output.newSourceHead) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn output;\n\t}\n\n\t/**\n\t * Dispose this branch, freezing its state.\n\t *\n\t * @remarks\n\t * Attempts to further mutate the branch will error.\n\t * Any transactions in progress will be aborted.\n\t * Calling dispose more than once has no effect.\n\t */\n\tpublic dispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\twhile (this.isTransacting()) {\n\t\t\tthis.abortTransaction();\n\t\t}\n\n\t\tthis.unsubscribeBranchTrimmer?.();\n\n\t\tthis.disposed = true;\n\t\tthis.emit(\"dispose\");\n\t}\n\n\tprivate assertNotDisposed(): void {\n\t\tassert(!this.disposed, 0x66e /* Branch is disposed */);\n\t}\n}\n\n/**\n * Registers an event listener that fires when the given forkable object forks.\n * The listener will also fire when any of those forks fork, and when those forks of forks fork, and so on.\n * @param forkable - an object that emits an event when it is forked\n * @param onFork - the fork event listener\n * @returns a function which when called will deregister all registrations (including transitive) created by this function.\n * The deregister function has undefined behavior if called more than once.\n */\nexport function onForkTransitive<T extends Listenable<{ fork: (t: T) => void }>>(\n\tforkable: T,\n\tonFork: (fork: T) => void,\n): () => void {\n\tconst offs: (() => void)[] = [];\n\toffs.push(\n\t\tforkable.on(\"fork\", (fork) => {\n\t\t\toffs.push(onForkTransitive(fork, onFork));\n\t\t\tonFork(fork);\n\t\t}),\n\t);\n\treturn () => offs.forEach((off) => off());\n}\n"]}
1
+ {"version":3,"file":"branch.js","sourceRoot":"","sources":["../../src/shared-tree-core/branch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAA8B,OAAO,EAAE,MAAM,0CAA0C,CAAC;AAE/F,OAAO,EAIN,UAAU,EAKV,YAAY,EACZ,cAAc,EACd,UAAU,EACV,YAAY,EACZ,SAAS,EACT,kBAAkB,GAElB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAmB,MAAM,oBAA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AqB,EAAE,gBAAgB,CAAC,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAC;QAE1F,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,aAAa,EAAE,CAAC;YACxC,OAAO,SAAS,CAAC;QAClB,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IAED;;;;;;;OAOG;IACI,OAAO;QACb,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,OAAO;QACR,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;YAC7B,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACzB,CAAC;QAED,IAAI,CAAC,wBAAwB,EAAE,EAAE,CAAC;QAElC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtB,CAAC;IAEO,iBAAiB;QACxB,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACxD,CAAC;CACD;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC/B,QAAW,EACX,MAAyB;IAEzB,MAAM,IAAI,GAAmB,EAAE,CAAC;IAChC,IAAI,CAAC,IAAI,CACR,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QAC5B,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QAC1C,MAAM,CAAC,IAAI,CAAC,CAAC;IACd,CAAC,CAAC,CACF,CAAC;IACF,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\nimport { type TelemetryEventBatcher, measure } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype BranchRebaseResult,\n\ttype ChangeFamily,\n\ttype ChangeFamilyEditor,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype GraphCommit,\n\ttype RevisionTag,\n\ttype TaggedChange,\n\tfindAncestor,\n\tmakeAnonChange,\n\tmintCommit,\n\trebaseBranch,\n\ttagChange,\n\ttagRollbackInverse,\n\ttype RebaseStatsWithDuration,\n} from \"../core/index.js\";\nimport { EventEmitter, type Listenable } from \"../events/index.js\";\n\nimport { TransactionStack } from \"./transactionStack.js\";\nimport { fail } from \"../util/index.js\";\n\n/**\n * Describes a change to a `SharedTreeBranch`. Various operations can mutate the head of the branch;\n * this change format describes each in terms of the \"removed commits\" (all commits which were present\n * on the branch before the operation but are no longer present after) and the \"new commits\" (all\n * commits which are present on the branch after the operation that were not present before). Each of\n * the following event types also provides a `change` which contains the net change to the branch\n * (or is undefined if there was no net change):\n * * Append - when one or more commits are appended to the head of the branch, for example via\n * a change applied by the branch's editor, or as a result of merging another branch into this one\n * * Remove - when one or more commits are removed from the head of the branch. This occurs\n * when a transaction is aborted and all commits pending in that transaction are removed.\n * * Replace - when an operation simultaneously removes and appends commits. For example, when this\n * branch is rebased and some commits are removed and replaced with rebased versions, or when a\n * transaction completes and all pending commits are replaced with a single squash commit.\n */\nexport type SharedTreeBranchChange<TChange> =\n\t| {\n\t\t\ttype: \"append\";\n\t\t\tchange: TaggedChange<TChange>;\n\t\t\tnewCommits: readonly GraphCommit<TChange>[];\n\t }\n\t| {\n\t\t\ttype: \"remove\";\n\t\t\tchange: TaggedChange<TChange> | undefined;\n\t\t\tremovedCommits: readonly GraphCommit<TChange>[];\n\t }\n\t| {\n\t\t\ttype: \"replace\";\n\t\t\tchange: TaggedChange<TChange> | undefined;\n\t\t\tremovedCommits: readonly GraphCommit<TChange>[];\n\t\t\tnewCommits: readonly GraphCommit<TChange>[];\n\t };\n\n/**\n * Returns the operation that caused the given {@link SharedTreeBranchChange}.\n */\nexport function getChangeReplaceType(\n\tchange: SharedTreeBranchChange<unknown> & { type: \"replace\" },\n): \"transactionCommit\" | \"rebase\" {\n\t// The \"replace\" variant of the change event is emitted by two operations: committing a transaction and doing a rebase.\n\t// Committing a transaction will always remove one or more commits (the commits that were squashed),\n\t// and will add exactly one new commit (the squash commit).\n\tif (change.removedCommits.length === 0 || change.newCommits.length !== 1) {\n\t\treturn \"rebase\";\n\t}\n\n\t// There is only one case in which a rebase both removes commits and adds exactly one new commit.\n\t// This occurs when there is exactly one divergent, but equivalent, commit on each branch:\n\t//\n\t// A ─ B (branch X)\t -- rebase Y onto X --> A ─ B (branch X)\n\t// └─ B' (branch Y) └─ (branch Y)\n\t//\n\t// B' is removed and replaced by B because both have the same revision.\n\tassert(\n\t\tchange.removedCommits[0] !== undefined,\n\t\t0x9e4 /* This wont run due to the length check above */,\n\t);\n\tassert(\n\t\tchange.newCommits[0] !== undefined,\n\t\t0x9e5 /* This wont run because a replace operation always has new commits */,\n\t);\n\tif (\n\t\tchange.removedCommits.length === 1 &&\n\t\tchange.removedCommits[0].revision === change.newCommits[0].revision\n\t) {\n\t\treturn \"rebase\";\n\t}\n\n\treturn \"transactionCommit\";\n}\n\n/**\n * The events emitted by a `SharedTreeBranch`\n */\nexport interface SharedTreeBranchEvents<TEditor extends ChangeFamilyEditor, TChange>\n\textends BranchTrimmingEvents {\n\t/**\n\t * Fired just before the head of this branch changes.\n\t * @param change - the change to this branch's state and commits\n\t */\n\tbeforeChange(change: SharedTreeBranchChange<TChange>): void;\n\n\t/**\n\t * Fired just after the head of this branch changes.\n\t * @param change - the change to this branch's state and commits\n\t */\n\tafterChange(change: SharedTreeBranchChange<TChange>): void;\n\n\t/**\n\t * {@inheritdoc TreeViewEvents.commitApplied}\n\t */\n\tcommitApplied(data: CommitMetadata): void;\n\n\t/**\n\t * Fired when this branch forks\n\t * @param fork - the new branch that forked off of this branch\n\t */\n\tfork(fork: SharedTreeBranch<TEditor, TChange>): void;\n\n\t/**\n\t * Fired after this branch is disposed\n\t */\n\tdispose(): void;\n\n\t/**\n\t * Fired after a new transaction is started.\n\t * @param isOuterTransaction - true iff the transaction being started is the outermost transaction\n\t * as opposed to a nested transaction.\n\t */\n\ttransactionStarted(isOuterTransaction: boolean): void;\n\n\t/**\n\t * Fired after the current transaction is aborted.\n\t * @param isOuterTransaction - true iff the transaction being aborted is the outermost transaction\n\t * as opposed to a nested transaction.\n\t */\n\ttransactionAborted(isOuterTransaction: boolean): void;\n\n\t/**\n\t * Fired after the current transaction is completely rolled back.\n\t * @param isOuterTransaction - true iff the transaction being aborted is the outermost transaction\n\t * as opposed to a nested transaction.\n\t */\n\ttransactionRolledBack(isOuterTransaction: boolean): void;\n\n\t/**\n\t * Fired after the current transaction is committed.\n\t * @param isOuterTransaction - true iff the transaction being committed is the outermost transaction\n\t * as opposed to a nested transaction.\n\t */\n\ttransactionCommitted(isOuterTransaction: boolean): void;\n}\n\n/**\n * Events related to branch trimming.\n *\n * @remarks\n * Trimming is a very specific kind of mutation which is the only allowed mutations to branches.\n * References to commits from other commits are removed so that the commit objects can be GC'd by the JS engine.\n * This happens by changing a commit's parent property to undefined, which drops all commits that are in its \"ancestry\".\n * It is done as a performance optimization when it is determined that commits are no longer needed for future computation.\n */\nexport interface BranchTrimmingEvents {\n\t/**\n\t * Fired when some contiguous range of commits beginning with the \"global tail\" of this branch are trimmed from the branch.\n\t * This happens by deleting the parent pointer to the last commit in that range. This event can be fired at any time.\n\t */\n\tancestryTrimmed(trimmedRevisions: RevisionTag[]): void;\n}\n\n/**\n * A branch of changes that can be applied to a SharedTree.\n */\nexport class SharedTreeBranch<\n\tTEditor extends ChangeFamilyEditor,\n\tTChange,\n> extends EventEmitter<SharedTreeBranchEvents<TEditor, TChange>> {\n\tpublic readonly editor: TEditor;\n\tprivate readonly transactions = new TransactionStack();\n\t/**\n\t * After pushing a starting revision to the transaction stack, this branch might be rebased\n\t * over commits which are children of that starting revision. When the transaction is committed,\n\t * those rebased-over commits should not be included in the transaction's squash commit, even though\n\t * they exist between the starting revision and the final commit within the transaction.\n\t *\n\t * Whenever `rebaseOnto` is called during a transaction, this map is augmented with an entry from the\n\t * original merge-base to the new merge-base.\n\t *\n\t * This state need only be retained for the lifetime of the transaction.\n\t *\n\t * TODO: This strategy might need to be revisited when adding better support for async transactions.\n\t * Since:\n\t *\n\t * 1. Transactionality is guaranteed primarily by squashing at commit time\n\t * 2. Branches may be rebased with an ongoing transaction\n\t *\n\t * a rebase operation might invalidate only a portion of a transaction's commits, thus defeating the\n\t * purpose of transactionality.\n\t *\n\t * AB#6483 and children items track this work.\n\t */\n\tprivate readonly initialTransactionRevToRebasedRev = new Map<RevisionTag, RevisionTag>();\n\tprivate disposed = false;\n\tprivate readonly unsubscribeBranchTrimmer?: () => void;\n\t/**\n\t * Construct a new branch.\n\t * @param head - the head of the branch\n\t * @param changeFamily - determines the set of changes that this branch can commit\n\t * @param branchTrimmer - an optional event emitter that informs the branch it has been trimmed. If this is not supplied, then the branch must\n\t * never be trimmed. See {@link BranchTrimmingEvents} for details on trimming.\n\t */\n\tpublic constructor(\n\t\tprivate head: GraphCommit<TChange>,\n\t\tpublic readonly changeFamily: ChangeFamily<TEditor, TChange>,\n\t\tprivate readonly mintRevisionTag: () => RevisionTag,\n\t\tprivate readonly branchTrimmer?: Listenable<BranchTrimmingEvents>,\n\t\tprivate readonly telemetryEventBatcher?: TelemetryEventBatcher<\n\t\t\tkeyof RebaseStatsWithDuration\n\t\t>,\n\t) {\n\t\tsuper();\n\t\tthis.editor = this.changeFamily.buildEditor((change) =>\n\t\t\tthis.apply(change, mintRevisionTag()),\n\t\t);\n\t\tthis.unsubscribeBranchTrimmer = branchTrimmer?.on(\"ancestryTrimmed\", (commit) => {\n\t\t\tthis.emit(\"ancestryTrimmed\", commit);\n\t\t});\n\t}\n\n\t/**\n\t * Sets the head of this branch. Emits no change events.\n\t */\n\tpublic setHead(head: GraphCommit<TChange>): void {\n\t\tthis.assertNotDisposed();\n\t\tassert(!this.isTransacting(), 0x685 /* Cannot set head during a transaction */);\n\t\tthis.head = head;\n\t}\n\n\t/**\n\t * Apply a change to this branch.\n\t * @param change - the change to apply\n\t * @param revision - the revision of the new head commit of the branch that contains `change`\n\t * @param changeKind - the kind of change to apply\n\t * @returns the change that was applied and the new head commit of the branch\n\t */\n\tpublic apply(\n\t\tchange: TChange,\n\t\trevision: RevisionTag,\n\t\tchangeKind: CommitKind = CommitKind.Default,\n\t): [change: TChange, newCommit: GraphCommit<TChange>] {\n\t\tthis.assertNotDisposed();\n\n\t\t// TODO: This should not be necessary when receiving changes from other clients.\n\t\tconst changeWithRevision = this.changeFamily.rebaser.changeRevision(change, revision);\n\n\t\tconst newHead = mintCommit(this.head, {\n\t\t\trevision,\n\t\t\tchange: changeWithRevision,\n\t\t});\n\n\t\tconst changeEvent = {\n\t\t\ttype: \"append\",\n\t\t\tchange: tagChange(changeWithRevision, revision),\n\t\t\tnewCommits: [newHead],\n\t\t} as const;\n\n\t\tthis.emit(\"beforeChange\", changeEvent);\n\t\tthis.head = newHead;\n\n\t\t// If this is not part of a transaction, emit a commitApplied event\n\t\tif (!this.isTransacting()) {\n\t\t\tthis.emit(\"commitApplied\", { isLocal: true, kind: changeKind });\n\t\t}\n\n\t\tthis.emit(\"afterChange\", changeEvent);\n\t\treturn [changeWithRevision, newHead];\n\t}\n\n\t/**\n\t * @returns the commit at the head of this branch.\n\t */\n\tpublic getHead(): GraphCommit<TChange> {\n\t\treturn this.head;\n\t}\n\n\t/**\n\t * Begin a transaction on this branch. If the transaction is committed via {@link commitTransaction},\n\t * all commits made since this call will be squashed into a single head commit.\n\t */\n\tpublic startTransaction(): void {\n\t\tthis.assertNotDisposed();\n\t\tconst forks = new Set<SharedTreeBranch<TEditor, TChange>>();\n\t\tconst onDisposeUnSubscribes: (() => void)[] = [];\n\t\tconst onForkUnSubscribe = onForkTransitive(this, (fork) => {\n\t\t\tforks.add(fork);\n\t\t\tonDisposeUnSubscribes.push(fork.on(\"dispose\", () => forks.delete(fork)));\n\t\t});\n\t\tthis.transactions.push(this.head.revision, () => {\n\t\t\tforks.forEach((fork) => fork.dispose());\n\t\t\tonDisposeUnSubscribes.forEach((unsubscribe) => unsubscribe());\n\t\t\tonForkUnSubscribe();\n\t\t});\n\t\tthis.editor.enterTransaction();\n\t\tthis.emit(\"transactionStarted\", this.transactions.size === 1);\n\t}\n\n\t/**\n\t * Commit the current transaction. There must be a transaction in progress that was begun via {@link startTransaction}.\n\t * If there are commits in the current transaction, they will be squashed into a new single head commit.\n\t * @returns the commits that were squashed and the new squash commit if a squash occurred, otherwise `undefined`.\n\t * @remarks If the transaction had no changes applied during its lifetime, then no squash occurs (i.e. this method is a no-op).\n\t * Even if the transaction contained only one change, it will still be replaced with an (equivalent) squash change.\n\t */\n\tpublic commitTransaction():\n\t\t| [squashedCommits: GraphCommit<TChange>[], newCommit: GraphCommit<TChange>]\n\t\t| undefined {\n\t\tthis.assertNotDisposed();\n\t\tconst [startCommit, commits] = this.popTransaction();\n\t\tthis.editor.exitTransaction();\n\n\t\tthis.emit(\"transactionCommitted\", this.transactions.size === 0);\n\t\tif (commits.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Squash the changes and make the squash commit the new head of this branch\n\t\tconst squashedChange = this.changeFamily.rebaser.compose(commits);\n\t\tconst revision = this.mintRevisionTag();\n\n\t\tconst newHead = mintCommit(startCommit, {\n\t\t\trevision,\n\t\t\tchange: this.changeFamily.rebaser.changeRevision(squashedChange, revision),\n\t\t});\n\n\t\tconst changeEvent = {\n\t\t\ttype: \"replace\",\n\t\t\tchange: undefined,\n\t\t\tremovedCommits: commits,\n\t\t\tnewCommits: [newHead],\n\t\t} as const;\n\n\t\tthis.emit(\"beforeChange\", changeEvent);\n\t\tthis.head = newHead;\n\n\t\t// If this transaction is not nested, emit a commitApplied event\n\t\tif (!this.isTransacting()) {\n\t\t\tthis.emit(\"commitApplied\", { isLocal: true, kind: CommitKind.Default });\n\t\t}\n\n\t\tthis.emit(\"afterChange\", changeEvent);\n\t\treturn [commits, newHead];\n\t}\n\n\t/**\n\t * Cancel the current transaction. There must be a transaction in progress that was begun via\n\t * {@link startTransaction}. All commits made during the transaction will be removed.\n\t * @returns the change to this branch resulting in the removal of the commits, and a list of the\n\t * commits that were removed.\n\t */\n\tpublic abortTransaction(): [\n\t\tchange: TChange | undefined,\n\t\tabortedCommits: GraphCommit<TChange>[],\n\t] {\n\t\tthis.assertNotDisposed();\n\t\tconst [startCommit, commits] = this.popTransaction();\n\t\tthis.editor.exitTransaction();\n\n\t\tthis.emit(\"transactionAborted\", this.transactions.size === 0);\n\t\tif (commits.length === 0) {\n\t\t\tthis.emit(\"transactionRolledBack\", this.transactions.size === 0);\n\t\t\treturn [undefined, []];\n\t\t}\n\n\t\tconst inverses: TaggedChange<TChange>[] = [];\n\t\tfor (let i = commits.length - 1; i >= 0; i--) {\n\t\t\tconst revision = this.mintRevisionTag();\n\t\t\tconst commit =\n\t\t\t\tcommits[i] ?? fail(\"This wont run because we are iterating through commits\");\n\t\t\tconst inverse = this.changeFamily.rebaser.changeRevision(\n\t\t\t\tthis.changeFamily.rebaser.invert(commit, true),\n\t\t\t\trevision,\n\t\t\t\tcommit.revision,\n\t\t\t);\n\n\t\t\tinverses.push(tagRollbackInverse(inverse, revision, commit.revision));\n\t\t}\n\t\tconst change =\n\t\t\tinverses.length > 0 ? this.changeFamily.rebaser.compose(inverses) : undefined;\n\n\t\tconst changeEvent = {\n\t\t\ttype: \"remove\",\n\t\t\tchange: change === undefined ? undefined : makeAnonChange(change),\n\t\t\tremovedCommits: commits,\n\t\t} as const;\n\n\t\tthis.emit(\"beforeChange\", changeEvent);\n\t\tthis.head = startCommit;\n\t\tthis.emit(\"afterChange\", changeEvent);\n\t\tthis.emit(\"transactionRolledBack\", this.transactions.size === 0);\n\t\treturn [change, commits];\n\t}\n\n\t/**\n\t * True iff this branch is in the middle of a transaction that was begin via {@link startTransaction}\n\t */\n\tpublic isTransacting(): boolean {\n\t\treturn this.transactions.size !== 0;\n\t}\n\n\tprivate popTransaction(): [GraphCommit<TChange>, GraphCommit<TChange>[]] {\n\t\tconst { startRevision: startRevisionOriginal } = this.transactions.pop();\n\t\tlet startRevision = startRevisionOriginal;\n\t\twhile (this.initialTransactionRevToRebasedRev.has(startRevision)) {\n\t\t\tstartRevision = this.initialTransactionRevToRebasedRev.get(startRevision) ?? oob();\n\t\t}\n\n\t\tif (!this.isTransacting()) {\n\t\t\tthis.initialTransactionRevToRebasedRev.clear();\n\t\t}\n\n\t\tconst commits: GraphCommit<TChange>[] = [];\n\t\tconst startCommit = findAncestor(\n\t\t\t[this.head, commits],\n\t\t\t(c) => c.revision === startRevision,\n\t\t);\n\t\tassert(\n\t\t\tstartCommit !== undefined,\n\t\t\t0x593 /* Expected branch to be ahead of transaction start revision */,\n\t\t);\n\t\treturn [startCommit, commits];\n\t}\n\n\t/**\n\t * Spawn a new branch that is based off of the current state of this branch.\n\t * Changes made to the new branch will not be applied to this branch until the new branch is merged back in.\n\t *\n\t * @remarks Forks created during a transaction will be disposed when the transaction ends.\n\t */\n\tpublic fork(): SharedTreeBranch<TEditor, TChange> {\n\t\tthis.assertNotDisposed();\n\t\tconst fork = new SharedTreeBranch(\n\t\t\tthis.head,\n\t\t\tthis.changeFamily,\n\t\t\tthis.mintRevisionTag,\n\t\t\tthis.branchTrimmer,\n\t\t);\n\t\tthis.emit(\"fork\", fork);\n\t\treturn fork;\n\t}\n\n\t/**\n\t * Rebase the changes that have been applied to this branch over divergent changes in the given branch.\n\t * After this operation completes, this branch will be based off of `branch`.\n\t *\n\t * @param branch - the branch to rebase onto\n\t * @param upTo - the furthest commit on `branch` over which to rebase (inclusive). Defaults to the head commit of `branch`.\n\t * @returns the result of the rebase or undefined if nothing changed\n\t */\n\tpublic rebaseOnto(\n\t\tbranch: SharedTreeBranch<TEditor, TChange>,\n\t\tupTo = branch.getHead(),\n\t): BranchRebaseResult<TChange> | undefined {\n\t\tthis.assertNotDisposed();\n\n\t\t// Rebase this branch onto the given branch\n\t\tconst rebaseResult = this.rebaseBranch(this, branch, upTo);\n\t\tif (rebaseResult === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// The net change to this branch is provided by the `rebaseBranch` API\n\t\tconst { newSourceHead, commits } = rebaseResult;\n\t\tconst { deletedSourceCommits, targetCommits, sourceCommits } = commits;\n\n\t\tconst newCommits = targetCommits.concat(sourceCommits);\n\t\tif (this.isTransacting()) {\n\t\t\tconst firstCommit = targetCommits[0] ?? oob();\n\t\t\tconst lastCommit = targetCommits[targetCommits.length - 1] ?? oob();\n\t\t\tconst src = firstCommit.parent?.revision;\n\t\t\tconst dst = lastCommit.revision;\n\t\t\tif (src !== undefined && dst !== undefined) {\n\t\t\t\tthis.initialTransactionRevToRebasedRev.set(src, dst);\n\t\t\t}\n\t\t}\n\t\tconst changeEvent = {\n\t\t\ttype: \"replace\",\n\t\t\tget change() {\n\t\t\t\tconst change = rebaseResult.sourceChange;\n\t\t\t\treturn change === undefined ? undefined : makeAnonChange(change);\n\t\t\t},\n\t\t\tremovedCommits: deletedSourceCommits,\n\t\t\tnewCommits,\n\t\t} as const;\n\t\tthis.emit(\"beforeChange\", changeEvent);\n\t\tthis.head = newSourceHead;\n\n\t\tthis.emit(\"afterChange\", changeEvent);\n\t\treturn rebaseResult;\n\t}\n\n\t/**\n\t * Apply all the divergent changes on the given branch to this branch.\n\t *\n\t * @param branch - the branch to merge into this branch\n\t * @returns the net change to this branch and the commits that were added to this branch by the merge,\n\t * or undefined if nothing changed\n\t */\n\tpublic merge(\n\t\tbranch: SharedTreeBranch<TEditor, TChange>,\n\t): [change: TChange, newCommits: GraphCommit<TChange>[]] | undefined {\n\t\tthis.assertNotDisposed();\n\t\tbranch.assertNotDisposed();\n\t\tassert(\n\t\t\t!branch.isTransacting(),\n\t\t\t0x597 /* Branch may not be merged while transaction is in progress */,\n\t\t);\n\n\t\t// Rebase the given branch onto this branch\n\t\tconst rebaseResult = this.rebaseBranch(branch, this);\n\t\tif (rebaseResult === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Compute the net change to this branch\n\t\tconst sourceCommits = rebaseResult.commits.sourceCommits;\n\t\tconst change = this.changeFamily.rebaser.compose(sourceCommits);\n\t\tconst taggedChange = makeAnonChange(change);\n\t\tconst changeEvent = {\n\t\t\ttype: \"append\",\n\t\t\tget change(): TaggedChange<TChange> {\n\t\t\t\treturn taggedChange;\n\t\t\t},\n\t\t\tnewCommits: sourceCommits,\n\t\t} as const;\n\n\t\tthis.emit(\"beforeChange\", changeEvent);\n\t\tthis.head = rebaseResult.newSourceHead;\n\t\tthis.emit(\"afterChange\", changeEvent);\n\t\treturn [change, sourceCommits];\n\t}\n\n\t/** Rebase `branchHead` onto `onto`, but return undefined if nothing changed */\n\tprivate rebaseBranch(\n\t\tbranch: SharedTreeBranch<TEditor, TChange>,\n\t\tonto: SharedTreeBranch<TEditor, TChange>,\n\t\tupTo = onto.getHead(),\n\t): BranchRebaseResult<TChange> | undefined {\n\t\tconst { head } = branch;\n\t\tif (head === upTo) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst { duration, output } = measure(() =>\n\t\t\trebaseBranch(\n\t\t\t\tthis.mintRevisionTag,\n\t\t\t\tthis.changeFamily.rebaser,\n\t\t\t\thead,\n\t\t\t\tupTo,\n\t\t\t\tonto.getHead(),\n\t\t\t),\n\t\t);\n\n\t\tthis.telemetryEventBatcher?.accumulateAndLog({ duration, ...output.telemetryProperties });\n\n\t\tif (this.head === output.newSourceHead) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn output;\n\t}\n\n\t/**\n\t * Dispose this branch, freezing its state.\n\t *\n\t * @remarks\n\t * Attempts to further mutate the branch will error.\n\t * Any transactions in progress will be aborted.\n\t * Calling dispose more than once has no effect.\n\t */\n\tpublic dispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\twhile (this.isTransacting()) {\n\t\t\tthis.abortTransaction();\n\t\t}\n\n\t\tthis.unsubscribeBranchTrimmer?.();\n\n\t\tthis.disposed = true;\n\t\tthis.emit(\"dispose\");\n\t}\n\n\tprivate assertNotDisposed(): void {\n\t\tassert(!this.disposed, 0x66e /* Branch is disposed */);\n\t}\n}\n\n/**\n * Registers an event listener that fires when the given forkable object forks.\n * The listener will also fire when any of those forks fork, and when those forks of forks fork, and so on.\n * @param forkable - an object that emits an event when it is forked\n * @param onFork - the fork event listener\n * @returns a function which when called will deregister all registrations (including transitive) created by this function.\n * The deregister function has undefined behavior if called more than once.\n */\nexport function onForkTransitive<T extends Listenable<{ fork: (t: T) => void }>>(\n\tforkable: T,\n\tonFork: (fork: T) => void,\n): () => void {\n\tconst offs: (() => void)[] = [];\n\toffs.push(\n\t\tforkable.on(\"fork\", (fork) => {\n\t\t\toffs.push(onForkTransitive(fork, onFork));\n\t\t\tonFork(fork);\n\t\t}),\n\t);\n\treturn () => offs.forEach((off) => off());\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/create.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,KAAK,EAAE,sBAAsB,EAAmB,MAAM,qBAAqB,CAAC;AAEnF,OAAO,KAAK,EAEX,mBAAmB,EACnB,oCAAoC,EACpC,0BAA0B,EAC1B,WAAW,EACX,SAAS,EACT,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAMN,KAAK,cAAc,EACnB,MAAM,kCAAkC,CAAC;AAK1C,OAAO,EAGN,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,mBAAmB,E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G;AACH,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,mBAAmB,EACpE,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,eAAe,GAAG,SAAS,EACjC,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,GAC3C,UAAU,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC,CAAC;AAkBnD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,mBAAmB,EACnE,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,sBAAsB,GAAG,SAAS,GACxC,UAAU,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC,CAkCjD"}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { assert } from "@fluidframework/core-utils/internal";
6
6
  import { fail } from "../../util/index.js";
7
- import { cursorForMapTreeNode, defaultSchemaPolicy, FieldKinds, intoStoredSchema, mapTreeFromCursor, } from "../../feature-libraries/index.js";
7
+ import { cursorForMapTreeNode, defaultSchemaPolicy, FieldKinds, intoStoredSchema, mapTreeFromCursor, UnhydratedContext, } from "../../feature-libraries/index.js";
8
8
  import { getOrCreateNodeFromFlexTreeNode } from "../proxies.js";
9
9
  import { getOrCreateMapTreeNode, isFieldInSchema } from "../../feature-libraries/index.js";
10
10
  import { toFlexSchema } from "../toFlexSchema.js";
@@ -84,7 +84,7 @@ export function createFromCursor(schema, cursor) {
84
84
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
85
85
  const mapTree = mapTrees[0];
86
86
  const rootSchema = flexSchema.nodeSchema.get(mapTree.type) ?? fail("missing schema");
87
- const mapTreeNode = getOrCreateMapTreeNode(rootSchema, mapTree);
87
+ const mapTreeNode = getOrCreateMapTreeNode(new UnhydratedContext(flexSchema), rootSchema, mapTree);
88
88
  // TODO: ensure this works for InnerNodes to create unhydrated nodes
89
89
  const result = getOrCreateNodeFromFlexTreeNode(mapTreeNode);
90
90
  return result;
@@ -1 +1 @@
1
- {"version":3,"file":"create.js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AAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,SAA4D,CAAC;IACrE,CAAC;IACD,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACnE,8JAA8J;IAC9J,oEAAoE;IACpE,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAE,CAAC;IAC7B,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACrF,MAAM,WAAW,GAAG,sBAAsB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAEhE,oEAAoE;IACpE,MAAM,MAAM,GAAG,+BAA+B,CAAC,WAAW,CAAC,CAAC;IAC5D,OAAO,MAAyD,CAAC;AAClE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { ITreeCursorSynchronous, SchemaAndPolicy } from \"../../core/index.js\";\nimport { fail } from \"../../util/index.js\";\nimport type {\n\tTreeLeafValue,\n\tImplicitFieldSchema,\n\tInsertableTreeFieldFromImplicitField,\n\tTreeFieldFromImplicitField,\n\tFieldSchema,\n\tFieldKind,\n} from \"../schemaTypes.js\";\nimport type { Unhydrated } from \"../core/index.js\";\nimport {\n\tcursorForMapTreeNode,\n\tdefaultSchemaPolicy,\n\tFieldKinds,\n\tintoStoredSchema,\n\tmapTreeFromCursor,\n\ttype NodeKeyManager,\n} from \"../../feature-libraries/index.js\";\nimport { getOrCreateNodeFromFlexTreeNode, type InsertableContent } from \"../proxies.js\";\nimport { getOrCreateMapTreeNode, isFieldInSchema } from \"../../feature-libraries/index.js\";\nimport { toFlexSchema } from \"../toFlexSchema.js\";\nimport { inSchemaOrThrow, mapTreeFromNodeData } from \"../toMapTree.js\";\nimport {\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\ttype ParseOptions,\n\ttype VerboseTree,\n\ttype VerboseTreeNode,\n} from \"./verboseTree.js\";\n\n/**\n * Construct tree content that is compatible with the field defined by the provided `schema`.\n * @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 * @param data - The data used to construct the field content.\n * @remarks\n * When providing a {@link TreeNodeSchemaClass}, this is the same as invoking its constructor except that an unhydrated node can also be provided.\n * This function exists as a generalization that can be used in other cases as well,\n * 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 *\n * Like with {@link TreeNodeSchemaClass}'s constructor, its an error to provide an existing node to this API.\n * TODO: For that case, use we should provide `Tree.clone`.\n * @privateRemarks\n * This could be exposed as a public `Tree.create` function.\n */\nexport function createFromInsertable<TSchema extends ImplicitFieldSchema>(\n\tschema: TSchema,\n\tdata: InsertableTreeFieldFromImplicitField<TSchema>,\n\tcontext?: NodeKeyManager | undefined,\n): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\tconst cursor = cursorFromInsertable(schema, data, context);\n\tconst result = cursor === undefined ? undefined : createFromCursor(schema, cursor);\n\treturn result as Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n}\n\n/**\n * Construct tree content that is compatible with the field defined by the provided `schema`.\n * @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 * @param data - The data used to construct the field content.\n * @remarks\n * When providing a {@link TreeNodeSchemaClass},\n * this is the same as invoking its constructor except that an unhydrated node can also be provided and the returned value is a cursor.\n * When `undefined` is provided (for an optional field), `undefined` is returned.\n */\nexport function cursorFromInsertable<TSchema extends ImplicitFieldSchema>(\n\tschema: TSchema,\n\tdata: InsertableTreeFieldFromImplicitField<TSchema>,\n\tcontext?: NodeKeyManager | undefined,\n):\n\t| ITreeCursorSynchronous\n\t| (TSchema extends FieldSchema<FieldKind.Optional> ? undefined : never) {\n\tconst flexSchema = toFlexSchema(schema);\n\tconst schemaValidationPolicy: SchemaAndPolicy = {\n\t\tpolicy: defaultSchemaPolicy,\n\t\t// TODO: optimize: This isn't the most efficient operation since its not cached, and has to convert all the schema.\n\t\tschema: intoStoredSchema(flexSchema),\n\t};\n\n\tconst mapTree = mapTreeFromNodeData(\n\t\tdata as InsertableContent | undefined,\n\t\tschema,\n\t\tcontext,\n\t\tschemaValidationPolicy,\n\t);\n\tif (mapTree === undefined) {\n\t\tassert(\n\t\t\tflexSchema.rootFieldSchema.kind === FieldKinds.optional,\n\t\t\t0xa10 /* missing non-optional field */,\n\t\t);\n\t\treturn undefined as TSchema extends FieldSchema<FieldKind.Optional> ? undefined : never;\n\t}\n\treturn cursorForMapTreeNode(mapTree);\n}\n\n/**\n * Construct tree content compatible with a field defined by the provided `schema`.\n * @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 * @param data - The data used to construct the field content. See `Tree.cloneToJSONVerbose`.\n * @privateRemarks\n * This could be exposed as a public `Tree.createFromVerbose` function.\n */\nexport function createFromVerbose<TSchema extends ImplicitFieldSchema, THandle>(\n\tschema: TSchema,\n\tdata: VerboseTreeNode<THandle> | undefined,\n\toptions: ParseOptions<THandle>,\n): Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\n/**\n * Construct tree content compatible with a field defined by the provided `schema`.\n * @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 * @param data - The data used to construct the field content. See `Tree.cloneToJSONVerbose`.\n */\nexport function createFromVerbose<TSchema extends ImplicitFieldSchema>(\n\tschema: TSchema,\n\tdata: VerboseTreeNode | undefined,\n\toptions?: Partial<ParseOptions<IFluidHandle>>,\n): Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\nexport function createFromVerbose<TSchema extends ImplicitFieldSchema, THandle>(\n\tschema: TSchema,\n\tdata: VerboseTreeNode<THandle> | undefined,\n\toptions?: Partial<ParseOptions<THandle>>,\n): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\tconst config: ParseOptions<THandle> = {\n\t\tvalueConverter: (input: VerboseTree<THandle>) => {\n\t\t\treturn input as TreeLeafValue | VerboseTreeNode<THandle>;\n\t\t},\n\t\t...options,\n\t};\n\tconst schemalessConfig = applySchemaToParserOptions(schema, config);\n\tconst cursor = cursorFromVerbose(data, schemalessConfig);\n\treturn createFromCursor(schema, cursor);\n}\n\n/**\n * Creates an unhydrated simple-tree field from a cursor in nodes mode.\n */\nexport function createFromCursor<TSchema extends ImplicitFieldSchema>(\n\tschema: TSchema,\n\tcursor: ITreeCursorSynchronous | undefined,\n): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\tconst mapTrees = cursor === undefined ? [] : [mapTreeFromCursor(cursor)];\n\tconst flexSchema = toFlexSchema(schema);\n\n\tconst schemaValidationPolicy: SchemaAndPolicy = {\n\t\tpolicy: defaultSchemaPolicy,\n\t\t// TODO: optimize: This isn't the most efficient operation since its not cached, and has to convert all the schema.\n\t\tschema: intoStoredSchema(flexSchema),\n\t};\n\n\tconst maybeError = isFieldInSchema(\n\t\tmapTrees,\n\t\tflexSchema.rootFieldSchema.stored,\n\t\tschemaValidationPolicy,\n\t);\n\tinSchemaOrThrow(maybeError);\n\n\tif (mapTrees.length === 0) {\n\t\treturn undefined as Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\t}\n\tassert(mapTrees.length === 1, 0xa11 /* unexpected field length */);\n\t// Length asserted above, so this is safe. This assert is done instead of checking for undefined after indexing to ensure a length greater than 1 also errors.\n\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\tconst mapTree = mapTrees[0]!;\n\tconst rootSchema = flexSchema.nodeSchema.get(mapTree.type) ?? fail(\"missing schema\");\n\tconst mapTreeNode = getOrCreateMapTreeNode(rootSchema, mapTree);\n\n\t// TODO: ensure this works for InnerNodes to create unhydrated nodes\n\tconst result = getOrCreateNodeFromFlexTreeNode(mapTreeNode);\n\treturn result as Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n}\n"]}
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/simple-tree/api/create.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAG7D,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAU3C,OAAO,EACN,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,GAEjB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAA0B,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EACN,0BAA0B,EAC1B,iBAAiB,GAIjB,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CACnC,MAAe,EACf,IAAmD,EACnD,OAAoC;IAEpC,MAAM,MAAM,GAAG,oBAAoB,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnF,OAAO,MAAyD,CAAC;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CACnC,MAAe,EACf,IAAmD,E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,EAAE,mBAAmB;QAC3B,mHAAmH;QACnH,MAAM,EAAE,gBAAgB,CAAC,UAAU,CAAC;KACpC,CAAC;IAEF,MAAM,UAAU,GAAG,eAAe,CACjC,QAAQ,EACR,UAAU,CAAC,eAAe,CAAC,MAAM,EACjC,sBAAsB,CACtB,CAAC;IACF,eAAe,CAAC,UAAU,CAAC,CAAC;IAE5B,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,SAA4D,CAAC;IACrE,CAAC;IACD,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACnE,8JAA8J;IAC9J,oEAAoE;IACpE,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAE,CAAC;IAC7B,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACrF,MAAM,WAAW,GAAG,sBAAsB,CACzC,IAAI,iBAAiB,CAAC,UAAU,CAAC,EACjC,UAAU,EACV,OAAO,CACP,CAAC;IAEF,oEAAoE;IACpE,MAAM,MAAM,GAAG,+BAA+B,CAAC,WAAW,CAAC,CAAC;IAC5D,OAAO,MAAyD,CAAC;AAClE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { ITreeCursorSynchronous, SchemaAndPolicy } from \"../../core/index.js\";\nimport { fail } from \"../../util/index.js\";\nimport type {\n\tTreeLeafValue,\n\tImplicitFieldSchema,\n\tInsertableTreeFieldFromImplicitField,\n\tTreeFieldFromImplicitField,\n\tFieldSchema,\n\tFieldKind,\n} from \"../schemaTypes.js\";\nimport type { Unhydrated } from \"../core/index.js\";\nimport {\n\tcursorForMapTreeNode,\n\tdefaultSchemaPolicy,\n\tFieldKinds,\n\tintoStoredSchema,\n\tmapTreeFromCursor,\n\tUnhydratedContext,\n\ttype NodeKeyManager,\n} from \"../../feature-libraries/index.js\";\nimport { getOrCreateNodeFromFlexTreeNode } from \"../proxies.js\";\nimport { getOrCreateMapTreeNode, isFieldInSchema } from \"../../feature-libraries/index.js\";\nimport { toFlexSchema } from \"../toFlexSchema.js\";\nimport { inSchemaOrThrow, mapTreeFromNodeData, type InsertableContent } from \"../toMapTree.js\";\nimport {\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\ttype ParseOptions,\n\ttype VerboseTree,\n\ttype VerboseTreeNode,\n} from \"./verboseTree.js\";\n\n/**\n * Construct tree content that is compatible with the field defined by the provided `schema`.\n * @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 * @param data - The data used to construct the field content.\n * @remarks\n * When providing a {@link TreeNodeSchemaClass}, this is the same as invoking its constructor except that an unhydrated node can also be provided.\n * This function exists as a generalization that can be used in other cases as well,\n * 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 *\n * Like with {@link TreeNodeSchemaClass}'s constructor, its an error to provide an existing node to this API.\n * TODO: For that case, use we should provide `Tree.clone`.\n * @privateRemarks\n * This could be exposed as a public `Tree.create` function.\n */\nexport function createFromInsertable<TSchema extends ImplicitFieldSchema>(\n\tschema: TSchema,\n\tdata: InsertableTreeFieldFromImplicitField<TSchema>,\n\tcontext?: NodeKeyManager | undefined,\n): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\tconst cursor = cursorFromInsertable(schema, data, context);\n\tconst result = cursor === undefined ? undefined : createFromCursor(schema, cursor);\n\treturn result as Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n}\n\n/**\n * Construct tree content that is compatible with the field defined by the provided `schema`.\n * @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 * @param data - The data used to construct the field content.\n * @remarks\n * When providing a {@link TreeNodeSchemaClass},\n * this is the same as invoking its constructor except that an unhydrated node can also be provided and the returned value is a cursor.\n * When `undefined` is provided (for an optional field), `undefined` is returned.\n */\nexport function cursorFromInsertable<TSchema extends ImplicitFieldSchema>(\n\tschema: TSchema,\n\tdata: InsertableTreeFieldFromImplicitField<TSchema>,\n\tcontext?: NodeKeyManager | undefined,\n):\n\t| ITreeCursorSynchronous\n\t| (TSchema extends FieldSchema<FieldKind.Optional> ? undefined : never) {\n\tconst flexSchema = toFlexSchema(schema);\n\tconst schemaValidationPolicy: SchemaAndPolicy = {\n\t\tpolicy: defaultSchemaPolicy,\n\t\t// TODO: optimize: This isn't the most efficient operation since its not cached, and has to convert all the schema.\n\t\tschema: intoStoredSchema(flexSchema),\n\t};\n\n\tconst mapTree = mapTreeFromNodeData(\n\t\tdata as InsertableContent | undefined,\n\t\tschema,\n\t\tcontext,\n\t\tschemaValidationPolicy,\n\t);\n\tif (mapTree === undefined) {\n\t\tassert(\n\t\t\tflexSchema.rootFieldSchema.kind === FieldKinds.optional,\n\t\t\t0xa10 /* missing non-optional field */,\n\t\t);\n\t\treturn undefined as TSchema extends FieldSchema<FieldKind.Optional> ? undefined : never;\n\t}\n\treturn cursorForMapTreeNode(mapTree);\n}\n\n/**\n * Construct tree content compatible with a field defined by the provided `schema`.\n * @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 * @param data - The data used to construct the field content. See `Tree.cloneToJSONVerbose`.\n * @privateRemarks\n * This could be exposed as a public `Tree.createFromVerbose` function.\n */\nexport function createFromVerbose<TSchema extends ImplicitFieldSchema, THandle>(\n\tschema: TSchema,\n\tdata: VerboseTreeNode<THandle> | undefined,\n\toptions: ParseOptions<THandle>,\n): Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\n/**\n * Construct tree content compatible with a field defined by the provided `schema`.\n * @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 * @param data - The data used to construct the field content. See `Tree.cloneToJSONVerbose`.\n */\nexport function createFromVerbose<TSchema extends ImplicitFieldSchema>(\n\tschema: TSchema,\n\tdata: VerboseTreeNode | undefined,\n\toptions?: Partial<ParseOptions<IFluidHandle>>,\n): Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\nexport function createFromVerbose<TSchema extends ImplicitFieldSchema, THandle>(\n\tschema: TSchema,\n\tdata: VerboseTreeNode<THandle> | undefined,\n\toptions?: Partial<ParseOptions<THandle>>,\n): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\tconst config: ParseOptions<THandle> = {\n\t\tvalueConverter: (input: VerboseTree<THandle>) => {\n\t\t\treturn input as TreeLeafValue | VerboseTreeNode<THandle>;\n\t\t},\n\t\t...options,\n\t};\n\tconst schemalessConfig = applySchemaToParserOptions(schema, config);\n\tconst cursor = cursorFromVerbose(data, schemalessConfig);\n\treturn createFromCursor(schema, cursor);\n}\n\n/**\n * Creates an unhydrated simple-tree field from a cursor in nodes mode.\n */\nexport function createFromCursor<TSchema extends ImplicitFieldSchema>(\n\tschema: TSchema,\n\tcursor: ITreeCursorSynchronous | undefined,\n): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\tconst mapTrees = cursor === undefined ? [] : [mapTreeFromCursor(cursor)];\n\tconst flexSchema = toFlexSchema(schema);\n\n\tconst schemaValidationPolicy: SchemaAndPolicy = {\n\t\tpolicy: defaultSchemaPolicy,\n\t\t// TODO: optimize: This isn't the most efficient operation since its not cached, and has to convert all the schema.\n\t\tschema: intoStoredSchema(flexSchema),\n\t};\n\n\tconst maybeError = isFieldInSchema(\n\t\tmapTrees,\n\t\tflexSchema.rootFieldSchema.stored,\n\t\tschemaValidationPolicy,\n\t);\n\tinSchemaOrThrow(maybeError);\n\n\tif (mapTrees.length === 0) {\n\t\treturn undefined as Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\t}\n\tassert(mapTrees.length === 1, 0xa11 /* unexpected field length */);\n\t// Length asserted above, so this is safe. This assert is done instead of checking for undefined after indexing to ensure a length greater than 1 also errors.\n\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\tconst mapTree = mapTrees[0]!;\n\tconst rootSchema = flexSchema.nodeSchema.get(mapTree.type) ?? fail(\"missing schema\");\n\tconst mapTreeNode = getOrCreateMapTreeNode(\n\t\tnew UnhydratedContext(flexSchema),\n\t\trootSchema,\n\t\tmapTree,\n\t);\n\n\t// TODO: ensure this works for InnerNodes to create unhydrated nodes\n\tconst result = getOrCreateNodeFromFlexTreeNode(mapTreeNode);\n\treturn result as Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { JsonTreeSchema } from "./jsonSchema.js";
6
- import type { ImplicitAllowedTypes } from "./schemaTypes.js";
6
+ import type { ImplicitAllowedTypes } from "../schemaTypes.js";
7
7
  /**
8
8
  * Creates a {@link https://json-schema.org/ | JSON Schema} representation of the provided {@link TreeNodeSchema}.
9
9
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getJsonSchema.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/getJsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAW9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CAK1E"}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { toJsonSchema } from "./simpleSchemaToJsonSchema.js";
6
6
  import { getSimpleSchema } from "./getSimpleSchema.js";
7
- import { getOrCreate } from "../util/index.js";
7
+ import { getOrCreate } from "../../util/index.js";
8
8
  /**
9
9
  * Cache in which the results of {@link getJsonSchema} are saved.
10
10
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getJsonSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/api/getJsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD;;GAEG;AACH,MAAM,eAAe,GAAG,IAAI,OAAO,EAAkC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,UAAU,aAAa,CAAC,MAA4B;IACzD,OAAO,WAAW,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE;QAChD,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,YAAY,CAAC,YAAY,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { JsonTreeSchema } from \"./jsonSchema.js\";\nimport type { ImplicitAllowedTypes } from \"../schemaTypes.js\";\nimport { toJsonSchema } from \"./simpleSchemaToJsonSchema.js\";\nimport { getSimpleSchema } from \"./getSimpleSchema.js\";\nimport { getOrCreate } from \"../../util/index.js\";\nimport type { TreeNodeSchema } from \"../core/index.js\";\n\n/**\n * Cache in which the results of {@link getJsonSchema} are saved.\n */\nconst jsonSchemaCache = new WeakMap<TreeNodeSchema, JsonTreeSchema>();\n\n/**\n * Creates a {@link https://json-schema.org/ | JSON Schema} representation of the provided {@link TreeNodeSchema}.\n *\n * @remarks\n * Useful when communicating the schema to external libraries or services.\n * Caches the result for future calls.\n *\n * @example\n *\n * A Shared Tree schema like the following:\n *\n * ```typescript\n * class MyObject extends schemaFactory.object(\"MyObject\", {\n * \tfoo: schemaFactory.number,\n * \tbar: schemaFactory.optional(schemaFactory.string),\n * });\n * ```\n *\n * Will yield JSON Schema like the following:\n *\n * ```json\n * {\n * \t\"$defs\": {\n * \t\t\"com.fluidframework.leaf.string\": {\n * \t\t\t\"type\": \"string\",\n * \t\t},\n * \t\t\"com.fluidframework.leaf.number\": {\n * \t\t\t\"type\": \"number\",\n * \t\t},\n * \t\t\"com.myapp.MyObject\": {\n * \t\t\t\"type\": \"object\",\n * \t\t\t\"properties\": {\n * \t\t\t\t\"foo\": { \"$ref\": \"com.fluidframework.leaf.number\" },\n * \t\t\t\t\"bar\": { \"$ref\": \"com.fluidframework.leaf.string\" },\n * \t\t\t},\n * \t\t\t\"required\": [\"foo\"],\n * \t\t},\n * \t},\n * \t\"anyOf\": [ { \"$ref\": \"#/$defs/com.myapp.MyObject\" } ],\n * }\n * ```\n *\n * @privateRemarks In the future, we may wish to move this to a more discoverable API location.\n * For now, while still an experimental API, it is surfaced as a free function.\n *\n * @alpha\n */\nexport function getJsonSchema(schema: ImplicitAllowedTypes): JsonTreeSchema {\n\treturn getOrCreate(jsonSchemaCache, schema, () => {\n\t\tconst simpleSchema = getSimpleSchema(schema);\n\t\treturn toJsonSchema(simpleSchema);\n\t});\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { ImplicitAllowedTypes } from "./schemaTypes.js";
5
+ import type { ImplicitAllowedTypes } from "../schemaTypes.js";
6
6
  import type { SimpleTreeSchema } from "./simpleSchema.js";
7
7
  /**
8
8
  * Creates a simplified representation of the provided {@link TreeNodeSchema}.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSimpleSchema.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/getSimpleSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQ1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,oBAAoB,GAAG,gBAAgB,CAE9E"}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { getOrCreate } from "../util/index.js";
5
+ import { getOrCreate } from "../../util/index.js";
6
6
  import { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
7
7
  /**
8
8
  * Cache in which the results of {@link getSimpleSchema} saved.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSimpleSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/api/getSimpleSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;GAEG;AACH,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAoC,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,UAAU,eAAe,CAAC,MAA4B;IAC3D,OAAO,WAAW,CAAC,iBAAiB,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;AACjF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { getOrCreate } from \"../../util/index.js\";\nimport type { TreeNodeSchema } from \"../core/index.js\";\nimport type { ImplicitAllowedTypes } from \"../schemaTypes.js\";\nimport type { SimpleTreeSchema } from \"./simpleSchema.js\";\nimport { toSimpleTreeSchema } from \"./viewSchemaToSimpleSchema.js\";\n\n/**\n * Cache in which the results of {@link getSimpleSchema} saved.\n */\nconst simpleSchemaCache = new WeakMap<TreeNodeSchema, SimpleTreeSchema>();\n\n/**\n * Creates a simplified representation of the provided {@link TreeNodeSchema}.\n *\n * @remarks Caches the result on the input schema for future calls.\n *\n * @example\n *\n * A Shared Tree schema like the following:\n *\n * ```typescript\n * class MyObject extends schemaFactory.object(\"MyObject\", {\n * \tfoo: schemaFactory.number,\n * \tbar: schemaFactory.optional(schemaFactory.string),\n * });\n * ```\n *\n * Will yield JSON Schema like the following:\n *\n * ```typescript\n * {\n * \tdefinitions: [\n * \t\t[\"com.fluidframework.leaf.number\", {\n * \t\t\tkind: \"leaf\",\n * \t\t\ttype: \"number\",\n * \t\t}],\n * \t\t[\"com.fluidframework.leaf.string\", {\n * \t\t\tkind: \"leaf\",\n * \t\t\ttype: \"string\",\n * \t\t}],\n * \t\t[\"com.myapp.MyObject\", {\n * \t\t\tkind: \"object\",\n * \t\t\tfields: {\n * \t\t\t\tfoo: {\n * \t\t\t\t\tkind: \"required\",\n * \t\t\t\t\tallowedTypes: [\"com.fluidframework.leaf.number\"]\n * \t\t\t\t},\n * \t\t\t\tbar: {\n * \t\t\t\t\tkind: \"optional\",\n * \t\t\t\t\tallowedTypes: [\"com.fluidframework.leaf.string\"]\n * \t\t\t\t},\n * \t\t\t},\n * \t\t}],\n * \t],\n * \tallowedTypes: [\"com.myapp.MyObject\"],\n * }\n * ```\n *\n * @privateRemarks In the future, we may wish to move this to a more discoverable API location.\n * For now, while still an experimental API, it is surfaced as a free function.\n */\nexport function getSimpleSchema(schema: ImplicitAllowedTypes): SimpleTreeSchema {\n\treturn getOrCreate(simpleSchemaCache, schema, () => toSimpleTreeSchema(schema));\n}\n"]}
@@ -8,5 +8,10 @@ export type { ValidateRecursiveSchema, FixRecursiveArraySchema, } from "./schema
8
8
  export { adaptEnum, enumFromStrings, singletonSchema, typedObjectValues, type EmptyObject, } from "./schemaCreationUtilities.js";
9
9
  export { treeNodeApi, type TreeNodeApi } from "./treeNodeApi.js";
10
10
  export { createFromInsertable, cursorFromInsertable } from "./create.js";
11
+ export type { SimpleTreeSchema } from "./simpleSchema.js";
12
+ export { type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, } from "./jsonSchema.js";
13
+ export { getJsonSchema } from "./getJsonSchema.js";
14
+ export { getSimpleSchema } from "./getSimpleSchema.js";
15
+ export { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from "./treeApiBeta.js";
11
16
  export { RecursiveObject as test_RecursiveObject, base as test_RecursiveObject_base, RecursiveObjectPojoMode as test_RecursiveObjectPojoMode, } from "./testRecursiveDomain.js";
12
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,GAC9B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,YAAY,EACX,uBAAuB,EACvB,uBAAuB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,KAAK,WAAW,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,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AE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI7F,OAAO,EACN,eAAe,IAAI,oBAAoB,EACvC,IAAI,IAAI,yBAAyB,EACjC,uBAAuB,IAAI,4BAA4B,GACvD,MAAM,0BAA0B,CAAC"}
@@ -7,6 +7,9 @@ export { SchemaFactory } from "./schemaFactory.js";
7
7
  export { adaptEnum, enumFromStrings, singletonSchema, typedObjectValues, } from "./schemaCreationUtilities.js";
8
8
  export { treeNodeApi } from "./treeNodeApi.js";
9
9
  export { createFromInsertable, cursorFromInsertable } from "./create.js";
10
+ export { getJsonSchema } from "./getJsonSchema.js";
11
+ export { getSimpleSchema } from "./getSimpleSchema.js";
12
+ export { TreeBeta } from "./treeApiBeta.js";
10
13
  // Exporting the schema (RecursiveObject) to test that recursive types are working correctly.
11
14
  // These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639
12
15
  export { RecursiveObject as test_RecursiveObject, base as test_RecursiveObject_base, RecursiveObjectPojoMode as test_RecursiveObjectPojoMode, } from "./testRecursiveDomain.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIN,qBAAqB,GAIrB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAyB,MAAM,oBAAoB,CAAC;AAK1E,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,EACf,iBAAiB,GAEjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAoB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEzE,6FAA6F;AAC7F,4IAA4I;AAC5I,OAAO,EACN,eAAe,IAAI,oBAAoB,EACvC,IAAI,IAAI,yBAAyB,EACjC,uBAAuB,IAAI,4BAA4B,GACvD,MAAM,0BAA0B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n} from \"./tree.js\";\nexport { SchemaFactory, type ScopedSchemaName } from \"./schemaFactory.js\";\nexport type {\n\tValidateRecursiveSchema,\n\tFixRecursiveArraySchema,\n} from \"./schemaFactoryRecursive.js\";\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttypedObjectValues,\n\ttype EmptyObject,\n} from \"./schemaCreationUtilities.js\";\nexport { treeNodeApi, type TreeNodeApi } from \"./treeNodeApi.js\";\nexport { createFromInsertable, cursorFromInsertable } from \"./create.js\";\n\n// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.\n// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\tRecursiveObject as test_RecursiveObject,\n\tbase as test_RecursiveObject_base,\n\tRecursiveObjectPojoMode as test_RecursiveObjectPojoMode,\n} from \"./testRecursiveDomain.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIN,qBAAqB,GAIrB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAyB,MAAM,oBAAoB,CAAC;AAK1E,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,EACf,iBAAiB,GAEjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAoB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAiBzE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAmD,MAAM,kBAAkB,CAAC;AAE7F,6FAA6F;AAC7F,4IAA4I;AAC5I,OAAO,EACN,eAAe,IAAI,oBAAoB,EACvC,IAAI,IAAI,yBAAyB,EACjC,uBAAuB,IAAI,4BAA4B,GACvD,MAAM,0BAA0B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n} from \"./tree.js\";\nexport { SchemaFactory, type ScopedSchemaName } from \"./schemaFactory.js\";\nexport type {\n\tValidateRecursiveSchema,\n\tFixRecursiveArraySchema,\n} from \"./schemaFactoryRecursive.js\";\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttypedObjectValues,\n\ttype EmptyObject,\n} from \"./schemaCreationUtilities.js\";\nexport { treeNodeApi, type TreeNodeApi } from \"./treeNodeApi.js\";\nexport { createFromInsertable, cursorFromInsertable } from \"./create.js\";\nexport type { SimpleTreeSchema } from \"./simpleSchema.js\";\nexport {\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n} from \"./jsonSchema.js\";\nexport { getJsonSchema } from \"./getJsonSchema.js\";\nexport { getSimpleSchema } from \"./getSimpleSchema.js\";\n\nexport { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from \"./treeApiBeta.js\";\n\n// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.\n// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\tRecursiveObject as test_RecursiveObject,\n\tbase as test_RecursiveObject_base,\n\tRecursiveObjectPojoMode as test_RecursiveObjectPojoMode,\n} from \"./testRecursiveDomain.js\";\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { NodeKind } from "./core/index.js";
5
+ import type { NodeKind } from "../core/index.js";
6
6
  /**
7
7
  * The fully-qualified {@link TreeNodeSchemaCore.identifier}.
8
8
  * @alpha
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonSchema.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/jsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,YAAY,EAAE,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,kBAAkB,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB,CAClC,SAAS,SAAS,QAAQ,EAC1B,eAAe,SAAS,cAAc;IAEtC;;;;;;;OAOG;IACH,QAAQ,CAAC,mBAAmB,EAAE,SAAS,CAAC;IAExC;;OAEG;IACH,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H,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,cAAe,SAAQ,eAAe;IACtD;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;CACrD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/api/jsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NodeKind } from \"../core/index.js\";\n\n/**\n * The fully-qualified {@link TreeNodeSchemaCore.identifier}.\n * @alpha\n */\nexport type JsonSchemaId = string;\n\n/**\n * Reference string pointing to a definition in the schema.\n * Should be the fully-qualified {@link TreeNodeSchemaCore.identifier}.\n * @remarks Of the form `#/$defs/<schema-identifier>`, where the `schema-identifier` is the fully-qualified {@link TreeNodeSchemaCore.identifier}.\n * @example Schema `com.myapp.foo` would be referenced via `#/$defs/com.myapp.foo`.\n * @alpha\n */\nexport type JsonRefPath = `#/$defs/${JsonSchemaId}`;\n\n/**\n * JSON entity type.\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n * @alpha\n */\nexport type JsonSchemaType = \"object\" | \"array\" | JsonLeafSchemaType;\n\n/**\n * JSON primitive types.\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n * @alpha\n */\nexport type JsonLeafSchemaType = \"string\" | \"number\" | \"boolean\" | \"null\";\n\n/**\n * Base interface for node schemas represented in {@link https://json-schema.org/draft/2020-12/json-schema-core | JSON Schema} format.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonNodeSchemaBase<\n\tTNodeKind extends NodeKind,\n\tTJsonSchemaType extends JsonSchemaType,\n> {\n\t/**\n\t * Kind of {@link TreeNodeSchema} this JSON Schema entry represents.\n\t *\n\t * @remarks There is not a 1:1 mapping between {@link TreeNodeSchema} types and JSON Schema types.\n\t * This is used to disambiguate the type of {@link TreeNodeSchema} this JSON Schema maps to.\n\t *\n\t * Note: This property name is not a part of the JSON Schema spec. This is a Fluid-specific extension.\n\t */\n\treadonly _treeNodeSchemaKind: TNodeKind;\n\n\t/**\n\t * {@inheritDoc JsonSchemaType}\n\t */\n\treadonly type: TJsonSchemaType;\n}\n\n/**\n * JSON Schema for an object node.\n *\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonObjectNodeSchema extends JsonNodeSchemaBase<NodeKind.Object, \"object\"> {\n\t/**\n\t * Object fields.\n\t * @remarks Required fields should have a corresponding entry in {@link JsonObjectNodeSchema.required}.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-properties}.\n\t */\n\treadonly properties: Record<string, JsonFieldSchema>;\n\n\t/**\n\t * List of keys for required fields.\n\t *\n\t * @remarks\n\t * Optional fields should not be included in this list.\n\t * Each key specified must have an entry in {@link JsonObjectNodeSchema.properties}.\n\t */\n\treadonly required?: string[];\n\n\t/**\n\t * Whether or not additional properties (properties not specified by the schema) are allowed in objects of this type.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-additionalproperties}.\n\t */\n\treadonly additionalProperties?: boolean;\n}\n\n/**\n * JSON Schema for an array node.\n *\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonArrayNodeSchema extends JsonNodeSchemaBase<NodeKind.Array, \"array\"> {\n\t/**\n\t * The kinds of items allowed under the array.\n\t * @remarks Always represented via references to {@link JsonTreeSchema.$defs}.\n\t *\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-items}.\n\t */\n\treadonly items: {\n\t\t/**\n\t\t * The kinds of items allowed under the array.\n\t\t * @remarks Always represented via references to {@link JsonTreeSchema.$defs}.\n\t\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-anyof}.\n\t\t */\n\t\tanyOf: JsonSchemaRef[];\n\t};\n}\n\n/**\n * JSON Schema for a map node.\n *\n * @remarks Special case for map nodes, which do not have a native JSON schema corollary.\n *\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonMapNodeSchema extends JsonNodeSchemaBase<NodeKind.Map, \"object\"> {\n\t/**\n\t * Used to control the types of properties that can appear in the \"object\" representation of the map.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-patternproperties}.\n\t */\n\treadonly patternProperties: {\n\t\t/**\n\t\t * Types allowed in the map.\n\t\t * @remarks This format allows for any (JSON-compliant) key, but restricts the allowed types to only those specified.\n\t\t */\n\t\t\"^.*$\": JsonFieldSchema;\n\t};\n}\n\n/**\n * JSON Schema for a leaf node.\n *\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonLeafNodeSchema\n\textends JsonNodeSchemaBase<NodeKind.Leaf, JsonLeafSchemaType> {\n\t/**\n\t * Primitive type.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n\t */\n\treadonly type: JsonLeafSchemaType;\n}\n\n/**\n * Type entry containing a reference to a definition in the schema.\n *\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-schema-references}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonSchemaRef {\n\t/**\n\t * Reference to a definition in the schema.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-direct-references-with-ref}.\n\t */\n\t$ref: JsonRefPath;\n}\n\n/**\n * {@link https://json-schema.org/draft/2020-12/json-schema-core | JSON Schema} representation of a {@link TreeNodeSchema}.\n *\n * @alpha\n */\nexport type JsonNodeSchema =\n\t| JsonLeafNodeSchema\n\t| JsonMapNodeSchema\n\t| JsonArrayNodeSchema\n\t| JsonObjectNodeSchema;\n\n/**\n *{@link https://json-schema.org/draft/2020-12/json-schema-core | JSON Schema} representation of a {@link FieldSchema}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonFieldSchema {\n\t/**\n\t * The kinds of items allowed under the field.\n\t * @remarks Always represented via references to {@link JsonTreeSchema.$defs}.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-anyof}.\n\t */\n\treadonly anyOf: JsonSchemaRef[];\n}\n\n/**\n * {@link https://json-schema.org/draft/2020-12/json-schema-core | JSON Schema} representation of a tree schema.\n *\n * @remarks\n * Includes the complete set of definitions reachable from the \"root\" schema.\n *\n * Note: This representation only uses a limited subset of supported JSON Schema features.\n * It is scoped to a format that can be used to sufficiently represent supported SharedTree schema.\n *\n * Also note that this schema format contains Fluid-specific extensions, such as the {@link JsonNodeSchemaBase._treeNodeSchemaKind}\n * property, meaning that it is not a *strict* subset.\n * When using these schemas with validation tools (for example, {@link https://ajv.js.org/}), you will need to opt out\n * of *strict* validation to ensure extra properties are allowed.\n *\n * @privateRemarks\n * Extending JSON Schema is permitted by the spec.\n * See {@link https://json-schema.org/draft/2020-12/json-schema-core#name-extending-json-schema}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonTreeSchema extends JsonFieldSchema {\n\t/**\n\t * The set of definitions reachable from this schema's root.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-schema-re-use-with-defs}\n\t */\n\treadonly $defs: Record<JsonSchemaId, JsonNodeSchema>;\n}\n"]}
@@ -19,7 +19,7 @@ export declare function schemaFromValue(value: TreeValue): TreeNodeSchema;
19
19
  /**
20
20
  * The name of a schema produced by {@link SchemaFactory}, including its optional scope prefix.
21
21
  *
22
- * @public
22
+ * @system @public
23
23
  */
24
24
  export type ScopedSchemaName<TScope extends string | undefined, TName extends number | string> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;
25
25
  /**
@@ -44,17 +44,46 @@ export type ScopedSchemaName<TScope extends string | undefined, TName extends nu
44
44
  * The usage below generalizes this to include array and map like objects as well.
45
45
  *
46
46
  * There are two ways to use these APIs:
47
- * | | Customizable | POJO Emulation |
48
- * | ------------------- | ------------ |--------------- |
49
- * | Declaration | `class X extends schemaFactory.object("x", {}) {}` | `const X = schemaFactory.object("x", {}); type X = NodeFromSchema<typeof X>; `
50
- * | Allows adding "local" (non-persisted) members | Yes. Members (including methods) can be added to class. | No. Attempting to set non-field members will error. |
51
- * | Prototype | The user defined class | `Object.prototype`, `Map.prototype` or `Array.prototype` depending on node kind |
52
- * | Structurally named Schema | Not Supported | Supported |
53
- * | Explicitly named Objects | Supported | Supported |
54
- * | Explicitly named Maps and Arrays | Supported: Both declaration approaches can be used | Not Supported |
55
- * | node.js assert.deepEqual | Compares like class instances: equal to other nodes of the same type with the same content, including custom local fields. | Compares like plain objects: equal to plain JavaScript objects with the same fields, and other nodes with the same fields, even if the types are different. |
56
- * | IntelliSense | Shows and links to user defined class by name: `X` | Shows internal type generation logic: `object & TreeNode & ObjectFromSchemaRecord<{}> & WithType<"test.x">` |
57
- * | Recursion | Supported with special declaration patterns. | Unsupported: Generated d.ts files replace recursive references with `any`, breaking use of recursive schema across compilation boundaries |
47
+ *
48
+ * Customizable Approach:
49
+ *
50
+ * 1. Declaration: `class X extends schemaFactory.object("x", {}) {}`
51
+ *
52
+ * 2. Allows adding "local" (non-persisted) members: Yes. Members (including methods) can be added to the class.
53
+ *
54
+ * 3. Prototype: The user-defined class.
55
+ *
56
+ * 4. Structurally named Schema: Not Supported.
57
+ *
58
+ * 5. Explicitly named Objects: Supported.
59
+ *
60
+ * 6. Explicitly named Maps and Arrays: Supported: Both declaration approaches can be used.
61
+ *
62
+ * 7. Node.js `assert.deepEqual`: Compares like class instances: equal to other nodes of the same type with the same content, including custom local fields.
63
+ *
64
+ * 8. IntelliSense: Shows and links to user-defined class by name: `X`.
65
+ *
66
+ * 9. Recursion: Supported with special declaration patterns.
67
+ *
68
+ * POJO Emulation Approach:
69
+ *
70
+ * 1. Declaration: `const X = schemaFactory.object("x", {}); type X = NodeFromSchema<typeof X>;`
71
+ *
72
+ * 2. Allows adding "local" (non-persisted) members: No. Attempting to set non-field members will result in an error.
73
+ *
74
+ * 3. Prototype: `Object.prototype`, `Map.prototype`, or `Array.prototype` depending on node kind.
75
+ *
76
+ * 4. Structurally named Schema: Supported.
77
+ *
78
+ * 5. Explicitly named Objects: Supported.
79
+ *
80
+ * 6. Explicitly named Maps and Arrays: Not Supported.
81
+ *
82
+ * 7. Node.js `assert.deepEqual`: Compares like plain objects: equal to plain JavaScript objects with the same fields, and other nodes with the same fields, even if the types are different.
83
+ *
84
+ * 8. IntelliSense: Shows internal type generation logic: `object & TreeNode & ObjectFromSchemaRecord<{}> & WithType<"test.x">`.
85
+ *
86
+ * 9. Recursion: Unsupported: Generated `.d.ts` files replace recursive references with `any`, breaking the use of recursive schema across compilation boundaries.
58
87
  *
59
88
  * Note that while "POJO Emulation" nodes act a lot like POJO objects, they are not true POJO objects:
60
89
  *
@@ -75,6 +104,8 @@ export type ScopedSchemaName<TScope extends string | undefined, TName extends nu
75
104
  * Allowing (or banning) custom/out-of-schema properties on the class is also possible in both modes: it could be orthogonal.
76
105
  * Also for consistency, if keeping the current approach to detecting `POJO Emulation` mode it might make sense to make explicitly named Maps and Arrays do the detection the same as how object does it.
77
106
  *
107
+ * Note: the comparison between the customizable and POJO modes is not done in a table because TSDoc does not currently have support for embedded markdown.
108
+ *
78
109
  * @sealed @public
79
110
  */
80
111
  export declare class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> {
@@ -327,7 +358,7 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
327
358
  * This version of `SchemaFactory.array` uses the same workarounds as {@link SchemaFactory.objectRecursive}.
328
359
  * See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
329
360
  */
330
- arrayRecursive<const Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array>, {
361
+ arrayRecursive<const Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array, unknown>, {
331
362
  /**
332
363
  * Iterator for the iterable of content for this node.
333
364
  * @privateRemarks
@@ -348,7 +379,7 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
348
379
  * This version of `SchemaFactory.map` uses the same workarounds as {@link SchemaFactory.objectRecursive}.
349
380
  * See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
350
381
  */
351
- mapRecursive<Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>, {
382
+ mapRecursive<Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map, unknown>, {
352
383
  /**
353
384
  * Iterator for the iterable of content for this node.
354
385
  * @privateRemarks
@@ -1 +1 @@
1
- {"version":3,"file":"schemaFactory.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,YAAY,IAAI,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAEN,KAAK,UAAU,EAEf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,K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