@fluidframework/tree 2.102.0 → 2.103.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (367) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/codec/versioned/format.d.ts +5 -4
  3. package/dist/codec/versioned/format.d.ts.map +1 -1
  4. package/dist/codec/versioned/format.js +26 -3
  5. package/dist/codec/versioned/format.js.map +1 -1
  6. package/dist/core/rebase/types.d.ts +4 -3
  7. package/dist/core/rebase/types.d.ts.map +1 -1
  8. package/dist/core/rebase/types.js +27 -4
  9. package/dist/core/rebase/types.js.map +1 -1
  10. package/dist/core/schema-stored/formatV1.d.ts +16 -15
  11. package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
  12. package/dist/core/schema-stored/formatV1.js +31 -8
  13. package/dist/core/schema-stored/formatV1.js.map +1 -1
  14. package/dist/core/schema-stored/formatV2.d.ts +29 -28
  15. package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
  16. package/dist/core/schema-stored/formatV2.js +33 -10
  17. package/dist/core/schema-stored/formatV2.js.map +1 -1
  18. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +11 -10
  19. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  20. package/dist/core/tree/detachedFieldIndexFormatCommon.js +33 -10
  21. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  22. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +7 -6
  23. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  24. package/dist/core/tree/detachedFieldIndexFormatV2.js +25 -2
  25. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  26. package/dist/core/tree/persistedTreeTextFormat.d.ts +19 -18
  27. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  28. package/dist/core/tree/persistedTreeTextFormat.js +33 -10
  29. package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
  30. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  31. package/dist/feature-libraries/chunked-forest/chunkTree.js +1 -1
  32. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  33. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +13 -12
  34. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  35. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js +36 -13
  36. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
  37. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +36 -35
  38. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -1
  39. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +41 -18
  40. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
  41. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +26 -25
  42. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -1
  43. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +27 -4
  44. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
  45. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.d.ts +24 -23
  46. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.d.ts.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js +30 -7
  48. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -1
  49. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +66 -14
  50. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  51. package/dist/feature-libraries/chunked-forest/uniformChunk.js +101 -36
  52. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  53. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  54. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +36 -14
  55. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  56. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +6 -5
  57. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  58. package/dist/feature-libraries/forest-summary/formatCommon.js +26 -3
  59. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  60. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +4 -3
  61. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  62. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js +26 -3
  63. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  64. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +45 -44
  65. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  66. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +48 -25
  67. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  68. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +23 -22
  69. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  70. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +29 -6
  71. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  72. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +9 -8
  73. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  74. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +31 -8
  75. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
  76. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +14 -13
  77. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  78. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +34 -11
  79. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
  80. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +5 -4
  81. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  82. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js +25 -2
  83. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  84. package/dist/feature-libraries/schema-index/formatV1.d.ts +15 -14
  85. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  86. package/dist/feature-libraries/schema-index/formatV1.js +27 -4
  87. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
  88. package/dist/feature-libraries/schema-index/formatV2.d.ts +20 -19
  89. package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  90. package/dist/feature-libraries/schema-index/formatV2.js +27 -4
  91. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  92. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  93. package/dist/feature-libraries/sequence-field/compose.js +1 -3
  94. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  95. package/dist/feature-libraries/sequence-field/formatV1.d.ts +283 -282
  96. package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  97. package/dist/feature-libraries/sequence-field/formatV1.js +63 -40
  98. package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -1
  99. package/dist/feature-libraries/sequence-field/formatV2.d.ts +180 -179
  100. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  101. package/dist/feature-libraries/sequence-field/formatV2.js +55 -32
  102. package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
  103. package/dist/feature-libraries/sequence-field/formatV3.d.ts +126 -125
  104. package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  105. package/dist/feature-libraries/sequence-field/formatV3.js +27 -4
  106. package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
  107. package/dist/packageVersion.d.ts +1 -1
  108. package/dist/packageVersion.js +1 -1
  109. package/dist/packageVersion.js.map +1 -1
  110. package/dist/shared-tree/sharedTree.d.ts +2 -2
  111. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  112. package/dist/shared-tree/sharedTree.js.map +1 -1
  113. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  114. package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  115. package/dist/shared-tree/sharedTreeChangeFormat.js +28 -5
  116. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  117. package/dist/shared-tree/treeCheckout.d.ts +3 -3
  118. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  119. package/dist/shared-tree/treeCheckout.js.map +1 -1
  120. package/dist/shared-tree-core/editManager.d.ts +2 -2
  121. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  122. package/dist/shared-tree-core/editManager.js.map +1 -1
  123. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +35 -34
  124. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  125. package/dist/shared-tree-core/editManagerFormatCommons.js +39 -16
  126. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  127. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +15 -15
  128. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  129. package/dist/shared-tree-core/editManagerFormatV1toV4.js +33 -10
  130. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  131. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +40 -40
  132. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  133. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +27 -4
  134. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  135. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  136. package/dist/shared-tree-core/messageCodecVSharedBranches.js +25 -2
  137. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  138. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +5 -5
  139. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  140. package/dist/shared-tree-core/messageFormatV1ToV4.js +31 -8
  141. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  142. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -7
  143. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  144. package/dist/shared-tree-core/messageFormatVSharedBranches.js +29 -6
  145. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  146. package/dist/simple-tree/core/treeNodeKernel.d.ts +5 -0
  147. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  148. package/dist/simple-tree/core/treeNodeKernel.js +37 -13
  149. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  150. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +121 -120
  151. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  152. package/dist/simple-tree/simpleSchemaFormatV1.js +54 -31
  153. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  154. package/dist/util/typeboxBrand.d.ts +1 -1
  155. package/dist/util/typeboxBrand.d.ts.map +1 -1
  156. package/dist/util/typeboxBrand.js +26 -3
  157. package/dist/util/typeboxBrand.js.map +1 -1
  158. package/dist/util/utils.d.ts +2 -2
  159. package/dist/util/utils.d.ts.map +1 -1
  160. package/dist/util/utils.js +25 -2
  161. package/dist/util/utils.js.map +1 -1
  162. package/eslint.config.mts +44 -0
  163. package/lib/codec/versioned/format.d.ts +5 -4
  164. package/lib/codec/versioned/format.d.ts.map +1 -1
  165. package/lib/codec/versioned/format.js +1 -1
  166. package/lib/codec/versioned/format.js.map +1 -1
  167. package/lib/core/rebase/types.d.ts +4 -3
  168. package/lib/core/rebase/types.d.ts.map +1 -1
  169. package/lib/core/rebase/types.js +1 -1
  170. package/lib/core/rebase/types.js.map +1 -1
  171. package/lib/core/schema-stored/formatV1.d.ts +16 -15
  172. package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
  173. package/lib/core/schema-stored/formatV1.js +1 -1
  174. package/lib/core/schema-stored/formatV1.js.map +1 -1
  175. package/lib/core/schema-stored/formatV2.d.ts +29 -28
  176. package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
  177. package/lib/core/schema-stored/formatV2.js +1 -1
  178. package/lib/core/schema-stored/formatV2.js.map +1 -1
  179. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +11 -10
  180. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  181. package/lib/core/tree/detachedFieldIndexFormatCommon.js +1 -1
  182. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  183. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +7 -6
  184. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  185. package/lib/core/tree/detachedFieldIndexFormatV2.js +1 -1
  186. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  187. package/lib/core/tree/persistedTreeTextFormat.d.ts +19 -18
  188. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  189. package/lib/core/tree/persistedTreeTextFormat.js +1 -1
  190. package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
  191. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  192. package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -1
  193. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  194. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +13 -12
  195. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  196. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js +1 -1
  197. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
  198. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +36 -35
  199. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -1
  200. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js +1 -1
  201. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
  202. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +26 -25
  203. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -1
  204. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js +1 -1
  205. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
  206. package/lib/feature-libraries/chunked-forest/codec/format/formatVText.d.ts +24 -23
  207. package/lib/feature-libraries/chunked-forest/codec/format/formatVText.d.ts.map +1 -1
  208. package/lib/feature-libraries/chunked-forest/codec/format/formatVText.js +1 -1
  209. package/lib/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -1
  210. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +66 -14
  211. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  212. package/lib/feature-libraries/chunked-forest/uniformChunk.js +101 -36
  213. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  214. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  215. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +36 -14
  216. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  217. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +6 -5
  218. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  219. package/lib/feature-libraries/forest-summary/formatCommon.js +1 -1
  220. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  221. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +4 -3
  222. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  223. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js +1 -1
  224. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  225. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +45 -44
  226. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  227. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js +1 -1
  228. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  229. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +23 -22
  230. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  231. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +1 -1
  232. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  233. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +9 -8
  234. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  235. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +1 -1
  236. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
  237. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +14 -13
  238. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  239. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +1 -1
  240. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
  241. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +5 -4
  242. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  243. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +1 -1
  244. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  245. package/lib/feature-libraries/schema-index/formatV1.d.ts +15 -14
  246. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  247. package/lib/feature-libraries/schema-index/formatV1.js +1 -1
  248. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
  249. package/lib/feature-libraries/schema-index/formatV2.d.ts +20 -19
  250. package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  251. package/lib/feature-libraries/schema-index/formatV2.js +1 -1
  252. package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
  253. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  254. package/lib/feature-libraries/sequence-field/compose.js +1 -3
  255. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  256. package/lib/feature-libraries/sequence-field/formatV1.d.ts +283 -282
  257. package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  258. package/lib/feature-libraries/sequence-field/formatV1.js +1 -1
  259. package/lib/feature-libraries/sequence-field/formatV1.js.map +1 -1
  260. package/lib/feature-libraries/sequence-field/formatV2.d.ts +180 -179
  261. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  262. package/lib/feature-libraries/sequence-field/formatV2.js +1 -1
  263. package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
  264. package/lib/feature-libraries/sequence-field/formatV3.d.ts +126 -125
  265. package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  266. package/lib/feature-libraries/sequence-field/formatV3.js +1 -1
  267. package/lib/feature-libraries/sequence-field/formatV3.js.map +1 -1
  268. package/lib/packageVersion.d.ts +1 -1
  269. package/lib/packageVersion.js +1 -1
  270. package/lib/packageVersion.js.map +1 -1
  271. package/lib/shared-tree/sharedTree.d.ts +2 -2
  272. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  273. package/lib/shared-tree/sharedTree.js +1 -1
  274. package/lib/shared-tree/sharedTree.js.map +1 -1
  275. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  276. package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  277. package/lib/shared-tree/sharedTreeChangeFormat.js +1 -1
  278. package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  279. package/lib/shared-tree/treeCheckout.d.ts +3 -3
  280. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  281. package/lib/shared-tree/treeCheckout.js +1 -1
  282. package/lib/shared-tree/treeCheckout.js.map +1 -1
  283. package/lib/shared-tree-core/editManager.d.ts +2 -2
  284. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  285. package/lib/shared-tree-core/editManager.js.map +1 -1
  286. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +35 -34
  287. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  288. package/lib/shared-tree-core/editManagerFormatCommons.js +1 -1
  289. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  290. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +15 -15
  291. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  292. package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -1
  293. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  294. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +40 -40
  295. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  296. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  297. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  298. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  299. package/lib/shared-tree-core/messageCodecVSharedBranches.js +1 -1
  300. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  301. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +5 -5
  302. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  303. package/lib/shared-tree-core/messageFormatV1ToV4.js +1 -1
  304. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  305. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -7
  306. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  307. package/lib/shared-tree-core/messageFormatVSharedBranches.js +1 -1
  308. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  309. package/lib/simple-tree/core/treeNodeKernel.d.ts +5 -0
  310. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  311. package/lib/simple-tree/core/treeNodeKernel.js +35 -12
  312. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  313. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +121 -120
  314. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  315. package/lib/simple-tree/simpleSchemaFormatV1.js +1 -1
  316. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  317. package/lib/util/typeboxBrand.d.ts +1 -1
  318. package/lib/util/typeboxBrand.d.ts.map +1 -1
  319. package/lib/util/typeboxBrand.js +1 -1
  320. package/lib/util/typeboxBrand.js.map +1 -1
  321. package/lib/util/utils.d.ts +2 -2
  322. package/lib/util/utils.d.ts.map +1 -1
  323. package/lib/util/utils.js +1 -1
  324. package/lib/util/utils.js.map +1 -1
  325. package/package.json +21 -21
  326. package/src/codec/versioned/format.ts +2 -1
  327. package/src/core/rebase/types.ts +1 -1
  328. package/src/core/schema-stored/formatV1.ts +2 -1
  329. package/src/core/schema-stored/formatV2.ts +2 -1
  330. package/src/core/tree/detachedFieldIndexFormatCommon.ts +2 -1
  331. package/src/core/tree/detachedFieldIndexFormatV2.ts +2 -1
  332. package/src/core/tree/persistedTreeTextFormat.ts +2 -1
  333. package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -2
  334. package/src/feature-libraries/chunked-forest/codec/format/formatGeneric.ts +2 -1
  335. package/src/feature-libraries/chunked-forest/codec/format/formatV1.ts +2 -1
  336. package/src/feature-libraries/chunked-forest/codec/format/formatV2.ts +2 -1
  337. package/src/feature-libraries/chunked-forest/codec/format/formatVText.ts +2 -1
  338. package/src/feature-libraries/chunked-forest/uniformChunk.ts +131 -44
  339. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +36 -14
  340. package/src/feature-libraries/forest-summary/formatCommon.ts +2 -1
  341. package/src/feature-libraries/modular-schema/genericFieldKindFormat.ts +2 -1
  342. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +2 -1
  343. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +2 -1
  344. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV1.ts +2 -1
  345. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV2.ts +2 -1
  346. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +2 -1
  347. package/src/feature-libraries/schema-index/formatV1.ts +2 -1
  348. package/src/feature-libraries/schema-index/formatV2.ts +2 -1
  349. package/src/feature-libraries/sequence-field/compose.ts +1 -4
  350. package/src/feature-libraries/sequence-field/formatV1.ts +2 -1
  351. package/src/feature-libraries/sequence-field/formatV2.ts +2 -1
  352. package/src/feature-libraries/sequence-field/formatV3.ts +2 -1
  353. package/src/packageVersion.ts +1 -1
  354. package/src/shared-tree/sharedTree.ts +2 -5
  355. package/src/shared-tree/sharedTreeChangeFormat.ts +2 -1
  356. package/src/shared-tree/treeCheckout.ts +3 -6
  357. package/src/shared-tree-core/editManager.ts +2 -2
  358. package/src/shared-tree-core/editManagerFormatCommons.ts +2 -1
  359. package/src/shared-tree-core/editManagerFormatV1toV4.ts +2 -1
  360. package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +2 -1
  361. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -1
  362. package/src/shared-tree-core/messageFormatV1ToV4.ts +2 -1
  363. package/src/shared-tree-core/messageFormatVSharedBranches.ts +2 -1
  364. package/src/simple-tree/core/treeNodeKernel.ts +39 -15
  365. package/src/simple-tree/simpleSchemaFormatV1.ts +2 -1
  366. package/src/util/typeboxBrand.ts +2 -1
  367. package/src/util/utils.ts +2 -1
@@ -2,32 +2,33 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type Static } from "@sinclair/typebox";
5
+ import * as Type from "@sinclair/typebox";
6
+ import type { Static } from "@sinclair/typebox";
6
7
  /**
7
8
  * Encoded content is a {@link ChunkReferenceId}.
8
9
  * This represents the shape of a chunk that is encoded separately and is referenced by its {@link ChunkReferenceId}.
9
10
  */
10
11
  export type EncodedIncrementalChunkShape = Static<typeof EncodedIncrementalChunkShape>;
11
- export declare const EncodedIncrementalChunkShape: import("@sinclair/typebox").TLiteral<0>;
12
+ export declare const EncodedIncrementalChunkShape: Type.TLiteral<0>;
12
13
  /**
13
14
  * The chunk shapes supported by the V2 format.
14
15
  * @remarks
15
16
  * See {@link EncodedChunkShapeV2}.
16
17
  */
17
18
  export declare const shapesV2: {
18
- readonly e: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<0>>;
19
- readonly a: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
20
- readonly b: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
21
- length: import("@sinclair/typebox").TNumber;
22
- shape: import("@sinclair/typebox").TNumber;
19
+ readonly e: Type.TOptional<Type.TLiteral<0>>;
20
+ readonly a: Type.TOptional<Type.TNumber>;
21
+ readonly b: Type.TOptional<Type.TObject<{
22
+ length: Type.TNumber;
23
+ shape: Type.TNumber;
23
24
  }>>;
24
- readonly c: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
25
- type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>>;
26
- value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>, import("@sinclair/typebox").TEnum<typeof import("./formatV1.js").SpecialField>]>>;
27
- fields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>, import("@sinclair/typebox").TNumber]>>>;
28
- extraFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
25
+ readonly c: Type.TOptional<Type.TObject<{
26
+ type: Type.TOptional<Type.TUnion<[Type.TString, Type.TNumber]>>;
27
+ value: Type.TOptional<Type.TUnion<[Type.TBoolean, Type.TArray<Type.TAny>, Type.TEnum<typeof import("./formatV1.js").SpecialField>]>>;
28
+ fields: Type.TOptional<Type.TArray<Type.TTuple<[Type.TUnion<[Type.TString, Type.TNumber]>, Type.TNumber]>>>;
29
+ extraFields: Type.TOptional<Type.TNumber>;
29
30
  }>>;
30
- readonly d: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<0>>;
31
+ readonly d: Type.TOptional<Type.TLiteral<0>>;
31
32
  };
32
33
  /**
33
34
  * V2 extension of {@link EncodedChunkShapeV1}.
@@ -35,19 +36,19 @@ export declare const shapesV2: {
35
36
  * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
36
37
  */
37
38
  export type EncodedChunkShapeV2 = Static<typeof EncodedChunkShapeV2>;
38
- export declare const EncodedChunkShapeV2: import("@sinclair/typebox").TObject<{
39
- readonly e: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<0>>;
40
- readonly a: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
41
- readonly b: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
42
- length: import("@sinclair/typebox").TNumber;
43
- shape: import("@sinclair/typebox").TNumber;
39
+ export declare const EncodedChunkShapeV2: Type.TObject<{
40
+ readonly e: Type.TOptional<Type.TLiteral<0>>;
41
+ readonly a: Type.TOptional<Type.TNumber>;
42
+ readonly b: Type.TOptional<Type.TObject<{
43
+ length: Type.TNumber;
44
+ shape: Type.TNumber;
44
45
  }>>;
45
- readonly c: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
46
- type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>>;
47
- value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>, import("@sinclair/typebox").TEnum<typeof import("./formatV1.js").SpecialField>]>>;
48
- fields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>, import("@sinclair/typebox").TNumber]>>>;
49
- extraFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
46
+ readonly c: Type.TOptional<Type.TObject<{
47
+ type: Type.TOptional<Type.TUnion<[Type.TString, Type.TNumber]>>;
48
+ value: Type.TOptional<Type.TUnion<[Type.TBoolean, Type.TArray<Type.TAny>, Type.TEnum<typeof import("./formatV1.js").SpecialField>]>>;
49
+ fields: Type.TOptional<Type.TArray<Type.TTuple<[Type.TUnion<[Type.TString, Type.TNumber]>, Type.TNumber]>>>;
50
+ extraFields: Type.TOptional<Type.TNumber>;
50
51
  }>>;
51
- readonly d: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<0>>;
52
+ readonly d: Type.TOptional<Type.TLiteral<0>>;
52
53
  }>;
53
54
  //# sourceMappingURL=formatV2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatV2.d.ts","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAMtD;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAC;AACvF,eAAO,MAAM,4BAA4B,yCAAkB,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;CAGX,CAAC;AAEX;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;EAAsC,CAAC"}
1
+ {"version":3,"file":"formatV2.d.ts","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMhD;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAC;AACvF,eAAO,MAAM,4BAA4B,kBAAkB,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;CAGX,CAAC;AAEX;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;EAAsC,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { Type } from "@sinclair/typebox";
5
+ import * as Type from "@sinclair/typebox";
6
6
  import { unionOptions } from "../../../../codec/index.js";
7
7
  import { shapesV1 } from "./formatV1.js";
8
8
  export const EncodedIncrementalChunkShape = Type.Literal(0);
@@ -1 +1 @@
1
- {"version":3,"file":"formatV2.js","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAOzC,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB,GAAG,QAAQ;IACX,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAAC;CACrC,CAAC;AAQX,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../../../codec/index.js\";\n\nimport { shapesV1 } from \"./formatV1.js\";\n\n/**\n * Encoded content is a {@link ChunkReferenceId}.\n * This represents the shape of a chunk that is encoded separately and is referenced by its {@link ChunkReferenceId}.\n */\nexport type EncodedIncrementalChunkShape = Static<typeof EncodedIncrementalChunkShape>;\nexport const EncodedIncrementalChunkShape = Type.Literal(0);\n\n/**\n * The chunk shapes supported by the V2 format.\n * @remarks\n * See {@link EncodedChunkShapeV2}.\n */\nexport const shapesV2 = {\n\t...shapesV1,\n\te: Type.Optional(EncodedIncrementalChunkShape),\n} as const;\n\n/**\n * V2 extension of {@link EncodedChunkShapeV1}.\n * @remarks\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport type EncodedChunkShapeV2 = Static<typeof EncodedChunkShapeV2>;\nexport const EncodedChunkShapeV2 = Type.Object(shapesV2, unionOptions);\n"]}
1
+ {"version":3,"file":"formatV2.js","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAOzC,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB,GAAG,QAAQ;IACX,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAAC;CACrC,CAAC;AAQX,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as Type from \"@sinclair/typebox\";\nimport type { Static } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../../../codec/index.js\";\n\nimport { shapesV1 } from \"./formatV1.js\";\n\n/**\n * Encoded content is a {@link ChunkReferenceId}.\n * This represents the shape of a chunk that is encoded separately and is referenced by its {@link ChunkReferenceId}.\n */\nexport type EncodedIncrementalChunkShape = Static<typeof EncodedIncrementalChunkShape>;\nexport const EncodedIncrementalChunkShape = Type.Literal(0);\n\n/**\n * The chunk shapes supported by the V2 format.\n * @remarks\n * See {@link EncodedChunkShapeV2}.\n */\nexport const shapesV2 = {\n\t...shapesV1,\n\te: Type.Optional(EncodedIncrementalChunkShape),\n} as const;\n\n/**\n * V2 extension of {@link EncodedChunkShapeV1}.\n * @remarks\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport type EncodedChunkShapeV2 = Static<typeof EncodedChunkShapeV2>;\nexport const EncodedChunkShapeV2 = Type.Object(shapesV2, unionOptions);\n"]}
@@ -2,7 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type Static } from "@sinclair/typebox";
5
+ import * as Type from "@sinclair/typebox";
6
+ import type { Static } from "@sinclair/typebox";
6
7
  /**
7
8
  * A node shape that derives from another node shape by overlaying property-level overrides.
8
9
  *
@@ -27,14 +28,14 @@ import { type Static } from "@sinclair/typebox";
27
28
  * Decoded by {@link applySpecialization}.
28
29
  */
29
30
  export type EncodedSpecializedNodeShape = Static<typeof EncodedSpecializedNodeShape>;
30
- export declare const EncodedSpecializedNodeShape: import("@sinclair/typebox").TObject<{
31
+ export declare const EncodedSpecializedNodeShape: Type.TObject<{
31
32
  /**
32
33
  * Index into the enclosing batch's shapes array of the shape this specializes.
33
34
  * Must resolve to either an {@link EncodedNodeShape} or another
34
35
  * `EncodedSpecializedNodeShape`; chains are followed transitively until a node shape
35
36
  * is reached. This restriction is enforced at runtime, not by the schema.
36
37
  */
37
- base: import("@sinclair/typebox").TNumber;
38
+ base: Type.TNumber;
38
39
  /**
39
40
  * Field-level overrides applied to the resolved base's `fields`. Entries whose key
40
41
  * matches a base field replace that field's shape index in place; entries with new
@@ -42,17 +43,17 @@ export declare const EncodedSpecializedNodeShape: import("@sinclair/typebox").TO
42
43
  * is preserved — this is the stream consumption order at decode time, so encoders
43
44
  * must serialize per-field tokens in the resulting field order, not in this list's order.
44
45
  */
45
- fields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>, import("@sinclair/typebox").TNumber]>>>;
46
+ fields: Type.TOptional<Type.TArray<Type.TTuple<[Type.TUnion<[Type.TString, Type.TNumber]>, Type.TNumber]>>>;
46
47
  /**
47
48
  * If absent, inherits the resolved base's value shape. If `null`, the resulting shape
48
49
  * has no value shape (explicit clear). Any other value replaces the base's.
49
50
  */
50
- value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>, import("@sinclair/typebox").TEnum<typeof import("./formatV1.js").SpecialField>]>, import("@sinclair/typebox").TNull]>>;
51
+ value: Type.TOptional<Type.TUnion<[Type.TUnion<[Type.TBoolean, Type.TArray<Type.TAny>, Type.TEnum<typeof import("./formatV1.js").SpecialField>]>, Type.TNull]>>;
51
52
  /**
52
53
  * If absent, inherits the resolved base's extraFields shape. If `null`, the resulting
53
54
  * shape has no extraFields (explicit clear). Any other value replaces the base's.
54
55
  */
55
- extraFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
56
+ extraFields: Type.TOptional<Type.TUnion<[Type.TNumber, Type.TNull]>>;
56
57
  }>;
57
58
  /**
58
59
  * Experimental extension of {@link EncodedChunkShapeV2}.
@@ -60,15 +61,15 @@ export declare const EncodedSpecializedNodeShape: import("@sinclair/typebox").TO
60
61
  * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
61
62
  */
62
63
  export type EncodedChunkShapeVTextExperimental = Static<typeof EncodedChunkShapeVTextExperimental>;
63
- export declare const EncodedChunkShapeVTextExperimental: import("@sinclair/typebox").TObject<{
64
- f: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
64
+ export declare const EncodedChunkShapeVTextExperimental: Type.TObject<{
65
+ f: Type.TOptional<Type.TObject<{
65
66
  /**
66
67
  * Index into the enclosing batch's shapes array of the shape this specializes.
67
68
  * Must resolve to either an {@link EncodedNodeShape} or another
68
69
  * `EncodedSpecializedNodeShape`; chains are followed transitively until a node shape
69
70
  * is reached. This restriction is enforced at runtime, not by the schema.
70
71
  */
71
- base: import("@sinclair/typebox").TNumber;
72
+ base: Type.TNumber;
72
73
  /**
73
74
  * Field-level overrides applied to the resolved base's `fields`. Entries whose key
74
75
  * matches a base field replace that field's shape index in place; entries with new
@@ -76,30 +77,30 @@ export declare const EncodedChunkShapeVTextExperimental: import("@sinclair/typeb
76
77
  * is preserved — this is the stream consumption order at decode time, so encoders
77
78
  * must serialize per-field tokens in the resulting field order, not in this list's order.
78
79
  */
79
- fields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>, import("@sinclair/typebox").TNumber]>>>;
80
+ fields: Type.TOptional<Type.TArray<Type.TTuple<[Type.TUnion<[Type.TString, Type.TNumber]>, Type.TNumber]>>>;
80
81
  /**
81
82
  * If absent, inherits the resolved base's value shape. If `null`, the resulting shape
82
83
  * has no value shape (explicit clear). Any other value replaces the base's.
83
84
  */
84
- value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>, import("@sinclair/typebox").TEnum<typeof import("./formatV1.js").SpecialField>]>, import("@sinclair/typebox").TNull]>>;
85
+ value: Type.TOptional<Type.TUnion<[Type.TUnion<[Type.TBoolean, Type.TArray<Type.TAny>, Type.TEnum<typeof import("./formatV1.js").SpecialField>]>, Type.TNull]>>;
85
86
  /**
86
87
  * If absent, inherits the resolved base's extraFields shape. If `null`, the resulting
87
88
  * shape has no extraFields (explicit clear). Any other value replaces the base's.
88
89
  */
89
- extraFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
90
+ extraFields: Type.TOptional<Type.TUnion<[Type.TNumber, Type.TNull]>>;
90
91
  }>>;
91
- e: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<0>>;
92
- a: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
93
- b: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
94
- length: import("@sinclair/typebox").TNumber;
95
- shape: import("@sinclair/typebox").TNumber;
92
+ e: Type.TOptional<Type.TLiteral<0>>;
93
+ a: Type.TOptional<Type.TNumber>;
94
+ b: Type.TOptional<Type.TObject<{
95
+ length: Type.TNumber;
96
+ shape: Type.TNumber;
96
97
  }>>;
97
- c: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
98
- type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>>;
99
- value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>, import("@sinclair/typebox").TEnum<typeof import("./formatV1.js").SpecialField>]>>;
100
- fields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>, import("@sinclair/typebox").TNumber]>>>;
101
- extraFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
98
+ c: Type.TOptional<Type.TObject<{
99
+ type: Type.TOptional<Type.TUnion<[Type.TString, Type.TNumber]>>;
100
+ value: Type.TOptional<Type.TUnion<[Type.TBoolean, Type.TArray<Type.TAny>, Type.TEnum<typeof import("./formatV1.js").SpecialField>]>>;
101
+ fields: Type.TOptional<Type.TArray<Type.TTuple<[Type.TUnion<[Type.TString, Type.TNumber]>, Type.TNumber]>>>;
102
+ extraFields: Type.TOptional<Type.TNumber>;
102
103
  }>>;
103
- d: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<0>>;
104
+ d: Type.TOptional<Type.TLiteral<0>>;
104
105
  }>;
105
106
  //# sourceMappingURL=formatVText.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatVText.d.ts","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/formatVText.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAQtD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AACrF,eAAO,MAAM,2BAA2B;IAEtC;;;;;OAKG;;IAEH;;;;;;OAMG;;IAEH;;;OAGG;;IAEH;;;OAGG;;EAIJ,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kCAAkC,GAAG,MAAM,CACtD,OAAO,kCAAkC,CACzC,CAAC;AACF,eAAO,MAAM,kCAAkC;;QArC7C;;;;;WAKG;;QAEH;;;;;;WAMG;;QAEH;;;WAGG;;QAEH;;;WAGG;;;;;;;;;;;;;;;;EAoBJ,CAAC"}
1
+ {"version":3,"file":"formatVText.d.ts","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/formatVText.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAQhD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AACrF,eAAO,MAAM,2BAA2B;IAEtC;;;;;OAKG;;IAEH;;;;;;OAMG;;IAEH;;;OAGG;;IAEH;;;OAGG;;EAIJ,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kCAAkC,GAAG,MAAM,CACtD,OAAO,kCAAkC,CACzC,CAAC;AACF,eAAO,MAAM,kCAAkC;;QArC7C;;;;;WAKG;;QAEH;;;;;;WAMG;;QAEH;;;WAGG;;QAEH;;;WAGG;;;;;;;;;;;;;;;;EAoBJ,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { Type } from "@sinclair/typebox";
5
+ import * as Type from "@sinclair/typebox";
6
6
  import { unionOptions } from "../../../../codec/index.js";
7
7
  import { ShapeIndex } from "./formatGeneric.js";
8
8
  import { EncodedFieldShape, EncodedValueShape } from "./formatV1.js";
@@ -1 +1 @@
1
- {"version":3,"file":"formatVText.js","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/formatVText.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA0BzC,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC,MAAM,CACrD;IACC;;;;;OAKG;IACH,IAAI,EAAE,UAAU;IAChB;;;;;;OAMG;IACH,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpD;;;OAGG;IACH,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAClE;;;OAGG;IACH,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;CACjE,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC;AAUF,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,CAAC,MAAM,CAC5D;IACC,GAAG,QAAQ;IACX,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CAC7C,EACD,YAAY,CACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../../../codec/index.js\";\n\nimport { ShapeIndex } from \"./formatGeneric.js\";\nimport { EncodedFieldShape, EncodedValueShape } from \"./formatV1.js\";\nimport { shapesV2 } from \"./formatV2.js\";\n\n/**\n * A node shape that derives from another node shape by overlaying property-level overrides.\n *\n * @remarks\n * Compresses runs of node shapes that differ only in a few properties: a base node shape\n * defines the structural skeleton, and the specialization narrows specific properties.\n *\n * For example, a base `FormatNode` with a variable-boolean `bold` field can be specialized\n * to a shape that pins `bold` to a constant `true` — every node decoded with the\n * specialization contributes zero stream tokens for `bold`.\n *\n * Specialization rules: `type` is always inherited from the resolved base. `fields` overrides\n * apply per-key: entries whose key matches a base field replace that entry's shape index in\n * place; entries with new keys are appended after all base fields. For `value` and\n * `extraFields`: if the property is absent on the wire, the base's value is inherited; if\n * `null`, the resulting shape has no value / no extraFields (explicit clear); any other value\n * replaces the base's.\n *\n * The `null` sentinel exists because JSON does not preserve `undefined`-valued properties,\n * so override-vs-inherit cannot be discriminated by property presence after persistence.\n *\n * Decoded by {@link applySpecialization}.\n */\nexport type EncodedSpecializedNodeShape = Static<typeof EncodedSpecializedNodeShape>;\nexport const EncodedSpecializedNodeShape = Type.Object(\n\t{\n\t\t/**\n\t\t * Index into the enclosing batch's shapes array of the shape this specializes.\n\t\t * Must resolve to either an {@link EncodedNodeShape} or another\n\t\t * `EncodedSpecializedNodeShape`; chains are followed transitively until a node shape\n\t\t * is reached. This restriction is enforced at runtime, not by the schema.\n\t\t */\n\t\tbase: ShapeIndex,\n\t\t/**\n\t\t * Field-level overrides applied to the resolved base's `fields`. Entries whose key\n\t\t * matches a base field replace that field's shape index in place; entries with new\n\t\t * keys are appended after all base fields, in the order given here. Base field order\n\t\t * is preserved — this is the stream consumption order at decode time, so encoders\n\t\t * must serialize per-field tokens in the resulting field order, not in this list's order.\n\t\t */\n\t\tfields: Type.Optional(Type.Array(EncodedFieldShape)),\n\t\t/**\n\t\t * If absent, inherits the resolved base's value shape. If `null`, the resulting shape\n\t\t * has no value shape (explicit clear). Any other value replaces the base's.\n\t\t */\n\t\tvalue: Type.Optional(Type.Union([EncodedValueShape, Type.Null()])),\n\t\t/**\n\t\t * If absent, inherits the resolved base's extraFields shape. If `null`, the resulting\n\t\t * shape has no extraFields (explicit clear). Any other value replaces the base's.\n\t\t */\n\t\textraFields: Type.Optional(Type.Union([ShapeIndex, Type.Null()])),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Experimental extension of {@link EncodedChunkShapeV2}.\n * @remarks\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport type EncodedChunkShapeVTextExperimental = Static<\n\ttypeof EncodedChunkShapeVTextExperimental\n>;\nexport const EncodedChunkShapeVTextExperimental = Type.Object(\n\t{\n\t\t...shapesV2,\n\t\tf: Type.Optional(EncodedSpecializedNodeShape),\n\t},\n\tunionOptions,\n);\n"]}
1
+ {"version":3,"file":"formatVText.js","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/formatVText.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA0BzC,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC,MAAM,CACrD;IACC;;;;;OAKG;IACH,IAAI,EAAE,UAAU;IAChB;;;;;;OAMG;IACH,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpD;;;OAGG;IACH,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAClE;;;OAGG;IACH,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;CACjE,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC;AAUF,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,CAAC,MAAM,CAC5D;IACC,GAAG,QAAQ;IACX,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CAC7C,EACD,YAAY,CACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as Type from \"@sinclair/typebox\";\nimport type { Static } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../../../codec/index.js\";\n\nimport { ShapeIndex } from \"./formatGeneric.js\";\nimport { EncodedFieldShape, EncodedValueShape } from \"./formatV1.js\";\nimport { shapesV2 } from \"./formatV2.js\";\n\n/**\n * A node shape that derives from another node shape by overlaying property-level overrides.\n *\n * @remarks\n * Compresses runs of node shapes that differ only in a few properties: a base node shape\n * defines the structural skeleton, and the specialization narrows specific properties.\n *\n * For example, a base `FormatNode` with a variable-boolean `bold` field can be specialized\n * to a shape that pins `bold` to a constant `true` — every node decoded with the\n * specialization contributes zero stream tokens for `bold`.\n *\n * Specialization rules: `type` is always inherited from the resolved base. `fields` overrides\n * apply per-key: entries whose key matches a base field replace that entry's shape index in\n * place; entries with new keys are appended after all base fields. For `value` and\n * `extraFields`: if the property is absent on the wire, the base's value is inherited; if\n * `null`, the resulting shape has no value / no extraFields (explicit clear); any other value\n * replaces the base's.\n *\n * The `null` sentinel exists because JSON does not preserve `undefined`-valued properties,\n * so override-vs-inherit cannot be discriminated by property presence after persistence.\n *\n * Decoded by {@link applySpecialization}.\n */\nexport type EncodedSpecializedNodeShape = Static<typeof EncodedSpecializedNodeShape>;\nexport const EncodedSpecializedNodeShape = Type.Object(\n\t{\n\t\t/**\n\t\t * Index into the enclosing batch's shapes array of the shape this specializes.\n\t\t * Must resolve to either an {@link EncodedNodeShape} or another\n\t\t * `EncodedSpecializedNodeShape`; chains are followed transitively until a node shape\n\t\t * is reached. This restriction is enforced at runtime, not by the schema.\n\t\t */\n\t\tbase: ShapeIndex,\n\t\t/**\n\t\t * Field-level overrides applied to the resolved base's `fields`. Entries whose key\n\t\t * matches a base field replace that field's shape index in place; entries with new\n\t\t * keys are appended after all base fields, in the order given here. Base field order\n\t\t * is preserved — this is the stream consumption order at decode time, so encoders\n\t\t * must serialize per-field tokens in the resulting field order, not in this list's order.\n\t\t */\n\t\tfields: Type.Optional(Type.Array(EncodedFieldShape)),\n\t\t/**\n\t\t * If absent, inherits the resolved base's value shape. If `null`, the resulting shape\n\t\t * has no value shape (explicit clear). Any other value replaces the base's.\n\t\t */\n\t\tvalue: Type.Optional(Type.Union([EncodedValueShape, Type.Null()])),\n\t\t/**\n\t\t * If absent, inherits the resolved base's extraFields shape. If `null`, the resulting\n\t\t * shape has no extraFields (explicit clear). Any other value replaces the base's.\n\t\t */\n\t\textraFields: Type.Optional(Type.Union([ShapeIndex, Type.Null()])),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Experimental extension of {@link EncodedChunkShapeV2}.\n * @remarks\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport type EncodedChunkShapeVTextExperimental = Static<\n\ttypeof EncodedChunkShapeVTextExperimental\n>;\nexport const EncodedChunkShapeVTextExperimental = Type.Object(\n\t{\n\t\t...shapesV2,\n\t\tf: Type.Optional(EncodedSpecializedNodeShape),\n\t},\n\tunionOptions,\n);\n"]}
@@ -57,6 +57,15 @@ export declare class TreeShape {
57
57
  readonly fields: ReadonlyMap<FieldKey, OffsetShape>;
58
58
  readonly fieldsOffsetArray: readonly OffsetShape[];
59
59
  readonly valuesPerTopLevelNode: number;
60
+ /**
61
+ * Information about every node in this shape.
62
+ * The root is first, and all indexes it uses to refer to other nodes are indexes into this array.
63
+ * Beyond that the ordering is an implementation detail of this shape.
64
+ * @remarks
65
+ * Use of this in contexts where there might be multiple top-level nodes requires some additional care.
66
+ * For example {@link Cursor} derives each node's actual position info from this shared
67
+ * array plus the node's top-level index within the chunk.
68
+ */
60
69
  readonly positions: readonly NodePositionInfo[];
61
70
  /**
62
71
  * Whether chunks using this shape (including any descendant leaf within it) may contain values compressed by the {@link UniformChunk.idCompressor}.
@@ -89,16 +98,16 @@ export declare class TreeShape {
89
98
  /**
90
99
  * The shape (see `TreeShape`) of a sequence of trees, all with the same shape (like `FieldShape`, but without a field key).
91
100
  *
92
- * This shape is optimized (by caching derived data like the positions array),
93
- * so that when paired with a value array it can be efficiently traversed like a tree by an {@link ITreeCursorSynchronous}.
94
- * See {@link uniformChunk} for how to do this.
101
+ * @remarks
102
+ * Paired with a value array, this lets a {@link UniformChunk} be traversed like a tree by an
103
+ * {@link ITreeCursorSynchronous}. The {@link Cursor} derives each node's position info from the
104
+ * shared {@link TreeShape.positions} plus the node's top-level index.
95
105
  *
96
106
  * TODO: consider storing shape information in WASM
97
107
  */
98
108
  export declare class ChunkShape {
99
109
  readonly treeShape: TreeShape;
100
110
  readonly topLevelLength: number;
101
- readonly positions: readonly (NodePositionInfo | undefined)[];
102
111
  constructor(treeShape: TreeShape, topLevelLength: number);
103
112
  equals(other: ChunkShape): boolean;
104
113
  }
@@ -122,7 +131,7 @@ declare class OffsetShape {
122
131
  constructor(shape: TreeShape, topLevelLength: number, offset: number, key: FieldKey, indexOfParentField: number | undefined);
123
132
  }
124
133
  /**
125
- * Information about a node at a specific position within a uniform chunk.
134
+ * Information about a node at a specific position within one top-level tree of a {@link TreeShape}.
126
135
  */
127
136
  declare class NodePositionInfo implements UpPath {
128
137
  readonly parent: NodePositionInfo | undefined;
@@ -134,13 +143,15 @@ declare class NodePositionInfo implements UpPath {
134
143
  readonly topLevelLength: number;
135
144
  readonly valueOffset: number;
136
145
  /**
137
- * @param parent - TODO
138
- * @param parentField - TODO
146
+ * @param parent - The parent node's {@link NodePositionInfo} or `undefined` for a root.
147
+ * @param parentField - The {@link FieldKey} of the field this node occupies within its parent.
139
148
  * @param parentIndex - indexWithinParentField
140
- * @param indexOfParentField - which field of the parent `parentIndex` is indexing into to locate this.
141
- * @param indexOfParentPosition - Index of parent NodePositionInfo in positions array. TODO: use offsets to avoid copying at top level?
149
+ * @param indexOfParentField - Which field of the parent `parentIndex` is indexing into to locate this.
150
+ * @param indexOfParentPosition - Index of this node's parent in {@link TreeShape.positions}
142
151
  * @param shape - Shape of the top level sequence this node is part of
143
- * @param valueOffset - TODO
152
+ * @param topLevelLength - Number of siblings in this node's field. For a root this is unused
153
+ * @param valueOffset - Offset of this node's value within one top-level tree's slice of the chunk's flat `values` array;
154
+ * only valid when `shape.hasValue` (otherwise it's where the value would have gone, and should not be used to read a value).
144
155
  */
145
156
  constructor(parent: NodePositionInfo | undefined, // TODO; general UpPath to allow prefixing here?
146
157
  parentField: FieldKey, parentIndex: number, indexOfParentField: number | undefined, indexOfParentPosition: number | undefined, shape: TreeShape, // Shape of sequence that contains this node (top level is parent of this node)
@@ -149,14 +160,25 @@ declare class NodePositionInfo implements UpPath {
149
160
  /**
150
161
  * The cursor implementation for `UniformChunk`.
151
162
  *
152
- * Works by tracking its location in the chunk's `positions` array.
163
+ * @remarks
164
+ * Tracks a flat `positionIndex` and derives each node's position info from the shape's shared
165
+ * {@link TreeShape.positions} plus the node's top-level index.
153
166
  */
154
167
  declare class Cursor extends SynchronousCursor implements ChunkedCursor {
155
168
  private readonly chunk;
156
169
  private positionIndex;
170
+ /** Position info for the current node, or `undefined` when in root field. */
157
171
  private nodePositionInfo;
172
+ /** Which top-level node of the chunk the current position is within. Valid when nodePositionInfo !== undefined. */
173
+ private topLevelIndex;
174
+ /** The chunk's shape. */
158
175
  private readonly shape;
159
- private readonly positions;
176
+ /** The chunk's per-tree shape (shape of each top-level tree). */
177
+ private readonly treeShape;
178
+ /** Number of positions in one top-level tree (treeShape.positions.length). */
179
+ private readonly nodeLength;
180
+ /** Number of values per top-level node (treeShape.valuesPerTopLevelNode). */
181
+ private readonly stride;
160
182
  mode: CursorLocationType;
161
183
  private fieldKey?;
162
184
  private indexOfField;
@@ -166,12 +188,32 @@ declare class Cursor extends SynchronousCursor implements ChunkedCursor {
166
188
  fork(): Cursor;
167
189
  /**
168
190
  * Change the current node within the chunk.
191
+ *
192
+ * @param positionIndex - flat position index of the newly selected node. This is NOT an index
193
+ * within a field, and is not bounds checked.
194
+ *
195
+ * @remarks
196
+ * Decomposes the index into {@link Cursor.topLevelIndex} and {@link Cursor.nodePositionInfo}.
169
197
  * See `nodeInfo` for getting data about the current node.
170
198
  *
171
- * @param positionIndex - index of the position of the newly selected node in `positions`.
172
- * This is NOT an index within a field, and is not bounds checked.
173
199
  */
174
200
  private moveToPosition;
201
+ /**
202
+ * Decode a flat `positionIndex` into its components.
203
+ *
204
+ * @param positionIndex - flat position index of the node to decode. Must be greater than 0;
205
+ * @returns the node's index within {@link TreeShape.positions} (`withinTree`), which top-level
206
+ * tree holds it (`topLevelIndex`), and the corresponding shared {@link NodePositionInfo} (`info`).
207
+ */
208
+ private decodePosition;
209
+ /**
210
+ * Build a standalone {@link UpPath} for the node at `positionIndex`. O(depth) allocation.
211
+ *
212
+ * @remarks
213
+ * walks the shared per-tree {@link TreeShape.positions} and applies the top-level index
214
+ * at each level. Mirrors how the `BasicChunk` cursor allocates paths.
215
+ */
216
+ private materializePath;
175
217
  /**
176
218
  * Gets information about the current node.
177
219
  *
@@ -199,6 +241,16 @@ declare class Cursor extends SynchronousCursor implements ChunkedCursor {
199
241
  getPath(prefix?: PathRootPrefix): UpPath | undefined;
200
242
  get fieldIndex(): number;
201
243
  readonly chunkStart: number;
244
+ /**
245
+ * Number of nodes in `info`'s field including `info` itself.
246
+ *
247
+ * @remarks
248
+ * For top-level nodes this is the chunk's `topLevelLength`, read from the chunk
249
+ * rather than the node, so the shared per-tree {@link TreeShape.positions} stays independent of
250
+ * chunk length; the root entry's own `topLevelLength` field is unused. Nested nodes use the
251
+ * field length stored on the node.
252
+ */
253
+ private siblingCount;
202
254
  get chunkLength(): number;
203
255
  seekNodes(offset: number): boolean;
204
256
  nextNode(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"uniformChunk.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/uniformChunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAA4B,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE7F,OAAO,EACN,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,WAAW,EAEX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAwB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAA+B,MAAM,uBAAuB,CAAC;AAEvF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAE9E;AAED;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,oBAAqB,YAAW,SAAS;IASlE,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,SAAS,EAAE;IATpB,YAAY,EAAE,SAAS,GAAG,aAAa,CAAC;IAC/C;;;;;OAKG;gBAEK,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,SAAS,EAAE,EAC1B,YAAY,CAAC,EAAE,aAAa;IAU7B,IAAW,cAAc,IAAI,MAAM,CAElC;IAEM,KAAK,IAAI,YAAY;IAIrB,MAAM,IAAI,MAAM;IAIvB,SAAS,CAAC,cAAc,IAAI,IAAI;CAChC;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAmBhE;;;;;;;GAOG;AACH,qBAAa,SAAS;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