@fluidframework/tree 2.80.0 → 2.81.0-374083

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 (914) hide show
  1. package/api-report/tree.alpha.api.md +43 -7
  2. package/dist/alpha.d.ts +5 -0
  3. package/dist/core/change-family/changeFamily.d.ts +4 -1
  4. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  5. package/dist/core/change-family/changeFamily.js.map +1 -1
  6. package/dist/core/change-family/index.d.ts +1 -1
  7. package/dist/core/change-family/index.d.ts.map +1 -1
  8. package/dist/core/change-family/index.js.map +1 -1
  9. package/dist/core/index.d.ts +3 -3
  10. package/dist/core/index.d.ts.map +1 -1
  11. package/dist/core/index.js +6 -4
  12. package/dist/core/index.js.map +1 -1
  13. package/dist/core/rebase/changeRebaser.d.ts +6 -1
  14. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  15. package/dist/core/rebase/changeRebaser.js.map +1 -1
  16. package/dist/core/rebase/index.d.ts +1 -1
  17. package/dist/core/rebase/index.d.ts.map +1 -1
  18. package/dist/core/rebase/index.js +2 -1
  19. package/dist/core/rebase/index.js.map +1 -1
  20. package/dist/core/rebase/types.d.ts +46 -8
  21. package/dist/core/rebase/types.d.ts.map +1 -1
  22. package/dist/core/rebase/types.js +5 -1
  23. package/dist/core/rebase/types.js.map +1 -1
  24. package/dist/core/rebase/utils.d.ts.map +1 -1
  25. package/dist/core/rebase/utils.js +30 -8
  26. package/dist/core/rebase/utils.js.map +1 -1
  27. package/dist/core/tree/anchorSet.js +1 -0
  28. package/dist/core/tree/anchorSet.js.map +1 -1
  29. package/dist/core/tree/detachedFieldIndex.d.ts +6 -0
  30. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  31. package/dist/core/tree/detachedFieldIndex.js +9 -0
  32. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  33. package/dist/core/tree/index.d.ts +1 -1
  34. package/dist/core/tree/index.d.ts.map +1 -1
  35. package/dist/core/tree/index.js +4 -3
  36. package/dist/core/tree/index.js.map +1 -1
  37. package/dist/core/tree/pathTree.d.ts +11 -3
  38. package/dist/core/tree/pathTree.d.ts.map +1 -1
  39. package/dist/core/tree/pathTree.js +14 -2
  40. package/dist/core/tree/pathTree.js.map +1 -1
  41. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  42. package/dist/core/tree/visitDelta.js +3 -2
  43. package/dist/core/tree/visitDelta.js.map +1 -1
  44. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  45. package/dist/core/tree/visitorUtils.js +58 -18
  46. package/dist/core/tree/visitorUtils.js.map +1 -1
  47. package/dist/feature-libraries/changeAtomIdBTree.d.ts +10 -4
  48. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  49. package/dist/feature-libraries/changeAtomIdBTree.js +16 -2
  50. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  51. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  52. package/dist/feature-libraries/chunked-forest/basicChunk.js +7 -0
  53. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  54. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  55. package/dist/feature-libraries/chunked-forest/chunkTree.js +4 -1
  56. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  58. package/dist/feature-libraries/chunked-forest/chunkedForest.js +3 -1
  59. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  60. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -0
  61. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  62. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +93 -44
  63. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  64. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +238 -69
  65. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  66. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
  67. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  68. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +11 -2
  69. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  70. package/dist/feature-libraries/default-schema/index.d.ts +2 -1
  71. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  72. package/dist/feature-libraries/default-schema/index.js +5 -2
  73. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  74. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +38 -0
  75. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  76. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +132 -0
  77. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  78. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  79. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  80. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  81. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  82. package/dist/feature-libraries/deltaUtils.d.ts +1 -0
  83. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  84. package/dist/feature-libraries/deltaUtils.js +6 -1
  85. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  86. package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
  87. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  88. package/dist/feature-libraries/flex-tree/context.js +6 -0
  89. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  90. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  91. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  92. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  93. package/dist/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  94. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  95. package/dist/feature-libraries/flex-tree/lazyField.js +40 -9
  96. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  97. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  98. package/dist/feature-libraries/forest-summary/forestSummarizer.js +3 -1
  99. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  100. package/dist/feature-libraries/index.d.ts +3 -3
  101. package/dist/feature-libraries/index.d.ts.map +1 -1
  102. package/dist/feature-libraries/index.js +8 -3
  103. package/dist/feature-libraries/index.js.map +1 -1
  104. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  105. package/dist/feature-libraries/mapTreeCursor.js +1 -0
  106. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  107. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  108. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  109. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  110. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  111. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  112. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -7
  113. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  114. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -51
  115. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  116. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  117. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  118. package/dist/feature-libraries/modular-schema/genericFieldKind.js +3 -9
  119. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  120. package/dist/feature-libraries/modular-schema/index.d.ts +4 -4
  121. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  122. package/dist/feature-libraries/modular-schema/index.js +2 -2
  123. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  124. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +11 -28
  125. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  126. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +255 -161
  127. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  128. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
  129. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
  130. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js +393 -0
  131. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
  132. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  133. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +8 -1
  134. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  135. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +48 -20
  136. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  137. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1350 -476
  138. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  139. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  140. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  141. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +146 -0
  142. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
  143. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js +32 -0
  144. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
  145. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +47 -11
  146. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  147. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -3
  148. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  149. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  150. package/dist/feature-libraries/object-forest/objectForest.js +3 -1
  151. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  152. package/dist/feature-libraries/optional-field/index.d.ts +2 -2
  153. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  154. package/dist/feature-libraries/optional-field/index.js +1 -2
  155. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  156. package/dist/feature-libraries/optional-field/optionalField.d.ts +5 -26
  157. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  158. package/dist/feature-libraries/optional-field/optionalField.js +221 -443
  159. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  160. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  161. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  162. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +31 -0
  163. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  164. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  165. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  166. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  167. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  168. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  169. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +57 -28
  170. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  171. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  172. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  173. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +57 -0
  174. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  175. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  176. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  177. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  178. package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
  179. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  180. package/dist/feature-libraries/sequence-field/compose.js +83 -259
  181. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  182. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  183. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  184. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  185. package/dist/feature-libraries/sequence-field/index.d.ts +2 -3
  186. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  187. package/dist/feature-libraries/sequence-field/index.js +1 -3
  188. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  189. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  190. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  191. package/dist/feature-libraries/sequence-field/invert.js +65 -167
  192. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  193. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  194. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  195. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  196. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  197. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  198. package/dist/feature-libraries/sequence-field/moveEffectTable.js +7 -90
  199. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  200. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  201. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  202. package/dist/feature-libraries/sequence-field/rebase.js +107 -114
  203. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  204. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  205. package/dist/feature-libraries/sequence-field/replaceRevisions.js +18 -31
  206. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  207. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  208. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  209. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  210. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  211. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  212. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +365 -187
  213. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  214. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  215. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +20 -62
  216. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  217. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  218. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  219. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  220. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  221. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  222. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  223. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
  224. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  225. package/dist/feature-libraries/sequence-field/types.d.ts +30 -59
  226. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  227. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  228. package/dist/feature-libraries/sequence-field/utils.d.ts +15 -24
  229. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  230. package/dist/feature-libraries/sequence-field/utils.js +116 -305
  231. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  232. package/dist/index.d.ts +3 -2
  233. package/dist/index.d.ts.map +1 -1
  234. package/dist/index.js +4 -1
  235. package/dist/index.js.map +1 -1
  236. package/dist/packageVersion.d.ts +1 -1
  237. package/dist/packageVersion.d.ts.map +1 -1
  238. package/dist/packageVersion.js +1 -1
  239. package/dist/packageVersion.js.map +1 -1
  240. package/dist/shared-tree/index.d.ts +1 -1
  241. package/dist/shared-tree/index.d.ts.map +1 -1
  242. package/dist/shared-tree/index.js.map +1 -1
  243. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  244. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  245. package/dist/shared-tree/schematizeTree.js +2 -1
  246. package/dist/shared-tree/schematizeTree.js.map +1 -1
  247. package/dist/shared-tree/schematizingTreeView.d.ts +1 -5
  248. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  249. package/dist/shared-tree/schematizingTreeView.js +38 -35
  250. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  251. package/dist/shared-tree/sharedTree.d.ts +9 -3
  252. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  253. package/dist/shared-tree/sharedTree.js +11 -0
  254. package/dist/shared-tree/sharedTree.js.map +1 -1
  255. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  256. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  257. package/dist/shared-tree/sharedTreeChangeCodecs.js +1 -0
  258. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  259. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  260. package/dist/shared-tree/sharedTreeChangeEnricher.js +1 -1
  261. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  262. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +5 -5
  263. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  264. package/dist/shared-tree/sharedTreeChangeFamily.js +10 -4
  265. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  266. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  267. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  268. package/dist/shared-tree/sharedTreeEditBuilder.js +14 -7
  269. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  270. package/dist/shared-tree/treeCheckout.d.ts +9 -10
  271. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  272. package/dist/shared-tree/treeCheckout.js +63 -8
  273. package/dist/shared-tree/treeCheckout.js.map +1 -1
  274. package/dist/shared-tree-core/branch.d.ts +3 -2
  275. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  276. package/dist/shared-tree-core/branch.js +9 -4
  277. package/dist/shared-tree-core/branch.js.map +1 -1
  278. package/dist/shared-tree-core/editManager.d.ts +2 -2
  279. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  280. package/dist/shared-tree-core/editManager.js +20 -14
  281. package/dist/shared-tree-core/editManager.js.map +1 -1
  282. package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -0
  283. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  284. package/dist/shared-tree-core/editManagerCodecs.js +10 -2
  285. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  286. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +1 -0
  287. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  288. package/dist/shared-tree-core/editManagerFormatCommons.js +6 -0
  289. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  290. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  291. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  292. package/dist/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  293. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  294. package/dist/shared-tree-core/index.d.ts +2 -2
  295. package/dist/shared-tree-core/index.d.ts.map +1 -1
  296. package/dist/shared-tree-core/index.js +3 -1
  297. package/dist/shared-tree-core/index.js.map +1 -1
  298. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  299. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  300. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  301. package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
  302. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  303. package/dist/shared-tree-core/messageCodecs.js +10 -2
  304. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  305. package/dist/shared-tree-core/messageFormat.d.ts +1 -0
  306. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  307. package/dist/shared-tree-core/messageFormat.js +6 -0
  308. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  309. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  310. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  311. package/dist/shared-tree-core/messageFormatV1ToV4.js +1 -0
  312. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  313. package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -0
  314. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  315. package/dist/shared-tree-core/sharedTreeCore.js +1 -1
  316. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  317. package/dist/simple-tree/api/index.d.ts +1 -1
  318. package/dist/simple-tree/api/index.d.ts.map +1 -1
  319. package/dist/simple-tree/api/index.js +2 -1
  320. package/dist/simple-tree/api/index.js.map +1 -1
  321. package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -1
  322. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  323. package/dist/simple-tree/api/schemaFactoryBeta.js +1 -1
  324. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  325. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +4 -4
  326. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  327. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  328. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  329. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +297 -1
  330. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  331. package/dist/simple-tree/api/tree.d.ts +3 -1
  332. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  333. package/dist/simple-tree/api/tree.js.map +1 -1
  334. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  335. package/dist/simple-tree/core/treeNodeKernel.js +6 -2
  336. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  337. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  338. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  339. package/dist/simple-tree/core/unhydratedFlexTree.js +59 -8
  340. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  341. package/dist/simple-tree/fieldSchema.d.ts +4 -4
  342. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  343. package/dist/simple-tree/fieldSchema.js.map +1 -1
  344. package/dist/simple-tree/index.d.ts +3 -3
  345. package/dist/simple-tree/index.d.ts.map +1 -1
  346. package/dist/simple-tree/index.js +4 -3
  347. package/dist/simple-tree/index.js.map +1 -1
  348. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  349. package/dist/simple-tree/node-kinds/array/arrayNode.js +7 -5
  350. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  351. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  352. package/dist/simple-tree/node-kinds/common.js +1 -1
  353. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  354. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  355. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  356. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  357. package/dist/simple-tree/node-kinds/object/objectNode.js +19 -19
  358. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  359. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  360. package/dist/simple-tree/node-kinds/record/recordNode.js +4 -2
  361. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  362. package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
  363. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  364. package/dist/simple-tree/prepareForInsertion.js +184 -126
  365. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  366. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  367. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  368. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +31 -13
  369. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  370. package/dist/text/index.d.ts +6 -0
  371. package/dist/text/index.d.ts.map +1 -0
  372. package/dist/text/index.js +10 -0
  373. package/dist/text/index.js.map +1 -0
  374. package/dist/text/textDomain.d.ts +138 -0
  375. package/dist/text/textDomain.d.ts.map +1 -0
  376. package/dist/text/textDomain.js +121 -0
  377. package/dist/text/textDomain.js.map +1 -0
  378. package/dist/treeFactory.d.ts.map +1 -1
  379. package/dist/treeFactory.js +12 -2
  380. package/dist/treeFactory.js.map +1 -1
  381. package/dist/util/bTreeUtils.d.ts +12 -4
  382. package/dist/util/bTreeUtils.d.ts.map +1 -1
  383. package/dist/util/bTreeUtils.js +14 -18
  384. package/dist/util/bTreeUtils.js.map +1 -1
  385. package/dist/util/index.d.ts +1 -1
  386. package/dist/util/index.d.ts.map +1 -1
  387. package/dist/util/index.js +2 -1
  388. package/dist/util/index.js.map +1 -1
  389. package/dist/util/nestedMap.js +12 -12
  390. package/dist/util/nestedMap.js.map +1 -1
  391. package/dist/util/rangeMap.d.ts +24 -12
  392. package/dist/util/rangeMap.d.ts.map +1 -1
  393. package/dist/util/rangeMap.js +46 -6
  394. package/dist/util/rangeMap.js.map +1 -1
  395. package/docs/user-facing/merge-semantics.md +3 -2
  396. package/eslint.config.mts +4 -32
  397. package/lib/alpha.d.ts +5 -0
  398. package/lib/core/change-family/changeFamily.d.ts +4 -1
  399. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  400. package/lib/core/change-family/changeFamily.js.map +1 -1
  401. package/lib/core/change-family/index.d.ts +1 -1
  402. package/lib/core/change-family/index.d.ts.map +1 -1
  403. package/lib/core/change-family/index.js.map +1 -1
  404. package/lib/core/index.d.ts +3 -3
  405. package/lib/core/index.d.ts.map +1 -1
  406. package/lib/core/index.js +2 -2
  407. package/lib/core/index.js.map +1 -1
  408. package/lib/core/rebase/changeRebaser.d.ts +6 -1
  409. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  410. package/lib/core/rebase/changeRebaser.js.map +1 -1
  411. package/lib/core/rebase/index.d.ts +1 -1
  412. package/lib/core/rebase/index.d.ts.map +1 -1
  413. package/lib/core/rebase/index.js +1 -1
  414. package/lib/core/rebase/index.js.map +1 -1
  415. package/lib/core/rebase/types.d.ts +46 -8
  416. package/lib/core/rebase/types.d.ts.map +1 -1
  417. package/lib/core/rebase/types.js +3 -0
  418. package/lib/core/rebase/types.js.map +1 -1
  419. package/lib/core/rebase/utils.d.ts.map +1 -1
  420. package/lib/core/rebase/utils.js +30 -8
  421. package/lib/core/rebase/utils.js.map +1 -1
  422. package/lib/core/tree/anchorSet.js +1 -0
  423. package/lib/core/tree/anchorSet.js.map +1 -1
  424. package/lib/core/tree/detachedFieldIndex.d.ts +6 -0
  425. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  426. package/lib/core/tree/detachedFieldIndex.js +10 -1
  427. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  428. package/lib/core/tree/index.d.ts +1 -1
  429. package/lib/core/tree/index.d.ts.map +1 -1
  430. package/lib/core/tree/index.js +1 -1
  431. package/lib/core/tree/index.js.map +1 -1
  432. package/lib/core/tree/pathTree.d.ts +11 -3
  433. package/lib/core/tree/pathTree.d.ts.map +1 -1
  434. package/lib/core/tree/pathTree.js +12 -1
  435. package/lib/core/tree/pathTree.js.map +1 -1
  436. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  437. package/lib/core/tree/visitDelta.js +3 -2
  438. package/lib/core/tree/visitDelta.js.map +1 -1
  439. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  440. package/lib/core/tree/visitorUtils.js +58 -18
  441. package/lib/core/tree/visitorUtils.js.map +1 -1
  442. package/lib/feature-libraries/changeAtomIdBTree.d.ts +10 -4
  443. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  444. package/lib/feature-libraries/changeAtomIdBTree.js +14 -1
  445. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  446. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  447. package/lib/feature-libraries/chunked-forest/basicChunk.js +8 -1
  448. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  449. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  450. package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -1
  451. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  452. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  453. package/lib/feature-libraries/chunked-forest/chunkedForest.js +3 -1
  454. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  455. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -0
  456. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  457. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +93 -44
  458. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  459. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +236 -70
  460. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  461. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
  462. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  463. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +11 -2
  464. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  465. package/lib/feature-libraries/default-schema/index.d.ts +2 -1
  466. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  467. package/lib/feature-libraries/default-schema/index.js +2 -1
  468. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  469. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +38 -0
  470. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
  471. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +128 -0
  472. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
  473. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
  474. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  475. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
  476. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  477. package/lib/feature-libraries/deltaUtils.d.ts +1 -0
  478. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  479. package/lib/feature-libraries/deltaUtils.js +5 -1
  480. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  481. package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
  482. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  483. package/lib/feature-libraries/flex-tree/context.js +6 -0
  484. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  485. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  486. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  487. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  488. package/lib/feature-libraries/flex-tree/lazyField.d.ts +8 -7
  489. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  490. package/lib/feature-libraries/flex-tree/lazyField.js +41 -10
  491. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  492. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  493. package/lib/feature-libraries/forest-summary/forestSummarizer.js +3 -1
  494. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  495. package/lib/feature-libraries/index.d.ts +3 -3
  496. package/lib/feature-libraries/index.d.ts.map +1 -1
  497. package/lib/feature-libraries/index.js +2 -2
  498. package/lib/feature-libraries/index.js.map +1 -1
  499. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  500. package/lib/feature-libraries/mapTreeCursor.js +2 -1
  501. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  502. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  503. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  504. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  505. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
  506. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  507. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +3 -5
  508. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  509. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -51
  510. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  511. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  512. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  513. package/lib/feature-libraries/modular-schema/genericFieldKind.js +3 -9
  514. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  515. package/lib/feature-libraries/modular-schema/index.d.ts +4 -4
  516. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  517. package/lib/feature-libraries/modular-schema/index.js +2 -2
  518. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  519. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +11 -28
  520. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  521. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +247 -143
  522. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  523. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +15 -0
  524. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +1 -0
  525. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js +389 -0
  526. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js.map +1 -0
  527. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  528. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +8 -1
  529. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  530. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +48 -20
  531. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  532. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1344 -479
  533. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  534. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  535. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  536. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +146 -0
  537. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +1 -0
  538. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js +29 -0
  539. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js.map +1 -0
  540. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +47 -11
  541. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  542. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +1 -1
  543. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  544. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  545. package/lib/feature-libraries/object-forest/objectForest.js +3 -1
  546. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  547. package/lib/feature-libraries/optional-field/index.d.ts +2 -2
  548. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  549. package/lib/feature-libraries/optional-field/index.js +1 -1
  550. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  551. package/lib/feature-libraries/optional-field/optionalField.d.ts +5 -26
  552. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  553. package/lib/feature-libraries/optional-field/optionalField.js +221 -441
  554. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  555. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  556. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  557. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +27 -0
  558. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  559. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
  560. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  561. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  562. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  563. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  564. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +55 -26
  565. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  566. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  567. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  568. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +53 -0
  569. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  570. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  571. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  572. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  573. package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
  574. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  575. package/lib/feature-libraries/sequence-field/compose.js +85 -261
  576. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  577. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
  578. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  579. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  580. package/lib/feature-libraries/sequence-field/index.d.ts +2 -3
  581. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  582. package/lib/feature-libraries/sequence-field/index.js +0 -1
  583. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  584. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  585. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  586. package/lib/feature-libraries/sequence-field/invert.js +67 -169
  587. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  588. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  589. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  590. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  591. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +4 -56
  592. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  593. package/lib/feature-libraries/sequence-field/moveEffectTable.js +6 -84
  594. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  595. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  596. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  597. package/lib/feature-libraries/sequence-field/rebase.js +109 -116
  598. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  599. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  600. package/lib/feature-libraries/sequence-field/replaceRevisions.js +18 -31
  601. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  602. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  603. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +0 -2
  604. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  605. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
  606. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  607. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +356 -182
  608. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  609. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  610. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +21 -63
  611. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  612. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  613. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  614. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  615. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  616. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -2
  617. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  618. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
  619. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  620. package/lib/feature-libraries/sequence-field/types.d.ts +30 -59
  621. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  622. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  623. package/lib/feature-libraries/sequence-field/utils.d.ts +15 -24
  624. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  625. package/lib/feature-libraries/sequence-field/utils.js +112 -298
  626. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  627. package/lib/index.d.ts +3 -2
  628. package/lib/index.d.ts.map +1 -1
  629. package/lib/index.js +2 -1
  630. package/lib/index.js.map +1 -1
  631. package/lib/packageVersion.d.ts +1 -1
  632. package/lib/packageVersion.d.ts.map +1 -1
  633. package/lib/packageVersion.js +1 -1
  634. package/lib/packageVersion.js.map +1 -1
  635. package/lib/shared-tree/index.d.ts +1 -1
  636. package/lib/shared-tree/index.d.ts.map +1 -1
  637. package/lib/shared-tree/index.js.map +1 -1
  638. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  639. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  640. package/lib/shared-tree/schematizeTree.js +3 -2
  641. package/lib/shared-tree/schematizeTree.js.map +1 -1
  642. package/lib/shared-tree/schematizingTreeView.d.ts +1 -5
  643. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  644. package/lib/shared-tree/schematizingTreeView.js +41 -38
  645. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  646. package/lib/shared-tree/sharedTree.d.ts +9 -3
  647. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  648. package/lib/shared-tree/sharedTree.js +11 -0
  649. package/lib/shared-tree/sharedTree.js.map +1 -1
  650. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  651. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  652. package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -0
  653. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  654. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  655. package/lib/shared-tree/sharedTreeChangeEnricher.js +2 -2
  656. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  657. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +5 -5
  658. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  659. package/lib/shared-tree/sharedTreeChangeFamily.js +11 -5
  660. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  661. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
  662. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  663. package/lib/shared-tree/sharedTreeEditBuilder.js +12 -6
  664. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  665. package/lib/shared-tree/treeCheckout.d.ts +9 -10
  666. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  667. package/lib/shared-tree/treeCheckout.js +66 -11
  668. package/lib/shared-tree/treeCheckout.js.map +1 -1
  669. package/lib/shared-tree-core/branch.d.ts +3 -2
  670. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  671. package/lib/shared-tree-core/branch.js +9 -4
  672. package/lib/shared-tree-core/branch.js.map +1 -1
  673. package/lib/shared-tree-core/editManager.d.ts +2 -2
  674. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  675. package/lib/shared-tree-core/editManager.js +20 -14
  676. package/lib/shared-tree-core/editManager.js.map +1 -1
  677. package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -0
  678. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  679. package/lib/shared-tree-core/editManagerCodecs.js +8 -1
  680. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  681. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +1 -0
  682. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  683. package/lib/shared-tree-core/editManagerFormatCommons.js +6 -0
  684. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  685. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  686. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  687. package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -0
  688. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  689. package/lib/shared-tree-core/index.d.ts +2 -2
  690. package/lib/shared-tree-core/index.d.ts.map +1 -1
  691. package/lib/shared-tree-core/index.js +2 -2
  692. package/lib/shared-tree-core/index.js.map +1 -1
  693. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  694. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  695. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  696. package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
  697. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  698. package/lib/shared-tree-core/messageCodecs.js +8 -1
  699. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  700. package/lib/shared-tree-core/messageFormat.d.ts +1 -0
  701. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  702. package/lib/shared-tree-core/messageFormat.js +6 -0
  703. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  704. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  705. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  706. package/lib/shared-tree-core/messageFormatV1ToV4.js +1 -0
  707. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  708. package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -0
  709. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  710. package/lib/shared-tree-core/sharedTreeCore.js +1 -1
  711. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  712. package/lib/simple-tree/api/index.d.ts +1 -1
  713. package/lib/simple-tree/api/index.d.ts.map +1 -1
  714. package/lib/simple-tree/api/index.js +1 -1
  715. package/lib/simple-tree/api/index.js.map +1 -1
  716. package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -1
  717. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  718. package/lib/simple-tree/api/schemaFactoryBeta.js +1 -1
  719. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  720. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +4 -4
  721. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  722. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  723. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  724. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +270 -0
  725. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  726. package/lib/simple-tree/api/tree.d.ts +3 -1
  727. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  728. package/lib/simple-tree/api/tree.js.map +1 -1
  729. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  730. package/lib/simple-tree/core/treeNodeKernel.js +6 -2
  731. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  732. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  733. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  734. package/lib/simple-tree/core/unhydratedFlexTree.js +58 -8
  735. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  736. package/lib/simple-tree/fieldSchema.d.ts +4 -4
  737. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  738. package/lib/simple-tree/fieldSchema.js.map +1 -1
  739. package/lib/simple-tree/index.d.ts +3 -3
  740. package/lib/simple-tree/index.d.ts.map +1 -1
  741. package/lib/simple-tree/index.js +2 -2
  742. package/lib/simple-tree/index.js.map +1 -1
  743. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  744. package/lib/simple-tree/node-kinds/array/arrayNode.js +8 -6
  745. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  746. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  747. package/lib/simple-tree/node-kinds/common.js +2 -2
  748. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  749. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  750. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  751. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  752. package/lib/simple-tree/node-kinds/object/objectNode.js +20 -20
  753. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  754. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  755. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -2
  756. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  757. package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
  758. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  759. package/lib/simple-tree/prepareForInsertion.js +184 -125
  760. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  761. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
  762. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  763. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +28 -11
  764. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  765. package/lib/text/index.d.ts +6 -0
  766. package/lib/text/index.d.ts.map +1 -0
  767. package/lib/text/index.js +6 -0
  768. package/lib/text/index.js.map +1 -0
  769. package/lib/text/textDomain.d.ts +138 -0
  770. package/lib/text/textDomain.d.ts.map +1 -0
  771. package/lib/text/textDomain.js +118 -0
  772. package/lib/text/textDomain.js.map +1 -0
  773. package/lib/treeFactory.d.ts.map +1 -1
  774. package/lib/treeFactory.js +13 -3
  775. package/lib/treeFactory.js.map +1 -1
  776. package/lib/util/bTreeUtils.d.ts +12 -4
  777. package/lib/util/bTreeUtils.d.ts.map +1 -1
  778. package/lib/util/bTreeUtils.js +15 -19
  779. package/lib/util/bTreeUtils.js.map +1 -1
  780. package/lib/util/index.d.ts +1 -1
  781. package/lib/util/index.d.ts.map +1 -1
  782. package/lib/util/index.js +1 -1
  783. package/lib/util/index.js.map +1 -1
  784. package/lib/util/nestedMap.js +12 -12
  785. package/lib/util/nestedMap.js.map +1 -1
  786. package/lib/util/rangeMap.d.ts +24 -12
  787. package/lib/util/rangeMap.d.ts.map +1 -1
  788. package/lib/util/rangeMap.js +44 -5
  789. package/lib/util/rangeMap.js.map +1 -1
  790. package/package.json +25 -25
  791. package/src/core/change-family/changeFamily.ts +5 -0
  792. package/src/core/change-family/index.ts +1 -0
  793. package/src/core/index.ts +6 -1
  794. package/src/core/rebase/changeRebaser.ts +6 -1
  795. package/src/core/rebase/index.ts +3 -0
  796. package/src/core/rebase/types.ts +65 -21
  797. package/src/core/rebase/utils.ts +39 -11
  798. package/src/core/tree/anchorSet.ts +1 -0
  799. package/src/core/tree/detachedFieldIndex.ts +17 -1
  800. package/src/core/tree/index.ts +2 -1
  801. package/src/core/tree/pathTree.ts +16 -4
  802. package/src/core/tree/visitDelta.ts +6 -2
  803. package/src/core/tree/visitorUtils.ts +55 -19
  804. package/src/feature-libraries/changeAtomIdBTree.ts +37 -5
  805. package/src/feature-libraries/chunked-forest/basicChunk.ts +7 -1
  806. package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
  807. package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -1
  808. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +1 -0
  809. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +399 -127
  810. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +13 -5
  811. package/src/feature-libraries/default-schema/index.ts +17 -5
  812. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +188 -0
  813. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +35 -9
  814. package/src/feature-libraries/deltaUtils.ts +6 -1
  815. package/src/feature-libraries/flex-tree/context.ts +17 -0
  816. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
  817. package/src/feature-libraries/flex-tree/lazyField.ts +68 -25
  818. package/src/feature-libraries/forest-summary/forestSummarizer.ts +3 -1
  819. package/src/feature-libraries/index.ts +22 -8
  820. package/src/feature-libraries/mapTreeCursor.ts +2 -1
  821. package/src/feature-libraries/mitigatedChangeFamily.ts +3 -1
  822. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
  823. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +32 -58
  824. package/src/feature-libraries/modular-schema/genericFieldKind.ts +6 -18
  825. package/src/feature-libraries/modular-schema/index.ts +16 -15
  826. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +560 -351
  827. package/src/feature-libraries/modular-schema/modularChangeCodecV3.ts +760 -0
  828. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +14 -1
  829. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2620 -782
  830. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +1 -0
  831. package/src/feature-libraries/modular-schema/modularChangeFormatV3.ts +62 -0
  832. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +58 -11
  833. package/src/feature-libraries/object-forest/objectForest.ts +3 -1
  834. package/src/feature-libraries/optional-field/index.ts +1 -3
  835. package/src/feature-libraries/optional-field/optionalField.ts +318 -562
  836. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +45 -0
  837. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +24 -38
  838. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
  839. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +94 -0
  840. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -1
  841. package/src/feature-libraries/sequence-field/compose.ts +139 -522
  842. package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
  843. package/src/feature-libraries/sequence-field/index.ts +0 -9
  844. package/src/feature-libraries/sequence-field/invert.ts +103 -228
  845. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  846. package/src/feature-libraries/sequence-field/moveEffectTable.ts +8 -195
  847. package/src/feature-libraries/sequence-field/rebase.ts +169 -205
  848. package/src/feature-libraries/sequence-field/replaceRevisions.ts +25 -47
  849. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
  850. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +648 -228
  851. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -70
  852. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +25 -27
  853. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +19 -129
  854. package/src/feature-libraries/sequence-field/types.ts +34 -64
  855. package/src/feature-libraries/sequence-field/utils.ts +139 -353
  856. package/src/index.ts +7 -0
  857. package/src/packageVersion.ts +1 -1
  858. package/src/shared-tree/index.ts +3 -2
  859. package/src/shared-tree/schematizeTree.ts +21 -8
  860. package/src/shared-tree/schematizingTreeView.ts +56 -70
  861. package/src/shared-tree/sharedTree.ts +20 -3
  862. package/src/shared-tree/sharedTreeChangeCodecs.ts +5 -1
  863. package/src/shared-tree/sharedTreeChangeEnricher.ts +2 -0
  864. package/src/shared-tree/sharedTreeChangeFamily.ts +15 -5
  865. package/src/shared-tree/sharedTreeEditBuilder.ts +39 -8
  866. package/src/shared-tree/treeCheckout.ts +95 -24
  867. package/src/shared-tree-core/branch.ts +13 -3
  868. package/src/shared-tree-core/editManager.ts +42 -28
  869. package/src/shared-tree-core/editManagerCodecs.ts +11 -1
  870. package/src/shared-tree-core/editManagerFormatCommons.ts +6 -0
  871. package/src/shared-tree-core/editManagerFormatV1toV4.ts +3 -1
  872. package/src/shared-tree-core/index.ts +2 -0
  873. package/src/shared-tree-core/messageCodecV1ToV4.ts +2 -1
  874. package/src/shared-tree-core/messageCodecs.ts +11 -1
  875. package/src/shared-tree-core/messageFormat.ts +6 -0
  876. package/src/shared-tree-core/messageFormatV1ToV4.ts +3 -1
  877. package/src/shared-tree-core/sharedTreeCore.ts +4 -1
  878. package/src/simple-tree/api/index.ts +3 -0
  879. package/src/simple-tree/api/schemaFactoryAlpha.ts +1 -1
  880. package/src/simple-tree/api/schemaFactoryBeta.ts +1 -1
  881. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +4 -4
  882. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +501 -0
  883. package/src/simple-tree/api/tree.ts +3 -1
  884. package/src/simple-tree/core/treeNodeKernel.ts +6 -2
  885. package/src/simple-tree/core/unhydratedFlexTree.ts +87 -36
  886. package/src/simple-tree/fieldSchema.ts +6 -4
  887. package/src/simple-tree/index.ts +5 -1
  888. package/src/simple-tree/node-kinds/array/arrayNode.ts +9 -7
  889. package/src/simple-tree/node-kinds/common.ts +2 -5
  890. package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
  891. package/src/simple-tree/node-kinds/object/objectNode.ts +26 -26
  892. package/src/simple-tree/node-kinds/record/recordNode.ts +10 -9
  893. package/src/simple-tree/prepareForInsertion.ts +343 -201
  894. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +43 -15
  895. package/src/text/README.md +8 -0
  896. package/src/text/index.ts +6 -0
  897. package/src/text/textDomain.ts +199 -0
  898. package/src/treeFactory.ts +14 -4
  899. package/src/util/bTreeUtils.ts +33 -22
  900. package/src/util/index.ts +3 -0
  901. package/src/util/nestedMap.ts +12 -12
  902. package/src/util/rangeMap.ts +72 -18
  903. package/.eslintrc.cjs +0 -125
  904. package/assertTagging.config.mjs +0 -14
  905. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  906. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  907. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
  908. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  909. package/docs/main/sequence-field/move-composition.md +0 -46
  910. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
  911. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
  912. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
  913. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
  914. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
@@ -5,13 +5,13 @@
5
5
  export { typeNameSymbol, typeSchemaSymbol, contentSchemaSymbol, type WithType, type TreeNodeSchema, type AnnotatedAllowedType, type AllowedTypesFullEvaluated, NodeKind, type TreeNodeSchemaClass, type TreeNodeSchemaNonClass, type TreeNodeSchemaCore, TreeNode, type Unhydrated, type InternalTreeNode, isTreeNode, tryDisposeTreeNode, HydratedContext, SimpleContextSlot, getInnerNode, getOrCreateNodeFromInnerNode, getOrCreateNodeFromInnerUnboxedNode, getKernel, type NodeFromSchema, isTreeNodeSchemaClass, type TreeNodeFromImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, type AllowedTypes, type InsertableTreeNodeFromAllowedTypes, type InsertableTypedNode, type NodeBuilderData, type Input, normalizeAllowedTypes, type NodeSchemaMetadata, type ImplicitAllowedTypes, type AllowedTypesMetadata, evaluateLazySchema, type UnannotateAllowedTypesList, type AllowedTypeMetadata, type AnnotatedAllowedTypes, SchemaUpgrade, type LazyItem, type FlexList, type FlexListToUnion, type ExtractItemType, walkNodeSchema, walkAllowedTypes, type SchemaVisitor, type SimpleNodeSchemaBase, withBufferedTreeEvents, type AnnotateAllowedTypesList, type AllowedTypesFull, type AllowedTypesFullFromMixed, AnnotatedAllowedTypesInternal, type NumberKeys, ExpectStored, createSchemaUpgrade, } from "./core/index.js";
6
6
  export { walkFieldSchema } from "./walkFieldSchema.js";
7
7
  export type { UnsafeUnknownSchema, Insertable } from "./unsafeUnknownSchema.js";
8
- export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, TreeViewConfigurationAlpha, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, scoped, SchemaFactoryBeta, type SchemaStaticsBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, treeNodeApi, type TreeNodeApi, type NodeChangedData, borrowCursorFromTreeNodeOrValue, exportConcise, importConcise, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, type TreeSchemaEncodingOptions, getJsonSchema, getSimpleSchema, type VerboseTreeNode, type TreeEncodingOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, SchemaCompatibilityTester, type Unenforced, type System_Unsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type UnannotateAllowedTypeUnsafe, type AnnotatedAllowedTypeUnsafe, type AnnotatedAllowedTypesUnsafe, type AllowedTypesFullUnsafe, type AllowedTypesFullFromMixedUnsafe, type UnannotateAllowedTypesListUnsafe, type AnnotateAllowedTypesListUnsafe, type TreeViewAlpha, type TreeViewBeta, type TreeBranch, type TreeBranchAlpha, type TreeBranchEvents, getPropertyKeyFromStoredKey, getStoredKey, tryGetSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, conciseFromCursor, createFromCursor, asTreeViewAlpha, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type TransactionConstraintAlpha, type NodeInDocumentConstraint, type NoChangeConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type FieldSchemaAlphaUnsafe, getIdentifierFromNode, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, schemaStatics, type TreeChangeEvents, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, KeyEncodingOptions, type TreeParsingOptions, incrementalSummaryHint, incrementalEncodingPolicyForAllowedTypes, type SchemaFactory_base, encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, eraseSchemaDetails, eraseSchemaDetailsSubclassable, } from "./api/index.js";
8
+ export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, TreeViewConfigurationAlpha, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, scoped, SchemaFactoryBeta, type SchemaStaticsBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, treeNodeApi, type TreeNodeApi, type NodeChangedData, borrowCursorFromTreeNodeOrValue, exportConcise, importConcise, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, type TreeSchemaEncodingOptions, getJsonSchema, getSimpleSchema, type VerboseTreeNode, type TreeEncodingOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, SchemaCompatibilityTester, type Unenforced, type System_Unsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type UnannotateAllowedTypeUnsafe, type AnnotatedAllowedTypeUnsafe, type AnnotatedAllowedTypesUnsafe, type AllowedTypesFullUnsafe, type AllowedTypesFullFromMixedUnsafe, type UnannotateAllowedTypesListUnsafe, type AnnotateAllowedTypesListUnsafe, type TreeViewAlpha, type TreeViewBeta, type TreeBranch, type TreeBranchAlpha, type TreeBranchEvents, getPropertyKeyFromStoredKey, getStoredKey, tryGetSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, conciseFromCursor, createFromCursor, asTreeViewAlpha, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type TransactionConstraintAlpha, type NodeInDocumentConstraint, type NoChangeConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type FieldSchemaAlphaUnsafe, getIdentifierFromNode, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, schemaStatics, type TreeChangeEvents, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, KeyEncodingOptions, type TreeParsingOptions, incrementalSummaryHint, incrementalEncodingPolicyForAllowedTypes, type SchemaFactory_base, encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, eraseSchemaDetails, eraseSchemaDetailsSubclassable, checkSchemaCompatibilitySnapshots, type SnapshotFileSystem, type SchemaCompatibilitySnapshotsOptions, } from "./api/index.js";
9
9
  export type { SimpleTreeSchema, SimpleNodeSchema, SimpleFieldSchema, SimpleLeafNodeSchema, SimpleMapNodeSchema, SimpleArrayNodeSchema, SimpleObjectNodeSchema, SimpleNodeSchemaBaseAlpha, SimpleObjectFieldSchema, SimpleRecordNodeSchema, SimpleAllowedTypeAttributes, SchemaType, } from "./simpleSchema.js";
10
10
  export { type ImplicitFieldSchema, type TreeFieldFromImplicitField, FieldKind, FieldSchema, FieldSchemaAlpha, type InsertableTreeFieldFromImplicitField, type DefaultProvider, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, areFieldSchemaEqual, areImplicitFieldSchemaEqual, type ApplyKind, type FieldSchemaMetadata, type InsertableField, type ApplyKindInput, type ReadableField, type ReadSchema, } from "./fieldSchema.js";
11
11
  export { tryGetTreeNodeForField } from "./getTreeNodeForField.js";
12
12
  export { type ArrayNodeCustomizableSchema, type ArrayNodePojoEmulationSchema, ArrayNodeSchema, asIndex, isArrayNodeSchema, IterableTreeArrayContent, type ReadonlyArrayNode, TreeArrayNode, type MapNodeCustomizableSchema, type MapNodePojoEmulationSchema, MapNodeSchema, isMapNodeSchema, type TreeMapNode, type MapNodeInsertableData, type FieldHasDefault, type InsertableObjectFromSchemaRecord, type ObjectFromSchemaRecord, ObjectNodeSchema, type ObjectNodeSchemaPrivate, objectSchema, isObjectNodeSchema, type TreeObjectNode, setField, isRecordNodeSchema, type RecordNodeCustomizableSchema, type RecordNodeInsertableData, type RecordNodePojoEmulationSchema, RecordNodeSchema, type TreeRecordNode, } from "./node-kinds/index.js";
13
- export { unhydratedFlexTreeFromInsertable, type InsertableContent, type FactoryContent, type FactoryContentObject, } from "./unhydratedFlexTreeFromInsertable.js";
14
- export { prepareForInsertion, prepareForInsertionContextless, } from "./prepareForInsertion.js";
13
+ export { flexTreeFromInsertable as unhydratedFlexTreeFromInsertable, type InsertableContent, type FactoryContent, type FactoryContentObject, } from "./unhydratedFlexTreeFromInsertable.js";
14
+ export { prepareForInsertion, prepareForInsertionContextless, type PreparedContent, } from "./prepareForInsertion.js";
15
15
  export { toStoredSchema, convertFieldKind, toUpgradeSchema, toInitialSchema, toUnhydratedSchema, restrictiveStoredSchemaGenerationOptions, permissiveStoredSchemaGenerationOptions, } from "./toStoredSchema.js";
16
16
  export { numberSchema, stringSchema, booleanSchema, handleSchema, nullSchema, } from "./leafNodeSchema.js";
17
17
  export type { LeafSchema } from "./leafNodeSchema.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,QAAQ,EACR,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,4BAA4B,EAC5B,mCAAmC,EACnC,SAAS,EACT,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,gCAAgC,EACrC,KAAK,0CAA0C,EAC/C,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,kCAAkC,EACvC,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,cAA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AwB,EAC7B,KAAK,6BAA6B,EAClC,gBAAgB,EAChB,KAAK,cAAc,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,gCAAgC,EAChC,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,mBAAmB,EACnB,8BAA8B,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,wCAAwC,EACxC,uCAAuC,GACvC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,GACV,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,QAAQ,EACR,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,4BAA4B,EAC5B,mCAAmC,EACnC,SAAS,EACT,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,gCAAgC,EACrC,KAAK,0CAA0C,EAC/C,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KA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O,EACP,iBAAiB,EACjB,wBAAwB,EACxB,KAAK,iBAAiB,EACtB,aAAa,EACb,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,aAAa,EACb,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,YAAY,EACZ,kBAAkB,EAClB,KAAK,cAAc,EACnB,QAAQ,EACR,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,gBAAgB,EAChB,KAAK,cAAc,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,sBAAsB,IAAI,gCAAgC,EAC1D,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,mBAAmB,EACnB,8BAA8B,EAC9B,KAAK,eAAe,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,wCAAwC,EACxC,uCAAuC,GACvC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,GACV,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -5,8 +5,8 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.applySchemaToParserOptions = exports.tryGetSchema = exports.getStoredKey = exports.getPropertyKeyFromStoredKey = exports.SchemaCompatibilityTester = exports.comparePersistedSchema = exports.extractPersistedSchema = exports.getSimpleSchema = exports.getJsonSchema = exports.trackDirtyNodes = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.TreeBeta = exports.importConcise = exports.exportConcise = exports.borrowCursorFromTreeNodeOrValue = exports.treeNodeApi = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.SchemaFactoryAlpha = exports.SchemaFactoryBeta = exports.scoped = exports.SchemaFactory = exports.TreeViewConfigurationAlpha = exports.TreeViewConfiguration = exports.walkFieldSchema = exports.createSchemaUpgrade = exports.ExpectStored = exports.AnnotatedAllowedTypesInternal = exports.withBufferedTreeEvents = exports.walkAllowedTypes = exports.walkNodeSchema = exports.SchemaUpgrade = exports.evaluateLazySchema = exports.normalizeAllowedTypes = exports.isTreeNodeSchemaClass = exports.getKernel = exports.getOrCreateNodeFromInnerUnboxedNode = exports.getOrCreateNodeFromInnerNode = exports.getInnerNode = exports.SimpleContextSlot = exports.HydratedContext = exports.tryDisposeTreeNode = exports.isTreeNode = exports.TreeNode = exports.NodeKind = exports.contentSchemaSymbol = exports.typeSchemaSymbol = exports.typeNameSymbol = void 0;
8
- exports.convertFieldKind = exports.toStoredSchema = exports.prepareForInsertionContextless = exports.prepareForInsertion = exports.unhydratedFlexTreeFromInsertable = exports.RecordNodeSchema = exports.isRecordNodeSchema = exports.setField = exports.isObjectNodeSchema = exports.objectSchema = exports.ObjectNodeSchema = exports.isMapNodeSchema = exports.MapNodeSchema = exports.TreeArrayNode = exports.IterableTreeArrayContent = exports.isArrayNodeSchema = exports.asIndex = exports.ArrayNodeSchema = exports.tryGetTreeNodeForField = exports.areImplicitFieldSchemaEqual = exports.areFieldSchemaEqual = exports.normalizeFieldSchema = exports.FieldSchemaAlpha = exports.FieldSchema = exports.FieldKind = exports.eraseSchemaDetailsSubclassable = exports.eraseSchemaDetails = exports.checkCompatibility = exports.importCompatibilitySchemaSnapshot = exports.exportCompatibilitySchemaSnapshot = exports.decodeSchemaCompatibilitySnapshot = exports.encodeSchemaCompatibilitySnapshot = exports.incrementalEncodingPolicyForAllowedTypes = exports.incrementalSummaryHint = exports.KeyEncodingOptions = exports.schemaStatics = exports.getIdentifierFromNode = exports.allowUnused = exports.replaceVerboseTreeHandles = exports.replaceHandles = exports.replaceConciseTreeHandles = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.asTreeViewAlpha = exports.createFromCursor = exports.conciseFromCursor = exports.verboseFromCursor = exports.cursorFromVerbose = void 0;
9
- exports.createTreeSchema = exports.getUnhydratedContext = exports.nullSchema = exports.handleSchema = exports.booleanSchema = exports.stringSchema = exports.numberSchema = exports.permissiveStoredSchemaGenerationOptions = exports.restrictiveStoredSchemaGenerationOptions = exports.toUnhydratedSchema = exports.toInitialSchema = exports.toUpgradeSchema = void 0;
8
+ exports.toStoredSchema = exports.prepareForInsertionContextless = exports.prepareForInsertion = exports.unhydratedFlexTreeFromInsertable = exports.RecordNodeSchema = exports.isRecordNodeSchema = exports.setField = exports.isObjectNodeSchema = exports.objectSchema = exports.ObjectNodeSchema = exports.isMapNodeSchema = exports.MapNodeSchema = exports.TreeArrayNode = exports.IterableTreeArrayContent = exports.isArrayNodeSchema = exports.asIndex = exports.ArrayNodeSchema = exports.tryGetTreeNodeForField = exports.areImplicitFieldSchemaEqual = exports.areFieldSchemaEqual = exports.normalizeFieldSchema = exports.FieldSchemaAlpha = exports.FieldSchema = exports.FieldKind = exports.checkSchemaCompatibilitySnapshots = exports.eraseSchemaDetailsSubclassable = exports.eraseSchemaDetails = exports.checkCompatibility = exports.importCompatibilitySchemaSnapshot = exports.exportCompatibilitySchemaSnapshot = exports.decodeSchemaCompatibilitySnapshot = exports.encodeSchemaCompatibilitySnapshot = exports.incrementalEncodingPolicyForAllowedTypes = exports.incrementalSummaryHint = exports.KeyEncodingOptions = exports.schemaStatics = exports.getIdentifierFromNode = exports.allowUnused = exports.replaceVerboseTreeHandles = exports.replaceHandles = exports.replaceConciseTreeHandles = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.asTreeViewAlpha = exports.createFromCursor = exports.conciseFromCursor = exports.verboseFromCursor = exports.cursorFromVerbose = void 0;
9
+ exports.createTreeSchema = exports.getUnhydratedContext = exports.nullSchema = exports.handleSchema = exports.booleanSchema = exports.stringSchema = exports.numberSchema = exports.permissiveStoredSchemaGenerationOptions = exports.restrictiveStoredSchemaGenerationOptions = exports.toUnhydratedSchema = exports.toInitialSchema = exports.toUpgradeSchema = exports.convertFieldKind = void 0;
10
10
  var index_js_1 = require("./core/index.js");
11
11
  Object.defineProperty(exports, "typeNameSymbol", { enumerable: true, get: function () { return index_js_1.typeNameSymbol; } });
12
12
  Object.defineProperty(exports, "typeSchemaSymbol", { enumerable: true, get: function () { return index_js_1.typeSchemaSymbol; } });
@@ -85,6 +85,7 @@ Object.defineProperty(exports, "importCompatibilitySchemaSnapshot", { enumerable
85
85
  Object.defineProperty(exports, "checkCompatibility", { enumerable: true, get: function () { return index_js_2.checkCompatibility; } });
86
86
  Object.defineProperty(exports, "eraseSchemaDetails", { enumerable: true, get: function () { return index_js_2.eraseSchemaDetails; } });
87
87
  Object.defineProperty(exports, "eraseSchemaDetailsSubclassable", { enumerable: true, get: function () { return index_js_2.eraseSchemaDetailsSubclassable; } });
88
+ Object.defineProperty(exports, "checkSchemaCompatibilitySnapshots", { enumerable: true, get: function () { return index_js_2.checkSchemaCompatibilitySnapshots; } });
88
89
  var fieldSchema_js_1 = require("./fieldSchema.js");
89
90
  Object.defineProperty(exports, "FieldKind", { enumerable: true, get: function () { return fieldSchema_js_1.FieldKind; } });
90
91
  Object.defineProperty(exports, "FieldSchema", { enumerable: true, get: function () { return fieldSchema_js_1.FieldSchema; } });
@@ -109,7 +110,7 @@ Object.defineProperty(exports, "setField", { enumerable: true, get: function ()
109
110
  Object.defineProperty(exports, "isRecordNodeSchema", { enumerable: true, get: function () { return index_js_3.isRecordNodeSchema; } });
110
111
  Object.defineProperty(exports, "RecordNodeSchema", { enumerable: true, get: function () { return index_js_3.RecordNodeSchema; } });
111
112
  var unhydratedFlexTreeFromInsertable_js_1 = require("./unhydratedFlexTreeFromInsertable.js");
112
- Object.defineProperty(exports, "unhydratedFlexTreeFromInsertable", { enumerable: true, get: function () { return unhydratedFlexTreeFromInsertable_js_1.unhydratedFlexTreeFromInsertable; } });
113
+ Object.defineProperty(exports, "unhydratedFlexTreeFromInsertable", { enumerable: true, get: function () { return unhydratedFlexTreeFromInsertable_js_1.flexTreeFromInsertable; } });
113
114
  var prepareForInsertion_js_1 = require("./prepareForInsertion.js");
114
115
  Object.defineProperty(exports, "prepareForInsertion", { enumerable: true, get: function () { return prepareForInsertion_js_1.prepareForInsertion; } });
115
116
  Object.defineProperty(exports, "prepareForInsertionContextless", { enumerable: true, get: function () { return prepareForInsertion_js_1.prepareForInsertionContextless; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAEH,4CA0DyB;AAzDxB,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAChB,+GAAA,mBAAmB,OAAA;AAKnB,oGAAA,QAAQ,OAAA;AAIR,oGAAA,QAAQ,OAAA;AAGR,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,6GAAA,iBAAiB,OAAA;AACjB,wGAAA,YAAY,OAAA;AACZ,wHAAA,4BAA4B,OAAA;AAC5B,+HAAA,mCAAmC,OAAA;AACnC,qGAAA,SAAS,OAAA;AAET,iHAAA,qBAAqB,OAAA;AASrB,iHAAA,qBAAqB,OAAA;AAIrB,8GAAA,kBAAkB,OAAA;AAIlB,yGAAA,aAAa,OAAA;AAKb,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAGhB,kHAAA,sBAAsB,OAAA;AAItB,yHAAA,6BAA6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;AACZ,kHAAA,aAAa,OAAA;AACb,iHAAA,YAAY,OAAA;AACZ,+GAAA,UAAU,OAAA;AAGX,uDAA0D;AAAjD,wHAAA,oBAAoB,OAAA;AAC7B,iDAAoE;AAA1C,iHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\tcontentSchemaSymbol,\n\ttype WithType,\n\ttype TreeNodeSchema,\n\ttype AnnotatedAllowedType,\n\ttype AllowedTypesFullEvaluated,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n\tTreeNode,\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n\tisTreeNode,\n\ttryDisposeTreeNode,\n\tHydratedContext,\n\tSimpleContextSlot,\n\tgetInnerNode,\n\tgetOrCreateNodeFromInnerNode,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n\tgetKernel,\n\ttype NodeFromSchema,\n\tisTreeNodeSchemaClass,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype AllowedTypes,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype InsertableTypedNode,\n\ttype NodeBuilderData,\n\ttype Input,\n\tnormalizeAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype AllowedTypesMetadata,\n\tevaluateLazySchema,\n\ttype UnannotateAllowedTypesList,\n\ttype AllowedTypeMetadata,\n\ttype AnnotatedAllowedTypes,\n\tSchemaUpgrade,\n\ttype LazyItem,\n\ttype FlexList,\n\ttype FlexListToUnion,\n\ttype ExtractItemType,\n\twalkNodeSchema,\n\twalkAllowedTypes,\n\ttype SchemaVisitor,\n\ttype SimpleNodeSchemaBase,\n\twithBufferedTreeEvents,\n\ttype AnnotateAllowedTypesList,\n\ttype AllowedTypesFull,\n\ttype AllowedTypesFullFromMixed,\n\tAnnotatedAllowedTypesInternal,\n\ttype NumberKeys,\n\tExpectStored,\n\tcreateSchemaUpgrade,\n} from \"./core/index.js\";\nexport { walkFieldSchema } from \"./walkFieldSchema.js\";\nexport type { UnsafeUnknownSchema, Insertable } from \"./unsafeUnknownSchema.js\";\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\tSchemaFactory,\n\tscoped,\n\tSchemaFactoryBeta,\n\ttype SchemaStaticsBeta,\n\tSchemaFactoryAlpha,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype ScopedSchemaName,\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\ttype NodeChangedData,\n\tborrowCursorFromTreeNodeOrValue,\n\texportConcise,\n\timportConcise,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\ttype TreeSchemaEncodingOptions,\n\tgetJsonSchema,\n\tgetSimpleSchema,\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\tSchemaCompatibilityTester,\n\ttype Unenforced,\n\ttype System_Unsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\ttype UnannotateAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypesUnsafe,\n\ttype AllowedTypesFullUnsafe,\n\ttype AllowedTypesFullFromMixedUnsafe,\n\ttype UnannotateAllowedTypesListUnsafe,\n\ttype AnnotateAllowedTypesListUnsafe,\n\ttype TreeViewAlpha,\n\ttype TreeViewBeta,\n\ttype TreeBranch,\n\ttype TreeBranchAlpha,\n\ttype TreeBranchEvents,\n\tgetPropertyKeyFromStoredKey,\n\tgetStoredKey,\n\ttryGetSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\tconciseFromCursor,\n\tcreateFromCursor,\n\tasTreeViewAlpha,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype TransactionConstraintAlpha,\n\ttype NodeInDocumentConstraint,\n\ttype NoChangeConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype FieldSchemaAlphaUnsafe,\n\tgetIdentifierFromNode,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tschemaStatics,\n\ttype TreeChangeEvents,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n\tincrementalSummaryHint,\n\tincrementalEncodingPolicyForAllowedTypes,\n\ttype SchemaFactory_base,\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n} from \"./api/index.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBaseAlpha,\n\tSimpleObjectFieldSchema,\n\tSimpleRecordNodeSchema,\n\tSimpleAllowedTypeAttributes,\n\tSchemaType,\n} from \"./simpleSchema.js\";\nexport {\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\tFieldKind,\n\tFieldSchema,\n\tFieldSchemaAlpha,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\tareFieldSchemaEqual,\n\tareImplicitFieldSchemaEqual,\n\ttype ApplyKind,\n\ttype FieldSchemaMetadata,\n\ttype InsertableField,\n\ttype ApplyKindInput,\n\ttype ReadableField,\n\ttype ReadSchema,\n} from \"./fieldSchema.js\";\nexport { tryGetTreeNodeForField } from \"./getTreeNodeForField.js\";\nexport {\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\tasIndex,\n\tisArrayNodeSchema,\n\tIterableTreeArrayContent,\n\ttype ReadonlyArrayNode,\n\tTreeArrayNode,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\tisMapNodeSchema,\n\ttype TreeMapNode,\n\ttype MapNodeInsertableData,\n\ttype FieldHasDefault,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype ObjectFromSchemaRecord,\n\tObjectNodeSchema,\n\ttype ObjectNodeSchemaPrivate,\n\tobjectSchema,\n\tisObjectNodeSchema,\n\ttype TreeObjectNode,\n\tsetField,\n\tisRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\tRecordNodeSchema,\n\ttype TreeRecordNode,\n} from \"./node-kinds/index.js\";\nexport {\n\tunhydratedFlexTreeFromInsertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n} from \"./unhydratedFlexTreeFromInsertable.js\";\nexport {\n\tprepareForInsertion,\n\tprepareForInsertionContextless,\n} from \"./prepareForInsertion.js\";\nexport {\n\ttoStoredSchema,\n\tconvertFieldKind,\n\ttoUpgradeSchema,\n\ttoInitialSchema,\n\ttoUnhydratedSchema,\n\trestrictiveStoredSchemaGenerationOptions,\n\tpermissiveStoredSchemaGenerationOptions,\n} from \"./toStoredSchema.js\";\nexport {\n\tnumberSchema,\n\tstringSchema,\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n} from \"./leafNodeSchema.js\";\nexport type { LeafSchema } from \"./leafNodeSchema.js\";\nexport { getUnhydratedContext } from \"./createContext.js\";\nexport { type TreeSchema, createTreeSchema } from \"./treeSchema.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAEH,4CA0DyB;AAzDxB,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAChB,+GAAA,mBAAmB,O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A,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAElB,oGAAA,QAAQ,OAAA;AACR,8GAAA,kBAAkB,OAAA;AAIlB,4GAAA,gBAAgB,OAAA;AAGjB,6FAK+C;AAJ9C,uJAAA,sBAAsB,OAAoC;AAK3D,mEAIkC;AAHjC,6HAAA,mBAAmB,OAAA;AACnB,wIAAA,8BAA8B,OAAA;AAG/B,yDAQ6B;AAP5B,mHAAA,cAAc,OAAA;AACd,qHAAA,gBAAgB,OAAA;AAChB,oHAAA,eAAe,OAAA;AACf,oHAAA,eAAe,OAAA;AACf,uHAAA,kBAAkB,OAAA;AAClB,6IAAA,wCAAwC,OAAA;AACxC,4IAAA,uCAAuC,OAAA;AAExC,yDAM6B;AAL5B,iHAAA,YAAY,OAAA;AACZ,iHAAA,YAAY,OAAA;AACZ,kHAAA,aAAa,OAAA;AACb,iHAAA,YAAY,OAAA;AACZ,+GAAA,UAAU,OAAA;AAGX,uDAA0D;AAAjD,wHAAA,oBAAoB,OAAA;AAC7B,iDAAoE;AAA1C,iHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\tcontentSchemaSymbol,\n\ttype WithType,\n\ttype TreeNodeSchema,\n\ttype AnnotatedAllowedType,\n\ttype AllowedTypesFullEvaluated,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n\tTreeNode,\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n\tisTreeNode,\n\ttryDisposeTreeNode,\n\tHydratedContext,\n\tSimpleContextSlot,\n\tgetInnerNode,\n\tgetOrCreateNodeFromInnerNode,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n\tgetKernel,\n\ttype NodeFromSchema,\n\tisTreeNodeSchemaClass,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype AllowedTypes,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype InsertableTypedNode,\n\ttype NodeBuilderData,\n\ttype Input,\n\tnormalizeAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype AllowedTypesMetadata,\n\tevaluateLazySchema,\n\ttype UnannotateAllowedTypesList,\n\ttype AllowedTypeMetadata,\n\ttype AnnotatedAllowedTypes,\n\tSchemaUpgrade,\n\ttype LazyItem,\n\ttype FlexList,\n\ttype FlexListToUnion,\n\ttype ExtractItemType,\n\twalkNodeSchema,\n\twalkAllowedTypes,\n\ttype SchemaVisitor,\n\ttype SimpleNodeSchemaBase,\n\twithBufferedTreeEvents,\n\ttype AnnotateAllowedTypesList,\n\ttype AllowedTypesFull,\n\ttype AllowedTypesFullFromMixed,\n\tAnnotatedAllowedTypesInternal,\n\ttype NumberKeys,\n\tExpectStored,\n\tcreateSchemaUpgrade,\n} from \"./core/index.js\";\nexport { walkFieldSchema } from \"./walkFieldSchema.js\";\nexport type { UnsafeUnknownSchema, Insertable } from \"./unsafeUnknownSchema.js\";\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\tSchemaFactory,\n\tscoped,\n\tSchemaFactoryBeta,\n\ttype SchemaStaticsBeta,\n\tSchemaFactoryAlpha,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype ScopedSchemaName,\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\ttype NodeChangedData,\n\tborrowCursorFromTreeNodeOrValue,\n\texportConcise,\n\timportConcise,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\ttype TreeSchemaEncodingOptions,\n\tgetJsonSchema,\n\tgetSimpleSchema,\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\tSchemaCompatibilityTester,\n\ttype Unenforced,\n\ttype System_Unsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\ttype UnannotateAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypesUnsafe,\n\ttype AllowedTypesFullUnsafe,\n\ttype AllowedTypesFullFromMixedUnsafe,\n\ttype UnannotateAllowedTypesListUnsafe,\n\ttype AnnotateAllowedTypesListUnsafe,\n\ttype TreeViewAlpha,\n\ttype TreeViewBeta,\n\ttype TreeBranch,\n\ttype TreeBranchAlpha,\n\ttype TreeBranchEvents,\n\tgetPropertyKeyFromStoredKey,\n\tgetStoredKey,\n\ttryGetSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\tconciseFromCursor,\n\tcreateFromCursor,\n\tasTreeViewAlpha,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype TransactionConstraintAlpha,\n\ttype NodeInDocumentConstraint,\n\ttype NoChangeConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype FieldSchemaAlphaUnsafe,\n\tgetIdentifierFromNode,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tschemaStatics,\n\ttype TreeChangeEvents,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n\tincrementalSummaryHint,\n\tincrementalEncodingPolicyForAllowedTypes,\n\ttype SchemaFactory_base,\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n\tcheckSchemaCompatibilitySnapshots,\n\ttype SnapshotFileSystem,\n\ttype SchemaCompatibilitySnapshotsOptions,\n} from \"./api/index.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBaseAlpha,\n\tSimpleObjectFieldSchema,\n\tSimpleRecordNodeSchema,\n\tSimpleAllowedTypeAttributes,\n\tSchemaType,\n} from \"./simpleSchema.js\";\nexport {\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\tFieldKind,\n\tFieldSchema,\n\tFieldSchemaAlpha,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\tareFieldSchemaEqual,\n\tareImplicitFieldSchemaEqual,\n\ttype ApplyKind,\n\ttype FieldSchemaMetadata,\n\ttype InsertableField,\n\ttype ApplyKindInput,\n\ttype ReadableField,\n\ttype ReadSchema,\n} from \"./fieldSchema.js\";\nexport { tryGetTreeNodeForField } from \"./getTreeNodeForField.js\";\nexport {\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\tasIndex,\n\tisArrayNodeSchema,\n\tIterableTreeArrayContent,\n\ttype ReadonlyArrayNode,\n\tTreeArrayNode,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\tisMapNodeSchema,\n\ttype TreeMapNode,\n\ttype MapNodeInsertableData,\n\ttype FieldHasDefault,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype ObjectFromSchemaRecord,\n\tObjectNodeSchema,\n\ttype ObjectNodeSchemaPrivate,\n\tobjectSchema,\n\tisObjectNodeSchema,\n\ttype TreeObjectNode,\n\tsetField,\n\tisRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\tRecordNodeSchema,\n\ttype TreeRecordNode,\n} from \"./node-kinds/index.js\";\nexport {\n\tflexTreeFromInsertable as unhydratedFlexTreeFromInsertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n} from \"./unhydratedFlexTreeFromInsertable.js\";\nexport {\n\tprepareForInsertion,\n\tprepareForInsertionContextless,\n\ttype PreparedContent,\n} from \"./prepareForInsertion.js\";\nexport {\n\ttoStoredSchema,\n\tconvertFieldKind,\n\ttoUpgradeSchema,\n\ttoInitialSchema,\n\ttoUnhydratedSchema,\n\trestrictiveStoredSchemaGenerationOptions,\n\tpermissiveStoredSchemaGenerationOptions,\n} from \"./toStoredSchema.js\";\nexport {\n\tnumberSchema,\n\tstringSchema,\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n} from \"./leafNodeSchema.js\";\nexport type { LeafSchema } from \"./leafNodeSchema.js\";\nexport { getUnhydratedContext } from \"./createContext.js\";\nexport { type TreeSchema, createTreeSchema } from \"./treeSchema.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"arrayNode.d.ts","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/array/arrayNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,OAAO,EAEN,KAAK,QAAQ,EAGb,QAAQ,EACR,KAAK,QAAQ,EAab,KAAK,oBAAoB,EACzB,KAAK,0CAA0C,EAE/C,KAAK,aAAa,EAClB,KAAK,gCAAgC,EAIrC,KAAK,yBAAyB,EAO9B,MAAM,qBAAqB,CAAC;AAY7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EACX,2BAA2B,EAC3B,4BAA4B,EAE5B,MAAM,qBAAqB,CAAC;AAU7B;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,GAAG,aAAa,CAClE,SAAQ,aAAa,CAAC,CAAC,CAAC,EACvB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;CAAG;AAEzD;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa,CAC7B,aAAa,SAAS,aAAa,CAAC,0BAA0B,GAAG,oBAAoB,EACrF,GA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ArrayFeaturesUntyped extends index_js_3.TreeNodeValid {
123
123
  }
124
124
  // Modify TreeNodeWithArrayFeaturesUntyped to add the members from Array.prototype
125
- arrayPrototypeKeys.forEach((key) => {
125
+ for (const key of arrayPrototypeKeys) {
126
126
  Object.defineProperty(TreeNodeWithArrayFeaturesUntyped.prototype, key, {
127
127
  value: Array.prototype[key],
128
128
  });
129
- });
129
+ }
130
130
  return TreeNodeWithArrayFeaturesUntyped;
131
131
  })();
132
132
  /* eslint-enable @typescript-eslint/explicit-member-accessibility, @typescript-eslint/no-explicit-any */
@@ -317,8 +317,10 @@ class CustomArrayNodeBase extends TreeNodeWithArrayFeatures {
317
317
  insertAt(index, ...value) {
318
318
  const field = getSequenceField(this);
319
319
  (0, index_js_4.validateIndex)(index, field, "TreeArrayNode.insertAt", true);
320
- const content = __classPrivateFieldGet(this, _CustomArrayNodeBase_instances, "m", _CustomArrayNodeBase_mapTreesFromFieldData).call(this, value);
321
- field.editor.insert(index, content);
320
+ field.context.runInTransaction(() => {
321
+ const content = __classPrivateFieldGet(this, _CustomArrayNodeBase_instances, "m", _CustomArrayNodeBase_mapTreesFromFieldData).call(this, value);
322
+ field.editor.attach(index, content);
323
+ });
322
324
  }
323
325
  insertAtStart(...value) {
324
326
  this.insertAt(0, ...value);
@@ -556,7 +558,7 @@ function arrayChildToFlexTree(child, allowedTypes) {
556
558
  throw new TypeError(`Received unsupported array entry value: ${child}.`);
557
559
  }
558
560
  }
559
- return (0, unhydratedFlexTreeFromInsertable_js_1.unhydratedFlexTreeFromInsertableNode)(childWithFallback, allowedTypes);
561
+ return (0, unhydratedFlexTreeFromInsertable_js_1.flexTreeFromInsertableNode)(childWithFallback, allowedTypes);
560
562
  }
561
563
  /**
562
564
  * {@link TreeNodeSchemaInitializedData.toFlexContent} for Array nodes.
@@ -1 +1 @@
1
- {"version":3,"file":"arrayNode.js","sourceRoot":"","sources":["../../../../src/simple-tree/node-kinds/array/arrayNode.ts"],"names":[],"mappings":";AAAA;;;GAG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,sBAAW,EAAC,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,6BAAkB,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,IAAI,IAAI,YAAY,GAAG,EAAE,CAAC;QACzB,4KAA4K;QAC5K,OAAO,6BAAkB,CAAC,GAAG,CAAC;IAC/B,CAAC;IAED,IAAI,MAAM,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC7B,OAAO,6BAAkB,CAAC,MAAM,CAAC;IAClC,CAAC;IAED,OAAO,6BAAkB,CAAC,IAAI,CAAC;AAChC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Lazy, oob, fail, assert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { EmptyKey, ObjectNodeStoredSchema } from \"../../../core/index.js\";\nimport type {\n\tFlexibleFieldContent,\n\tFlexTreeNode,\n\tFlexTreeSequenceField,\n} from \"../../../feature-libraries/index.js\";\nimport { FieldKinds, isTreeValue } from \"../../../feature-libraries/index.js\";\nimport {\n\tCompatibilityLevel,\n\ttype WithType,\n\t// eslint-disable-next-line import-x/no-deprecated\n\ttypeNameSymbol,\n\tNodeKind,\n\ttype TreeNode,\n\ttype InternalTreeNode,\n\ttype TreeNodeSchema,\n\ttypeSchemaSymbol,\n\tgetOrCreateNodeFromInnerNode,\n\tgetSimpleNodeSchemaFromInnerNode,\n\tgetInnerNode,\n\ttype TreeNodeSchemaClass,\n\tgetKernel,\n\ttype UnhydratedFlexTreeNode,\n\tUnhydratedSequenceField,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n\tnormalizeAllowedTypes,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype TreeLeafValue,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\tTreeNodeValid,\n\ttype MostDerivedData,\n\ttype TreeNodeSchemaInitializedData,\n\ttype TreeNodeSchemaCorePrivate,\n\tprivateDataSymbol,\n\tcreateTreeNodeSchemaPrivateData,\n\ttype FlexContent,\n\ttype TreeNodeSchemaPrivateData,\n\twithBufferedTreeEvents,\n\tAnnotatedAllowedTypesInternal,\n} from \"../../core/index.js\";\nimport {\n\ttype FactoryContent,\n\ttype InsertableContent,\n\tunhydratedFlexTreeFromInsertable,\n\tunhydratedFlexTreeFromInsertableNode,\n} from \"../../unhydratedFlexTreeFromInsertable.js\";\nimport { prepareArrayContentForInsertion } from \"../../prepareForInsertion.js\";\nimport {\n\tgetTreeNodeSchemaInitializedData,\n\tgetUnhydratedContext,\n} from \"../../createContext.js\";\nimport type { NodeSchemaOptionsAlpha, System_Unsafe } from \"../../api/index.js\";\nimport type {\n\tArrayNodeCustomizableSchema,\n\tArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n} from \"./arrayNodeTypes.js\";\nimport {\n\tbrand,\n\tvalidateIndex,\n\tvalidateIndexRange,\n\ttype JsonCompatibleReadOnlyObject,\n} from \"../../../util/index.js\";\nimport { nullSchema } from \"../../leafNodeSchema.js\";\nimport type { SchemaType, SimpleAllowedTypeAttributes } from \"../../simpleSchema.js\";\n\n/**\n * A covariant base type for {@link (TreeArrayNode:interface)}.\n *\n * This provides the readonly subset of TreeArrayNode functionality, and is used as the source interface for moves since that needs to be covariant.\n * @privateRemarks\n * Ideally this would just include `TreeNode, WithType<string, NodeKind.Array>` in the extends list but https://github.com/microsoft/TypeScript/issues/16936 prevents that from compiling.\n * As a workaround around for this TypeScript limitation, the conflicting type intersection is wrapped in `Awaited` (which has no effect on the type in this case) which allows it to compile.\n * @system @sealed @public\n */\nexport interface ReadonlyArrayNode<out T = TreeNode | TreeLeafValue>\n\textends ReadonlyArray<T>,\n\t\tAwaited<TreeNode & WithType<string, NodeKind.Array>> {}\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 * @typeParam T - Use Default: Do not specify. Type of values to read from the array.\n * @typeParam TNew - Use Default: Do not specify. Type of values to write into the array.\n * @typeParam TMoveFrom - Use Default: Do not specify. Type of node from which children can be moved into this array.\n *\n * @sealed @public\n */\nexport interface TreeArrayNode<\n\tTAllowedTypes extends System_Unsafe.ImplicitAllowedTypesUnsafe = ImplicitAllowedTypes,\n\tout T = [TAllowedTypes] extends [ImplicitAllowedTypes]\n\t\t? TreeNodeFromImplicitAllowedTypes<TAllowedTypes>\n\t\t: TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>,\n\tin TNew = [TAllowedTypes] extends [ImplicitAllowedTypes]\n\t\t? InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes>\n\t\t: InsertableTreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>,\n\tin TMoveFrom = ReadonlyArrayNode,\n> extends ReadonlyArrayNode<T> {\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 *\n\t * WARNING - This API is easily misused.\n\t * Please read the documentation for the `destinationGap` parameter carefully.\n\t *\n\t * @param destinationGap - The location *between* existing items that the moved item should be moved to.\n\t *\n\t * WARNING - `destinationGap` describes a location between existing items *prior to applying the move operation*.\n\t *\n\t * For example, if the array contains items `[A, B, C]` before the move, the `destinationGap` must be one of the following:\n\t *\n\t * - `0` (between the start of the array and `A`'s original position)\n\t *\n\t * - `1` (between `A`'s original position and `B`'s original position)\n\t *\n\t * - `2` (between `B`'s original position and `C`'s original position)\n\t *\n\t * - `3` (between `C`'s original position and the end of the array)\n\t *\n\t * So moving `A` between `B` and `C` would require `destinationGap` to be `2`.\n\t *\n\t * This interpretation of `destinationGap` makes it easy to specify the desired destination relative to a sibling item that is not being moved,\n\t * or relative to the start or end of the array:\n\t *\n\t * - Move to the start of the array: `array.moveToIndex(0, ...)` (see also `moveToStart`)\n\t *\n\t * - Move to before some item X: `array.moveToIndex(indexOfX, ...)`\n\t *\n\t * - Move to after some item X: `array.moveToIndex(indexOfX + 1`, ...)\n\t *\n\t * - Move to the end of the array: `array.moveToIndex(array.length, ...)` (see also `moveToEnd`)\n\t *\n\t * This interpretation of `destinationGap` does however make it less obvious how to move an item relative to its current position:\n\t *\n\t * - Move item B before its predecessor: `array.moveToIndex(indexOfB - 1, ...)`\n\t *\n\t * - Move item B after its successor: `array.moveToIndex(indexOfB + 2, ...)`\n\t *\n\t * Notice the asymmetry between `-1` and `+2` in the above examples.\n\t * In such scenarios, it can often be easier to approach such edits by swapping adjacent items:\n\t * If items A and B are adjacent, such that A precedes B,\n\t * then they can be swapped with `array.moveToIndex(indexOfA, indexOfB)`.\n\t *\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(destinationGap: number, sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the desired location in the array.\n\t *\n\t * WARNING - This API is easily misused.\n\t * Please read the documentation for the `destinationGap` parameter carefully.\n\t *\n\t * @param destinationGap - The location *between* existing items that the moved item should be moved to.\n\t *\n\t * WARNING - `destinationGap` describes a location between existing items *prior to applying the move operation*.\n\t *\n\t * For example, if the array contains items `[A, B, C]` before the move, the `destinationGap` must be one of the following:\n\t *\n\t * - `0` (between the start of the array and `A`'s original position)\n\t *\n\t * - `1` (between `A`'s original position and `B`'s original position)\n\t *\n\t * - `2` (between `B`'s original position and `C`'s original position)\n\t *\n\t * - `3` (between `C`'s original position and the end of the array)\n\t *\n\t * So moving `A` between `B` and `C` would require `destinationGap` to be `2`.\n\t *\n\t * This interpretation of `destinationGap` makes it easy to specify the desired destination relative to a sibling item that is not being moved,\n\t * or relative to the start or end of the array:\n\t *\n\t * - Move to the start of the array: `array.moveToIndex(0, ...)` (see also `moveToStart`)\n\t *\n\t * - Move to before some item X: `array.moveToIndex(indexOfX, ...)`\n\t *\n\t * - Move to after some item X: `array.moveToIndex(indexOfX + 1`, ...)\n\t *\n\t * - Move to the end of the array: `array.moveToIndex(array.length, ...)` (see also `moveToEnd`)\n\t *\n\t * This interpretation of `destinationGap` does however make it less obvious how to move an item relative to its current position:\n\t *\n\t * - Move item B before its predecessor: `array.moveToIndex(indexOfB - 1, ...)`\n\t *\n\t * - Move item B after its successor: `array.moveToIndex(indexOfB + 2, ...)`\n\t *\n\t * Notice the asymmetry between `-1` and `+2` in the above examples.\n\t * In such scenarios, it can often be easier to approach such edits by swapping adjacent items:\n\t * If items A and B are adjacent, such that A precedes B,\n\t * then they can be swapped with `array.moveToIndex(indexOfA, indexOfB)`.\n\t *\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(destinationGap: 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 *\n\t * WARNING - This API is easily misused.\n\t * Please read the documentation for the `destinationGap` parameter carefully.\n\t *\n\t * @param destinationGap - The location *between* existing items that the moved item should be moved to.\n\t *\n\t * WARNING - `destinationGap` describes a location between existing items *prior to applying the move operation*.\n\t *\n\t * For example, if the array contains items `[A, B, C]` before the move, the `destinationGap` must be one of the following:\n\t *\n\t * - `0` (between the start of the array and `A`'s original position)\n\t *\n\t * - `1` (between `A`'s original position and `B`'s original position)\n\t *\n\t * - `2` (between `B`'s original position and `C`'s original position)\n\t *\n\t * - `3` (between `C`'s original position and the end of the array)\n\t *\n\t * So moving `A` between `B` and `C` would require `destinationGap` to be `2`.\n\t *\n\t * This interpretation of `destinationGap` makes it easy to specify the desired destination relative to a sibling item that is not being moved,\n\t * or relative to the start or end of the array:\n\t *\n\t * - Move to the start of the array: `array.moveToIndex(0, ...)` (see also `moveToStart`)\n\t *\n\t * - Move to before some item X: `array.moveToIndex(indexOfX, ...)`\n\t *\n\t * - Move to after some item X: `array.moveToIndex(indexOfX + 1`, ...)\n\t *\n\t * - Move to the end of the array: `array.moveToIndex(array.length, ...)` (see also `moveToEnd`)\n\t *\n\t * This interpretation of `destinationGap` does however make it less obvious how to move an item relative to its current position:\n\t *\n\t * - Move item B before its predecessor: `array.moveToIndex(indexOfB - 1, ...)`\n\t *\n\t * - Move item B after its successor: `array.moveToIndex(indexOfB + 2, ...)`\n\t *\n\t * Notice the asymmetry between `-1` and `+2` in the above examples.\n\t * In such scenarios, it can often be easier to approach such edits by swapping adjacent items:\n\t * If items A and B are adjacent, such that A precedes B,\n\t * then they can be swapped with `array.moveToIndex(indexOfA, indexOfB)`.\n\t *\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(destinationGap: number, sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the desired location within the array.\n\t *\n\t * WARNING - This API is easily misused.\n\t * Please read the documentation for the `destinationGap` parameter carefully.\n\t *\n\t * @param destinationGap - The location *between* existing items that the moved item should be moved to.\n\t *\n\t * WARNING - `destinationGap` describes a location between existing items *prior to applying the move operation*.\n\t *\n\t * For example, if the array contains items `[A, B, C]` before the move, the `destinationGap` must be one of the following:\n\t *\n\t * - `0` (between the start of the array and `A`'s original position)\n\t *\n\t * - `1` (between `A`'s original position and `B`'s original position)\n\t *\n\t * - `2` (between `B`'s original position and `C`'s original position)\n\t *\n\t * - `3` (between `C`'s original position and the end of the array)\n\t *\n\t * So moving `A` between `B` and `C` would require `destinationGap` to be `2`.\n\t *\n\t * This interpretation of `destinationGap` makes it easy to specify the desired destination relative to a sibling item that is not being moved,\n\t * or relative to the start or end of the array:\n\t *\n\t * - Move to the start of the array: `array.moveToIndex(0, ...)` (see also `moveToStart`)\n\t *\n\t * - Move to before some item X: `array.moveToIndex(indexOfX, ...)`\n\t *\n\t * - Move to after some item X: `array.moveToIndex(indexOfX + 1`, ...)\n\t *\n\t * - Move to the end of the array: `array.moveToIndex(array.length, ...)` (see also `moveToEnd`)\n\t *\n\t * This interpretation of `destinationGap` does however make it less obvious how to move an item relative to its current position:\n\t *\n\t * - Move item B before its predecessor: `array.moveToIndex(indexOfB - 1, ...)`\n\t *\n\t * - Move item B after its successor: `array.moveToIndex(indexOfB + 2, ...)`\n\t *\n\t * Notice the asymmetry between `-1` and `+2` in the above examples.\n\t * In such scenarios, it can often be easier to approach such edits by swapping adjacent items:\n\t * If items A and B are adjacent, such that A precedes B,\n\t * then they can be swapped with `array.moveToIndex(indexOfA, indexOfB)`.\n\t *\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\tdestinationGap: 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 * @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(arrayNode: ReadonlyArrayNode): FlexTreeSequenceField {\n\treturn getInnerNode(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\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\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 * Create a proxy which implements the {@link TreeArrayNode} API.\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 to 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// In NodeJS 22, assert.strict.deepEqual started special casing well known constructors like Array.\n\t\t\t\t// That made this necessary, ensuring that in POJO mode, TreeArrayNode are still deepEqual to arrays.\n\t\t\t\tif (key === \"constructor\") {\n\t\t\t\t\treturn proxyTarget.constructor;\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 maybeContent === undefined\n\t\t\t\t? undefined\n\t\t\t\t: getOrCreateNodeFromInnerUnboxedNode(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: val === undefined ? undefined : getOrCreateNodeFromInnerUnboxedNode(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 childSchema(): ImplicitAllowedTypes;\n\tprotected abstract get allowedTypes(): ReadonlySet<TreeNodeSchema>;\n\n\tpublic abstract override get [typeSchemaSymbol](): TreeNodeSchemaClass<\n\t\tstring,\n\t\tNodeKind.Array\n\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>): FlexibleFieldContent {\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 contentArray = content.flatMap((c): InsertableContent[] =>\n\t\t\tc instanceof IterableTreeArrayContent ? [...c] : [c],\n\t\t);\n\n\t\tconst kernel = getKernel(this);\n\t\tconst flexContext = kernel.getInnerNode().context;\n\t\tassert(\n\t\t\tflexContext === kernel.context.flexContext,\n\t\t\t0xc14 /* Expected flexContext to match */,\n\t\t);\n\t\tconst innerSchema = kernel.context.flexContext.schema.nodeSchema.get(\n\t\t\tbrand(kernel.schema.identifier),\n\t\t);\n\t\tassert(\n\t\t\tinnerSchema instanceof ObjectNodeStoredSchema,\n\t\t\t0xc15 /* Expected ObjectNodeStoredSchema */,\n\t\t);\n\t\tconst fieldSchema = innerSchema.getFieldSchema(EmptyKey);\n\n\t\tconst mapTrees = prepareArrayContentForInsertion(\n\t\t\tcontentArray,\n\t\t\tthis.childSchema,\n\t\t\tsequenceField.context,\n\t\t\tfieldSchema.types,\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 [...(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(0xadb /* 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 getOrCreateNodeFromInnerNode(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, \"TreeArrayNode.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, \"TreeArrayNode.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, editor } = field;\n\t\tconst removeStart = start ?? 0;\n\t\tvalidateIndex(removeStart, field, \"TreeArrayNode.removeRange\", true);\n\n\t\tconst removeEnd = Math.min(length, end ?? length);\n\t\tvalidateIndexRange(removeStart, removeEnd, field, \"TreeArrayNode.removeRange\");\n\n\t\teditor.remove(removeStart, removeEnd - removeStart);\n\t}\n\tpublic moveToStart(sourceIndex: number, source?: ReadonlyArrayNode): void {\n\t\tconst sourceArray = source ?? this;\n\t\tconst sourceField = getSequenceField(sourceArray);\n\t\tvalidateIndex(sourceIndex, sourceField, \"TreeArrayNode.moveToStart\");\n\t\tthis.moveRangeToIndex(0, sourceIndex, sourceIndex + 1, source);\n\t}\n\tpublic moveToEnd(sourceIndex: number, source?: ReadonlyArrayNode): void {\n\t\tconst sourceArray = source ?? this;\n\t\tconst sourceField = getSequenceField(sourceArray);\n\t\tvalidateIndex(sourceIndex, sourceField, \"TreeArrayNode.moveToEnd\");\n\t\tthis.moveRangeToIndex(this.length, sourceIndex, sourceIndex + 1, source);\n\t}\n\tpublic moveToIndex(\n\t\tdestinationGap: number,\n\t\tsourceIndex: number,\n\t\tsource?: ReadonlyArrayNode,\n\t): void {\n\t\tconst sourceArray = source ?? this;\n\t\tconst sourceField = getSequenceField(sourceArray);\n\t\tconst destinationField = getSequenceField(this);\n\t\tvalidateIndex(destinationGap, destinationField, \"TreeArrayNode.moveToIndex\", true);\n\t\tvalidateIndex(sourceIndex, sourceField, \"TreeArrayNode.moveToIndex\");\n\t\tthis.moveRangeToIndex(destinationGap, sourceIndex, sourceIndex + 1, source);\n\t}\n\tpublic moveRangeToStart(\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource?: ReadonlyArrayNode,\n\t): void {\n\t\tvalidateIndexRange(\n\t\t\tsourceStart,\n\t\t\tsourceEnd,\n\t\t\tsource ?? getSequenceField(this),\n\t\t\t\"TreeArrayNode.moveRangeToStart\",\n\t\t);\n\t\tthis.moveRangeToIndex(0, sourceStart, sourceEnd, source);\n\t}\n\tpublic moveRangeToEnd(\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource?: ReadonlyArrayNode,\n\t): void {\n\t\tvalidateIndexRange(\n\t\t\tsourceStart,\n\t\t\tsourceEnd,\n\t\t\tsource ?? getSequenceField(this),\n\t\t\t\"TreeArrayNode.moveRangeToEnd\",\n\t\t);\n\t\tthis.moveRangeToIndex(this.length, sourceStart, sourceEnd, source);\n\t}\n\tpublic moveRangeToIndex(\n\t\tdestinationGap: number,\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource?: ReadonlyArrayNode,\n\t): void {\n\t\tconst destinationField = getSequenceField(this);\n\t\tconst destinationSchema = this.allowedTypes;\n\t\tconst kernel = getKernel(this);\n\t\tconst destinationStored = (\n\t\t\tkernel.context.flexContext.schema.nodeSchema.get(brand(kernel.schema.identifier)) ??\n\t\t\tfail(0xc16 /* missing schema for array node */)\n\t\t).getFieldSchema(EmptyKey).types;\n\t\tconst sourceField = source === undefined ? destinationField : getSequenceField(source);\n\n\t\tvalidateIndex(destinationGap, destinationField, \"TreeArrayNode.moveRangeToIndex\", true);\n\t\tvalidateIndexRange(\n\t\t\tsourceStart,\n\t\t\tsourceEnd,\n\t\t\tsource ?? destinationField,\n\t\t\t\"TreeArrayNode.moveRangeToIndex\",\n\t\t);\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\tconst sourceSchema = getSimpleNodeSchemaFromInnerNode(sourceNode);\n\t\t\t\tif (!destinationSchema.has(sourceSchema)) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Type ${sourceNode.type} in source sequence is not allowed in destination.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (!destinationStored.has(sourceNode.type)) {\n\t\t\t\t\t// TODO: better and centralized messages for missing staged schema updates.\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Type ${sourceNode.type} in source sequence is not allowed in destination's stored schema: this would likely require upgrading the document to permit a staged schema.`,\n\t\t\t\t\t);\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 (!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\tdestinationGap,\n\t\t\t);\n\t\t} else {\n\t\t\tif (!(sourceField instanceof UnhydratedSequenceField)) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"Cannot move elements from a hydrated array to an unhydrated array.\",\n\t\t\t\t);\n\t\t\t}\n\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\n\t\t\t// We implement move here via subsequent `remove` and `insert`.\n\t\t\t// This is strictly an implementation detail and should not be observable by the user.\n\t\t\t// TODO:AB#47457: Implement proper move support for unhydrated trees.\n\t\t\t// As a temporary mitigation, we will pause tree events until both edits have been completed.\n\t\t\t// That way, users will only see a single change event for the array instead of 2.\n\t\t\twithBufferedTreeEvents(() => {\n\t\t\t\tif (sourceField !== destinationField || destinationGap < sourceStart) {\n\t\t\t\t\tdestinationField.editor.insert(\n\t\t\t\t\t\tdestinationGap,\n\t\t\t\t\t\tsourceField.editor.remove(sourceStart, movedCount),\n\t\t\t\t\t);\n\t\t\t\t} else if (destinationGap > sourceStart + movedCount) {\n\t\t\t\t\tdestinationField.editor.insert(\n\t\t\t\t\t\tdestinationGap - movedCount,\n\t\t\t\t\t\tsourceField.editor.remove(sourceStart, movedCount),\n\t\t\t\t\t);\n\t\t\t\t}\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(0xadc /* 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 * @param persistedMetadata - Optional persisted metadata for the object node schema.\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\tconst TCustomMetadata = unknown,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tcustomizable: boolean,\n\tnodeOptions: NodeSchemaOptionsAlpha<TCustomMetadata>,\n) {\n\ttype Output = ArrayNodeCustomizableSchema<\n\t\tTName,\n\t\tT,\n\t\tImplicitlyConstructable,\n\t\tTCustomMetadata\n\t> &\n\t\tArrayNodePojoEmulationSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> &\n\t\tTreeNodeSchemaCorePrivate;\n\n\tconst persistedMetadata = nodeOptions?.persistedMetadata;\n\tconst normalizedTypes = normalizeAllowedTypes(info);\n\tconst lazyAllowedTypesIdentifiers = new Lazy(\n\t\t() => new Set(normalizedTypes.evaluate().map((type) => type.identifier)),\n\t);\n\tconst lazySimpleAllowedTypes = new Lazy(() => {\n\t\treturn AnnotatedAllowedTypesInternal.evaluateSimpleAllowedTypes(normalizedTypes);\n\t});\n\n\tlet privateData: TreeNodeSchemaPrivateData | undefined;\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: Number.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): UnhydratedFlexTreeNode {\n\t\t\treturn unhydratedFlexTreeFromInsertable(input as object, this as typeof Schema);\n\t\t}\n\n\t\tpublic static get allowedTypesIdentifiers(): ReadonlySet<string> {\n\t\t\treturn lazyAllowedTypesIdentifiers.value;\n\t\t}\n\n\t\tpublic static get simpleAllowedTypes(): ReadonlyMap<\n\t\t\tstring,\n\t\t\tSimpleAllowedTypeAttributes<SchemaType.View>\n\t\t> {\n\t\t\treturn lazySimpleAllowedTypes.value;\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup(): TreeNodeSchemaInitializedData {\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\tconst schema = this as ArrayNodeSchema;\n\n\t\t\treturn getTreeNodeSchemaInitializedData(this, {\n\t\t\t\tshallowCompatibilityTest: (data: FactoryContent): CompatibilityLevel =>\n\t\t\t\t\tshallowCompatibilityTest(data, schema),\n\t\t\t\ttoFlexContent: (\n\t\t\t\t\tdata: FactoryContent,\n\t\t\t\t\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n\t\t\t\t): FlexContent => arrayToFlexContent(data, schema),\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\t\tpublic static get childTypes(): ReadonlySet<TreeNodeSchema> {\n\t\t\treturn normalizedTypes.evaluateSet();\n\t\t}\n\t\tpublic static readonly metadata: NodeSchemaMetadata<TCustomMetadata> =\n\t\t\tnodeOptions.metadata ?? {};\n\t\tpublic static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =\n\t\t\tpersistedMetadata;\n\n\t\t// eslint-disable-next-line import-x/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 childSchema(): T {\n\t\t\treturn info;\n\t\t}\n\t\tprotected get allowedTypes(): ReadonlySet<TreeNodeSchema> {\n\t\t\treturn normalizedTypes.evaluateSet();\n\t\t}\n\n\t\tpublic static get [privateDataSymbol](): TreeNodeSchemaPrivateData {\n\t\t\treturn (privateData ??= createTreeNodeSchemaPrivateData(this, [normalizedTypes]));\n\t\t}\n\t}\n\n\tconst output: Output = Schema;\n\treturn output;\n}\n\n/**\n * Transforms data for a child of an array.\n * @param child - The tree data to be transformed.\n * @param allowedTypes - The set of types allowed by the parent context. Used to validate the input tree.\n */\nfunction arrayChildToFlexTree(\n\tchild: InsertableContent,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): UnhydratedFlexTreeNode {\n\t// We do not support undefined sequence entries.\n\t// If we encounter an undefined entry, use null instead if supported by the schema, otherwise throw.\n\tlet childWithFallback = child;\n\tif (child === undefined) {\n\t\tif (allowedTypes.has(nullSchema)) {\n\t\t\tchildWithFallback = null;\n\t\t} else {\n\t\t\tthrow new TypeError(`Received unsupported array entry value: ${child}.`);\n\t\t}\n\t}\n\treturn unhydratedFlexTreeFromInsertableNode(childWithFallback, allowedTypes);\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.toFlexContent} for Array nodes.\n *\n * @param data - The tree data to be transformed. Must be an iterable.\n * @param schema - The schema to comply with.\n */\nfunction arrayToFlexContent(data: FactoryContent, schema: ArrayNodeSchema): FlexContent {\n\tif (!(typeof data === \"object\" && data !== null && Symbol.iterator in data)) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\tthrow new UsageError(`Input data is incompatible with Array schema: ${data}`);\n\t}\n\n\tconst allowedChildTypes = normalizeAllowedTypes(schema.info);\n\n\tconst mappedData = Array.from(data, (child) =>\n\t\tarrayChildToFlexTree(child, allowedChildTypes.evaluateSet()),\n\t);\n\n\tconst context = getUnhydratedContext(schema).flexContext;\n\n\t// Array nodes have a single `EmptyKey` field:\n\tconst fieldsEntries =\n\t\tmappedData.length === 0\n\t\t\t? []\n\t\t\t: ([\n\t\t\t\t\t[\n\t\t\t\t\t\tEmptyKey,\n\t\t\t\t\t\tnew UnhydratedSequenceField(\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tFieldKinds.sequence.identifier,\n\t\t\t\t\t\t\tEmptyKey,\n\t\t\t\t\t\t\tmappedData,\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t] as const);\n\n\treturn [\n\t\t{\n\t\t\ttype: brand(schema.identifier),\n\t\t},\n\t\tnew Map(fieldsEntries),\n\t];\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.shallowCompatibilityTest} for Array nodes.\n */\nfunction shallowCompatibilityTest(\n\tdata: FactoryContent,\n\tschema: ArrayNodeSchema,\n): CompatibilityLevel {\n\tif (isTreeValue(data)) {\n\t\treturn CompatibilityLevel.None;\n\t}\n\n\tif (data instanceof Map) {\n\t\t// Maps are iterable, so type checking does allow constructing an ArrayNode from a map if the ArrayNode's type is an array that includes the key and value types of the map.\n\t\treturn CompatibilityLevel.Low;\n\t}\n\n\tif (Symbol.iterator in data) {\n\t\treturn CompatibilityLevel.Normal;\n\t}\n\n\treturn CompatibilityLevel.None;\n}\n"]}
1
+ {"version":3,"file":"arrayNode.js","sourceRoot":"","sources":["../../../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G,CAAC,aAAa,CAAC;KACtB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,wBAAwB,CAChC,IAAoB,EACpB,MAAuB;IAEvB,IAAI,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,6BAAkB,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,IAAI,IAAI,YAAY,GAAG,EAAE,CAAC;QACzB,4KAA4K;QAC5K,OAAO,6BAAkB,CAAC,GAAG,CAAC;IAC/B,CAAC;IAED,IAAI,MAAM,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC7B,OAAO,6BAAkB,CAAC,MAAM,CAAC;IAClC,CAAC;IAED,OAAO,6BAAkB,CAAC,IAAI,CAAC;AAChC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Lazy, oob, fail, assert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { EmptyKey, ObjectNodeStoredSchema } from \"../../../core/index.js\";\nimport type {\n\tFlexibleFieldContent,\n\tFlexTreeNode,\n\tFlexTreeSequenceField,\n} from \"../../../feature-libraries/index.js\";\nimport { FieldKinds, isTreeValue } from \"../../../feature-libraries/index.js\";\nimport {\n\tCompatibilityLevel,\n\ttype WithType,\n\t// eslint-disable-next-line import-x/no-deprecated\n\ttypeNameSymbol,\n\tNodeKind,\n\ttype TreeNode,\n\ttype InternalTreeNode,\n\ttype TreeNodeSchema,\n\ttypeSchemaSymbol,\n\tgetOrCreateNodeFromInnerNode,\n\tgetSimpleNodeSchemaFromInnerNode,\n\tgetInnerNode,\n\ttype TreeNodeSchemaClass,\n\tgetKernel,\n\ttype UnhydratedFlexTreeNode,\n\tUnhydratedSequenceField,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n\tnormalizeAllowedTypes,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype TreeLeafValue,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\tTreeNodeValid,\n\ttype MostDerivedData,\n\ttype TreeNodeSchemaInitializedData,\n\ttype TreeNodeSchemaCorePrivate,\n\tprivateDataSymbol,\n\tcreateTreeNodeSchemaPrivateData,\n\ttype FlexContent,\n\ttype TreeNodeSchemaPrivateData,\n\twithBufferedTreeEvents,\n\tAnnotatedAllowedTypesInternal,\n} from \"../../core/index.js\";\nimport {\n\ttype FactoryContent,\n\tflexTreeFromInsertableNode,\n\ttype InsertableContent,\n\tunhydratedFlexTreeFromInsertable,\n} from \"../../unhydratedFlexTreeFromInsertable.js\";\nimport { prepareArrayContentForInsertion } from \"../../prepareForInsertion.js\";\nimport {\n\tgetTreeNodeSchemaInitializedData,\n\tgetUnhydratedContext,\n} from \"../../createContext.js\";\nimport type { NodeSchemaOptionsAlpha, System_Unsafe } from \"../../api/index.js\";\nimport type {\n\tArrayNodeCustomizableSchema,\n\tArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n} from \"./arrayNodeTypes.js\";\nimport {\n\tbrand,\n\tvalidateIndex,\n\tvalidateIndexRange,\n\ttype JsonCompatibleReadOnlyObject,\n} from \"../../../util/index.js\";\nimport { nullSchema } from \"../../leafNodeSchema.js\";\nimport type { SchemaType, SimpleAllowedTypeAttributes } from \"../../simpleSchema.js\";\n\n/**\n * A covariant base type for {@link (TreeArrayNode:interface)}.\n *\n * This provides the readonly subset of TreeArrayNode functionality, and is used as the source interface for moves since that needs to be covariant.\n * @privateRemarks\n * Ideally this would just include `TreeNode, WithType<string, NodeKind.Array>` in the extends list but https://github.com/microsoft/TypeScript/issues/16936 prevents that from compiling.\n * As a workaround around for this TypeScript limitation, the conflicting type intersection is wrapped in `Awaited` (which has no effect on the type in this case) which allows it to compile.\n * @system @sealed @public\n */\nexport interface ReadonlyArrayNode<out T = TreeNode | TreeLeafValue>\n\textends ReadonlyArray<T>,\n\t\tAwaited<TreeNode & WithType<string, NodeKind.Array>> {}\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 * @typeParam T - Use Default: Do not specify. Type of values to read from the array.\n * @typeParam TNew - Use Default: Do not specify. Type of values to write into the array.\n * @typeParam TMoveFrom - Use Default: Do not specify. Type of node from which children can be moved into this array.\n *\n * @sealed @public\n */\nexport interface TreeArrayNode<\n\tTAllowedTypes extends System_Unsafe.ImplicitAllowedTypesUnsafe = ImplicitAllowedTypes,\n\tout T = [TAllowedTypes] extends [ImplicitAllowedTypes]\n\t\t? TreeNodeFromImplicitAllowedTypes<TAllowedTypes>\n\t\t: TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>,\n\tin TNew = [TAllowedTypes] extends [ImplicitAllowedTypes]\n\t\t? InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes>\n\t\t: InsertableTreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>,\n\tin TMoveFrom = ReadonlyArrayNode,\n> extends ReadonlyArrayNode<T> {\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 *\n\t * WARNING - This API is easily misused.\n\t * Please read the documentation for the `destinationGap` parameter carefully.\n\t *\n\t * @param destinationGap - The location *between* existing items that the moved item should be moved to.\n\t *\n\t * WARNING - `destinationGap` describes a location between existing items *prior to applying the move operation*.\n\t *\n\t * For example, if the array contains items `[A, B, C]` before the move, the `destinationGap` must be one of the following:\n\t *\n\t * - `0` (between the start of the array and `A`'s original position)\n\t *\n\t * - `1` (between `A`'s original position and `B`'s original position)\n\t *\n\t * - `2` (between `B`'s original position and `C`'s original position)\n\t *\n\t * - `3` (between `C`'s original position and the end of the array)\n\t *\n\t * So moving `A` between `B` and `C` would require `destinationGap` to be `2`.\n\t *\n\t * This interpretation of `destinationGap` makes it easy to specify the desired destination relative to a sibling item that is not being moved,\n\t * or relative to the start or end of the array:\n\t *\n\t * - Move to the start of the array: `array.moveToIndex(0, ...)` (see also `moveToStart`)\n\t *\n\t * - Move to before some item X: `array.moveToIndex(indexOfX, ...)`\n\t *\n\t * - Move to after some item X: `array.moveToIndex(indexOfX + 1`, ...)\n\t *\n\t * - Move to the end of the array: `array.moveToIndex(array.length, ...)` (see also `moveToEnd`)\n\t *\n\t * This interpretation of `destinationGap` does however make it less obvious how to move an item relative to its current position:\n\t *\n\t * - Move item B before its predecessor: `array.moveToIndex(indexOfB - 1, ...)`\n\t *\n\t * - Move item B after its successor: `array.moveToIndex(indexOfB + 2, ...)`\n\t *\n\t * Notice the asymmetry between `-1` and `+2` in the above examples.\n\t * In such scenarios, it can often be easier to approach such edits by swapping adjacent items:\n\t * If items A and B are adjacent, such that A precedes B,\n\t * then they can be swapped with `array.moveToIndex(indexOfA, indexOfB)`.\n\t *\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(destinationGap: number, sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the desired location in the array.\n\t *\n\t * WARNING - This API is easily misused.\n\t * Please read the documentation for the `destinationGap` parameter carefully.\n\t *\n\t * @param destinationGap - The location *between* existing items that the moved item should be moved to.\n\t *\n\t * WARNING - `destinationGap` describes a location between existing items *prior to applying the move operation*.\n\t *\n\t * For example, if the array contains items `[A, B, C]` before the move, the `destinationGap` must be one of the following:\n\t *\n\t * - `0` (between the start of the array and `A`'s original position)\n\t *\n\t * - `1` (between `A`'s original position and `B`'s original position)\n\t *\n\t * - `2` (between `B`'s original position and `C`'s original position)\n\t *\n\t * - `3` (between `C`'s original position and the end of the array)\n\t *\n\t * So moving `A` between `B` and `C` would require `destinationGap` to be `2`.\n\t *\n\t * This interpretation of `destinationGap` makes it easy to specify the desired destination relative to a sibling item that is not being moved,\n\t * or relative to the start or end of the array:\n\t *\n\t * - Move to the start of the array: `array.moveToIndex(0, ...)` (see also `moveToStart`)\n\t *\n\t * - Move to before some item X: `array.moveToIndex(indexOfX, ...)`\n\t *\n\t * - Move to after some item X: `array.moveToIndex(indexOfX + 1`, ...)\n\t *\n\t * - Move to the end of the array: `array.moveToIndex(array.length, ...)` (see also `moveToEnd`)\n\t *\n\t * This interpretation of `destinationGap` does however make it less obvious how to move an item relative to its current position:\n\t *\n\t * - Move item B before its predecessor: `array.moveToIndex(indexOfB - 1, ...)`\n\t *\n\t * - Move item B after its successor: `array.moveToIndex(indexOfB + 2, ...)`\n\t *\n\t * Notice the asymmetry between `-1` and `+2` in the above examples.\n\t * In such scenarios, it can often be easier to approach such edits by swapping adjacent items:\n\t * If items A and B are adjacent, such that A precedes B,\n\t * then they can be swapped with `array.moveToIndex(indexOfA, indexOfB)`.\n\t *\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(destinationGap: 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 *\n\t * WARNING - This API is easily misused.\n\t * Please read the documentation for the `destinationGap` parameter carefully.\n\t *\n\t * @param destinationGap - The location *between* existing items that the moved item should be moved to.\n\t *\n\t * WARNING - `destinationGap` describes a location between existing items *prior to applying the move operation*.\n\t *\n\t * For example, if the array contains items `[A, B, C]` before the move, the `destinationGap` must be one of the following:\n\t *\n\t * - `0` (between the start of the array and `A`'s original position)\n\t *\n\t * - `1` (between `A`'s original position and `B`'s original position)\n\t *\n\t * - `2` (between `B`'s original position and `C`'s original position)\n\t *\n\t * - `3` (between `C`'s original position and the end of the array)\n\t *\n\t * So moving `A` between `B` and `C` would require `destinationGap` to be `2`.\n\t *\n\t * This interpretation of `destinationGap` makes it easy to specify the desired destination relative to a sibling item that is not being moved,\n\t * or relative to the start or end of the array:\n\t *\n\t * - Move to the start of the array: `array.moveToIndex(0, ...)` (see also `moveToStart`)\n\t *\n\t * - Move to before some item X: `array.moveToIndex(indexOfX, ...)`\n\t *\n\t * - Move to after some item X: `array.moveToIndex(indexOfX + 1`, ...)\n\t *\n\t * - Move to the end of the array: `array.moveToIndex(array.length, ...)` (see also `moveToEnd`)\n\t *\n\t * This interpretation of `destinationGap` does however make it less obvious how to move an item relative to its current position:\n\t *\n\t * - Move item B before its predecessor: `array.moveToIndex(indexOfB - 1, ...)`\n\t *\n\t * - Move item B after its successor: `array.moveToIndex(indexOfB + 2, ...)`\n\t *\n\t * Notice the asymmetry between `-1` and `+2` in the above examples.\n\t * In such scenarios, it can often be easier to approach such edits by swapping adjacent items:\n\t * If items A and B are adjacent, such that A precedes B,\n\t * then they can be swapped with `array.moveToIndex(indexOfA, indexOfB)`.\n\t *\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(destinationGap: number, sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the desired location within the array.\n\t *\n\t * WARNING - This API is easily misused.\n\t * Please read the documentation for the `destinationGap` parameter carefully.\n\t *\n\t * @param destinationGap - The location *between* existing items that the moved item should be moved to.\n\t *\n\t * WARNING - `destinationGap` describes a location between existing items *prior to applying the move operation*.\n\t *\n\t * For example, if the array contains items `[A, B, C]` before the move, the `destinationGap` must be one of the following:\n\t *\n\t * - `0` (between the start of the array and `A`'s original position)\n\t *\n\t * - `1` (between `A`'s original position and `B`'s original position)\n\t *\n\t * - `2` (between `B`'s original position and `C`'s original position)\n\t *\n\t * - `3` (between `C`'s original position and the end of the array)\n\t *\n\t * So moving `A` between `B` and `C` would require `destinationGap` to be `2`.\n\t *\n\t * This interpretation of `destinationGap` makes it easy to specify the desired destination relative to a sibling item that is not being moved,\n\t * or relative to the start or end of the array:\n\t *\n\t * - Move to the start of the array: `array.moveToIndex(0, ...)` (see also `moveToStart`)\n\t *\n\t * - Move to before some item X: `array.moveToIndex(indexOfX, ...)`\n\t *\n\t * - Move to after some item X: `array.moveToIndex(indexOfX + 1`, ...)\n\t *\n\t * - Move to the end of the array: `array.moveToIndex(array.length, ...)` (see also `moveToEnd`)\n\t *\n\t * This interpretation of `destinationGap` does however make it less obvious how to move an item relative to its current position:\n\t *\n\t * - Move item B before its predecessor: `array.moveToIndex(indexOfB - 1, ...)`\n\t *\n\t * - Move item B after its successor: `array.moveToIndex(indexOfB + 2, ...)`\n\t *\n\t * Notice the asymmetry between `-1` and `+2` in the above examples.\n\t * In such scenarios, it can often be easier to approach such edits by swapping adjacent items:\n\t * If items A and B are adjacent, such that A precedes B,\n\t * then they can be swapped with `array.moveToIndex(indexOfA, indexOfB)`.\n\t *\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\tdestinationGap: 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 * @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(arrayNode: ReadonlyArrayNode): FlexTreeSequenceField {\n\treturn getInnerNode(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\tfor (const key of arrayPrototypeKeys) {\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\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\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 * Create a proxy which implements the {@link TreeArrayNode} API.\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 to 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// In NodeJS 22, assert.strict.deepEqual started special casing well known constructors like Array.\n\t\t\t\t// That made this necessary, ensuring that in POJO mode, TreeArrayNode are still deepEqual to arrays.\n\t\t\t\tif (key === \"constructor\") {\n\t\t\t\t\treturn proxyTarget.constructor;\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 maybeContent === undefined\n\t\t\t\t? undefined\n\t\t\t\t: getOrCreateNodeFromInnerUnboxedNode(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: val === undefined ? undefined : getOrCreateNodeFromInnerUnboxedNode(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 childSchema(): ImplicitAllowedTypes;\n\tprotected abstract get allowedTypes(): ReadonlySet<TreeNodeSchema>;\n\n\tpublic abstract override get [typeSchemaSymbol](): TreeNodeSchemaClass<\n\t\tstring,\n\t\tNodeKind.Array\n\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>): FlexibleFieldContent {\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 contentArray = content.flatMap((c): InsertableContent[] =>\n\t\t\tc instanceof IterableTreeArrayContent ? [...c] : [c],\n\t\t);\n\n\t\tconst kernel = getKernel(this);\n\t\tconst flexContext = kernel.getInnerNode().context;\n\t\tassert(\n\t\t\tflexContext === kernel.context.flexContext,\n\t\t\t0xc14 /* Expected flexContext to match */,\n\t\t);\n\t\tconst innerSchema = kernel.context.flexContext.schema.nodeSchema.get(\n\t\t\tbrand(kernel.schema.identifier),\n\t\t);\n\t\tassert(\n\t\t\tinnerSchema instanceof ObjectNodeStoredSchema,\n\t\t\t0xc15 /* Expected ObjectNodeStoredSchema */,\n\t\t);\n\t\tconst fieldSchema = innerSchema.getFieldSchema(EmptyKey);\n\n\t\tconst mapTrees = prepareArrayContentForInsertion(\n\t\t\tcontentArray,\n\t\t\tthis.childSchema,\n\t\t\tsequenceField.context,\n\t\t\tfieldSchema.types,\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 [...(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(0xadb /* 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 getOrCreateNodeFromInnerNode(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, \"TreeArrayNode.insertAt\", true);\n\t\tfield.context.runInTransaction(() => {\n\t\t\tconst content = this.#mapTreesFromFieldData(value);\n\t\t\tfield.editor.attach(index, content);\n\t\t});\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, \"TreeArrayNode.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, editor } = field;\n\t\tconst removeStart = start ?? 0;\n\t\tvalidateIndex(removeStart, field, \"TreeArrayNode.removeRange\", true);\n\n\t\tconst removeEnd = Math.min(length, end ?? length);\n\t\tvalidateIndexRange(removeStart, removeEnd, field, \"TreeArrayNode.removeRange\");\n\n\t\teditor.remove(removeStart, removeEnd - removeStart);\n\t}\n\tpublic moveToStart(sourceIndex: number, source?: ReadonlyArrayNode): void {\n\t\tconst sourceArray = source ?? this;\n\t\tconst sourceField = getSequenceField(sourceArray);\n\t\tvalidateIndex(sourceIndex, sourceField, \"TreeArrayNode.moveToStart\");\n\t\tthis.moveRangeToIndex(0, sourceIndex, sourceIndex + 1, source);\n\t}\n\tpublic moveToEnd(sourceIndex: number, source?: ReadonlyArrayNode): void {\n\t\tconst sourceArray = source ?? this;\n\t\tconst sourceField = getSequenceField(sourceArray);\n\t\tvalidateIndex(sourceIndex, sourceField, \"TreeArrayNode.moveToEnd\");\n\t\tthis.moveRangeToIndex(this.length, sourceIndex, sourceIndex + 1, source);\n\t}\n\tpublic moveToIndex(\n\t\tdestinationGap: number,\n\t\tsourceIndex: number,\n\t\tsource?: ReadonlyArrayNode,\n\t): void {\n\t\tconst sourceArray = source ?? this;\n\t\tconst sourceField = getSequenceField(sourceArray);\n\t\tconst destinationField = getSequenceField(this);\n\t\tvalidateIndex(destinationGap, destinationField, \"TreeArrayNode.moveToIndex\", true);\n\t\tvalidateIndex(sourceIndex, sourceField, \"TreeArrayNode.moveToIndex\");\n\t\tthis.moveRangeToIndex(destinationGap, sourceIndex, sourceIndex + 1, source);\n\t}\n\tpublic moveRangeToStart(\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource?: ReadonlyArrayNode,\n\t): void {\n\t\tvalidateIndexRange(\n\t\t\tsourceStart,\n\t\t\tsourceEnd,\n\t\t\tsource ?? getSequenceField(this),\n\t\t\t\"TreeArrayNode.moveRangeToStart\",\n\t\t);\n\t\tthis.moveRangeToIndex(0, sourceStart, sourceEnd, source);\n\t}\n\tpublic moveRangeToEnd(\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource?: ReadonlyArrayNode,\n\t): void {\n\t\tvalidateIndexRange(\n\t\t\tsourceStart,\n\t\t\tsourceEnd,\n\t\t\tsource ?? getSequenceField(this),\n\t\t\t\"TreeArrayNode.moveRangeToEnd\",\n\t\t);\n\t\tthis.moveRangeToIndex(this.length, sourceStart, sourceEnd, source);\n\t}\n\tpublic moveRangeToIndex(\n\t\tdestinationGap: number,\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource?: ReadonlyArrayNode,\n\t): void {\n\t\tconst destinationField = getSequenceField(this);\n\t\tconst destinationSchema = this.allowedTypes;\n\t\tconst kernel = getKernel(this);\n\t\tconst destinationStored = (\n\t\t\tkernel.context.flexContext.schema.nodeSchema.get(brand(kernel.schema.identifier)) ??\n\t\t\tfail(0xc16 /* missing schema for array node */)\n\t\t).getFieldSchema(EmptyKey).types;\n\t\tconst sourceField = source === undefined ? destinationField : getSequenceField(source);\n\n\t\tvalidateIndex(destinationGap, destinationField, \"TreeArrayNode.moveRangeToIndex\", true);\n\t\tvalidateIndexRange(\n\t\t\tsourceStart,\n\t\t\tsourceEnd,\n\t\t\tsource ?? destinationField,\n\t\t\t\"TreeArrayNode.moveRangeToIndex\",\n\t\t);\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\tconst sourceSchema = getSimpleNodeSchemaFromInnerNode(sourceNode);\n\t\t\t\tif (!destinationSchema.has(sourceSchema)) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Type ${sourceNode.type} in source sequence is not allowed in destination.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (!destinationStored.has(sourceNode.type)) {\n\t\t\t\t\t// TODO: better and centralized messages for missing staged schema updates.\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Type ${sourceNode.type} in source sequence is not allowed in destination's stored schema: this would likely require upgrading the document to permit a staged schema.`,\n\t\t\t\t\t);\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 (!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\tdestinationGap,\n\t\t\t);\n\t\t} else {\n\t\t\tif (!(sourceField instanceof UnhydratedSequenceField)) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"Cannot move elements from a hydrated array to an unhydrated array.\",\n\t\t\t\t);\n\t\t\t}\n\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\n\t\t\t// We implement move here via subsequent `remove` and `insert`.\n\t\t\t// This is strictly an implementation detail and should not be observable by the user.\n\t\t\t// TODO:AB#47457: Implement proper move support for unhydrated trees.\n\t\t\t// As a temporary mitigation, we will pause tree events until both edits have been completed.\n\t\t\t// That way, users will only see a single change event for the array instead of 2.\n\t\t\twithBufferedTreeEvents(() => {\n\t\t\t\tif (sourceField !== destinationField || destinationGap < sourceStart) {\n\t\t\t\t\tdestinationField.editor.insert(\n\t\t\t\t\t\tdestinationGap,\n\t\t\t\t\t\tsourceField.editor.remove(sourceStart, movedCount),\n\t\t\t\t\t);\n\t\t\t\t} else if (destinationGap > sourceStart + movedCount) {\n\t\t\t\t\tdestinationField.editor.insert(\n\t\t\t\t\t\tdestinationGap - movedCount,\n\t\t\t\t\t\tsourceField.editor.remove(sourceStart, movedCount),\n\t\t\t\t\t);\n\t\t\t\t}\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(0xadc /* 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 * @param persistedMetadata - Optional persisted metadata for the object node schema.\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\tconst TCustomMetadata = unknown,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tcustomizable: boolean,\n\tnodeOptions: NodeSchemaOptionsAlpha<TCustomMetadata>,\n) {\n\ttype Output = ArrayNodeCustomizableSchema<\n\t\tTName,\n\t\tT,\n\t\tImplicitlyConstructable,\n\t\tTCustomMetadata\n\t> &\n\t\tArrayNodePojoEmulationSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> &\n\t\tTreeNodeSchemaCorePrivate;\n\n\tconst persistedMetadata = nodeOptions?.persistedMetadata;\n\tconst normalizedTypes = normalizeAllowedTypes(info);\n\tconst lazyAllowedTypesIdentifiers = new Lazy(\n\t\t() => new Set(normalizedTypes.evaluate().map((type) => type.identifier)),\n\t);\n\tconst lazySimpleAllowedTypes = new Lazy(() => {\n\t\treturn AnnotatedAllowedTypesInternal.evaluateSimpleAllowedTypes(normalizedTypes);\n\t});\n\n\tlet privateData: TreeNodeSchemaPrivateData | undefined;\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: Number.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): UnhydratedFlexTreeNode {\n\t\t\treturn unhydratedFlexTreeFromInsertable(input as object, this as typeof Schema);\n\t\t}\n\n\t\tpublic static get allowedTypesIdentifiers(): ReadonlySet<string> {\n\t\t\treturn lazyAllowedTypesIdentifiers.value;\n\t\t}\n\n\t\tpublic static get simpleAllowedTypes(): ReadonlyMap<\n\t\t\tstring,\n\t\t\tSimpleAllowedTypeAttributes<SchemaType.View>\n\t\t> {\n\t\t\treturn lazySimpleAllowedTypes.value;\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup(): TreeNodeSchemaInitializedData {\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\tconst schema = this as ArrayNodeSchema;\n\n\t\t\treturn getTreeNodeSchemaInitializedData(this, {\n\t\t\t\tshallowCompatibilityTest: (data: FactoryContent): CompatibilityLevel =>\n\t\t\t\t\tshallowCompatibilityTest(data, schema),\n\t\t\t\ttoFlexContent: (\n\t\t\t\t\tdata: FactoryContent,\n\t\t\t\t\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n\t\t\t\t): FlexContent => arrayToFlexContent(data, schema),\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\t\tpublic static get childTypes(): ReadonlySet<TreeNodeSchema> {\n\t\t\treturn normalizedTypes.evaluateSet();\n\t\t}\n\t\tpublic static readonly metadata: NodeSchemaMetadata<TCustomMetadata> =\n\t\t\tnodeOptions.metadata ?? {};\n\t\tpublic static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =\n\t\t\tpersistedMetadata;\n\n\t\t// eslint-disable-next-line import-x/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 childSchema(): T {\n\t\t\treturn info;\n\t\t}\n\t\tprotected get allowedTypes(): ReadonlySet<TreeNodeSchema> {\n\t\t\treturn normalizedTypes.evaluateSet();\n\t\t}\n\n\t\tpublic static get [privateDataSymbol](): TreeNodeSchemaPrivateData {\n\t\t\treturn (privateData ??= createTreeNodeSchemaPrivateData(this, [normalizedTypes]));\n\t\t}\n\t}\n\n\tconst output: Output = Schema;\n\treturn output;\n}\n\n/**\n * Transforms data for a child of an array.\n * @param child - The tree data to be transformed.\n * @param allowedTypes - The set of types allowed by the parent context. Used to validate the input tree.\n */\nfunction arrayChildToFlexTree(\n\tchild: InsertableContent,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): FlexTreeNode {\n\t// We do not support undefined sequence entries.\n\t// If we encounter an undefined entry, use null instead if supported by the schema, otherwise throw.\n\tlet childWithFallback = child;\n\tif (child === undefined) {\n\t\tif (allowedTypes.has(nullSchema)) {\n\t\t\tchildWithFallback = null;\n\t\t} else {\n\t\t\tthrow new TypeError(`Received unsupported array entry value: ${child}.`);\n\t\t}\n\t}\n\treturn flexTreeFromInsertableNode(childWithFallback, allowedTypes);\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.toFlexContent} for Array nodes.\n *\n * @param data - The tree data to be transformed. Must be an iterable.\n * @param schema - The schema to comply with.\n */\nfunction arrayToFlexContent(data: FactoryContent, schema: ArrayNodeSchema): FlexContent {\n\tif (!(typeof data === \"object\" && data !== null && Symbol.iterator in data)) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\tthrow new UsageError(`Input data is incompatible with Array schema: ${data}`);\n\t}\n\n\tconst allowedChildTypes = normalizeAllowedTypes(schema.info);\n\n\tconst mappedData = Array.from(data, (child) =>\n\t\tarrayChildToFlexTree(child, allowedChildTypes.evaluateSet()),\n\t);\n\n\tconst context = getUnhydratedContext(schema).flexContext;\n\n\t// Array nodes have a single `EmptyKey` field:\n\tconst fieldsEntries =\n\t\tmappedData.length === 0\n\t\t\t? []\n\t\t\t: ([\n\t\t\t\t\t[\n\t\t\t\t\t\tEmptyKey,\n\t\t\t\t\t\tnew UnhydratedSequenceField(\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tFieldKinds.sequence.identifier,\n\t\t\t\t\t\t\tEmptyKey,\n\t\t\t\t\t\t\tmappedData,\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t] as const);\n\n\treturn [\n\t\t{\n\t\t\ttype: brand(schema.identifier),\n\t\t},\n\t\tnew Map(fieldsEntries),\n\t];\n}\n\n/**\n * {@link TreeNodeSchemaInitializedData.shallowCompatibilityTest} for Array nodes.\n */\nfunction shallowCompatibilityTest(\n\tdata: FactoryContent,\n\tschema: ArrayNodeSchema,\n): CompatibilityLevel {\n\tif (isTreeValue(data)) {\n\t\treturn CompatibilityLevel.None;\n\t}\n\n\tif (data instanceof Map) {\n\t\t// Maps are iterable, so type checking does allow constructing an ArrayNode from a map if the ArrayNode's type is an array that includes the key and value types of the map.\n\t\treturn CompatibilityLevel.Low;\n\t}\n\n\tif (Symbol.iterator in data) {\n\t\treturn CompatibilityLevel.Normal;\n\t}\n\n\treturn CompatibilityLevel.None;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/node-kinds/common.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAIN,KAAK,WAAW,EAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;GAEG;AAEH;;GAEG;AACH,wBAAgB,2BAA2B,CAC1C,cAAc,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,EAC9D,MAAM,EAAE,aAAa,GAAG,gBAAgB,GACtC,WAAW,CA0Bb"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/node-kinds/common.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAIN,KAAK,WAAW,EAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;GAEG;AAEH;;GAEG;AACH,wBAAgB,2BAA2B,CAC1C,cAAc,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,EAC9D,MAAM,EAAE,aAAa,GAAG,gBAAgB,GACtC,WAAW,CAuBb"}