@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
@@ -0,0 +1,93 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { Static } from "@sinclair/typebox";
6
+ import { type Values } from "../../../../util/index.js";
7
+ import { EncodedChunkShapeV1 } from "./formatV1.js";
8
+ import { EncodedChunkShapeV2 } from "./formatV2.js";
9
+ /**
10
+ * The format version for the field batch.
11
+ */
12
+ export type FieldBatchFormatVersion = Values<typeof FieldBatchFormatVersion>;
13
+ export declare const FieldBatchFormatVersion: {
14
+ readonly v1: import("../../../../util/brand.js").Brand<1, "FieldBatchFormatVersion">;
15
+ readonly v2: import("../../../../util/brand.js").Brand<2, "FieldBatchFormatVersion">;
16
+ };
17
+ /**
18
+ * Encoded {@link FieldBatch} using V1 format.
19
+ * @remarks
20
+ * Does not support {@link EncodedIncrementalChunkShape}.
21
+ */
22
+ export type EncodedFieldBatchV1 = Static<typeof EncodedFieldBatchV1>;
23
+ export declare const EncodedFieldBatchV1: import("@sinclair/typebox").TObject<{
24
+ data: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>>;
25
+ version: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TLiteral<FieldBatchFormatVersion>]>;
26
+ identifiers: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
27
+ shapes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
28
+ e: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
29
+ a: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
30
+ b: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
31
+ length: import("@sinclair/typebox").TNumber;
32
+ shape: import("@sinclair/typebox").TNumber;
33
+ }>>;
34
+ c: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
35
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>>;
36
+ value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>, import("@sinclair/typebox").TEnum<typeof import("./formatV1.js").SpecialField>]>>;
37
+ fields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>, import("@sinclair/typebox").TNumber]>>>;
38
+ extraFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
39
+ }>>;
40
+ d: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<0>>;
41
+ }>>;
42
+ }>;
43
+ /**
44
+ * Encoded {@link FieldBatch} using V2 format.
45
+ * @remarks
46
+ * Adds support for {@link EncodedIncrementalChunkShape}.
47
+ */
48
+ export type EncodedFieldBatchV2 = Static<typeof EncodedFieldBatchV2>;
49
+ export declare const EncodedFieldBatchV2: import("@sinclair/typebox").TObject<{
50
+ data: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>>;
51
+ version: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TLiteral<FieldBatchFormatVersion>]>;
52
+ identifiers: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
53
+ shapes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
54
+ e: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<0>>;
55
+ a: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
56
+ b: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
57
+ length: import("@sinclair/typebox").TNumber;
58
+ shape: import("@sinclair/typebox").TNumber;
59
+ }>>;
60
+ c: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
61
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>>;
62
+ value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>, import("@sinclair/typebox").TEnum<typeof import("./formatV1.js").SpecialField>]>>;
63
+ fields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>, import("@sinclair/typebox").TNumber]>>>;
64
+ extraFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
65
+ }>>;
66
+ d: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<0>>;
67
+ }>>;
68
+ }>;
69
+ /**
70
+ * Encoded {@link FieldBatch}, which might use V2 features, but might also have been from a V1 encoder.
71
+ * @remarks
72
+ * Type wise, equivalent to V2, as that is a superset of V1.
73
+ * Used instead of just V2 for clarity.
74
+ */
75
+ export type EncodedFieldBatchV1OrV2 = EncodedFieldBatchV1 | EncodedFieldBatchV2;
76
+ /**
77
+ * Encoded data, compatible with both V1 and V2 formats.
78
+ * @remarks
79
+ * This is the intersection of the two versions, which is possible because V2 is a non-breaking extension of V1.
80
+ * This type can be used when the code is compatible with both versions and does not need to distinguish between them.
81
+ *
82
+ * Type wise, equivalent to V1, as that is a subset of V2.
83
+ * Used instead of just V1 for clarity.
84
+ */
85
+ export type EncodedFieldBatchV1AndV2 = EncodedFieldBatchV1 & EncodedFieldBatchV2;
86
+ /**
87
+ * Encoded chunk shape, which might use V2 features, but might also have been from a V1 encoder.
88
+ * @remarks
89
+ * Type wise, equivalent to V2, as that is a superset of V1.
90
+ * Used instead of just V2 for clarity.
91
+ */
92
+ export type EncodedChunkShapeV1OrV2 = EncodedChunkShapeV1 | EncodedChunkShapeV2;
93
+ //# sourceMappingURL=versions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/versions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAc,KAAK,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,eAAO,MAAM,uBAAuB;;;CAclC,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;EAG/B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;EAG/B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;AAEhF;;;;;;;;GAQG;AACH,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;AAEjF;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,GAAG,mBAAmB,CAAC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.EncodedFieldBatchV2 = exports.EncodedFieldBatchV1 = exports.FieldBatchFormatVersion = void 0;
8
+ const index_js_1 = require("../../../../util/index.js");
9
+ const formatGeneric_js_1 = require("./formatGeneric.js");
10
+ const formatV1_js_1 = require("./formatV1.js");
11
+ const formatV2_js_1 = require("./formatV2.js");
12
+ exports.FieldBatchFormatVersion = (0, index_js_1.strictEnum)("FieldBatchFormatVersion", {
13
+ /**
14
+ * Initial version.
15
+ * @remarks
16
+ * For simplicity of implementation the format for this version allows the same chunk shapes as v2, but must not use {@link EncodedIncrementalChunkShape}
17
+ * as older clients will not know how to handle that shape but think they can handle this format.
18
+ */
19
+ v1: 1,
20
+ /**
21
+ * Adds support for incremental encoding of chunks.
22
+ * @remarks
23
+ * {@link EncodedIncrementalChunkShape} was added in this version.
24
+ */
25
+ v2: 2,
26
+ });
27
+ exports.EncodedFieldBatchV1 = (0, formatGeneric_js_1.EncodedFieldBatchGeneric)(exports.FieldBatchFormatVersion.v1, formatV1_js_1.EncodedChunkShapeV1);
28
+ exports.EncodedFieldBatchV2 = (0, formatGeneric_js_1.EncodedFieldBatchGeneric)(exports.FieldBatchFormatVersion.v2, formatV2_js_1.EncodedChunkShapeV2);
29
+ //# sourceMappingURL=versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/versions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,wDAAoE;AAEpE,yDAA8D;AAC9D,+CAAoD;AACpD,+CAAoD;AAMvC,QAAA,uBAAuB,GAAG,IAAA,qBAAU,EAAC,yBAAyB,EAAE;IAC5E;;;;;OAKG;IACH,EAAE,EAAE,CAAC;IACL;;;;OAIG;IACH,EAAE,EAAE,CAAC;CACL,CAAC,CAAC;AAQU,QAAA,mBAAmB,GAAG,IAAA,2CAAwB,EAC1D,+BAAuB,CAAC,EAAE,EAC1B,iCAAmB,CACnB,CAAC;AAQW,QAAA,mBAAmB,GAAG,IAAA,2CAAwB,EAC1D,+BAAuB,CAAC,EAAE,EAC1B,iCAAmB,CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Static } from \"@sinclair/typebox\";\n\nimport { strictEnum, type Values } from \"../../../../util/index.js\";\n\nimport { EncodedFieldBatchGeneric } from \"./formatGeneric.js\";\nimport { EncodedChunkShapeV1 } from \"./formatV1.js\";\nimport { EncodedChunkShapeV2 } from \"./formatV2.js\";\n\n/**\n * The format version for the field batch.\n */\nexport type FieldBatchFormatVersion = Values<typeof FieldBatchFormatVersion>;\nexport const FieldBatchFormatVersion = strictEnum(\"FieldBatchFormatVersion\", {\n\t/**\n\t * Initial version.\n\t * @remarks\n\t * For simplicity of implementation the format for this version allows the same chunk shapes as v2, but must not use {@link EncodedIncrementalChunkShape}\n\t * as older clients will not know how to handle that shape but think they can handle this format.\n\t */\n\tv1: 1,\n\t/**\n\t * Adds support for incremental encoding of chunks.\n\t * @remarks\n\t * {@link EncodedIncrementalChunkShape} was added in this version.\n\t */\n\tv2: 2,\n});\n\n/**\n * Encoded {@link FieldBatch} using V1 format.\n * @remarks\n * Does not support {@link EncodedIncrementalChunkShape}.\n */\nexport type EncodedFieldBatchV1 = Static<typeof EncodedFieldBatchV1>;\nexport const EncodedFieldBatchV1 = EncodedFieldBatchGeneric(\n\tFieldBatchFormatVersion.v1,\n\tEncodedChunkShapeV1,\n);\n\n/**\n * Encoded {@link FieldBatch} using V2 format.\n * @remarks\n * Adds support for {@link EncodedIncrementalChunkShape}.\n */\nexport type EncodedFieldBatchV2 = Static<typeof EncodedFieldBatchV2>;\nexport const EncodedFieldBatchV2 = EncodedFieldBatchGeneric(\n\tFieldBatchFormatVersion.v2,\n\tEncodedChunkShapeV2,\n);\n\n/**\n * Encoded {@link FieldBatch}, which might use V2 features, but might also have been from a V1 encoder.\n * @remarks\n * Type wise, equivalent to V2, as that is a superset of V1.\n * Used instead of just V2 for clarity.\n */\nexport type EncodedFieldBatchV1OrV2 = EncodedFieldBatchV1 | EncodedFieldBatchV2;\n\n/**\n * Encoded data, compatible with both V1 and V2 formats.\n * @remarks\n * This is the intersection of the two versions, which is possible because V2 is a non-breaking extension of V1.\n * This type can be used when the code is compatible with both versions and does not need to distinguish between them.\n *\n * Type wise, equivalent to V1, as that is a subset of V2.\n * Used instead of just V1 for clarity.\n */\nexport type EncodedFieldBatchV1AndV2 = EncodedFieldBatchV1 & EncodedFieldBatchV2;\n\n/**\n * Encoded chunk shape, which might use V2 features, but might also have been from a V1 encoder.\n * @remarks\n * Type wise, equivalent to V2, as that is a superset of V1.\n * Used instead of just V2 for clarity.\n */\nexport type EncodedChunkShapeV1OrV2 = EncodedChunkShapeV1 | EncodedChunkShapeV2;\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export type { EncodedFieldBatch } from "./format.js";
6
- export { FieldBatchFormatVersion } from "./format.js";
5
+ export type { EncodedFieldBatchV1, EncodedFieldBatchV1OrV2, EncodedFieldBatchV2, } from "./format/index.js";
6
+ export { FieldBatchFormatVersion } from "./format/index.js";
7
7
  export type { FieldBatch } from "./fieldBatch.js";
8
8
  export { type FieldBatchCodec, fieldBatchCodecBuilder, type FieldBatchEncodingContext, type IncrementalEncoderDecoder, type IncrementalEncoder, type IncrementalDecoder, type ChunkReferenceId, } from "./codecs.js";
9
9
  export { type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, } from "./incrementalEncodingPolicy.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACN,KAAK,eAAe,EACpB,sBAAsB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,yBAAyB,EAC9B,gCAAgC,GAChC,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACN,KAAK,eAAe,EACpB,sBAAsB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,yBAAyB,EAC9B,gCAAgC,GAChC,MAAM,gCAAgC,CAAC"}
@@ -5,8 +5,8 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.defaultIncrementalEncodingPolicy = exports.fieldBatchCodecBuilder = exports.FieldBatchFormatVersion = void 0;
8
- var format_js_1 = require("./format.js");
9
- Object.defineProperty(exports, "FieldBatchFormatVersion", { enumerable: true, get: function () { return format_js_1.FieldBatchFormatVersion; } });
8
+ var index_js_1 = require("./format/index.js");
9
+ Object.defineProperty(exports, "FieldBatchFormatVersion", { enumerable: true, get: function () { return index_js_1.FieldBatchFormatVersion; } });
10
10
  var codecs_js_1 = require("./codecs.js");
11
11
  Object.defineProperty(exports, "fieldBatchCodecBuilder", { enumerable: true, get: function () { return codecs_js_1.fieldBatchCodecBuilder; } });
12
12
  var incrementalEncodingPolicy_js_1 = require("./incrementalEncodingPolicy.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yCAAsD;AAA7C,oHAAA,uBAAuB,OAAA;AAEhC,yCAQqB;AANpB,mHAAA,sBAAsB,OAAA;AAOvB,+EAGwC;AADvC,gJAAA,gCAAgC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { EncodedFieldBatch } from \"./format.js\";\nexport { FieldBatchFormatVersion } from \"./format.js\";\nexport type { FieldBatch } from \"./fieldBatch.js\";\nexport {\n\ttype FieldBatchCodec,\n\tfieldBatchCodecBuilder,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncoderDecoder,\n\ttype IncrementalEncoder,\n\ttype IncrementalDecoder,\n\ttype ChunkReferenceId,\n} from \"./codecs.js\";\nexport {\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./incrementalEncodingPolicy.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,8CAA4D;AAAnD,mHAAA,uBAAuB,OAAA;AAEhC,yCAQqB;AANpB,mHAAA,sBAAsB,OAAA;AAOvB,+EAGwC;AADvC,gJAAA,gCAAgC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tEncodedFieldBatchV1,\n\tEncodedFieldBatchV1OrV2,\n\tEncodedFieldBatchV2,\n} from \"./format/index.js\";\nexport { FieldBatchFormatVersion } from \"./format/index.js\";\nexport type { FieldBatch } from \"./fieldBatch.js\";\nexport {\n\ttype FieldBatchCodec,\n\tfieldBatchCodecBuilder,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncoderDecoder,\n\ttype IncrementalEncoder,\n\ttype IncrementalDecoder,\n\ttype ChunkReferenceId,\n} from \"./codecs.js\";\nexport {\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./incrementalEncodingPolicy.js\";\n"]}
@@ -6,14 +6,14 @@ import { type ITreeCursorSynchronous, type TreeNodeSchemaIdentifier } from "../.
6
6
  import type { Counter, DeduplicationTable } from "./chunkCodecUtilities.js";
7
7
  import { type BufferFormat, Shape } from "./chunkEncodingGeneric.js";
8
8
  import { type EncoderContext, type FieldEncoder, type KeyedFieldEncoder, type NodeEncoder } from "./compressedEncode.js";
9
- import type { EncodedChunkShape, EncodedFieldShape, EncodedValueShape } from "./format.js";
9
+ import type { EncodedChunkShapeV1OrV2, EncodedFieldShape, EncodedValueShape } from "./format/index.js";
10
10
  /**
11
11
  * Encodes a node with the {@link EncodedNodeShape} shape.
12
12
  * @remarks
13
13
  * The fact this is also a Shape is an implementation detail of the encoder: that allows the shape it uses to be itself,
14
14
  * which is an easy way to keep all the related code together without extra objects.
15
15
  */
16
- export declare class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> implements NodeEncoder {
16
+ export declare class NodeShapeBasedEncoder extends Shape<EncodedChunkShapeV1OrV2> implements NodeEncoder {
17
17
  readonly type: undefined | TreeNodeSchemaIdentifier;
18
18
  readonly value: EncodedValueShape;
19
19
  /**
@@ -57,10 +57,10 @@ export declare class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> impl
57
57
  */
58
58
  otherFieldsEncoder: undefined | FieldEncoder);
59
59
  private getValueToEncode;
60
- encodeNode(cursor: ITreeCursorSynchronous, context: EncoderContext, outputBuffer: BufferFormat<EncodedChunkShape>): void;
61
- encodeShape(identifiers: DeduplicationTable<string>, shapes: DeduplicationTable<Shape<EncodedChunkShape>>): EncodedChunkShape;
62
- countReferencedShapesAndIdentifiers(identifiers: Counter<string>, shapeDiscovered: (shape: Shape<EncodedChunkShape>) => void): void;
63
- get shape(): Shape<EncodedChunkShape>;
60
+ encodeNode(cursor: ITreeCursorSynchronous, context: EncoderContext, outputBuffer: BufferFormat<EncodedChunkShapeV1OrV2>): void;
61
+ encodeShape(identifiers: DeduplicationTable<string>, shapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>): EncodedChunkShapeV1OrV2;
62
+ countReferencedShapesAndIdentifiers(identifiers: Counter<string>, shapeDiscovered: (shape: Shape<EncodedChunkShapeV1OrV2>) => void): void;
63
+ get shape(): Shape<EncodedChunkShapeV1OrV2>;
64
64
  }
65
- export declare function encodeFieldShapes(fieldEncoders: readonly KeyedFieldEncoder[], identifiers: DeduplicationTable<string>, shapes: DeduplicationTable<Shape<EncodedChunkShape>>): EncodedFieldShape[] | undefined;
65
+ export declare function encodeFieldShapes(fieldEncoders: readonly KeyedFieldEncoder[], identifiers: DeduplicationTable<string>, shapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>): EncodedFieldShape[] | undefined;
66
66
  //# sourceMappingURL=nodeEncoder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodeEncoder.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/nodeEncoder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAEN,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAG7B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC5E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AS,iBAAiB,EAAE;IACtE;;;OAGG;IACa,kBAAkB,EAAE,SAAS,GAAG,YAAY;IAM7D,OAAO,CAAC,gBAAgB;IAajB,UAAU,CAChB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,YAAY,CAAC,uBAAuB,CAAC,GACjD,IAAI;IAgCA,WAAW,CACjB,WAAW,EAAE,kBAAkB,CAAC,MAAM,CAAC,EACvC,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,GACxD,uBAAuB;IAWnB,mCAAmC,CACzC,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,EAC5B,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,KAAK,IAAI,GAC9D,IAAI;IAeP,IAAW,KAAK,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAEjD;CACD;AAED,wBAAgB,iBAAiB,CAChC,aAAa,EAAE,SAAS,iBAAiB,EAAE,EAC3C,WAAW,EAAE,kBAAkB,CAAC,MAAM,CAAC,EACvC,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,GACxD,iBAAiB,EAAE,GAAG,SAAS,CAUjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"nodeEncoder.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/nodeEncoder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AACnE,qEAAoE;AAEpE,qDAMgC;AAChC,qDAA+C;AAG/C,uEAAsF;AACtF,+DAM+B;AAG/B;;;;;GAKG;AACH,MAAa,qBAAsB,SAAQ,+BAAwB;IAOlE,YACiB,IAA0C,EAC1C,KAAwB;IACxC;;;;;;;;;;OAUG;IACa,wBAAsD;IACtE;;;OAGG;IACa,kBAA4C;QAE5D,KAAK,EAAE,CAAC;QApBQ,SAAI,GAAJ,IAAI,CAAsC;QAC1C,UAAK,GAAL,KAAK,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,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC;AAC/D,CAAC;AAED,SAAS,wBAAwB,CAChC,UAA8B,EAC9B,WAAuC;IAEvC,OAAO,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,wBAAwB,CAChC,OAAiC,EACjC,MAAoD;IAEpD,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,UAAU,CAClB,KAA+B,EAC/B,MAAoD;IAEpD,OAAO,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAC1E,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport { isStableId } from \"@fluidframework/id-compressor/internal\";\n\nimport {\n\ttype FieldKey,\n\ttype ITreeCursorSynchronous,\n\ttype TreeNodeSchemaIdentifier,\n\tforEachField,\n\ttype Value,\n} from \"../../../core/index.js\";\nimport { brand } from \"../../../util/index.js\";\n\nimport type { Counter, DeduplicationTable } from \"./chunkCodecUtilities.js\";\nimport { type BufferFormat, IdentifierToken, Shape } from \"./chunkEncodingGeneric.js\";\nimport {\n\ttype EncoderContext,\n\ttype FieldEncoder,\n\ttype KeyedFieldEncoder,\n\ttype NodeEncoder,\n\tencodeValue,\n} from \"./compressedEncode.js\";\nimport type { EncodedChunkShape, EncodedFieldShape, EncodedValueShape } from \"./format.js\";\n\n/**\n * Encodes a node with the {@link EncodedNodeShape} shape.\n * @remarks\n * The fact this is also a Shape is an implementation detail of the encoder: that allows the shape it uses to be itself,\n * which is an easy way to keep all the related code together without extra objects.\n */\nexport class NodeShapeBasedEncoder extends Shape<EncodedChunkShape> implements NodeEncoder {\n\t/**\n\t * Set of keys for fields that are encoded using {@link NodeShapeBasedEncoder.specializedFieldEncoders}.\n\t * TODO: Ensure uniform chunks, encoding and identifier generation sort fields the same.\n\t */\n\tprivate readonly specializedFieldKeys: Set<FieldKey>;\n\n\tpublic constructor(\n\t\tpublic readonly type: undefined | TreeNodeSchemaIdentifier,\n\t\tpublic readonly value: EncodedValueShape,\n\t\t/**\n\t\t * Encoders for a specific set of fields, by key, in the order they will be encoded.\n\t\t * These are fields for which specialized encoding is provided as an optimization.\n\t\t * Using these for a given field instead of falling back to {@link NodeShapeBasedEncoder.specializedFieldEncoders} is often more efficient:\n\t\t * this avoids the need to explicitly include the key and shape in the encoded data for each node instance.\n\t\t * Instead, this information is here, and thus is encoded only once as part of the node shape.\n\t\t * These encoders will be used, even if the field they apply to is empty (which can add overhead for fields which are usually empty).\n\t\t *\n\t\t * Any fields not included here will be encoded using {@link NodeShapeBasedEncoder.otherFieldsEncoder}.\n\t\t * If {@link NodeShapeBasedEncoder.otherFieldsEncoder} is undefined, then this must handle all non-empty fields.\n\t\t */\n\t\tpublic readonly specializedFieldEncoders: readonly KeyedFieldEncoder[],\n\t\t/**\n\t\t * Encoder for all other fields that are not in {@link NodeShapeBasedEncoder.specializedFieldEncoders}. These fields must\n\t\t * be encoded after the specialized fields.\n\t\t */\n\t\tpublic readonly otherFieldsEncoder: undefined | FieldEncoder,\n\t) {\n\t\tsuper();\n\t\tthis.specializedFieldKeys = new Set(this.specializedFieldEncoders.map((f) => f.key));\n\t}\n\n\tprivate getValueToEncode(cursor: ITreeCursorSynchronous, context: EncoderContext): Value {\n\t\tif (this.value === 0) {\n\t\t\tassert(typeof cursor.value === \"string\", 0x9aa /* identifier must be type string */);\n\t\t\tif (isStableId(cursor.value)) {\n\t\t\t\tconst sessionSpaceCompressedId = context.idCompressor.tryRecompress(cursor.value);\n\t\t\t\tif (sessionSpaceCompressedId !== undefined) {\n\t\t\t\t\treturn context.idCompressor.normalizeToOpSpace(sessionSpaceCompressedId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cursor.value;\n\t}\n\n\tpublic encodeNode(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat<EncodedChunkShape>,\n\t): void {\n\t\tif (this.type === undefined) {\n\t\t\toutputBuffer.push(new IdentifierToken(cursor.type));\n\t\t} else {\n\t\t\tassert(cursor.type === this.type, 0x741 /* type must match shape */);\n\t\t}\n\t\tencodeValue(this.getValueToEncode(cursor, context), this.value, outputBuffer);\n\t\tfor (const fieldEncoder of this.specializedFieldEncoders) {\n\t\t\tcursor.enterField(brand(fieldEncoder.key));\n\t\t\tfieldEncoder.encoder.encodeField(cursor, context, outputBuffer);\n\t\t\tcursor.exitField();\n\t\t}\n\n\t\tconst otherFieldsBuffer: BufferFormat<EncodedChunkShape> = [];\n\n\t\tforEachField(cursor, () => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tif (!this.specializedFieldKeys.has(key)) {\n\t\t\t\tassert(\n\t\t\t\t\tthis.otherFieldsEncoder !== undefined,\n\t\t\t\t\t0x742 /* had extra local fields when shape does not support them */,\n\t\t\t\t);\n\t\t\t\totherFieldsBuffer.push(new IdentifierToken(key));\n\t\t\t\tthis.otherFieldsEncoder.encodeField(cursor, context, otherFieldsBuffer);\n\t\t\t}\n\t\t});\n\n\t\tif (this.otherFieldsEncoder !== undefined) {\n\t\t\toutputBuffer.push(otherFieldsBuffer);\n\t\t}\n\t}\n\n\tpublic encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape<EncodedChunkShape>>,\n\t): EncodedChunkShape {\n\t\treturn {\n\t\t\tc: {\n\t\t\t\ttype: encodeOptionalIdentifier(this.type, identifiers),\n\t\t\t\tvalue: this.value,\n\t\t\t\tfields: encodeFieldShapes(this.specializedFieldEncoders, identifiers, shapes),\n\t\t\t\textraFields: encodeOptionalFieldShape(this.otherFieldsEncoder, shapes),\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape<EncodedChunkShape>) => void,\n\t): void {\n\t\tif (this.type !== undefined) {\n\t\t\tidentifiers.add(this.type);\n\t\t}\n\n\t\tfor (const fieldEncoder of this.specializedFieldEncoders) {\n\t\t\tidentifiers.add(fieldEncoder.key);\n\t\t\tshapeDiscovered(fieldEncoder.encoder.shape);\n\t\t}\n\n\t\tif (this.otherFieldsEncoder !== undefined) {\n\t\t\tshapeDiscovered(this.otherFieldsEncoder.shape);\n\t\t}\n\t}\n\n\tpublic get shape(): Shape<EncodedChunkShape> {\n\t\treturn this;\n\t}\n}\n\nexport function encodeFieldShapes(\n\tfieldEncoders: readonly KeyedFieldEncoder[],\n\tidentifiers: DeduplicationTable<string>,\n\tshapes: DeduplicationTable<Shape<EncodedChunkShape>>,\n): EncodedFieldShape[] | undefined {\n\tif (fieldEncoders.length === 0) {\n\t\treturn undefined;\n\t}\n\treturn fieldEncoders.map((fieldEncoder) => [\n\t\t// key\n\t\tencodeIdentifier(fieldEncoder.key, identifiers),\n\t\t// shape\n\t\tshapes.valueToIndex.get(fieldEncoder.encoder.shape) ?? fail(0xb50 /* missing shape */),\n\t]);\n}\n\nfunction encodeIdentifier(\n\tidentifier: string,\n\tidentifiers: DeduplicationTable<string>,\n): string | number {\n\treturn identifiers.valueToIndex.get(identifier) ?? identifier;\n}\n\nfunction encodeOptionalIdentifier(\n\tidentifier: string | undefined,\n\tidentifiers: DeduplicationTable<string>,\n): string | number | undefined {\n\treturn identifier === undefined ? undefined : encodeIdentifier(identifier, identifiers);\n}\n\nfunction encodeOptionalFieldShape(\n\tencoder: FieldEncoder | undefined,\n\tshapes: DeduplicationTable<Shape<EncodedChunkShape>>,\n): number | undefined {\n\treturn encoder === undefined ? undefined : dedupShape(encoder.shape, shapes);\n}\n\nfunction dedupShape(\n\tshape: Shape<EncodedChunkShape>,\n\tshapes: DeduplicationTable<Shape<EncodedChunkShape>>,\n): number {\n\treturn shapes.valueToIndex.get(shape) ?? fail(0xb51 /* missing shape */);\n}\n"]}
1
+ {"version":3,"file":"nodeEncoder.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/nodeEncoder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AACnE,qEAAoE;AAEpE,qDAMgC;AAChC,qDAA+C;AAG/C,uEAAsF;AACtF,+DAM+B;AAO/B;;;;;GAKG;AACH,MAAa,qBACZ,SAAQ,+BAA8B;IAStC,YACiB,IAA0C,EAC1C,KAAwB;IACxC;;;;;;;;;;OAUG;IACa,wBAAsD;IACtE;;;OAGG;IACa,kBAA4C;QAE5D,KAAK,EAAE,CAAC;QApBQ,SAAI,GAAJ,IAAI,CAAsC;QAC1C,UAAK,GAAL,KAAK,CAAmB;QAYxB,6BAAwB,GAAxB,wBAAwB,CAA8B;QAKtD,uBAAkB,GAAlB,kBAAkB,CAA0B;QAG5D,IAAI,CAAC,oBAAoB,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACtF,CAAC;IAEO,gBAAgB,CAAC,MAA8B,EAAE,OAAuB;QAC/E,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC;YACtB,IAAA,iBAAM,EAAC,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE,KAAK,CAAC,oCAAoC,CAAC,CAAC;YACrF,IAAI,IAAA,qBAAU,EAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC9B,MAAM,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CA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ourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport { isStableId } from \"@fluidframework/id-compressor/internal\";\n\nimport {\n\ttype FieldKey,\n\ttype ITreeCursorSynchronous,\n\ttype TreeNodeSchemaIdentifier,\n\tforEachField,\n\ttype Value,\n} from \"../../../core/index.js\";\nimport { brand } from \"../../../util/index.js\";\n\nimport type { Counter, DeduplicationTable } from \"./chunkCodecUtilities.js\";\nimport { type BufferFormat, IdentifierToken, Shape } from \"./chunkEncodingGeneric.js\";\nimport {\n\ttype EncoderContext,\n\ttype FieldEncoder,\n\ttype KeyedFieldEncoder,\n\ttype NodeEncoder,\n\tencodeValue,\n} from \"./compressedEncode.js\";\nimport type {\n\tEncodedChunkShapeV1OrV2,\n\tEncodedFieldShape,\n\tEncodedValueShape,\n} from \"./format/index.js\";\n\n/**\n * Encodes a node with the {@link EncodedNodeShape} shape.\n * @remarks\n * The fact this is also a Shape is an implementation detail of the encoder: that allows the shape it uses to be itself,\n * which is an easy way to keep all the related code together without extra objects.\n */\nexport class NodeShapeBasedEncoder\n\textends Shape<EncodedChunkShapeV1OrV2>\n\timplements NodeEncoder\n{\n\t/**\n\t * Set of keys for fields that are encoded using {@link NodeShapeBasedEncoder.specializedFieldEncoders}.\n\t * TODO: Ensure uniform chunks, encoding and identifier generation sort fields the same.\n\t */\n\tprivate readonly specializedFieldKeys: Set<FieldKey>;\n\n\tpublic constructor(\n\t\tpublic readonly type: undefined | TreeNodeSchemaIdentifier,\n\t\tpublic readonly value: EncodedValueShape,\n\t\t/**\n\t\t * Encoders for a specific set of fields, by key, in the order they will be encoded.\n\t\t * These are fields for which specialized encoding is provided as an optimization.\n\t\t * Using these for a given field instead of falling back to {@link NodeShapeBasedEncoder.specializedFieldEncoders} is often more efficient:\n\t\t * this avoids the need to explicitly include the key and shape in the encoded data for each node instance.\n\t\t * Instead, this information is here, and thus is encoded only once as part of the node shape.\n\t\t * These encoders will be used, even if the field they apply to is empty (which can add overhead for fields which are usually empty).\n\t\t *\n\t\t * Any fields not included here will be encoded using {@link NodeShapeBasedEncoder.otherFieldsEncoder}.\n\t\t * If {@link NodeShapeBasedEncoder.otherFieldsEncoder} is undefined, then this must handle all non-empty fields.\n\t\t */\n\t\tpublic readonly specializedFieldEncoders: readonly KeyedFieldEncoder[],\n\t\t/**\n\t\t * Encoder for all other fields that are not in {@link NodeShapeBasedEncoder.specializedFieldEncoders}. These fields must\n\t\t * be encoded after the specialized fields.\n\t\t */\n\t\tpublic readonly otherFieldsEncoder: undefined | FieldEncoder,\n\t) {\n\t\tsuper();\n\t\tthis.specializedFieldKeys = new Set(this.specializedFieldEncoders.map((f) => f.key));\n\t}\n\n\tprivate getValueToEncode(cursor: ITreeCursorSynchronous, context: EncoderContext): Value {\n\t\tif (this.value === 0) {\n\t\t\tassert(typeof cursor.value === \"string\", 0x9aa /* identifier must be type string */);\n\t\t\tif (isStableId(cursor.value)) {\n\t\t\t\tconst sessionSpaceCompressedId = context.idCompressor.tryRecompress(cursor.value);\n\t\t\t\tif (sessionSpaceCompressedId !== undefined) {\n\t\t\t\t\treturn context.idCompressor.normalizeToOpSpace(sessionSpaceCompressedId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cursor.value;\n\t}\n\n\tpublic encodeNode(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat<EncodedChunkShapeV1OrV2>,\n\t): void {\n\t\tif (this.type === undefined) {\n\t\t\toutputBuffer.push(new IdentifierToken(cursor.type));\n\t\t} else {\n\t\t\tassert(cursor.type === this.type, 0x741 /* type must match shape */);\n\t\t}\n\t\tencodeValue(this.getValueToEncode(cursor, context), this.value, outputBuffer);\n\t\tfor (const fieldEncoder of this.specializedFieldEncoders) {\n\t\t\tcursor.enterField(brand(fieldEncoder.key));\n\t\t\tfieldEncoder.encoder.encodeField(cursor, context, outputBuffer);\n\t\t\tcursor.exitField();\n\t\t}\n\n\t\tconst otherFieldsBuffer: BufferFormat<EncodedChunkShapeV1OrV2> = [];\n\n\t\tforEachField(cursor, () => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tif (!this.specializedFieldKeys.has(key)) {\n\t\t\t\tassert(\n\t\t\t\t\tthis.otherFieldsEncoder !== undefined,\n\t\t\t\t\t0x742 /* had extra local fields when shape does not support them */,\n\t\t\t\t);\n\t\t\t\totherFieldsBuffer.push(new IdentifierToken(key));\n\t\t\t\tthis.otherFieldsEncoder.encodeField(cursor, context, otherFieldsBuffer);\n\t\t\t}\n\t\t});\n\n\t\tif (this.otherFieldsEncoder !== undefined) {\n\t\t\toutputBuffer.push(otherFieldsBuffer);\n\t\t}\n\t}\n\n\tpublic encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>,\n\t): EncodedChunkShapeV1OrV2 {\n\t\treturn {\n\t\t\tc: {\n\t\t\t\ttype: encodeOptionalIdentifier(this.type, identifiers),\n\t\t\t\tvalue: this.value,\n\t\t\t\tfields: encodeFieldShapes(this.specializedFieldEncoders, identifiers, shapes),\n\t\t\t\textraFields: encodeOptionalFieldShape(this.otherFieldsEncoder, shapes),\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape<EncodedChunkShapeV1OrV2>) => void,\n\t): void {\n\t\tif (this.type !== undefined) {\n\t\t\tidentifiers.add(this.type);\n\t\t}\n\n\t\tfor (const fieldEncoder of this.specializedFieldEncoders) {\n\t\t\tidentifiers.add(fieldEncoder.key);\n\t\t\tshapeDiscovered(fieldEncoder.encoder.shape);\n\t\t}\n\n\t\tif (this.otherFieldsEncoder !== undefined) {\n\t\t\tshapeDiscovered(this.otherFieldsEncoder.shape);\n\t\t}\n\t}\n\n\tpublic get shape(): Shape<EncodedChunkShapeV1OrV2> {\n\t\treturn this;\n\t}\n}\n\nexport function encodeFieldShapes(\n\tfieldEncoders: readonly KeyedFieldEncoder[],\n\tidentifiers: DeduplicationTable<string>,\n\tshapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>,\n): EncodedFieldShape[] | undefined {\n\tif (fieldEncoders.length === 0) {\n\t\treturn undefined;\n\t}\n\treturn fieldEncoders.map((fieldEncoder) => [\n\t\t// key\n\t\tencodeIdentifier(fieldEncoder.key, identifiers),\n\t\t// shape\n\t\tshapes.valueToIndex.get(fieldEncoder.encoder.shape) ?? fail(0xb50 /* missing shape */),\n\t]);\n}\n\nfunction encodeIdentifier(\n\tidentifier: string,\n\tidentifiers: DeduplicationTable<string>,\n): string | number {\n\treturn identifiers.valueToIndex.get(identifier) ?? identifier;\n}\n\nfunction encodeOptionalIdentifier(\n\tidentifier: string | undefined,\n\tidentifiers: DeduplicationTable<string>,\n): string | number | undefined {\n\treturn identifier === undefined ? undefined : encodeIdentifier(identifier, identifiers);\n}\n\nfunction encodeOptionalFieldShape(\n\tencoder: FieldEncoder | undefined,\n\tshapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>,\n): number | undefined {\n\treturn encoder === undefined ? undefined : dedupShape(encoder.shape, shapes);\n}\n\nfunction dedupShape(\n\tshape: Shape<EncodedChunkShapeV1OrV2>,\n\tshapes: DeduplicationTable<Shape<EncodedChunkShapeV1OrV2>>,\n): number {\n\treturn shapes.valueToIndex.get(shape) ?? fail(0xb51 /* missing shape */);\n}\n"]}
@@ -7,7 +7,7 @@ import { type StoredSchemaCollection, type TreeFieldStoredSchema, type TreeNodeS
7
7
  import type { IncrementalEncoder } from "./codecs.js";
8
8
  import { EncoderContext, type FieldEncoder, type FieldEncodeBuilder, type NodeEncodeBuilder } from "./compressedEncode.js";
9
9
  import type { FieldBatch } from "./fieldBatch.js";
10
- import { type EncodedFieldBatchV1, type EncodedFieldBatchV2, FieldBatchFormatVersion } from "./format.js";
10
+ import { type EncodedFieldBatchV1, type EncodedFieldBatchV2, FieldBatchFormatVersion } from "./format/index.js";
11
11
  import { NodeShapeBasedEncoder } from "./nodeEncoder.js";
12
12
  /**
13
13
  * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
@@ -1 +1 @@
1
- {"version":3,"file":"schemaBasedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAIN,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAI7B,KAAK,YAAY,EACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACN,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EAKtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAEN,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAExB,uBAAuB,EAEvB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,sBAAsB,EAC9B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,aAAa,GACzB,mBAAmB,CASrB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,sBAAsB,EAC9B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,aAAa,EAC3B,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,GAChD,mBAAmB,CASrB;AA0BD,wBAAgB,YAAY,CAC3B,YAAY,EAAE,sBAAsB,EACpC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,aAAa,EAC3B,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,EAClD,OAAO,EAAE,uBAAuB,GAC9B,cAAc,CAYhB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,WAAW,EAAE,iBAAiB,EAC9B,KAAK,EAAE,qBAAqB,EAC5B,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,sBAAsB,GAClC,YAAY,CA8Bd;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,YAAY,EAAE,kBAAkB,EAChC,YAAY,EAAE,sBAAsB,EACpC,UAAU,EAAE,wBAAwB,EACpC,kBAAkB,CAAC,EAAE,kBAAkB,GACrC,qBAAqB,CA4CvB"}
1
+ {"version":3,"file":"schemaBasedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAIN,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAI7B,KAAK,YAAY,EACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACN,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EAKtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACN,KAAK,mBAAmB,EAExB,KAAK,mBAAmB,EAExB,uBAAuB,EAEvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,sBAAsB,EAC9B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,aAAa,GACzB,mBAAmB,CAWrB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,sBAAsB,EAC9B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,aAAa,EAC3B,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,GAChD,mBAAmB,CASrB;AA0BD,wBAAgB,YAAY,CAC3B,YAAY,EAAE,sBAAsB,EACpC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,aAAa,EAC3B,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,EAClD,OAAO,EAAE,uBAAuB,GAC9B,cAAc,CAYhB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,WAAW,EAAE,iBAAiB,EAC9B,KAAK,EAAE,qBAAqB,EAC5B,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,sBAAsB,GAClC,YAAY,CA8Bd;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,YAAY,EAAE,kBAAkB,EAChC,YAAY,EAAE,sBAAsB,EACpC,UAAU,EAAE,wBAAwB,EACpC,kBAAkB,CAAC,EAAE,kBAAkB,GACrC,qBAAqB,CA4CvB"}
@@ -9,7 +9,7 @@ const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../../core/index.js");
10
10
  const index_js_2 = require("../../../util/index.js");
11
11
  const compressedEncode_js_1 = require("./compressedEncode.js");
12
- const format_js_1 = require("./format.js");
12
+ const index_js_3 = require("./format/index.js");
13
13
  const incrementalEncodingPolicy_js_1 = require("./incrementalEncodingPolicy.js");
14
14
  const nodeEncoder_js_1 = require("./nodeEncoder.js");
15
15
  /**
@@ -18,7 +18,9 @@ const nodeEncoder_js_1 = require("./nodeEncoder.js");
18
18
  * This version does not support incremental encoding.
19
19
  */
20
20
  function schemaCompressedEncodeV1(schema, policy, fieldBatch, idCompressor) {
21
- return schemaCompressedEncode(schema, policy, fieldBatch, idCompressor, undefined /* incrementalEncoder */, (0, index_js_2.brand)(format_js_1.FieldBatchFormatVersion.v1));
21
+ const encoded = schemaCompressedEncode(schema, policy, fieldBatch, idCompressor, undefined /* incrementalEncoder */, (0, index_js_2.brand)(index_js_3.FieldBatchFormatVersion.v1));
22
+ // Since incrementalEncoder was not provided, no V2 features should be used, and this cast should be safe.
23
+ return encoded;
22
24
  }
23
25
  exports.schemaCompressedEncodeV1 = schemaCompressedEncodeV1;
24
26
  /**
@@ -27,7 +29,7 @@ exports.schemaCompressedEncodeV1 = schemaCompressedEncodeV1;
27
29
  * Incremental encoding is supported from this version onwards.
28
30
  */
29
31
  function schemaCompressedEncodeV2(schema, policy, fieldBatch, idCompressor, incrementalEncoder) {
30
- return schemaCompressedEncode(schema, policy, fieldBatch, idCompressor, incrementalEncoder, (0, index_js_2.brand)(format_js_1.FieldBatchFormatVersion.v2));
32
+ return schemaCompressedEncode(schema, policy, fieldBatch, idCompressor, incrementalEncoder, (0, index_js_2.brand)(index_js_3.FieldBatchFormatVersion.v2));
31
33
  }
32
34
  exports.schemaCompressedEncodeV2 = schemaCompressedEncodeV2;
33
35
  /**
@@ -62,7 +64,7 @@ function getFieldEncoder(nodeBuilder, field, context, storedSchema) {
62
64
  (0, internal_1.assert)(nodeSchema !== undefined, 0x99a /* nodeSchema must be defined */);
63
65
  (0, internal_1.assert)(nodeSchema instanceof index_js_1.LeafNodeStoredSchema, 0x99b /* nodeSchema must be LeafNodeStoredSchema */);
64
66
  (0, internal_1.assert)(nodeSchema.leafValue === index_js_1.ValueSchema.String, 0x99c /* identifier field can only be type string */);
65
- const identifierNodeEncoder = new nodeEncoder_js_1.NodeShapeBasedEncoder(type, format_js_1.SpecialField.Identifier, [], undefined);
67
+ const identifierNodeEncoder = new nodeEncoder_js_1.NodeShapeBasedEncoder(type, index_js_3.SpecialField.Identifier, [], undefined);
66
68
  return (0, compressedEncode_js_1.asFieldEncoder)(identifierNodeEncoder);
67
69
  }
68
70
  return (0, compressedEncode_js_1.asFieldEncoder)(nodeEncoder);
@@ -1 +1 @@
1
- {"version":3,"file":"schemaBasedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,qDAWgC;AAChC,qDAAgE;AAGhE,+DAU+B;AAE/B,2CAOqB;AACrB,iFAAkF;AAClF,qDAAyD;AAEzD;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B;IAE3B,OAAO,sBAAsB,CAC5B,MAAM,EACN,MAAM,EACN,UAAU,EACV,YAAY,EACZ,SAAS,CAAC,wBAAwB,EAClC,IAAA,gBAAK,EAAC,mCAAuB,CAAC,EAAE,CAAC,CACjC,CAAC;AACH,CAAC;AAdD,4DAcC;AAED;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B,EAC3B,kBAAkD;IAElD,OAAO,sBAAsB,CAC5B,MAAM,EACN,MAAM,EACN,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,IAAA,gBAAK,EAAC,mCAAuB,CAAC,EAAE,CAAC,CACjC,CAAC;AACH,CAAC;AAfD,4DAeC;AAED;;;;;;;;;GASG;AACH,SAAS,sBAAsB,CAC9B,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B,EAC3B,kBAAkD,EAClD,OAAgC;IAEhC,OAAO,IAAA,sCAAgB,EACtB,UAAU,EACV,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,OAAO,CAAC,CACvE,CAAC;AACH,CAAC;AAED,SAAgB,YAAY,CAC3B,YAAoC,EACpC,MAAoB,EACpB,YAA2B,EAC3B,kBAAkD,EAClD,OAAgC;IAEhC,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AC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,IAAA,0BAAe,EAAC,MAAM,CAAC,CAAC;QACzB,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\tValueSchema,\n\tMultiplicity,\n\tidentifierFieldKindIdentifier,\n\ttype SchemaPolicy,\n} from \"../../../core/index.js\";\nimport { brand, oneFromIterable } from \"../../../util/index.js\";\n\nimport type { IncrementalEncoder } from \"./codecs.js\";\nimport {\n\tEncoderContext,\n\ttype FieldEncoder,\n\ttype FieldEncodeBuilder,\n\ttype KeyedFieldEncoder,\n\ttype NodeEncodeBuilder,\n\tanyNodeEncoder,\n\tasFieldEncoder,\n\tcompressedEncode,\n\tincrementalFieldEncoder,\n} from \"./compressedEncode.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\ttype EncodedFieldBatch,\n\ttype EncodedFieldBatchV1,\n\ttype EncodedFieldBatchV2,\n\ttype EncodedValueShape,\n\tFieldBatchFormatVersion,\n\tSpecialField,\n} from \"./format.js\";\nimport { defaultIncrementalEncodingPolicy } from \"./incrementalEncodingPolicy.js\";\nimport { NodeShapeBasedEncoder } from \"./nodeEncoder.js\";\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * This version does not support incremental encoding.\n */\nexport function schemaCompressedEncodeV1(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n): EncodedFieldBatchV1 {\n\treturn schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tundefined /* incrementalEncoder */,\n\t\tbrand(FieldBatchFormatVersion.v1),\n\t);\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * Incremental encoding is supported from this version onwards.\n */\nexport function schemaCompressedEncodeV2(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n): EncodedFieldBatchV2 {\n\treturn schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tbrand(FieldBatchFormatVersion.v2),\n\t);\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk`.\n * @remarks\n * If `incrementalEncoder` is provided,\n * fields that support incremental encoding will encode their chunks separately via the `incrementalEncoder`.\n * See {@link IncrementalEncoder} for more details.\n *\n * Optimized for encoded size and encoding performance.\n * TODO: This function should eventually also take in the root FieldSchema to more efficiently compress the nodes.\n */\nfunction schemaCompressedEncode(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncodedFieldBatch {\n\treturn compressedEncode(\n\t\tfieldBatch,\n\t\tbuildContext(schema, policy, idCompressor, incrementalEncoder, version),\n\t);\n}\n\nexport function buildContext(\n\tstoredSchema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncoderContext {\n\tconst context: EncoderContext = new EncoderContext(\n\t\t(fieldBuilder: FieldEncodeBuilder, schemaName: TreeNodeSchemaIdentifier) =>\n\t\t\tgetNodeEncoder(fieldBuilder, storedSchema, schemaName, incrementalEncoder),\n\t\t(nodeBuilder: NodeEncodeBuilder, fieldSchema: TreeFieldStoredSchema) =>\n\t\t\tgetFieldEncoder(nodeBuilder, fieldSchema, context, storedSchema),\n\t\tpolicy.fieldKinds,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tversion,\n\t);\n\treturn context;\n}\n\n/**\n * Selects an encoder to use to encode fields.\n */\nexport function getFieldEncoder(\n\tnodeBuilder: NodeEncodeBuilder,\n\tfield: TreeFieldStoredSchema,\n\tcontext: EncoderContext,\n\tstoredSchema: StoredSchemaCollection,\n): FieldEncoder {\n\tconst kind = context.fieldShapes.get(field.kind) ?? fail(0xb52 /* missing FieldKind */);\n\tconst type = oneFromIterable(field.types);\n\tconst nodeEncoder =\n\t\ttype === undefined ? anyNodeEncoder : nodeBuilder.nodeEncoderFromSchema(type);\n\tif (kind.multiplicity === Multiplicity.Single) {\n\t\tif (field.kind === identifierFieldKindIdentifier) {\n\t\t\tassert(type !== undefined, 0x999 /* field type must be defined in identifier field */);\n\t\t\tconst nodeSchema = storedSchema.nodeSchema.get(type);\n\t\t\tassert(nodeSchema !== undefined, 0x99a /* nodeSchema must be defined */);\n\t\t\tassert(\n\t\t\t\tnodeSchema instanceof LeafNodeStoredSchema,\n\t\t\t\t0x99b /* nodeSchema must be LeafNodeStoredSchema */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tnodeSchema.leafValue === ValueSchema.String,\n\t\t\t\t0x99c /* identifier field can only be type string */,\n\t\t\t);\n\t\t\tconst identifierNodeEncoder = new NodeShapeBasedEncoder(\n\t\t\t\ttype,\n\t\t\t\tSpecialField.Identifier,\n\t\t\t\t[],\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\treturn asFieldEncoder(identifierNodeEncoder);\n\t\t}\n\t\treturn asFieldEncoder(nodeEncoder);\n\t} else {\n\t\treturn context.nestedArrayEncoder(nodeEncoder);\n\t}\n}\n\n/**\n * Selects an encoder to use to encode nodes.\n */\nexport function getNodeEncoder(\n\tfieldBuilder: FieldEncodeBuilder,\n\tstoredSchema: StoredSchemaCollection,\n\tschemaName: TreeNodeSchemaIdentifier,\n\tincrementalEncoder?: IncrementalEncoder,\n): NodeShapeBasedEncoder {\n\tconst shouldEncodeIncrementally =\n\t\tincrementalEncoder?.shouldEncodeIncrementally ?? defaultIncrementalEncodingPolicy;\n\tconst schema =\n\t\tstoredSchema.nodeSchema.get(schemaName) ?? fail(0xb53 /* missing node schema */);\n\n\t// This handles both object and array nodes.\n\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t// TODO:Performance:\n\t\t// consider moving some optional and sequence fields to extra fields if they are commonly empty\n\t\t// to reduce encoded size.\n\t\tconst objectNodeFields: KeyedFieldEncoder[] = [];\n\t\tfor (const [key, field] of schema.objectNodeFields ?? []) {\n\t\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName, key)\n\t\t\t\t? incrementalFieldEncoder\n\t\t\t\t: fieldBuilder.fieldEncoderFromSchema(field);\n\t\t\tobjectNodeFields.push({\n\t\t\t\tkey,\n\t\t\t\tencoder: fieldEncoder,\n\t\t\t});\n\t\t}\n\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, objectNodeFields, undefined);\n\t\treturn shape;\n\t}\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tconst shape = new NodeShapeBasedEncoder(\n\t\t\tschemaName,\n\t\t\tvalueShapeFromSchema(schema.leafValue),\n\t\t\t[],\n\t\t\tundefined,\n\t\t);\n\t\treturn shape;\n\t}\n\n\t// This handles both maps and record nodes.\n\tif (schema instanceof MapNodeStoredSchema) {\n\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName)\n\t\t\t? incrementalFieldEncoder\n\t\t\t: fieldBuilder.fieldEncoderFromSchema(schema.mapFields);\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, [], fieldEncoder);\n\t\treturn shape;\n\t}\n\tfail(0xb54 /* unsupported node kind */);\n}\n\nfunction valueShapeFromSchema(schema: ValueSchema | undefined): undefined | EncodedValueShape {\n\tswitch (schema) {\n\t\tcase undefined: {\n\t\t\treturn false;\n\t\t}\n\t\tcase ValueSchema.Number:\n\t\tcase ValueSchema.String:\n\t\tcase ValueSchema.Boolean:\n\t\tcase ValueSchema.FluidHandle: {\n\t\t\treturn true;\n\t\t}\n\t\tcase ValueSchema.Null: {\n\t\t\treturn [null];\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(schema);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"schemaBasedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,qDAWgC;AAChC,qDAAgE;AAGhE,+DAU+B;AAE/B,gDAO2B;AAC3B,iFAAkF;AAClF,qDAAyD;AAEzD;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B;IAE3B,MAAM,OAAO,GAA4B,sBAAsB,CAC9D,MAAM,EACN,MAAM,EACN,UAAU,EACV,YAAY,EACZ,SAAS,CAAC,wBAAwB,EAClC,IAAA,gBAAK,EAAC,kCAAuB,CAAC,EAAE,CAAC,CACjC,CAAC;IACF,0GAA0G;IAC1G,OAAO,OAA8B,CAAC;AACvC,CAAC;AAhBD,4DAgBC;AAED;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B,EAC3B,kBAAkD;IAElD,OAAO,sBAAsB,CAC5B,MAAM,EACN,MAAM,EACN,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,IAAA,gBAAK,EAAC,kCAAuB,CAAC,EAAE,CAAC,CACjC,CAAC;AACH,CAAC;AAfD,4DAe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AC;QAChB,KAAK,SAAS,CAAC,CAAC,CAAC;YAChB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,KAAK,sBAAW,CAAC,MAAM,CAAC;QACxB,KAAK,sBAAW,CAAC,MAAM,CAAC;QACxB,KAAK,sBAAW,CAAC,OAAO,CAAC;QACzB,KAAK,sBAAW,CAAC,WAAW,CAAC,CAAC,CAAC;YAC9B,OAAO,IAAI,CAAC;QACb,CAAC;QACD,KAAK,sBAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,CAAC;QACf,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,IAAA,0BAAe,EAAC,MAAM,CAAC,CAAC;QACzB,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\tValueSchema,\n\tMultiplicity,\n\tidentifierFieldKindIdentifier,\n\ttype SchemaPolicy,\n} from \"../../../core/index.js\";\nimport { brand, oneFromIterable } from \"../../../util/index.js\";\n\nimport type { IncrementalEncoder } from \"./codecs.js\";\nimport {\n\tEncoderContext,\n\ttype FieldEncoder,\n\ttype FieldEncodeBuilder,\n\ttype KeyedFieldEncoder,\n\ttype NodeEncodeBuilder,\n\tanyNodeEncoder,\n\tasFieldEncoder,\n\tcompressedEncode,\n\tincrementalFieldEncoder,\n} from \"./compressedEncode.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\ttype EncodedFieldBatchV1,\n\ttype EncodedFieldBatchV1OrV2,\n\ttype EncodedFieldBatchV2,\n\ttype EncodedValueShape,\n\tFieldBatchFormatVersion,\n\tSpecialField,\n} from \"./format/index.js\";\nimport { defaultIncrementalEncodingPolicy } from \"./incrementalEncodingPolicy.js\";\nimport { NodeShapeBasedEncoder } from \"./nodeEncoder.js\";\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * This version does not support incremental encoding.\n */\nexport function schemaCompressedEncodeV1(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n): EncodedFieldBatchV1 {\n\tconst encoded: EncodedFieldBatchV1OrV2 = schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tundefined /* incrementalEncoder */,\n\t\tbrand(FieldBatchFormatVersion.v1),\n\t);\n\t// Since incrementalEncoder was not provided, no V2 features should be used, and this cast should be safe.\n\treturn encoded as EncodedFieldBatchV1;\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * Incremental encoding is supported from this version onwards.\n */\nexport function schemaCompressedEncodeV2(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n): EncodedFieldBatchV2 {\n\treturn schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tbrand(FieldBatchFormatVersion.v2),\n\t);\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk`.\n * @remarks\n * If `incrementalEncoder` is provided,\n * fields that support incremental encoding will encode their chunks separately via the `incrementalEncoder`.\n * See {@link IncrementalEncoder} for more details.\n *\n * Optimized for encoded size and encoding performance.\n * TODO: This function should eventually also take in the root FieldSchema to more efficiently compress the nodes.\n */\nfunction schemaCompressedEncode(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncodedFieldBatchV1OrV2 {\n\treturn compressedEncode(\n\t\tfieldBatch,\n\t\tbuildContext(schema, policy, idCompressor, incrementalEncoder, version),\n\t);\n}\n\nexport function buildContext(\n\tstoredSchema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncoderContext {\n\tconst context: EncoderContext = new EncoderContext(\n\t\t(fieldBuilder: FieldEncodeBuilder, schemaName: TreeNodeSchemaIdentifier) =>\n\t\t\tgetNodeEncoder(fieldBuilder, storedSchema, schemaName, incrementalEncoder),\n\t\t(nodeBuilder: NodeEncodeBuilder, fieldSchema: TreeFieldStoredSchema) =>\n\t\t\tgetFieldEncoder(nodeBuilder, fieldSchema, context, storedSchema),\n\t\tpolicy.fieldKinds,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tversion,\n\t);\n\treturn context;\n}\n\n/**\n * Selects an encoder to use to encode fields.\n */\nexport function getFieldEncoder(\n\tnodeBuilder: NodeEncodeBuilder,\n\tfield: TreeFieldStoredSchema,\n\tcontext: EncoderContext,\n\tstoredSchema: StoredSchemaCollection,\n): FieldEncoder {\n\tconst kind = context.fieldShapes.get(field.kind) ?? fail(0xb52 /* missing FieldKind */);\n\tconst type = oneFromIterable(field.types);\n\tconst nodeEncoder =\n\t\ttype === undefined ? anyNodeEncoder : nodeBuilder.nodeEncoderFromSchema(type);\n\tif (kind.multiplicity === Multiplicity.Single) {\n\t\tif (field.kind === identifierFieldKindIdentifier) {\n\t\t\tassert(type !== undefined, 0x999 /* field type must be defined in identifier field */);\n\t\t\tconst nodeSchema = storedSchema.nodeSchema.get(type);\n\t\t\tassert(nodeSchema !== undefined, 0x99a /* nodeSchema must be defined */);\n\t\t\tassert(\n\t\t\t\tnodeSchema instanceof LeafNodeStoredSchema,\n\t\t\t\t0x99b /* nodeSchema must be LeafNodeStoredSchema */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tnodeSchema.leafValue === ValueSchema.String,\n\t\t\t\t0x99c /* identifier field can only be type string */,\n\t\t\t);\n\t\t\tconst identifierNodeEncoder = new NodeShapeBasedEncoder(\n\t\t\t\ttype,\n\t\t\t\tSpecialField.Identifier,\n\t\t\t\t[],\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\treturn asFieldEncoder(identifierNodeEncoder);\n\t\t}\n\t\treturn asFieldEncoder(nodeEncoder);\n\t} else {\n\t\treturn context.nestedArrayEncoder(nodeEncoder);\n\t}\n}\n\n/**\n * Selects an encoder to use to encode nodes.\n */\nexport function getNodeEncoder(\n\tfieldBuilder: FieldEncodeBuilder,\n\tstoredSchema: StoredSchemaCollection,\n\tschemaName: TreeNodeSchemaIdentifier,\n\tincrementalEncoder?: IncrementalEncoder,\n): NodeShapeBasedEncoder {\n\tconst shouldEncodeIncrementally =\n\t\tincrementalEncoder?.shouldEncodeIncrementally ?? defaultIncrementalEncodingPolicy;\n\tconst schema =\n\t\tstoredSchema.nodeSchema.get(schemaName) ?? fail(0xb53 /* missing node schema */);\n\n\t// This handles both object and array nodes.\n\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t// TODO:Performance:\n\t\t// consider moving some optional and sequence fields to extra fields if they are commonly empty\n\t\t// to reduce encoded size.\n\t\tconst objectNodeFields: KeyedFieldEncoder[] = [];\n\t\tfor (const [key, field] of schema.objectNodeFields ?? []) {\n\t\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName, key)\n\t\t\t\t? incrementalFieldEncoder\n\t\t\t\t: fieldBuilder.fieldEncoderFromSchema(field);\n\t\t\tobjectNodeFields.push({\n\t\t\t\tkey,\n\t\t\t\tencoder: fieldEncoder,\n\t\t\t});\n\t\t}\n\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, objectNodeFields, undefined);\n\t\treturn shape;\n\t}\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tconst shape = new NodeShapeBasedEncoder(\n\t\t\tschemaName,\n\t\t\tvalueShapeFromSchema(schema.leafValue),\n\t\t\t[],\n\t\t\tundefined,\n\t\t);\n\t\treturn shape;\n\t}\n\n\t// This handles both maps and record nodes.\n\tif (schema instanceof MapNodeStoredSchema) {\n\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName)\n\t\t\t? incrementalFieldEncoder\n\t\t\t: fieldBuilder.fieldEncoderFromSchema(schema.mapFields);\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, [], fieldEncoder);\n\t\treturn shape;\n\t}\n\tfail(0xb54 /* unsupported node kind */);\n}\n\nfunction valueShapeFromSchema(schema: ValueSchema | undefined): undefined | EncodedValueShape {\n\tswitch (schema) {\n\t\tcase undefined: {\n\t\t\treturn false;\n\t\t}\n\t\tcase ValueSchema.Number:\n\t\tcase ValueSchema.String:\n\t\tcase ValueSchema.Boolean:\n\t\tcase ValueSchema.FluidHandle: {\n\t\t\treturn true;\n\t\t}\n\t\tcase ValueSchema.Null: {\n\t\t\treturn [null];\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(schema);\n\t\t}\n\t}\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { FieldBatch } from "./fieldBatch.js";
6
- import { type EncodedFieldBatchV1, type EncodedFieldBatchV2 } from "./format.js";
6
+ import type { EncodedFieldBatchV1, EncodedFieldBatchV2 } from "./format/index.js";
7
7
  /**
8
8
  * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
9
9
  * @remarks See {@link uncompressedEncode} for more details.
@@ -1 +1 @@
1
- {"version":3,"file":"uncompressedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAGN,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAGxB,MAAM,aAAa,CAAC;AAGrB;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAE3E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAE3E"}
1
+ {"version":3,"file":"uncompressedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACX,mBAAmB,EAEnB,mBAAmB,EAInB,MAAM,mBAAmB,CAAC;AAG3B;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAE3E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAE3E"}
@@ -7,13 +7,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.uncompressedEncodeV2 = exports.uncompressedEncodeV1 = void 0;
8
8
  const index_js_1 = require("../../../core/index.js");
9
9
  const index_js_2 = require("../../../util/index.js");
10
- const format_js_1 = require("./format.js");
10
+ const index_js_3 = require("./format/index.js");
11
11
  /**
12
12
  * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
13
13
  * @remarks See {@link uncompressedEncode} for more details.
14
14
  */
15
15
  function uncompressedEncodeV1(batch) {
16
- return uncompressedEncode(batch, (0, index_js_2.brand)(format_js_1.FieldBatchFormatVersion.v1));
16
+ return uncompressedEncode(batch, (0, index_js_2.brand)(index_js_3.FieldBatchFormatVersion.v1));
17
17
  }
18
18
  exports.uncompressedEncodeV1 = uncompressedEncodeV1;
19
19
  /**
@@ -21,7 +21,7 @@ exports.uncompressedEncodeV1 = uncompressedEncodeV1;
21
21
  * @remarks See {@link uncompressedEncode} for more details.
22
22
  */
23
23
  function uncompressedEncodeV2(batch) {
24
- return uncompressedEncode(batch, (0, index_js_2.brand)(format_js_1.FieldBatchFormatVersion.v2));
24
+ return uncompressedEncode(batch, (0, index_js_2.brand)(index_js_3.FieldBatchFormatVersion.v2));
25
25
  }
26
26
  exports.uncompressedEncodeV2 = uncompressedEncodeV2;
27
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"uncompressedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAIgC;AAChC,qDAA+C;AAI/C,2CAOqB;AAGrB;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAiB;IACrD,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAA,gBAAK,EAAC,mCAAuB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,oDAEC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAiB;IACrD,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAA,gBAAK,EAAC,mCAAuB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,oDAEC;AAED;;;;;;;GAOG;AACH,SAAS,kBAAkB,CAC1B,KAAiB,EACjB,OAAgC;IAEhC,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC7C,OAAO;QACN,OAAO;QACP,WAAW,EAAE,EAAE;QACf,4CAA4C;QAC5C,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC9C,mFAAmF;QACnF,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;KAClD,CAAC;AACH,CAAC;AAED,MAAM,SAAS,GAAe,CAAC,CAAC;AAChC,MAAM,UAAU,GAAe,CAAC,CAAC;AAEjC,MAAM,YAAY,GAAqB;IACtC,WAAW,EAAE,UAAU;CACvB,CAAC;AAEF,MAAM,QAAQ,GAA4B,SAAS,CAAC;AAEpD;;;;;GAKG;AACH,SAAS,cAAc,CAAC,MAA8B;IACrD,MAAM,IAAI,GAAgC,EAAE,CAAC;IAC7C,IAAA,sBAAW,EAAC,MAAM,EAAE,GAAG,EAAE;QACxB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,KAAK,GAAgC,EAAE,CAAC;QAC9C,IAAA,uBAAY,EAAC,MAAM,EAAE,GAAG,EAAE;YACzB,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype ITreeCursorSynchronous,\n\tforEachField,\n\tforEachNode,\n} from \"../../../core/index.js\";\nimport { brand } from \"../../../util/index.js\";\nimport type { FluidSerializableReadOnly } from \"../../valueUtilities.js\";\n\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\tFieldBatchFormatVersion,\n\ttype EncodedFieldBatch,\n\ttype EncodedFieldBatchV1,\n\ttype EncodedFieldBatchV2,\n\ttype EncodedNestedArrayShape,\n\ttype EncodedNodeShape,\n} from \"./format.js\";\nimport type { ShapeIndex } from \"./formatGeneric.js\";\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.\n * @remarks See {@link uncompressedEncode} for more details.\n */\nexport function uncompressedEncodeV1(batch: FieldBatch): EncodedFieldBatchV1 {\n\treturn uncompressedEncode(batch, brand(FieldBatchFormatVersion.v1));\n}\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.\n * @remarks See {@link uncompressedEncode} for more details.\n */\nexport function uncompressedEncodeV2(batch: FieldBatch): EncodedFieldBatchV2 {\n\treturn uncompressedEncode(batch, brand(FieldBatchFormatVersion.v2));\n}\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk`.\n *\n * No polymorphism, identifier deduplication or schema based compression.\n * Just uses two hard coded shapes and inline identifiers.\n *\n * This is intended as a simple reference implementation with minimal code and dependencies.\n */\nfunction uncompressedEncode(\n\tbatch: FieldBatch,\n\tversion: FieldBatchFormatVersion,\n): EncodedFieldBatch {\n\tconst rootFields = batch.map(encodeSequence);\n\treturn {\n\t\tversion,\n\t\tidentifiers: [],\n\t\t// A single shape used to encode all fields.\n\t\tshapes: [{ c: anyNodeShape }, { a: anyArray }],\n\t\t// Wrap up each field as an indicator to use the above shape, and its encoded data.\n\t\tdata: rootFields.map((data) => [arrayIndex, data]),\n\t};\n}\n\nconst treeIndex: ShapeIndex = 0;\nconst arrayIndex: ShapeIndex = 1;\n\nconst anyNodeShape: EncodedNodeShape = {\n\textraFields: arrayIndex,\n};\n\nconst anyArray: EncodedNestedArrayShape = treeIndex;\n\n/**\n * Encode a field using the hard coded shape above.\n * @remarks\n * Since this shape contains no information about the actual schema, all schema/shape information is inline in the data:\n * that is why this encoding is called \"uncompressed\".\n */\nfunction encodeSequence(cursor: ITreeCursorSynchronous): FluidSerializableReadOnly[] {\n\tconst data: FluidSerializableReadOnly[] = [];\n\tforEachNode(cursor, () => {\n\t\tdata.push(cursor.type);\n\t\tconst value = cursor.value;\n\t\tdata.push(value !== undefined);\n\t\tif (value !== undefined) {\n\t\t\tdata.push(value);\n\t\t}\n\t\tconst local: FluidSerializableReadOnly[] = [];\n\t\tforEachField(cursor, () => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tlocal.push(key, encodeSequence(cursor));\n\t\t});\n\t\tdata.push(local);\n\t});\n\treturn data;\n}\n"]}
1
+ {"version":3,"file":"uncompressedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAIgC;AAChC,qDAA+C;AAY/C,gDAA4D;AAE5D;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAiB;IACrD,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAA,gBAAK,EAAC,kCAAuB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,oDAEC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAiB;IACrD,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAA,gBAAK,EAAC,kCAAuB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,oDAEC;AAED;;;;;;;GAOG;AACH,SAAS,kBAAkB,CAC1B,KAAiB,EACjB,OAAgC;IAEhC,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC7C,OAAO;QACN,OAAO;QACP,WAAW,EAAE,EAAE;QACf,4CAA4C;QAC5C,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC9C,mFAAmF;QACnF,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;KAClD,CAAC;AACH,CAAC;AAED,MAAM,SAAS,GAAe,CAAC,CAAC;AAChC,MAAM,UAAU,GAAe,CAAC,CAAC;AAEjC,MAAM,YAAY,GAAqB;IACtC,WAAW,EAAE,UAAU;CACvB,CAAC;AAEF,MAAM,QAAQ,GAA4B,SAAS,CAAC;AAEpD;;;;;GAKG;AACH,SAAS,cAAc,CAAC,MAA8B;IACrD,MAAM,IAAI,GAAgC,EAAE,CAAC;IAC7C,IAAA,sBAAW,EAAC,MAAM,EAAE,GAAG,EAAE;QACxB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,KAAK,GAAgC,EAAE,CAAC;QAC9C,IAAA,uBAAY,EAAC,MAAM,EAAE,GAAG,EAAE;YACzB,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype ITreeCursorSynchronous,\n\tforEachField,\n\tforEachNode,\n} from \"../../../core/index.js\";\nimport { brand } from \"../../../util/index.js\";\nimport type { FluidSerializableReadOnly } from \"../../valueUtilities.js\";\n\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport type {\n\tEncodedFieldBatchV1,\n\tEncodedFieldBatchV1AndV2,\n\tEncodedFieldBatchV2,\n\tEncodedNestedArrayShape,\n\tEncodedNodeShape,\n\tShapeIndex,\n} from \"./format/index.js\";\nimport { FieldBatchFormatVersion } from \"./format/index.js\";\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.\n * @remarks See {@link uncompressedEncode} for more details.\n */\nexport function uncompressedEncodeV1(batch: FieldBatch): EncodedFieldBatchV1 {\n\treturn uncompressedEncode(batch, brand(FieldBatchFormatVersion.v1));\n}\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.\n * @remarks See {@link uncompressedEncode} for more details.\n */\nexport function uncompressedEncodeV2(batch: FieldBatch): EncodedFieldBatchV2 {\n\treturn uncompressedEncode(batch, brand(FieldBatchFormatVersion.v2));\n}\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk`.\n *\n * No polymorphism, identifier deduplication or schema based compression.\n * Just uses two hard coded shapes and inline identifiers.\n *\n * This is intended as a simple reference implementation with minimal code and dependencies.\n */\nfunction uncompressedEncode(\n\tbatch: FieldBatch,\n\tversion: FieldBatchFormatVersion,\n): EncodedFieldBatchV1AndV2 {\n\tconst rootFields = batch.map(encodeSequence);\n\treturn {\n\t\tversion,\n\t\tidentifiers: [],\n\t\t// A single shape used to encode all fields.\n\t\tshapes: [{ c: anyNodeShape }, { a: anyArray }],\n\t\t// Wrap up each field as an indicator to use the above shape, and its encoded data.\n\t\tdata: rootFields.map((data) => [arrayIndex, data]),\n\t};\n}\n\nconst treeIndex: ShapeIndex = 0;\nconst arrayIndex: ShapeIndex = 1;\n\nconst anyNodeShape: EncodedNodeShape = {\n\textraFields: arrayIndex,\n};\n\nconst anyArray: EncodedNestedArrayShape = treeIndex;\n\n/**\n * Encode a field using the hard coded shape above.\n * @remarks\n * Since this shape contains no information about the actual schema, all schema/shape information is inline in the data:\n * that is why this encoding is called \"uncompressed\".\n */\nfunction encodeSequence(cursor: ITreeCursorSynchronous): FluidSerializableReadOnly[] {\n\tconst data: FluidSerializableReadOnly[] = [];\n\tforEachNode(cursor, () => {\n\t\tdata.push(cursor.type);\n\t\tconst value = cursor.value;\n\t\tdata.push(value !== undefined);\n\t\tif (value !== undefined) {\n\t\t\tdata.push(value);\n\t\t}\n\t\tconst local: FluidSerializableReadOnly[] = [];\n\t\tforEachField(cursor, () => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tlocal.push(key, encodeSequence(cursor));\n\t\t});\n\t\tdata.push(local);\n\t});\n\treturn data;\n}\n"]}
@@ -6,6 +6,6 @@ export { uniformChunk, ChunkShape } from "./uniformChunk.js";
6
6
  export { type TreeChunk, dummyRoot } from "../../core/index.js";
7
7
  export { chunkTree, defaultChunkPolicy, makeTreeChunker, type IChunker, chunkFieldSingle, chunkField, combineChunks, } from "./chunkTree.js";
8
8
  export { buildChunkedForest } from "./chunkedForest.js";
9
- export { type EncodedFieldBatch, FieldBatchFormatVersion, type FieldBatch, type FieldBatchCodec, fieldBatchCodecBuilder, type FieldBatchEncodingContext, type IncrementalEncoderDecoder, type ChunkReferenceId, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, } from "./codec/index.js";
9
+ export { FieldBatchFormatVersion, type FieldBatch, type FieldBatchCodec, fieldBatchCodecBuilder, type FieldBatchEncodingContext, type IncrementalEncoderDecoder, type ChunkReferenceId, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, type EncodedFieldBatchV1OrV2, type EncodedFieldBatchV2, } from "./codec/index.js";
10
10
  export { emptyChunk } from "./emptyChunk.js";
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,KAAK,QAAQ,EACb,gBAAgB,EAChB,UAAU,EACV,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACN,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,sBAAsB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,gCAAgC,GAChC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,KAAK,QAAQ,EACb,gBAAgB,EAChB,UAAU,EACV,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACN,uBAAuB,EACvB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,sBAAsB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,gCAAgC,EAChC,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAA6D;AAApD,+GAAA,YAAY,OAAA;AAAE,6GAAA,UAAU,OAAA;AACjC,gDAAgE;AAAvC,qGAAA,SAAS,OAAA;AAClC,+CAQwB;AAPvB,yGAAA,SAAS,OAAA;AACT,kHAAA,kBAAkB,OAAA;AAClB,+GAAA,eAAe,OAAA;AAEf,gHAAA,gBAAgB,OAAA;AAChB,0GAAA,UAAU,OAAA;AACV,6GAAA,aAAa,OAAA;AAEd,uDAAwD;AAA/C,sHAAA,kBAAkB,OAAA;AAC3B,6CAW0B;AATzB,mHAAA,uBAAuB,OAAA;AAGvB,kHAAA,sBAAsB,OAAA;AAKtB,4HAAA,gCAAgC,OAAA;AAEjC,iDAA6C;AAApC,2GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { uniformChunk, ChunkShape } from \"./uniformChunk.js\";\nexport { type TreeChunk, dummyRoot } from \"../../core/index.js\";\nexport {\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tmakeTreeChunker,\n\ttype IChunker,\n\tchunkFieldSingle,\n\tchunkField,\n\tcombineChunks,\n} from \"./chunkTree.js\";\nexport { buildChunkedForest } from \"./chunkedForest.js\";\nexport {\n\ttype EncodedFieldBatch,\n\tFieldBatchFormatVersion,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tfieldBatchCodecBuilder,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncoderDecoder,\n\ttype ChunkReferenceId,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./codec/index.js\";\nexport { emptyChunk } from \"./emptyChunk.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAA6D;AAApD,+GAAA,YAAY,OAAA;AAAE,6GAAA,UAAU,OAAA;AACjC,gDAAgE;AAAvC,qGAAA,SAAS,OAAA;AAClC,+CAQwB;AAPvB,yGAAA,SAAS,OAAA;AACT,kHAAA,kBAAkB,OAAA;AAClB,+GAAA,eAAe,OAAA;AAEf,gHAAA,gBAAgB,OAAA;AAChB,0GAAA,UAAU,OAAA;AACV,6GAAA,aAAa,OAAA;AAEd,uDAAwD;AAA/C,sHAAA,kBAAkB,OAAA;AAC3B,6CAY0B;AAXzB,mHAAA,uBAAuB,OAAA;AAGvB,kHAAA,sBAAsB,OAAA;AAKtB,4HAAA,gCAAgC,OAAA;AAIjC,iDAA6C;AAApC,2GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { uniformChunk, ChunkShape } from \"./uniformChunk.js\";\nexport { type TreeChunk, dummyRoot } from \"../../core/index.js\";\nexport {\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tmakeTreeChunker,\n\ttype IChunker,\n\tchunkFieldSingle,\n\tchunkField,\n\tcombineChunks,\n} from \"./chunkTree.js\";\nexport { buildChunkedForest } from \"./chunkedForest.js\";\nexport {\n\tFieldBatchFormatVersion,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tfieldBatchCodecBuilder,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncoderDecoder,\n\ttype ChunkReferenceId,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n\ttype EncodedFieldBatchV1OrV2,\n\ttype EncodedFieldBatchV2,\n} from \"./codec/index.js\";\nexport { emptyChunk } from \"./emptyChunk.js\";\n"]}
@@ -54,22 +54,30 @@ export declare class TreeShape {
54
54
  readonly type: TreeNodeSchemaIdentifier;
55
55
  readonly hasValue: boolean;
56
56
  readonly fieldsArray: readonly FieldShape[];
57
- readonly maybeDecompressedStringAsNumber: boolean;
58
57
  readonly fields: ReadonlyMap<FieldKey, OffsetShape>;
59
58
  readonly fieldsOffsetArray: readonly OffsetShape[];
60
59
  readonly valuesPerTopLevelNode: number;
61
60
  readonly positions: readonly NodePositionInfo[];
61
+ /**
62
+ * Whether chunks using this shape (including any descendant leaf within it) may contain values compressed by the {@link UniformChunk.idCompressor}.
63
+ *
64
+ * @remarks
65
+ * For string leaf nodes, this can be explicitly set to `true` to indicate that the value may be a compressed id
66
+ * stored as a number that needs to be decompressed back to a string.
67
+ * For non-leaf nodes, this is automatically derived from whether any child shapes have it set.
68
+ */
69
+ readonly mayContainCompressedIds: boolean;
62
70
  /**
63
71
  *
64
72
  * @param type - {@link TreeNodeSchemaIdentifier} used to compare shapes.
65
73
  * @param hasValue - whether or not the TreeShape has a value.
66
74
  * @param fieldsArray - an array of {@link FieldShape} values, which contains a TreeShape for each FieldKey.
67
75
  *
68
- * @param maybeDecompressedStringAsNumber - used to check whether or not the value could have been compressed by the idCompressor.
69
- * This flag can only be set on string leaf nodes, and will throw a usage error otherwise.
70
- * If set to true, an additional check can be made (example: getting the value of {@link Cursor}) to return the original uncompressed value.
76
+ * @param maybeCompressedIdLeaf - whether the value may have been compressed by the {@link UniformChunk.idCompressor}.
77
+ * Can only be explicitly set to `true` on string leaf nodes; otherwise this constructor asserts.
78
+ * For non-leaf nodes, {@link TreeShape.mayContainCompressedIds} is automatically derived from child shapes.
71
79
  */
72
- constructor(type: TreeNodeSchemaIdentifier, hasValue: boolean, fieldsArray: readonly FieldShape[], maybeDecompressedStringAsNumber?: boolean);
80
+ constructor(type: TreeNodeSchemaIdentifier, hasValue: boolean, fieldsArray: readonly FieldShape[], maybeCompressedIdLeaf?: boolean);
73
81
  equals(other: TreeShape): boolean;
74
82
  withTopLevelLength(topLevelLength: number): ChunkShape;
75
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"uniformChunk.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/uniformChunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAA4B,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG7F,OAAO,EACN,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,WAAW,EAEX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAW,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAA+B,MAAM,uBAAuB,CAAC;AAEvF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAE9E;AAED;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,oBAAqB,YAAW,SAAS;IASlE,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,SAAS,EAAE;IATpB,YAAY,EAAE,SAAS,GAAG,aAAa,CAAC;IAC/C;;;;;OAKG;gBAEK,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,SAAS,EAAE,EAC1B,YAAY,CAAC,EAAE,aAAa;IAU7B,IAAW,cAAc,IAAI,MAAM,CAElC;IAEM,KAAK,IAAI,YAAY;IAIrB,MAAM,IAAI,MAAM;IAIvB,SAAS,CAAC,cAAc,IAAI,IAAI;CAChC;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAEhE;;;;;;;GAOG;AACH,qBAAa,SAAS;aAmBJ,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