@fluidframework/tree 2.3.0-288113 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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":"arrayNode.js","sourceRoot":"","sources":["../../src/simple-tree/arrayNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;AAEH,kEAA0D;AAC1D,+CAAmE;AAC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AAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC1B,MAAM,IAAI,qBAAU,CACnB,uCAAuC,UAAU,oBAAoB,CACrE,CAAC;QACH,CAAC;IACF,CAAC;SAAM,CAAC;QACP,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YAC3B,MAAM,IAAI,qBAAU,CACnB,uCAAuC,UAAU,oBAAoB,CACrE,CAAC;QACH,CAAC;IACF,CAAC;AACF,CAAC;AAED,SAAS,kBAAkB,CAC1B,UAAkB,EAClB,QAAgB,EAChB,KAAkC,EAClC,UAAkB;IAElB,aAAa,CAAC,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACnD,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACjD,IAAI,UAAU,GAAG,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,QAAQ,EAAE,CAAC;QACtD,MAAM,IAAI,qBAAU,CACnB,uCAAuC,UAAU,oBAAoB,CACrE,CAAC;IACH,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { oob } from \"@fluidframework/core-utils/internal\";\nimport { EmptyKey, type ExclusiveMapTree } from \"../core/index.js\";\nimport {\n\ttype FlexAllowedTypes,\n\ttype FlexTreeNodeSchema,\n\ttype FlexTreeNode,\n\ttype FlexTreeSequenceField,\n\ttype MapTreeNode,\n\tgetOrCreateMapTreeNode,\n\tgetSchemaAndPolicy,\n\tisFlexTreeNode,\n\tisMapTreeSequenceField,\n} from \"../feature-libraries/index.js\";\nimport {\n\ttype InsertableContent,\n\tgetOrCreateNodeFromFlexTreeNode,\n\tprepareContentForHydration,\n} from \"./proxies.js\";\nimport { getOrCreateInnerNode } from \"./proxyBinding.js\";\n// This import seems to trigger a false positive `Type import \"TreeNodeFromImplicitAllowedTypes\" is used by decorator metadata` lint error.\n// Other ways to import (ex: import the module with the items as type imports) give different more real errors, and auto fix to this format,\n// so there does not seem to be a clean workaround to make the linter happy.\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport type {\n\tImplicitAllowedTypes,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n\tTreeNodeFromImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport {\n\ttype WithType,\n\t// eslint-disable-next-line import/no-deprecated\n\ttypeNameSymbol,\n\tNodeKind,\n\ttype TreeNode,\n\ttype InternalTreeNode,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchema,\n\ttypeSchemaSymbol,\n} from \"./core/index.js\";\nimport { mapTreeFromNodeData } from \"./toMapTree.js\";\nimport { fail } from \"../util/index.js\";\nimport { getFlexSchema } from \"./toFlexSchema.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { getKernel } from \"./core/index.js\";\nimport { TreeNodeValid, type MostDerivedData } from \"./treeNodeValid.js\";\n\n/**\n * A generic array type, used to defined types like {@link (TreeArrayNode:interface)}.\n *\n * @privateRemarks\n * Inlining this into TreeArrayNode causes recursive array use to stop compiling.\n *\n * @sealed @public\n */\nexport interface TreeArrayNodeBase<out T, in TNew, in TMoveFrom>\n\textends ReadonlyArray<T>,\n\t\tTreeNode {\n\t/**\n\t * Inserts new item(s) at a specified location.\n\t * @param index - The index at which to insert `value`.\n\t * @param value - The content to insert.\n\t * @throws Throws if `index` is not in the range [0, `array.length`).\n\t */\n\tinsertAt(index: number, ...value: readonly (TNew | IterableTreeArrayContent<TNew>)[]): void;\n\n\t/**\n\t * Inserts new item(s) at the start of the array.\n\t * @param value - The content to insert.\n\t */\n\tinsertAtStart(...value: readonly (TNew | IterableTreeArrayContent<TNew>)[]): void;\n\n\t/**\n\t * Inserts new item(s) at the end of the array.\n\t * @param value - The content to insert.\n\t */\n\tinsertAtEnd(...value: readonly (TNew | IterableTreeArrayContent<TNew>)[]): void;\n\n\t/**\n\t * Removes the item at the specified location.\n\t * @param index - The index at which to remove the item.\n\t * @throws Throws if `index` is not in the range [0, `array.length`).\n\t */\n\tremoveAt(index: number): void;\n\n\t/**\n\t * Removes all items between the specified indices.\n\t * @param start - The starting index of the range to remove (inclusive). Defaults to the start of the array.\n\t * @param end - The ending index of the range to remove (exclusive). Defaults to `array.length`.\n\t * @throws Throws if `start` is not in the range [0, `array.length`].\n\t * @throws Throws if `end` is less than `start`.\n\t * If `end` is not supplied or is greater than the length of the array, all items after `start` are removed.\n\t *\n\t * @remarks\n\t * The default values for start and end are computed when this is called,\n\t * and thus the behavior is the same as providing them explicitly, even with respect to merge resolution with concurrent edits.\n\t * For example, two concurrent transactions both emptying the array with `node.removeRange()` then inserting an item,\n\t * will merge to result in the array having both inserted items.\n\t */\n\tremoveRange(start?: number, end?: number): void;\n\n\t/**\n\t * Moves the specified item to the start of the array.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `array.length`).\n\t */\n\tmoveToStart(sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the start of the array.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source array to move the item out of.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `array.length`).\n\t */\n\tmoveToStart(sourceIndex: number, source: TMoveFrom): void;\n\n\t/**\n\t * Moves the specified item to the end of the array.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `array.length`).\n\t */\n\tmoveToEnd(sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the end of the array.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source array to move the item out of.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `array.length`).\n\t */\n\tmoveToEnd(sourceIndex: number, source: TMoveFrom): void;\n\n\t/**\n\t * Moves the specified item to the desired location in the array.\n\t * @param index - The index to move the item to.\n\t * This is based on the state of the array before moving the source item.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if any of the input indices are not in the range [0, `array.length`).\n\t */\n\tmoveToIndex(index: number, sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the desired location in the array.\n\t * @param index - The index to move the item to in the range [0, `array.length`].\n\t * This is based on the state of the array before moving the source item.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source array to move the item out of.\n\t * @throws Throws if any of the source index is not in the range [0, `array.length`),\n\t * or if the index is not in the range [0, `array.length`].\n\t */\n\tmoveToIndex(index: number, sourceIndex: number, source: TMoveFrom): void;\n\n\t/**\n\t * Moves the specified items to the start of the array.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if either of the input indices are not in the range [0, `array.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.\n\t */\n\tmoveRangeToStart(sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the start of the array.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source array to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination array,\n\t * if either of the input indices are not in the range [0, `array.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.\n\t */\n\tmoveRangeToStart(sourceStart: number, sourceEnd: number, source: TMoveFrom): void;\n\n\t/**\n\t * Moves the specified items to the end of the array.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if either of the input indices are not in the range [0, `array.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.\n\t */\n\tmoveRangeToEnd(sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the end of the array.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source array to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination array,\n\t * if either of the input indices are not in the range [0, `array.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.\n\t */\n\tmoveRangeToEnd(sourceStart: number, sourceEnd: number, source: TMoveFrom): void;\n\n\t/**\n\t * Moves the specified items to the desired location within the array.\n\t * @param index - The index to move the items to.\n\t * This is based on the state of the array before moving the source items.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if any of the input indices are not in the range [0, `array.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.\n\t */\n\tmoveRangeToIndex(index: number, sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the desired location within the array.\n\t * @param index - The index to move the items to.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source array to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination array,\n\t * if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.\n\t */\n\tmoveRangeToIndex(\n\t\tindex: number,\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource: TMoveFrom,\n\t): void;\n\n\t/**\n\t * Returns a custom IterableIterator which throws usage errors if concurrent editing and iteration occurs.\n\t */\n\tvalues(): IterableIterator<T>;\n}\n\n/**\n * A {@link TreeNode} which implements 'readonly T[]' and the array mutation APIs.\n *\n * @typeParam TAllowedTypes - Schema for types which are allowed as members of this array.\n *\n * @sealed @public\n */\nexport interface TreeArrayNode<\n\tTAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n> extends TreeArrayNodeBase<\n\t\tTreeNodeFromImplicitAllowedTypes<TAllowedTypes>,\n\t\tInsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes>,\n\t\tTreeArrayNode\n\t> {}\n\n/**\n * A {@link TreeNode} which implements 'readonly T[]' and the array mutation APIs.\n * @public\n */\nexport const TreeArrayNode = {\n\t/**\n\t * Wrap an iterable of items to inserted as consecutive items in a array.\n\t * @remarks\n\t * The object returned by this function can be inserted into a {@link (TreeArrayNode:interface)}.\n\t * Its contents will be inserted consecutively in the corresponding location in the array.\n\t * @example\n\t * ```ts\n\t * array.insertAtEnd(TreeArrayNode.spread(iterable))\n\t * ```\n\t */\n\tspread: <T>(content: Iterable<T>) => create(content),\n} as const;\n\n/**\n * Package internal construction API.\n * Use {@link (TreeArrayNode:variable).spread} to create an instance of this type instead.\n */\nlet create: <T>(content: Iterable<T>) => IterableTreeArrayContent<T>;\n\n/**\n * Used to insert iterable content into a {@link (TreeArrayNode:interface)}.\n * Use {@link (TreeArrayNode:variable).spread} to create an instance of this type.\n * @sealed @public\n */\nexport class IterableTreeArrayContent<T> implements Iterable<T> {\n\tstatic {\n\t\tcreate = <T2>(content: Iterable<T2>) => new IterableTreeArrayContent(content);\n\t}\n\n\tprivate constructor(private readonly content: Iterable<T>) {}\n\n\t/**\n\t * Iterates over content for nodes to insert.\n\t */\n\tpublic [Symbol.iterator](): Iterator<T> {\n\t\treturn this.content[Symbol.iterator]();\n\t}\n}\n\n/**\n * Given a array node proxy, returns its underlying LazySequence field.\n */\nfunction getSequenceField<\n\tTTypes extends FlexAllowedTypes,\n\tTSimpleType extends ImplicitAllowedTypes,\n>(arrayNode: TreeArrayNode<TSimpleType>): FlexTreeSequenceField<TTypes> {\n\treturn getOrCreateInnerNode(arrayNode).getBoxed(EmptyKey) as FlexTreeSequenceField<TTypes>;\n}\n\n// For compatibility, we are initially implement 'readonly T[]' by applying the Array.prototype methods\n// to the array node proxy. Over time, we should replace these with efficient implementations on LazySequence\n// to avoid re-entering the proxy as these methods access 'length' and the indexed properties.\n//\n// For brevity, the current implementation dynamically builds a property descriptor map from a list of\n// Array functions we want to re-expose via the proxy.\n\nconst arrayPrototypeKeys = [\n\t\"concat\",\n\t\"entries\",\n\t\"every\",\n\t\"filter\",\n\t\"find\",\n\t\"findIndex\",\n\t\"flat\",\n\t\"flatMap\",\n\t\"forEach\",\n\t\"includes\",\n\t\"indexOf\",\n\t\"join\",\n\t\"keys\",\n\t\"lastIndexOf\",\n\t\"map\",\n\t\"reduce\",\n\t\"reduceRight\",\n\t\"slice\",\n\t\"some\",\n\t\"toLocaleString\",\n\t\"toString\",\n\n\t// \"copyWithin\",\n\t// \"fill\",\n\t// \"length\",\n\t// \"pop\",\n\t// \"push\",\n\t// \"reverse\",\n\t// \"shift\",\n\t// \"sort\",\n\t// \"splice\",\n\t// \"unshift\",\n] as const;\n\n/**\n * {@link TreeNodeValid}, but modified to add members from Array.prototype named in {@link arrayPrototypeKeys}.\n * @privateRemarks\n * Since a lot of scratch types and values are involved with creating this,\n * it's generating using an immediately invoked function expression (IIFE).\n * This is a common JavaScript pattern for cases like this to avoid cluttering the scope.\n */\nconst TreeNodeWithArrayFeatures = (() => {\n\t/**\n\t * {@link TreeNodeValid}, but modified to add members from Array.prototype named in {@link arrayPrototypeKeys}.\n\t */\n\tabstract class TreeNodeWithArrayFeaturesUntyped<\n\t\tconst T extends ImplicitAllowedTypes,\n\t> extends TreeNodeValid<Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>> {}\n\n\t// Modify TreeNodeWithArrayFeaturesUntyped to add the members from Array.prototype\n\tarrayPrototypeKeys.forEach((key) => {\n\t\tObject.defineProperty(TreeNodeWithArrayFeaturesUntyped.prototype, key, {\n\t\t\tvalue: Array.prototype[key],\n\t\t});\n\t});\n\n\treturn TreeNodeWithArrayFeaturesUntyped as unknown as typeof NodeWithArrayFeatures;\n})();\n\n/**\n * Type of {@link TreeNodeValid}, but with array members added to the instance type.\n *\n * TypeScript has a rule that `Base constructors must all have the same return type.ts(2510)`.\n * This means that intersecting two types with different constructors to create a type with a more constrained constructor (ex: more specific return type)\n * is not supported.\n *\n * TypeScript also has a limitation that there is no way to replace or remove just the constructor of a type without losing all the private and protected members.\n * See https://github.com/microsoft/TypeScript/issues/35416 for details.\n *\n * TypeScript also does not support explicitly specifying the instance type in a class definition as the constructor return type.\n *\n * Thus to replace the instance type, while preserving the protected static members of TreeNodeValid,\n * the only option seems to be actually declaring a class with all the members explicitly inline.\n *\n * To avoid incurring any bundle size / runtime overhead from this and having to stub out the function bodies,\n * the class uses `declare`.\n * TypeScript does not support `declare` inside scopes, so this is not inside the function scope above.\n *\n * The members of this class were generated using the \"implement interface\" refactoring.\n * Since that refactoring does not add `public`, the lint to require it is disabled for this section of the file.\n * To update this class delete all members and reapply the \"implement interface\" refactoring.\n * As these signatures get formatted to be over three times as many lines with prettier (which is not helpful), it is also suppressed.\n */\n/* eslint-disable @typescript-eslint/explicit-member-accessibility, @typescript-eslint/no-explicit-any */\n// prettier-ignore\ndeclare abstract class NodeWithArrayFeatures<Input, T>\n\textends TreeNodeValid<Input>\n\timplements Pick<readonly T[], (typeof arrayPrototypeKeys)[number]>\n{\n\tconcat(...items: ConcatArray<T>[]): T[];\n\tconcat(...items: (T | ConcatArray<T>)[]): T[];\n\tentries(): IterableIterator<[number, T]>;\n\tevery<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any,\n\t): this is readonly S[];\n\tevery(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any,\n\t): boolean;\n\tfilter<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any,\n\t): S[];\n\tfilter(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any,\n\t): T[];\n\tfind<S extends T>(\n\t\tpredicate: (value: T, index: number, obj: readonly T[]) => value is S,\n\t\tthisArg?: any,\n\t): S | undefined;\n\tfind(\n\t\tpredicate: (value: T, index: number, obj: readonly T[]) => unknown,\n\t\tthisArg?: any,\n\t): T | undefined;\n\tfindIndex(\n\t\tpredicate: (value: T, index: number, obj: readonly T[]) => unknown,\n\t\tthisArg?: any,\n\t): number;\n\tflat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];\n\tflatMap<U, This = undefined>(\n\t\tcallback: (this: This, value: T, index: number, array: T[]) => U | readonly U[],\n\t\tthisArg?: This | undefined,\n\t): U[];\n\tforEach(\n\t\tcallbackfn: (value: T, index: number, array: readonly T[]) => void,\n\t\tthisArg?: any,\n\t): void;\n\tincludes(searchElement: T, fromIndex?: number | undefined): boolean;\n\tindexOf(searchElement: T, fromIndex?: number | undefined): number;\n\tjoin(separator?: string | undefined): string;\n\tkeys(): IterableIterator<number>;\n\tlastIndexOf(searchElement: T, fromIndex?: number | undefined): number;\n\tmap<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[];\n\treduce(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: T,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[],\n\t\t) => T,\n\t): T;\n\treduce(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: T,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[],\n\t\t) => T,\n\t\tinitialValue: T,\n\t): T;\n\treduce<U>(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: U,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[],\n\t\t) => U,\n\t\tinitialValue: U,\n\t): U;\n\treduceRight(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: T,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[],\n\t\t) => T,\n\t): T;\n\treduceRight(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: T,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[],\n\t\t) => T,\n\t\tinitialValue: T,\n\t): T;\n\treduceRight<U>(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: U,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[],\n\t\t) => U,\n\t\tinitialValue: U,\n\t): U;\n\tslice(start?: number | undefined, end?: number | undefined): T[];\n\tsome(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any,\n\t): boolean;\n\ttoLocaleString(): string;\n\ttoString(): string;\n}\n/* eslint-enable @typescript-eslint/explicit-member-accessibility, @typescript-eslint/no-explicit-any */\n\n/**\n * Attempts to coerce the given property key to an integer index property.\n * @param key - The property key to coerce.\n * @param exclusiveMax - This restricts the range in which the resulting index is allowed to be.\n * The coerced index of `key` must be less than `exclusiveMax` or else this function will return `undefined`.\n * This is useful for reading an array within the bounds of its length, e.g. `asIndex(key, array.length)`.\n */\nexport function asIndex(key: string | symbol, exclusiveMax: number): number | undefined {\n\tif (typeof key !== \"string\") {\n\t\treturn undefined;\n\t}\n\n\t// TODO: It may be worth a '0' <= ch <= '9' check before calling 'Number' to quickly\n\t// reject 'length' as an index, or even parsing integers ourselves.\n\tconst asNumber = Number(key);\n\tif (!Number.isInteger(asNumber)) {\n\t\treturn undefined;\n\t}\n\n\t// Check that the original string is the same after converting to a number and back again.\n\t// This prevents keys like \"5.0\", \"0x5\", \" 5\" from coercing to 5, and keys like \" \" or \"\" from coercing to 0.\n\tconst asString = String(asNumber);\n\tif (asString !== key) {\n\t\treturn undefined;\n\t}\n\n\t// TODO: See 'matrix/range.ts' for fast integer coercing + range check.\n\treturn 0 <= asNumber && asNumber < exclusiveMax ? asNumber : undefined;\n}\n\n/**\n * @param allowAdditionalProperties - If true, setting of unexpected properties will be forwarded to the target object.\n * Otherwise setting of unexpected properties will error.\n * @param proxyTarget - Target object of the proxy. Must provide an own `length` value property\n * (which is not used but must exist for getOwnPropertyDescriptor invariants) and the array functionality from {@link arrayNodePrototype}.\n * Controls the prototype exposed by the produced proxy.\n * @param dispatchTarget - provides the functionally of the node, implementing all fields.\n */\nfunction createArrayNodeProxy(\n\tallowAdditionalProperties: boolean,\n\tproxyTarget: object,\n\tdispatchTarget: object,\n): TreeArrayNode {\n\t// To satisfy 'deepEquals' level scrutiny, the target of the proxy must be an array literal in order\n\t// to pass 'Object.getPrototypeOf'. It also satisfies 'Array.isArray' and 'Object.prototype.toString'\n\t// requirements without use of Array[Symbol.species], which is potentially on a path ot deprecation.\n\tconst proxy: TreeArrayNode = new Proxy<TreeArrayNode>(proxyTarget as TreeArrayNode, {\n\t\tget: (target, key, receiver) => {\n\t\t\tconst field = getSequenceField(receiver);\n\t\t\tconst maybeIndex = asIndex(key, field.length);\n\n\t\t\tif (maybeIndex === undefined) {\n\t\t\t\tif (key === \"length\") {\n\t\t\t\t\treturn field.length;\n\t\t\t\t}\n\n\t\t\t\t// Pass the proxy as the receiver here, so that any methods on\n\t\t\t\t// the prototype receive `proxy` as `this`.\n\t\t\t\treturn Reflect.get(dispatchTarget, key, receiver) as unknown;\n\t\t\t}\n\n\t\t\tconst maybeContent = field.at(maybeIndex);\n\t\t\treturn isFlexTreeNode(maybeContent)\n\t\t\t\t? getOrCreateNodeFromFlexTreeNode(maybeContent)\n\t\t\t\t: maybeContent;\n\t\t},\n\t\tset: (target, key, newValue, receiver) => {\n\t\t\tif (key === \"length\") {\n\t\t\t\t// To allow \"length\" to look like \"length\" on an array, getOwnPropertyDescriptor has to report it as a writable value.\n\t\t\t\t// This means the proxy target must provide a length value, but since it can't use getters and setters, it can't be correct.\n\t\t\t\t// Therefor length has to be handled in this proxy.\n\t\t\t\t// Since it's not actually mutable, return false so setting it will produce a type error.\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// 'Symbol.isConcatSpreadable' may be set on an Array instance to modify the behavior of\n\t\t\t// the concat method. We allow this property to be added to the dispatch object.\n\t\t\tif (key === Symbol.isConcatSpreadable) {\n\t\t\t\treturn Reflect.set(dispatchTarget, key, newValue, receiver);\n\t\t\t}\n\n\t\t\t// Array nodes treat all non-negative integer indexes as array access.\n\t\t\t// Using Infinity here (rather than length) ensures that indexing past the end doesn't create additional session local properties.\n\t\t\tconst maybeIndex = asIndex(key, Number.POSITIVE_INFINITY);\n\t\t\tif (maybeIndex !== undefined) {\n\t\t\t\t// For MVP, we otherwise disallow setting properties (mutation is only available via the array node mutation APIs).\n\t\t\t\t// To ensure a clear and actionable error experience, we will throw explicitly here, rather than just returning false.\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"Cannot set indexed properties on array nodes. Use array node mutation APIs to alter the array.\",\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn allowAdditionalProperties ? Reflect.set(target, key, newValue, receiver) : false;\n\t\t},\n\t\thas: (target, key) => {\n\t\t\tconst field = getSequenceField(proxy);\n\t\t\tconst maybeIndex = asIndex(key, field.length);\n\t\t\treturn maybeIndex !== undefined || Reflect.has(dispatchTarget, key);\n\t\t},\n\t\townKeys: (target) => {\n\t\t\tconst field = getSequenceField(proxy);\n\n\t\t\t// TODO: Would a lazy iterator to produce the indexes work / be more efficient?\n\t\t\t// TODO: Need to surface 'Symbol.isConcatSpreadable' as an own key.\n\t\t\tconst keys: (string | symbol)[] = Array.from(\n\t\t\t\t{ length: field.length },\n\t\t\t\t(_, index) => `${index}`,\n\t\t\t);\n\n\t\t\tif (allowAdditionalProperties) {\n\t\t\t\tkeys.push(...Reflect.ownKeys(target));\n\t\t\t} else {\n\t\t\t\tkeys.push(\"length\");\n\t\t\t}\n\t\t\treturn keys;\n\t\t},\n\t\tgetOwnPropertyDescriptor: (target, key) => {\n\t\t\tconst field = getSequenceField(proxy);\n\t\t\tconst maybeIndex = asIndex(key, field.length);\n\t\t\tif (maybeIndex !== undefined) {\n\t\t\t\tconst val = field.at(maybeIndex);\n\t\t\t\t// To satisfy 'deepEquals' level scrutiny, the property descriptor for indexed properties must\n\t\t\t\t// be a simple value property (as opposed to using getter) and declared writable/enumerable/configurable.\n\t\t\t\treturn {\n\t\t\t\t\tvalue: isFlexTreeNode(val) ? getOrCreateNodeFromFlexTreeNode(val) : val,\n\t\t\t\t\twritable: true, // For MVP, setting indexed properties is reported as allowed here (for deep equals compatibility noted above), but not actually supported.\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t};\n\t\t\t} else if (key === \"length\") {\n\t\t\t\t// To satisfy 'deepEquals' level scrutiny, the property descriptor for 'length' must be a simple\n\t\t\t\t// value property (as opposed to using getter) and be declared writable / non-configurable.\n\t\t\t\treturn {\n\t\t\t\t\tvalue: field.length,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn Reflect.getOwnPropertyDescriptor(dispatchTarget, key);\n\t\t},\n\t\tdefineProperty(target, key, attributes) {\n\t\t\tconst maybeIndex = asIndex(key, Number.POSITIVE_INFINITY);\n\t\t\tif (maybeIndex !== undefined) {\n\t\t\t\tthrow new UsageError(\"Shadowing of array indices is not permitted.\");\n\t\t\t}\n\t\t\treturn Reflect.defineProperty(dispatchTarget, key, attributes);\n\t\t},\n\t});\n\treturn proxy;\n}\n\ntype Insertable<T extends ImplicitAllowedTypes> = readonly (\n\t| InsertableTreeNodeFromImplicitAllowedTypes<T>\n\t| IterableTreeArrayContent<InsertableTreeNodeFromImplicitAllowedTypes<T>>\n)[];\n\nabstract class CustomArrayNodeBase<const T extends ImplicitAllowedTypes>\n\textends TreeNodeWithArrayFeatures<\n\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\tTreeNodeFromImplicitAllowedTypes<T>\n\t>\n\timplements TreeArrayNode<T>\n{\n\t// Indexing must be provided by subclass.\n\t[k: number]: TreeNodeFromImplicitAllowedTypes<T>;\n\n\tpublic static readonly kind = NodeKind.Array;\n\n\tprotected abstract get simpleSchema(): T;\n\n\tpublic constructor(\n\t\tinput: Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T>> | InternalTreeNode,\n\t) {\n\t\tsuper(input);\n\t}\n\n\t#mapTreesFromFieldData(value: Insertable<T>): ExclusiveMapTree[] {\n\t\tconst sequenceField = getSequenceField(this);\n\t\tconst content = value as readonly (\n\t\t\t| InsertableContent\n\t\t\t| IterableTreeArrayContent<InsertableContent>\n\t\t)[];\n\n\t\tconst mapTrees = content\n\t\t\t.flatMap((c): InsertableContent[] =>\n\t\t\t\tc instanceof IterableTreeArrayContent ? Array.from(c) : [c],\n\t\t\t)\n\t\t\t.map((c) =>\n\t\t\t\tmapTreeFromNodeData(\n\t\t\t\t\tc,\n\t\t\t\t\tthis.simpleSchema,\n\t\t\t\t\tsequenceField.context?.nodeKeyManager,\n\t\t\t\t\tgetSchemaAndPolicy(sequenceField),\n\t\t\t\t),\n\t\t\t);\n\n\t\tif (sequenceField.context !== undefined) {\n\t\t\tprepareContentForHydration(mapTrees, sequenceField.context.checkout.forest);\n\t\t}\n\n\t\treturn mapTrees;\n\t}\n\n\tpublic toJSON(): unknown {\n\t\t// This override causes the class instance to `JSON.stringify` as `[a, b]` rather than `{0: a, 1: b}`.\n\t\treturn Array.from(this as unknown as TreeArrayNode);\n\t}\n\n\t// Instances of this class are used as the dispatch object for the proxy,\n\t// and thus its set of keys is used to implement `has` (for the `in` operator) for the non-numeric cases.\n\t// Therefore it must include `length`,\n\t// even though this \"length\" is never invoked (due to being shadowed by the proxy provided own property).\n\tpublic get length(): number {\n\t\treturn fail(\"Proxy should intercept length\");\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\treturn this.values();\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic get [Symbol.unscopables]() {\n\t\t// This might not be the exact right set of values, but it only matters for `with` clauses which are deprecated and are banned in strict mode, so it shouldn't matter much.\n\t\t// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with for details.\n\t\treturn Array.prototype[Symbol.unscopables];\n\t}\n\n\tpublic at(\n\t\tthis: TreeArrayNode<T>,\n\t\tindex: number,\n\t): TreeNodeFromImplicitAllowedTypes<T> | undefined {\n\t\tconst field = getSequenceField(this);\n\t\tconst val = field.boxedAt(index);\n\n\t\tif (val === undefined) {\n\t\t\treturn val;\n\t\t}\n\n\t\treturn getOrCreateNodeFromFlexTreeNode(val) as TreeNodeFromImplicitAllowedTypes<T>;\n\t}\n\tpublic insertAt(index: number, ...value: Insertable<T>): void {\n\t\tconst field = getSequenceField(this);\n\t\tvalidateIndex(index, field, \"insertAt\", true);\n\t\tconst content = this.#mapTreesFromFieldData(value);\n\t\tfield.editor.insert(index, content);\n\t}\n\tpublic insertAtStart(...value: Insertable<T>): void {\n\t\tthis.insertAt(0, ...value);\n\t}\n\tpublic insertAtEnd(...value: Insertable<T>): void {\n\t\tthis.insertAt(this.length, ...value);\n\t}\n\tpublic removeAt(index: number): void {\n\t\tconst field = getSequenceField(this);\n\t\tvalidateIndex(index, field, \"removeAt\");\n\t\tfield.editor.remove(index, 1);\n\t}\n\tpublic removeRange(start?: number, end?: number): void {\n\t\tconst field = getSequenceField(this);\n\t\tconst { length } = field;\n\t\tconst removeStart = start ?? 0;\n\t\tconst removeEnd = Math.min(length, end ?? length);\n\t\tvalidatePositiveIndex(removeStart);\n\t\tvalidatePositiveIndex(removeEnd);\n\t\tif (removeEnd < removeStart) {\n\t\t\t// This catches both the case where start is > array.length and when start is > end.\n\t\t\tthrow new UsageError('Too large of \"start\" value passed to TreeArrayNode.removeRange.');\n\t\t}\n\t\tfield.editor.remove(removeStart, removeEnd - removeStart);\n\t}\n\tpublic moveToStart(sourceIndex: number, source?: TreeArrayNode): void {\n\t\tconst sourceArray = source ?? this;\n\t\tconst sourceField = getSequenceField(sourceArray);\n\t\tvalidateIndex(sourceIndex, sourceField, \"moveToStart\");\n\t\tthis.moveRangeToIndex(0, sourceIndex, sourceIndex + 1, source);\n\t}\n\tpublic moveToEnd(sourceIndex: number, source?: TreeArrayNode): void {\n\t\tconst sourceArray = source ?? this;\n\t\tconst sourceField = getSequenceField(sourceArray);\n\t\tvalidateIndex(sourceIndex, sourceField, \"moveToEnd\");\n\t\tthis.moveRangeToIndex(this.length, sourceIndex, sourceIndex + 1, source);\n\t}\n\tpublic moveToIndex(\n\t\tdestinationIndex: number,\n\t\tsourceIndex: number,\n\t\tsource?: TreeArrayNode,\n\t): void {\n\t\tconst sourceArray = source ?? this;\n\t\tconst sourceField = getSequenceField(sourceArray);\n\t\tconst destinationField = getSequenceField(this);\n\t\tvalidateIndex(destinationIndex, destinationField, \"moveToIndex\", true);\n\t\tvalidateIndex(sourceIndex, sourceField, \"moveToIndex\");\n\t\tthis.moveRangeToIndex(destinationIndex, sourceIndex, sourceIndex + 1, source);\n\t}\n\tpublic moveRangeToStart(\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource?: TreeArrayNode,\n\t): void {\n\t\tvalidateIndexRange(\n\t\t\tsourceStart,\n\t\t\tsourceEnd,\n\t\t\tsource ?? getSequenceField(this),\n\t\t\t\"moveRangeToStart\",\n\t\t);\n\t\tthis.moveRangeToIndex(0, sourceStart, sourceEnd, source);\n\t}\n\tpublic moveRangeToEnd(sourceStart: number, sourceEnd: number, source?: TreeArrayNode): void {\n\t\tvalidateIndexRange(\n\t\t\tsourceStart,\n\t\t\tsourceEnd,\n\t\t\tsource ?? getSequenceField(this),\n\t\t\t\"moveRangeToEnd\",\n\t\t);\n\t\tthis.moveRangeToIndex(this.length, sourceStart, sourceEnd, source);\n\t}\n\tpublic moveRangeToIndex(\n\t\tdestinationIndex: number,\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource?: TreeArrayNode,\n\t): void {\n\t\tconst destinationField = getSequenceField(this);\n\t\tconst sourceField = source !== undefined ? getSequenceField(source) : destinationField;\n\n\t\tvalidateIndex(destinationIndex, destinationField, \"moveRangeToIndex\", true);\n\t\tvalidateIndexRange(sourceStart, sourceEnd, source ?? destinationField, \"moveRangeToIndex\");\n\n\t\t// TODO: determine support for move across different sequence types\n\t\tif (destinationField.schema.types !== undefined && sourceField !== destinationField) {\n\t\t\tfor (let i = sourceStart; i < sourceEnd; i++) {\n\t\t\t\tconst sourceNode = sourceField.boxedAt(i) ?? oob();\n\t\t\t\tif (!destinationField.schema.types.has(sourceNode.schema.name)) {\n\t\t\t\t\tthrow new UsageError(\"Type in source sequence is not allowed in destination.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst movedCount = sourceEnd - sourceStart;\n\t\tif (destinationField.context === undefined) {\n\t\t\tif (!isMapTreeSequenceField(sourceField)) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"Cannot move elements from an inserted array to an array that has not yet been inserted\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (sourceField !== destinationField || destinationIndex < sourceStart) {\n\t\t\t\tdestinationField.editor.insert(\n\t\t\t\t\tdestinationIndex,\n\t\t\t\t\tsourceField.editor.remove(sourceStart, movedCount),\n\t\t\t\t);\n\t\t\t} else if (destinationIndex > sourceStart + movedCount) {\n\t\t\t\tdestinationField.editor.insert(\n\t\t\t\t\tdestinationIndex - movedCount,\n\t\t\t\t\tsourceField.editor.remove(sourceStart, movedCount),\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tif (sourceField.context === undefined) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"Cannot move elements from an array that has not yet been inserted to an inserted array\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tdestinationField.context.checkout.editor.move(\n\t\t\t\tsourceField.getFieldPath(),\n\t\t\t\tsourceStart,\n\t\t\t\tmovedCount,\n\t\t\t\tdestinationField.getFieldPath(),\n\t\t\t\tdestinationIndex,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\treturn this.generateValues(getKernel(this).generationNumber);\n\t}\n\tprivate *generateValues(\n\t\tinitialLastUpdatedStamp: number,\n\t): Generator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\tif (initialLastUpdatedStamp !== getKernel(this).generationNumber) {\n\t\t\tthrow new UsageError(`Concurrent editing and iteration is not allowed.`);\n\t\t}\n\t\tfor (let i = 0; i < this.length; i++) {\n\t\t\tyield this.at(i) ?? fail(\"Index is out of bounds\");\n\t\t\tif (initialLastUpdatedStamp !== getKernel(this).generationNumber) {\n\t\t\t\tthrow new UsageError(`Concurrent editing and iteration is not allowed.`);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n *\n * @param name - Unique identifier for this schema including the factory's scope.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function arraySchema<\n\tTName extends string,\n\tconst T extends ImplicitAllowedTypes,\n\tconst ImplicitlyConstructable extends boolean,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tcustomizable: boolean,\n) {\n\ttype Output = TreeNodeSchemaClass<\n\t\tTName,\n\t\tNodeKind.Array,\n\t\tTreeArrayNode<T> & WithType<TName, NodeKind.Array>,\n\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\tImplicitlyConstructable,\n\t\tT\n\t>;\n\tlet flexSchema: FlexTreeNodeSchema;\n\n\t// This class returns a proxy from its constructor to handle numeric indexing.\n\t// Alternatively it could extend a normal class which gets tons of numeric properties added.\n\tclass schema extends CustomArrayNodeBase<T> {\n\t\tpublic static override prepareInstance<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tflexNode: FlexTreeNode,\n\t\t): TreeNodeValid<T2> {\n\t\t\tconst proxyTarget = customizable ? instance : [];\n\n\t\t\tif (customizable) {\n\t\t\t\t// Since proxy reports this as a \"non-configurable\" property, it must exist on the underlying object used as the proxy target, not as an inherited property.\n\t\t\t\t// This should not get used as the proxy should intercept all use.\n\t\t\t\tObject.defineProperty(instance, \"length\", {\n\t\t\t\t\tvalue: NaN,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn createArrayNodeProxy(customizable, proxyTarget, instance) as unknown as schema;\n\t\t}\n\n\t\tpublic static override buildRawNode<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tinput: T2,\n\t\t): MapTreeNode {\n\t\t\treturn getOrCreateMapTreeNode(\n\t\t\t\tflexSchema,\n\t\t\t\tmapTreeFromNodeData(input as object, this as unknown as ImplicitAllowedTypes),\n\t\t\t);\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup<T2>(this: typeof TreeNodeValid<T2>): void {\n\t\t\tflexSchema = getFlexSchema(this as unknown as TreeNodeSchema);\n\n\t\t\t// First run, do extra validation.\n\t\t\t// TODO: provide a way for TreeConfiguration to trigger this same validation to ensure it gets run early.\n\t\t\t// Scan for shadowing inherited members which won't work, but stop scan early to allow shadowing built in (which seems to work ok).\n\t\t\t{\n\t\t\t\tlet prototype: object = this.prototype;\n\t\t\t\t// There isn't a clear cleaner way to author this loop.\n\t\t\t\twhile (prototype !== schema.prototype) {\n\t\t\t\t\t// Search prototype keys and check for positive integers. Throw if any are found.\n\t\t\t\t\t// Shadowing of index properties on array nodes is not supported.\n\t\t\t\t\tfor (const key of Object.getOwnPropertyNames(prototype)) {\n\t\t\t\t\t\tconst maybeIndex = asIndex(key, Number.POSITIVE_INFINITY);\n\t\t\t\t\t\tif (maybeIndex !== undefined) {\n\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t`Schema ${identifier} defines an inherited index property \"${key.toString()}\" which shadows a possible array index. Shadowing of array indices is not permitted.`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Since this stops at the array node base schema, it should never see a null prototype, so this case is safe.\n\t\t\t\t\t// Additionally, if the prototype chain is ever messed up such that the array base schema is not in it,\n\t\t\t\t\t// the null that would show up here does at least ensure this code throws instead of hanging.\n\t\t\t\t\tprototype = Reflect.getPrototypeOf(prototype) as object;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: ImplicitlyConstructable =\n\t\t\timplicitlyConstructable;\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): Output {\n\t\t\treturn schema.constructorCached?.constructor as unknown as Output;\n\t\t}\n\n\t\tprotected get simpleSchema(): T {\n\t\t\treturn info;\n\t\t}\n\t}\n\n\tconst output: Output = schema;\n\treturn output;\n}\n\nfunction validateSafeInteger(index: number): void {\n\tif (!Number.isSafeInteger(index)) {\n\t\tthrow new UsageError(`Expected a safe integer, got ${index}.`);\n\t}\n}\n\nfunction validatePositiveIndex(index: number): void {\n\tvalidateSafeInteger(index);\n\tif (index < 0) {\n\t\tthrow new UsageError(`Expected non-negative index, got ${index}.`);\n\t}\n}\n\nfunction validateIndex(\n\tindex: number,\n\tarray: { readonly length: number },\n\tmethodName: string,\n\tallowOnePastEnd: boolean = false,\n): void {\n\tvalidatePositiveIndex(index);\n\tif (allowOnePastEnd) {\n\t\tif (index > array.length) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Index value passed to TreeArrayNode.${methodName} is out of bounds.`,\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (index >= array.length) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Index value passed to TreeArrayNode.${methodName} is out of bounds.`,\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction validateIndexRange(\n\tstartIndex: number,\n\tendIndex: number,\n\tarray: { readonly length: number },\n\tmethodName: string,\n): void {\n\tvalidateIndex(startIndex, array, methodName, true);\n\tvalidateIndex(endIndex, array, methodName, true);\n\tif (startIndex > endIndex || array.length < endIndex) {\n\t\tthrow new UsageError(\n\t\t\t`Index value passed to TreeArrayNode.${methodName} is out of bounds.`,\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"arrayNode.js","sourceRoot":"","sources":["../../src/simple-tree/arrayNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;AAEH,kEAA0D;AAC1D,uEAAsE;AAEtE,+CAAmE;AACnE,4DAUuC;AACvC,6CAA2F;AAC3F,uDAAyD;AAUzD,8CAUyB;AACzB,iDAA6E;AAC7E,+CAAwC;AACxC,uDAAgE;AAChE,8CAA4C;AAC5C,yDAAyE;AAkMzE;;;GAGG;AACU,QAAA,aAAa,GAAG;IAC5B;;;;;;;;;OASG;IACH,MAAM,EAAE,CAAI,OAAoB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;CAC3C,CAAC;AAEX;;;GAGG;AACH,IAAI,MAAgE,CAAC;AAErE;;;;GAIG;AACH,MAAa,wBAAwB;IAKpC,YAAqC,OAAoB;QAApB,YAAO,GAAP,OAAO,CAAa;IAAG,CAAC;IAE7D;;OAEG;IACI,CAAC,MAAM,CAAC,QAAQ,CAAC;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACxC,CAAC;CACD;AAbD,4DAaC;AAZA;IACC,MAAM,GAAG,CAAK,OAAqB,EAAE,EAAE,CAAC,IAAI,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAC/E,CAAC,GAAA,CAAA;AAYF;;GAEG;AACH,SAAS,gBAAgB,CACxB,SAAqC;IAErC,OAAO,IAAA,sCAAoB,EAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,mBAAQ,CAA0B,CAAC;AACpF,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E,IAAI,CAAC,CAAC;IACjD,IAAI,UAAU,GAAG,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,QAAQ,EAAE,CAAC;QACtD,MAAM,IAAI,qBAAU,CACnB,uCAAuC,UAAU,oBAAoB,CACrE,CAAC;IACH,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { oob } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { EmptyKey, type ExclusiveMapTree } from \"../core/index.js\";\nimport {\n\ttype FlexTreeNodeSchema,\n\ttype FlexTreeNode,\n\ttype FlexTreeSequenceField,\n\ttype MapTreeNode,\n\tgetOrCreateMapTreeNode,\n\tgetSchemaAndPolicy,\n\tisFlexTreeNode,\n\tisMapTreeSequenceField,\n\tUnhydratedContext,\n} from \"../feature-libraries/index.js\";\nimport { getOrCreateNodeFromFlexTreeNode, prepareContentForHydration } from \"./proxies.js\";\nimport { getOrCreateInnerNode } from \"./proxyBinding.js\";\n// This import seems to trigger a false positive `Type import \"TreeNodeFromImplicitAllowedTypes\" is used by decorator metadata` lint error.\n// Other ways to import (ex: import the module with the items as type imports) give different more real errors, and auto fix to this format,\n// so there does not seem to be a clean workaround to make the linter happy.\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport type {\n\tImplicitAllowedTypes,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n\tTreeNodeFromImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport {\n\ttype WithType,\n\t// eslint-disable-next-line import/no-deprecated\n\ttypeNameSymbol,\n\tNodeKind,\n\ttype TreeNode,\n\ttype InternalTreeNode,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchema,\n\ttypeSchemaSymbol,\n} from \"./core/index.js\";\nimport { type InsertableContent, mapTreeFromNodeData } from \"./toMapTree.js\";\nimport { fail } from \"../util/index.js\";\nimport { getFlexSchema, toFlexSchema } from \"./toFlexSchema.js\";\nimport { getKernel } from \"./core/index.js\";\nimport { TreeNodeValid, type MostDerivedData } from \"./treeNodeValid.js\";\n\n/**\n * A generic array type, used to defined types like {@link (TreeArrayNode:interface)}.\n *\n * @privateRemarks\n * Inlining this into TreeArrayNode causes recursive array use to stop compiling.\n *\n * @system @sealed @public\n */\nexport interface TreeArrayNodeBase<out T, in TNew, in TMoveFrom>\n\textends ReadonlyArray<T>,\n\t\tTreeNode {\n\t/**\n\t * Inserts new item(s) at a specified location.\n\t * @param index - The index at which to insert `value`.\n\t * @param value - The content to insert.\n\t * @throws Throws if `index` is not in the range [0, `array.length`).\n\t */\n\tinsertAt(index: number, ...value: readonly (TNew | IterableTreeArrayContent<TNew>)[]): void;\n\n\t/**\n\t * Inserts new item(s) at the start of the array.\n\t * @param value - The content to insert.\n\t */\n\tinsertAtStart(...value: readonly (TNew | IterableTreeArrayContent<TNew>)[]): void;\n\n\t/**\n\t * Inserts new item(s) at the end of the array.\n\t * @param value - The content to insert.\n\t */\n\tinsertAtEnd(...value: readonly (TNew | IterableTreeArrayContent<TNew>)[]): void;\n\n\t/**\n\t * Removes the item at the specified location.\n\t * @param index - The index at which to remove the item.\n\t * @throws Throws if `index` is not in the range [0, `array.length`).\n\t */\n\tremoveAt(index: number): void;\n\n\t/**\n\t * Removes all items between the specified indices.\n\t * @param start - The starting index of the range to remove (inclusive). Defaults to the start of the array.\n\t * @param end - The ending index of the range to remove (exclusive). Defaults to `array.length`.\n\t * @throws Throws if `start` is not in the range [0, `array.length`].\n\t * @throws Throws if `end` is less than `start`.\n\t * If `end` is not supplied or is greater than the length of the array, all items after `start` are removed.\n\t *\n\t * @remarks\n\t * The default values for start and end are computed when this is called,\n\t * and thus the behavior is the same as providing them explicitly, even with respect to merge resolution with concurrent edits.\n\t * For example, two concurrent transactions both emptying the array with `node.removeRange()` then inserting an item,\n\t * will merge to result in the array having both inserted items.\n\t */\n\tremoveRange(start?: number, end?: number): void;\n\n\t/**\n\t * Moves the specified item to the start of the array.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `array.length`).\n\t */\n\tmoveToStart(sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the start of the array.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source array to move the item out of.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `array.length`).\n\t */\n\tmoveToStart(sourceIndex: number, source: TMoveFrom): void;\n\n\t/**\n\t * Moves the specified item to the end of the array.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `array.length`).\n\t */\n\tmoveToEnd(sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the end of the array.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source array to move the item out of.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `array.length`).\n\t */\n\tmoveToEnd(sourceIndex: number, source: TMoveFrom): void;\n\n\t/**\n\t * Moves the specified item to the desired location in the array.\n\t * @param index - The index to move the item to.\n\t * This is based on the state of the array before moving the source item.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if any of the input indices are not in the range [0, `array.length`).\n\t */\n\tmoveToIndex(index: number, sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the desired location in the array.\n\t * @param index - The index to move the item to in the range [0, `array.length`].\n\t * This is based on the state of the array before moving the source item.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source array to move the item out of.\n\t * @throws Throws if any of the source index is not in the range [0, `array.length`),\n\t * or if the index is not in the range [0, `array.length`].\n\t */\n\tmoveToIndex(index: number, sourceIndex: number, source: TMoveFrom): void;\n\n\t/**\n\t * Moves the specified items to the start of the array.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if either of the input indices are not in the range [0, `array.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.\n\t */\n\tmoveRangeToStart(sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the start of the array.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source array to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination array,\n\t * if either of the input indices are not in the range [0, `array.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.\n\t */\n\tmoveRangeToStart(sourceStart: number, sourceEnd: number, source: TMoveFrom): void;\n\n\t/**\n\t * Moves the specified items to the end of the array.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if either of the input indices are not in the range [0, `array.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.\n\t */\n\tmoveRangeToEnd(sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the end of the array.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source array to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination array,\n\t * if either of the input indices are not in the range [0, `array.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.\n\t */\n\tmoveRangeToEnd(sourceStart: number, sourceEnd: number, source: TMoveFrom): void;\n\n\t/**\n\t * Moves the specified items to the desired location within the array.\n\t * @param index - The index to move the items to.\n\t * This is based on the state of the array before moving the source items.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if any of the input indices are not in the range [0, `array.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.\n\t */\n\tmoveRangeToIndex(index: number, sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the desired location within the array.\n\t * @param index - The index to move the items to.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source array to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination array,\n\t * if any of the input indices are not in the range [0, `array.length`], or if `sourceStart` is greater than `sourceEnd`.\n\t */\n\tmoveRangeToIndex(\n\t\tindex: number,\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource: TMoveFrom,\n\t): void;\n\n\t/**\n\t * Returns a custom IterableIterator which throws usage errors if concurrent editing and iteration occurs.\n\t */\n\tvalues(): IterableIterator<T>;\n}\n\n/**\n * A {@link TreeNode} which implements 'readonly T[]' and the array mutation APIs.\n *\n * @typeParam TAllowedTypes - Schema for types which are allowed as members of this array.\n *\n * @sealed @public\n */\nexport interface TreeArrayNode<\n\tTAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n> extends TreeArrayNodeBase<\n\t\tTreeNodeFromImplicitAllowedTypes<TAllowedTypes>,\n\t\tInsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes>,\n\t\tTreeArrayNode\n\t> {}\n\n/**\n * A {@link TreeNode} which implements 'readonly T[]' and the array mutation APIs.\n * @public\n */\nexport const TreeArrayNode = {\n\t/**\n\t * Wrap an iterable of items to inserted as consecutive items in a array.\n\t * @remarks\n\t * The object returned by this function can be inserted into a {@link (TreeArrayNode:interface)}.\n\t * Its contents will be inserted consecutively in the corresponding location in the array.\n\t * @example\n\t * ```ts\n\t * array.insertAtEnd(TreeArrayNode.spread(iterable))\n\t * ```\n\t */\n\tspread: <T>(content: Iterable<T>) => create(content),\n} as const;\n\n/**\n * Package internal construction API.\n * Use {@link (TreeArrayNode:variable).spread} to create an instance of this type instead.\n */\nlet create: <T>(content: Iterable<T>) => IterableTreeArrayContent<T>;\n\n/**\n * Used to insert iterable content into a {@link (TreeArrayNode:interface)}.\n * Use {@link (TreeArrayNode:variable).spread} to create an instance of this type.\n * @sealed @public\n */\nexport class IterableTreeArrayContent<T> implements Iterable<T> {\n\tstatic {\n\t\tcreate = <T2>(content: Iterable<T2>) => new IterableTreeArrayContent(content);\n\t}\n\n\tprivate constructor(private readonly content: Iterable<T>) {}\n\n\t/**\n\t * Iterates over content for nodes to insert.\n\t */\n\tpublic [Symbol.iterator](): Iterator<T> {\n\t\treturn this.content[Symbol.iterator]();\n\t}\n}\n\n/**\n * Given a array node proxy, returns its underlying LazySequence field.\n */\nfunction getSequenceField<TSimpleType extends ImplicitAllowedTypes>(\n\tarrayNode: TreeArrayNode<TSimpleType>,\n): FlexTreeSequenceField {\n\treturn getOrCreateInnerNode(arrayNode).getBoxed(EmptyKey) as FlexTreeSequenceField;\n}\n\n// For compatibility, we are initially implement 'readonly T[]' by applying the Array.prototype methods\n// to the array node proxy. Over time, we should replace these with efficient implementations on LazySequence\n// to avoid re-entering the proxy as these methods access 'length' and the indexed properties.\n//\n// For brevity, the current implementation dynamically builds a property descriptor map from a list of\n// Array functions we want to re-expose via the proxy.\n\nconst arrayPrototypeKeys = [\n\t\"concat\",\n\t\"entries\",\n\t\"every\",\n\t\"filter\",\n\t\"find\",\n\t\"findIndex\",\n\t\"flat\",\n\t\"flatMap\",\n\t\"forEach\",\n\t\"includes\",\n\t\"indexOf\",\n\t\"join\",\n\t\"keys\",\n\t\"lastIndexOf\",\n\t\"map\",\n\t\"reduce\",\n\t\"reduceRight\",\n\t\"slice\",\n\t\"some\",\n\t\"toLocaleString\",\n\t\"toString\",\n\n\t// \"copyWithin\",\n\t// \"fill\",\n\t// \"length\",\n\t// \"pop\",\n\t// \"push\",\n\t// \"reverse\",\n\t// \"shift\",\n\t// \"sort\",\n\t// \"splice\",\n\t// \"unshift\",\n] as const;\n\n/**\n * {@link TreeNodeValid}, but modified to add members from Array.prototype named in {@link arrayPrototypeKeys}.\n * @privateRemarks\n * Since a lot of scratch types and values are involved with creating this,\n * it's generating using an immediately invoked function expression (IIFE).\n * This is a common JavaScript pattern for cases like this to avoid cluttering the scope.\n */\nconst TreeNodeWithArrayFeatures = (() => {\n\t/**\n\t * {@link TreeNodeValid}, but modified to add members from Array.prototype named in {@link arrayPrototypeKeys}.\n\t */\n\tabstract class TreeNodeWithArrayFeaturesUntyped<\n\t\tconst T extends ImplicitAllowedTypes,\n\t> extends TreeNodeValid<Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>> {}\n\n\t// Modify TreeNodeWithArrayFeaturesUntyped to add the members from Array.prototype\n\tarrayPrototypeKeys.forEach((key) => {\n\t\tObject.defineProperty(TreeNodeWithArrayFeaturesUntyped.prototype, key, {\n\t\t\tvalue: Array.prototype[key],\n\t\t});\n\t});\n\n\treturn TreeNodeWithArrayFeaturesUntyped as unknown as typeof NodeWithArrayFeatures;\n})();\n\n/**\n * Type of {@link TreeNodeValid}, but with array members added to the instance type.\n *\n * TypeScript has a rule that `Base constructors must all have the same return type.ts(2510)`.\n * This means that intersecting two types with different constructors to create a type with a more constrained constructor (ex: more specific return type)\n * is not supported.\n *\n * TypeScript also has a limitation that there is no way to replace or remove just the constructor of a type without losing all the private and protected members.\n * See https://github.com/microsoft/TypeScript/issues/35416 for details.\n *\n * TypeScript also does not support explicitly specifying the instance type in a class definition as the constructor return type.\n *\n * Thus to replace the instance type, while preserving the protected static members of TreeNodeValid,\n * the only option seems to be actually declaring a class with all the members explicitly inline.\n *\n * To avoid incurring any bundle size / runtime overhead from this and having to stub out the function bodies,\n * the class uses `declare`.\n * TypeScript does not support `declare` inside scopes, so this is not inside the function scope above.\n *\n * The members of this class were generated using the \"implement interface\" refactoring.\n * Since that refactoring does not add `public`, the lint to require it is disabled for this section of the file.\n * To update this class delete all members and reapply the \"implement interface\" refactoring.\n * As these signatures get formatted to be over three times as many lines with prettier (which is not helpful), it is also suppressed.\n */\n/* eslint-disable @typescript-eslint/explicit-member-accessibility, @typescript-eslint/no-explicit-any */\n// prettier-ignore\ndeclare abstract class NodeWithArrayFeatures<Input, T>\n\textends TreeNodeValid<Input>\n\timplements Pick<readonly T[], (typeof arrayPrototypeKeys)[number]>\n{\n\tconcat(...items: ConcatArray<T>[]): T[];\n\tconcat(...items: (T | ConcatArray<T>)[]): T[];\n\tentries(): IterableIterator<[number, T]>;\n\tevery<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any,\n\t): this is readonly S[];\n\tevery(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any,\n\t): boolean;\n\tfilter<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any,\n\t): S[];\n\tfilter(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any,\n\t): T[];\n\tfind<S extends T>(\n\t\tpredicate: (value: T, index: number, obj: readonly T[]) => value is S,\n\t\tthisArg?: any,\n\t): S | undefined;\n\tfind(\n\t\tpredicate: (value: T, index: number, obj: readonly T[]) => unknown,\n\t\tthisArg?: any,\n\t): T | undefined;\n\tfindIndex(\n\t\tpredicate: (value: T, index: number, obj: readonly T[]) => unknown,\n\t\tthisArg?: any,\n\t): number;\n\tflat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];\n\tflatMap<U, This = undefined>(\n\t\tcallback: (this: This, value: T, index: number, array: T[]) => U | readonly U[],\n\t\tthisArg?: This | undefined,\n\t): U[];\n\tforEach(\n\t\tcallbackfn: (value: T, index: number, array: readonly T[]) => void,\n\t\tthisArg?: any,\n\t): void;\n\tincludes(searchElement: T, fromIndex?: number | undefined): boolean;\n\tindexOf(searchElement: T, fromIndex?: number | undefined): number;\n\tjoin(separator?: string | undefined): string;\n\tkeys(): IterableIterator<number>;\n\tlastIndexOf(searchElement: T, fromIndex?: number | undefined): number;\n\tmap<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[];\n\treduce(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: T,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[],\n\t\t) => T,\n\t): T;\n\treduce(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: T,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[],\n\t\t) => T,\n\t\tinitialValue: T,\n\t): T;\n\treduce<U>(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: U,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[],\n\t\t) => U,\n\t\tinitialValue: U,\n\t): U;\n\treduceRight(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: T,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[],\n\t\t) => T,\n\t): T;\n\treduceRight(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: T,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[],\n\t\t) => T,\n\t\tinitialValue: T,\n\t): T;\n\treduceRight<U>(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: U,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[],\n\t\t) => U,\n\t\tinitialValue: U,\n\t): U;\n\tslice(start?: number | undefined, end?: number | undefined): T[];\n\tsome(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any,\n\t): boolean;\n\ttoLocaleString(): string;\n\ttoString(): string;\n}\n/* eslint-enable @typescript-eslint/explicit-member-accessibility, @typescript-eslint/no-explicit-any */\n\n/**\n * Attempts to coerce the given property key to an integer index property.\n * @param key - The property key to coerce.\n * @param exclusiveMax - This restricts the range in which the resulting index is allowed to be.\n * The coerced index of `key` must be less than `exclusiveMax` or else this function will return `undefined`.\n * This is useful for reading an array within the bounds of its length, e.g. `asIndex(key, array.length)`.\n */\nexport function asIndex(key: string | symbol, exclusiveMax: number): number | undefined {\n\tif (typeof key !== \"string\") {\n\t\treturn undefined;\n\t}\n\n\t// TODO: It may be worth a '0' <= ch <= '9' check before calling 'Number' to quickly\n\t// reject 'length' as an index, or even parsing integers ourselves.\n\tconst asNumber = Number(key);\n\tif (!Number.isInteger(asNumber)) {\n\t\treturn undefined;\n\t}\n\n\t// Check that the original string is the same after converting to a number and back again.\n\t// This prevents keys like \"5.0\", \"0x5\", \" 5\" from coercing to 5, and keys like \" \" or \"\" from coercing to 0.\n\tconst asString = String(asNumber);\n\tif (asString !== key) {\n\t\treturn undefined;\n\t}\n\n\t// TODO: See 'matrix/range.ts' for fast integer coercing + range check.\n\treturn 0 <= asNumber && asNumber < exclusiveMax ? asNumber : undefined;\n}\n\n/**\n * @param allowAdditionalProperties - If true, setting of unexpected properties will be forwarded to the target object.\n * Otherwise setting of unexpected properties will error.\n * @param proxyTarget - Target object of the proxy. Must provide an own `length` value property\n * (which is not used but must exist for getOwnPropertyDescriptor invariants) and the array functionality from {@link arrayNodePrototype}.\n * Controls the prototype exposed by the produced proxy.\n * @param dispatchTarget - provides the functionally of the node, implementing all fields.\n */\nfunction createArrayNodeProxy(\n\tallowAdditionalProperties: boolean,\n\tproxyTarget: object,\n\tdispatchTarget: object,\n): TreeArrayNode {\n\t// To satisfy 'deepEquals' level scrutiny, the target of the proxy must be an array literal in order\n\t// to pass 'Object.getPrototypeOf'. It also satisfies 'Array.isArray' and 'Object.prototype.toString'\n\t// requirements without use of Array[Symbol.species], which is potentially on a path ot deprecation.\n\tconst proxy: TreeArrayNode = new Proxy<TreeArrayNode>(proxyTarget as TreeArrayNode, {\n\t\tget: (target, key, receiver) => {\n\t\t\tconst field = getSequenceField(receiver);\n\t\t\tconst maybeIndex = asIndex(key, field.length);\n\n\t\t\tif (maybeIndex === undefined) {\n\t\t\t\tif (key === \"length\") {\n\t\t\t\t\treturn field.length;\n\t\t\t\t}\n\n\t\t\t\t// Pass the proxy as the receiver here, so that any methods on\n\t\t\t\t// the prototype receive `proxy` as `this`.\n\t\t\t\treturn Reflect.get(dispatchTarget, key, receiver) as unknown;\n\t\t\t}\n\n\t\t\tconst maybeContent = field.at(maybeIndex);\n\t\t\treturn isFlexTreeNode(maybeContent)\n\t\t\t\t? getOrCreateNodeFromFlexTreeNode(maybeContent)\n\t\t\t\t: maybeContent;\n\t\t},\n\t\tset: (target, key, newValue, receiver) => {\n\t\t\tif (key === \"length\") {\n\t\t\t\t// To allow \"length\" to look like \"length\" on an array, getOwnPropertyDescriptor has to report it as a writable value.\n\t\t\t\t// This means the proxy target must provide a length value, but since it can't use getters and setters, it can't be correct.\n\t\t\t\t// Therefor length has to be handled in this proxy.\n\t\t\t\t// Since it's not actually mutable, return false so setting it will produce a type error.\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// 'Symbol.isConcatSpreadable' may be set on an Array instance to modify the behavior of\n\t\t\t// the concat method. We allow this property to be added to the dispatch object.\n\t\t\tif (key === Symbol.isConcatSpreadable) {\n\t\t\t\treturn Reflect.set(dispatchTarget, key, newValue, receiver);\n\t\t\t}\n\n\t\t\t// Array nodes treat all non-negative integer indexes as array access.\n\t\t\t// Using Infinity here (rather than length) ensures that indexing past the end doesn't create additional session local properties.\n\t\t\tconst maybeIndex = asIndex(key, Number.POSITIVE_INFINITY);\n\t\t\tif (maybeIndex !== undefined) {\n\t\t\t\t// For MVP, we otherwise disallow setting properties (mutation is only available via the array node mutation APIs).\n\t\t\t\t// To ensure a clear and actionable error experience, we will throw explicitly here, rather than just returning false.\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"Cannot set indexed properties on array nodes. Use array node mutation APIs to alter the array.\",\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn allowAdditionalProperties ? Reflect.set(target, key, newValue, receiver) : false;\n\t\t},\n\t\thas: (target, key) => {\n\t\t\tconst field = getSequenceField(proxy);\n\t\t\tconst maybeIndex = asIndex(key, field.length);\n\t\t\treturn maybeIndex !== undefined || Reflect.has(dispatchTarget, key);\n\t\t},\n\t\townKeys: (target) => {\n\t\t\tconst field = getSequenceField(proxy);\n\n\t\t\t// TODO: Would a lazy iterator to produce the indexes work / be more efficient?\n\t\t\t// TODO: Need to surface 'Symbol.isConcatSpreadable' as an own key.\n\t\t\tconst keys: (string | symbol)[] = Array.from(\n\t\t\t\t{ length: field.length },\n\t\t\t\t(_, index) => `${index}`,\n\t\t\t);\n\n\t\t\tif (allowAdditionalProperties) {\n\t\t\t\tkeys.push(...Reflect.ownKeys(target));\n\t\t\t} else {\n\t\t\t\tkeys.push(\"length\");\n\t\t\t}\n\t\t\treturn keys;\n\t\t},\n\t\tgetOwnPropertyDescriptor: (target, key) => {\n\t\t\tconst field = getSequenceField(proxy);\n\t\t\tconst maybeIndex = asIndex(key, field.length);\n\t\t\tif (maybeIndex !== undefined) {\n\t\t\t\tconst val = field.at(maybeIndex);\n\t\t\t\t// To satisfy 'deepEquals' level scrutiny, the property descriptor for indexed properties must\n\t\t\t\t// be a simple value property (as opposed to using getter) and declared writable/enumerable/configurable.\n\t\t\t\treturn {\n\t\t\t\t\tvalue: isFlexTreeNode(val) ? getOrCreateNodeFromFlexTreeNode(val) : val,\n\t\t\t\t\twritable: true, // For MVP, setting indexed properties is reported as allowed here (for deep equals compatibility noted above), but not actually supported.\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t};\n\t\t\t} else if (key === \"length\") {\n\t\t\t\t// To satisfy 'deepEquals' level scrutiny, the property descriptor for 'length' must be a simple\n\t\t\t\t// value property (as opposed to using getter) and be declared writable / non-configurable.\n\t\t\t\treturn {\n\t\t\t\t\tvalue: field.length,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn Reflect.getOwnPropertyDescriptor(dispatchTarget, key);\n\t\t},\n\t\tdefineProperty(target, key, attributes) {\n\t\t\tconst maybeIndex = asIndex(key, Number.POSITIVE_INFINITY);\n\t\t\tif (maybeIndex !== undefined) {\n\t\t\t\tthrow new UsageError(\"Shadowing of array indices is not permitted.\");\n\t\t\t}\n\t\t\treturn Reflect.defineProperty(dispatchTarget, key, attributes);\n\t\t},\n\t});\n\treturn proxy;\n}\n\ntype Insertable<T extends ImplicitAllowedTypes> = readonly (\n\t| InsertableTreeNodeFromImplicitAllowedTypes<T>\n\t| IterableTreeArrayContent<InsertableTreeNodeFromImplicitAllowedTypes<T>>\n)[];\n\nabstract class CustomArrayNodeBase<const T extends ImplicitAllowedTypes>\n\textends TreeNodeWithArrayFeatures<\n\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\tTreeNodeFromImplicitAllowedTypes<T>\n\t>\n\timplements TreeArrayNode<T>\n{\n\t// Indexing must be provided by subclass.\n\t[k: number]: TreeNodeFromImplicitAllowedTypes<T>;\n\n\tpublic static readonly kind = NodeKind.Array;\n\n\tprotected abstract get simpleSchema(): T;\n\n\tpublic constructor(\n\t\tinput: Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T>> | InternalTreeNode,\n\t) {\n\t\tsuper(input);\n\t}\n\n\t#mapTreesFromFieldData(value: Insertable<T>): ExclusiveMapTree[] {\n\t\tconst sequenceField = getSequenceField(this);\n\t\tconst content = value as readonly (\n\t\t\t| InsertableContent\n\t\t\t| IterableTreeArrayContent<InsertableContent>\n\t\t)[];\n\n\t\tconst mapTrees = content\n\t\t\t.flatMap((c): InsertableContent[] =>\n\t\t\t\tc instanceof IterableTreeArrayContent ? Array.from(c) : [c],\n\t\t\t)\n\t\t\t.map((c) =>\n\t\t\t\tmapTreeFromNodeData(\n\t\t\t\t\tc,\n\t\t\t\t\tthis.simpleSchema,\n\t\t\t\t\tsequenceField.context.isHydrated()\n\t\t\t\t\t\t? sequenceField.context.nodeKeyManager\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tgetSchemaAndPolicy(sequenceField),\n\t\t\t\t),\n\t\t\t);\n\n\t\tif (sequenceField.context.isHydrated()) {\n\t\t\tprepareContentForHydration(mapTrees, sequenceField.context.checkout.forest);\n\t\t}\n\n\t\treturn mapTrees;\n\t}\n\n\tpublic toJSON(): unknown {\n\t\t// This override causes the class instance to `JSON.stringify` as `[a, b]` rather than `{0: a, 1: b}`.\n\t\treturn Array.from(this as unknown as TreeArrayNode);\n\t}\n\n\t// Instances of this class are used as the dispatch object for the proxy,\n\t// and thus its set of keys is used to implement `has` (for the `in` operator) for the non-numeric cases.\n\t// Therefore it must include `length`,\n\t// even though this \"length\" is never invoked (due to being shadowed by the proxy provided own property).\n\tpublic get length(): number {\n\t\treturn fail(\"Proxy should intercept length\");\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\treturn this.values();\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic get [Symbol.unscopables]() {\n\t\t// This might not be the exact right set of values, but it only matters for `with` clauses which are deprecated and are banned in strict mode, so it shouldn't matter much.\n\t\t// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with for details.\n\t\treturn Array.prototype[Symbol.unscopables];\n\t}\n\n\tpublic at(\n\t\tthis: TreeArrayNode<T>,\n\t\tindex: number,\n\t): TreeNodeFromImplicitAllowedTypes<T> | undefined {\n\t\tconst field = getSequenceField(this);\n\t\tconst val = field.boxedAt(index);\n\n\t\tif (val === undefined) {\n\t\t\treturn val;\n\t\t}\n\n\t\treturn getOrCreateNodeFromFlexTreeNode(val) as TreeNodeFromImplicitAllowedTypes<T>;\n\t}\n\tpublic insertAt(index: number, ...value: Insertable<T>): void {\n\t\tconst field = getSequenceField(this);\n\t\tvalidateIndex(index, field, \"insertAt\", true);\n\t\tconst content = this.#mapTreesFromFieldData(value);\n\t\tfield.editor.insert(index, content);\n\t}\n\tpublic insertAtStart(...value: Insertable<T>): void {\n\t\tthis.insertAt(0, ...value);\n\t}\n\tpublic insertAtEnd(...value: Insertable<T>): void {\n\t\tthis.insertAt(this.length, ...value);\n\t}\n\tpublic removeAt(index: number): void {\n\t\tconst field = getSequenceField(this);\n\t\tvalidateIndex(index, field, \"removeAt\");\n\t\tfield.editor.remove(index, 1);\n\t}\n\tpublic removeRange(start?: number, end?: number): void {\n\t\tconst field = getSequenceField(this);\n\t\tconst { length } = field;\n\t\tconst removeStart = start ?? 0;\n\t\tconst removeEnd = Math.min(length, end ?? length);\n\t\tvalidatePositiveIndex(removeStart);\n\t\tvalidatePositiveIndex(removeEnd);\n\t\tif (removeEnd < removeStart) {\n\t\t\t// This catches both the case where start is > array.length and when start is > end.\n\t\t\tthrow new UsageError('Too large of \"start\" value passed to TreeArrayNode.removeRange.');\n\t\t}\n\t\tfield.editor.remove(removeStart, removeEnd - removeStart);\n\t}\n\tpublic moveToStart(sourceIndex: number, source?: TreeArrayNode): void {\n\t\tconst sourceArray = source ?? this;\n\t\tconst sourceField = getSequenceField(sourceArray);\n\t\tvalidateIndex(sourceIndex, sourceField, \"moveToStart\");\n\t\tthis.moveRangeToIndex(0, sourceIndex, sourceIndex + 1, source);\n\t}\n\tpublic moveToEnd(sourceIndex: number, source?: TreeArrayNode): void {\n\t\tconst sourceArray = source ?? this;\n\t\tconst sourceField = getSequenceField(sourceArray);\n\t\tvalidateIndex(sourceIndex, sourceField, \"moveToEnd\");\n\t\tthis.moveRangeToIndex(this.length, sourceIndex, sourceIndex + 1, source);\n\t}\n\tpublic moveToIndex(\n\t\tdestinationIndex: number,\n\t\tsourceIndex: number,\n\t\tsource?: TreeArrayNode,\n\t): void {\n\t\tconst sourceArray = source ?? this;\n\t\tconst sourceField = getSequenceField(sourceArray);\n\t\tconst destinationField = getSequenceField(this);\n\t\tvalidateIndex(destinationIndex, destinationField, \"moveToIndex\", true);\n\t\tvalidateIndex(sourceIndex, sourceField, \"moveToIndex\");\n\t\tthis.moveRangeToIndex(destinationIndex, sourceIndex, sourceIndex + 1, source);\n\t}\n\tpublic moveRangeToStart(\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource?: TreeArrayNode,\n\t): void {\n\t\tvalidateIndexRange(\n\t\t\tsourceStart,\n\t\t\tsourceEnd,\n\t\t\tsource ?? getSequenceField(this),\n\t\t\t\"moveRangeToStart\",\n\t\t);\n\t\tthis.moveRangeToIndex(0, sourceStart, sourceEnd, source);\n\t}\n\tpublic moveRangeToEnd(sourceStart: number, sourceEnd: number, source?: TreeArrayNode): void {\n\t\tvalidateIndexRange(\n\t\t\tsourceStart,\n\t\t\tsourceEnd,\n\t\t\tsource ?? getSequenceField(this),\n\t\t\t\"moveRangeToEnd\",\n\t\t);\n\t\tthis.moveRangeToIndex(this.length, sourceStart, sourceEnd, source);\n\t}\n\tpublic moveRangeToIndex(\n\t\tdestinationIndex: number,\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource?: TreeArrayNode,\n\t): void {\n\t\tconst destinationField = getSequenceField(this);\n\t\tconst sourceField = source !== undefined ? getSequenceField(source) : destinationField;\n\n\t\tvalidateIndex(destinationIndex, destinationField, \"moveRangeToIndex\", true);\n\t\tvalidateIndexRange(sourceStart, sourceEnd, source ?? destinationField, \"moveRangeToIndex\");\n\n\t\t// TODO: determine support for move across different sequence types\n\t\tif (sourceField !== destinationField) {\n\t\t\tfor (let i = sourceStart; i < sourceEnd; i++) {\n\t\t\t\tconst sourceNode = sourceField.boxedAt(i) ?? oob();\n\t\t\t\tif (!destinationField.schema.types.has(sourceNode.schema)) {\n\t\t\t\t\tthrow new UsageError(\"Type in source sequence is not allowed in destination.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst movedCount = sourceEnd - sourceStart;\n\t\tif (!destinationField.context.isHydrated()) {\n\t\t\tif (!isMapTreeSequenceField(sourceField)) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"Cannot move elements from an unhydrated array to a hydrated array.\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (sourceField !== destinationField || destinationIndex < sourceStart) {\n\t\t\t\tdestinationField.editor.insert(\n\t\t\t\t\tdestinationIndex,\n\t\t\t\t\tsourceField.editor.remove(sourceStart, movedCount),\n\t\t\t\t);\n\t\t\t} else if (destinationIndex > sourceStart + movedCount) {\n\t\t\t\tdestinationField.editor.insert(\n\t\t\t\t\tdestinationIndex - movedCount,\n\t\t\t\t\tsourceField.editor.remove(sourceStart, movedCount),\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tif (!sourceField.context.isHydrated()) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"Cannot move elements from an unhydrated array to a hydrated array.\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (sourceField.context !== destinationField.context) {\n\t\t\t\tthrow new UsageError(\"Cannot move elements between two different TreeViews.\");\n\t\t\t}\n\n\t\t\tdestinationField.context.checkout.editor.move(\n\t\t\t\tsourceField.getFieldPath(),\n\t\t\t\tsourceStart,\n\t\t\t\tmovedCount,\n\t\t\t\tdestinationField.getFieldPath(),\n\t\t\t\tdestinationIndex,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\treturn this.generateValues(getKernel(this).generationNumber);\n\t}\n\tprivate *generateValues(\n\t\tinitialLastUpdatedStamp: number,\n\t): Generator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\tconst kernel = getKernel(this);\n\t\tif (initialLastUpdatedStamp !== kernel.generationNumber) {\n\t\t\tthrow new UsageError(`Concurrent editing and iteration is not allowed.`);\n\t\t}\n\t\tfor (let i = 0; i < this.length; i++) {\n\t\t\tyield this.at(i) ?? fail(\"Index is out of bounds\");\n\t\t\tif (initialLastUpdatedStamp !== kernel.generationNumber) {\n\t\t\t\tthrow new UsageError(`Concurrent editing and iteration is not allowed.`);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n *\n * @param name - Unique identifier for this schema including the factory's scope.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function arraySchema<\n\tTName extends string,\n\tconst T extends ImplicitAllowedTypes,\n\tconst ImplicitlyConstructable extends boolean,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tcustomizable: boolean,\n) {\n\ttype Output = TreeNodeSchemaClass<\n\t\tTName,\n\t\tNodeKind.Array,\n\t\tTreeArrayNode<T> & WithType<TName, NodeKind.Array>,\n\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\tImplicitlyConstructable,\n\t\tT\n\t>;\n\tlet flexSchema: FlexTreeNodeSchema;\n\tlet unhydratedContext: UnhydratedContext;\n\n\t// This class returns a proxy from its constructor to handle numeric indexing.\n\t// Alternatively it could extend a normal class which gets tons of numeric properties added.\n\tclass Schema extends CustomArrayNodeBase<T> {\n\t\tpublic static override prepareInstance<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tflexNode: FlexTreeNode,\n\t\t): TreeNodeValid<T2> {\n\t\t\tconst proxyTarget = customizable ? instance : [];\n\n\t\t\tif (customizable) {\n\t\t\t\t// Since proxy reports this as a \"non-configurable\" property, it must exist on the underlying object used as the proxy target, not as an inherited property.\n\t\t\t\t// This should not get used as the proxy should intercept all use.\n\t\t\t\tObject.defineProperty(instance, \"length\", {\n\t\t\t\t\tvalue: NaN,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn createArrayNodeProxy(customizable, proxyTarget, instance) as unknown as Schema;\n\t\t}\n\n\t\tpublic static override buildRawNode<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tinput: T2,\n\t\t): MapTreeNode {\n\t\t\treturn getOrCreateMapTreeNode(\n\t\t\t\tunhydratedContext,\n\t\t\t\tflexSchema,\n\t\t\t\tmapTreeFromNodeData(input as object, this as unknown as ImplicitAllowedTypes),\n\t\t\t);\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup<T2>(this: typeof TreeNodeValid<T2>): void {\n\t\t\tconst schema = this as unknown as TreeNodeSchema;\n\t\t\tflexSchema = getFlexSchema(schema);\n\t\t\tunhydratedContext = new UnhydratedContext(toFlexSchema(schema));\n\n\t\t\t// First run, do extra validation.\n\t\t\t// TODO: provide a way for TreeConfiguration to trigger this same validation to ensure it gets run early.\n\t\t\t// Scan for shadowing inherited members which won't work, but stop scan early to allow shadowing built in (which seems to work ok).\n\t\t\t{\n\t\t\t\tlet prototype: object = this.prototype;\n\t\t\t\t// There isn't a clear cleaner way to author this loop.\n\t\t\t\twhile (prototype !== Schema.prototype) {\n\t\t\t\t\t// Search prototype keys and check for positive integers. Throw if any are found.\n\t\t\t\t\t// Shadowing of index properties on array nodes is not supported.\n\t\t\t\t\tfor (const key of Object.getOwnPropertyNames(prototype)) {\n\t\t\t\t\t\tconst maybeIndex = asIndex(key, Number.POSITIVE_INFINITY);\n\t\t\t\t\t\tif (maybeIndex !== undefined) {\n\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t`Schema ${identifier} defines an inherited index property \"${key.toString()}\" which shadows a possible array index. Shadowing of array indices is not permitted.`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Since this stops at the array node base schema, it should never see a null prototype, so this case is safe.\n\t\t\t\t\t// Additionally, if the prototype chain is ever messed up such that the array base schema is not in it,\n\t\t\t\t\t// the null that would show up here does at least ensure this code throws instead of hanging.\n\t\t\t\t\tprototype = Reflect.getPrototypeOf(prototype) as object;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: ImplicitlyConstructable =\n\t\t\timplicitlyConstructable;\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): Output {\n\t\t\treturn Schema.constructorCached?.constructor as unknown as Output;\n\t\t}\n\n\t\tprotected get simpleSchema(): T {\n\t\t\treturn info;\n\t\t}\n\t}\n\n\tconst output: Output = Schema;\n\treturn output;\n}\n\nfunction validateSafeInteger(index: number): void {\n\tif (!Number.isSafeInteger(index)) {\n\t\tthrow new UsageError(`Expected a safe integer, got ${index}.`);\n\t}\n}\n\nfunction validatePositiveIndex(index: number): void {\n\tvalidateSafeInteger(index);\n\tif (index < 0) {\n\t\tthrow new UsageError(`Expected non-negative index, got ${index}.`);\n\t}\n}\n\nfunction validateIndex(\n\tindex: number,\n\tarray: { readonly length: number },\n\tmethodName: string,\n\tallowOnePastEnd: boolean = false,\n): void {\n\tvalidatePositiveIndex(index);\n\tif (allowOnePastEnd) {\n\t\tif (index > array.length) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Index value passed to TreeArrayNode.${methodName} is out of bounds.`,\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (index >= array.length) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Index value passed to TreeArrayNode.${methodName} is out of bounds.`,\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction validateIndexRange(\n\tstartIndex: number,\n\tendIndex: number,\n\tarray: { readonly length: number },\n\tmethodName: string,\n): void {\n\tvalidateIndex(startIndex, array, methodName, true);\n\tvalidateIndex(endIndex, array, methodName, true);\n\tif (startIndex > endIndex || array.length < endIndex) {\n\t\tthrow new UsageError(\n\t\t\t`Index value passed to TreeArrayNode.${methodName} is out of bounds.`,\n\t\t);\n\t}\n}\n"]}
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { isTreeNode, TreeNodeKernel, getKernel, tryGetTreeNodeSchema, } from "./treeNodeKernel.js";
5
+ export { isTreeNode, TreeNodeKernel, getKernel, tryGetTreeNodeSchema, type InnerNode, tryGetCachedTreeNode, tryDisposeTreeNode, } from "./treeNodeKernel.js";
6
6
  export { type WithType, typeNameSymbol, typeSchemaSymbol } from "./withType.js";
7
- export { type TreeChangeEvents, TreeNode, type Unhydrated, inPrototypeChain, type InternalTreeNode, privateToken, type NodeChangedData, } from "./types.js";
7
+ export { type TreeChangeEvents, TreeNode, type Unhydrated, inPrototypeChain, type InternalTreeNode, privateToken, } from "./types.js";
8
8
  export { type TreeNodeSchema, NodeKind, type TreeNodeSchemaClass, type TreeNodeSchemaNonClass, type TreeNodeSchemaCore, } from "./treeNodeSchema.js";
9
- export { getSimpleNodeSchema, setFlexSchemaFromClassSchema, tryGetSimpleNodeSchema, cachedFlexSchemaFromClassSchema, } from "./schemaCaching.js";
9
+ export { getSimpleNodeSchema, setFlexSchemaFromClassSchema, tryGetSimpleNodeSchema, cachedFlexSchemaFromClassSchema, getSimpleNodeSchemaFromNode, } from "./schemaCaching.js";
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,cAAc,EACd,SAAS,EACT,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EACN,KAAK,gBAAgB,EACrB,QAAQ,EACR,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,YAAY,EACZ,KAAK,eAAe,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,KAAK,cAAc,EACnB,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,mBAAmB,EACnB,4BAA4B,EAC5B,sBAAsB,EACtB,+BAA+B,GAC/B,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,KAAK,SAAS,EACd,oBAAoB,EACpB,kBAAkB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EACN,KAAK,gBAAgB,EACrB,QAAQ,EACR,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,YAAY,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,KAAK,cAAc,EACnB,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,mBAAmB,EACnB,4BAA4B,EAC5B,sBAAsB,EACtB,+BAA+B,EAC/B,2BAA2B,GAC3B,MAAM,oBAAoB,CAAC"}
@@ -4,12 +4,14 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.cachedFlexSchemaFromClassSchema = exports.tryGetSimpleNodeSchema = exports.setFlexSchemaFromClassSchema = exports.getSimpleNodeSchema = exports.NodeKind = exports.privateToken = exports.inPrototypeChain = exports.TreeNode = exports.typeSchemaSymbol = exports.typeNameSymbol = exports.tryGetTreeNodeSchema = exports.getKernel = exports.TreeNodeKernel = exports.isTreeNode = void 0;
7
+ exports.getSimpleNodeSchemaFromNode = exports.cachedFlexSchemaFromClassSchema = exports.tryGetSimpleNodeSchema = exports.setFlexSchemaFromClassSchema = exports.getSimpleNodeSchema = exports.NodeKind = exports.privateToken = exports.inPrototypeChain = exports.TreeNode = exports.typeSchemaSymbol = exports.typeNameSymbol = exports.tryDisposeTreeNode = exports.tryGetCachedTreeNode = exports.tryGetTreeNodeSchema = exports.getKernel = exports.TreeNodeKernel = exports.isTreeNode = void 0;
8
8
  var treeNodeKernel_js_1 = require("./treeNodeKernel.js");
9
9
  Object.defineProperty(exports, "isTreeNode", { enumerable: true, get: function () { return treeNodeKernel_js_1.isTreeNode; } });
10
10
  Object.defineProperty(exports, "TreeNodeKernel", { enumerable: true, get: function () { return treeNodeKernel_js_1.TreeNodeKernel; } });
11
11
  Object.defineProperty(exports, "getKernel", { enumerable: true, get: function () { return treeNodeKernel_js_1.getKernel; } });
12
12
  Object.defineProperty(exports, "tryGetTreeNodeSchema", { enumerable: true, get: function () { return treeNodeKernel_js_1.tryGetTreeNodeSchema; } });
13
+ Object.defineProperty(exports, "tryGetCachedTreeNode", { enumerable: true, get: function () { return treeNodeKernel_js_1.tryGetCachedTreeNode; } });
14
+ Object.defineProperty(exports, "tryDisposeTreeNode", { enumerable: true, get: function () { return treeNodeKernel_js_1.tryDisposeTreeNode; } });
13
15
  var withType_js_1 = require("./withType.js");
14
16
  Object.defineProperty(exports, "typeNameSymbol", { enumerable: true, get: function () { return withType_js_1.typeNameSymbol; } });
15
17
  Object.defineProperty(exports, "typeSchemaSymbol", { enumerable: true, get: function () { return withType_js_1.typeSchemaSymbol; } });
@@ -24,4 +26,5 @@ Object.defineProperty(exports, "getSimpleNodeSchema", { enumerable: true, get: f
24
26
  Object.defineProperty(exports, "setFlexSchemaFromClassSchema", { enumerable: true, get: function () { return schemaCaching_js_1.setFlexSchemaFromClassSchema; } });
25
27
  Object.defineProperty(exports, "tryGetSimpleNodeSchema", { enumerable: true, get: function () { return schemaCaching_js_1.tryGetSimpleNodeSchema; } });
26
28
  Object.defineProperty(exports, "cachedFlexSchemaFromClassSchema", { enumerable: true, get: function () { return schemaCaching_js_1.cachedFlexSchemaFromClassSchema; } });
29
+ Object.defineProperty(exports, "getSimpleNodeSchemaFromNode", { enumerable: true, get: function () { return schemaCaching_js_1.getSimpleNodeSchemaFromNode; } });
27
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAK6B;AAJ5B,+GAAA,UAAU,OAAA;AACV,mHAAA,cAAc,OAAA;AACd,8GAAA,SAAS,OAAA;AACT,yHAAA,oBAAoB,OAAA;AAErB,6CAAgF;AAAxD,6GAAA,cAAc,OAAA;AAAE,+GAAA,gBAAgB,OAAA;AACxD,uCAQoB;AANnB,oGAAA,QAAQ,OAAA;AAER,4GAAA,gBAAgB,OAAA;AAEhB,wGAAA,YAAY,OAAA;AAGb,yDAM6B;AAJ5B,6GAAA,QAAQ,OAAA;AAKT,uDAK4B;AAJ3B,uHAAA,mBAAmB,OAAA;AACnB,gIAAA,4BAA4B,OAAA;AAC5B,0HAAA,sBAAsB,OAAA;AACtB,mIAAA,+BAA+B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tisTreeNode,\n\tTreeNodeKernel,\n\tgetKernel,\n\ttryGetTreeNodeSchema,\n} from \"./treeNodeKernel.js\";\nexport { type WithType, typeNameSymbol, typeSchemaSymbol } from \"./withType.js\";\nexport {\n\ttype TreeChangeEvents,\n\tTreeNode,\n\ttype Unhydrated,\n\tinPrototypeChain,\n\ttype InternalTreeNode,\n\tprivateToken,\n\ttype NodeChangedData,\n} from \"./types.js\";\nexport {\n\ttype TreeNodeSchema,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n} from \"./treeNodeSchema.js\";\nexport {\n\tgetSimpleNodeSchema,\n\tsetFlexSchemaFromClassSchema,\n\ttryGetSimpleNodeSchema,\n\tcachedFlexSchemaFromClassSchema,\n} from \"./schemaCaching.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAQ6B;AAP5B,+GAAA,UAAU,OAAA;AACV,mHAAA,cAAc,OAAA;AACd,8GAAA,SAAS,OAAA;AACT,yHAAA,oBAAoB,OAAA;AAEpB,yHAAA,oBAAoB,OAAA;AACpB,uHAAA,kBAAkB,OAAA;AAEnB,6CAAgF;AAAxD,6GAAA,cAAc,OAAA;AAAE,+GAAA,gBAAgB,OAAA;AACxD,uCAOoB;AALnB,oGAAA,QAAQ,OAAA;AAER,4GAAA,gBAAgB,OAAA;AAEhB,wGAAA,YAAY,OAAA;AAEb,yDAM6B;AAJ5B,6GAAA,QAAQ,OAAA;AAKT,uDAM4B;AAL3B,uHAAA,mBAAmB,OAAA;AACnB,gIAAA,4BAA4B,OAAA;AAC5B,0HAAA,sBAAsB,OAAA;AACtB,mIAAA,+BAA+B,OAAA;AAC/B,+HAAA,2BAA2B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tisTreeNode,\n\tTreeNodeKernel,\n\tgetKernel,\n\ttryGetTreeNodeSchema,\n\ttype InnerNode,\n\ttryGetCachedTreeNode,\n\ttryDisposeTreeNode,\n} from \"./treeNodeKernel.js\";\nexport { type WithType, typeNameSymbol, typeSchemaSymbol } from \"./withType.js\";\nexport {\n\ttype TreeChangeEvents,\n\tTreeNode,\n\ttype Unhydrated,\n\tinPrototypeChain,\n\ttype InternalTreeNode,\n\tprivateToken,\n} from \"./types.js\";\nexport {\n\ttype TreeNodeSchema,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n} from \"./treeNodeSchema.js\";\nexport {\n\tgetSimpleNodeSchema,\n\tsetFlexSchemaFromClassSchema,\n\ttryGetSimpleNodeSchema,\n\tcachedFlexSchemaFromClassSchema,\n\tgetSimpleNodeSchemaFromNode,\n} from \"./schemaCaching.js\";\n"]}
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import type { FlexTreeNodeSchema, TreeNodeSchemaBase } from "../../feature-libraries/index.js";
6
6
  import type { TreeNodeSchema } from "./treeNodeSchema.js";
7
+ import type { InnerNode } from "./treeNodeKernel.js";
7
8
  export declare function cachedFlexSchemaFromClassSchema(schema: TreeNodeSchema): TreeNodeSchemaBase | undefined;
8
9
  export declare function setFlexSchemaFromClassSchema(simple: TreeNodeSchema, flex: TreeNodeSchemaBase): void;
9
10
  /**
@@ -16,4 +17,8 @@ export declare function tryGetSimpleNodeSchema(flexSchema: FlexTreeNodeSchema):
16
17
  * Fails if no cached value is found.
17
18
  */
18
19
  export declare function getSimpleNodeSchema(flexSchema: FlexTreeNodeSchema): TreeNodeSchema;
20
+ /**
21
+ * Gets the {@link TreeNodeSchema} for the {@link InnerNode}.
22
+ */
23
+ export declare function getSimpleNodeSchemaFromNode(innerNode: InnerNode): TreeNodeSchema;
19
24
  //# sourceMappingURL=schemaCaching.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaCaching.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/schemaCaching.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG/F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAa1D,wBAAgB,+BAA+B,CAC9C,MAAM,EAAE,cAAc,GACpB,kBAAkB,GAAG,SAAS,CAGhC;AAED,wBAAgB,4BAA4B,CAC3C,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,kBAAkB,GACtB,IAAI,CAON;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACrC,UAAU,EAAE,kBAAkB,GAC5B,cAAc,GAAG,SAAS,CAK5B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,kBAAkB,GAAG,cAAc,CAElF"}
1
+ {"version":3,"file":"schemaCaching.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/schemaCaching.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG/F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAarD,wBAAgB,+BAA+B,CAC9C,MAAM,EAAE,cAAc,GACpB,kBAAkB,GAAG,SAAS,CAGhC;AAED,wBAAgB,4BAA4B,CAC3C,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,kBAAkB,GACtB,IAAI,CAON;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACrC,UAAU,EAAE,kBAAkB,GAC5B,cAAc,GAAG,SAAS,CAK5B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,kBAAkB,GAAG,cAAc,CAElF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,GAAG,cAAc,CAIhF"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getSimpleNodeSchema = exports.tryGetSimpleNodeSchema = exports.setFlexSchemaFromClassSchema = exports.cachedFlexSchemaFromClassSchema = void 0;
7
+ exports.getSimpleNodeSchemaFromNode = exports.getSimpleNodeSchema = exports.tryGetSimpleNodeSchema = exports.setFlexSchemaFromClassSchema = exports.cachedFlexSchemaFromClassSchema = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../util/index.js");
10
10
  /**
@@ -49,4 +49,13 @@ function getSimpleNodeSchema(flexSchema) {
49
49
  return tryGetSimpleNodeSchema(flexSchema) ?? (0, index_js_1.fail)("missing simple schema");
50
50
  }
51
51
  exports.getSimpleNodeSchema = getSimpleNodeSchema;
52
+ /**
53
+ * Gets the {@link TreeNodeSchema} for the {@link InnerNode}.
54
+ */
55
+ function getSimpleNodeSchemaFromNode(innerNode) {
56
+ // TODO: to make this work without depending on flex tree schema, a new caching/lookup mechanism will be required, likely leveraging the FlexTreeContext:
57
+ // A SimpleTreeContext could be defined and associated with the FlexTreeContext, and used to look up simple-tree schema by identifier.
58
+ return getSimpleNodeSchema(innerNode.flexSchema);
59
+ }
60
+ exports.getSimpleNodeSchemaFromNode = getSimpleNodeSchemaFromNode;
52
61
  //# sourceMappingURL=schemaCaching.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaCaching.js","sourceRoot":"","sources":["../../../src/simple-tree/core/schemaCaching.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAG7D,kDAA2C;AAI3C;;;GAGG;AACH,MAAM,gBAAgB,GAAkB,MAAM,CAAC,YAAY,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,sBAAsB,GAAkB,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAEzE,SAAgB,+BAA+B,CAC9C,MAAsB;IAEtB,8DAA8D;IAC9D,OAAQ,MAAc,CAAC,gBAAgB,CAAmC,CAAC;AAC5E,CAAC;AALD,0EAKC;AAED,SAAgB,4BAA4B,CAC3C,MAAsB,EACtB,IAAwB;IAExB,IAAA,iBAAM,EAAC,CAAC,CAAC,gBAAgB,IAAI,MAAM,CAAC,EAAE,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAChF,IAAA,iBAAM,EAAC,CAAC,CAAC,sBAAsB,IAAI,IAAI,CAAC,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAClF,8DAA8D;IAC7D,MAAc,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IACzC,8DAA8D;IAC7D,IAAY,CAAC,sBAAsB,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AAVD,oEAUC;AAED;;;GAGG;AACH,SAAgB,sBAAsB,CACrC,UAA8B;IAE9B,IAAI,sBAAsB,IAAI,UAAU,EAAE,CAAC;QAC1C,OAAO,UAAU,CAAC,sBAAsB,CAAmB,CAAC;IAC7D,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAPD,wDAOC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,UAA8B;IACjE,OAAO,sBAAsB,CAAC,UAAU,CAAC,IAAI,IAAA,eAAI,EAAC,uBAAuB,CAAC,CAAC;AAC5E,CAAC;AAFD,kDAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { FlexTreeNodeSchema, TreeNodeSchemaBase } from \"../../feature-libraries/index.js\";\nimport { fail } from \"../../util/index.js\";\n\nimport type { TreeNodeSchema } from \"./treeNodeSchema.js\";\n\n/**\n * A symbol for storing FlexTreeSchema on TreeNodeSchema.\n * Eagerly set on leaves, and lazily set for other cases.\n */\nconst flexSchemaSymbol: unique symbol = Symbol(`flexSchema`);\n\n/**\n * A symbol for storing TreeNodeSchema on FlexTreeNode's schema.\n */\nconst simpleNodeSchemaSymbol: unique symbol = Symbol(`simpleNodeSchema`);\n\nexport function cachedFlexSchemaFromClassSchema(\n\tschema: TreeNodeSchema,\n): TreeNodeSchemaBase | undefined {\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treturn (schema as any)[flexSchemaSymbol] as TreeNodeSchemaBase | undefined;\n}\n\nexport function setFlexSchemaFromClassSchema(\n\tsimple: TreeNodeSchema,\n\tflex: TreeNodeSchemaBase,\n): void {\n\tassert(!(flexSchemaSymbol in simple), 0x91f /* simple schema already marked */);\n\tassert(!(simpleNodeSchemaSymbol in flex), 0x920 /* flex schema already marked */);\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(simple as any)[flexSchemaSymbol] = flex;\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(flex as any)[simpleNodeSchemaSymbol] = simple;\n}\n\n/**\n * Gets the {@link TreeNodeSchema} cached on the provided {@link FlexTreeNodeSchema | flexSchema}.\n * Returns `undefined` if no cached value is found.\n */\nexport function tryGetSimpleNodeSchema(\n\tflexSchema: FlexTreeNodeSchema,\n): TreeNodeSchema | undefined {\n\tif (simpleNodeSchemaSymbol in flexSchema) {\n\t\treturn flexSchema[simpleNodeSchemaSymbol] as TreeNodeSchema;\n\t}\n\treturn undefined;\n}\n\n/**\n * Gets the {@link TreeNodeSchema} cached on the provided {@link FlexTreeNodeSchema | flexSchema}.\n * Fails if no cached value is found.\n */\nexport function getSimpleNodeSchema(flexSchema: FlexTreeNodeSchema): TreeNodeSchema {\n\treturn tryGetSimpleNodeSchema(flexSchema) ?? fail(\"missing simple schema\");\n}\n"]}
1
+ {"version":3,"file":"schemaCaching.js","sourceRoot":"","sources":["../../../src/simple-tree/core/schemaCaching.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAG7D,kDAA2C;AAK3C;;;GAGG;AACH,MAAM,gBAAgB,GAAkB,MAAM,CAAC,YAAY,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,sBAAsB,GAAkB,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAEzE,SAAgB,+BAA+B,CAC9C,MAAsB;IAEtB,8DAA8D;IAC9D,OAAQ,MAAc,CAAC,gBAAgB,CAAmC,CAAC;AAC5E,CAAC;AALD,0EAKC;AAED,SAAgB,4BAA4B,CAC3C,MAAsB,EACtB,IAAwB;IAExB,IAAA,iBAAM,EAAC,CAAC,CAAC,gBAAgB,IAAI,MAAM,CAAC,EAAE,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAChF,IAAA,iBAAM,EAAC,CAAC,CAAC,sBAAsB,IAAI,IAAI,CAAC,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAClF,8DAA8D;IAC7D,MAAc,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IACzC,8DAA8D;IAC7D,IAAY,CAAC,sBAAsB,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AAVD,oEAUC;AAED;;;GAGG;AACH,SAAgB,sBAAsB,CACrC,UAA8B;IAE9B,IAAI,sBAAsB,IAAI,UAAU,EAAE,CAAC;QAC1C,OAAO,UAAU,CAAC,sBAAsB,CAAmB,CAAC;IAC7D,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAPD,wDAOC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,UAA8B;IACjE,OAAO,sBAAsB,CAAC,UAAU,CAAC,IAAI,IAAA,eAAI,EAAC,uBAAuB,CAAC,CAAC;AAC5E,CAAC;AAFD,kDAEC;AAED;;GAEG;AACH,SAAgB,2BAA2B,CAAC,SAAoB;IAC/D,yJAAyJ;IACzJ,sIAAsI;IACtI,OAAO,mBAAmB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAClD,CAAC;AAJD,kEAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { FlexTreeNodeSchema, TreeNodeSchemaBase } from \"../../feature-libraries/index.js\";\nimport { fail } from \"../../util/index.js\";\n\nimport type { TreeNodeSchema } from \"./treeNodeSchema.js\";\nimport type { InnerNode } from \"./treeNodeKernel.js\";\n\n/**\n * A symbol for storing FlexTreeSchema on TreeNodeSchema.\n * Eagerly set on leaves, and lazily set for other cases.\n */\nconst flexSchemaSymbol: unique symbol = Symbol(`flexSchema`);\n\n/**\n * A symbol for storing TreeNodeSchema on FlexTreeNode's schema.\n */\nconst simpleNodeSchemaSymbol: unique symbol = Symbol(`simpleNodeSchema`);\n\nexport function cachedFlexSchemaFromClassSchema(\n\tschema: TreeNodeSchema,\n): TreeNodeSchemaBase | undefined {\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treturn (schema as any)[flexSchemaSymbol] as TreeNodeSchemaBase | undefined;\n}\n\nexport function setFlexSchemaFromClassSchema(\n\tsimple: TreeNodeSchema,\n\tflex: TreeNodeSchemaBase,\n): void {\n\tassert(!(flexSchemaSymbol in simple), 0x91f /* simple schema already marked */);\n\tassert(!(simpleNodeSchemaSymbol in flex), 0x920 /* flex schema already marked */);\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(simple as any)[flexSchemaSymbol] = flex;\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(flex as any)[simpleNodeSchemaSymbol] = simple;\n}\n\n/**\n * Gets the {@link TreeNodeSchema} cached on the provided {@link FlexTreeNodeSchema | flexSchema}.\n * Returns `undefined` if no cached value is found.\n */\nexport function tryGetSimpleNodeSchema(\n\tflexSchema: FlexTreeNodeSchema,\n): TreeNodeSchema | undefined {\n\tif (simpleNodeSchemaSymbol in flexSchema) {\n\t\treturn flexSchema[simpleNodeSchemaSymbol] as TreeNodeSchema;\n\t}\n\treturn undefined;\n}\n\n/**\n * Gets the {@link TreeNodeSchema} cached on the provided {@link FlexTreeNodeSchema | flexSchema}.\n * Fails if no cached value is found.\n */\nexport function getSimpleNodeSchema(flexSchema: FlexTreeNodeSchema): TreeNodeSchema {\n\treturn tryGetSimpleNodeSchema(flexSchema) ?? fail(\"missing simple schema\");\n}\n\n/**\n * Gets the {@link TreeNodeSchema} for the {@link InnerNode}.\n */\nexport function getSimpleNodeSchemaFromNode(innerNode: InnerNode): TreeNodeSchema {\n\t// TODO: to make this work without depending on flex tree schema, a new caching/lookup mechanism will be required, likely leveraging the FlexTreeContext:\n\t// A SimpleTreeContext could be defined and associated with the FlexTreeContext, and used to look up simple-tree schema by identifier.\n\treturn getSimpleNodeSchema(innerNode.flexSchema);\n}\n"]}
@@ -4,8 +4,8 @@
4
4
  */
5
5
  import { type Listenable, type Off } from "../../events/index.js";
6
6
  import type { TreeNode, Unhydrated } from "./types.js";
7
- import type { AnchorEvents, AnchorNode } from "../../core/index.js";
8
- import { TreeStatus } from "../../feature-libraries/index.js";
7
+ import { type AnchorEvents, type AnchorNode, type AnchorSet, type UpPath } from "../../core/index.js";
8
+ import { TreeStatus, type FlexTreeNode, type MapTreeNode } from "../../feature-libraries/index.js";
9
9
  import type { TreeNodeSchema } from "./treeNodeSchema.js";
10
10
  export declare function getKernel(node: TreeNode): TreeNodeKernel;
11
11
  /**
@@ -41,30 +41,88 @@ export declare class TreeNodeKernel implements Listenable<KernelEvents> {
41
41
  #private;
42
42
  readonly node: TreeNode;
43
43
  readonly schema: TreeNodeSchema;
44
+ private innerNode;
44
45
  private disposed;
45
46
  /**
46
47
  * Generation number which is incremented any time we have an edit on the node.
47
48
  * Used during iteration to make sure there has been no edits that were concurrently made.
49
+ * @remarks
50
+ * This is updated monotonically by this class when edits are applied.
51
+ * TODO: update this when applying edits to unhydrated trees.
52
+ *
53
+ * If TypeScript supported making this immutable from outside the class without making it readonly from inside, that would be used here,
54
+ * but they only way to do that is add a separate public accessor and make it private, which was deemed not worth the boilerplate, runtime overhead and bundle size.
48
55
  */
49
56
  generationNumber: number;
50
57
  /**
51
58
  * Create a TreeNodeKernel which can be looked up with {@link getKernel}.
59
+ *
60
+ * @param innerNode - When unhydrated/raw or marinated the MapTreeNode. FlexTreeNode when cooked.
52
61
  * @remarks
53
62
  * Exactly one kernel per TreeNode should be created.
54
63
  */
55
- constructor(node: TreeNode, schema: TreeNodeSchema);
64
+ constructor(node: TreeNode, schema: TreeNodeSchema, innerNode: InnerNode);
56
65
  /**
57
66
  * Transition from {@link Unhydrated} to hydrated.
67
+ * Bi-directionally associates the given hydrated TreeNode to the given anchor node.
58
68
  * @remarks
59
69
  * Happens at most once for any given node.
70
+ * Cleans up mappings to {@link MapTreeNode} - it is assumed that they are no longer needed once the proxy has an anchor node.
60
71
  */
61
72
  hydrate(anchorNode: AnchorNode): void;
62
73
  isHydrated(): boolean;
63
74
  getStatus(): TreeStatus;
64
75
  on<K extends keyof KernelEvents>(eventName: K, listener: KernelEvents[K]): Off;
65
76
  dispose(): void;
77
+ /**
78
+ * Retrieves the flex node associated with the given target via {@link setInnerNode}.
79
+ * @remarks
80
+ * For {@link Unhydrated} nodes, this returns the MapTreeNode.
81
+ *
82
+ * For hydrated nodes it returns a FlexTreeNode backed by the forest.
83
+ * Note that for "marinated" nodes, this FlexTreeNode exists and returns it: it does not return the MapTreeNode which is the current InnerNode.
84
+ */
85
+ getOrCreateInnerNode(allowFreed?: boolean): InnerNode;
86
+ /**
87
+ * Creates an anchor node and associates it with the given proxy.
88
+ * @privateRemarks
89
+ * Use `forgetters` to cleanup the anchor allocated by this function once the anchor is no longer needed.
90
+ * In practice, this happens when either the anchor node is destroyed, or another anchor to the same node is created by a new flex node.
91
+ *
92
+ * The FlexTreeNode holds a reference to the same anchor, and has a lifetime at least as long as the simple-tree,
93
+ * so this would be unnecessary except for the case of "marinated" nodes, which have an anchor,
94
+ * but might not have a FlexTreeNode.
95
+ * Handling this case is an optimization assuming that this extra anchor reference is cheaper than eagerly creating FlexTreeNodes.
96
+ */
97
+ anchorProxy(anchors: AnchorSet, path: UpPath): AnchorNode;
98
+ /**
99
+ * Retrieves the InnerNode associated with the given target via {@link setInnerNode}, if any.
100
+ * @remarks
101
+ * If `target` is a unhydrated node, returns its MapTreeNode.
102
+ * If `target` is a cooked node (or marinated but a FlexTreeNode exists) returns the FlexTreeNode.
103
+ * If the target is not a node, or a marinated node with no FlexTreeNode for its anchor, returns undefined.
104
+ */
105
+ tryGetInnerNode(): InnerNode | undefined;
66
106
  }
67
107
  declare const kernelEvents: readonly ["childrenChangedAfterBatch", "subtreeChangedAfterBatch"];
68
108
  type KernelEvents = Pick<AnchorEvents, (typeof kernelEvents)[number]>;
109
+ /**
110
+ * For "cooked" nodes this is a FlexTreeNode thats a projection of forest content.
111
+ * For {@link Unhydrated} nodes this is a MapTreeNode.
112
+ * For "marinated" nodes, some code (ex: getOrCreateInnerNode) returns the FlexTreeNode thats a projection of forest content, and some code (ex: tryGetInnerNode) returns undefined.
113
+ *
114
+ * @remarks
115
+ * Currently MapTreeNode extends FlexTreeNode, and most code which can work with either just uses FlexTreeNode.
116
+ * TODO: Code should be migrating toward using this type to distinguish to two use-cases.
117
+ *
118
+ * TODO: The inconsistent handling of "marinated" cases should be cleaned up.
119
+ * Maybe getOrCreateInnerNode should cook marinated nodes so they have a proper InnerNode?
120
+ */
121
+ export type InnerNode = FlexTreeNode | MapTreeNode;
122
+ /**
123
+ * Retrieves the proxy associated with the given flex node via {@link setInnerNode}, if any.
124
+ */
125
+ export declare function tryGetCachedTreeNode(flexNode: InnerNode): TreeNode | undefined;
126
+ export declare function tryDisposeTreeNode(anchorNode: AnchorNode): void;
69
127
  export {};
70
128
  //# sourceMappingURL=treeNodeKernel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"treeNodeKernel.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeKernel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAIN,KAAK,UAAU,EACf,KAAK,GAAG,EACR,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAIN,UAAU,EAEV,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,cAAc,CAIxD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,OAAO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