@fluidframework/tree 2.91.0 → 2.93.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 (1023) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/README.md +1 -1
  3. package/api-report/tree.alpha.api.md +117 -51
  4. package/api-report/tree.beta.api.md +41 -12
  5. package/api-report/tree.legacy.beta.api.md +41 -12
  6. package/dist/api.d.ts +11 -1
  7. package/dist/api.d.ts.map +1 -1
  8. package/dist/api.js.map +1 -1
  9. package/dist/codec/codec.d.ts +28 -2
  10. package/dist/codec/codec.d.ts.map +1 -1
  11. package/dist/codec/codec.js +1 -0
  12. package/dist/codec/codec.js.map +1 -1
  13. package/dist/codec/index.d.ts +2 -2
  14. package/dist/codec/index.d.ts.map +1 -1
  15. package/dist/codec/index.js +2 -4
  16. package/dist/codec/index.js.map +1 -1
  17. package/dist/codec/versioned/codec.d.ts +18 -36
  18. package/dist/codec/versioned/codec.d.ts.map +1 -1
  19. package/dist/codec/versioned/codec.js +46 -59
  20. package/dist/codec/versioned/codec.js.map +1 -1
  21. package/dist/codec/versioned/index.d.ts +1 -1
  22. package/dist/codec/versioned/index.d.ts.map +1 -1
  23. package/dist/codec/versioned/index.js +2 -4
  24. package/dist/codec/versioned/index.js.map +1 -1
  25. package/dist/core/forest/forest.d.ts +5 -2
  26. package/dist/core/forest/forest.d.ts.map +1 -1
  27. package/dist/core/forest/forest.js.map +1 -1
  28. package/dist/core/index.d.ts +1 -1
  29. package/dist/core/index.d.ts.map +1 -1
  30. package/dist/core/index.js +6 -2
  31. package/dist/core/index.js.map +1 -1
  32. package/dist/core/rebase/changeRebaser.d.ts +8 -1
  33. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  34. package/dist/core/rebase/changeRebaser.js.map +1 -1
  35. package/dist/core/rebase/revisionTagCodec.d.ts +4 -3
  36. package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
  37. package/dist/core/rebase/revisionTagCodec.js +2 -0
  38. package/dist/core/rebase/revisionTagCodec.js.map +1 -1
  39. package/dist/core/rebase/utils.d.ts +2 -2
  40. package/dist/core/rebase/utils.d.ts.map +1 -1
  41. package/dist/core/rebase/utils.js +4 -4
  42. package/dist/core/rebase/utils.js.map +1 -1
  43. package/dist/core/schema-stored/formatV2.d.ts +1 -1
  44. package/dist/core/schema-stored/formatV2.js +1 -1
  45. package/dist/core/schema-stored/formatV2.js.map +1 -1
  46. package/dist/core/tree/anchorSet.d.ts +8 -0
  47. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  48. package/dist/core/tree/anchorSet.js +63 -7
  49. package/dist/core/tree/anchorSet.js.map +1 -1
  50. package/dist/core/tree/cursor.d.ts +25 -1
  51. package/dist/core/tree/cursor.d.ts.map +1 -1
  52. package/dist/core/tree/cursor.js +45 -1
  53. package/dist/core/tree/cursor.js.map +1 -1
  54. package/dist/core/tree/deltaUtil.d.ts +13 -1
  55. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  56. package/dist/core/tree/deltaUtil.js +34 -1
  57. package/dist/core/tree/deltaUtil.js.map +1 -1
  58. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -5
  59. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  60. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  61. package/dist/core/tree/index.d.ts +2 -2
  62. package/dist/core/tree/index.d.ts.map +1 -1
  63. package/dist/core/tree/index.js +6 -2
  64. package/dist/core/tree/index.js.map +1 -1
  65. package/dist/core/tree/visitDelta.d.ts +11 -0
  66. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  67. package/dist/core/tree/visitDelta.js +1 -1
  68. package/dist/core/tree/visitDelta.js.map +1 -1
  69. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  70. package/dist/core/tree/visitorUtils.js +5 -0
  71. package/dist/core/tree/visitorUtils.js.map +1 -1
  72. package/dist/entrypoints/alpha.d.ts +1 -1
  73. package/dist/entrypoints/alpha.d.ts.map +1 -1
  74. package/dist/entrypoints/alpha.js +5 -6
  75. package/dist/entrypoints/alpha.js.map +1 -1
  76. package/dist/entrypoints/beta.d.ts +1 -1
  77. package/dist/entrypoints/beta.d.ts.map +1 -1
  78. package/dist/entrypoints/beta.js +4 -2
  79. package/dist/entrypoints/beta.js.map +1 -1
  80. package/dist/entrypoints/legacy.d.ts +1 -1
  81. package/dist/entrypoints/legacy.d.ts.map +1 -1
  82. package/dist/entrypoints/legacy.js +4 -2
  83. package/dist/entrypoints/legacy.js.map +1 -1
  84. package/dist/entrypoints/public.js +1 -1
  85. package/dist/entrypoints/public.js.map +1 -1
  86. package/dist/feature-libraries/changeAtomIdCodec.d.ts +4 -3
  87. package/dist/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  88. package/dist/feature-libraries/changeAtomIdCodec.js +2 -0
  89. package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
  90. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +2 -2
  91. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  92. package/dist/feature-libraries/chunked-forest/chunkTree.js +2 -1
  93. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  94. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -1
  95. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  96. package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  97. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  98. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +4 -4
  99. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  100. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -6
  101. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  102. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  103. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  104. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  105. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -2
  106. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  107. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  108. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -4
  109. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  110. package/dist/feature-libraries/chunked-forest/codec/codecs.js +6 -6
  111. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  112. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +12 -12
  113. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  114. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
  115. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  116. package/dist/feature-libraries/chunked-forest/codec/{formatGeneric.d.ts → format/formatGeneric.d.ts} +1 -1
  117. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -0
  118. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -0
  119. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +187 -0
  120. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -0
  121. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +115 -0
  122. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -0
  123. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +33 -0
  124. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -0
  125. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +16 -0
  126. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -0
  127. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts +10 -0
  128. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -0
  129. package/dist/feature-libraries/chunked-forest/codec/format/index.js +18 -0
  130. package/dist/feature-libraries/chunked-forest/codec/format/index.js.map +1 -0
  131. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts +93 -0
  132. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -0
  133. package/dist/feature-libraries/chunked-forest/codec/format/versions.js +29 -0
  134. package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -0
  135. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  136. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  137. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -2
  138. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  139. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
  140. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  141. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  142. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  143. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  144. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +6 -4
  145. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  146. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +1 -1
  147. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  148. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +3 -3
  149. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  150. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  151. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  152. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  153. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +13 -5
  154. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  155. package/dist/feature-libraries/chunked-forest/uniformChunk.js +22 -18
  156. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  157. package/dist/feature-libraries/cursorComparator.d.ts +23 -0
  158. package/dist/feature-libraries/cursorComparator.d.ts.map +1 -0
  159. package/dist/feature-libraries/cursorComparator.js +65 -0
  160. package/dist/feature-libraries/cursorComparator.js.map +1 -0
  161. package/dist/feature-libraries/forest-summary/codec.d.ts +1 -1
  162. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +3 -3
  163. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  164. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  165. package/dist/feature-libraries/index.d.ts +3 -2
  166. package/dist/feature-libraries/index.d.ts.map +1 -1
  167. package/dist/feature-libraries/index.js +5 -5
  168. package/dist/feature-libraries/index.js.map +1 -1
  169. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -0
  170. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  171. package/dist/feature-libraries/indexing/anchorTreeIndex.js +15 -8
  172. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  173. package/dist/feature-libraries/indexing/types.d.ts +4 -3
  174. package/dist/feature-libraries/indexing/types.d.ts.map +1 -1
  175. package/dist/feature-libraries/indexing/types.js.map +1 -1
  176. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  177. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  178. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  179. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
  180. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  181. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  182. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  183. package/dist/feature-libraries/modular-schema/genericFieldKind.js +0 -1
  184. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  185. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +10 -10
  186. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  187. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -4
  188. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  189. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +3 -3
  190. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  191. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  192. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +3 -3
  193. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  194. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  195. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -1
  196. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  197. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +4 -3
  198. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  199. package/dist/feature-libraries/object-forest/objectForest.d.ts +1 -1
  200. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  201. package/dist/feature-libraries/object-forest/objectForest.js +2 -2
  202. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  203. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +4 -4
  204. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  205. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  206. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +3 -3
  207. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  208. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  209. package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
  210. package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
  211. package/dist/feature-libraries/schema-edits/index.js +2 -3
  212. package/dist/feature-libraries/schema-edits/index.js.map +1 -1
  213. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -15
  214. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  215. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -54
  216. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  217. package/dist/feature-libraries/schema-index/codec.d.ts +3 -16
  218. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  219. package/dist/feature-libraries/schema-index/codec.js +1 -21
  220. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  221. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
  222. package/dist/feature-libraries/schema-index/formatV2.js +1 -1
  223. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  224. package/dist/feature-libraries/schema-index/index.d.ts +1 -1
  225. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  226. package/dist/feature-libraries/schema-index/index.js +1 -2
  227. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  228. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -4
  229. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  230. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  231. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +3 -3
  232. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  233. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  234. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -3
  235. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  236. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  237. package/dist/index.d.ts +2 -2
  238. package/dist/index.d.ts.map +1 -1
  239. package/dist/index.js +2 -3
  240. package/dist/index.js.map +1 -1
  241. package/dist/packageVersion.d.ts +1 -1
  242. package/dist/packageVersion.js +1 -1
  243. package/dist/packageVersion.js.map +1 -1
  244. package/dist/serializableDomainSchema.d.ts +5 -5
  245. package/dist/serializableDomainSchema.d.ts.map +1 -1
  246. package/dist/serializableDomainSchema.js.map +1 -1
  247. package/dist/shared-tree/independentView.d.ts +1 -1
  248. package/dist/shared-tree/independentView.d.ts.map +1 -1
  249. package/dist/shared-tree/independentView.js +14 -21
  250. package/dist/shared-tree/independentView.js.map +1 -1
  251. package/dist/shared-tree/index.d.ts +2 -2
  252. package/dist/shared-tree/index.d.ts.map +1 -1
  253. package/dist/shared-tree/index.js +1 -2
  254. package/dist/shared-tree/index.js.map +1 -1
  255. package/dist/shared-tree/schematizingTreeView.d.ts +2 -36
  256. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  257. package/dist/shared-tree/schematizingTreeView.js +15 -117
  258. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  259. package/dist/shared-tree/sharedTree.d.ts +3 -22
  260. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  261. package/dist/shared-tree/sharedTree.js +10 -27
  262. package/dist/shared-tree/sharedTree.js.map +1 -1
  263. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +3 -2
  264. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  265. package/dist/shared-tree/sharedTreeChangeCodecs.js +23 -16
  266. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  267. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  268. package/dist/shared-tree/sharedTreeChangeEnricher.js +1 -1
  269. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  270. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  271. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  272. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  273. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  274. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  275. package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  276. package/dist/shared-tree/sharedTreeChangeFormat.js +13 -5
  277. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  278. package/dist/shared-tree/tree.d.ts.map +1 -1
  279. package/dist/shared-tree/tree.js +2 -1
  280. package/dist/shared-tree/tree.js.map +1 -1
  281. package/dist/shared-tree/treeAlpha.d.ts +17 -1
  282. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  283. package/dist/shared-tree/treeAlpha.js +3 -0
  284. package/dist/shared-tree/treeAlpha.js.map +1 -1
  285. package/dist/shared-tree/treeCheckout.d.ts +34 -69
  286. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  287. package/dist/shared-tree/treeCheckout.js +885 -678
  288. package/dist/shared-tree/treeCheckout.js.map +1 -1
  289. package/dist/shared-tree/unhydratedTreeContext.js +3 -3
  290. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  291. package/dist/shared-tree-core/editManagerCodecs.d.ts +23 -12
  292. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  293. package/dist/shared-tree-core/editManagerCodecs.js +40 -67
  294. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  295. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  296. package/dist/shared-tree-core/editManagerCodecsCommons.js +0 -1
  297. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  298. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +10 -2
  299. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  300. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +18 -13
  301. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  302. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  303. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  304. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +6 -9
  305. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  306. package/dist/shared-tree-core/index.d.ts +3 -3
  307. package/dist/shared-tree-core/index.d.ts.map +1 -1
  308. package/dist/shared-tree-core/index.js +5 -8
  309. package/dist/shared-tree-core/index.js.map +1 -1
  310. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -3
  311. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  312. package/dist/shared-tree-core/messageCodecV1ToV4.js +8 -8
  313. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  314. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts +2 -3
  315. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  316. package/dist/shared-tree-core/messageCodecVSharedBranches.js +5 -4
  317. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  318. package/dist/shared-tree-core/messageCodecs.d.ts +15 -14
  319. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  320. package/dist/shared-tree-core/messageCodecs.js +38 -74
  321. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  322. package/dist/shared-tree-core/messageFormat.d.ts +0 -1
  323. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  324. package/dist/shared-tree-core/messageFormat.js +1 -2
  325. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  326. package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -3
  327. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  328. package/dist/shared-tree-core/sharedTreeCore.js +12 -2
  329. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  330. package/dist/sharedTreeAttributes.d.ts.map +1 -1
  331. package/dist/sharedTreeAttributes.js +3 -0
  332. package/dist/sharedTreeAttributes.js.map +1 -1
  333. package/dist/simple-tree/api/discrepancies.js +4 -1
  334. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  335. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  336. package/dist/simple-tree/api/identifierIndex.js +1 -1
  337. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  338. package/dist/simple-tree/api/index.d.ts +2 -1
  339. package/dist/simple-tree/api/index.d.ts.map +1 -1
  340. package/dist/simple-tree/api/index.js +3 -2
  341. package/dist/simple-tree/api/index.js.map +1 -1
  342. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  343. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  344. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +33 -4
  345. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  346. package/dist/simple-tree/api/schemaFactoryAlpha.js +17 -1
  347. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  348. package/dist/simple-tree/api/simpleTreeIndex.d.ts +5 -5
  349. package/dist/simple-tree/api/simpleTreeIndex.js +1 -1
  350. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  351. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  352. package/dist/simple-tree/api/storedSchema.js +10 -7
  353. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  354. package/dist/simple-tree/api/tree.d.ts +7 -19
  355. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  356. package/dist/simple-tree/api/tree.js.map +1 -1
  357. package/dist/simple-tree/api/treeAlpha.d.ts +126 -0
  358. package/dist/simple-tree/api/treeAlpha.d.ts.map +1 -0
  359. package/dist/simple-tree/api/treeAlpha.js +7 -0
  360. package/dist/simple-tree/api/treeAlpha.js.map +1 -0
  361. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  362. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  363. package/dist/simple-tree/api/treeChangeEvents.d.ts +4 -1
  364. package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  365. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
  366. package/dist/simple-tree/api/treeNodeApi.d.ts +108 -0
  367. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  368. package/dist/simple-tree/api/treeNodeApi.js +104 -3
  369. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  370. package/dist/simple-tree/core/toStored.d.ts +7 -0
  371. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  372. package/dist/simple-tree/core/toStored.js.map +1 -1
  373. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  374. package/dist/simple-tree/core/treeNodeKernel.js +45 -8
  375. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  376. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +17 -3
  377. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  378. package/dist/simple-tree/core/unhydratedFlexTree.js +117 -11
  379. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  380. package/dist/simple-tree/fieldSchema.d.ts +6 -1
  381. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  382. package/dist/simple-tree/fieldSchema.js +3 -0
  383. package/dist/simple-tree/fieldSchema.js.map +1 -1
  384. package/dist/simple-tree/index.d.ts +2 -2
  385. package/dist/simple-tree/index.d.ts.map +1 -1
  386. package/dist/simple-tree/index.js +4 -3
  387. package/dist/simple-tree/index.js.map +1 -1
  388. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +16 -0
  389. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  390. package/dist/simple-tree/node-kinds/array/arrayNode.js +23 -0
  391. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  392. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +10 -1
  393. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  394. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  395. package/dist/simple-tree/node-kinds/array/index.d.ts +2 -2
  396. package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  397. package/dist/simple-tree/node-kinds/array/index.js.map +1 -1
  398. package/dist/simple-tree/node-kinds/index.d.ts +2 -2
  399. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  400. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  401. package/dist/simple-tree/node-kinds/map/index.d.ts +1 -1
  402. package/dist/simple-tree/node-kinds/map/index.d.ts.map +1 -1
  403. package/dist/simple-tree/node-kinds/map/index.js.map +1 -1
  404. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  405. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  406. package/dist/simple-tree/node-kinds/map/mapNode.js +6 -1
  407. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  408. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +6 -6
  409. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  410. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  411. package/dist/simple-tree/simpleSchema.d.ts +17 -0
  412. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  413. package/dist/simple-tree/simpleSchema.js.map +1 -1
  414. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  415. package/dist/simple-tree/toStoredSchema.js +23 -1
  416. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  417. package/dist/tableSchema.d.ts +4 -5
  418. package/dist/tableSchema.d.ts.map +1 -1
  419. package/dist/tableSchema.js +12 -23
  420. package/dist/tableSchema.js.map +1 -1
  421. package/dist/text/textDomain.d.ts.map +1 -1
  422. package/dist/text/textDomain.js +27 -0
  423. package/dist/text/textDomain.js.map +1 -1
  424. package/dist/text/textDomainFormatted.d.ts +321 -11
  425. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  426. package/dist/text/textDomainFormatted.js +100 -25
  427. package/dist/text/textDomainFormatted.js.map +1 -1
  428. package/dist/treeFactory.d.ts.map +1 -1
  429. package/dist/treeFactory.js +5 -2
  430. package/dist/treeFactory.js.map +1 -1
  431. package/dist/util/index.d.ts +1 -1
  432. package/dist/util/index.d.ts.map +1 -1
  433. package/dist/util/index.js +2 -3
  434. package/dist/util/index.js.map +1 -1
  435. package/dist/util/referenceCounting.d.ts.map +1 -1
  436. package/dist/util/referenceCounting.js +0 -1
  437. package/dist/util/referenceCounting.js.map +1 -1
  438. package/dist/util/utils.d.ts +0 -1
  439. package/dist/util/utils.d.ts.map +1 -1
  440. package/dist/util/utils.js +1 -6
  441. package/dist/util/utils.js.map +1 -1
  442. package/eslint.config.mts +1 -1
  443. package/legacy.d.ts +2 -3
  444. package/lib/api.d.ts +11 -1
  445. package/lib/api.d.ts.map +1 -1
  446. package/lib/api.js.map +1 -1
  447. package/lib/codec/codec.d.ts +28 -2
  448. package/lib/codec/codec.d.ts.map +1 -1
  449. package/lib/codec/codec.js +1 -0
  450. package/lib/codec/codec.js.map +1 -1
  451. package/lib/codec/index.d.ts +2 -2
  452. package/lib/codec/index.d.ts.map +1 -1
  453. package/lib/codec/index.js +1 -1
  454. package/lib/codec/index.js.map +1 -1
  455. package/lib/codec/versioned/codec.d.ts +18 -36
  456. package/lib/codec/versioned/codec.d.ts.map +1 -1
  457. package/lib/codec/versioned/codec.js +45 -56
  458. package/lib/codec/versioned/codec.js.map +1 -1
  459. package/lib/codec/versioned/index.d.ts +1 -1
  460. package/lib/codec/versioned/index.d.ts.map +1 -1
  461. package/lib/codec/versioned/index.js +1 -1
  462. package/lib/codec/versioned/index.js.map +1 -1
  463. package/lib/core/forest/forest.d.ts +5 -2
  464. package/lib/core/forest/forest.d.ts.map +1 -1
  465. package/lib/core/forest/forest.js.map +1 -1
  466. package/lib/core/index.d.ts +1 -1
  467. package/lib/core/index.d.ts.map +1 -1
  468. package/lib/core/index.js +1 -1
  469. package/lib/core/index.js.map +1 -1
  470. package/lib/core/rebase/changeRebaser.d.ts +8 -1
  471. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  472. package/lib/core/rebase/changeRebaser.js.map +1 -1
  473. package/lib/core/rebase/revisionTagCodec.d.ts +4 -3
  474. package/lib/core/rebase/revisionTagCodec.d.ts.map +1 -1
  475. package/lib/core/rebase/revisionTagCodec.js +2 -0
  476. package/lib/core/rebase/revisionTagCodec.js.map +1 -1
  477. package/lib/core/rebase/utils.d.ts +2 -2
  478. package/lib/core/rebase/utils.d.ts.map +1 -1
  479. package/lib/core/rebase/utils.js +4 -4
  480. package/lib/core/rebase/utils.js.map +1 -1
  481. package/lib/core/schema-stored/formatV2.d.ts +1 -1
  482. package/lib/core/schema-stored/formatV2.js +1 -1
  483. package/lib/core/schema-stored/formatV2.js.map +1 -1
  484. package/lib/core/tree/anchorSet.d.ts +8 -0
  485. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  486. package/lib/core/tree/anchorSet.js +63 -7
  487. package/lib/core/tree/anchorSet.js.map +1 -1
  488. package/lib/core/tree/cursor.d.ts +25 -1
  489. package/lib/core/tree/cursor.d.ts.map +1 -1
  490. package/lib/core/tree/cursor.js +43 -0
  491. package/lib/core/tree/cursor.js.map +1 -1
  492. package/lib/core/tree/deltaUtil.d.ts +13 -1
  493. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  494. package/lib/core/tree/deltaUtil.js +31 -0
  495. package/lib/core/tree/deltaUtil.js.map +1 -1
  496. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -5
  497. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  498. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  499. package/lib/core/tree/index.d.ts +2 -2
  500. package/lib/core/tree/index.d.ts.map +1 -1
  501. package/lib/core/tree/index.js +2 -2
  502. package/lib/core/tree/index.js.map +1 -1
  503. package/lib/core/tree/visitDelta.d.ts +11 -0
  504. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  505. package/lib/core/tree/visitDelta.js +1 -1
  506. package/lib/core/tree/visitDelta.js.map +1 -1
  507. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  508. package/lib/core/tree/visitorUtils.js +5 -0
  509. package/lib/core/tree/visitorUtils.js.map +1 -1
  510. package/lib/entrypoints/alpha.d.ts +1 -1
  511. package/lib/entrypoints/alpha.d.ts.map +1 -1
  512. package/lib/entrypoints/alpha.js +2 -2
  513. package/lib/entrypoints/alpha.js.map +1 -1
  514. package/lib/entrypoints/beta.d.ts +1 -1
  515. package/lib/entrypoints/beta.d.ts.map +1 -1
  516. package/lib/entrypoints/beta.js +2 -2
  517. package/lib/entrypoints/beta.js.map +1 -1
  518. package/lib/entrypoints/legacy.d.ts +1 -1
  519. package/lib/entrypoints/legacy.d.ts.map +1 -1
  520. package/lib/entrypoints/legacy.js +2 -2
  521. package/lib/entrypoints/legacy.js.map +1 -1
  522. package/lib/entrypoints/public.js +1 -1
  523. package/lib/entrypoints/public.js.map +1 -1
  524. package/lib/feature-libraries/changeAtomIdCodec.d.ts +4 -3
  525. package/lib/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  526. package/lib/feature-libraries/changeAtomIdCodec.js +2 -0
  527. package/lib/feature-libraries/changeAtomIdCodec.js.map +1 -1
  528. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +2 -2
  529. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  530. package/lib/feature-libraries/chunked-forest/chunkTree.js +2 -1
  531. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  532. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -1
  533. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  534. package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  535. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  536. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +4 -4
  537. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  538. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +4 -4
  539. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  540. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  541. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  542. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  543. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -2
  544. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  545. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  546. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -4
  547. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  548. package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  549. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  550. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +12 -12
  551. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  552. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
  553. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  554. package/lib/feature-libraries/chunked-forest/codec/{formatGeneric.d.ts → format/formatGeneric.d.ts} +1 -1
  555. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -0
  556. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -0
  557. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +187 -0
  558. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -0
  559. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js +112 -0
  560. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -0
  561. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +33 -0
  562. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -0
  563. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js +13 -0
  564. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -0
  565. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts +10 -0
  566. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -0
  567. package/lib/feature-libraries/chunked-forest/codec/format/index.js +8 -0
  568. package/lib/feature-libraries/chunked-forest/codec/format/index.js.map +1 -0
  569. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts +93 -0
  570. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -0
  571. package/lib/feature-libraries/chunked-forest/codec/format/versions.js +26 -0
  572. package/lib/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -0
  573. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  574. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  575. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  576. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  577. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
  578. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  579. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  580. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  581. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  582. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +4 -2
  583. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  584. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +1 -1
  585. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  586. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
  587. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  588. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  589. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  590. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  591. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +13 -5
  592. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  593. package/lib/feature-libraries/chunked-forest/uniformChunk.js +22 -18
  594. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  595. package/lib/feature-libraries/cursorComparator.d.ts +23 -0
  596. package/lib/feature-libraries/cursorComparator.d.ts.map +1 -0
  597. package/lib/feature-libraries/cursorComparator.js +61 -0
  598. package/lib/feature-libraries/cursorComparator.js.map +1 -0
  599. package/lib/feature-libraries/forest-summary/codec.d.ts +1 -1
  600. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +3 -3
  601. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  602. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  603. package/lib/feature-libraries/index.d.ts +3 -2
  604. package/lib/feature-libraries/index.d.ts.map +1 -1
  605. package/lib/feature-libraries/index.js +3 -2
  606. package/lib/feature-libraries/index.js.map +1 -1
  607. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -0
  608. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  609. package/lib/feature-libraries/indexing/anchorTreeIndex.js +15 -8
  610. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  611. package/lib/feature-libraries/indexing/types.d.ts +4 -3
  612. package/lib/feature-libraries/indexing/types.d.ts.map +1 -1
  613. package/lib/feature-libraries/indexing/types.js.map +1 -1
  614. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  615. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  616. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  617. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
  618. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  619. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  620. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  621. package/lib/feature-libraries/modular-schema/genericFieldKind.js +0 -1
  622. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  623. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +10 -10
  624. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  625. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -4
  626. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  627. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +3 -3
  628. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  629. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  630. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +3 -3
  631. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  632. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  633. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -1
  634. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  635. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +4 -3
  636. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  637. package/lib/feature-libraries/object-forest/objectForest.d.ts +1 -1
  638. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  639. package/lib/feature-libraries/object-forest/objectForest.js +2 -2
  640. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  641. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +4 -4
  642. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  643. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +1 -1
  644. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  645. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +3 -3
  646. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  647. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  648. package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
  649. package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
  650. package/lib/feature-libraries/schema-edits/index.js +1 -1
  651. package/lib/feature-libraries/schema-edits/index.js.map +1 -1
  652. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -15
  653. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  654. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -50
  655. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  656. package/lib/feature-libraries/schema-index/codec.d.ts +3 -16
  657. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  658. package/lib/feature-libraries/schema-index/codec.js +0 -19
  659. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  660. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
  661. package/lib/feature-libraries/schema-index/formatV2.js +1 -1
  662. package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
  663. package/lib/feature-libraries/schema-index/index.d.ts +1 -1
  664. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  665. package/lib/feature-libraries/schema-index/index.js +1 -1
  666. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  667. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -4
  668. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  669. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  670. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +3 -3
  671. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  672. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +1 -1
  673. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  674. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -3
  675. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  676. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  677. package/lib/index.d.ts +2 -2
  678. package/lib/index.d.ts.map +1 -1
  679. package/lib/index.js +1 -1
  680. package/lib/index.js.map +1 -1
  681. package/lib/packageVersion.d.ts +1 -1
  682. package/lib/packageVersion.js +1 -1
  683. package/lib/packageVersion.js.map +1 -1
  684. package/lib/serializableDomainSchema.d.ts +5 -5
  685. package/lib/serializableDomainSchema.d.ts.map +1 -1
  686. package/lib/serializableDomainSchema.js +4 -1
  687. package/lib/serializableDomainSchema.js.map +1 -1
  688. package/lib/shared-tree/independentView.d.ts +1 -1
  689. package/lib/shared-tree/independentView.d.ts.map +1 -1
  690. package/lib/shared-tree/independentView.js +4 -11
  691. package/lib/shared-tree/independentView.js.map +1 -1
  692. package/lib/shared-tree/index.d.ts +2 -2
  693. package/lib/shared-tree/index.d.ts.map +1 -1
  694. package/lib/shared-tree/index.js +1 -1
  695. package/lib/shared-tree/index.js.map +1 -1
  696. package/lib/shared-tree/schematizingTreeView.d.ts +2 -36
  697. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  698. package/lib/shared-tree/schematizingTreeView.js +17 -116
  699. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  700. package/lib/shared-tree/sharedTree.d.ts +3 -22
  701. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  702. package/lib/shared-tree/sharedTree.js +11 -27
  703. package/lib/shared-tree/sharedTree.js.map +1 -1
  704. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +3 -2
  705. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  706. package/lib/shared-tree/sharedTreeChangeCodecs.js +19 -12
  707. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  708. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  709. package/lib/shared-tree/sharedTreeChangeEnricher.js +2 -2
  710. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  711. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  712. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  713. package/lib/shared-tree/sharedTreeChangeFamily.js +2 -2
  714. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  715. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  716. package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  717. package/lib/shared-tree/sharedTreeChangeFormat.js +11 -5
  718. package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  719. package/lib/shared-tree/tree.d.ts.map +1 -1
  720. package/lib/shared-tree/tree.js +2 -1
  721. package/lib/shared-tree/tree.js.map +1 -1
  722. package/lib/shared-tree/treeAlpha.d.ts +17 -1
  723. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  724. package/lib/shared-tree/treeAlpha.js +3 -0
  725. package/lib/shared-tree/treeAlpha.js.map +1 -1
  726. package/lib/shared-tree/treeCheckout.d.ts +34 -69
  727. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  728. package/lib/shared-tree/treeCheckout.js +889 -683
  729. package/lib/shared-tree/treeCheckout.js.map +1 -1
  730. package/lib/shared-tree/unhydratedTreeContext.js +1 -1
  731. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  732. package/lib/shared-tree-core/editManagerCodecs.d.ts +23 -12
  733. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  734. package/lib/shared-tree-core/editManagerCodecs.js +41 -65
  735. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  736. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  737. package/lib/shared-tree-core/editManagerCodecsCommons.js +0 -1
  738. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  739. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +10 -2
  740. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  741. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +16 -11
  742. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  743. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  744. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  745. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +5 -8
  746. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  747. package/lib/shared-tree-core/index.d.ts +3 -3
  748. package/lib/shared-tree-core/index.d.ts.map +1 -1
  749. package/lib/shared-tree-core/index.js +3 -3
  750. package/lib/shared-tree-core/index.js.map +1 -1
  751. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -3
  752. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  753. package/lib/shared-tree-core/messageCodecV1ToV4.js +8 -8
  754. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  755. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts +2 -3
  756. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  757. package/lib/shared-tree-core/messageCodecVSharedBranches.js +5 -4
  758. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  759. package/lib/shared-tree-core/messageCodecs.d.ts +15 -14
  760. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  761. package/lib/shared-tree-core/messageCodecs.js +38 -71
  762. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  763. package/lib/shared-tree-core/messageFormat.d.ts +0 -1
  764. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  765. package/lib/shared-tree-core/messageFormat.js +0 -1
  766. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  767. package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -3
  768. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  769. package/lib/shared-tree-core/sharedTreeCore.js +14 -4
  770. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  771. package/lib/sharedTreeAttributes.d.ts.map +1 -1
  772. package/lib/sharedTreeAttributes.js +3 -0
  773. package/lib/sharedTreeAttributes.js.map +1 -1
  774. package/lib/simple-tree/api/discrepancies.js +4 -1
  775. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  776. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  777. package/lib/simple-tree/api/identifierIndex.js +1 -1
  778. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  779. package/lib/simple-tree/api/index.d.ts +2 -1
  780. package/lib/simple-tree/api/index.d.ts.map +1 -1
  781. package/lib/simple-tree/api/index.js +1 -1
  782. package/lib/simple-tree/api/index.js.map +1 -1
  783. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  784. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  785. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +33 -4
  786. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  787. package/lib/simple-tree/api/schemaFactoryAlpha.js +19 -3
  788. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  789. package/lib/simple-tree/api/simpleTreeIndex.d.ts +5 -5
  790. package/lib/simple-tree/api/simpleTreeIndex.js +1 -1
  791. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  792. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  793. package/lib/simple-tree/api/storedSchema.js +11 -8
  794. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  795. package/lib/simple-tree/api/tree.d.ts +7 -19
  796. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  797. package/lib/simple-tree/api/tree.js.map +1 -1
  798. package/lib/simple-tree/api/treeAlpha.d.ts +126 -0
  799. package/lib/simple-tree/api/treeAlpha.d.ts.map +1 -0
  800. package/lib/simple-tree/api/treeAlpha.js +6 -0
  801. package/lib/simple-tree/api/treeAlpha.js.map +1 -0
  802. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  803. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  804. package/lib/simple-tree/api/treeChangeEvents.d.ts +4 -1
  805. package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  806. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
  807. package/lib/simple-tree/api/treeNodeApi.d.ts +108 -0
  808. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  809. package/lib/simple-tree/api/treeNodeApi.js +101 -2
  810. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  811. package/lib/simple-tree/core/toStored.d.ts +7 -0
  812. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  813. package/lib/simple-tree/core/toStored.js.map +1 -1
  814. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  815. package/lib/simple-tree/core/treeNodeKernel.js +45 -8
  816. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  817. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +17 -3
  818. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  819. package/lib/simple-tree/core/unhydratedFlexTree.js +118 -12
  820. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  821. package/lib/simple-tree/fieldSchema.d.ts +6 -1
  822. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  823. package/lib/simple-tree/fieldSchema.js +3 -0
  824. package/lib/simple-tree/fieldSchema.js.map +1 -1
  825. package/lib/simple-tree/index.d.ts +2 -2
  826. package/lib/simple-tree/index.d.ts.map +1 -1
  827. package/lib/simple-tree/index.js +1 -1
  828. package/lib/simple-tree/index.js.map +1 -1
  829. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +16 -0
  830. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  831. package/lib/simple-tree/node-kinds/array/arrayNode.js +23 -0
  832. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  833. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +10 -1
  834. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  835. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  836. package/lib/simple-tree/node-kinds/array/index.d.ts +2 -2
  837. package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  838. package/lib/simple-tree/node-kinds/array/index.js.map +1 -1
  839. package/lib/simple-tree/node-kinds/index.d.ts +2 -2
  840. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  841. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  842. package/lib/simple-tree/node-kinds/map/index.d.ts +1 -1
  843. package/lib/simple-tree/node-kinds/map/index.d.ts.map +1 -1
  844. package/lib/simple-tree/node-kinds/map/index.js.map +1 -1
  845. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  846. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  847. package/lib/simple-tree/node-kinds/map/mapNode.js +6 -1
  848. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  849. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +6 -6
  850. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  851. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  852. package/lib/simple-tree/simpleSchema.d.ts +17 -0
  853. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  854. package/lib/simple-tree/simpleSchema.js.map +1 -1
  855. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  856. package/lib/simple-tree/toStoredSchema.js +24 -2
  857. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  858. package/lib/tableSchema.d.ts +4 -5
  859. package/lib/tableSchema.d.ts.map +1 -1
  860. package/lib/tableSchema.js +12 -23
  861. package/lib/tableSchema.js.map +1 -1
  862. package/lib/text/textDomain.d.ts.map +1 -1
  863. package/lib/text/textDomain.js +29 -0
  864. package/lib/text/textDomain.js.map +1 -1
  865. package/lib/text/textDomainFormatted.d.ts +321 -11
  866. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  867. package/lib/text/textDomainFormatted.js +103 -28
  868. package/lib/text/textDomainFormatted.js.map +1 -1
  869. package/lib/treeFactory.d.ts.map +1 -1
  870. package/lib/treeFactory.js +6 -3
  871. package/lib/treeFactory.js.map +1 -1
  872. package/lib/tsdoc-metadata.json +1 -1
  873. package/lib/util/index.d.ts +1 -1
  874. package/lib/util/index.d.ts.map +1 -1
  875. package/lib/util/index.js +1 -1
  876. package/lib/util/index.js.map +1 -1
  877. package/lib/util/referenceCounting.d.ts.map +1 -1
  878. package/lib/util/referenceCounting.js +0 -1
  879. package/lib/util/referenceCounting.js.map +1 -1
  880. package/lib/util/utils.d.ts +0 -1
  881. package/lib/util/utils.d.ts.map +1 -1
  882. package/lib/util/utils.js +0 -1
  883. package/lib/util/utils.js.map +1 -1
  884. package/package.json +35 -40
  885. package/scripts/generate-entrypoint-sources.sh +4 -2
  886. package/src/api.ts +21 -0
  887. package/src/codec/codec.ts +32 -2
  888. package/src/codec/index.ts +2 -3
  889. package/src/codec/versioned/codec.ts +99 -109
  890. package/src/codec/versioned/index.ts +1 -3
  891. package/src/core/forest/forest.ts +5 -2
  892. package/src/core/index.ts +4 -0
  893. package/src/core/rebase/changeRebaser.ts +8 -0
  894. package/src/core/rebase/revisionTagCodec.ts +4 -4
  895. package/src/core/rebase/utils.ts +9 -2
  896. package/src/core/schema-stored/formatV2.ts +1 -1
  897. package/src/core/tree/anchorSet.ts +92 -10
  898. package/src/core/tree/cursor.ts +52 -1
  899. package/src/core/tree/deltaUtil.ts +37 -1
  900. package/src/core/tree/detachedFieldIndexCodecs.ts +4 -4
  901. package/src/core/tree/index.ts +4 -0
  902. package/src/core/tree/visitDelta.ts +13 -1
  903. package/src/core/tree/visitorUtils.ts +5 -0
  904. package/src/entrypoints/alpha.ts +21 -10
  905. package/src/entrypoints/beta.ts +7 -1
  906. package/src/entrypoints/legacy.ts +7 -1
  907. package/src/entrypoints/public.ts +1 -1
  908. package/src/feature-libraries/changeAtomIdCodec.ts +8 -7
  909. package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -2
  910. package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -2
  911. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +18 -13
  912. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
  913. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -2
  914. package/src/feature-libraries/chunked-forest/codec/codecs.ts +16 -10
  915. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +16 -14
  916. package/src/feature-libraries/chunked-forest/codec/{formatGeneric.ts → format/formatGeneric.ts} +1 -1
  917. package/src/feature-libraries/chunked-forest/codec/{format.ts → format/formatV1.ts} +41 -111
  918. package/src/feature-libraries/chunked-forest/codec/format/formatV2.ts +31 -0
  919. package/src/feature-libraries/chunked-forest/codec/format/index.ts +31 -0
  920. package/src/feature-libraries/chunked-forest/codec/format/versions.ts +81 -0
  921. package/src/feature-libraries/chunked-forest/codec/index.ts +6 -2
  922. package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +19 -12
  923. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +6 -4
  924. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +10 -10
  925. package/src/feature-libraries/chunked-forest/index.ts +2 -1
  926. package/src/feature-libraries/chunked-forest/uniformChunk.ts +42 -20
  927. package/src/feature-libraries/cursorComparator.ts +77 -0
  928. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +5 -5
  929. package/src/feature-libraries/index.ts +5 -3
  930. package/src/feature-libraries/indexing/anchorTreeIndex.ts +21 -10
  931. package/src/feature-libraries/indexing/types.ts +5 -3
  932. package/src/feature-libraries/mitigatedChangeFamily.ts +4 -1
  933. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +4 -5
  934. package/src/feature-libraries/modular-schema/genericFieldKind.ts +0 -1
  935. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +19 -26
  936. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +4 -4
  937. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -5
  938. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +6 -2
  939. package/src/feature-libraries/object-forest/objectForest.ts +8 -2
  940. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +11 -13
  941. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +4 -5
  942. package/src/feature-libraries/schema-edits/index.ts +1 -4
  943. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +10 -78
  944. package/src/feature-libraries/schema-index/codec.ts +0 -25
  945. package/src/feature-libraries/schema-index/formatV2.ts +1 -1
  946. package/src/feature-libraries/schema-index/index.ts +1 -4
  947. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +6 -6
  948. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +8 -5
  949. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +4 -5
  950. package/src/index.ts +14 -3
  951. package/src/packageVersion.ts +1 -1
  952. package/src/serializableDomainSchema.ts +6 -0
  953. package/src/shared-tree/independentView.ts +5 -18
  954. package/src/shared-tree/index.ts +0 -4
  955. package/src/shared-tree/schematizingTreeView.ts +19 -165
  956. package/src/shared-tree/sharedTree.ts +16 -59
  957. package/src/shared-tree/sharedTreeChangeCodecs.ts +23 -29
  958. package/src/shared-tree/sharedTreeChangeEnricher.ts +1 -2
  959. package/src/shared-tree/sharedTreeChangeFamily.ts +2 -0
  960. package/src/shared-tree/sharedTreeChangeFormat.ts +23 -8
  961. package/src/shared-tree/tree.ts +2 -5
  962. package/src/shared-tree/treeAlpha.ts +30 -0
  963. package/src/shared-tree/treeCheckout.ts +275 -99
  964. package/src/shared-tree/unhydratedTreeContext.ts +1 -1
  965. package/src/shared-tree-core/editManagerCodecs.ts +99 -124
  966. package/src/shared-tree-core/editManagerCodecsCommons.ts +0 -1
  967. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +54 -59
  968. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +72 -95
  969. package/src/shared-tree-core/index.ts +4 -8
  970. package/src/shared-tree-core/messageCodecV1ToV4.ts +56 -71
  971. package/src/shared-tree-core/messageCodecVSharedBranches.ts +76 -92
  972. package/src/shared-tree-core/messageCodecs.ts +88 -126
  973. package/src/shared-tree-core/messageFormat.ts +0 -3
  974. package/src/shared-tree-core/sharedTreeCore.ts +14 -21
  975. package/src/sharedTreeAttributes.ts +3 -0
  976. package/src/simple-tree/api/discrepancies.ts +6 -1
  977. package/src/simple-tree/api/identifierIndex.ts +2 -2
  978. package/src/simple-tree/api/index.ts +14 -0
  979. package/src/simple-tree/api/schemaFactory.ts +0 -2
  980. package/src/simple-tree/api/schemaFactoryAlpha.ts +80 -4
  981. package/src/simple-tree/api/simpleTreeIndex.ts +6 -6
  982. package/src/simple-tree/api/storedSchema.ts +12 -20
  983. package/src/simple-tree/api/tree.ts +7 -20
  984. package/src/simple-tree/api/treeAlpha.ts +153 -0
  985. package/src/simple-tree/api/treeBeta.ts +1 -1
  986. package/src/simple-tree/api/treeChangeEvents.ts +4 -1
  987. package/src/simple-tree/api/treeNodeApi.ts +189 -3
  988. package/src/simple-tree/core/toStored.ts +8 -0
  989. package/src/simple-tree/core/treeNodeKernel.ts +53 -7
  990. package/src/simple-tree/core/unhydratedFlexTree.ts +137 -9
  991. package/src/simple-tree/fieldSchema.ts +10 -0
  992. package/src/simple-tree/index.ts +15 -0
  993. package/src/simple-tree/node-kinds/array/arrayNode.ts +64 -0
  994. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +25 -1
  995. package/src/simple-tree/node-kinds/array/index.ts +2 -0
  996. package/src/simple-tree/node-kinds/index.ts +3 -0
  997. package/src/simple-tree/node-kinds/map/index.ts +1 -0
  998. package/src/simple-tree/node-kinds/map/mapNode.ts +20 -3
  999. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +6 -6
  1000. package/src/simple-tree/simpleSchema.ts +20 -0
  1001. package/src/simple-tree/toStoredSchema.ts +28 -1
  1002. package/src/tableSchema.ts +16 -28
  1003. package/src/text/textDomain.ts +68 -1
  1004. package/src/text/textDomainFormatted.ts +113 -11
  1005. package/src/treeFactory.ts +10 -5
  1006. package/src/util/index.ts +0 -1
  1007. package/src/util/referenceCounting.ts +0 -1
  1008. package/src/util/utils.ts +0 -2
  1009. package/.mocharc.customBenchmarks.cjs +0 -25
  1010. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +0 -383
  1011. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +0 -1
  1012. package/dist/feature-libraries/chunked-forest/codec/format.js +0 -191
  1013. package/dist/feature-libraries/chunked-forest/codec/format.js.map +0 -1
  1014. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +0 -1
  1015. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +0 -1
  1016. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +0 -383
  1017. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +0 -1
  1018. package/lib/feature-libraries/chunked-forest/codec/format.js +0 -188
  1019. package/lib/feature-libraries/chunked-forest/codec/format.js.map +0 -1
  1020. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +0 -1
  1021. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +0 -1
  1022. /package/dist/feature-libraries/chunked-forest/codec/{formatGeneric.js → format/formatGeneric.js} +0 -0
  1023. /package/lib/feature-libraries/chunked-forest/codec/{formatGeneric.js → format/formatGeneric.js} +0 -0
@@ -27,11 +27,11 @@ import { TreeCompressionStrategy } from "../../treeCompressionUtils.js";
27
27
  import { decode } from "./chunkDecoding.js";
28
28
  import type { FieldBatch } from "./fieldBatch.js";
29
29
  import {
30
- type EncodedFieldBatch,
31
- FieldBatchFormatVersion,
32
30
  EncodedFieldBatchV1,
33
31
  EncodedFieldBatchV2,
34
- } from "./format.js";
32
+ FieldBatchFormatVersion,
33
+ type EncodedFieldBatchV1OrV2,
34
+ } from "./format/index.js";
35
35
  import type { IncrementalEncodingPolicy } from "./incrementalEncodingPolicy.js";
36
36
  import { schemaCompressedEncodeV1, schemaCompressedEncodeV2 } from "./schemaBasedEncode.js";
37
37
  import { uncompressedEncodeV1, uncompressedEncodeV2 } from "./uncompressedEncode.js";
@@ -67,7 +67,7 @@ export interface IncrementalEncoder {
67
67
  */
68
68
  encodeIncrementalField(
69
69
  cursor: ITreeCursorSynchronous,
70
- chunkEncoder: (chunk: TreeChunk) => EncodedFieldBatch,
70
+ chunkEncoder: (chunk: TreeChunk) => EncodedFieldBatchV2,
71
71
  ): ChunkReferenceId[];
72
72
  }
73
73
 
@@ -87,7 +87,7 @@ export interface IncrementalDecoder {
87
87
  */
88
88
  decodeIncrementalChunk(
89
89
  referenceId: ChunkReferenceId,
90
- chunkDecoder: (encoded: EncodedFieldBatch) => TreeChunk,
90
+ chunkDecoder: (encoded: EncodedFieldBatchV2) => TreeChunk,
91
91
  ): TreeChunk;
92
92
  }
93
93
  /**
@@ -117,25 +117,28 @@ export type FieldBatchCodec = ReturnType<typeof fieldBatchCodecBuilder.build>;
117
117
  */
118
118
  function makeFieldBatchCodecForVersion(
119
119
  version: FieldBatchFormatVersion,
120
- uncompressedEncodeFn: (batch: FieldBatch) => EncodedFieldBatch,
120
+ uncompressedEncodeFn: (batch: FieldBatch) => EncodedFieldBatchV1OrV2,
121
121
  schemaCompressedEncodeFn: (
122
122
  schema: StoredSchemaCollection,
123
123
  policy: SchemaPolicy,
124
124
  fieldBatch: FieldBatch,
125
125
  idCompressor: IIdCompressor,
126
126
  incrementalEncoder: IncrementalEncoder | undefined,
127
- ) => EncodedFieldBatch,
127
+ ) => EncodedFieldBatchV1OrV2,
128
128
  encodedFieldBatchType: TSchema,
129
129
  ): CodecAndSchema<FieldBatch, FieldBatchEncodingContext> {
130
130
  return {
131
- encode: (data: FieldBatch, context: FieldBatchEncodingContext): EncodedFieldBatch => {
131
+ encode: (
132
+ data: FieldBatch,
133
+ context: FieldBatchEncodingContext,
134
+ ): EncodedFieldBatchV1OrV2 => {
132
135
  for (const cursor of data) {
133
136
  assert(
134
137
  cursor.mode === CursorLocationType.Fields,
135
138
  0x8a3 /* FieldBatch expects fields cursors */,
136
139
  );
137
140
  }
138
- let encoded: EncodedFieldBatch;
141
+ let encoded: EncodedFieldBatchV1OrV2;
139
142
  let incrementalEncoder: IncrementalEncoder | undefined;
140
143
  switch (context.encodeType) {
141
144
  case TreeCompressionStrategy.Uncompressed: {
@@ -176,7 +179,10 @@ function makeFieldBatchCodecForVersion(
176
179
  // TODO: consider checking input data was in schema.
177
180
  return encoded;
178
181
  },
179
- decode: (data: EncodedFieldBatch, context: FieldBatchEncodingContext): FieldBatch => {
182
+ decode: (
183
+ data: EncodedFieldBatchV1OrV2,
184
+ context: FieldBatchEncodingContext,
185
+ ): FieldBatch => {
180
186
  // TODO: consider checking data is in schema.
181
187
  return decode(
182
188
  data,
@@ -30,13 +30,15 @@ import type { IncrementalEncoder } from "./codecs.js";
30
30
  import type { FieldBatch } from "./fieldBatch.js";
31
31
  import {
32
32
  type EncodedAnyShape,
33
- type EncodedChunkShape,
34
- type EncodedFieldBatch,
33
+ type EncodedChunkShapeV1,
34
+ type EncodedChunkShapeV1OrV2,
35
+ type EncodedChunkShapeV2,
36
+ type EncodedFieldBatchV1OrV2,
35
37
  type EncodedNestedArrayShape,
36
38
  type EncodedValueShape,
37
39
  FieldBatchFormatVersion,
38
40
  SpecialField,
39
- } from "./format.js";
41
+ } from "./format/index.js";
40
42
 
41
43
  /**
42
44
  * Encode data from `FieldBatch` into an `EncodedFieldBatch`.
@@ -48,7 +50,7 @@ import {
48
50
  export function compressedEncode(
49
51
  fieldBatch: FieldBatch,
50
52
  context: EncoderContext,
51
- ): EncodedFieldBatch {
53
+ ): EncodedFieldBatchV1OrV2 {
52
54
  const batchBuffer: BufferFormat[] = [];
53
55
 
54
56
  // Populate buffer, including shape and identifier references
@@ -60,8 +62,8 @@ export function compressedEncode(
60
62
  return updateShapesAndIdentifiersEncoding(context.version, batchBuffer);
61
63
  }
62
64
 
63
- export type BufferFormat = BufferFormatGeneric<EncodedChunkShape>;
64
- export type Shape = ShapeGeneric<EncodedChunkShape>;
65
+ export type BufferFormat = BufferFormatGeneric<EncodedChunkShapeV1OrV2>;
66
+ export type Shape = ShapeGeneric<EncodedChunkShapeV1OrV2>;
65
67
 
66
68
  /**
67
69
  * Like {@link FieldEncoder}, except data will be prefixed with the key.
@@ -163,7 +165,7 @@ export function asNodesEncoder(encoder: NodeEncoder): NodesEncoder {
163
165
  /**
164
166
  * Encodes a chunk with {@link EncodedAnyShape} by prefixing the data with its shape.
165
167
  */
166
- export class AnyShape extends ShapeGeneric<EncodedChunkShape> {
168
+ export class AnyShape extends ShapeGeneric<EncodedChunkShapeV1OrV2> {
167
169
  private constructor() {
168
170
  super();
169
171
  }
@@ -172,7 +174,7 @@ export class AnyShape extends ShapeGeneric<EncodedChunkShape> {
172
174
  public encodeShape(
173
175
  identifiers: DeduplicationTable<string>,
174
176
  shapes: DeduplicationTable<Shape>,
175
- ): EncodedChunkShape {
177
+ ): EncodedChunkShapeV1 {
176
178
  const encodedAnyShape: EncodedAnyShape = 0;
177
179
  return { d: encodedAnyShape };
178
180
  }
@@ -268,7 +270,7 @@ export const anyFieldEncoder: FieldEncoder = {
268
270
  * which is an easy way to keep all the related code together without extra objects.
269
271
  */
270
272
  export class InlineArrayEncoder
271
- extends ShapeGeneric<EncodedChunkShape>
273
+ extends ShapeGeneric<EncodedChunkShapeV1OrV2>
272
274
  implements NodesEncoder, FieldEncoder
273
275
  {
274
276
  public static readonly empty: InlineArrayEncoder = new InlineArrayEncoder(0, {
@@ -328,7 +330,7 @@ export class InlineArrayEncoder
328
330
  public encodeShape(
329
331
  identifiers: DeduplicationTable<string>,
330
332
  shapes: DeduplicationTable<Shape>,
331
- ): EncodedChunkShape {
333
+ ): EncodedChunkShapeV1 {
332
334
  return {
333
335
  b: {
334
336
  length: this.length,
@@ -352,7 +354,7 @@ export class InlineArrayEncoder
352
354
  /**
353
355
  * Encodes the shape for a nested array as {@link EncodedNestedArrayShape} shape.
354
356
  */
355
- export class NestedArrayShape extends ShapeGeneric<EncodedChunkShape> {
357
+ export class NestedArrayShape extends ShapeGeneric<EncodedChunkShapeV1OrV2> {
356
358
  /**
357
359
  * @param innerShape - The shape of each item in this nested array.
358
360
  */
@@ -363,7 +365,7 @@ export class NestedArrayShape extends ShapeGeneric<EncodedChunkShape> {
363
365
  public encodeShape(
364
366
  identifiers: DeduplicationTable<string>,
365
367
  shapes: DeduplicationTable<Shape>,
366
- ): EncodedChunkShape {
368
+ ): EncodedChunkShapeV1OrV2 {
367
369
  const shape: EncodedNestedArrayShape =
368
370
  shapes.valueToIndex.get(this.innerShape) ??
369
371
  fail(0xb4f /* index for shape not found in table */);
@@ -422,11 +424,11 @@ export class NestedArrayEncoder implements FieldEncoder {
422
424
  /**
423
425
  * Encodes the shape for an incremental chunk as {@link EncodedIncrementalChunkShape} shape.
424
426
  */
425
- export class IncrementalChunkShape extends ShapeGeneric<EncodedChunkShape> {
427
+ export class IncrementalChunkShape extends ShapeGeneric<EncodedChunkShapeV2> {
426
428
  public encodeShape(
427
429
  identifiers: DeduplicationTable<string>,
428
430
  shapes: DeduplicationTable<Shape>,
429
- ): EncodedChunkShape {
431
+ ): EncodedChunkShapeV2 {
430
432
  return {
431
433
  e: 0 /* EncodedIncrementalChunkShape */,
432
434
  };
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { type Static, type TSchema, Type } from "@sinclair/typebox";
7
7
 
8
- import type { FieldBatchFormatVersion } from "./format.js";
8
+ import type { FieldBatchFormatVersion } from "./versions.js";
9
9
 
10
10
  /**
11
11
  * Identifier OR Index of an identifier in the identifier list.
@@ -5,49 +5,21 @@
5
5
 
6
6
  import { type Static, Type } from "@sinclair/typebox";
7
7
 
8
- import { unionOptions } from "../../../codec/index.js";
9
- import { strictEnum, type Values } from "../../../util/index.js";
8
+ import { unionOptions } from "../../../../codec/index.js";
10
9
 
11
- import {
12
- Count,
13
- EncodedFieldBatchGeneric,
14
- IdentifierOrIndex,
15
- ShapeIndex,
16
- } from "./formatGeneric.js";
17
-
18
- /**
19
- * The format version for the field batch.
20
- */
21
- export const FieldBatchFormatVersion = strictEnum("FieldBatchFormatVersion", {
22
- /**
23
- * Initial version.
24
- * @remarks
25
- * For simplicity of implementation the format for this version allows the same chunk shapes as v2, but must not use {@link EncodedIncrementalChunkShape}
26
- * as older clients will not know how to handle that shape but think they can handle this format.
27
- */
28
- v1: 1,
29
- /**
30
- * Adds support for incremental encoding of chunks.
31
- * @remarks
32
- * {@link EncodedIncrementalChunkShape} was added in this version.
33
- */
34
- v2: 2,
35
- });
36
- export type FieldBatchFormatVersion = Values<typeof FieldBatchFormatVersion>;
37
-
38
- // Compatible versions used for format/version validation.
39
- // TODO: A proper version update policy will need to be documented.
40
- export const validVersions = new Set([...Object.values(FieldBatchFormatVersion)]);
10
+ import { Count, IdentifierOrIndex, ShapeIndex } from "./formatGeneric.js";
41
11
 
42
12
  /**
43
13
  * Top level length is implied from length of data array.
44
14
  * All content are of this shape.
45
15
  */
16
+ export type EncodedNestedArrayShape = Static<typeof EncodedNestedArrayShape>;
46
17
  export const EncodedNestedArrayShape = ShapeIndex;
47
18
 
48
19
  /**
49
20
  * Inline array.
50
21
  */
22
+ export type EncodedInlineArrayShape = Static<typeof EncodedInlineArrayShape>;
51
23
  export const EncodedInlineArrayShape = Type.Object(
52
24
  {
53
25
  length: Count,
@@ -64,18 +36,14 @@ export const EncodedInlineArrayShape = Type.Object(
64
36
  *
65
37
  * Used for polymorphism.
66
38
  */
39
+ export type EncodedAnyShape = Static<typeof EncodedAnyShape>;
67
40
  export const EncodedAnyShape = Type.Literal(0);
68
41
 
69
- /**
70
- * Encoded content is a {@link ChunkReferenceId}.
71
- * This represents the shape of a chunk that is encoded separately and is referenced by its {@link ChunkReferenceId}.
72
- */
73
- export const EncodedIncrementalChunkShape = Type.Literal(0);
74
-
75
42
  /**
76
43
  * Content of the encoded field is specified by the Shape referenced by the ShapeIndex.
77
44
  * This is a tuple for conciseness.
78
45
  */
46
+ export type EncodedFieldShape = Static<typeof EncodedFieldShape>;
79
47
  export const EncodedFieldShape = Type.Tuple([
80
48
  /**
81
49
  * Field key for this field.
@@ -87,33 +55,6 @@ export const EncodedFieldShape = Type.Tuple([
87
55
  ShapeIndex,
88
56
  ]);
89
57
 
90
- export type EncodedFieldShape = Static<typeof EncodedFieldShape>;
91
-
92
- enum CounterRelativeTo {
93
- // Relative to previous node of same type in depth first pre-order traversal.
94
- PreviousNodeOfType_DepthFirstPreOrder,
95
- // TODO: add alternative relative mode relative to previous note at a path to allow delta encoded sequences (like points where x and y are delta encoded relative to previous points).
96
- }
97
-
98
- enum CounterMode {
99
- Number,
100
- // TODO: document wrap modes and bit skipping. Note UUID subVersion here (ex: UUIDv4)
101
- UUID,
102
- }
103
-
104
- /**
105
- * Delta encoded value relative to a previous node's value.
106
- */
107
- export const EncodedCounter = Type.Object(
108
- {
109
- relativeTo: Type.Enum(CounterRelativeTo),
110
- // If not provided, delta inline in data.
111
- delta: Type.Optional(Type.Number()),
112
- mode: Type.Enum(CounterMode),
113
- },
114
- { additionalProperties: false },
115
- );
116
-
117
58
  /**
118
59
  * Used in {@link EncodedValueShape} for special field kind handling.
119
60
  */
@@ -159,6 +100,10 @@ export const EncodedValueShape = Type.Union([
159
100
  ]);
160
101
  export type EncodedValueShape = undefined | Static<typeof EncodedValueShape>;
161
102
 
103
+ /**
104
+ * The encoded form of a {@link Shape} for a node.
105
+ */
106
+ export type EncodedNodeShape = Static<typeof EncodedNodeShape>;
162
107
  export const EncodedNodeShape = Type.Object(
163
108
  {
164
109
  /**
@@ -181,6 +126,30 @@ export const EncodedNodeShape = Type.Object(
181
126
  { additionalProperties: false },
182
127
  );
183
128
 
129
+ /**
130
+ * The chunk shapes supported by the V1 format.
131
+ * @remarks
132
+ * See {@link EncodedChunkShapeV1}.
133
+ */
134
+ export const shapesV1 = {
135
+ /**
136
+ * {@link EncodedNestedArrayShape} union member.
137
+ */
138
+ a: Type.Optional(EncodedNestedArrayShape),
139
+ /**
140
+ * {@link EncodedInlineArrayShape} union member.
141
+ */
142
+ b: Type.Optional(EncodedInlineArrayShape),
143
+ /**
144
+ * {@link EncodedNodeShape} union member.
145
+ */
146
+ c: Type.Optional(EncodedNodeShape),
147
+ /**
148
+ * {@link EncodedAnyShape} union member.
149
+ */
150
+ d: Type.Optional(EncodedAnyShape),
151
+ } as const;
152
+
184
153
  /**
185
154
  * Discriminated union that represents the shapes of chunks in the encoded data.
186
155
  * "Chunk" here refers to a chunk of tree data, rooted at a range of nodes, that is encoded as a
@@ -191,52 +160,13 @@ export const EncodedNodeShape = Type.Object(
191
160
  * This is similar to other such concepts in the system.
192
161
  *
193
162
  * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
163
+ * @privateRemarks
164
+ * Because the TypeScript types for how we model these unions don't require exactly one property,
165
+ * to prevent a union with more options from being assignable to this one, we include Never.
166
+ * This matters in this case because the V2 format only differs in that it has another entry in this Union.
194
167
  */
195
- export const EncodedChunkShape = Type.Object(
196
- {
197
- /**
198
- * {@link EncodedNestedArrayShape} union member.
199
- */
200
- a: Type.Optional(EncodedNestedArrayShape),
201
- /**
202
- * {@link EncodedInlineArrayShape} union member.
203
- */
204
- b: Type.Optional(EncodedInlineArrayShape),
205
- /**
206
- * {@link EncodedNodeShape} union member.
207
- */
208
- c: Type.Optional(EncodedNodeShape),
209
- /**
210
- * {@link EncodedAnyShape} union member.
211
- */
212
- d: Type.Optional(EncodedAnyShape),
213
- /**
214
- * {@link EncodedIncrementalChunkShape} union member.
215
- */
216
- e: Type.Optional(EncodedIncrementalChunkShape),
217
- },
168
+ export type EncodedChunkShapeV1 = Static<typeof EncodedChunkShapeV1>;
169
+ export const EncodedChunkShapeV1 = Type.Object(
170
+ { ...shapesV1, e: Type.Optional(Type.Never()) },
218
171
  unionOptions,
219
172
  );
220
-
221
- export type EncodedChunkShape = Static<typeof EncodedChunkShape>;
222
-
223
- export type EncodedNestedArrayShape = Static<typeof EncodedNestedArrayShape>;
224
- export type EncodedInlineArrayShape = Static<typeof EncodedInlineArrayShape>;
225
- export type EncodedNodeShape = Static<typeof EncodedNodeShape>;
226
- export type EncodedAnyShape = Static<typeof EncodedAnyShape>;
227
- export type EncodedIncrementalChunkShape = Static<typeof EncodedIncrementalChunkShape>;
228
-
229
- export const EncodedFieldBatchV1 = EncodedFieldBatchGeneric(
230
- FieldBatchFormatVersion.v1,
231
- EncodedChunkShape,
232
- );
233
- export type EncodedFieldBatchV1 = Static<typeof EncodedFieldBatchV1>;
234
-
235
- export const EncodedFieldBatchV2 = EncodedFieldBatchGeneric(
236
- FieldBatchFormatVersion.v2,
237
- EncodedChunkShape,
238
- );
239
- export type EncodedFieldBatchV2 = Static<typeof EncodedFieldBatchV2>;
240
-
241
- export const EncodedFieldBatch = Type.Union([EncodedFieldBatchV1, EncodedFieldBatchV2]);
242
- export type EncodedFieldBatch = Static<typeof EncodedFieldBatch>;
@@ -0,0 +1,31 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { type Static, Type } from "@sinclair/typebox";
7
+
8
+ import { unionOptions } from "../../../../codec/index.js";
9
+
10
+ import { shapesV1 } from "./formatV1.js";
11
+
12
+ /**
13
+ * Encoded content is a {@link ChunkReferenceId}.
14
+ * This represents the shape of a chunk that is encoded separately and is referenced by its {@link ChunkReferenceId}.
15
+ */
16
+ export type EncodedIncrementalChunkShape = Static<typeof EncodedIncrementalChunkShape>;
17
+ export const EncodedIncrementalChunkShape = Type.Literal(0);
18
+
19
+ /**
20
+ * V2 extension of {@link EncodedChunkShapeV1}.
21
+ * @remarks
22
+ * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
23
+ */
24
+ export type EncodedChunkShapeV2 = Static<typeof EncodedChunkShapeV2>;
25
+ export const EncodedChunkShapeV2 = Type.Object(
26
+ {
27
+ ...shapesV1,
28
+ e: Type.Optional(EncodedIncrementalChunkShape),
29
+ },
30
+ unionOptions,
31
+ );
@@ -0,0 +1,31 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ export type {
7
+ EncodedChunkShapeV1,
8
+ EncodedInlineArrayShape,
9
+ EncodedNestedArrayShape,
10
+ EncodedNodeShape,
11
+ EncodedValueShape,
12
+ EncodedFieldShape,
13
+ } from "./formatV1.js";
14
+ export {
15
+ EncodedAnyShape,
16
+ SpecialField,
17
+ } from "./formatV1.js";
18
+ export { EncodedIncrementalChunkShape, EncodedChunkShapeV2 } from "./formatV2.js";
19
+ export {
20
+ FieldBatchFormatVersion,
21
+ EncodedFieldBatchV1,
22
+ EncodedFieldBatchV2,
23
+ type EncodedFieldBatchV1OrV2,
24
+ type EncodedFieldBatchV1AndV2,
25
+ type EncodedChunkShapeV1OrV2,
26
+ } from "./versions.js";
27
+ export type {
28
+ ShapeIndex,
29
+ IdentifierOrIndex,
30
+ EncodedFieldBatchGeneric,
31
+ } from "./formatGeneric.js";
@@ -0,0 +1,81 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import type { Static } from "@sinclair/typebox";
7
+
8
+ import { strictEnum, type Values } from "../../../../util/index.js";
9
+
10
+ import { EncodedFieldBatchGeneric } from "./formatGeneric.js";
11
+ import { EncodedChunkShapeV1 } from "./formatV1.js";
12
+ import { EncodedChunkShapeV2 } from "./formatV2.js";
13
+
14
+ /**
15
+ * The format version for the field batch.
16
+ */
17
+ export type FieldBatchFormatVersion = Values<typeof FieldBatchFormatVersion>;
18
+ export const FieldBatchFormatVersion = strictEnum("FieldBatchFormatVersion", {
19
+ /**
20
+ * Initial version.
21
+ * @remarks
22
+ * For simplicity of implementation the format for this version allows the same chunk shapes as v2, but must not use {@link EncodedIncrementalChunkShape}
23
+ * as older clients will not know how to handle that shape but think they can handle this format.
24
+ */
25
+ v1: 1,
26
+ /**
27
+ * Adds support for incremental encoding of chunks.
28
+ * @remarks
29
+ * {@link EncodedIncrementalChunkShape} was added in this version.
30
+ */
31
+ v2: 2,
32
+ });
33
+
34
+ /**
35
+ * Encoded {@link FieldBatch} using V1 format.
36
+ * @remarks
37
+ * Does not support {@link EncodedIncrementalChunkShape}.
38
+ */
39
+ export type EncodedFieldBatchV1 = Static<typeof EncodedFieldBatchV1>;
40
+ export const EncodedFieldBatchV1 = EncodedFieldBatchGeneric(
41
+ FieldBatchFormatVersion.v1,
42
+ EncodedChunkShapeV1,
43
+ );
44
+
45
+ /**
46
+ * Encoded {@link FieldBatch} using V2 format.
47
+ * @remarks
48
+ * Adds support for {@link EncodedIncrementalChunkShape}.
49
+ */
50
+ export type EncodedFieldBatchV2 = Static<typeof EncodedFieldBatchV2>;
51
+ export const EncodedFieldBatchV2 = EncodedFieldBatchGeneric(
52
+ FieldBatchFormatVersion.v2,
53
+ EncodedChunkShapeV2,
54
+ );
55
+
56
+ /**
57
+ * Encoded {@link FieldBatch}, which might use V2 features, but might also have been from a V1 encoder.
58
+ * @remarks
59
+ * Type wise, equivalent to V2, as that is a superset of V1.
60
+ * Used instead of just V2 for clarity.
61
+ */
62
+ export type EncodedFieldBatchV1OrV2 = EncodedFieldBatchV1 | EncodedFieldBatchV2;
63
+
64
+ /**
65
+ * Encoded data, compatible with both V1 and V2 formats.
66
+ * @remarks
67
+ * This is the intersection of the two versions, which is possible because V2 is a non-breaking extension of V1.
68
+ * This type can be used when the code is compatible with both versions and does not need to distinguish between them.
69
+ *
70
+ * Type wise, equivalent to V1, as that is a subset of V2.
71
+ * Used instead of just V1 for clarity.
72
+ */
73
+ export type EncodedFieldBatchV1AndV2 = EncodedFieldBatchV1 & EncodedFieldBatchV2;
74
+
75
+ /**
76
+ * Encoded chunk shape, which might use V2 features, but might also have been from a V1 encoder.
77
+ * @remarks
78
+ * Type wise, equivalent to V2, as that is a superset of V1.
79
+ * Used instead of just V2 for clarity.
80
+ */
81
+ export type EncodedChunkShapeV1OrV2 = EncodedChunkShapeV1 | EncodedChunkShapeV2;
@@ -3,8 +3,12 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- export type { EncodedFieldBatch } from "./format.js";
7
- export { FieldBatchFormatVersion } from "./format.js";
6
+ export type {
7
+ EncodedFieldBatchV1,
8
+ EncodedFieldBatchV1OrV2,
9
+ EncodedFieldBatchV2,
10
+ } from "./format/index.js";
11
+ export { FieldBatchFormatVersion } from "./format/index.js";
8
12
  export type { FieldBatch } from "./fieldBatch.js";
9
13
  export {
10
14
  type FieldBatchCodec,
@@ -24,7 +24,11 @@ import {
24
24
  type NodeEncoder,
25
25
  encodeValue,
26
26
  } from "./compressedEncode.js";
27
- import type { EncodedChunkShape, EncodedFieldShape, EncodedValueShape } from "./format.js";
27
+ import type {
28
+ EncodedChunkShapeV1OrV2,
29
+ EncodedFieldShape,
30
+ EncodedValueShape,
31
+ } from "./format/index.js";
28
32
 
29
33
  /**
30
34
  * Encodes a node with the {@link EncodedNodeShape} shape.
@@ -32,7 +36,10 @@ import type { EncodedChunkShape, EncodedFieldShape, EncodedValueShape } from "./
32
36
  * The fact this is also a Shape is an implementation detail of the encoder: that allows the shape it uses to be itself,
33
37
  * which is an easy way to keep all the related code together without extra objects.
34
38
  */
35
- export class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> implements NodeEncoder {
39
+ export class NodeShapeBasedEncoder
40
+ extends Shape<EncodedChunkShapeV1OrV2>
41
+ implements NodeEncoder
42
+ {
36
43
  /**
37
44
  * Set of keys for fields that are encoded using {@link NodeShapeBasedEncoder.specializedFieldEncoders}.
38
45
  * TODO: Ensure uniform chunks, encoding and identifier generation sort fields the same.
@@ -80,7 +87,7 @@ export class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> implements N
80
87
  public encodeNode(
81
88
  cursor: ITreeCursorSynchronous,
82
89
  context: EncoderContext,
83
- outputBuffer: BufferFormat<EncodedChunkShape>,
90
+ outputBuffer: BufferFormat<EncodedChunkShapeV1OrV2>,
84
91
  ): void {
85
92
  if (this.type === undefined) {
86
93
  outputBuffer.push(new IdentifierToken(cursor.type));
@@ -94,7 +101,7 @@ export class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> implements N
94
101
  cursor.exitField();
95
102
  }
96
103
 
97
- const otherFieldsBuffer: BufferFormat<EncodedChunkShape> = [];
104
+ const otherFieldsBuffer: BufferFormat<EncodedChunkShapeV1OrV2> = [];
98
105
 
99
106
  forEachField(cursor, () => {
100
107
  const key = cursor.getFieldKey();
@@ -115,8 +122,8 @@ export class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> implements N
115
122
 
116
123
  public encodeShape(
117
124
  identifiers: DeduplicationTable<string>,
118
- shapes: DeduplicationTable<Shape<EncodedChunkShape>>,
119
- ): EncodedChunkShape {
125
+ shapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>,
126
+ ): EncodedChunkShapeV1OrV2 {
120
127
  return {
121
128
  c: {
122
129
  type: encodeOptionalIdentifier(this.type, identifiers),
@@ -129,7 +136,7 @@ export class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> implements N
129
136
 
130
137
  public countReferencedShapesAndIdentifiers(
131
138
  identifiers: Counter<string>,
132
- shapeDiscovered: (shape: Shape<EncodedChunkShape>) => void,
139
+ shapeDiscovered: (shape: Shape<EncodedChunkShapeV1OrV2>) => void,
133
140
  ): void {
134
141
  if (this.type !== undefined) {
135
142
  identifiers.add(this.type);
@@ -145,7 +152,7 @@ export class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> implements N
145
152
  }
146
153
  }
147
154
 
148
- public get shape(): Shape<EncodedChunkShape> {
155
+ public get shape(): Shape<EncodedChunkShapeV1OrV2> {
149
156
  return this;
150
157
  }
151
158
  }
@@ -153,7 +160,7 @@ export class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> implements N
153
160
  export function encodeFieldShapes(
154
161
  fieldEncoders: readonly KeyedFieldEncoder[],
155
162
  identifiers: DeduplicationTable<string>,
156
- shapes: DeduplicationTable<Shape<EncodedChunkShape>>,
163
+ shapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>,
157
164
  ): EncodedFieldShape[] | undefined {
158
165
  if (fieldEncoders.length === 0) {
159
166
  return undefined;
@@ -182,14 +189,14 @@ function encodeOptionalIdentifier(
182
189
 
183
190
  function encodeOptionalFieldShape(
184
191
  encoder: FieldEncoder | undefined,
185
- shapes: DeduplicationTable<Shape<EncodedChunkShape>>,
192
+ shapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>,
186
193
  ): number | undefined {
187
194
  return encoder === undefined ? undefined : dedupShape(encoder.shape, shapes);
188
195
  }
189
196
 
190
197
  function dedupShape(
191
- shape: Shape<EncodedChunkShape>,
192
- shapes: DeduplicationTable<Shape<EncodedChunkShape>>,
198
+ shape: Shape<EncodedChunkShapeV1OrV2>,
199
+ shapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>,
193
200
  ): number {
194
201
  return shapes.valueToIndex.get(shape) ?? fail(0xb51 /* missing shape */);
195
202
  }