@fluidframework/tree 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.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 (2507) hide show
  1. package/.eslintrc.cjs +2 -0
  2. package/CHANGELOG.md +74 -0
  3. package/api-extractor.json +2 -3
  4. package/api-report/tree.api.md +208 -154
  5. package/beta.d.ts +11 -0
  6. package/dist/beta.d.ts +90 -0
  7. package/dist/codec/codec.d.ts +10 -4
  8. package/dist/codec/codec.d.ts.map +1 -1
  9. package/dist/codec/codec.js +2 -2
  10. package/dist/codec/codec.js.map +1 -1
  11. package/dist/codec/discriminatedUnions.d.ts.map +1 -1
  12. package/dist/codec/discriminatedUnions.js +6 -2
  13. package/dist/codec/discriminatedUnions.js.map +1 -1
  14. package/dist/codec/index.d.ts +2 -2
  15. package/dist/codec/index.d.ts.map +1 -1
  16. package/dist/codec/index.js +3 -2
  17. package/dist/codec/index.js.map +1 -1
  18. package/dist/codec/noopValidator.d.ts.map +1 -1
  19. package/dist/codec/noopValidator.js.map +1 -1
  20. package/dist/codec/versioned/codec.d.ts +10 -2
  21. package/dist/codec/versioned/codec.d.ts.map +1 -1
  22. package/dist/codec/versioned/codec.js +28 -6
  23. package/dist/codec/versioned/codec.js.map +1 -1
  24. package/dist/codec/versioned/index.d.ts +1 -1
  25. package/dist/codec/versioned/index.d.ts.map +1 -1
  26. package/dist/codec/versioned/index.js +2 -1
  27. package/dist/codec/versioned/index.js.map +1 -1
  28. package/dist/core/change-family/changeFamily.d.ts +2 -2
  29. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  30. package/dist/core/change-family/changeFamily.js.map +1 -1
  31. package/dist/core/forest/editableForest.d.ts +1 -1
  32. package/dist/core/forest/editableForest.d.ts.map +1 -1
  33. package/dist/core/forest/editableForest.js +2 -2
  34. package/dist/core/forest/editableForest.js.map +1 -1
  35. package/dist/core/forest/forest.d.ts +5 -1
  36. package/dist/core/forest/forest.d.ts.map +1 -1
  37. package/dist/core/forest/forest.js +2 -2
  38. package/dist/core/forest/forest.js.map +1 -1
  39. package/dist/core/index.d.ts +3 -3
  40. package/dist/core/index.d.ts.map +1 -1
  41. package/dist/core/index.js +6 -3
  42. package/dist/core/index.js.map +1 -1
  43. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  44. package/dist/core/rebase/changeRebaser.js.map +1 -1
  45. package/dist/core/rebase/index.d.ts +1 -1
  46. package/dist/core/rebase/index.d.ts.map +1 -1
  47. package/dist/core/rebase/index.js +4 -1
  48. package/dist/core/rebase/index.js.map +1 -1
  49. package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
  50. package/dist/core/rebase/revisionTagCodec.js +2 -2
  51. package/dist/core/rebase/revisionTagCodec.js.map +1 -1
  52. package/dist/core/rebase/types.d.ts +30 -0
  53. package/dist/core/rebase/types.d.ts.map +1 -1
  54. package/dist/core/rebase/types.js +26 -1
  55. package/dist/core/rebase/types.js.map +1 -1
  56. package/dist/core/rebase/utils.d.ts.map +1 -1
  57. package/dist/core/rebase/utils.js +11 -10
  58. package/dist/core/rebase/utils.js.map +1 -1
  59. package/dist/core/revertible/index.d.ts +1 -1
  60. package/dist/core/revertible/index.d.ts.map +1 -1
  61. package/dist/core/revertible/index.js +1 -3
  62. package/dist/core/revertible/index.js.map +1 -1
  63. package/dist/core/revertible/revertible.d.ts +15 -49
  64. package/dist/core/revertible/revertible.d.ts.map +1 -1
  65. package/dist/core/revertible/revertible.js +3 -33
  66. package/dist/core/revertible/revertible.js.map +1 -1
  67. package/dist/core/schema-stored/format.d.ts.map +1 -1
  68. package/dist/core/schema-stored/format.js.map +1 -1
  69. package/dist/core/schema-stored/index.d.ts +2 -1
  70. package/dist/core/schema-stored/index.d.ts.map +1 -1
  71. package/dist/core/schema-stored/index.js +4 -1
  72. package/dist/core/schema-stored/index.js.map +1 -1
  73. package/dist/core/schema-stored/multiplicity.d.ts.map +1 -0
  74. package/dist/{feature-libraries → core/schema-stored}/multiplicity.js +2 -2
  75. package/{lib/feature-libraries → dist/core/schema-stored}/multiplicity.js.map +1 -1
  76. package/dist/core/schema-stored/schema.d.ts +32 -9
  77. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  78. package/dist/core/schema-stored/schema.js +14 -7
  79. package/dist/core/schema-stored/schema.js.map +1 -1
  80. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  81. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  82. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  83. package/dist/core/tree/anchorSet.d.ts +31 -16
  84. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  85. package/dist/core/tree/anchorSet.js +37 -62
  86. package/dist/core/tree/anchorSet.js.map +1 -1
  87. package/dist/core/tree/cursor.d.ts.map +1 -1
  88. package/dist/core/tree/cursor.js +4 -4
  89. package/dist/core/tree/cursor.js.map +1 -1
  90. package/dist/core/tree/delta.d.ts.map +1 -1
  91. package/dist/core/tree/delta.js.map +1 -1
  92. package/dist/core/tree/deltaUtil.d.ts +1 -1
  93. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  94. package/dist/core/tree/deltaUtil.js.map +1 -1
  95. package/dist/core/tree/detachedFieldIndex.d.ts +2 -2
  96. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  97. package/dist/core/tree/detachedFieldIndex.js +15 -15
  98. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  99. package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  100. package/dist/core/tree/detachedFieldIndexCodec.js +4 -4
  101. package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
  102. package/dist/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
  103. package/dist/core/tree/detachedFieldIndexFormat.js.map +1 -1
  104. package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  105. package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
  106. package/dist/core/tree/mapTree.d.ts.map +1 -1
  107. package/dist/core/tree/mapTree.js.map +1 -1
  108. package/dist/core/tree/pathTree.d.ts.map +1 -1
  109. package/dist/core/tree/pathTree.js.map +1 -1
  110. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  111. package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
  112. package/dist/core/tree/sparseTree.d.ts.map +1 -1
  113. package/dist/core/tree/sparseTree.js +5 -5
  114. package/dist/core/tree/sparseTree.js.map +1 -1
  115. package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
  116. package/dist/core/tree/treeTextFormat.js.map +1 -1
  117. package/dist/core/tree/types.d.ts +1 -1
  118. package/dist/core/tree/types.d.ts.map +1 -1
  119. package/dist/core/tree/types.js +7 -7
  120. package/dist/core/tree/types.js.map +1 -1
  121. package/dist/core/tree/visitDelta.d.ts +13 -2
  122. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  123. package/dist/core/tree/visitDelta.js +47 -18
  124. package/dist/core/tree/visitDelta.js.map +1 -1
  125. package/dist/core/tree/visitPath.d.ts +1 -1
  126. package/dist/core/tree/visitPath.d.ts.map +1 -1
  127. package/dist/core/tree/visitPath.js +4 -0
  128. package/dist/core/tree/visitPath.js.map +1 -1
  129. package/dist/core/tree/visitorUtils.d.ts +4 -4
  130. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  131. package/dist/core/tree/visitorUtils.js +2 -2
  132. package/dist/core/tree/visitorUtils.js.map +1 -1
  133. package/dist/domains/json/jsonCursor.d.ts.map +1 -1
  134. package/dist/domains/json/jsonCursor.js +7 -7
  135. package/dist/domains/json/jsonCursor.js.map +1 -1
  136. package/dist/domains/json/jsonDomainSchema.d.ts.map +1 -1
  137. package/dist/domains/json/jsonDomainSchema.js.map +1 -1
  138. package/dist/domains/leafDomain.d.ts.map +1 -1
  139. package/dist/domains/leafDomain.js +8 -8
  140. package/dist/domains/leafDomain.js.map +1 -1
  141. package/dist/domains/nodeKey/nodeKeySchema.d.ts.map +1 -1
  142. package/dist/domains/nodeKey/nodeKeySchema.js +2 -2
  143. package/dist/domains/nodeKey/nodeKeySchema.js.map +1 -1
  144. package/dist/domains/schemaBuilder.d.ts +19 -81
  145. package/dist/domains/schemaBuilder.d.ts.map +1 -1
  146. package/dist/domains/schemaBuilder.js +24 -93
  147. package/dist/domains/schemaBuilder.js.map +1 -1
  148. package/dist/domains/testRecursiveDomain.d.ts +0 -4
  149. package/dist/domains/testRecursiveDomain.d.ts.map +1 -1
  150. package/dist/domains/testRecursiveDomain.js +1 -8
  151. package/dist/domains/testRecursiveDomain.js.map +1 -1
  152. package/dist/events/events.d.ts.map +1 -1
  153. package/dist/events/events.js +2 -2
  154. package/dist/events/events.js.map +1 -1
  155. package/dist/external-utilities/typeboxValidator.d.ts.map +1 -1
  156. package/dist/external-utilities/typeboxValidator.js.map +1 -1
  157. package/dist/feature-libraries/changeAtomIdCodec.d.ts +1 -1
  158. package/dist/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  159. package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
  160. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts +3 -3
  161. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  162. package/dist/feature-libraries/chunked-forest/basicChunk.js +29 -29
  163. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  164. package/dist/feature-libraries/chunked-forest/chunk.d.ts +1 -1
  165. package/dist/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
  166. package/dist/feature-libraries/chunked-forest/chunk.js +2 -2
  167. package/dist/feature-libraries/chunked-forest/chunk.js.map +1 -1
  168. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +2 -2
  169. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  170. package/dist/feature-libraries/chunked-forest/chunkTree.js +13 -14
  171. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  172. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -2
  173. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  174. package/dist/feature-libraries/chunked-forest/chunkedForest.js +25 -24
  175. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  176. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +2 -2
  177. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
  178. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +4 -4
  179. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  180. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  181. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  182. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +13 -13
  183. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  184. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +2 -2
  185. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  186. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +3 -3
  187. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  188. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -1
  189. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  190. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  191. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -9
  192. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  193. package/dist/feature-libraries/chunked-forest/codec/codecs.js +6 -5
  194. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  195. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +3 -3
  196. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  197. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +8 -8
  198. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  199. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +1 -1
  200. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  201. package/dist/feature-libraries/chunked-forest/codec/format.js +1 -2
  202. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  203. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +1 -1
  204. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  205. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  206. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  207. package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts +2 -2
  208. package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
  209. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +3 -3
  210. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
  211. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts +3 -3
  212. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +1 -1
  213. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js +4 -5
  214. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
  215. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  216. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  217. package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  218. package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  219. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  220. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  221. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  222. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  223. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  224. package/dist/feature-libraries/chunked-forest/sequenceChunk.js +1 -1
  225. package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  226. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +3 -3
  227. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  228. package/dist/feature-libraries/chunked-forest/uniformChunk.js +21 -21
  229. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  230. package/dist/feature-libraries/contextuallyTyped.d.ts +5 -9
  231. package/dist/feature-libraries/contextuallyTyped.d.ts.map +1 -1
  232. package/dist/feature-libraries/contextuallyTyped.js +33 -48
  233. package/dist/feature-libraries/contextuallyTyped.js.map +1 -1
  234. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -5
  235. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  236. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +7 -7
  237. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  238. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +18 -4
  239. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  240. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +59 -24
  241. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  242. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  243. package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  244. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  245. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  246. package/dist/feature-libraries/default-schema/index.js +2 -1
  247. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  248. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +8 -0
  249. package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -0
  250. package/dist/feature-libraries/default-schema/noChangeCodecs.js +10 -0
  251. package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -0
  252. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +1 -1
  253. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  254. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +2 -2
  255. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  256. package/dist/feature-libraries/editableTreeBinder.d.ts.map +1 -1
  257. package/dist/feature-libraries/editableTreeBinder.js +6 -6
  258. package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
  259. package/dist/feature-libraries/fieldGenerator.d.ts +1 -1
  260. package/dist/feature-libraries/fieldGenerator.d.ts.map +1 -1
  261. package/dist/feature-libraries/fieldGenerator.js.map +1 -1
  262. package/dist/feature-libraries/flex-tree/context.d.ts +16 -4
  263. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  264. package/dist/feature-libraries/flex-tree/context.js +27 -15
  265. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  266. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +43 -36
  267. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  268. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +9 -6
  269. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  270. package/dist/feature-libraries/flex-tree/index.d.ts +3 -3
  271. package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
  272. package/dist/feature-libraries/flex-tree/index.js +3 -2
  273. package/dist/feature-libraries/flex-tree/index.js.map +1 -1
  274. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +7 -8
  275. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  276. package/dist/feature-libraries/flex-tree/lazyEntity.js +12 -17
  277. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  278. package/dist/feature-libraries/flex-tree/lazyField.d.ts +21 -7
  279. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  280. package/dist/feature-libraries/flex-tree/lazyField.js +69 -46
  281. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  282. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +12 -9
  283. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  284. package/dist/feature-libraries/flex-tree/lazyNode.js +51 -97
  285. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  286. package/dist/feature-libraries/flex-tree/nodeKeys.d.ts.map +1 -1
  287. package/dist/feature-libraries/flex-tree/nodeKeys.js.map +1 -1
  288. package/dist/feature-libraries/flex-tree/treeEvents.d.ts +7 -70
  289. package/dist/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
  290. package/dist/feature-libraries/flex-tree/treeEvents.js.map +1 -1
  291. package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  292. package/dist/feature-libraries/flex-tree/unboxed.js +1 -1
  293. package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
  294. package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  295. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  296. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  297. package/dist/feature-libraries/forest-summary/codec.js +2 -2
  298. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  299. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -3
  300. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  301. package/dist/feature-libraries/forest-summary/forestSummarizer.js +14 -14
  302. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  303. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  304. package/dist/feature-libraries/forest-summary/format.js +4 -4
  305. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  306. package/dist/feature-libraries/index.d.ts +8 -9
  307. package/dist/feature-libraries/index.d.ts.map +1 -1
  308. package/dist/feature-libraries/index.js +9 -9
  309. package/dist/feature-libraries/index.js.map +1 -1
  310. package/dist/feature-libraries/mapTreeCursor.d.ts +1 -1
  311. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  312. package/dist/feature-libraries/mapTreeCursor.js +2 -2
  313. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  314. package/dist/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
  315. package/dist/feature-libraries/modular-schema/comparison.d.ts +1 -1
  316. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  317. package/dist/feature-libraries/modular-schema/comparison.js +20 -20
  318. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  319. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +19 -13
  320. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  321. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  322. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +3 -4
  323. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  324. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  325. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +21 -0
  326. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -0
  327. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js +7 -0
  328. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -0
  329. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +1 -2
  330. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
  331. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +4 -4
  332. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
  333. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  334. package/dist/feature-libraries/modular-schema/genericFieldKind.js +3 -7
  335. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  336. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +3 -5
  337. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  338. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +7 -7
  339. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  340. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +1 -1
  341. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  342. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js +1 -1
  343. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  344. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +4 -4
  345. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  346. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  347. package/dist/feature-libraries/modular-schema/index.d.ts +5 -4
  348. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  349. package/dist/feature-libraries/modular-schema/index.js +3 -2
  350. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  351. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +1 -1
  352. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  353. package/dist/feature-libraries/modular-schema/isNeverTree.js +10 -11
  354. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  355. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +4 -5
  356. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  357. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +73 -37
  358. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  359. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +13 -25
  360. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  361. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +261 -169
  362. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  363. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +5 -12
  364. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  365. package/dist/feature-libraries/modular-schema/modularChangeFormat.js +0 -10
  366. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  367. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +6 -4
  368. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  369. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  370. package/dist/feature-libraries/node-key/nodeKey.d.ts +1 -1
  371. package/dist/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
  372. package/dist/feature-libraries/node-key/nodeKey.js.map +1 -1
  373. package/dist/feature-libraries/node-key/nodeKeyIndex.d.ts +2 -2
  374. package/dist/feature-libraries/node-key/nodeKeyIndex.d.ts.map +1 -1
  375. package/dist/feature-libraries/node-key/nodeKeyIndex.js +3 -3
  376. package/dist/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
  377. package/dist/feature-libraries/node-key/nodeKeyManager.d.ts +2 -2
  378. package/dist/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
  379. package/dist/feature-libraries/node-key/nodeKeyManager.js +9 -9
  380. package/dist/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
  381. package/dist/feature-libraries/object-forest/objectForest.d.ts +1 -1
  382. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  383. package/dist/feature-libraries/object-forest/objectForest.js +49 -48
  384. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  385. package/dist/feature-libraries/optional-field/index.d.ts +1 -1
  386. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  387. package/dist/feature-libraries/optional-field/index.js +1 -2
  388. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  389. package/dist/feature-libraries/optional-field/optionalField.d.ts +3 -5
  390. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  391. package/dist/feature-libraries/optional-field/optionalField.js +33 -39
  392. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  393. package/dist/feature-libraries/optional-field/{optionalFieldChangeFormat.d.ts → optionalFieldChangeFormatV1.d.ts} +1 -1
  394. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -0
  395. package/dist/feature-libraries/optional-field/{optionalFieldChangeFormat.js → optionalFieldChangeFormatV1.js} +11 -2
  396. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -0
  397. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +25 -0
  398. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -0
  399. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +44 -0
  400. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -0
  401. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +4 -7
  402. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  403. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  404. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +12 -0
  405. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +1 -0
  406. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js +158 -0
  407. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +1 -0
  408. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +12 -0
  409. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -0
  410. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +87 -0
  411. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -0
  412. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -4
  413. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  414. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +7 -150
  415. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  416. package/dist/feature-libraries/schema-aware/schemaAware.d.ts +3 -4
  417. package/dist/feature-libraries/schema-aware/schemaAware.d.ts.map +1 -1
  418. package/dist/feature-libraries/schema-aware/schemaAware.js +1 -1
  419. package/dist/feature-libraries/schema-aware/schemaAware.js.map +1 -1
  420. package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
  421. package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
  422. package/dist/feature-libraries/schema-edits/index.js +2 -2
  423. package/dist/feature-libraries/schema-edits/index.js.map +1 -1
  424. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -3
  425. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  426. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +13 -5
  427. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  428. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  429. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  430. package/dist/feature-libraries/schema-edits/schemaChangeTypes.d.ts +5 -0
  431. package/dist/feature-libraries/schema-edits/schemaChangeTypes.d.ts.map +1 -1
  432. package/dist/feature-libraries/schema-edits/schemaChangeTypes.js.map +1 -1
  433. package/dist/feature-libraries/schema-index/codec.d.ts +1 -1
  434. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  435. package/dist/feature-libraries/schema-index/codec.js +10 -10
  436. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  437. package/dist/feature-libraries/schema-index/format.d.ts.map +1 -1
  438. package/dist/feature-libraries/schema-index/format.js.map +1 -1
  439. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
  440. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  441. package/dist/feature-libraries/schema-index/schemaSummarizer.js +4 -4
  442. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  443. package/dist/feature-libraries/schemaBuilder.d.ts +1 -1
  444. package/dist/feature-libraries/schemaBuilder.d.ts.map +1 -1
  445. package/dist/feature-libraries/schemaBuilder.js +1 -1
  446. package/dist/feature-libraries/schemaBuilder.js.map +1 -1
  447. package/dist/feature-libraries/schemaBuilderBase.d.ts +1 -1
  448. package/dist/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
  449. package/dist/feature-libraries/schemaBuilderBase.js +19 -19
  450. package/dist/feature-libraries/schemaBuilderBase.js.map +1 -1
  451. package/dist/feature-libraries/sequence-field/compose.d.ts +9 -13
  452. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  453. package/dist/feature-libraries/sequence-field/compose.js +76 -43
  454. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  455. package/dist/feature-libraries/sequence-field/format.d.ts.map +1 -1
  456. package/dist/feature-libraries/sequence-field/format.js +14 -14
  457. package/dist/feature-libraries/sequence-field/format.js.map +1 -1
  458. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +3 -3
  459. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  460. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  461. package/dist/feature-libraries/sequence-field/index.d.ts +5 -5
  462. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  463. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  464. package/dist/feature-libraries/sequence-field/invert.d.ts +1 -2
  465. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  466. package/dist/feature-libraries/sequence-field/invert.js +30 -39
  467. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  468. package/dist/feature-libraries/sequence-field/markListFactory.d.ts +4 -4
  469. package/dist/feature-libraries/sequence-field/markListFactory.d.ts.map +1 -1
  470. package/dist/feature-libraries/sequence-field/markListFactory.js.map +1 -1
  471. package/dist/feature-libraries/sequence-field/markQueue.d.ts +7 -7
  472. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  473. package/dist/feature-libraries/sequence-field/markQueue.js +2 -2
  474. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  475. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +25 -14
  476. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  477. package/dist/feature-libraries/sequence-field/moveEffectTable.js +20 -11
  478. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  479. package/dist/feature-libraries/sequence-field/prune.d.ts +2 -2
  480. package/dist/feature-libraries/sequence-field/prune.d.ts.map +1 -1
  481. package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
  482. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -4
  483. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  484. package/dist/feature-libraries/sequence-field/rebase.js +34 -40
  485. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  486. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +2 -2
  487. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
  488. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +2 -2
  489. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  490. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts +1 -1
  491. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  492. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +1 -1
  493. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  494. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +2 -2
  495. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
  496. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js +1 -1
  497. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
  498. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -3
  499. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  500. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +17 -19
  501. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  502. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +17 -17
  503. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  504. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +2 -2
  505. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  506. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -3
  507. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  508. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +10 -10
  509. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  510. package/dist/feature-libraries/sequence-field/types.d.ts +7 -8
  511. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  512. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  513. package/dist/feature-libraries/sequence-field/utils.d.ts +42 -35
  514. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  515. package/dist/feature-libraries/sequence-field/utils.js +43 -21
  516. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  517. package/dist/feature-libraries/storedToViewSchema.d.ts +2 -2
  518. package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  519. package/dist/feature-libraries/storedToViewSchema.js +3 -3
  520. package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
  521. package/dist/feature-libraries/treeCursorUtils.d.ts +1 -1
  522. package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  523. package/dist/feature-libraries/treeCursorUtils.js +8 -8
  524. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  525. package/dist/feature-libraries/treeTextCursor.d.ts +1 -1
  526. package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
  527. package/dist/feature-libraries/treeTextCursor.js +3 -3
  528. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  529. package/dist/feature-libraries/typed-schema/flexList.d.ts +1 -2
  530. package/dist/feature-libraries/typed-schema/flexList.d.ts.map +1 -1
  531. package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
  532. package/dist/feature-libraries/typed-schema/index.d.ts +0 -1
  533. package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
  534. package/dist/feature-libraries/typed-schema/index.js.map +1 -1
  535. package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  536. package/dist/feature-libraries/typed-schema/schemaCollection.js +14 -14
  537. package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  538. package/dist/feature-libraries/typed-schema/typeUtils.d.ts +0 -5
  539. package/dist/feature-libraries/typed-schema/typeUtils.d.ts.map +1 -1
  540. package/dist/feature-libraries/typed-schema/typeUtils.js.map +1 -1
  541. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +5 -4
  542. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  543. package/dist/feature-libraries/typed-schema/typedTreeSchema.js +19 -11
  544. package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  545. package/dist/feature-libraries/typed-schema/view.d.ts +1 -1
  546. package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
  547. package/dist/feature-libraries/typed-schema/view.js +10 -10
  548. package/dist/feature-libraries/typed-schema/view.js.map +1 -1
  549. package/dist/feature-libraries/valueUtilities.d.ts +6 -3
  550. package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
  551. package/dist/feature-libraries/valueUtilities.js +11 -10
  552. package/dist/feature-libraries/valueUtilities.js.map +1 -1
  553. package/dist/index.d.ts +7 -7
  554. package/dist/index.d.ts.map +1 -1
  555. package/dist/index.js +9 -9
  556. package/dist/index.js.map +1 -1
  557. package/dist/packageVersion.d.ts +1 -1
  558. package/dist/packageVersion.js +1 -1
  559. package/dist/packageVersion.js.map +1 -1
  560. package/dist/public.d.ts +90 -0
  561. package/dist/shared-tree/index.d.ts +3 -3
  562. package/dist/shared-tree/index.d.ts.map +1 -1
  563. package/dist/shared-tree/index.js +2 -1
  564. package/dist/shared-tree/index.js.map +1 -1
  565. package/dist/shared-tree/schematizeTree.d.ts +1 -1
  566. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  567. package/dist/shared-tree/schematizeTree.js +11 -11
  568. package/dist/shared-tree/schematizeTree.js.map +1 -1
  569. package/dist/shared-tree/schematizingTreeView.d.ts +10 -3
  570. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  571. package/dist/shared-tree/schematizingTreeView.js +39 -39
  572. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  573. package/dist/shared-tree/sharedTree.d.ts +58 -8
  574. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  575. package/dist/shared-tree/sharedTree.js +45 -12
  576. package/dist/shared-tree/sharedTree.js.map +1 -1
  577. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +3 -5
  578. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  579. package/dist/shared-tree/sharedTreeChangeCodecs.js +18 -11
  580. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  581. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +1 -0
  582. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  583. package/dist/shared-tree/sharedTreeChangeFamily.js +9 -6
  584. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  585. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +4 -188
  586. package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  587. package/dist/shared-tree/sharedTreeChangeFormat.js +3 -3
  588. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  589. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  590. package/dist/shared-tree/sharedTreeEditBuilder.js +4 -1
  591. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  592. package/dist/shared-tree/treeApi.d.ts +83 -2
  593. package/dist/shared-tree/treeApi.d.ts.map +1 -1
  594. package/dist/shared-tree/treeApi.js +37 -14
  595. package/dist/shared-tree/treeApi.js.map +1 -1
  596. package/dist/shared-tree/treeCheckout.d.ts +41 -20
  597. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  598. package/dist/shared-tree/treeCheckout.js +135 -61
  599. package/dist/shared-tree/treeCheckout.js.map +1 -1
  600. package/dist/shared-tree/treeView.d.ts +3 -3
  601. package/dist/shared-tree/treeView.d.ts.map +1 -1
  602. package/dist/shared-tree/treeView.js.map +1 -1
  603. package/dist/shared-tree-core/branch.d.ts +5 -32
  604. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  605. package/dist/shared-tree-core/branch.js +12 -142
  606. package/dist/shared-tree-core/branch.js.map +1 -1
  607. package/dist/shared-tree-core/editManager.d.ts +2 -15
  608. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  609. package/dist/shared-tree-core/editManager.js +38 -82
  610. package/dist/shared-tree-core/editManager.js.map +1 -1
  611. package/dist/shared-tree-core/editManagerCodecs.d.ts +4 -4
  612. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  613. package/dist/shared-tree-core/editManagerCodecs.js +24 -10
  614. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  615. package/dist/shared-tree-core/editManagerFormat.d.ts +4 -5
  616. package/dist/shared-tree-core/editManagerFormat.d.ts.map +1 -1
  617. package/dist/shared-tree-core/editManagerFormat.js +9 -10
  618. package/dist/shared-tree-core/editManagerFormat.js.map +1 -1
  619. package/dist/shared-tree-core/editManagerSummarizer.d.ts +7 -6
  620. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  621. package/dist/shared-tree-core/editManagerSummarizer.js +6 -9
  622. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  623. package/dist/shared-tree-core/index.d.ts +1 -1
  624. package/dist/shared-tree-core/index.d.ts.map +1 -1
  625. package/dist/shared-tree-core/index.js +2 -2
  626. package/dist/shared-tree-core/index.js.map +1 -1
  627. package/dist/shared-tree-core/messageCodecs.d.ts +7 -4
  628. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  629. package/dist/shared-tree-core/messageCodecs.js +21 -4
  630. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  631. package/dist/shared-tree-core/messageFormat.d.ts +10 -2
  632. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  633. package/dist/shared-tree-core/messageFormat.js +1 -0
  634. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  635. package/dist/shared-tree-core/messageTypes.d.ts.map +1 -1
  636. package/dist/shared-tree-core/messageTypes.js.map +1 -1
  637. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  638. package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
  639. package/dist/shared-tree-core/sharedTreeCore.d.ts +10 -5
  640. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  641. package/dist/shared-tree-core/sharedTreeCore.js +18 -18
  642. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  643. package/dist/simple-tree/arrayNode.d.ts +187 -0
  644. package/dist/simple-tree/arrayNode.d.ts.map +1 -0
  645. package/dist/simple-tree/arrayNode.js +438 -0
  646. package/dist/simple-tree/arrayNode.js.map +1 -0
  647. package/dist/simple-tree/index.d.ts +10 -8
  648. package/dist/simple-tree/index.d.ts.map +1 -1
  649. package/dist/simple-tree/index.js +9 -8
  650. package/dist/simple-tree/index.js.map +1 -1
  651. package/dist/simple-tree/leafNodeSchema.d.ts +11 -0
  652. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -0
  653. package/dist/simple-tree/leafNodeSchema.js +51 -0
  654. package/dist/simple-tree/leafNodeSchema.js.map +1 -0
  655. package/dist/simple-tree/mapNode.d.ts +86 -0
  656. package/dist/simple-tree/mapNode.d.ts.map +1 -0
  657. package/dist/simple-tree/mapNode.js +204 -0
  658. package/dist/simple-tree/mapNode.js.map +1 -0
  659. package/dist/simple-tree/objectNode.d.ts +62 -0
  660. package/dist/simple-tree/objectNode.d.ts.map +1 -0
  661. package/dist/simple-tree/objectNode.js +242 -0
  662. package/dist/simple-tree/objectNode.js.map +1 -0
  663. package/dist/simple-tree/proxies.d.ts +21 -62
  664. package/dist/simple-tree/proxies.d.ts.map +1 -1
  665. package/dist/simple-tree/proxies.js +128 -679
  666. package/dist/simple-tree/proxies.js.map +1 -1
  667. package/dist/simple-tree/proxyBinding.d.ts +48 -0
  668. package/dist/simple-tree/proxyBinding.d.ts.map +1 -0
  669. package/dist/simple-tree/proxyBinding.js +132 -0
  670. package/dist/simple-tree/proxyBinding.js.map +1 -0
  671. package/dist/simple-tree/rawNode.d.ts +9 -50
  672. package/dist/simple-tree/rawNode.d.ts.map +1 -1
  673. package/dist/simple-tree/rawNode.js +15 -91
  674. package/dist/simple-tree/rawNode.js.map +1 -1
  675. package/dist/simple-tree/schemaCaching.d.ts +26 -0
  676. package/dist/simple-tree/schemaCaching.d.ts.map +1 -0
  677. package/dist/simple-tree/schemaCaching.js +69 -0
  678. package/dist/simple-tree/schemaCaching.js.map +1 -0
  679. package/dist/simple-tree/schemaCreationUtilities.d.ts +2 -1
  680. package/dist/simple-tree/schemaCreationUtilities.d.ts.map +1 -1
  681. package/dist/simple-tree/schemaCreationUtilities.js +3 -3
  682. package/dist/simple-tree/schemaCreationUtilities.js.map +1 -1
  683. package/dist/simple-tree/schemaFactory.d.ts +92 -43
  684. package/dist/simple-tree/schemaFactory.d.ts.map +1 -1
  685. package/dist/simple-tree/schemaFactory.js +124 -177
  686. package/dist/simple-tree/schemaFactory.js.map +1 -1
  687. package/dist/simple-tree/schemaFactoryRecursive.d.ts +27 -83
  688. package/dist/simple-tree/schemaFactoryRecursive.d.ts.map +1 -1
  689. package/dist/simple-tree/schemaFactoryRecursive.js +1 -115
  690. package/dist/simple-tree/schemaFactoryRecursive.js.map +1 -1
  691. package/dist/simple-tree/schemaTypes.d.ts +123 -70
  692. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  693. package/dist/simple-tree/schemaTypes.js +86 -5
  694. package/dist/simple-tree/schemaTypes.js.map +1 -1
  695. package/dist/simple-tree/testRecursiveDomain.d.ts +8 -8
  696. package/dist/simple-tree/testRecursiveDomain.d.ts.map +1 -1
  697. package/dist/simple-tree/testRecursiveDomain.js +2 -2
  698. package/dist/simple-tree/testRecursiveDomain.js.map +1 -1
  699. package/dist/simple-tree/toFlexSchema.d.ts +8 -20
  700. package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
  701. package/dist/simple-tree/toFlexSchema.js +33 -41
  702. package/dist/simple-tree/toFlexSchema.js.map +1 -1
  703. package/dist/simple-tree/toMapTree.d.ts +12 -22
  704. package/dist/simple-tree/toMapTree.d.ts.map +1 -1
  705. package/dist/simple-tree/toMapTree.js +185 -136
  706. package/dist/simple-tree/toMapTree.js.map +1 -1
  707. package/dist/simple-tree/tree.d.ts +20 -3
  708. package/dist/simple-tree/tree.d.ts.map +1 -1
  709. package/dist/simple-tree/tree.js.map +1 -1
  710. package/dist/simple-tree/treeApi.d.ts +82 -5
  711. package/dist/simple-tree/treeApi.d.ts.map +1 -1
  712. package/dist/simple-tree/treeApi.js +96 -18
  713. package/dist/simple-tree/treeApi.js.map +1 -1
  714. package/dist/simple-tree/types.d.ts +1 -142
  715. package/dist/simple-tree/types.d.ts.map +1 -1
  716. package/dist/simple-tree/types.js.map +1 -1
  717. package/dist/simple-tree/typesUnsafe.d.ts +32 -17
  718. package/dist/simple-tree/typesUnsafe.d.ts.map +1 -1
  719. package/dist/simple-tree/typesUnsafe.js.map +1 -1
  720. package/dist/treeFactory.d.ts +31 -14
  721. package/dist/treeFactory.d.ts.map +1 -1
  722. package/dist/treeFactory.js +50 -23
  723. package/dist/treeFactory.js.map +1 -1
  724. package/dist/util/brand.d.ts +26 -114
  725. package/dist/util/brand.d.ts.map +1 -1
  726. package/dist/util/brand.js +24 -91
  727. package/dist/util/brand.js.map +1 -1
  728. package/dist/util/idAllocator.d.ts.map +1 -1
  729. package/dist/util/idAllocator.js +2 -2
  730. package/dist/util/idAllocator.js.map +1 -1
  731. package/dist/util/index.d.ts +5 -3
  732. package/dist/util/index.d.ts.map +1 -1
  733. package/dist/util/index.js +8 -9
  734. package/dist/util/index.js.map +1 -1
  735. package/dist/util/nestedSet.d.ts.map +1 -1
  736. package/dist/util/nestedSet.js.map +1 -1
  737. package/dist/util/opaque.d.ts +46 -0
  738. package/dist/util/opaque.d.ts.map +1 -0
  739. package/dist/util/opaque.js +29 -0
  740. package/dist/util/opaque.js.map +1 -0
  741. package/dist/util/referenceCounting.d.ts +1 -1
  742. package/dist/util/referenceCounting.d.ts.map +1 -1
  743. package/dist/util/referenceCounting.js +3 -3
  744. package/dist/util/referenceCounting.js.map +1 -1
  745. package/dist/util/typeCheckTests.d.ts +1 -1
  746. package/dist/util/typeCheckTests.d.ts.map +1 -1
  747. package/dist/util/typeCheckTests.js.map +1 -1
  748. package/dist/util/typeUtils.d.ts +13 -0
  749. package/dist/util/typeUtils.d.ts.map +1 -1
  750. package/dist/util/typeUtils.js.map +1 -1
  751. package/dist/util/typeboxBrand.d.ts +17 -0
  752. package/dist/util/typeboxBrand.d.ts.map +1 -0
  753. package/dist/util/typeboxBrand.js +32 -0
  754. package/dist/util/typeboxBrand.js.map +1 -0
  755. package/dist/util/utils.d.ts +2 -15
  756. package/dist/util/utils.d.ts.map +1 -1
  757. package/dist/util/utils.js +11 -11
  758. package/dist/util/utils.js.map +1 -1
  759. package/docs/main/compatibility.md +95 -0
  760. package/docs/main/schema2.md +3 -3
  761. package/docs/main/sequence-field/move-composition.md +46 -0
  762. package/docs/main/tree-content-apis.md +5 -5
  763. package/docs/roadmap.md +4 -4
  764. package/internal.d.ts +11 -0
  765. package/lib/beta.d.ts +90 -0
  766. package/lib/codec/codec.d.ts +10 -4
  767. package/lib/codec/codec.d.ts.map +1 -1
  768. package/lib/codec/codec.js +2 -2
  769. package/lib/codec/codec.js.map +1 -1
  770. package/lib/codec/discriminatedUnions.d.ts.map +1 -1
  771. package/lib/codec/discriminatedUnions.js +5 -1
  772. package/lib/codec/discriminatedUnions.js.map +1 -1
  773. package/lib/codec/index.d.ts +2 -2
  774. package/lib/codec/index.d.ts.map +1 -1
  775. package/lib/codec/index.js +1 -1
  776. package/lib/codec/index.js.map +1 -1
  777. package/lib/codec/noopValidator.d.ts.map +1 -1
  778. package/lib/codec/noopValidator.js.map +1 -1
  779. package/lib/codec/versioned/codec.d.ts +10 -2
  780. package/lib/codec/versioned/codec.d.ts.map +1 -1
  781. package/lib/codec/versioned/codec.js +25 -4
  782. package/lib/codec/versioned/codec.js.map +1 -1
  783. package/lib/codec/versioned/index.d.ts +1 -1
  784. package/lib/codec/versioned/index.d.ts.map +1 -1
  785. package/lib/codec/versioned/index.js +1 -1
  786. package/lib/codec/versioned/index.js.map +1 -1
  787. package/lib/core/change-family/changeFamily.d.ts +2 -2
  788. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  789. package/lib/core/change-family/changeFamily.js.map +1 -1
  790. package/lib/core/forest/editableForest.d.ts +1 -1
  791. package/lib/core/forest/editableForest.d.ts.map +1 -1
  792. package/lib/core/forest/editableForest.js +2 -2
  793. package/lib/core/forest/editableForest.js.map +1 -1
  794. package/lib/core/forest/forest.d.ts +5 -1
  795. package/lib/core/forest/forest.d.ts.map +1 -1
  796. package/lib/core/forest/forest.js +1 -1
  797. package/lib/core/forest/forest.js.map +1 -1
  798. package/lib/core/index.d.ts +3 -3
  799. package/lib/core/index.d.ts.map +1 -1
  800. package/lib/core/index.js +3 -3
  801. package/lib/core/index.js.map +1 -1
  802. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  803. package/lib/core/rebase/changeRebaser.js.map +1 -1
  804. package/lib/core/rebase/index.d.ts +1 -1
  805. package/lib/core/rebase/index.d.ts.map +1 -1
  806. package/lib/core/rebase/index.js +1 -1
  807. package/lib/core/rebase/index.js.map +1 -1
  808. package/lib/core/rebase/revisionTagCodec.d.ts.map +1 -1
  809. package/lib/core/rebase/revisionTagCodec.js +1 -1
  810. package/lib/core/rebase/revisionTagCodec.js.map +1 -1
  811. package/lib/core/rebase/types.d.ts +30 -0
  812. package/lib/core/rebase/types.d.ts.map +1 -1
  813. package/lib/core/rebase/types.js +23 -0
  814. package/lib/core/rebase/types.js.map +1 -1
  815. package/lib/core/rebase/utils.d.ts.map +1 -1
  816. package/lib/core/rebase/utils.js +6 -5
  817. package/lib/core/rebase/utils.js.map +1 -1
  818. package/lib/core/revertible/index.d.ts +1 -1
  819. package/lib/core/revertible/index.d.ts.map +1 -1
  820. package/lib/core/revertible/index.js +1 -1
  821. package/lib/core/revertible/index.js.map +1 -1
  822. package/lib/core/revertible/revertible.d.ts +15 -49
  823. package/lib/core/revertible/revertible.d.ts.map +1 -1
  824. package/lib/core/revertible/revertible.js +2 -32
  825. package/lib/core/revertible/revertible.js.map +1 -1
  826. package/lib/core/schema-stored/format.d.ts.map +1 -1
  827. package/lib/core/schema-stored/format.js.map +1 -1
  828. package/lib/core/schema-stored/index.d.ts +2 -1
  829. package/lib/core/schema-stored/index.d.ts.map +1 -1
  830. package/lib/core/schema-stored/index.js +2 -1
  831. package/lib/core/schema-stored/index.js.map +1 -1
  832. package/lib/core/schema-stored/multiplicity.d.ts.map +1 -0
  833. package/lib/core/schema-stored/multiplicity.js.map +1 -0
  834. package/lib/core/schema-stored/schema.d.ts +32 -9
  835. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  836. package/lib/core/schema-stored/schema.js +13 -7
  837. package/lib/core/schema-stored/schema.js.map +1 -1
  838. package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  839. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  840. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  841. package/lib/core/tree/anchorSet.d.ts +31 -16
  842. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  843. package/lib/core/tree/anchorSet.js +10 -35
  844. package/lib/core/tree/anchorSet.js.map +1 -1
  845. package/lib/core/tree/cursor.d.ts.map +1 -1
  846. package/lib/core/tree/cursor.js +1 -1
  847. package/lib/core/tree/cursor.js.map +1 -1
  848. package/lib/core/tree/delta.d.ts.map +1 -1
  849. package/lib/core/tree/delta.js.map +1 -1
  850. package/lib/core/tree/deltaUtil.d.ts +1 -1
  851. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  852. package/lib/core/tree/deltaUtil.js.map +1 -1
  853. package/lib/core/tree/detachedFieldIndex.d.ts +2 -2
  854. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  855. package/lib/core/tree/detachedFieldIndex.js +2 -2
  856. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  857. package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
  858. package/lib/core/tree/detachedFieldIndexCodec.js +1 -1
  859. package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
  860. package/lib/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
  861. package/lib/core/tree/detachedFieldIndexFormat.js.map +1 -1
  862. package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  863. package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
  864. package/lib/core/tree/mapTree.d.ts.map +1 -1
  865. package/lib/core/tree/mapTree.js.map +1 -1
  866. package/lib/core/tree/pathTree.d.ts.map +1 -1
  867. package/lib/core/tree/pathTree.js.map +1 -1
  868. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  869. package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
  870. package/lib/core/tree/sparseTree.d.ts.map +1 -1
  871. package/lib/core/tree/sparseTree.js +1 -1
  872. package/lib/core/tree/sparseTree.js.map +1 -1
  873. package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
  874. package/lib/core/tree/treeTextFormat.js.map +1 -1
  875. package/lib/core/tree/types.d.ts +1 -1
  876. package/lib/core/tree/types.d.ts.map +1 -1
  877. package/lib/core/tree/types.js +1 -1
  878. package/lib/core/tree/types.js.map +1 -1
  879. package/lib/core/tree/visitDelta.d.ts +13 -2
  880. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  881. package/lib/core/tree/visitDelta.js +43 -14
  882. package/lib/core/tree/visitDelta.js.map +1 -1
  883. package/lib/core/tree/visitPath.d.ts +1 -1
  884. package/lib/core/tree/visitPath.d.ts.map +1 -1
  885. package/lib/core/tree/visitPath.js +4 -0
  886. package/lib/core/tree/visitPath.js.map +1 -1
  887. package/lib/core/tree/visitorUtils.d.ts +4 -4
  888. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  889. package/lib/core/tree/visitorUtils.js +1 -1
  890. package/lib/core/tree/visitorUtils.js.map +1 -1
  891. package/lib/domains/json/jsonCursor.d.ts.map +1 -1
  892. package/lib/domains/json/jsonCursor.js +1 -1
  893. package/lib/domains/json/jsonCursor.js.map +1 -1
  894. package/lib/domains/json/jsonDomainSchema.d.ts.map +1 -1
  895. package/lib/domains/json/jsonDomainSchema.js.map +1 -1
  896. package/lib/domains/leafDomain.d.ts.map +1 -1
  897. package/lib/domains/leafDomain.js +1 -1
  898. package/lib/domains/leafDomain.js.map +1 -1
  899. package/lib/domains/nodeKey/nodeKeySchema.d.ts.map +1 -1
  900. package/lib/domains/nodeKey/nodeKeySchema.js +2 -2
  901. package/lib/domains/nodeKey/nodeKeySchema.js.map +1 -1
  902. package/lib/domains/schemaBuilder.d.ts +19 -81
  903. package/lib/domains/schemaBuilder.d.ts.map +1 -1
  904. package/lib/domains/schemaBuilder.js +24 -92
  905. package/lib/domains/schemaBuilder.js.map +1 -1
  906. package/lib/domains/testRecursiveDomain.d.ts +0 -4
  907. package/lib/domains/testRecursiveDomain.d.ts.map +1 -1
  908. package/lib/domains/testRecursiveDomain.js +1 -8
  909. package/lib/domains/testRecursiveDomain.js.map +1 -1
  910. package/lib/events/events.d.ts.map +1 -1
  911. package/lib/events/events.js +1 -1
  912. package/lib/events/events.js.map +1 -1
  913. package/lib/external-utilities/typeboxValidator.d.ts.map +1 -1
  914. package/lib/external-utilities/typeboxValidator.js.map +1 -1
  915. package/lib/feature-libraries/changeAtomIdCodec.d.ts +1 -1
  916. package/lib/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  917. package/lib/feature-libraries/changeAtomIdCodec.js.map +1 -1
  918. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts +3 -3
  919. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  920. package/lib/feature-libraries/chunked-forest/basicChunk.js +4 -4
  921. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  922. package/lib/feature-libraries/chunked-forest/chunk.d.ts +1 -1
  923. package/lib/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
  924. package/lib/feature-libraries/chunked-forest/chunk.js +1 -1
  925. package/lib/feature-libraries/chunked-forest/chunk.js.map +1 -1
  926. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +2 -2
  927. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  928. package/lib/feature-libraries/chunked-forest/chunkTree.js +5 -6
  929. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  930. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -2
  931. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  932. package/lib/feature-libraries/chunked-forest/chunkedForest.js +4 -3
  933. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  934. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +2 -2
  935. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
  936. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +1 -1
  937. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  938. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  939. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  940. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +3 -3
  941. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  942. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +2 -2
  943. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  944. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +1 -1
  945. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  946. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -1
  947. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  948. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  949. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -9
  950. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  951. package/lib/feature-libraries/chunked-forest/codec/codecs.js +4 -3
  952. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  953. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +3 -3
  954. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  955. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
  956. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  957. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +1 -1
  958. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  959. package/lib/feature-libraries/chunked-forest/codec/format.js +2 -3
  960. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  961. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +1 -1
  962. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  963. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  964. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  965. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  966. package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts +2 -2
  967. package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
  968. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +1 -1
  969. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
  970. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts +3 -3
  971. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +1 -1
  972. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js +3 -4
  973. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
  974. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  975. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  976. package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  977. package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  978. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  979. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  980. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  981. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  982. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  983. package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -1
  984. package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  985. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +3 -3
  986. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  987. package/lib/feature-libraries/chunked-forest/uniformChunk.js +4 -4
  988. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  989. package/lib/feature-libraries/contextuallyTyped.d.ts +5 -9
  990. package/lib/feature-libraries/contextuallyTyped.d.ts.map +1 -1
  991. package/lib/feature-libraries/contextuallyTyped.js +6 -20
  992. package/lib/feature-libraries/contextuallyTyped.js.map +1 -1
  993. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -5
  994. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  995. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -6
  996. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  997. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +18 -4
  998. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  999. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +55 -20
  1000. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  1001. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  1002. package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  1003. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  1004. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  1005. package/lib/feature-libraries/default-schema/index.js +1 -1
  1006. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  1007. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +8 -0
  1008. package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -0
  1009. package/lib/feature-libraries/default-schema/noChangeCodecs.js +7 -0
  1010. package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -0
  1011. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +1 -1
  1012. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  1013. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +1 -1
  1014. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  1015. package/lib/feature-libraries/editableTreeBinder.d.ts.map +1 -1
  1016. package/lib/feature-libraries/editableTreeBinder.js +1 -1
  1017. package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
  1018. package/lib/feature-libraries/fieldGenerator.d.ts +1 -1
  1019. package/lib/feature-libraries/fieldGenerator.d.ts.map +1 -1
  1020. package/lib/feature-libraries/fieldGenerator.js.map +1 -1
  1021. package/lib/feature-libraries/flex-tree/context.d.ts +16 -4
  1022. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  1023. package/lib/feature-libraries/flex-tree/context.js +17 -5
  1024. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  1025. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +43 -36
  1026. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  1027. package/lib/feature-libraries/flex-tree/flexTreeTypes.js +8 -5
  1028. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  1029. package/lib/feature-libraries/flex-tree/index.d.ts +3 -3
  1030. package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
  1031. package/lib/feature-libraries/flex-tree/index.js +2 -2
  1032. package/lib/feature-libraries/flex-tree/index.js.map +1 -1
  1033. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +7 -8
  1034. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  1035. package/lib/feature-libraries/flex-tree/lazyEntity.js +8 -12
  1036. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  1037. package/lib/feature-libraries/flex-tree/lazyField.d.ts +21 -7
  1038. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  1039. package/lib/feature-libraries/flex-tree/lazyField.js +43 -22
  1040. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  1041. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +12 -9
  1042. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  1043. package/lib/feature-libraries/flex-tree/lazyNode.js +35 -80
  1044. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  1045. package/lib/feature-libraries/flex-tree/nodeKeys.d.ts.map +1 -1
  1046. package/lib/feature-libraries/flex-tree/nodeKeys.js.map +1 -1
  1047. package/lib/feature-libraries/flex-tree/treeEvents.d.ts +7 -70
  1048. package/lib/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
  1049. package/lib/feature-libraries/flex-tree/treeEvents.js.map +1 -1
  1050. package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  1051. package/lib/feature-libraries/flex-tree/unboxed.js +1 -1
  1052. package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
  1053. package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  1054. package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
  1055. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  1056. package/lib/feature-libraries/forest-summary/codec.js +1 -1
  1057. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  1058. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -3
  1059. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  1060. package/lib/feature-libraries/forest-summary/forestSummarizer.js +3 -3
  1061. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  1062. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  1063. package/lib/feature-libraries/forest-summary/format.js +1 -1
  1064. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  1065. package/lib/feature-libraries/index.d.ts +8 -9
  1066. package/lib/feature-libraries/index.d.ts.map +1 -1
  1067. package/lib/feature-libraries/index.js +6 -7
  1068. package/lib/feature-libraries/index.js.map +1 -1
  1069. package/lib/feature-libraries/mapTreeCursor.d.ts +1 -1
  1070. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  1071. package/lib/feature-libraries/mapTreeCursor.js +2 -2
  1072. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  1073. package/lib/feature-libraries/memoizedIdRangeAllocator.js +1 -1
  1074. package/lib/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
  1075. package/lib/feature-libraries/modular-schema/comparison.d.ts +1 -1
  1076. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  1077. package/lib/feature-libraries/modular-schema/comparison.js +3 -3
  1078. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  1079. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +19 -13
  1080. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  1081. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  1082. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +3 -4
  1083. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  1084. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  1085. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +21 -0
  1086. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -0
  1087. package/lib/{test/codec/codec.spec.d.ts → feature-libraries/modular-schema/fieldKindConfiguration.js} +1 -1
  1088. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -0
  1089. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +1 -2
  1090. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
  1091. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +3 -3
  1092. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
  1093. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  1094. package/lib/feature-libraries/modular-schema/genericFieldKind.js +3 -7
  1095. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  1096. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +3 -5
  1097. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
  1098. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +7 -7
  1099. package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  1100. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +1 -1
  1101. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  1102. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js +1 -1
  1103. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  1104. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +4 -4
  1105. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
  1106. package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  1107. package/lib/feature-libraries/modular-schema/index.d.ts +5 -4
  1108. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  1109. package/lib/feature-libraries/modular-schema/index.js +2 -2
  1110. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  1111. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +1 -1
  1112. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  1113. package/lib/feature-libraries/modular-schema/isNeverTree.js +6 -7
  1114. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  1115. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +4 -5
  1116. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  1117. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +63 -27
  1118. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  1119. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +13 -25
  1120. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  1121. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +202 -110
  1122. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  1123. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +5 -12
  1124. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  1125. package/lib/feature-libraries/modular-schema/modularChangeFormat.js +2 -12
  1126. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  1127. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +6 -4
  1128. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  1129. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  1130. package/lib/feature-libraries/node-key/nodeKey.d.ts +1 -1
  1131. package/lib/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
  1132. package/lib/feature-libraries/node-key/nodeKey.js.map +1 -1
  1133. package/lib/feature-libraries/node-key/nodeKeyIndex.d.ts +2 -2
  1134. package/lib/feature-libraries/node-key/nodeKeyIndex.d.ts.map +1 -1
  1135. package/lib/feature-libraries/node-key/nodeKeyIndex.js +2 -2
  1136. package/lib/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
  1137. package/lib/feature-libraries/node-key/nodeKeyManager.d.ts +2 -2
  1138. package/lib/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
  1139. package/lib/feature-libraries/node-key/nodeKeyManager.js +2 -2
  1140. package/lib/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
  1141. package/lib/feature-libraries/object-forest/objectForest.d.ts +1 -1
  1142. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  1143. package/lib/feature-libraries/object-forest/objectForest.js +6 -5
  1144. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  1145. package/lib/feature-libraries/optional-field/index.d.ts +1 -1
  1146. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  1147. package/lib/feature-libraries/optional-field/index.js +1 -1
  1148. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  1149. package/lib/feature-libraries/optional-field/optionalField.d.ts +3 -5
  1150. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  1151. package/lib/feature-libraries/optional-field/optionalField.js +18 -22
  1152. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  1153. package/lib/feature-libraries/optional-field/{optionalFieldChangeFormat.d.ts → optionalFieldChangeFormatV1.d.ts} +1 -1
  1154. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -0
  1155. package/lib/feature-libraries/optional-field/{optionalFieldChangeFormat.js → optionalFieldChangeFormatV1.js} +11 -2
  1156. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -0
  1157. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +25 -0
  1158. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -0
  1159. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +40 -0
  1160. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -0
  1161. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +4 -7
  1162. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  1163. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  1164. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +12 -0
  1165. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +1 -0
  1166. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js +154 -0
  1167. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +1 -0
  1168. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +12 -0
  1169. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -0
  1170. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +83 -0
  1171. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -0
  1172. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -4
  1173. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  1174. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +7 -150
  1175. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  1176. package/lib/feature-libraries/schema-aware/schemaAware.d.ts +3 -4
  1177. package/lib/feature-libraries/schema-aware/schemaAware.d.ts.map +1 -1
  1178. package/lib/feature-libraries/schema-aware/schemaAware.js +1 -1
  1179. package/lib/feature-libraries/schema-aware/schemaAware.js.map +1 -1
  1180. package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
  1181. package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
  1182. package/lib/feature-libraries/schema-edits/index.js +1 -1
  1183. package/lib/feature-libraries/schema-edits/index.js.map +1 -1
  1184. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -3
  1185. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  1186. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +10 -2
  1187. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  1188. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  1189. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  1190. package/lib/feature-libraries/schema-edits/schemaChangeTypes.d.ts +5 -0
  1191. package/lib/feature-libraries/schema-edits/schemaChangeTypes.d.ts.map +1 -1
  1192. package/lib/feature-libraries/schema-edits/schemaChangeTypes.js.map +1 -1
  1193. package/lib/feature-libraries/schema-index/codec.d.ts +1 -1
  1194. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  1195. package/lib/feature-libraries/schema-index/codec.js +3 -3
  1196. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  1197. package/lib/feature-libraries/schema-index/format.d.ts.map +1 -1
  1198. package/lib/feature-libraries/schema-index/format.js.map +1 -1
  1199. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
  1200. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  1201. package/lib/feature-libraries/schema-index/schemaSummarizer.js +2 -2
  1202. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  1203. package/lib/feature-libraries/schemaBuilder.d.ts +1 -1
  1204. package/lib/feature-libraries/schemaBuilder.d.ts.map +1 -1
  1205. package/lib/feature-libraries/schemaBuilder.js +1 -1
  1206. package/lib/feature-libraries/schemaBuilder.js.map +1 -1
  1207. package/lib/feature-libraries/schemaBuilderBase.d.ts +1 -1
  1208. package/lib/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
  1209. package/lib/feature-libraries/schemaBuilderBase.js +2 -2
  1210. package/lib/feature-libraries/schemaBuilderBase.js.map +1 -1
  1211. package/lib/feature-libraries/sequence-field/compose.d.ts +9 -13
  1212. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  1213. package/lib/feature-libraries/sequence-field/compose.js +63 -30
  1214. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  1215. package/lib/feature-libraries/sequence-field/format.d.ts.map +1 -1
  1216. package/lib/feature-libraries/sequence-field/format.js +1 -1
  1217. package/lib/feature-libraries/sequence-field/format.js.map +1 -1
  1218. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +3 -3
  1219. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  1220. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  1221. package/lib/feature-libraries/sequence-field/index.d.ts +5 -5
  1222. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  1223. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  1224. package/lib/feature-libraries/sequence-field/invert.d.ts +1 -2
  1225. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  1226. package/lib/feature-libraries/sequence-field/invert.js +20 -29
  1227. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  1228. package/lib/feature-libraries/sequence-field/markListFactory.d.ts +4 -4
  1229. package/lib/feature-libraries/sequence-field/markListFactory.d.ts.map +1 -1
  1230. package/lib/feature-libraries/sequence-field/markListFactory.js.map +1 -1
  1231. package/lib/feature-libraries/sequence-field/markQueue.d.ts +7 -7
  1232. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  1233. package/lib/feature-libraries/sequence-field/markQueue.js +1 -1
  1234. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  1235. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +25 -14
  1236. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  1237. package/lib/feature-libraries/sequence-field/moveEffectTable.js +15 -6
  1238. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  1239. package/lib/feature-libraries/sequence-field/prune.d.ts +2 -2
  1240. package/lib/feature-libraries/sequence-field/prune.d.ts.map +1 -1
  1241. package/lib/feature-libraries/sequence-field/prune.js.map +1 -1
  1242. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -4
  1243. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  1244. package/lib/feature-libraries/sequence-field/rebase.js +11 -17
  1245. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  1246. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +2 -2
  1247. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
  1248. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +2 -2
  1249. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  1250. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts +1 -1
  1251. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  1252. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +1 -1
  1253. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  1254. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +2 -2
  1255. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
  1256. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js +1 -1
  1257. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
  1258. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -3
  1259. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  1260. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +13 -15
  1261. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  1262. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +17 -17
  1263. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  1264. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +1 -1
  1265. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  1266. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -3
  1267. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  1268. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +7 -7
  1269. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  1270. package/lib/feature-libraries/sequence-field/types.d.ts +7 -8
  1271. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  1272. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  1273. package/lib/feature-libraries/sequence-field/utils.d.ts +42 -35
  1274. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  1275. package/lib/feature-libraries/sequence-field/utils.js +28 -7
  1276. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  1277. package/lib/feature-libraries/storedToViewSchema.d.ts +2 -2
  1278. package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  1279. package/lib/feature-libraries/storedToViewSchema.js +3 -3
  1280. package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
  1281. package/lib/feature-libraries/treeCursorUtils.d.ts +1 -1
  1282. package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  1283. package/lib/feature-libraries/treeCursorUtils.js +2 -2
  1284. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  1285. package/lib/feature-libraries/treeTextCursor.d.ts +1 -1
  1286. package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
  1287. package/lib/feature-libraries/treeTextCursor.js +2 -2
  1288. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  1289. package/lib/feature-libraries/typed-schema/flexList.d.ts +1 -2
  1290. package/lib/feature-libraries/typed-schema/flexList.d.ts.map +1 -1
  1291. package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
  1292. package/lib/feature-libraries/typed-schema/index.d.ts +0 -1
  1293. package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
  1294. package/lib/feature-libraries/typed-schema/index.js.map +1 -1
  1295. package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  1296. package/lib/feature-libraries/typed-schema/schemaCollection.js +4 -4
  1297. package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  1298. package/lib/feature-libraries/typed-schema/typeUtils.d.ts +0 -5
  1299. package/lib/feature-libraries/typed-schema/typeUtils.d.ts.map +1 -1
  1300. package/lib/feature-libraries/typed-schema/typeUtils.js.map +1 -1
  1301. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +5 -4
  1302. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  1303. package/lib/feature-libraries/typed-schema/typedTreeSchema.js +16 -8
  1304. package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  1305. package/lib/feature-libraries/typed-schema/view.d.ts +1 -1
  1306. package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
  1307. package/lib/feature-libraries/typed-schema/view.js +1 -1
  1308. package/lib/feature-libraries/typed-schema/view.js.map +1 -1
  1309. package/lib/feature-libraries/valueUtilities.d.ts +6 -3
  1310. package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
  1311. package/lib/feature-libraries/valueUtilities.js +8 -7
  1312. package/lib/feature-libraries/valueUtilities.js.map +1 -1
  1313. package/lib/index.d.ts +7 -7
  1314. package/lib/index.d.ts.map +1 -1
  1315. package/lib/index.js +5 -7
  1316. package/lib/index.js.map +1 -1
  1317. package/lib/packageVersion.d.ts +1 -1
  1318. package/lib/packageVersion.js +1 -1
  1319. package/lib/packageVersion.js.map +1 -1
  1320. package/lib/public.d.ts +90 -0
  1321. package/lib/shared-tree/index.d.ts +3 -3
  1322. package/lib/shared-tree/index.d.ts.map +1 -1
  1323. package/lib/shared-tree/index.js +2 -2
  1324. package/lib/shared-tree/index.js.map +1 -1
  1325. package/lib/shared-tree/schematizeTree.d.ts +1 -1
  1326. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  1327. package/lib/shared-tree/schematizeTree.js +6 -6
  1328. package/lib/shared-tree/schematizeTree.js.map +1 -1
  1329. package/lib/shared-tree/schematizingTreeView.d.ts +10 -3
  1330. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  1331. package/lib/shared-tree/schematizingTreeView.js +21 -21
  1332. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  1333. package/lib/shared-tree/sharedTree.d.ts +58 -8
  1334. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  1335. package/lib/shared-tree/sharedTree.js +43 -10
  1336. package/lib/shared-tree/sharedTree.js.map +1 -1
  1337. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +3 -5
  1338. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  1339. package/lib/shared-tree/sharedTreeChangeCodecs.js +18 -10
  1340. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  1341. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +1 -0
  1342. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  1343. package/lib/shared-tree/sharedTreeChangeFamily.js +7 -5
  1344. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  1345. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +4 -188
  1346. package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  1347. package/lib/shared-tree/sharedTreeChangeFormat.js +3 -3
  1348. package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  1349. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  1350. package/lib/shared-tree/sharedTreeEditBuilder.js +4 -1
  1351. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  1352. package/lib/shared-tree/treeApi.d.ts +83 -2
  1353. package/lib/shared-tree/treeApi.d.ts.map +1 -1
  1354. package/lib/shared-tree/treeApi.js +30 -7
  1355. package/lib/shared-tree/treeApi.js.map +1 -1
  1356. package/lib/shared-tree/treeCheckout.d.ts +41 -20
  1357. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  1358. package/lib/shared-tree/treeCheckout.js +115 -41
  1359. package/lib/shared-tree/treeCheckout.js.map +1 -1
  1360. package/lib/shared-tree/treeView.d.ts +3 -3
  1361. package/lib/shared-tree/treeView.d.ts.map +1 -1
  1362. package/lib/shared-tree/treeView.js.map +1 -1
  1363. package/lib/shared-tree-core/branch.d.ts +5 -32
  1364. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  1365. package/lib/shared-tree-core/branch.js +9 -139
  1366. package/lib/shared-tree-core/branch.js.map +1 -1
  1367. package/lib/shared-tree-core/editManager.d.ts +2 -15
  1368. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  1369. package/lib/shared-tree-core/editManager.js +4 -48
  1370. package/lib/shared-tree-core/editManager.js.map +1 -1
  1371. package/lib/shared-tree-core/editManagerCodecs.d.ts +4 -4
  1372. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  1373. package/lib/shared-tree-core/editManagerCodecs.js +19 -6
  1374. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  1375. package/lib/shared-tree-core/editManagerFormat.d.ts +4 -5
  1376. package/lib/shared-tree-core/editManagerFormat.d.ts.map +1 -1
  1377. package/lib/shared-tree-core/editManagerFormat.js +2 -3
  1378. package/lib/shared-tree-core/editManagerFormat.js.map +1 -1
  1379. package/lib/shared-tree-core/editManagerSummarizer.d.ts +7 -6
  1380. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  1381. package/lib/shared-tree-core/editManagerSummarizer.js +4 -7
  1382. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  1383. package/lib/shared-tree-core/index.d.ts +1 -1
  1384. package/lib/shared-tree-core/index.d.ts.map +1 -1
  1385. package/lib/shared-tree-core/index.js.map +1 -1
  1386. package/lib/shared-tree-core/messageCodecs.d.ts +7 -4
  1387. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  1388. package/lib/shared-tree-core/messageCodecs.js +19 -3
  1389. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  1390. package/lib/shared-tree-core/messageFormat.d.ts +10 -2
  1391. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  1392. package/lib/shared-tree-core/messageFormat.js +1 -0
  1393. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  1394. package/lib/shared-tree-core/messageTypes.d.ts.map +1 -1
  1395. package/lib/shared-tree-core/messageTypes.js.map +1 -1
  1396. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  1397. package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
  1398. package/lib/shared-tree-core/sharedTreeCore.d.ts +10 -5
  1399. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  1400. package/lib/shared-tree-core/sharedTreeCore.js +12 -12
  1401. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  1402. package/lib/simple-tree/arrayNode.d.ts +187 -0
  1403. package/lib/simple-tree/arrayNode.d.ts.map +1 -0
  1404. package/lib/simple-tree/arrayNode.js +433 -0
  1405. package/lib/simple-tree/arrayNode.js.map +1 -0
  1406. package/lib/simple-tree/index.d.ts +10 -8
  1407. package/lib/simple-tree/index.d.ts.map +1 -1
  1408. package/lib/simple-tree/index.js +4 -4
  1409. package/lib/simple-tree/index.js.map +1 -1
  1410. package/lib/simple-tree/leafNodeSchema.d.ts +11 -0
  1411. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -0
  1412. package/lib/simple-tree/leafNodeSchema.js +48 -0
  1413. package/lib/simple-tree/leafNodeSchema.js.map +1 -0
  1414. package/lib/simple-tree/mapNode.d.ts +86 -0
  1415. package/lib/simple-tree/mapNode.d.ts.map +1 -0
  1416. package/lib/simple-tree/mapNode.js +198 -0
  1417. package/lib/simple-tree/mapNode.js.map +1 -0
  1418. package/lib/simple-tree/objectNode.d.ts +62 -0
  1419. package/lib/simple-tree/objectNode.d.ts.map +1 -0
  1420. package/lib/simple-tree/objectNode.js +236 -0
  1421. package/lib/simple-tree/objectNode.js.map +1 -0
  1422. package/lib/simple-tree/proxies.d.ts +21 -62
  1423. package/lib/simple-tree/proxies.d.ts.map +1 -1
  1424. package/lib/simple-tree/proxies.js +119 -667
  1425. package/lib/simple-tree/proxies.js.map +1 -1
  1426. package/lib/simple-tree/proxyBinding.d.ts +48 -0
  1427. package/lib/simple-tree/proxyBinding.d.ts.map +1 -0
  1428. package/lib/simple-tree/proxyBinding.js +124 -0
  1429. package/lib/simple-tree/proxyBinding.js.map +1 -0
  1430. package/lib/simple-tree/rawNode.d.ts +9 -50
  1431. package/lib/simple-tree/rawNode.d.ts.map +1 -1
  1432. package/lib/simple-tree/rawNode.js +12 -85
  1433. package/lib/simple-tree/rawNode.js.map +1 -1
  1434. package/lib/simple-tree/schemaCaching.d.ts +26 -0
  1435. package/lib/simple-tree/schemaCaching.d.ts.map +1 -0
  1436. package/lib/simple-tree/schemaCaching.js +61 -0
  1437. package/lib/simple-tree/schemaCaching.js.map +1 -0
  1438. package/lib/simple-tree/schemaCreationUtilities.d.ts +2 -1
  1439. package/lib/simple-tree/schemaCreationUtilities.d.ts.map +1 -1
  1440. package/lib/simple-tree/schemaCreationUtilities.js +1 -1
  1441. package/lib/simple-tree/schemaCreationUtilities.js.map +1 -1
  1442. package/lib/simple-tree/schemaFactory.d.ts +92 -43
  1443. package/lib/simple-tree/schemaFactory.d.ts.map +1 -1
  1444. package/lib/simple-tree/schemaFactory.js +105 -157
  1445. package/lib/simple-tree/schemaFactory.js.map +1 -1
  1446. package/lib/simple-tree/schemaFactoryRecursive.d.ts +27 -83
  1447. package/lib/simple-tree/schemaFactoryRecursive.d.ts.map +1 -1
  1448. package/lib/simple-tree/schemaFactoryRecursive.js +1 -114
  1449. package/lib/simple-tree/schemaFactoryRecursive.js.map +1 -1
  1450. package/lib/simple-tree/schemaTypes.d.ts +123 -70
  1451. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  1452. package/lib/simple-tree/schemaTypes.js +81 -4
  1453. package/lib/simple-tree/schemaTypes.js.map +1 -1
  1454. package/lib/simple-tree/testRecursiveDomain.d.ts +8 -8
  1455. package/lib/simple-tree/testRecursiveDomain.d.ts.map +1 -1
  1456. package/lib/simple-tree/testRecursiveDomain.js +2 -2
  1457. package/lib/simple-tree/testRecursiveDomain.js.map +1 -1
  1458. package/lib/simple-tree/toFlexSchema.d.ts +8 -20
  1459. package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
  1460. package/lib/simple-tree/toFlexSchema.js +22 -27
  1461. package/lib/simple-tree/toFlexSchema.js.map +1 -1
  1462. package/lib/simple-tree/toMapTree.d.ts +12 -22
  1463. package/lib/simple-tree/toMapTree.d.ts.map +1 -1
  1464. package/lib/simple-tree/toMapTree.js +183 -133
  1465. package/lib/simple-tree/toMapTree.js.map +1 -1
  1466. package/lib/simple-tree/tree.d.ts +20 -3
  1467. package/lib/simple-tree/tree.d.ts.map +1 -1
  1468. package/lib/simple-tree/tree.js.map +1 -1
  1469. package/lib/simple-tree/treeApi.d.ts +82 -5
  1470. package/lib/simple-tree/treeApi.d.ts.map +1 -1
  1471. package/lib/simple-tree/treeApi.js +90 -12
  1472. package/lib/simple-tree/treeApi.js.map +1 -1
  1473. package/lib/simple-tree/types.d.ts +1 -142
  1474. package/lib/simple-tree/types.d.ts.map +1 -1
  1475. package/lib/simple-tree/types.js.map +1 -1
  1476. package/lib/simple-tree/typesUnsafe.d.ts +32 -17
  1477. package/lib/simple-tree/typesUnsafe.d.ts.map +1 -1
  1478. package/lib/simple-tree/typesUnsafe.js.map +1 -1
  1479. package/lib/treeFactory.d.ts +31 -14
  1480. package/lib/treeFactory.d.ts.map +1 -1
  1481. package/lib/treeFactory.js +48 -22
  1482. package/lib/treeFactory.js.map +1 -1
  1483. package/lib/util/brand.d.ts +26 -114
  1484. package/lib/util/brand.d.ts.map +1 -1
  1485. package/lib/util/brand.js +23 -83
  1486. package/lib/util/brand.js.map +1 -1
  1487. package/lib/util/idAllocator.d.ts.map +1 -1
  1488. package/lib/util/idAllocator.js +1 -1
  1489. package/lib/util/idAllocator.js.map +1 -1
  1490. package/lib/util/index.d.ts +5 -3
  1491. package/lib/util/index.d.ts.map +1 -1
  1492. package/lib/util/index.js +3 -1
  1493. package/lib/util/index.js.map +1 -1
  1494. package/lib/util/nestedSet.d.ts.map +1 -1
  1495. package/lib/util/nestedSet.js.map +1 -1
  1496. package/lib/util/opaque.d.ts +46 -0
  1497. package/lib/util/opaque.d.ts.map +1 -0
  1498. package/lib/util/opaque.js +24 -0
  1499. package/lib/util/opaque.js.map +1 -0
  1500. package/lib/util/referenceCounting.d.ts +1 -1
  1501. package/lib/util/referenceCounting.d.ts.map +1 -1
  1502. package/lib/util/referenceCounting.js +2 -2
  1503. package/lib/util/referenceCounting.js.map +1 -1
  1504. package/lib/util/typeCheckTests.d.ts +1 -1
  1505. package/lib/util/typeCheckTests.d.ts.map +1 -1
  1506. package/lib/util/typeCheckTests.js.map +1 -1
  1507. package/lib/util/typeUtils.d.ts +13 -0
  1508. package/lib/util/typeUtils.d.ts.map +1 -1
  1509. package/lib/util/typeUtils.js.map +1 -1
  1510. package/lib/util/typeboxBrand.d.ts +17 -0
  1511. package/lib/util/typeboxBrand.d.ts.map +1 -0
  1512. package/lib/util/typeboxBrand.js +27 -0
  1513. package/lib/util/typeboxBrand.js.map +1 -0
  1514. package/lib/util/utils.d.ts +2 -15
  1515. package/lib/util/utils.d.ts.map +1 -1
  1516. package/lib/util/utils.js +3 -3
  1517. package/lib/util/utils.js.map +1 -1
  1518. package/package.json +55 -50
  1519. package/src/codec/codec.ts +15 -7
  1520. package/src/codec/discriminatedUnions.ts +3 -1
  1521. package/src/codec/index.ts +8 -1
  1522. package/src/codec/noopValidator.ts +1 -0
  1523. package/src/codec/versioned/codec.ts +55 -25
  1524. package/src/codec/versioned/index.ts +5 -1
  1525. package/src/core/README.md +1 -5
  1526. package/src/core/change-family/changeFamily.ts +3 -2
  1527. package/src/core/forest/editableForest.ts +7 -5
  1528. package/src/core/forest/forest.ts +11 -4
  1529. package/src/core/index.ts +10 -8
  1530. package/src/core/rebase/changeRebaser.ts +1 -0
  1531. package/src/core/rebase/index.ts +4 -0
  1532. package/src/core/rebase/revisionTagCodec.ts +3 -1
  1533. package/src/core/rebase/types.ts +46 -1
  1534. package/src/core/rebase/utils.ts +9 -6
  1535. package/src/core/revertible/index.ts +1 -1
  1536. package/src/core/revertible/revertible.ts +17 -50
  1537. package/src/core/schema-stored/format.ts +1 -0
  1538. package/src/core/schema-stored/index.ts +5 -2
  1539. package/src/{feature-libraries → core/schema-stored}/multiplicity.ts +1 -0
  1540. package/src/core/schema-stored/schema.ts +51 -23
  1541. package/src/core/schema-stored/storedSchemaRepository.ts +4 -2
  1542. package/src/core/tree/anchorSet.ts +52 -63
  1543. package/src/core/tree/cursor.ts +3 -1
  1544. package/src/core/tree/delta.ts +1 -0
  1545. package/src/core/tree/deltaUtil.ts +2 -1
  1546. package/src/core/tree/detachedFieldIndex.ts +6 -4
  1547. package/src/core/tree/detachedFieldIndexCodec.ts +4 -2
  1548. package/src/core/tree/detachedFieldIndexFormat.ts +2 -0
  1549. package/src/core/tree/detachedFieldIndexTypes.ts +1 -0
  1550. package/src/core/tree/mapTree.ts +1 -0
  1551. package/src/core/tree/pathTree.ts +1 -0
  1552. package/src/core/tree/persistedTreeTextFormat.ts +1 -0
  1553. package/src/core/tree/sparseTree.ts +4 -2
  1554. package/src/core/tree/treeTextFormat.ts +1 -0
  1555. package/src/core/tree/types.ts +2 -1
  1556. package/src/core/tree/visitDelta.ts +65 -18
  1557. package/src/core/tree/visitPath.ts +2 -1
  1558. package/src/core/tree/visitorUtils.ts +7 -5
  1559. package/src/domains/json/jsonCursor.ts +6 -4
  1560. package/src/domains/json/jsonDomainSchema.ts +1 -2
  1561. package/src/domains/leafDomain.ts +1 -1
  1562. package/src/domains/nodeKey/nodeKeySchema.ts +5 -4
  1563. package/src/domains/schemaBuilder.ts +25 -214
  1564. package/src/domains/testRecursiveDomain.ts +2 -25
  1565. package/src/events/events.ts +2 -1
  1566. package/src/external-utilities/typeboxValidator.ts +2 -1
  1567. package/src/feature-libraries/README.md +4 -4
  1568. package/src/feature-libraries/changeAtomIdCodec.ts +4 -4
  1569. package/src/feature-libraries/chunked-forest/basicChunk.ts +12 -10
  1570. package/src/feature-libraries/chunked-forest/chunk.ts +3 -2
  1571. package/src/feature-libraries/chunked-forest/chunkTree.ts +17 -15
  1572. package/src/feature-libraries/chunked-forest/chunkedForest.ts +20 -17
  1573. package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +4 -3
  1574. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +16 -14
  1575. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +5 -3
  1576. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -1
  1577. package/src/feature-libraries/chunked-forest/codec/codecs.ts +9 -12
  1578. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +11 -9
  1579. package/src/feature-libraries/chunked-forest/codec/format.ts +4 -3
  1580. package/src/feature-libraries/chunked-forest/codec/index.ts +1 -6
  1581. package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +8 -6
  1582. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncoding.ts +13 -11
  1583. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +2 -1
  1584. package/src/feature-libraries/chunked-forest/emptyChunk.ts +5 -4
  1585. package/src/feature-libraries/chunked-forest/index.ts +0 -1
  1586. package/src/feature-libraries/chunked-forest/sequenceChunk.ts +3 -2
  1587. package/src/feature-libraries/chunked-forest/uniformChunk.ts +11 -9
  1588. package/src/feature-libraries/contextuallyTyped.ts +23 -36
  1589. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +36 -57
  1590. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +78 -25
  1591. package/src/feature-libraries/default-schema/defaultSchema.ts +1 -0
  1592. package/src/feature-libraries/default-schema/index.ts +2 -0
  1593. package/src/feature-libraries/default-schema/noChangeCodecs.ts +12 -0
  1594. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +4 -3
  1595. package/src/feature-libraries/editableTreeBinder.ts +3 -1
  1596. package/src/feature-libraries/fieldGenerator.ts +2 -1
  1597. package/src/feature-libraries/flex-tree/README.md +2 -2
  1598. package/src/feature-libraries/flex-tree/context.ts +34 -8
  1599. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +63 -45
  1600. package/src/feature-libraries/flex-tree/index.ts +3 -3
  1601. package/src/feature-libraries/flex-tree/lazyEntity.ts +13 -23
  1602. package/src/feature-libraries/flex-tree/lazyField.ts +95 -47
  1603. package/src/feature-libraries/flex-tree/lazyNode.ts +65 -131
  1604. package/src/feature-libraries/flex-tree/nodeKeys.ts +1 -0
  1605. package/src/feature-libraries/flex-tree/treeEvents.ts +7 -73
  1606. package/src/feature-libraries/flex-tree/unboxed.ts +3 -2
  1607. package/src/feature-libraries/flex-tree/utilities.ts +1 -0
  1608. package/src/feature-libraries/forest-summary/codec.ts +3 -1
  1609. package/src/feature-libraries/forest-summary/forestSummarizer.ts +13 -11
  1610. package/src/feature-libraries/forest-summary/format.ts +2 -1
  1611. package/src/feature-libraries/index.ts +13 -12
  1612. package/src/feature-libraries/mapTreeCursor.ts +8 -6
  1613. package/src/feature-libraries/memoizedIdRangeAllocator.ts +3 -3
  1614. package/src/feature-libraries/modular-schema/comparison.ts +11 -9
  1615. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +29 -28
  1616. package/src/feature-libraries/modular-schema/fieldKind.ts +8 -4
  1617. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +24 -0
  1618. package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +7 -5
  1619. package/src/feature-libraries/modular-schema/genericFieldKind.ts +12 -20
  1620. package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +18 -31
  1621. package/src/feature-libraries/modular-schema/genericFieldKindFormat.ts +2 -2
  1622. package/src/feature-libraries/modular-schema/genericFieldKindTypes.ts +4 -4
  1623. package/src/feature-libraries/modular-schema/index.ts +5 -2
  1624. package/src/feature-libraries/modular-schema/isNeverTree.ts +12 -12
  1625. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +151 -56
  1626. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +460 -251
  1627. package/src/feature-libraries/modular-schema/modularChangeFormat.ts +4 -22
  1628. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +7 -3
  1629. package/src/feature-libraries/node-key/nodeKey.ts +2 -1
  1630. package/src/feature-libraries/node-key/nodeKeyIndex.ts +5 -3
  1631. package/src/feature-libraries/node-key/nodeKeyManager.ts +6 -4
  1632. package/src/feature-libraries/object-forest/objectForest.ts +25 -23
  1633. package/src/feature-libraries/optional-field/index.ts +1 -1
  1634. package/src/feature-libraries/optional-field/optionalField.ts +38 -44
  1635. package/src/feature-libraries/optional-field/{optionalFieldChangeFormat.ts → optionalFieldChangeFormatV1.ts} +10 -1
  1636. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV2.ts +60 -0
  1637. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +4 -7
  1638. package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +204 -0
  1639. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +135 -0
  1640. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +11 -207
  1641. package/src/feature-libraries/schema-aware/README.md +1 -1
  1642. package/src/feature-libraries/schema-aware/schemaAware.ts +13 -9
  1643. package/src/feature-libraries/schema-edits/index.ts +1 -1
  1644. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +23 -3
  1645. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +1 -0
  1646. package/src/feature-libraries/schema-edits/schemaChangeTypes.ts +6 -0
  1647. package/src/feature-libraries/schema-index/codec.ts +8 -7
  1648. package/src/feature-libraries/schema-index/format.ts +1 -0
  1649. package/src/feature-libraries/schema-index/schemaSummarizer.ts +10 -8
  1650. package/src/feature-libraries/schemaBuilder.ts +2 -1
  1651. package/src/feature-libraries/schemaBuilderBase.ts +16 -14
  1652. package/src/feature-libraries/sequence-field/compose.ts +283 -176
  1653. package/src/feature-libraries/sequence-field/format.ts +2 -1
  1654. package/src/feature-libraries/sequence-field/helperTypes.ts +5 -5
  1655. package/src/feature-libraries/sequence-field/index.ts +4 -5
  1656. package/src/feature-libraries/sequence-field/invert.ts +49 -82
  1657. package/src/feature-libraries/sequence-field/markListFactory.ts +4 -4
  1658. package/src/feature-libraries/sequence-field/markQueue.ts +12 -10
  1659. package/src/feature-libraries/sequence-field/moveEffectTable.ts +61 -31
  1660. package/src/feature-libraries/sequence-field/prune.ts +4 -8
  1661. package/src/feature-libraries/sequence-field/rebase.ts +128 -141
  1662. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +9 -10
  1663. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +3 -2
  1664. package/src/feature-libraries/sequence-field/sequenceFieldChangeRebaser.ts +3 -2
  1665. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +31 -38
  1666. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +38 -59
  1667. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +15 -15
  1668. package/src/feature-libraries/sequence-field/types.ts +7 -9
  1669. package/src/feature-libraries/sequence-field/utils.ts +95 -76
  1670. package/src/feature-libraries/storedToViewSchema.ts +13 -12
  1671. package/src/feature-libraries/treeCursorUtils.ts +9 -8
  1672. package/src/feature-libraries/treeTextCursor.ts +12 -10
  1673. package/src/feature-libraries/typed-schema/flexList.ts +1 -3
  1674. package/src/feature-libraries/typed-schema/index.ts +0 -2
  1675. package/src/feature-libraries/typed-schema/schemaCollection.ts +11 -10
  1676. package/src/feature-libraries/typed-schema/typeUtils.ts +0 -6
  1677. package/src/feature-libraries/typed-schema/typedTreeSchema.ts +32 -18
  1678. package/src/feature-libraries/typed-schema/view.ts +6 -5
  1679. package/src/feature-libraries/valueUtilities.ts +11 -9
  1680. package/src/index.ts +34 -26
  1681. package/src/packageVersion.ts +1 -1
  1682. package/src/shared-tree/index.ts +9 -1
  1683. package/src/shared-tree/schematizeTree.ts +12 -10
  1684. package/src/shared-tree/schematizingTreeView.ts +47 -28
  1685. package/src/shared-tree/sharedTree.ts +131 -44
  1686. package/src/shared-tree/sharedTreeChangeCodecs.ts +79 -62
  1687. package/src/shared-tree/sharedTreeChangeFamily.ts +13 -7
  1688. package/src/shared-tree/sharedTreeChangeFormat.ts +4 -3
  1689. package/src/shared-tree/sharedTreeEditBuilder.ts +5 -1
  1690. package/src/shared-tree/treeApi.ts +141 -10
  1691. package/src/shared-tree/treeCheckout.ts +203 -60
  1692. package/src/shared-tree/treeView.ts +5 -4
  1693. package/src/shared-tree-core/branch.ts +20 -204
  1694. package/src/shared-tree-core/editManager.ts +20 -78
  1695. package/src/shared-tree-core/editManagerCodecs.ts +111 -63
  1696. package/src/shared-tree-core/editManagerFormat.ts +7 -8
  1697. package/src/shared-tree-core/editManagerSummarizer.ts +14 -36
  1698. package/src/shared-tree-core/index.ts +2 -0
  1699. package/src/shared-tree-core/messageCodecs.ts +62 -5
  1700. package/src/shared-tree-core/messageFormat.ts +12 -2
  1701. package/src/shared-tree-core/messageTypes.ts +1 -0
  1702. package/src/shared-tree-core/sequenceIdUtils.ts +1 -0
  1703. package/src/shared-tree-core/sharedTreeCore.ts +40 -22
  1704. package/src/simple-tree/ProxyBinding.md +102 -0
  1705. package/src/simple-tree/README.md +0 -6
  1706. package/src/simple-tree/arrayNode.ts +769 -0
  1707. package/src/simple-tree/index.ts +16 -9
  1708. package/src/simple-tree/leafNodeSchema.ts +72 -0
  1709. package/src/simple-tree/mapNode.ts +343 -0
  1710. package/src/simple-tree/objectNode.ts +411 -0
  1711. package/src/simple-tree/proxies.ts +197 -932
  1712. package/src/simple-tree/proxyBinding.ts +182 -0
  1713. package/src/simple-tree/rawNode.ts +19 -135
  1714. package/src/simple-tree/schemaCaching.ts +90 -0
  1715. package/src/simple-tree/schemaCreationUtilities.ts +6 -9
  1716. package/src/simple-tree/schemaFactory.ts +247 -261
  1717. package/src/simple-tree/schemaFactoryRecursive.ts +32 -185
  1718. package/src/simple-tree/schemaTypes.ts +149 -81
  1719. package/src/simple-tree/testRecursiveDomain.ts +3 -3
  1720. package/src/simple-tree/toFlexSchema.ts +39 -47
  1721. package/src/simple-tree/toMapTree.ts +236 -196
  1722. package/src/simple-tree/tree.ts +24 -3
  1723. package/src/simple-tree/treeApi.ts +209 -24
  1724. package/src/simple-tree/types.ts +1 -173
  1725. package/src/simple-tree/typesUnsafe.ts +42 -21
  1726. package/src/treeFactory.ts +51 -26
  1727. package/src/util/brand.ts +36 -168
  1728. package/src/util/idAllocator.ts +2 -1
  1729. package/src/util/index.ts +4 -18
  1730. package/src/util/nestedSet.ts +1 -1
  1731. package/src/util/opaque.ts +68 -0
  1732. package/src/util/referenceCounting.ts +3 -3
  1733. package/src/util/typeCheckTests.ts +7 -7
  1734. package/src/util/typeUtils.ts +14 -0
  1735. package/src/util/typeboxBrand.ts +31 -0
  1736. package/src/util/utils.ts +3 -17
  1737. package/tsconfig.json +1 -1
  1738. package/api-extractor-cjs.json +0 -18
  1739. package/api-extractor-esm.json +0 -14
  1740. package/dist/feature-libraries/multiplicity.d.ts.map +0 -1
  1741. package/dist/feature-libraries/multiplicity.js.map +0 -1
  1742. package/dist/feature-libraries/optional-field/optionalFieldChangeFormat.d.ts.map +0 -1
  1743. package/dist/feature-libraries/optional-field/optionalFieldChangeFormat.js.map +0 -1
  1744. package/dist/simple-tree/flexNode.d.ts +0 -35
  1745. package/dist/simple-tree/flexNode.d.ts.map +0 -1
  1746. package/dist/simple-tree/flexNode.js +0 -62
  1747. package/dist/simple-tree/flexNode.js.map +0 -1
  1748. package/dist/simple-tree/treeArrayNode.d.ts +0 -46
  1749. package/dist/simple-tree/treeArrayNode.d.ts.map +0 -1
  1750. package/dist/simple-tree/treeArrayNode.js +0 -50
  1751. package/dist/simple-tree/treeArrayNode.js.map +0 -1
  1752. package/dist/tree-alpha.d.ts +0 -2159
  1753. package/dist/tree-beta.d.ts +0 -2159
  1754. package/dist/tree-public.d.ts +0 -1942
  1755. package/dist/tree-untrimmed.d.ts +0 -6880
  1756. package/lib/feature-libraries/multiplicity.d.ts.map +0 -1
  1757. package/lib/feature-libraries/optional-field/optionalFieldChangeFormat.d.ts.map +0 -1
  1758. package/lib/feature-libraries/optional-field/optionalFieldChangeFormat.js.map +0 -1
  1759. package/lib/simple-tree/flexNode.d.ts +0 -35
  1760. package/lib/simple-tree/flexNode.d.ts.map +0 -1
  1761. package/lib/simple-tree/flexNode.js +0 -55
  1762. package/lib/simple-tree/flexNode.js.map +0 -1
  1763. package/lib/simple-tree/treeArrayNode.d.ts +0 -46
  1764. package/lib/simple-tree/treeArrayNode.d.ts.map +0 -1
  1765. package/lib/simple-tree/treeArrayNode.js +0 -46
  1766. package/lib/simple-tree/treeArrayNode.js.map +0 -1
  1767. package/lib/test/codec/ajvValidator.cjs +0 -70
  1768. package/lib/test/codec/ajvValidator.cjs.map +0 -1
  1769. package/lib/test/codec/ajvValidator.d.cts +0 -13
  1770. package/lib/test/codec/ajvValidator.d.cts.map +0 -1
  1771. package/lib/test/codec/codec.spec.d.ts.map +0 -1
  1772. package/lib/test/codec/codec.spec.js +0 -36
  1773. package/lib/test/codec/codec.spec.js.map +0 -1
  1774. package/lib/test/codec/index.d.ts +0 -7
  1775. package/lib/test/codec/index.d.ts.map +0 -1
  1776. package/lib/test/codec/index.js +0 -7
  1777. package/lib/test/codec/index.js.map +0 -1
  1778. package/lib/test/codec/utils.d.ts +0 -58
  1779. package/lib/test/codec/utils.d.ts.map +0 -1
  1780. package/lib/test/codec/utils.js +0 -61
  1781. package/lib/test/codec/utils.js.map +0 -1
  1782. package/lib/test/cursorTestSuite.d.ts +0 -106
  1783. package/lib/test/cursorTestSuite.d.ts.map +0 -1
  1784. package/lib/test/cursorTestSuite.js +0 -680
  1785. package/lib/test/cursorTestSuite.js.map +0 -1
  1786. package/lib/test/domains/json/benchmarks.d.ts +0 -17
  1787. package/lib/test/domains/json/benchmarks.d.ts.map +0 -1
  1788. package/lib/test/domains/json/benchmarks.js +0 -61
  1789. package/lib/test/domains/json/benchmarks.js.map +0 -1
  1790. package/lib/test/domains/json/canada.d.ts +0 -33
  1791. package/lib/test/domains/json/canada.d.ts.map +0 -1
  1792. package/lib/test/domains/json/canada.js +0 -81
  1793. package/lib/test/domains/json/canada.js.map +0 -1
  1794. package/lib/test/domains/json/citm.d.ts +0 -81
  1795. package/lib/test/domains/json/citm.d.ts.map +0 -1
  1796. package/lib/test/domains/json/citm.js +0 -515
  1797. package/lib/test/domains/json/citm.js.map +0 -1
  1798. package/lib/test/domains/json/jsDirectObject.bench.d.ts +0 -13
  1799. package/lib/test/domains/json/jsDirectObject.bench.d.ts.map +0 -1
  1800. package/lib/test/domains/json/jsDirectObject.bench.js +0 -74
  1801. package/lib/test/domains/json/jsDirectObject.bench.js.map +0 -1
  1802. package/lib/test/domains/json/jsObjectUtil.d.ts +0 -12
  1803. package/lib/test/domains/json/jsObjectUtil.d.ts.map +0 -1
  1804. package/lib/test/domains/json/jsObjectUtil.js +0 -36
  1805. package/lib/test/domains/json/jsObjectUtil.js.map +0 -1
  1806. package/lib/test/domains/json/jsonCursor.bench.d.ts +0 -11
  1807. package/lib/test/domains/json/jsonCursor.bench.d.ts.map +0 -1
  1808. package/lib/test/domains/json/jsonCursor.bench.js +0 -220
  1809. package/lib/test/domains/json/jsonCursor.bench.js.map +0 -1
  1810. package/lib/test/domains/json/jsonCursor.spec.d.ts +0 -6
  1811. package/lib/test/domains/json/jsonCursor.spec.d.ts.map +0 -1
  1812. package/lib/test/domains/json/jsonCursor.spec.js +0 -75
  1813. package/lib/test/domains/json/jsonCursor.spec.js.map +0 -1
  1814. package/lib/test/domains/json/jsonGeneratorUtils.d.ts +0 -9
  1815. package/lib/test/domains/json/jsonGeneratorUtils.d.ts.map +0 -1
  1816. package/lib/test/domains/json/jsonGeneratorUtils.js +0 -36
  1817. package/lib/test/domains/json/jsonGeneratorUtils.js.map +0 -1
  1818. package/lib/test/domains/json/twitter.d.ts +0 -204
  1819. package/lib/test/domains/json/twitter.d.ts.map +0 -1
  1820. package/lib/test/domains/json/twitter.js +0 -7413
  1821. package/lib/test/domains/json/twitter.js.map +0 -1
  1822. package/lib/test/domains/schemaBuilder.spec.d.ts +0 -6
  1823. package/lib/test/domains/schemaBuilder.spec.d.ts.map +0 -1
  1824. package/lib/test/domains/schemaBuilder.spec.js +0 -148
  1825. package/lib/test/domains/schemaBuilder.spec.js.map +0 -1
  1826. package/lib/test/editMinter.d.ts +0 -8
  1827. package/lib/test/editMinter.d.ts.map +0 -1
  1828. package/lib/test/editMinter.js +0 -21
  1829. package/lib/test/editMinter.js.map +0 -1
  1830. package/lib/test/events/eventEmitter.spec.d.ts +0 -6
  1831. package/lib/test/events/eventEmitter.spec.d.ts.map +0 -1
  1832. package/lib/test/events/eventEmitter.spec.js +0 -159
  1833. package/lib/test/events/eventEmitter.spec.js.map +0 -1
  1834. package/lib/test/exhaustiveRebaserUtils.d.ts +0 -78
  1835. package/lib/test/exhaustiveRebaserUtils.d.ts.map +0 -1
  1836. package/lib/test/exhaustiveRebaserUtils.js +0 -53
  1837. package/lib/test/exhaustiveRebaserUtils.js.map +0 -1
  1838. package/lib/test/feature-libraries/chunked-forest/basicChunk.spec.d.ts +0 -6
  1839. package/lib/test/feature-libraries/chunked-forest/basicChunk.spec.d.ts.map +0 -1
  1840. package/lib/test/feature-libraries/chunked-forest/basicChunk.spec.js +0 -161
  1841. package/lib/test/feature-libraries/chunked-forest/basicChunk.spec.js.map +0 -1
  1842. package/lib/test/feature-libraries/chunked-forest/chunkEncodingEndToEnd.d.ts +0 -2
  1843. package/lib/test/feature-libraries/chunked-forest/chunkEncodingEndToEnd.d.ts.map +0 -1
  1844. package/lib/test/feature-libraries/chunked-forest/chunkEncodingEndToEnd.js +0 -102
  1845. package/lib/test/feature-libraries/chunked-forest/chunkEncodingEndToEnd.js.map +0 -1
  1846. package/lib/test/feature-libraries/chunked-forest/chunkTree.spec.d.ts +0 -6
  1847. package/lib/test/feature-libraries/chunked-forest/chunkTree.spec.d.ts.map +0 -1
  1848. package/lib/test/feature-libraries/chunked-forest/chunkTree.spec.js +0 -259
  1849. package/lib/test/feature-libraries/chunked-forest/chunkTree.spec.js.map +0 -1
  1850. package/lib/test/feature-libraries/chunked-forest/chunkedForest.spec.d.ts +0 -6
  1851. package/lib/test/feature-libraries/chunked-forest/chunkedForest.spec.d.ts.map +0 -1
  1852. package/lib/test/feature-libraries/chunked-forest/chunkedForest.spec.js +0 -47
  1853. package/lib/test/feature-libraries/chunked-forest/chunkedForest.spec.js.map +0 -1
  1854. package/lib/test/feature-libraries/chunked-forest/codec/checkEncode.d.ts +0 -9
  1855. package/lib/test/feature-libraries/chunked-forest/codec/checkEncode.d.ts.map +0 -1
  1856. package/lib/test/feature-libraries/chunked-forest/codec/checkEncode.js +0 -124
  1857. package/lib/test/feature-libraries/chunked-forest/codec/checkEncode.js.map +0 -1
  1858. package/lib/test/feature-libraries/chunked-forest/codec/chunkCodecUtilities.spec.d.ts +0 -6
  1859. package/lib/test/feature-libraries/chunked-forest/codec/chunkCodecUtilities.spec.d.ts.map +0 -1
  1860. package/lib/test/feature-libraries/chunked-forest/codec/chunkCodecUtilities.spec.js +0 -187
  1861. package/lib/test/feature-libraries/chunked-forest/codec/chunkCodecUtilities.spec.js.map +0 -1
  1862. package/lib/test/feature-libraries/chunked-forest/codec/chunkDecoding.spec.d.ts +0 -6
  1863. package/lib/test/feature-libraries/chunked-forest/codec/chunkDecoding.spec.d.ts.map +0 -1
  1864. package/lib/test/feature-libraries/chunked-forest/codec/chunkDecoding.spec.js +0 -308
  1865. package/lib/test/feature-libraries/chunked-forest/codec/chunkDecoding.spec.js.map +0 -1
  1866. package/lib/test/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.spec.d.ts +0 -6
  1867. package/lib/test/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.spec.d.ts.map +0 -1
  1868. package/lib/test/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.spec.js +0 -123
  1869. package/lib/test/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.spec.js.map +0 -1
  1870. package/lib/test/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.spec.d.ts +0 -7
  1871. package/lib/test/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.spec.d.ts.map +0 -1
  1872. package/lib/test/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.spec.js +0 -135
  1873. package/lib/test/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.spec.js.map +0 -1
  1874. package/lib/test/feature-libraries/chunked-forest/codec/compressedEncode.spec.d.ts +0 -11
  1875. package/lib/test/feature-libraries/chunked-forest/codec/compressedEncode.spec.d.ts.map +0 -1
  1876. package/lib/test/feature-libraries/chunked-forest/codec/compressedEncode.spec.js +0 -211
  1877. package/lib/test/feature-libraries/chunked-forest/codec/compressedEncode.spec.js.map +0 -1
  1878. package/lib/test/feature-libraries/chunked-forest/codec/format.spec.d.ts +0 -6
  1879. package/lib/test/feature-libraries/chunked-forest/codec/format.spec.d.ts.map +0 -1
  1880. package/lib/test/feature-libraries/chunked-forest/codec/format.spec.js +0 -15
  1881. package/lib/test/feature-libraries/chunked-forest/codec/format.spec.js.map +0 -1
  1882. package/lib/test/feature-libraries/chunked-forest/codec/nodeShape.spec.d.ts +0 -6
  1883. package/lib/test/feature-libraries/chunked-forest/codec/nodeShape.spec.d.ts.map +0 -1
  1884. package/lib/test/feature-libraries/chunked-forest/codec/nodeShape.spec.js +0 -98
  1885. package/lib/test/feature-libraries/chunked-forest/codec/nodeShape.spec.js.map +0 -1
  1886. package/lib/test/feature-libraries/chunked-forest/codec/schemaBasedEncoding.spec.d.ts +0 -6
  1887. package/lib/test/feature-libraries/chunked-forest/codec/schemaBasedEncoding.spec.d.ts.map +0 -1
  1888. package/lib/test/feature-libraries/chunked-forest/codec/schemaBasedEncoding.spec.js +0 -176
  1889. package/lib/test/feature-libraries/chunked-forest/codec/schemaBasedEncoding.spec.js.map +0 -1
  1890. package/lib/test/feature-libraries/chunked-forest/codec/uncompressedEncode.spec.d.ts +0 -6
  1891. package/lib/test/feature-libraries/chunked-forest/codec/uncompressedEncode.spec.d.ts.map +0 -1
  1892. package/lib/test/feature-libraries/chunked-forest/codec/uncompressedEncode.spec.js +0 -29
  1893. package/lib/test/feature-libraries/chunked-forest/codec/uncompressedEncode.spec.js.map +0 -1
  1894. package/lib/test/feature-libraries/chunked-forest/fieldCursorTestUtilities.d.ts +0 -12
  1895. package/lib/test/feature-libraries/chunked-forest/fieldCursorTestUtilities.d.ts.map +0 -1
  1896. package/lib/test/feature-libraries/chunked-forest/fieldCursorTestUtilities.js +0 -38
  1897. package/lib/test/feature-libraries/chunked-forest/fieldCursorTestUtilities.js.map +0 -1
  1898. package/lib/test/feature-libraries/chunked-forest/uniformChunk.spec.d.ts +0 -6
  1899. package/lib/test/feature-libraries/chunked-forest/uniformChunk.spec.d.ts.map +0 -1
  1900. package/lib/test/feature-libraries/chunked-forest/uniformChunk.spec.js +0 -138
  1901. package/lib/test/feature-libraries/chunked-forest/uniformChunk.spec.js.map +0 -1
  1902. package/lib/test/feature-libraries/chunked-forest/uniformChunkTestData.d.ts +0 -34
  1903. package/lib/test/feature-libraries/chunked-forest/uniformChunkTestData.d.ts.map +0 -1
  1904. package/lib/test/feature-libraries/chunked-forest/uniformChunkTestData.js +0 -114
  1905. package/lib/test/feature-libraries/chunked-forest/uniformChunkTestData.js.map +0 -1
  1906. package/lib/test/feature-libraries/contextuallyTyped.spec.d.ts +0 -6
  1907. package/lib/test/feature-libraries/contextuallyTyped.spec.d.ts.map +0 -1
  1908. package/lib/test/feature-libraries/contextuallyTyped.spec.js +0 -107
  1909. package/lib/test/feature-libraries/contextuallyTyped.spec.js.map +0 -1
  1910. package/lib/test/feature-libraries/default-field-kinds/defaultChangeFamily.spec.d.ts +0 -6
  1911. package/lib/test/feature-libraries/default-field-kinds/defaultChangeFamily.spec.d.ts.map +0 -1
  1912. package/lib/test/feature-libraries/default-field-kinds/defaultChangeFamily.spec.js +0 -850
  1913. package/lib/test/feature-libraries/default-field-kinds/defaultChangeFamily.spec.js.map +0 -1
  1914. package/lib/test/feature-libraries/default-field-kinds/defaultFieldKinds.spec.d.ts +0 -6
  1915. package/lib/test/feature-libraries/default-field-kinds/defaultFieldKinds.spec.d.ts.map +0 -1
  1916. package/lib/test/feature-libraries/default-field-kinds/defaultFieldKinds.spec.js +0 -110
  1917. package/lib/test/feature-libraries/default-field-kinds/defaultFieldKinds.spec.js.map +0 -1
  1918. package/lib/test/feature-libraries/deltaUtils.spec.d.ts +0 -6
  1919. package/lib/test/feature-libraries/deltaUtils.spec.d.ts.map +0 -1
  1920. package/lib/test/feature-libraries/deltaUtils.spec.js +0 -87
  1921. package/lib/test/feature-libraries/deltaUtils.spec.js.map +0 -1
  1922. package/lib/test/feature-libraries/fieldKindTestUtils.d.ts +0 -20
  1923. package/lib/test/feature-libraries/fieldKindTestUtils.d.ts.map +0 -1
  1924. package/lib/test/feature-libraries/fieldKindTestUtils.js +0 -42
  1925. package/lib/test/feature-libraries/fieldKindTestUtils.js.map +0 -1
  1926. package/lib/test/feature-libraries/flex-tree/editableTree.identifier.spec.d.ts +0 -6
  1927. package/lib/test/feature-libraries/flex-tree/editableTree.identifier.spec.d.ts.map +0 -1
  1928. package/lib/test/feature-libraries/flex-tree/editableTree.identifier.spec.js +0 -91
  1929. package/lib/test/feature-libraries/flex-tree/editableTree.identifier.spec.js.map +0 -1
  1930. package/lib/test/feature-libraries/flex-tree/editableTreeTypes.spec.d.ts +0 -6
  1931. package/lib/test/feature-libraries/flex-tree/editableTreeTypes.spec.d.ts.map +0 -1
  1932. package/lib/test/feature-libraries/flex-tree/editableTreeTypes.spec.js +0 -225
  1933. package/lib/test/feature-libraries/flex-tree/editableTreeTypes.spec.js.map +0 -1
  1934. package/lib/test/feature-libraries/flex-tree/events.spec.d.ts +0 -2
  1935. package/lib/test/feature-libraries/flex-tree/events.spec.d.ts.map +0 -1
  1936. package/lib/test/feature-libraries/flex-tree/events.spec.js +0 -605
  1937. package/lib/test/feature-libraries/flex-tree/events.spec.js.map +0 -1
  1938. package/lib/test/feature-libraries/flex-tree/lazyField.spec.d.ts +0 -6
  1939. package/lib/test/feature-libraries/flex-tree/lazyField.spec.d.ts.map +0 -1
  1940. package/lib/test/feature-libraries/flex-tree/lazyField.spec.js +0 -326
  1941. package/lib/test/feature-libraries/flex-tree/lazyField.spec.js.map +0 -1
  1942. package/lib/test/feature-libraries/flex-tree/lazyNode.spec.d.ts +0 -6
  1943. package/lib/test/feature-libraries/flex-tree/lazyNode.spec.d.ts.map +0 -1
  1944. package/lib/test/feature-libraries/flex-tree/lazyNode.spec.js +0 -381
  1945. package/lib/test/feature-libraries/flex-tree/lazyNode.spec.js.map +0 -1
  1946. package/lib/test/feature-libraries/flex-tree/navigation.spec.d.ts +0 -6
  1947. package/lib/test/feature-libraries/flex-tree/navigation.spec.d.ts.map +0 -1
  1948. package/lib/test/feature-libraries/flex-tree/navigation.spec.js +0 -50
  1949. package/lib/test/feature-libraries/flex-tree/navigation.spec.js.map +0 -1
  1950. package/lib/test/feature-libraries/flex-tree/unboxed.spec.d.ts +0 -6
  1951. package/lib/test/feature-libraries/flex-tree/unboxed.spec.d.ts.map +0 -1
  1952. package/lib/test/feature-libraries/flex-tree/unboxed.spec.js +0 -197
  1953. package/lib/test/feature-libraries/flex-tree/unboxed.spec.js.map +0 -1
  1954. package/lib/test/feature-libraries/flex-tree/utilities.spec.d.ts +0 -6
  1955. package/lib/test/feature-libraries/flex-tree/utilities.spec.d.ts.map +0 -1
  1956. package/lib/test/feature-libraries/flex-tree/utilities.spec.js +0 -109
  1957. package/lib/test/feature-libraries/flex-tree/utilities.spec.js.map +0 -1
  1958. package/lib/test/feature-libraries/flex-tree/utils.d.ts +0 -32
  1959. package/lib/test/feature-libraries/flex-tree/utils.d.ts.map +0 -1
  1960. package/lib/test/feature-libraries/flex-tree/utils.js +0 -50
  1961. package/lib/test/feature-libraries/flex-tree/utils.js.map +0 -1
  1962. package/lib/test/feature-libraries/forest-summary/forestSummarizerCodec.spec.d.ts +0 -6
  1963. package/lib/test/feature-libraries/forest-summary/forestSummarizerCodec.spec.d.ts.map +0 -1
  1964. package/lib/test/feature-libraries/forest-summary/forestSummarizerCodec.spec.js +0 -115
  1965. package/lib/test/feature-libraries/forest-summary/forestSummarizerCodec.spec.js.map +0 -1
  1966. package/lib/test/feature-libraries/mapTreeCursor.spec.d.ts +0 -6
  1967. package/lib/test/feature-libraries/mapTreeCursor.spec.d.ts.map +0 -1
  1968. package/lib/test/feature-libraries/mapTreeCursor.spec.js +0 -8
  1969. package/lib/test/feature-libraries/mapTreeCursor.spec.js.map +0 -1
  1970. package/lib/test/feature-libraries/memoizedIdRangeAllocator.spec.d.ts +0 -6
  1971. package/lib/test/feature-libraries/memoizedIdRangeAllocator.spec.d.ts.map +0 -1
  1972. package/lib/test/feature-libraries/memoizedIdRangeAllocator.spec.js +0 -80
  1973. package/lib/test/feature-libraries/memoizedIdRangeAllocator.spec.js.map +0 -1
  1974. package/lib/test/feature-libraries/mitigatedChangeFamily.spec.d.ts +0 -6
  1975. package/lib/test/feature-libraries/mitigatedChangeFamily.spec.d.ts.map +0 -1
  1976. package/lib/test/feature-libraries/mitigatedChangeFamily.spec.js +0 -96
  1977. package/lib/test/feature-libraries/mitigatedChangeFamily.spec.js.map +0 -1
  1978. package/lib/test/feature-libraries/modular-schema/basicRebasers.d.ts +0 -44
  1979. package/lib/test/feature-libraries/modular-schema/basicRebasers.d.ts.map +0 -1
  1980. package/lib/test/feature-libraries/modular-schema/basicRebasers.js +0 -77
  1981. package/lib/test/feature-libraries/modular-schema/basicRebasers.js.map +0 -1
  1982. package/lib/test/feature-libraries/modular-schema/comparison.spec.d.ts +0 -6
  1983. package/lib/test/feature-libraries/modular-schema/comparison.spec.d.ts.map +0 -1
  1984. package/lib/test/feature-libraries/modular-schema/comparison.spec.js +0 -264
  1985. package/lib/test/feature-libraries/modular-schema/comparison.spec.js.map +0 -1
  1986. package/lib/test/feature-libraries/modular-schema/genericFieldKind.spec.d.ts +0 -6
  1987. package/lib/test/feature-libraries/modular-schema/genericFieldKind.spec.d.ts.map +0 -1
  1988. package/lib/test/feature-libraries/modular-schema/genericFieldKind.spec.js +0 -345
  1989. package/lib/test/feature-libraries/modular-schema/genericFieldKind.spec.js.map +0 -1
  1990. package/lib/test/feature-libraries/modular-schema/genericFieldSnapshots.test.d.ts +0 -6
  1991. package/lib/test/feature-libraries/modular-schema/genericFieldSnapshots.test.d.ts.map +0 -1
  1992. package/lib/test/feature-libraries/modular-schema/genericFieldSnapshots.test.js +0 -49
  1993. package/lib/test/feature-libraries/modular-schema/genericFieldSnapshots.test.js.map +0 -1
  1994. package/lib/test/feature-libraries/modular-schema/isNeverTree.spec.d.ts +0 -6
  1995. package/lib/test/feature-libraries/modular-schema/isNeverTree.spec.d.ts.map +0 -1
  1996. package/lib/test/feature-libraries/modular-schema/isNeverTree.spec.js +0 -126
  1997. package/lib/test/feature-libraries/modular-schema/isNeverTree.spec.js.map +0 -1
  1998. package/lib/test/feature-libraries/modular-schema/modularChangeFamily.spec.d.ts +0 -6
  1999. package/lib/test/feature-libraries/modular-schema/modularChangeFamily.spec.d.ts.map +0 -1
  2000. package/lib/test/feature-libraries/modular-schema/modularChangeFamily.spec.js +0 -1070
  2001. package/lib/test/feature-libraries/modular-schema/modularChangeFamily.spec.js.map +0 -1
  2002. package/lib/test/feature-libraries/modular-schema/rangeMap.spec.d.ts +0 -6
  2003. package/lib/test/feature-libraries/modular-schema/rangeMap.spec.d.ts.map +0 -1
  2004. package/lib/test/feature-libraries/modular-schema/rangeMap.spec.js +0 -182
  2005. package/lib/test/feature-libraries/modular-schema/rangeMap.spec.js.map +0 -1
  2006. package/lib/test/feature-libraries/modular-schema/schemaEvolutionExamples.spec.d.ts +0 -6
  2007. package/lib/test/feature-libraries/modular-schema/schemaEvolutionExamples.spec.d.ts.map +0 -1
  2008. package/lib/test/feature-libraries/modular-schema/schemaEvolutionExamples.spec.js +0 -390
  2009. package/lib/test/feature-libraries/modular-schema/schemaEvolutionExamples.spec.js.map +0 -1
  2010. package/lib/test/feature-libraries/modularChangeFamilyIntegration.spec.d.ts +0 -6
  2011. package/lib/test/feature-libraries/modularChangeFamilyIntegration.spec.d.ts.map +0 -1
  2012. package/lib/test/feature-libraries/modularChangeFamilyIntegration.spec.js +0 -556
  2013. package/lib/test/feature-libraries/modularChangeFamilyIntegration.spec.js.map +0 -1
  2014. package/lib/test/feature-libraries/node-key/nodeKey.spec.d.ts +0 -6
  2015. package/lib/test/feature-libraries/node-key/nodeKey.spec.d.ts.map +0 -1
  2016. package/lib/test/feature-libraries/node-key/nodeKey.spec.js +0 -74
  2017. package/lib/test/feature-libraries/node-key/nodeKey.spec.js.map +0 -1
  2018. package/lib/test/feature-libraries/node-key/nodeKeyIndex.bench.d.ts +0 -6
  2019. package/lib/test/feature-libraries/node-key/nodeKeyIndex.bench.d.ts.map +0 -1
  2020. package/lib/test/feature-libraries/node-key/nodeKeyIndex.bench.js +0 -258
  2021. package/lib/test/feature-libraries/node-key/nodeKeyIndex.bench.js.map +0 -1
  2022. package/lib/test/feature-libraries/node-key/nodeKeyIndex.spec.d.ts +0 -6
  2023. package/lib/test/feature-libraries/node-key/nodeKeyIndex.spec.d.ts.map +0 -1
  2024. package/lib/test/feature-libraries/node-key/nodeKeyIndex.spec.js +0 -262
  2025. package/lib/test/feature-libraries/node-key/nodeKeyIndex.spec.js.map +0 -1
  2026. package/lib/test/feature-libraries/objectForest.spec.d.ts +0 -6
  2027. package/lib/test/feature-libraries/objectForest.spec.d.ts.map +0 -1
  2028. package/lib/test/feature-libraries/objectForest.spec.js +0 -62
  2029. package/lib/test/feature-libraries/objectForest.spec.js.map +0 -1
  2030. package/lib/test/feature-libraries/optional-field/optionalChangeRebaser.test.d.ts +0 -6
  2031. package/lib/test/feature-libraries/optional-field/optionalChangeRebaser.test.d.ts.map +0 -1
  2032. package/lib/test/feature-libraries/optional-field/optionalChangeRebaser.test.js +0 -352
  2033. package/lib/test/feature-libraries/optional-field/optionalChangeRebaser.test.js.map +0 -1
  2034. package/lib/test/feature-libraries/optional-field/optionalField.spec.d.ts +0 -6
  2035. package/lib/test/feature-libraries/optional-field/optionalField.spec.d.ts.map +0 -1
  2036. package/lib/test/feature-libraries/optional-field/optionalField.spec.js +0 -396
  2037. package/lib/test/feature-libraries/optional-field/optionalField.spec.js.map +0 -1
  2038. package/lib/test/feature-libraries/optional-field/optionalFieldChangeCodecs.test.d.ts +0 -6
  2039. package/lib/test/feature-libraries/optional-field/optionalFieldChangeCodecs.test.d.ts.map +0 -1
  2040. package/lib/test/feature-libraries/optional-field/optionalFieldChangeCodecs.test.js +0 -50
  2041. package/lib/test/feature-libraries/optional-field/optionalFieldChangeCodecs.test.js.map +0 -1
  2042. package/lib/test/feature-libraries/optional-field/optionalFieldSnapshots.test.d.ts +0 -6
  2043. package/lib/test/feature-libraries/optional-field/optionalFieldSnapshots.test.d.ts.map +0 -1
  2044. package/lib/test/feature-libraries/optional-field/optionalFieldSnapshots.test.js +0 -59
  2045. package/lib/test/feature-libraries/optional-field/optionalFieldSnapshots.test.js.map +0 -1
  2046. package/lib/test/feature-libraries/optional-field/optionalFieldUtils.d.ts +0 -62
  2047. package/lib/test/feature-libraries/optional-field/optionalFieldUtils.d.ts.map +0 -1
  2048. package/lib/test/feature-libraries/optional-field/optionalFieldUtils.js +0 -232
  2049. package/lib/test/feature-libraries/optional-field/optionalFieldUtils.js.map +0 -1
  2050. package/lib/test/feature-libraries/schema-aware/schemaAware.spec.d.ts +0 -6
  2051. package/lib/test/feature-libraries/schema-aware/schemaAware.spec.d.ts.map +0 -1
  2052. package/lib/test/feature-libraries/schema-aware/schemaAware.spec.js +0 -133
  2053. package/lib/test/feature-libraries/schema-aware/schemaAware.spec.js.map +0 -1
  2054. package/lib/test/feature-libraries/schema-aware/schemaComplex.d.ts +0 -16
  2055. package/lib/test/feature-libraries/schema-aware/schemaComplex.d.ts.map +0 -1
  2056. package/lib/test/feature-libraries/schema-aware/schemaComplex.js +0 -40
  2057. package/lib/test/feature-libraries/schema-aware/schemaComplex.js.map +0 -1
  2058. package/lib/test/feature-libraries/schema-aware/schemaSimple.d.ts +0 -13
  2059. package/lib/test/feature-libraries/schema-aware/schemaSimple.d.ts.map +0 -1
  2060. package/lib/test/feature-libraries/schema-aware/schemaSimple.js +0 -28
  2061. package/lib/test/feature-libraries/schema-aware/schemaSimple.js.map +0 -1
  2062. package/lib/test/feature-libraries/schema-index/codec.spec.d.ts +0 -6
  2063. package/lib/test/feature-libraries/schema-index/codec.spec.d.ts.map +0 -1
  2064. package/lib/test/feature-libraries/schema-index/codec.spec.js +0 -81
  2065. package/lib/test/feature-libraries/schema-index/codec.spec.js.map +0 -1
  2066. package/lib/test/feature-libraries/schema-index/schemaSummarizer.spec.d.ts +0 -6
  2067. package/lib/test/feature-libraries/schema-index/schemaSummarizer.spec.d.ts.map +0 -1
  2068. package/lib/test/feature-libraries/schema-index/schemaSummarizer.spec.js +0 -28
  2069. package/lib/test/feature-libraries/schema-index/schemaSummarizer.spec.js.map +0 -1
  2070. package/lib/test/feature-libraries/schemaBuilder.spec.d.ts +0 -6
  2071. package/lib/test/feature-libraries/schemaBuilder.spec.d.ts.map +0 -1
  2072. package/lib/test/feature-libraries/schemaBuilder.spec.js +0 -88
  2073. package/lib/test/feature-libraries/schemaBuilder.spec.js.map +0 -1
  2074. package/lib/test/feature-libraries/sequence-field/compose.test.d.ts +0 -6
  2075. package/lib/test/feature-libraries/sequence-field/compose.test.d.ts.map +0 -1
  2076. package/lib/test/feature-libraries/sequence-field/compose.test.js +0 -1431
  2077. package/lib/test/feature-libraries/sequence-field/compose.test.js.map +0 -1
  2078. package/lib/test/feature-libraries/sequence-field/invert.test.d.ts +0 -6
  2079. package/lib/test/feature-libraries/sequence-field/invert.test.d.ts.map +0 -1
  2080. package/lib/test/feature-libraries/sequence-field/invert.test.js +0 -418
  2081. package/lib/test/feature-libraries/sequence-field/invert.test.js.map +0 -1
  2082. package/lib/test/feature-libraries/sequence-field/markListFactory.test.d.ts +0 -6
  2083. package/lib/test/feature-libraries/sequence-field/markListFactory.test.d.ts.map +0 -1
  2084. package/lib/test/feature-libraries/sequence-field/markListFactory.test.js +0 -239
  2085. package/lib/test/feature-libraries/sequence-field/markListFactory.test.js.map +0 -1
  2086. package/lib/test/feature-libraries/sequence-field/populatedMarks.d.ts +0 -18
  2087. package/lib/test/feature-libraries/sequence-field/populatedMarks.d.ts.map +0 -1
  2088. package/lib/test/feature-libraries/sequence-field/populatedMarks.js +0 -95
  2089. package/lib/test/feature-libraries/sequence-field/populatedMarks.js.map +0 -1
  2090. package/lib/test/feature-libraries/sequence-field/randomChangeGenerator.d.ts +0 -12
  2091. package/lib/test/feature-libraries/sequence-field/randomChangeGenerator.d.ts.map +0 -1
  2092. package/lib/test/feature-libraries/sequence-field/randomChangeGenerator.js +0 -35
  2093. package/lib/test/feature-libraries/sequence-field/randomChangeGenerator.js.map +0 -1
  2094. package/lib/test/feature-libraries/sequence-field/randomChangeGenerator.test.d.ts +0 -6
  2095. package/lib/test/feature-libraries/sequence-field/randomChangeGenerator.test.d.ts.map +0 -1
  2096. package/lib/test/feature-libraries/sequence-field/randomChangeGenerator.test.js +0 -42
  2097. package/lib/test/feature-libraries/sequence-field/randomChangeGenerator.test.js.map +0 -1
  2098. package/lib/test/feature-libraries/sequence-field/rebase.test.d.ts +0 -6
  2099. package/lib/test/feature-libraries/sequence-field/rebase.test.d.ts.map +0 -1
  2100. package/lib/test/feature-libraries/sequence-field/rebase.test.js +0 -1038
  2101. package/lib/test/feature-libraries/sequence-field/rebase.test.js.map +0 -1
  2102. package/lib/test/feature-libraries/sequence-field/relevantRemovedRoots.test.d.ts +0 -6
  2103. package/lib/test/feature-libraries/sequence-field/relevantRemovedRoots.test.d.ts.map +0 -1
  2104. package/lib/test/feature-libraries/sequence-field/relevantRemovedRoots.test.js +0 -211
  2105. package/lib/test/feature-libraries/sequence-field/relevantRemovedRoots.test.js.map +0 -1
  2106. package/lib/test/feature-libraries/sequence-field/sequenceChangeRebaser.test.d.ts +0 -11
  2107. package/lib/test/feature-libraries/sequence-field/sequenceChangeRebaser.test.d.ts.map +0 -1
  2108. package/lib/test/feature-libraries/sequence-field/sequenceChangeRebaser.test.js +0 -784
  2109. package/lib/test/feature-libraries/sequence-field/sequenceChangeRebaser.test.js.map +0 -1
  2110. package/lib/test/feature-libraries/sequence-field/sequenceField.spec.d.ts +0 -6
  2111. package/lib/test/feature-libraries/sequence-field/sequenceField.spec.d.ts.map +0 -1
  2112. package/lib/test/feature-libraries/sequence-field/sequenceField.spec.js +0 -36
  2113. package/lib/test/feature-libraries/sequence-field/sequenceField.spec.js.map +0 -1
  2114. package/lib/test/feature-libraries/sequence-field/sequenceFieldCodecs.test.d.ts +0 -6
  2115. package/lib/test/feature-libraries/sequence-field/sequenceFieldCodecs.test.d.ts.map +0 -1
  2116. package/lib/test/feature-libraries/sequence-field/sequenceFieldCodecs.test.js +0 -34
  2117. package/lib/test/feature-libraries/sequence-field/sequenceFieldCodecs.test.js.map +0 -1
  2118. package/lib/test/feature-libraries/sequence-field/sequenceFieldEditor.test.d.ts +0 -6
  2119. package/lib/test/feature-libraries/sequence-field/sequenceFieldEditor.test.d.ts.map +0 -1
  2120. package/lib/test/feature-libraries/sequence-field/sequenceFieldEditor.test.js +0 -38
  2121. package/lib/test/feature-libraries/sequence-field/sequenceFieldEditor.test.js.map +0 -1
  2122. package/lib/test/feature-libraries/sequence-field/sequenceFieldSnapshots.test.d.ts +0 -6
  2123. package/lib/test/feature-libraries/sequence-field/sequenceFieldSnapshots.test.d.ts.map +0 -1
  2124. package/lib/test/feature-libraries/sequence-field/sequenceFieldSnapshots.test.js +0 -34
  2125. package/lib/test/feature-libraries/sequence-field/sequenceFieldSnapshots.test.js.map +0 -1
  2126. package/lib/test/feature-libraries/sequence-field/sequenceFieldToDelta.test.d.ts +0 -6
  2127. package/lib/test/feature-libraries/sequence-field/sequenceFieldToDelta.test.d.ts.map +0 -1
  2128. package/lib/test/feature-libraries/sequence-field/sequenceFieldToDelta.test.js +0 -417
  2129. package/lib/test/feature-libraries/sequence-field/sequenceFieldToDelta.test.js.map +0 -1
  2130. package/lib/test/feature-libraries/sequence-field/sequenceFieldUtils.test.d.ts +0 -6
  2131. package/lib/test/feature-libraries/sequence-field/sequenceFieldUtils.test.d.ts.map +0 -1
  2132. package/lib/test/feature-libraries/sequence-field/sequenceFieldUtils.test.js +0 -40
  2133. package/lib/test/feature-libraries/sequence-field/sequenceFieldUtils.test.js.map +0 -1
  2134. package/lib/test/feature-libraries/sequence-field/testEdits.d.ts +0 -124
  2135. package/lib/test/feature-libraries/sequence-field/testEdits.d.ts.map +0 -1
  2136. package/lib/test/feature-libraries/sequence-field/testEdits.js +0 -270
  2137. package/lib/test/feature-libraries/sequence-field/testEdits.js.map +0 -1
  2138. package/lib/test/feature-libraries/sequence-field/utils.d.ts +0 -106
  2139. package/lib/test/feature-libraries/sequence-field/utils.d.ts.map +0 -1
  2140. package/lib/test/feature-libraries/sequence-field/utils.js +0 -535
  2141. package/lib/test/feature-libraries/sequence-field/utils.js.map +0 -1
  2142. package/lib/test/feature-libraries/storedToViewSchema.spec.d.ts +0 -6
  2143. package/lib/test/feature-libraries/storedToViewSchema.spec.d.ts.map +0 -1
  2144. package/lib/test/feature-libraries/storedToViewSchema.spec.js +0 -117
  2145. package/lib/test/feature-libraries/storedToViewSchema.spec.js.map +0 -1
  2146. package/lib/test/feature-libraries/treeCursorUtils.spec.d.ts +0 -6
  2147. package/lib/test/feature-libraries/treeCursorUtils.spec.d.ts.map +0 -1
  2148. package/lib/test/feature-libraries/treeCursorUtils.spec.js +0 -237
  2149. package/lib/test/feature-libraries/treeCursorUtils.spec.js.map +0 -1
  2150. package/lib/test/feature-libraries/treeTextCursor.spec.d.ts +0 -6
  2151. package/lib/test/feature-libraries/treeTextCursor.spec.d.ts.map +0 -1
  2152. package/lib/test/feature-libraries/treeTextCursor.spec.js +0 -8
  2153. package/lib/test/feature-libraries/treeTextCursor.spec.js.map +0 -1
  2154. package/lib/test/feature-libraries/typedSchema/example.spec.d.ts +0 -6
  2155. package/lib/test/feature-libraries/typedSchema/example.spec.d.ts.map +0 -1
  2156. package/lib/test/feature-libraries/typedSchema/example.spec.js +0 -20
  2157. package/lib/test/feature-libraries/typedSchema/example.spec.js.map +0 -1
  2158. package/lib/test/feature-libraries/typedSchema/flexList.spec.d.ts +0 -6
  2159. package/lib/test/feature-libraries/typedSchema/flexList.spec.d.ts.map +0 -1
  2160. package/lib/test/feature-libraries/typedSchema/flexList.spec.js +0 -52
  2161. package/lib/test/feature-libraries/typedSchema/flexList.spec.js.map +0 -1
  2162. package/lib/test/feature-libraries/typedSchema/typeUtils.spec.d.ts +0 -6
  2163. package/lib/test/feature-libraries/typedSchema/typeUtils.spec.d.ts.map +0 -1
  2164. package/lib/test/feature-libraries/typedSchema/typeUtils.spec.js +0 -10
  2165. package/lib/test/feature-libraries/typedSchema/typeUtils.spec.js.map +0 -1
  2166. package/lib/test/feature-libraries/typedSchema/typedTreeSchema.spec.d.ts +0 -6
  2167. package/lib/test/feature-libraries/typedSchema/typedTreeSchema.spec.d.ts.map +0 -1
  2168. package/lib/test/feature-libraries/typedSchema/typedTreeSchema.spec.js +0 -83
  2169. package/lib/test/feature-libraries/typedSchema/typedTreeSchema.spec.js.map +0 -1
  2170. package/lib/test/feature-libraries/valueUtilities.spec.d.ts +0 -6
  2171. package/lib/test/feature-libraries/valueUtilities.spec.d.ts.map +0 -1
  2172. package/lib/test/feature-libraries/valueUtilities.spec.js +0 -69
  2173. package/lib/test/feature-libraries/valueUtilities.spec.js.map +0 -1
  2174. package/lib/test/forestTestSuite.d.ts +0 -26
  2175. package/lib/test/forestTestSuite.d.ts.map +0 -1
  2176. package/lib/test/forestTestSuite.js +0 -793
  2177. package/lib/test/forestTestSuite.js.map +0 -1
  2178. package/lib/test/objMerge.d.ts +0 -24
  2179. package/lib/test/objMerge.d.ts.map +0 -1
  2180. package/lib/test/objMerge.js +0 -181
  2181. package/lib/test/objMerge.js.map +0 -1
  2182. package/lib/test/rebase/findAncestor.spec.d.ts +0 -6
  2183. package/lib/test/rebase/findAncestor.spec.d.ts.map +0 -1
  2184. package/lib/test/rebase/findAncestor.spec.js +0 -139
  2185. package/lib/test/rebase/findAncestor.spec.js.map +0 -1
  2186. package/lib/test/rebase/fuzz.d.ts +0 -16
  2187. package/lib/test/rebase/fuzz.d.ts.map +0 -1
  2188. package/lib/test/rebase/fuzz.js +0 -57
  2189. package/lib/test/rebase/fuzz.js.map +0 -1
  2190. package/lib/test/rebase/generateFuzzyCombinedChange.spec.d.ts +0 -6
  2191. package/lib/test/rebase/generateFuzzyCombinedChange.spec.d.ts.map +0 -1
  2192. package/lib/test/rebase/generateFuzzyCombinedChange.spec.js +0 -42
  2193. package/lib/test/rebase/generateFuzzyCombinedChange.spec.js.map +0 -1
  2194. package/lib/test/rebase/rebaseBranch.spec.d.ts +0 -6
  2195. package/lib/test/rebase/rebaseBranch.spec.d.ts.map +0 -1
  2196. package/lib/test/rebase/rebaseBranch.spec.js +0 -208
  2197. package/lib/test/rebase/rebaseBranch.spec.js.map +0 -1
  2198. package/lib/test/rebase/rebaser.spec.d.ts +0 -14
  2199. package/lib/test/rebase/rebaser.spec.d.ts.map +0 -1
  2200. package/lib/test/rebase/rebaser.spec.js +0 -166
  2201. package/lib/test/rebase/rebaser.spec.js.map +0 -1
  2202. package/lib/test/rebase/revisionTagCodec.spec.d.ts +0 -6
  2203. package/lib/test/rebase/revisionTagCodec.spec.d.ts.map +0 -1
  2204. package/lib/test/rebase/revisionTagCodec.spec.js +0 -56
  2205. package/lib/test/rebase/revisionTagCodec.spec.js.map +0 -1
  2206. package/lib/test/rebase/verifyChangeRebaser.spec.d.ts +0 -6
  2207. package/lib/test/rebase/verifyChangeRebaser.spec.d.ts.map +0 -1
  2208. package/lib/test/rebase/verifyChangeRebaser.spec.js +0 -52
  2209. package/lib/test/rebase/verifyChangeRebaser.spec.js.map +0 -1
  2210. package/lib/test/rebaserAxiomaticTests.d.ts +0 -15
  2211. package/lib/test/rebaserAxiomaticTests.d.ts.map +0 -1
  2212. package/lib/test/rebaserAxiomaticTests.js +0 -202
  2213. package/lib/test/rebaserAxiomaticTests.js.map +0 -1
  2214. package/lib/test/scalableTestTrees.d.ts +0 -89
  2215. package/lib/test/scalableTestTrees.d.ts.map +0 -1
  2216. package/lib/test/scalableTestTrees.js +0 -188
  2217. package/lib/test/scalableTestTrees.js.map +0 -1
  2218. package/lib/test/shared-tree/editing.spec.d.ts +0 -2
  2219. package/lib/test/shared-tree/editing.spec.d.ts.map +0 -1
  2220. package/lib/test/shared-tree/editing.spec.js +0 -2091
  2221. package/lib/test/shared-tree/editing.spec.js.map +0 -1
  2222. package/lib/test/shared-tree/fuzz/anchorStability.fuzz.spec.d.ts +0 -2
  2223. package/lib/test/shared-tree/fuzz/anchorStability.fuzz.spec.d.ts.map +0 -1
  2224. package/lib/test/shared-tree/fuzz/anchorStability.fuzz.spec.js +0 -161
  2225. package/lib/test/shared-tree/fuzz/anchorStability.fuzz.spec.js.map +0 -1
  2226. package/lib/test/shared-tree/fuzz/composeVsIndividual.fuzz.spec.d.ts +0 -2
  2227. package/lib/test/shared-tree/fuzz/composeVsIndividual.fuzz.spec.d.ts.map +0 -1
  2228. package/lib/test/shared-tree/fuzz/composeVsIndividual.fuzz.spec.js +0 -105
  2229. package/lib/test/shared-tree/fuzz/composeVsIndividual.fuzz.spec.js.map +0 -1
  2230. package/lib/test/shared-tree/fuzz/fuzzEditGenerators.d.ts +0 -127
  2231. package/lib/test/shared-tree/fuzz/fuzzEditGenerators.d.ts.map +0 -1
  2232. package/lib/test/shared-tree/fuzz/fuzzEditGenerators.js +0 -439
  2233. package/lib/test/shared-tree/fuzz/fuzzEditGenerators.js.map +0 -1
  2234. package/lib/test/shared-tree/fuzz/fuzzEditReducers.d.ts +0 -21
  2235. package/lib/test/shared-tree/fuzz/fuzzEditReducers.d.ts.map +0 -1
  2236. package/lib/test/shared-tree/fuzz/fuzzEditReducers.js +0 -214
  2237. package/lib/test/shared-tree/fuzz/fuzzEditReducers.js.map +0 -1
  2238. package/lib/test/shared-tree/fuzz/fuzzUtils.d.ts +0 -33
  2239. package/lib/test/shared-tree/fuzz/fuzzUtils.d.ts.map +0 -1
  2240. package/lib/test/shared-tree/fuzz/fuzzUtils.js +0 -78
  2241. package/lib/test/shared-tree/fuzz/fuzzUtils.js.map +0 -1
  2242. package/lib/test/shared-tree/fuzz/operationTypes.d.ts +0 -116
  2243. package/lib/test/shared-tree/fuzz/operationTypes.d.ts.map +0 -1
  2244. package/lib/test/shared-tree/fuzz/operationTypes.js +0 -6
  2245. package/lib/test/shared-tree/fuzz/operationTypes.js.map +0 -1
  2246. package/lib/test/shared-tree/fuzz/topLevel.fuzz.spec.d.ts +0 -2
  2247. package/lib/test/shared-tree/fuzz/topLevel.fuzz.spec.d.ts.map +0 -1
  2248. package/lib/test/shared-tree/fuzz/topLevel.fuzz.spec.js +0 -110
  2249. package/lib/test/shared-tree/fuzz/topLevel.fuzz.spec.js.map +0 -1
  2250. package/lib/test/shared-tree/fuzz/undoRedo.fuzz.spec.d.ts +0 -6
  2251. package/lib/test/shared-tree/fuzz/undoRedo.fuzz.spec.d.ts.map +0 -1
  2252. package/lib/test/shared-tree/fuzz/undoRedo.fuzz.spec.js +0 -220
  2253. package/lib/test/shared-tree/fuzz/undoRedo.fuzz.spec.js.map +0 -1
  2254. package/lib/test/shared-tree/opSize.bench.d.ts +0 -2
  2255. package/lib/test/shared-tree/opSize.bench.d.ts.map +0 -1
  2256. package/lib/test/shared-tree/opSize.bench.js +0 -559
  2257. package/lib/test/shared-tree/opSize.bench.js.map +0 -1
  2258. package/lib/test/shared-tree/schematizeTree.spec.d.ts +0 -6
  2259. package/lib/test/shared-tree/schematizeTree.spec.d.ts.map +0 -1
  2260. package/lib/test/shared-tree/schematizeTree.spec.js +0 -331
  2261. package/lib/test/shared-tree/schematizeTree.spec.js.map +0 -1
  2262. package/lib/test/shared-tree/schematizingTreeView.spec.d.ts +0 -6
  2263. package/lib/test/shared-tree/schematizingTreeView.spec.d.ts.map +0 -1
  2264. package/lib/test/shared-tree/schematizingTreeView.spec.js +0 -137
  2265. package/lib/test/shared-tree/schematizingTreeView.spec.js.map +0 -1
  2266. package/lib/test/shared-tree/sharedTree.bench.d.ts +0 -2
  2267. package/lib/test/shared-tree/sharedTree.bench.d.ts.map +0 -1
  2268. package/lib/test/shared-tree/sharedTree.bench.js +0 -349
  2269. package/lib/test/shared-tree/sharedTree.bench.js.map +0 -1
  2270. package/lib/test/shared-tree/sharedTree.spec.d.ts +0 -2
  2271. package/lib/test/shared-tree/sharedTree.spec.d.ts.map +0 -1
  2272. package/lib/test/shared-tree/sharedTree.spec.js +0 -1375
  2273. package/lib/test/shared-tree/sharedTree.spec.js.map +0 -1
  2274. package/lib/test/shared-tree/sharedTreeChangeCodec.spec.d.ts +0 -6
  2275. package/lib/test/shared-tree/sharedTreeChangeCodec.spec.d.ts.map +0 -1
  2276. package/lib/test/shared-tree/sharedTreeChangeCodec.spec.js +0 -52
  2277. package/lib/test/shared-tree/sharedTreeChangeCodec.spec.js.map +0 -1
  2278. package/lib/test/shared-tree/sharedTreeChangeFamily.spec.d.ts +0 -6
  2279. package/lib/test/shared-tree/sharedTreeChangeFamily.spec.d.ts.map +0 -1
  2280. package/lib/test/shared-tree/sharedTreeChangeFamily.spec.js +0 -139
  2281. package/lib/test/shared-tree/sharedTreeChangeFamily.spec.js.map +0 -1
  2282. package/lib/test/shared-tree/summary.bench.d.ts +0 -6
  2283. package/lib/test/shared-tree/summary.bench.d.ts.map +0 -1
  2284. package/lib/test/shared-tree/summary.bench.js +0 -111
  2285. package/lib/test/shared-tree/summary.bench.js.map +0 -1
  2286. package/lib/test/shared-tree/treeApi.spec.d.ts +0 -2
  2287. package/lib/test/shared-tree/treeApi.spec.d.ts.map +0 -1
  2288. package/lib/test/shared-tree/treeApi.spec.js +0 -151
  2289. package/lib/test/shared-tree/treeApi.spec.js.map +0 -1
  2290. package/lib/test/shared-tree/treeCheckout.spec.d.ts +0 -2
  2291. package/lib/test/shared-tree/treeCheckout.spec.d.ts.map +0 -1
  2292. package/lib/test/shared-tree/treeCheckout.spec.js +0 -678
  2293. package/lib/test/shared-tree/treeCheckout.spec.js.map +0 -1
  2294. package/lib/test/shared-tree/treeView.spec.d.ts +0 -2
  2295. package/lib/test/shared-tree/treeView.spec.d.ts.map +0 -1
  2296. package/lib/test/shared-tree/treeView.spec.js +0 -16
  2297. package/lib/test/shared-tree/treeView.spec.js.map +0 -1
  2298. package/lib/test/shared-tree/undo.spec.d.ts +0 -2
  2299. package/lib/test/shared-tree/undo.spec.d.ts.map +0 -1
  2300. package/lib/test/shared-tree/undo.spec.js +0 -298
  2301. package/lib/test/shared-tree/undo.spec.js.map +0 -1
  2302. package/lib/test/shared-tree-core/branch.spec.d.ts +0 -6
  2303. package/lib/test/shared-tree-core/branch.spec.d.ts.map +0 -1
  2304. package/lib/test/shared-tree-core/branch.spec.js +0 -766
  2305. package/lib/test/shared-tree-core/branch.spec.js.map +0 -1
  2306. package/lib/test/shared-tree-core/edit-manager/editManager.bench.d.ts +0 -6
  2307. package/lib/test/shared-tree-core/edit-manager/editManager.bench.d.ts.map +0 -1
  2308. package/lib/test/shared-tree-core/edit-manager/editManager.bench.js +0 -227
  2309. package/lib/test/shared-tree-core/edit-manager/editManager.bench.js.map +0 -1
  2310. package/lib/test/shared-tree-core/edit-manager/editManager.spec.d.ts +0 -6
  2311. package/lib/test/shared-tree-core/edit-manager/editManager.spec.d.ts.map +0 -1
  2312. package/lib/test/shared-tree-core/edit-manager/editManager.spec.js +0 -13
  2313. package/lib/test/shared-tree-core/edit-manager/editManager.spec.js.map +0 -1
  2314. package/lib/test/shared-tree-core/edit-manager/editManagerCodecs.test.d.ts +0 -6
  2315. package/lib/test/shared-tree-core/edit-manager/editManagerCodecs.test.d.ts.map +0 -1
  2316. package/lib/test/shared-tree-core/edit-manager/editManagerCodecs.test.js +0 -161
  2317. package/lib/test/shared-tree-core/edit-manager/editManagerCodecs.test.js.map +0 -1
  2318. package/lib/test/shared-tree-core/edit-manager/editManagerCorrectness.test.d.ts +0 -6
  2319. package/lib/test/shared-tree-core/edit-manager/editManagerCorrectness.test.d.ts.map +0 -1
  2320. package/lib/test/shared-tree-core/edit-manager/editManagerCorrectness.test.js +0 -568
  2321. package/lib/test/shared-tree-core/edit-manager/editManagerCorrectness.test.js.map +0 -1
  2322. package/lib/test/shared-tree-core/edit-manager/editManagerPerf.test.d.ts +0 -6
  2323. package/lib/test/shared-tree-core/edit-manager/editManagerPerf.test.d.ts.map +0 -1
  2324. package/lib/test/shared-tree-core/edit-manager/editManagerPerf.test.js +0 -442
  2325. package/lib/test/shared-tree-core/edit-manager/editManagerPerf.test.js.map +0 -1
  2326. package/lib/test/shared-tree-core/edit-manager/editManagerScenario.d.ts +0 -80
  2327. package/lib/test/shared-tree-core/edit-manager/editManagerScenario.d.ts.map +0 -1
  2328. package/lib/test/shared-tree-core/edit-manager/editManagerScenario.js +0 -267
  2329. package/lib/test/shared-tree-core/edit-manager/editManagerScenario.js.map +0 -1
  2330. package/lib/test/shared-tree-core/edit-manager/editManagerTestUtils.d.ts +0 -211
  2331. package/lib/test/shared-tree-core/edit-manager/editManagerTestUtils.d.ts.map +0 -1
  2332. package/lib/test/shared-tree-core/edit-manager/editManagerTestUtils.js +0 -130
  2333. package/lib/test/shared-tree-core/edit-manager/editManagerTestUtils.js.map +0 -1
  2334. package/lib/test/shared-tree-core/message.spec.d.ts +0 -2
  2335. package/lib/test/shared-tree-core/message.spec.d.ts.map +0 -1
  2336. package/lib/test/shared-tree-core/message.spec.js +0 -99
  2337. package/lib/test/shared-tree-core/message.spec.js.map +0 -1
  2338. package/lib/test/shared-tree-core/sharedTreeCore.spec.d.ts +0 -2
  2339. package/lib/test/shared-tree-core/sharedTreeCore.spec.d.ts.map +0 -1
  2340. package/lib/test/shared-tree-core/sharedTreeCore.spec.js +0 -316
  2341. package/lib/test/shared-tree-core/sharedTreeCore.spec.js.map +0 -1
  2342. package/lib/test/shared-tree-core/utils.d.ts +0 -19
  2343. package/lib/test/shared-tree-core/utils.d.ts.map +0 -1
  2344. package/lib/test/shared-tree-core/utils.js +0 -26
  2345. package/lib/test/shared-tree-core/utils.js.map +0 -1
  2346. package/lib/test/simple-tree/list.spec.d.ts +0 -6
  2347. package/lib/test/simple-tree/list.spec.d.ts.map +0 -1
  2348. package/lib/test/simple-tree/list.spec.js +0 -613
  2349. package/lib/test/simple-tree/list.spec.js.map +0 -1
  2350. package/lib/test/simple-tree/object.spec.d.ts +0 -6
  2351. package/lib/test/simple-tree/object.spec.d.ts.map +0 -1
  2352. package/lib/test/simple-tree/object.spec.js +0 -390
  2353. package/lib/test/simple-tree/object.spec.js.map +0 -1
  2354. package/lib/test/simple-tree/objectFactory.spec.d.ts +0 -6
  2355. package/lib/test/simple-tree/objectFactory.spec.d.ts.map +0 -1
  2356. package/lib/test/simple-tree/objectFactory.spec.js +0 -210
  2357. package/lib/test/simple-tree/objectFactory.spec.js.map +0 -1
  2358. package/lib/test/simple-tree/primitives.spec.d.ts +0 -6
  2359. package/lib/test/simple-tree/primitives.spec.d.ts.map +0 -1
  2360. package/lib/test/simple-tree/primitives.spec.js +0 -134
  2361. package/lib/test/simple-tree/primitives.spec.js.map +0 -1
  2362. package/lib/test/simple-tree/proxies.spec.d.ts +0 -6
  2363. package/lib/test/simple-tree/proxies.spec.d.ts.map +0 -1
  2364. package/lib/test/simple-tree/proxies.spec.js +0 -597
  2365. package/lib/test/simple-tree/proxies.spec.js.map +0 -1
  2366. package/lib/test/simple-tree/rawObjectNode.spec.d.ts +0 -6
  2367. package/lib/test/simple-tree/rawObjectNode.spec.d.ts.map +0 -1
  2368. package/lib/test/simple-tree/rawObjectNode.spec.js +0 -73
  2369. package/lib/test/simple-tree/rawObjectNode.spec.js.map +0 -1
  2370. package/lib/test/simple-tree/schemaCreationUtilities.spec.d.ts +0 -6
  2371. package/lib/test/simple-tree/schemaCreationUtilities.spec.d.ts.map +0 -1
  2372. package/lib/test/simple-tree/schemaCreationUtilities.spec.js +0 -153
  2373. package/lib/test/simple-tree/schemaCreationUtilities.spec.js.map +0 -1
  2374. package/lib/test/simple-tree/schemaFactory.examples.spec.d.ts +0 -6
  2375. package/lib/test/simple-tree/schemaFactory.examples.spec.d.ts.map +0 -1
  2376. package/lib/test/simple-tree/schemaFactory.examples.spec.js +0 -107
  2377. package/lib/test/simple-tree/schemaFactory.examples.spec.js.map +0 -1
  2378. package/lib/test/simple-tree/schemaFactory.spec.d.ts +0 -6
  2379. package/lib/test/simple-tree/schemaFactory.spec.d.ts.map +0 -1
  2380. package/lib/test/simple-tree/schemaFactory.spec.js +0 -515
  2381. package/lib/test/simple-tree/schemaFactory.spec.js.map +0 -1
  2382. package/lib/test/simple-tree/schemaFactoryRecursive.spec.d.ts +0 -6
  2383. package/lib/test/simple-tree/schemaFactoryRecursive.spec.d.ts.map +0 -1
  2384. package/lib/test/simple-tree/schemaFactoryRecursive.spec.js +0 -282
  2385. package/lib/test/simple-tree/schemaFactoryRecursive.spec.js.map +0 -1
  2386. package/lib/test/simple-tree/schemaTypes.spec.d.ts +0 -6
  2387. package/lib/test/simple-tree/schemaTypes.spec.d.ts.map +0 -1
  2388. package/lib/test/simple-tree/schemaTypes.spec.js +0 -89
  2389. package/lib/test/simple-tree/schemaTypes.spec.js.map +0 -1
  2390. package/lib/test/simple-tree/toFlexSchema.spec.d.ts +0 -6
  2391. package/lib/test/simple-tree/toFlexSchema.spec.d.ts.map +0 -1
  2392. package/lib/test/simple-tree/toFlexSchema.spec.js +0 -30
  2393. package/lib/test/simple-tree/toFlexSchema.spec.js.map +0 -1
  2394. package/lib/test/simple-tree/toMapTree.spec.d.ts +0 -6
  2395. package/lib/test/simple-tree/toMapTree.spec.d.ts.map +0 -1
  2396. package/lib/test/simple-tree/toMapTree.spec.js +0 -423
  2397. package/lib/test/simple-tree/toMapTree.spec.js.map +0 -1
  2398. package/lib/test/simple-tree/tree.spec.d.ts +0 -6
  2399. package/lib/test/simple-tree/tree.spec.d.ts.map +0 -1
  2400. package/lib/test/simple-tree/tree.spec.js +0 -71
  2401. package/lib/test/simple-tree/tree.spec.js.map +0 -1
  2402. package/lib/test/simple-tree/treeApi.spec.d.ts +0 -6
  2403. package/lib/test/simple-tree/treeApi.spec.d.ts.map +0 -1
  2404. package/lib/test/simple-tree/treeApi.spec.js +0 -146
  2405. package/lib/test/simple-tree/treeApi.spec.js.map +0 -1
  2406. package/lib/test/simple-tree/utils.d.ts +0 -16
  2407. package/lib/test/simple-tree/utils.d.ts.map +0 -1
  2408. package/lib/test/simple-tree/utils.js +0 -33
  2409. package/lib/test/simple-tree/utils.js.map +0 -1
  2410. package/lib/test/snapshots/gc.spec.d.ts +0 -6
  2411. package/lib/test/snapshots/gc.spec.d.ts.map +0 -1
  2412. package/lib/test/snapshots/gc.spec.js +0 -106
  2413. package/lib/test/snapshots/gc.spec.js.map +0 -1
  2414. package/lib/test/snapshots/index.d.ts +0 -6
  2415. package/lib/test/snapshots/index.d.ts.map +0 -1
  2416. package/lib/test/snapshots/index.js +0 -6
  2417. package/lib/test/snapshots/index.js.map +0 -1
  2418. package/lib/test/snapshots/schema.spec.d.ts +0 -6
  2419. package/lib/test/snapshots/schema.spec.d.ts.map +0 -1
  2420. package/lib/test/snapshots/schema.spec.js +0 -17
  2421. package/lib/test/snapshots/schema.spec.js.map +0 -1
  2422. package/lib/test/snapshots/snapshotTools.d.ts +0 -25
  2423. package/lib/test/snapshots/snapshotTools.d.ts.map +0 -1
  2424. package/lib/test/snapshots/snapshotTools.js +0 -85
  2425. package/lib/test/snapshots/snapshotTools.js.map +0 -1
  2426. package/lib/test/snapshots/summary.spec.d.ts +0 -6
  2427. package/lib/test/snapshots/summary.spec.d.ts.map +0 -1
  2428. package/lib/test/snapshots/summary.spec.js +0 -26
  2429. package/lib/test/snapshots/summary.spec.js.map +0 -1
  2430. package/lib/test/snapshots/testTrees.d.ts +0 -15
  2431. package/lib/test/snapshots/testTrees.d.ts.map +0 -1
  2432. package/lib/test/snapshots/testTrees.js +0 -374
  2433. package/lib/test/snapshots/testTrees.js.map +0 -1
  2434. package/lib/test/snapshots/utils.d.ts +0 -7
  2435. package/lib/test/snapshots/utils.d.ts.map +0 -1
  2436. package/lib/test/snapshots/utils.js +0 -106
  2437. package/lib/test/snapshots/utils.js.map +0 -1
  2438. package/lib/test/testChange.d.ts +0 -90
  2439. package/lib/test/testChange.d.ts.map +0 -1
  2440. package/lib/test/testChange.js +0 -234
  2441. package/lib/test/testChange.js.map +0 -1
  2442. package/lib/test/testChange.spec.d.ts +0 -6
  2443. package/lib/test/testChange.spec.d.ts.map +0 -1
  2444. package/lib/test/testChange.spec.js +0 -113
  2445. package/lib/test/testChange.spec.js.map +0 -1
  2446. package/lib/test/testTrees.d.ts +0 -56
  2447. package/lib/test/testTrees.d.ts.map +0 -1
  2448. package/lib/test/testTrees.js +0 -175
  2449. package/lib/test/testTrees.js.map +0 -1
  2450. package/lib/test/tree/anchorSet.spec.d.ts +0 -6
  2451. package/lib/test/tree/anchorSet.spec.d.ts.map +0 -1
  2452. package/lib/test/tree/anchorSet.spec.js +0 -593
  2453. package/lib/test/tree/anchorSet.spec.js.map +0 -1
  2454. package/lib/test/tree/detachedFieldIndex.spec.d.ts +0 -11
  2455. package/lib/test/tree/detachedFieldIndex.spec.d.ts.map +0 -1
  2456. package/lib/test/tree/detachedFieldIndex.spec.js +0 -218
  2457. package/lib/test/tree/detachedFieldIndex.spec.js.map +0 -1
  2458. package/lib/test/tree/pathTree.spec.d.ts +0 -6
  2459. package/lib/test/tree/pathTree.spec.d.ts.map +0 -1
  2460. package/lib/test/tree/pathTree.spec.js +0 -122
  2461. package/lib/test/tree/pathTree.spec.js.map +0 -1
  2462. package/lib/test/tree/visitDelta.spec.d.ts +0 -6
  2463. package/lib/test/tree/visitDelta.spec.d.ts.map +0 -1
  2464. package/lib/test/tree/visitDelta.spec.js +0 -1055
  2465. package/lib/test/tree/visitDelta.spec.js.map +0 -1
  2466. package/lib/test/util/brand.spec.d.ts +0 -22
  2467. package/lib/test/util/brand.spec.d.ts.map +0 -1
  2468. package/lib/test/util/brand.spec.js +0 -19
  2469. package/lib/test/util/brand.spec.js.map +0 -1
  2470. package/lib/test/util/deepFreeze.spec.d.ts +0 -6
  2471. package/lib/test/util/deepFreeze.spec.d.ts.map +0 -1
  2472. package/lib/test/util/deepFreeze.spec.js +0 -176
  2473. package/lib/test/util/deepFreeze.spec.js.map +0 -1
  2474. package/lib/test/util/nestedMap.spec.d.ts +0 -6
  2475. package/lib/test/util/nestedMap.spec.d.ts.map +0 -1
  2476. package/lib/test/util/nestedMap.spec.js +0 -190
  2477. package/lib/test/util/nestedMap.spec.js.map +0 -1
  2478. package/lib/test/util/offsetList.spec.d.ts +0 -6
  2479. package/lib/test/util/offsetList.spec.d.ts.map +0 -1
  2480. package/lib/test/util/offsetList.spec.js +0 -35
  2481. package/lib/test/util/offsetList.spec.js.map +0 -1
  2482. package/lib/test/util/testTreeProvider.spec.d.ts +0 -6
  2483. package/lib/test/util/testTreeProvider.spec.d.ts.map +0 -1
  2484. package/lib/test/util/testTreeProvider.spec.js +0 -56
  2485. package/lib/test/util/testTreeProvider.spec.js.map +0 -1
  2486. package/lib/test/util/typeUtils.spec.d.ts +0 -6
  2487. package/lib/test/util/typeUtils.spec.d.ts.map +0 -1
  2488. package/lib/test/util/typeUtils.spec.js +0 -19
  2489. package/lib/test/util/typeUtils.spec.js.map +0 -1
  2490. package/lib/test/util/utils.spec.d.ts +0 -6
  2491. package/lib/test/util/utils.spec.d.ts.map +0 -1
  2492. package/lib/test/util/utils.spec.js +0 -27
  2493. package/lib/test/util/utils.spec.js.map +0 -1
  2494. package/lib/test/utils.d.ts +0 -313
  2495. package/lib/test/utils.d.ts.map +0 -1
  2496. package/lib/test/utils.js +0 -765
  2497. package/lib/test/utils.js.map +0 -1
  2498. package/lib/tree-alpha.d.ts +0 -2159
  2499. package/lib/tree-beta.d.ts +0 -2159
  2500. package/lib/tree-public.d.ts +0 -1942
  2501. package/lib/tree-untrimmed.d.ts +0 -6880
  2502. package/src/simple-tree/flexNode.ts +0 -96
  2503. package/src/simple-tree/treeArrayNode.ts +0 -70
  2504. /package/dist/{feature-libraries → core/schema-stored}/multiplicity.d.ts +0 -0
  2505. /package/lib/{feature-libraries → core/schema-stored}/multiplicity.d.ts +0 -0
  2506. /package/lib/{feature-libraries → core/schema-stored}/multiplicity.js +0 -0
  2507. /package/{dist → lib}/tsdoc-metadata.json +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"chunkedForest.js","sourceRoot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OAAO,IAAI,aAAa,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACxE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\tITreeSubscriptionCursor,\n\tIEditableForest,\n\tTreeNavigationResult,\n\tTreeStoredSchemaSubscription,\n\tFieldKey,\n\tDetachedField,\n\tAnchorSet,\n\tdetachedFieldAsKey,\n\tUpPath,\n\tAnchor,\n\tFieldAnchor,\n\tForestEvents,\n\tITreeSubscriptionCursorState,\n\trootFieldKey,\n\tmapCursorField,\n\tDeltaVisitor,\n\tPlaceIndex,\n\tRange,\n\tITreeCursorSynchronous,\n\taboveRootPlaceholder,\n\tProtoNodes,\n} from \"../../core/index.js\";\nimport { assertValidRange, brand, fail, getOrAddEmptyToMap } from \"../../util/index.js\";\nimport { createEmitter } from \"../../events/index.js\";\nimport { BasicChunk, BasicChunkCursor, SiblingsOrKey } from \"./basicChunk.js\";\nimport { basicChunkTree, chunkTree, IChunker } from \"./chunkTree.js\";\nimport { ChunkedCursor, TreeChunk } from \"./chunk.js\";\n\nfunction makeRoot(): BasicChunk {\n\treturn new BasicChunk(aboveRootPlaceholder, new Map());\n}\n\ninterface StackNode {\n\tmutableChunk: BasicChunk;\n\tkey: FieldKey;\n}\n\n/**\n * Implementation of IEditableForest based on copy on write chunks.\n *\n * This implementation focuses on performance.\n */\nexport class ChunkedForest implements IEditableForest {\n\tprivate activeVisitor?: DeltaVisitor;\n\n\tprivate readonly events = createEmitter<ForestEvents>();\n\n\t/**\n\t * @param roots - dummy node above the root under which detached fields are stored. All content of the forest is reachable from this.\n\t * @param schema - schema which all content in this forest is assumed to comply with.\n\t * @param chunker - Chunking policy. TODO: dispose of this when forest is disposed.\n\t * @param anchors - anchorSet used to track location in this forest across changes. Callers of applyDelta must ensure this is updated accordingly.\n\t */\n\tpublic constructor(\n\t\tpublic roots: BasicChunk,\n\t\tpublic readonly schema: TreeStoredSchemaSubscription,\n\t\tpublic readonly chunker: IChunker,\n\t\tpublic readonly anchors: AnchorSet = new AnchorSet(),\n\t) {}\n\n\tpublic get isEmpty(): boolean {\n\t\treturn this.roots.fields.size === 0;\n\t}\n\n\tpublic on<K extends keyof ForestEvents>(eventName: K, listener: ForestEvents[K]): () => void {\n\t\treturn this.events.on(eventName, listener);\n\t}\n\n\tpublic clone(schema: TreeStoredSchemaSubscription, anchors: AnchorSet): ChunkedForest {\n\t\tthis.roots.referenceAdded();\n\t\treturn new ChunkedForest(this.roots, schema, this.chunker.clone(schema), anchors);\n\t}\n\n\tpublic forgetAnchor(anchor: Anchor): void {\n\t\tthis.anchors.forget(anchor);\n\t}\n\n\tpublic acquireVisitor(): DeltaVisitor {\n\t\tassert(\n\t\t\tthis.activeVisitor === undefined,\n\t\t\t0x76a /* Must release existing visitor before acquiring another */,\n\t\t);\n\t\tthis.events.emit(\"beforeChange\");\n\n\t\tif (this.roots.isShared()) {\n\t\t\tthis.roots = this.roots.clone();\n\t\t}\n\n\t\tconst visitor = {\n\t\t\tforest: this,\n\t\t\t// Current location in the tree, as a non-shared BasicChunk (TODO: support in-place modification of other chunk formats when possible).\n\t\t\t// Start above root detached sequences.\n\t\t\tmutableChunkStack: [] as StackNode[],\n\t\t\tmutableChunk: this.roots as BasicChunk | undefined,\n\t\t\tgetParent() {\n\t\t\t\tassert(\n\t\t\t\t\tthis.mutableChunkStack.length > 0,\n\t\t\t\t\t0x532 /* invalid access to root's parent */,\n\t\t\t\t);\n\t\t\t\treturn this.mutableChunkStack[this.mutableChunkStack.length - 1];\n\t\t\t},\n\t\t\tfree(): void {\n\t\t\t\tthis.mutableChunk = undefined;\n\t\t\t\tthis.mutableChunkStack.length = 0;\n\t\t\t\tassert(\n\t\t\t\t\tthis.forest.activeVisitor !== undefined,\n\t\t\t\t\t0x76b /* Multiple free calls for same visitor */,\n\t\t\t\t);\n\t\t\t\tthis.forest.activeVisitor = undefined;\n\t\t\t\tthis.forest.events.emit(\"afterChange\");\n\t\t\t},\n\t\t\tdestroy(detachedField: FieldKey, count: number): void {\n\t\t\t\tthis.forest.roots.fields.delete(detachedField);\n\t\t\t},\n\t\t\tcreate(content: ProtoNodes, destination: FieldKey): void {\n\t\t\t\tconst chunks: TreeChunk[] = content.map((c) => chunkTree(c, this.forest.chunker));\n\t\t\t\tthis.forest.roots.fields.set(destination, chunks);\n\t\t\t},\n\t\t\tattach(source: FieldKey, count: number, destination: PlaceIndex): void {\n\t\t\t\tthis.attachEdit(source, count, destination);\n\t\t\t},\n\t\t\tdetach(source: Range, destination: FieldKey): void {\n\t\t\t\tthis.detachEdit(source, destination);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Attaches the range into the current field by transferring it from the given source path.\n\t\t\t * Does not invalidate dependents.\n\t\t\t * @param source - The the range to be attached.\n\t\t\t * @param destination - The index in the current field at which to attach the content.\n\t\t\t */\n\t\t\tattachEdit(source: FieldKey, count: number, destination: PlaceIndex): void {\n\t\t\t\tconst sourceField = this.forest.roots.fields.get(source) ?? [];\n\t\t\t\tthis.forest.roots.fields.delete(source);\n\t\t\t\tif (sourceField.length === 0) {\n\t\t\t\t\treturn; // Prevent creating 0 sized fields when inserting empty into empty.\n\t\t\t\t}\n\n\t\t\t\tconst parent = this.getParent();\n\t\t\t\tconst destinationField = getOrAddEmptyToMap(parent.mutableChunk.fields, parent.key);\n\t\t\t\t// TODO: this will fail for very large moves due to argument limits.\n\t\t\t\tdestinationField.splice(destination, 0, ...sourceField);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Detaches the range from the current field and transfers it to the given destination if any.\n\t\t\t * Does not invalidate dependents.\n\t\t\t * @param source - The bounds of the range to be detached from the current field.\n\t\t\t * @param destination - If specified, the destination to transfer the detached range to.\n\t\t\t * If not specified, the detached range is destroyed.\n\t\t\t */\n\t\t\tdetachEdit(source: Range, destination: FieldKey | undefined): void {\n\t\t\t\tconst parent = this.getParent();\n\t\t\t\tconst sourceField = parent.mutableChunk.fields.get(parent.key) ?? [];\n\n\t\t\t\tassertValidRange(source, sourceField);\n\t\t\t\tconst newField = sourceField.splice(source.start, source.end - source.start);\n\n\t\t\t\tif (destination !== undefined) {\n\t\t\t\t\tassert(\n\t\t\t\t\t\t!this.forest.roots.fields.has(destination),\n\t\t\t\t\t\t0x7af /* Destination must be a new empty detached field */,\n\t\t\t\t\t);\n\t\t\t\t\tif (newField.length > 0) {\n\t\t\t\t\t\tthis.forest.roots.fields.set(destination, newField);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (const child of newField) {\n\t\t\t\t\t\tchild.referenceRemoved();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// This check is performed after the transfer to ensure that the field is not removed in scenarios\n\t\t\t\t// where the source and destination are the same.\n\t\t\t\tif (sourceField.length === 0) {\n\t\t\t\t\tparent.mutableChunk.fields.delete(parent.key);\n\t\t\t\t}\n\t\t\t},\n\t\t\treplace(\n\t\t\t\tnewContentSource: FieldKey,\n\t\t\t\trange: Range,\n\t\t\t\toldContentDestination: FieldKey,\n\t\t\t): void {\n\t\t\t\tassert(\n\t\t\t\t\tnewContentSource !== oldContentDestination,\n\t\t\t\t\t0x7b0 /* Replace detached source field and detached destination field must be different */,\n\t\t\t\t);\n\t\t\t\tthis.detachEdit(range, oldContentDestination);\n\t\t\t\tthis.attachEdit(newContentSource, range.end - range.start, range.start);\n\t\t\t},\n\t\t\tenterNode(index: number): void {\n\t\t\t\tassert(this.mutableChunk === undefined, 0x535 /* should be in field */);\n\t\t\t\tconst parent = this.getParent();\n\t\t\t\tconst chunks =\n\t\t\t\t\tparent.mutableChunk.fields.get(parent.key) ?? fail(\"missing edited field\");\n\t\t\t\tlet indexWithinChunk = index;\n\t\t\t\tlet indexOfChunk = 0;\n\t\t\t\twhile (indexWithinChunk >= chunks[indexOfChunk].topLevelLength) {\n\t\t\t\t\tindexWithinChunk -= chunks[indexOfChunk].topLevelLength;\n\t\t\t\t\tindexOfChunk++;\n\t\t\t\t\tif (indexOfChunk === chunks.length) {\n\t\t\t\t\t\tfail(\"missing edited node\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet found = chunks[indexOfChunk];\n\t\t\t\tif (!(found instanceof BasicChunk)) {\n\t\t\t\t\t// TODO:Perf: support in place editing of other chunk formats when possible:\n\t\t\t\t\t// 1. Support updating values in uniform chunks.\n\t\t\t\t\t// 2. Support traversing sequence chunks.\n\t\t\t\t\t//\n\t\t\t\t\t// Maybe build path when visitor navigates then lazily sync to chunk tree when editing?\n\t\t\t\t\tconst newChunks = mapCursorField(found.cursor(), (cursor) =>\n\t\t\t\t\t\tbasicChunkTree(cursor, this.forest.chunker),\n\t\t\t\t\t);\n\t\t\t\t\t// TODO: this could fail for really long chunks being split (due to argument count limits).\n\t\t\t\t\t// Current implementations of chunks shouldn't ever be that long, but it could be an issue if they get bigger.\n\t\t\t\t\tchunks.splice(indexOfChunk, 1, ...newChunks);\n\t\t\t\t\tfound.referenceRemoved();\n\n\t\t\t\t\tfound = newChunks[indexWithinChunk];\n\t\t\t\t}\n\t\t\t\tassert(found instanceof BasicChunk, 0x536 /* chunk should have been normalized */);\n\t\t\t\tif (found.isShared()) {\n\t\t\t\t\tthis.mutableChunk = chunks[indexOfChunk] = found.clone();\n\t\t\t\t\tfound.referenceRemoved();\n\t\t\t\t} else {\n\t\t\t\t\tthis.mutableChunk = found;\n\t\t\t\t}\n\t\t\t},\n\t\t\texitNode(index: number): void {\n\t\t\t\tassert(this.mutableChunk !== undefined, 0x537 /* should be in node */);\n\t\t\t\tthis.mutableChunk = undefined;\n\t\t\t},\n\t\t\tenterField(key: FieldKey): void {\n\t\t\t\tassert(this.mutableChunk !== undefined, 0x538 /* should be in node */);\n\t\t\t\tthis.mutableChunkStack.push({ key, mutableChunk: this.mutableChunk });\n\t\t\t\tthis.mutableChunk = undefined;\n\t\t\t},\n\t\t\texitField(key: FieldKey): void {\n\t\t\t\tconst top = this.mutableChunkStack.pop() ?? fail(\"should not be at root\");\n\t\t\t\tassert(this.mutableChunk === undefined, 0x539 /* should be in field */);\n\t\t\t\tthis.mutableChunk = top.mutableChunk;\n\t\t\t},\n\t\t};\n\t\tthis.activeVisitor = visitor;\n\t\treturn visitor;\n\t}\n\n\tprivate nextDetachedFieldIdentifier = 0;\n\tpublic newDetachedField(): DetachedField {\n\t\tconst field: DetachedField = brand(String(this.nextDetachedFieldIdentifier));\n\t\tassert(\n\t\t\t!this.roots.fields.has(detachedFieldAsKey(field)),\n\t\t\t0x53a /* new field must not already exist */,\n\t\t);\n\t\tthis.nextDetachedFieldIdentifier += 1;\n\t\treturn field;\n\t}\n\n\tpublic allocateCursor(): Cursor {\n\t\treturn new Cursor(\n\t\t\tthis,\n\t\t\tITreeSubscriptionCursorState.Cleared,\n\t\t\t[],\n\t\t\t[],\n\t\t\t[],\n\t\t\t[],\n\t\t\t[],\n\t\t\t[],\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tundefined,\n\t\t);\n\t}\n\n\tpublic tryMoveCursorToNode(\n\t\tdestination: Anchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\tconst path = this.anchors.locate(destination);\n\t\tif (path === undefined) {\n\t\t\treturn TreeNavigationResult.NotFound;\n\t\t}\n\t\tthis.moveCursorToPath(path, cursorToMove);\n\t\treturn TreeNavigationResult.Ok;\n\t}\n\n\tpublic tryMoveCursorToField(\n\t\tdestination: FieldAnchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\tassert(\n\t\t\tcursorToMove instanceof Cursor,\n\t\t\t0x53b /* ChunkedForest must only be given its own Cursor type */,\n\t\t);\n\t\tif (destination.parent === undefined) {\n\t\t\tcursorToMove.setToDetachedSequence(destination.fieldKey);\n\t\t\treturn TreeNavigationResult.Ok;\n\t\t}\n\t\tconst result = this.tryMoveCursorToNode(destination.parent, cursorToMove);\n\t\tif (result !== TreeNavigationResult.Ok) {\n\t\t\treturn result;\n\t\t}\n\n\t\tcursorToMove.enterField(destination.fieldKey);\n\t\treturn TreeNavigationResult.Ok;\n\t}\n\n\tpublic moveCursorToPath(destination: UpPath, cursorToMove: ITreeSubscriptionCursor): void {\n\t\tassert(\n\t\t\tcursorToMove instanceof Cursor,\n\t\t\t0x53c /* ChunkedForest must only be given its own Cursor type */,\n\t\t);\n\t\tassert(\n\t\t\tcursorToMove.forest === this,\n\t\t\t0x53d /* ChunkedForest must only be given its own Cursor */,\n\t\t);\n\n\t\tconst indexStack: number[] = [];\n\t\tconst keyStack: FieldKey[] = [];\n\n\t\tlet path: UpPath | undefined = destination;\n\t\twhile (path !== undefined) {\n\t\t\tindexStack.push(path.parentIndex);\n\t\t\tkeyStack.push(path.parentField);\n\t\t\tpath = path.parent;\n\t\t}\n\t\tcursorToMove.clear();\n\t\twhile (keyStack.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst key = keyStack.pop()!;\n\t\t\tif (cursorToMove.state === ITreeSubscriptionCursorState.Cleared) {\n\t\t\t\tcursorToMove.setToDetachedSequence(key);\n\t\t\t\tcursorToMove.state = ITreeSubscriptionCursorState.Current;\n\t\t\t} else {\n\t\t\t\tcursorToMove.enterField(key);\n\t\t\t}\n\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tcursorToMove.enterNode(indexStack.pop()!);\n\t\t}\n\t}\n\n\tpublic getCursorAboveDetachedFields(): ITreeCursorSynchronous {\n\t\tconst rootCursor = this.roots.cursor();\n\t\trootCursor.enterNode(0);\n\t\treturn rootCursor;\n\t}\n}\n\nclass Cursor extends BasicChunkCursor implements ITreeSubscriptionCursor {\n\tpublic constructor(\n\t\tpublic readonly forest: ChunkedForest,\n\t\tpublic state: ITreeSubscriptionCursorState,\n\t\troot: readonly TreeChunk[],\n\t\tsiblingStack: SiblingsOrKey[],\n\t\tindexStack: number[],\n\t\tindexOfChunkStack: number[],\n\t\tindexWithinChunkStack: number[],\n\t\tsiblings: SiblingsOrKey,\n\t\tindex: number,\n\t\tindexOfChunk: number,\n\t\tindexWithinChunk: number,\n\t\tnestedCursor: ChunkedCursor | undefined,\n\t) {\n\t\tsuper(\n\t\t\troot,\n\t\t\tsiblingStack,\n\t\t\tindexStack,\n\t\t\tindexOfChunkStack,\n\t\t\tindexWithinChunkStack,\n\t\t\tsiblings,\n\t\t\tindex,\n\t\t\tindexOfChunk,\n\t\t\tindexWithinChunk,\n\t\t\tnestedCursor,\n\t\t);\n\t}\n\n\tpublic setToDetachedSequence(key: FieldKey): void {\n\t\tthis.root = (this.forest.roots.fields.get(key) ?? []) as BasicChunk[];\n\t\tthis.siblingStack.length = 0;\n\t\tthis.indexStack.length = 0;\n\t\tthis.indexOfChunkStack.length = 0;\n\t\tthis.indexWithinChunkStack.length = 0;\n\t\tthis.siblings = [key];\n\t\tthis.index = 0;\n\t\tthis.indexOfChunk = 0;\n\t\tthis.indexWithinChunk = 0;\n\t\tthis.nestedCursor = undefined;\n\t}\n\n\tpublic override fork(): Cursor {\n\t\t// Siblings arrays are not modified during navigation and do not need be be copied.\n\t\t// This allows this copy to be shallow, and `this.siblings` below to not be copied as all.\n\t\treturn new Cursor(\n\t\t\tthis.forest,\n\t\t\tthis.state,\n\t\t\tthis.root,\n\t\t\t[...this.siblingStack],\n\t\t\t[...this.indexStack],\n\t\t\t[...this.indexOfChunkStack],\n\t\t\t[...this.indexWithinChunkStack],\n\t\t\tthis.siblings,\n\t\t\tthis.index,\n\t\t\tthis.indexOfChunk,\n\t\t\tthis.indexWithinChunk,\n\t\t\tthis.nestedCursor?.fork(),\n\t\t);\n\t}\n\n\tpublic buildFieldAnchor(): FieldAnchor {\n\t\tconst path = this.getFieldPath();\n\t\tconst anchor =\n\t\t\tpath.parent === undefined ? undefined : this.forest.anchors.track(path.parent);\n\t\treturn { parent: anchor, fieldKey: path.field };\n\t}\n\n\tpublic free(): void {\n\t\tthis.state = ITreeSubscriptionCursorState.Freed;\n\t}\n\n\tpublic buildAnchor(): Anchor {\n\t\treturn this.forest.anchors.track(this.getPath());\n\t}\n\n\tpublic clear(): void {\n\t\tthis.state = ITreeSubscriptionCursorState.Cleared;\n\t\tthis.setToDetachedSequence(rootFieldKey);\n\t}\n}\n\n/**\n * @returns an implementation of {@link IEditableForest} with no data or schema.\n */\nexport function buildChunkedForest(chunker: IChunker, anchors?: AnchorSet): ChunkedForest {\n\treturn new ChunkedForest(makeRoot(), chunker.schema, chunker, anchors);\n}\n"]}
1
+ {"version":3,"file":"chunkedForest.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/chunkedForest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAEN,SAAS,EAST,4BAA4B,EAO5B,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAExF,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAiB,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAAY,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAErE,SAAS,QAAQ;IAChB,OAAO,IAAI,UAAU,CAAC,oBAAoB,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACxD,CAAC;AAOD;;;;GAIG;AACH,MAAM,OAAO,aAAa;IAKzB;;;;;OAKG;IACH,YACQ,KAAiB,EACR,MAAoC,EACpC,OAAiB,EACjB,UAAqB,IAAI,SAAS,EAAE;QAH7C,UAAK,GAAL,KAAK,CAAY;QACR,WAAM,GAAN,MAAM,CAA8B;QACpC,YAAO,GAAP,O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E,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IACjD,CAAC;IAEM,IAAI;QACV,IAAI,CAAC,KAAK,GAAG,4BAA4B,CAAC,KAAK,CAAC;IACjD,CAAC;IAEM,WAAW;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IAEM,KAAK;QACX,IAAI,CAAC,KAAK,GAAG,4BAA4B,CAAC,OAAO,CAAC;QAClD,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;CACD;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAiB,EAAE,OAAmB;IACxE,OAAO,IAAI,aAAa,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACxE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tAnchor,\n\tAnchorSet,\n\tDeltaVisitor,\n\tDetachedField,\n\tFieldAnchor,\n\tFieldKey,\n\tForestEvents,\n\tIEditableForest,\n\tITreeCursorSynchronous,\n\tITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\tPlaceIndex,\n\tProtoNodes,\n\tRange,\n\tTreeNavigationResult,\n\tTreeStoredSchemaSubscription,\n\tUpPath,\n\taboveRootPlaceholder,\n\tdetachedFieldAsKey,\n\tmapCursorField,\n\trootFieldKey,\n} from \"../../core/index.js\";\nimport { createEmitter } from \"../../events/index.js\";\nimport { assertValidRange, brand, fail, getOrAddEmptyToMap } from \"../../util/index.js\";\n\nimport { BasicChunk, BasicChunkCursor, SiblingsOrKey } from \"./basicChunk.js\";\nimport { ChunkedCursor, TreeChunk } from \"./chunk.js\";\nimport { IChunker, basicChunkTree, chunkTree } from \"./chunkTree.js\";\n\nfunction makeRoot(): BasicChunk {\n\treturn new BasicChunk(aboveRootPlaceholder, new Map());\n}\n\ninterface StackNode {\n\tmutableChunk: BasicChunk;\n\tkey: FieldKey;\n}\n\n/**\n * Implementation of IEditableForest based on copy on write chunks.\n *\n * This implementation focuses on performance.\n */\nexport class ChunkedForest implements IEditableForest {\n\tprivate activeVisitor?: DeltaVisitor;\n\n\tprivate readonly events = createEmitter<ForestEvents>();\n\n\t/**\n\t * @param roots - dummy node above the root under which detached fields are stored. All content of the forest is reachable from this.\n\t * @param schema - schema which all content in this forest is assumed to comply with.\n\t * @param chunker - Chunking policy. TODO: dispose of this when forest is disposed.\n\t * @param anchors - anchorSet used to track location in this forest across changes. Callers of applyDelta must ensure this is updated accordingly.\n\t */\n\tpublic constructor(\n\t\tpublic roots: BasicChunk,\n\t\tpublic readonly schema: TreeStoredSchemaSubscription,\n\t\tpublic readonly chunker: IChunker,\n\t\tpublic readonly anchors: AnchorSet = new AnchorSet(),\n\t) {}\n\n\tpublic get isEmpty(): boolean {\n\t\treturn this.roots.fields.size === 0;\n\t}\n\n\tpublic on<K extends keyof ForestEvents>(eventName: K, listener: ForestEvents[K]): () => void {\n\t\treturn this.events.on(eventName, listener);\n\t}\n\n\tpublic clone(schema: TreeStoredSchemaSubscription, anchors: AnchorSet): ChunkedForest {\n\t\tthis.roots.referenceAdded();\n\t\treturn new ChunkedForest(this.roots, schema, this.chunker.clone(schema), anchors);\n\t}\n\n\tpublic forgetAnchor(anchor: Anchor): void {\n\t\tthis.anchors.forget(anchor);\n\t}\n\n\tpublic acquireVisitor(): DeltaVisitor {\n\t\tassert(\n\t\t\tthis.activeVisitor === undefined,\n\t\t\t0x76a /* Must release existing visitor before acquiring another */,\n\t\t);\n\t\tthis.events.emit(\"beforeChange\");\n\n\t\tif (this.roots.isShared()) {\n\t\t\tthis.roots = this.roots.clone();\n\t\t}\n\n\t\tconst visitor = {\n\t\t\tforest: this,\n\t\t\t// Current location in the tree, as a non-shared BasicChunk (TODO: support in-place modification of other chunk formats when possible).\n\t\t\t// Start above root detached sequences.\n\t\t\tmutableChunkStack: [] as StackNode[],\n\t\t\tmutableChunk: this.roots as BasicChunk | undefined,\n\t\t\tgetParent() {\n\t\t\t\tassert(\n\t\t\t\t\tthis.mutableChunkStack.length > 0,\n\t\t\t\t\t0x532 /* invalid access to root's parent */,\n\t\t\t\t);\n\t\t\t\treturn this.mutableChunkStack[this.mutableChunkStack.length - 1];\n\t\t\t},\n\t\t\tfree(): void {\n\t\t\t\tthis.mutableChunk = undefined;\n\t\t\t\tthis.mutableChunkStack.length = 0;\n\t\t\t\tassert(\n\t\t\t\t\tthis.forest.activeVisitor !== undefined,\n\t\t\t\t\t0x76b /* Multiple free calls for same visitor */,\n\t\t\t\t);\n\t\t\t\tthis.forest.activeVisitor = undefined;\n\t\t\t\tthis.forest.events.emit(\"afterChange\");\n\t\t\t},\n\t\t\tdestroy(detachedField: FieldKey, count: number): void {\n\t\t\t\tthis.forest.roots.fields.delete(detachedField);\n\t\t\t},\n\t\t\tcreate(content: ProtoNodes, destination: FieldKey): void {\n\t\t\t\tconst chunks: TreeChunk[] = content.map((c) => chunkTree(c, this.forest.chunker));\n\t\t\t\tthis.forest.roots.fields.set(destination, chunks);\n\t\t\t\tthis.forest.events.emit(\"afterRootFieldCreated\", destination);\n\t\t\t},\n\t\t\tattach(source: FieldKey, count: number, destination: PlaceIndex): void {\n\t\t\t\tthis.attachEdit(source, count, destination);\n\t\t\t},\n\t\t\tdetach(source: Range, destination: FieldKey): void {\n\t\t\t\tthis.detachEdit(source, destination);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Attaches the range into the current field by transferring it from the given source path.\n\t\t\t * Does not invalidate dependents.\n\t\t\t * @param source - The the range to be attached.\n\t\t\t * @param destination - The index in the current field at which to attach the content.\n\t\t\t */\n\t\t\tattachEdit(source: FieldKey, count: number, destination: PlaceIndex): void {\n\t\t\t\tconst sourceField = this.forest.roots.fields.get(source) ?? [];\n\t\t\t\tthis.forest.roots.fields.delete(source);\n\t\t\t\tif (sourceField.length === 0) {\n\t\t\t\t\treturn; // Prevent creating 0 sized fields when inserting empty into empty.\n\t\t\t\t}\n\n\t\t\t\tconst parent = this.getParent();\n\t\t\t\tconst destinationField = getOrAddEmptyToMap(parent.mutableChunk.fields, parent.key);\n\t\t\t\t// TODO: this will fail for very large moves due to argument limits.\n\t\t\t\tdestinationField.splice(destination, 0, ...sourceField);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Detaches the range from the current field and transfers it to the given destination if any.\n\t\t\t * Does not invalidate dependents.\n\t\t\t * @param source - The bounds of the range to be detached from the current field.\n\t\t\t * @param destination - If specified, the destination to transfer the detached range to.\n\t\t\t * If not specified, the detached range is destroyed.\n\t\t\t */\n\t\t\tdetachEdit(source: Range, destination: FieldKey | undefined): void {\n\t\t\t\tconst parent = this.getParent();\n\t\t\t\tconst sourceField = parent.mutableChunk.fields.get(parent.key) ?? [];\n\n\t\t\t\tassertValidRange(source, sourceField);\n\t\t\t\tconst newField = sourceField.splice(source.start, source.end - source.start);\n\n\t\t\t\tif (destination !== undefined) {\n\t\t\t\t\tassert(\n\t\t\t\t\t\t!this.forest.roots.fields.has(destination),\n\t\t\t\t\t\t0x7af /* Destination must be a new empty detached field */,\n\t\t\t\t\t);\n\t\t\t\t\tif (newField.length > 0) {\n\t\t\t\t\t\tthis.forest.roots.fields.set(destination, newField);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (const child of newField) {\n\t\t\t\t\t\tchild.referenceRemoved();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// This check is performed after the transfer to ensure that the field is not removed in scenarios\n\t\t\t\t// where the source and destination are the same.\n\t\t\t\tif (sourceField.length === 0) {\n\t\t\t\t\tparent.mutableChunk.fields.delete(parent.key);\n\t\t\t\t}\n\t\t\t},\n\t\t\treplace(\n\t\t\t\tnewContentSource: FieldKey,\n\t\t\t\trange: Range,\n\t\t\t\toldContentDestination: FieldKey,\n\t\t\t): void {\n\t\t\t\tassert(\n\t\t\t\t\tnewContentSource !== oldContentDestination,\n\t\t\t\t\t0x7b0 /* Replace detached source field and detached destination field must be different */,\n\t\t\t\t);\n\t\t\t\tthis.detachEdit(range, oldContentDestination);\n\t\t\t\tthis.attachEdit(newContentSource, range.end - range.start, range.start);\n\t\t\t},\n\t\t\tenterNode(index: number): void {\n\t\t\t\tassert(this.mutableChunk === undefined, 0x535 /* should be in field */);\n\t\t\t\tconst parent = this.getParent();\n\t\t\t\tconst chunks =\n\t\t\t\t\tparent.mutableChunk.fields.get(parent.key) ?? fail(\"missing edited field\");\n\t\t\t\tlet indexWithinChunk = index;\n\t\t\t\tlet indexOfChunk = 0;\n\t\t\t\twhile (indexWithinChunk >= chunks[indexOfChunk].topLevelLength) {\n\t\t\t\t\tindexWithinChunk -= chunks[indexOfChunk].topLevelLength;\n\t\t\t\t\tindexOfChunk++;\n\t\t\t\t\tif (indexOfChunk === chunks.length) {\n\t\t\t\t\t\tfail(\"missing edited node\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet found = chunks[indexOfChunk];\n\t\t\t\tif (!(found instanceof BasicChunk)) {\n\t\t\t\t\t// TODO:Perf: support in place editing of other chunk formats when possible:\n\t\t\t\t\t// 1. Support updating values in uniform chunks.\n\t\t\t\t\t// 2. Support traversing sequence chunks.\n\t\t\t\t\t//\n\t\t\t\t\t// Maybe build path when visitor navigates then lazily sync to chunk tree when editing?\n\t\t\t\t\tconst newChunks = mapCursorField(found.cursor(), (cursor) =>\n\t\t\t\t\t\tbasicChunkTree(cursor, this.forest.chunker),\n\t\t\t\t\t);\n\t\t\t\t\t// TODO: this could fail for really long chunks being split (due to argument count limits).\n\t\t\t\t\t// Current implementations of chunks shouldn't ever be that long, but it could be an issue if they get bigger.\n\t\t\t\t\tchunks.splice(indexOfChunk, 1, ...newChunks);\n\t\t\t\t\tfound.referenceRemoved();\n\n\t\t\t\t\tfound = newChunks[indexWithinChunk];\n\t\t\t\t}\n\t\t\t\tassert(found instanceof BasicChunk, 0x536 /* chunk should have been normalized */);\n\t\t\t\tif (found.isShared()) {\n\t\t\t\t\tthis.mutableChunk = chunks[indexOfChunk] = found.clone();\n\t\t\t\t\tfound.referenceRemoved();\n\t\t\t\t} else {\n\t\t\t\t\tthis.mutableChunk = found;\n\t\t\t\t}\n\t\t\t},\n\t\t\texitNode(index: number): void {\n\t\t\t\tassert(this.mutableChunk !== undefined, 0x537 /* should be in node */);\n\t\t\t\tthis.mutableChunk = undefined;\n\t\t\t},\n\t\t\tenterField(key: FieldKey): void {\n\t\t\t\tassert(this.mutableChunk !== undefined, 0x538 /* should be in node */);\n\t\t\t\tthis.mutableChunkStack.push({ key, mutableChunk: this.mutableChunk });\n\t\t\t\tthis.mutableChunk = undefined;\n\t\t\t},\n\t\t\texitField(key: FieldKey): void {\n\t\t\t\tconst top = this.mutableChunkStack.pop() ?? fail(\"should not be at root\");\n\t\t\t\tassert(this.mutableChunk === undefined, 0x539 /* should be in field */);\n\t\t\t\tthis.mutableChunk = top.mutableChunk;\n\t\t\t},\n\t\t};\n\t\tthis.activeVisitor = visitor;\n\t\treturn visitor;\n\t}\n\n\tprivate nextDetachedFieldIdentifier = 0;\n\tpublic newDetachedField(): DetachedField {\n\t\tconst field: DetachedField = brand(String(this.nextDetachedFieldIdentifier));\n\t\tassert(\n\t\t\t!this.roots.fields.has(detachedFieldAsKey(field)),\n\t\t\t0x53a /* new field must not already exist */,\n\t\t);\n\t\tthis.nextDetachedFieldIdentifier += 1;\n\t\treturn field;\n\t}\n\n\tpublic allocateCursor(): Cursor {\n\t\treturn new Cursor(\n\t\t\tthis,\n\t\t\tITreeSubscriptionCursorState.Cleared,\n\t\t\t[],\n\t\t\t[],\n\t\t\t[],\n\t\t\t[],\n\t\t\t[],\n\t\t\t[],\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tundefined,\n\t\t);\n\t}\n\n\tpublic tryMoveCursorToNode(\n\t\tdestination: Anchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\tconst path = this.anchors.locate(destination);\n\t\tif (path === undefined) {\n\t\t\treturn TreeNavigationResult.NotFound;\n\t\t}\n\t\tthis.moveCursorToPath(path, cursorToMove);\n\t\treturn TreeNavigationResult.Ok;\n\t}\n\n\tpublic tryMoveCursorToField(\n\t\tdestination: FieldAnchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\tassert(\n\t\t\tcursorToMove instanceof Cursor,\n\t\t\t0x53b /* ChunkedForest must only be given its own Cursor type */,\n\t\t);\n\t\tif (destination.parent === undefined) {\n\t\t\tcursorToMove.setToDetachedSequence(destination.fieldKey);\n\t\t\treturn TreeNavigationResult.Ok;\n\t\t}\n\t\tconst result = this.tryMoveCursorToNode(destination.parent, cursorToMove);\n\t\tif (result !== TreeNavigationResult.Ok) {\n\t\t\treturn result;\n\t\t}\n\n\t\tcursorToMove.enterField(destination.fieldKey);\n\t\treturn TreeNavigationResult.Ok;\n\t}\n\n\tpublic moveCursorToPath(destination: UpPath, cursorToMove: ITreeSubscriptionCursor): void {\n\t\tassert(\n\t\t\tcursorToMove instanceof Cursor,\n\t\t\t0x53c /* ChunkedForest must only be given its own Cursor type */,\n\t\t);\n\t\tassert(\n\t\t\tcursorToMove.forest === this,\n\t\t\t0x53d /* ChunkedForest must only be given its own Cursor */,\n\t\t);\n\n\t\tconst indexStack: number[] = [];\n\t\tconst keyStack: FieldKey[] = [];\n\n\t\tlet path: UpPath | undefined = destination;\n\t\twhile (path !== undefined) {\n\t\t\tindexStack.push(path.parentIndex);\n\t\t\tkeyStack.push(path.parentField);\n\t\t\tpath = path.parent;\n\t\t}\n\t\tcursorToMove.clear();\n\t\twhile (keyStack.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst key = keyStack.pop()!;\n\t\t\tif (cursorToMove.state === ITreeSubscriptionCursorState.Cleared) {\n\t\t\t\tcursorToMove.setToDetachedSequence(key);\n\t\t\t\tcursorToMove.state = ITreeSubscriptionCursorState.Current;\n\t\t\t} else {\n\t\t\t\tcursorToMove.enterField(key);\n\t\t\t}\n\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tcursorToMove.enterNode(indexStack.pop()!);\n\t\t}\n\t}\n\n\tpublic getCursorAboveDetachedFields(): ITreeCursorSynchronous {\n\t\tconst rootCursor = this.roots.cursor();\n\t\trootCursor.enterNode(0);\n\t\treturn rootCursor;\n\t}\n}\n\nclass Cursor extends BasicChunkCursor implements ITreeSubscriptionCursor {\n\tpublic constructor(\n\t\tpublic readonly forest: ChunkedForest,\n\t\tpublic state: ITreeSubscriptionCursorState,\n\t\troot: readonly TreeChunk[],\n\t\tsiblingStack: SiblingsOrKey[],\n\t\tindexStack: number[],\n\t\tindexOfChunkStack: number[],\n\t\tindexWithinChunkStack: number[],\n\t\tsiblings: SiblingsOrKey,\n\t\tindex: number,\n\t\tindexOfChunk: number,\n\t\tindexWithinChunk: number,\n\t\tnestedCursor: ChunkedCursor | undefined,\n\t) {\n\t\tsuper(\n\t\t\troot,\n\t\t\tsiblingStack,\n\t\t\tindexStack,\n\t\t\tindexOfChunkStack,\n\t\t\tindexWithinChunkStack,\n\t\t\tsiblings,\n\t\t\tindex,\n\t\t\tindexOfChunk,\n\t\t\tindexWithinChunk,\n\t\t\tnestedCursor,\n\t\t);\n\t}\n\n\tpublic setToDetachedSequence(key: FieldKey): void {\n\t\tthis.root = (this.forest.roots.fields.get(key) ?? []) as BasicChunk[];\n\t\tthis.siblingStack.length = 0;\n\t\tthis.indexStack.length = 0;\n\t\tthis.indexOfChunkStack.length = 0;\n\t\tthis.indexWithinChunkStack.length = 0;\n\t\tthis.siblings = [key];\n\t\tthis.index = 0;\n\t\tthis.indexOfChunk = 0;\n\t\tthis.indexWithinChunk = 0;\n\t\tthis.nestedCursor = undefined;\n\t}\n\n\tpublic override fork(): Cursor {\n\t\t// Siblings arrays are not modified during navigation and do not need be be copied.\n\t\t// This allows this copy to be shallow, and `this.siblings` below to not be copied as all.\n\t\treturn new Cursor(\n\t\t\tthis.forest,\n\t\t\tthis.state,\n\t\t\tthis.root,\n\t\t\t[...this.siblingStack],\n\t\t\t[...this.indexStack],\n\t\t\t[...this.indexOfChunkStack],\n\t\t\t[...this.indexWithinChunkStack],\n\t\t\tthis.siblings,\n\t\t\tthis.index,\n\t\t\tthis.indexOfChunk,\n\t\t\tthis.indexWithinChunk,\n\t\t\tthis.nestedCursor?.fork(),\n\t\t);\n\t}\n\n\tpublic buildFieldAnchor(): FieldAnchor {\n\t\tconst path = this.getFieldPath();\n\t\tconst anchor =\n\t\t\tpath.parent === undefined ? undefined : this.forest.anchors.track(path.parent);\n\t\treturn { parent: anchor, fieldKey: path.field };\n\t}\n\n\tpublic free(): void {\n\t\tthis.state = ITreeSubscriptionCursorState.Freed;\n\t}\n\n\tpublic buildAnchor(): Anchor {\n\t\treturn this.forest.anchors.track(this.getPath());\n\t}\n\n\tpublic clear(): void {\n\t\tthis.state = ITreeSubscriptionCursorState.Cleared;\n\t\tthis.setToDetachedSequence(rootFieldKey);\n\t}\n}\n\n/**\n * @returns an implementation of {@link IEditableForest} with no data or schema.\n */\nexport function buildChunkedForest(chunker: IChunker, anchors?: AnchorSet): ChunkedForest {\n\treturn new ChunkedForest(makeRoot(), chunker.schema, chunker, anchors);\n}\n"]}
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { TreeChunk } from "../chunk.js";
6
- import { FluidSerializableReadOnly } from "../../valueUtilities.js";
7
5
  import { TreeValue } from "../../../core/index.js";
6
+ import { FluidSerializableReadOnly } from "../../valueUtilities.js";
7
+ import { TreeChunk } from "../chunk.js";
8
8
  /**
9
9
  * Utilities related to chunk encoding and decoding that do not depend on specific chunk types or formats.
10
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chunkCodecUtilities.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAsB,MAAM,yBAAyB,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;GAEG;AAEH;;;;GAIG;AACH,qBAAa,OAAO,CAAC,CAAC;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IAC7C,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,SAAI;IAK1B;;;;;OAKG;IACI,UAAU,CAAC,MAAM,GAAE,aAAa,CAAC,CAAC,CAAc,GAAG,kBAAkB,CAAC,CAAC,CAAC;CAiB/E;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;AAE/E;;;GAGG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,CAAC;CACpC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAWrF;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CAGlE;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,yBAAyB,EAAE,CAAC;IACpD;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,yBAAyB,CAI1E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAI7D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAI/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,CAI/D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAInE;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,SAAS,CAAC;CAC3E"}
1
+ {"version":3,"file":"chunkCodecUtilities.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,yBAAyB,EAAsB,MAAM,yBAAyB,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AAEH;;;;GAIG;AACH,qBAAa,OAAO,CAAC,CAAC;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IAC7C,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,SAAI;IAK1B;;;;;OAKG;IACI,UAAU,CAAC,MAAM,GAAE,aAAa,CAAC,CAAC,CAAc,GAAG,kBAAkB,CAAC,CAAC,CAAC;CAiB/E;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,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AY,GAAG,SAAS,CAAC;CAC3E"}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { assert } from "@fluidframework/core-utils";
5
+ import { assert } from "@fluidframework/core-utils/internal";
6
6
  import { assertValidIndex } from "../../../util/index.js";
7
7
  import { assertAllowedValue } from "../../valueUtilities.js";
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"chunkCodecUtilities.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAA6B,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGxF;;GAEG;AAEH;;;;GAIG;AACH,MAAM,OAAO,OAAO;IAApB;QACkB,WAAM,GAAmB,IAAI,GAAG,EAAE,CAAC;IA6BrD,CAAC;IA5BO,GAAG,CAAC,CAAI,EAAE,KAAK,GAAG,CAAC;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACI,UAAU,CAAC,SAA2B,GAAG,EAAE,CAAC,IAAI;QACtD,MAAM,IAAI,GAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC1C,qGAAqG;QACrG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAA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CAAC,KAAK,CAAC,CAAC;AACpB,CAAC;AAgBD;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,MAAoB;IAC9C,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,CAAC,MAAM,EAAE,CAAC;IAChB,OAAO,OAAO,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAoB;IACpD,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,CAAC,OAAO,OAAO,KAAK,QAAQ,EAAE,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC3E,OAAO,OAAO,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAoB;IACrD,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,CAAC,OAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAC7E,OAAO,OAAO,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAoB;IACnD,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,OAAO,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAoB;IACpD,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACrE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACrC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport { assertValidIndex } from \"../../../util/index.js\";\nimport { TreeChunk } from \"../chunk.js\";\nimport { FluidSerializableReadOnly, assertAllowedValue } from \"../../valueUtilities.js\";\nimport { TreeValue } from \"../../../core/index.js\";\n\n/**\n * Utilities related to chunk encoding and decoding that do not depend on specific chunk types or formats.\n */\n\n/**\n * Counts usages of some `T`, then generates tables for replacing those `T` values with small numbers.\n *\n * Can be used to deduplicate objects when encoding via {@link https://go-compression.github.io/algorithms/dictionary/ | Dictionary Coding}.\n */\nexport class Counter<T> {\n\tprivate readonly counts: Map<T, number> = new Map();\n\tpublic add(t: T, count = 1) {\n\t\tconst old = this.counts.get(t) ?? 0;\n\t\tthis.counts.set(t, old + count);\n\t}\n\n\t/**\n\t * Generate a table which can be used to deduplicate the items added via `add`.\n\t * Table is sorted from most used to least used so that more commonly added items will get smaller indexes.\n\t *\n\t * @param filter - determines which items should be included in the table.\n\t */\n\tpublic buildTable(filter: CounterFilter<T> = () => true): DeduplicationTable<T> {\n\t\tconst data: T[] = [...this.counts.keys()];\n\t\t// Sort in descending order by count, giving priority (smaller indexes) to more commonly used values.\n\t\tdata.sort((a, b) => (this.counts.get(b) ?? 0) - (this.counts.get(a) ?? 0));\n\t\t// Since the index needed is the output index not the input one, data.filter doesn't quite work here.\n\t\tconst filtered: T[] = [];\n\t\tfor (const t of data) {\n\t\t\tconst include = filter(t, filtered.length, this.counts.get(t) ?? 0);\n\t\t\tif (include) {\n\t\t\t\tfiltered.push(t);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tindexToValue: filtered,\n\t\t\tvalueToIndex: new Map(filtered.map((t, index) => [t, index])),\n\t\t};\n\t}\n}\n\n/**\n * Returns true iff a given item `t` (of which there are `count` usages) is worth substituting with the number `value`.\n */\nexport type CounterFilter<T> = (t: T, value: number, count: number) => boolean;\n\n/**\n * Table for dictionary compression.\n * See {@link Counter}.\n */\nexport interface DeduplicationTable<T> {\n\t/**\n\t * Lookup table derived from indexToValue,\n\t */\n\treadonly valueToIndex: ReadonlyMap<T, number>;\n\t/**\n\t * Deduplication table: lookup values by their index.\n\t *\n\t * This is the portion of the table that should be included in persisted data.\n\t */\n\treadonly indexToValue: readonly T[];\n}\n\n/**\n * Filter for use with Counter.buildTable that minimizes the size of the produced JSON.\n *\n * @remarks\n * This minimizes the number of UTF-16 code units in the produced JSON.\n * This is not ideal: minimizing UTF-8 bytes would be better.\n * For ascii text these are the same, and in worst cases they correlate pretty well (accurate to within a small constant factor).\n * This is thus good enough for a heuristic.\n *\n * Also the use of this filter doesn't take into account the length cost of keeping a value in the table possibly\n * making some of the entries at higher indexes in the table get a larger number.\n * For example, if keeping an entry at index 9 saves one character this will keep it,\n * even if that means the next entry (at index 10) loses more than one character due to 10 being two digits instead of the one digit it would have been at index 9.\n * This means that this filter is not guaranteed to be optimal, but it should always be quite close.\n */\nexport function jsonMinimizingFilter(s: string, value: number, count: number): boolean {\n\t// The most practical way to compute how long s will be with quoting and escaping\n\t// is to actually quote and escape it with JSON.stringify:\n\tconst quotedAndEscaped = JSON.stringify(s);\n\t// Account for count instances of value, and one instance of a `,s` which would go in the table.\n\tconst lengthUsingTable = String(value).length * count + quotedAndEscaped.length + 1;\n\t// Account for count instances of s.\n\tconst lengthWithoutTable = quotedAndEscaped.length * count;\n\t// Break ties to not use the table to avoid needing a lookup,\n\t// and save table entries for other uses.\n\treturn lengthUsingTable < lengthWithoutTable;\n}\n\n/**\n * Read from an array, but error if index is not valid.\n */\nexport function getChecked<T>(data: readonly T[], index: number): T {\n\tassertValidIndex(index, data);\n\treturn data[index];\n}\n\n/**\n * A readable stream.\n */\nexport interface StreamCursor {\n\t/**\n\t * The data to read.\n\t */\n\treadonly data: readonly FluidSerializableReadOnly[];\n\t/**\n\t * Location in the data.\n\t */\n\toffset: number;\n}\n\n/**\n * Read one item from the stream, advancing the stream offset.\n */\nexport function readStream(stream: StreamCursor): FluidSerializableReadOnly {\n\tconst content = getChecked(stream.data, stream.offset);\n\tstream.offset++;\n\treturn content;\n}\n\n/**\n * Read one number from the stream, advancing the stream offset.\n */\nexport function readStreamNumber(stream: StreamCursor): number {\n\tconst content = readStream(stream);\n\tassert(typeof content === \"number\", 0x730 /* expected number in stream */);\n\treturn content;\n}\n\n/**\n * Read one boolean from the stream, advancing the stream offset.\n */\nexport function readStreamBoolean(stream: StreamCursor): boolean {\n\tconst content = readStream(stream);\n\tassert(typeof content === \"boolean\", 0x731 /* expected boolean in stream */);\n\treturn content;\n}\n\n/**\n * Read one TreeValue from the stream, advancing the stream offset.\n */\nexport function readStreamValue(stream: StreamCursor): TreeValue {\n\tconst content = readStream(stream);\n\tassertAllowedValue(content);\n\treturn content;\n}\n\n/**\n * Read one nested array from the stream, advancing the stream offset.\n *\n * @returns the nested array as a stream.\n */\nexport function readStreamStream(stream: StreamCursor): StreamCursor {\n\tconst content = readStream(stream);\n\tassert(Array.isArray(content), 0x732 /* expected Array in stream */);\n\treturn { data: content, offset: 0 };\n}\n\n/**\n * Decodes a chunk within a FieldBatch.\n */\nexport interface ChunkDecoder {\n\t/**\n\t * Read from stream, updating the offset.\n\t *\n\t * @returns a TreeChunk made from the data from `stream`.\n\t * This chunk is allowed to reference/take ownership of content it reads from the stream.\n\t */\n\tdecode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk;\n}\n"]}
1
+ {"version":3,"file":"chunkCodecUtilities.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAA6B,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGxF;;GAEG;AAEH;;;;GAIG;AACH,MAAM,OAAO,OAAO;IAApB;QACkB,WAAM,GAAmB,IAAI,GAAG,EAAE,CAAC;IA6BrD,CAAC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O,OAAO,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAoB;IACnD,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,OAAO,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAoB;IACpD,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACrE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACrC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { TreeValue } from \"../../../core/index.js\";\nimport { assertValidIndex } from \"../../../util/index.js\";\nimport { FluidSerializableReadOnly, assertAllowedValue } from \"../../valueUtilities.js\";\nimport { TreeChunk } from \"../chunk.js\";\n\n/**\n * Utilities related to chunk encoding and decoding that do not depend on specific chunk types or formats.\n */\n\n/**\n * Counts usages of some `T`, then generates tables for replacing those `T` values with small numbers.\n *\n * Can be used to deduplicate objects when encoding via {@link https://go-compression.github.io/algorithms/dictionary/ | Dictionary Coding}.\n */\nexport class Counter<T> {\n\tprivate readonly counts: Map<T, number> = new Map();\n\tpublic add(t: T, count = 1) {\n\t\tconst old = this.counts.get(t) ?? 0;\n\t\tthis.counts.set(t, old + count);\n\t}\n\n\t/**\n\t * Generate a table which can be used to deduplicate the items added via `add`.\n\t * Table is sorted from most used to least used so that more commonly added items will get smaller indexes.\n\t *\n\t * @param filter - determines which items should be included in the table.\n\t */\n\tpublic buildTable(filter: CounterFilter<T> = () => true): DeduplicationTable<T> {\n\t\tconst data: T[] = [...this.counts.keys()];\n\t\t// Sort in descending order by count, giving priority (smaller indexes) to more commonly used values.\n\t\tdata.sort((a, b) => (this.counts.get(b) ?? 0) - (this.counts.get(a) ?? 0));\n\t\t// Since the index needed is the output index not the input one, data.filter doesn't quite work here.\n\t\tconst filtered: T[] = [];\n\t\tfor (const t of data) {\n\t\t\tconst include = filter(t, filtered.length, this.counts.get(t) ?? 0);\n\t\t\tif (include) {\n\t\t\t\tfiltered.push(t);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tindexToValue: filtered,\n\t\t\tvalueToIndex: new Map(filtered.map((t, index) => [t, index])),\n\t\t};\n\t}\n}\n\n/**\n * Returns true iff a given item `t` (of which there are `count` usages) is worth substituting with the number `value`.\n */\nexport type CounterFilter<T> = (t: T, value: number, count: number) => boolean;\n\n/**\n * Table for dictionary compression.\n * See {@link Counter}.\n */\nexport interface DeduplicationTable<T> {\n\t/**\n\t * Lookup table derived from indexToValue,\n\t */\n\treadonly valueToIndex: ReadonlyMap<T, number>;\n\t/**\n\t * Deduplication table: lookup values by their index.\n\t *\n\t * This is the portion of the table that should be included in persisted data.\n\t */\n\treadonly indexToValue: readonly T[];\n}\n\n/**\n * Filter for use with Counter.buildTable that minimizes the size of the produced JSON.\n *\n * @remarks\n * This minimizes the number of UTF-16 code units in the produced JSON.\n * This is not ideal: minimizing UTF-8 bytes would be better.\n * For ascii text these are the same, and in worst cases they correlate pretty well (accurate to within a small constant factor).\n * This is thus good enough for a heuristic.\n *\n * Also the use of this filter doesn't take into account the length cost of keeping a value in the table possibly\n * making some of the entries at higher indexes in the table get a larger number.\n * For example, if keeping an entry at index 9 saves one character this will keep it,\n * even if that means the next entry (at index 10) loses more than one character due to 10 being two digits instead of the one digit it would have been at index 9.\n * This means that this filter is not guaranteed to be optimal, but it should always be quite close.\n */\nexport function jsonMinimizingFilter(s: string, value: number, count: number): boolean {\n\t// The most practical way to compute how long s will be with quoting and escaping\n\t// is to actually quote and escape it with JSON.stringify:\n\tconst quotedAndEscaped = JSON.stringify(s);\n\t// Account for count instances of value, and one instance of a `,s` which would go in the table.\n\tconst lengthUsingTable = String(value).length * count + quotedAndEscaped.length + 1;\n\t// Account for count instances of s.\n\tconst lengthWithoutTable = quotedAndEscaped.length * count;\n\t// Break ties to not use the table to avoid needing a lookup,\n\t// and save table entries for other uses.\n\treturn lengthUsingTable < lengthWithoutTable;\n}\n\n/**\n * Read from an array, but error if index is not valid.\n */\nexport function getChecked<T>(data: readonly T[], index: number): T {\n\tassertValidIndex(index, data);\n\treturn data[index];\n}\n\n/**\n * A readable stream.\n */\nexport interface StreamCursor {\n\t/**\n\t * The data to read.\n\t */\n\treadonly data: readonly FluidSerializableReadOnly[];\n\t/**\n\t * Location in the data.\n\t */\n\toffset: number;\n}\n\n/**\n * Read one item from the stream, advancing the stream offset.\n */\nexport function readStream(stream: StreamCursor): FluidSerializableReadOnly {\n\tconst content = getChecked(stream.data, stream.offset);\n\tstream.offset++;\n\treturn content;\n}\n\n/**\n * Read one number from the stream, advancing the stream offset.\n */\nexport function readStreamNumber(stream: StreamCursor): number {\n\tconst content = readStream(stream);\n\tassert(typeof content === \"number\", 0x730 /* expected number in stream */);\n\treturn content;\n}\n\n/**\n * Read one boolean from the stream, advancing the stream offset.\n */\nexport function readStreamBoolean(stream: StreamCursor): boolean {\n\tconst content = readStream(stream);\n\tassert(typeof content === \"boolean\", 0x731 /* expected boolean in stream */);\n\treturn content;\n}\n\n/**\n * Read one TreeValue from the stream, advancing the stream offset.\n */\nexport function readStreamValue(stream: StreamCursor): TreeValue {\n\tconst content = readStream(stream);\n\tassertAllowedValue(content);\n\treturn content;\n}\n\n/**\n * Read one nested array from the stream, advancing the stream offset.\n *\n * @returns the nested array as a stream.\n */\nexport function readStreamStream(stream: StreamCursor): StreamCursor {\n\tconst content = readStream(stream);\n\tassert(Array.isArray(content), 0x732 /* expected Array in stream */);\n\treturn { data: content, offset: 0 };\n}\n\n/**\n * Decodes a chunk within a FieldBatch.\n */\nexport interface ChunkDecoder {\n\t/**\n\t * Read from stream, updating the offset.\n\t *\n\t * @returns a TreeChunk made from the data from `stream`.\n\t * This chunk is allowed to reference/take ownership of content it reads from the stream.\n\t */\n\tdecode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk;\n}\n"]}
@@ -4,9 +4,9 @@
4
4
  */
5
5
  import { Value } from "../../../core/index.js";
6
6
  import { TreeChunk } from "../chunk.js";
7
- import { EncodedChunkShape, EncodedFieldBatch, EncodedInlineArray, EncodedNestedArray, EncodedTreeShape, EncodedValueShape } from "./format.js";
8
7
  import { ChunkDecoder, StreamCursor } from "./chunkCodecUtilities.js";
9
8
  import { DecoderContext } from "./chunkDecodingGeneric.js";
9
+ import { EncodedChunkShape, EncodedFieldBatch, EncodedInlineArray, EncodedNestedArray, EncodedTreeShape, EncodedValueShape } from "./format.js";
10
10
  /**
11
11
  * Decode `chunk` into a TreeChunk.
12
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chunkDecoding.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkDecoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAsC,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEnF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,OAAO,EAEN,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,YAAY,EACZ,YAAY,EAOZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,cAAc,EAGd,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,EAAE,CAO5D;AAqBD;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,iBAAiB,GAAG,KAAK,CAgB/E;AAED;;;;G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AC,QAAQ,CAAC,aAAa,CAA+B;gBAE3C,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,cAAc,CAAC,iBAAiB,CAAC;IAWnD,MAAM,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,SAAS;CAmCjF"}
@@ -2,12 +2,12 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { assert, unreachableCase } from "@fluidframework/core-utils";
6
- import { assertValidIndex } from "../../../util/index.js";
5
+ import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
7
6
  import { DiscriminatedUnionDispatcher } from "../../../codec/index.js";
7
+ import { assertValidIndex } from "../../../util/index.js";
8
8
  import { BasicChunk } from "../basicChunk.js";
9
- import { SequenceChunk } from "../sequenceChunk.js";
10
9
  import { emptyChunk } from "../emptyChunk.js";
10
+ import { SequenceChunk } from "../sequenceChunk.js";
11
11
  import { getChecked, readStream, readStreamBoolean, readStreamNumber, readStreamStream, readStreamValue, } from "./chunkCodecUtilities.js";
12
12
  import { DecoderContext, decode as genericDecode, readStreamIdentifier, } from "./chunkDecodingGeneric.js";
13
13
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"chunkDecoding.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkDecoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAU9C,OAAO,EAGN,UAAU,E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E,MAAM,CAAC,CAAC;YAC/C,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;SACvB;QAED,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,SAAS,EAAE;YACzC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACjD,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;YACvC,OAAO,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;gBAC1C,MAAM,GAAG,GAAa,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC9D,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;aAC/C;SACD;QAED,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils\";\nimport { assertValidIndex } from \"../../../util/index.js\";\nimport { FieldKey, TreeNodeSchemaIdentifier, Value } from \"../../../core/index.js\";\nimport { DiscriminatedUnionDispatcher } from \"../../../codec/index.js\";\nimport { TreeChunk } from \"../chunk.js\";\nimport { BasicChunk } from \"../basicChunk.js\";\nimport { SequenceChunk } from \"../sequenceChunk.js\";\nimport { emptyChunk } from \"../emptyChunk.js\";\nimport {\n\tEncodedAnyShape,\n\tEncodedChunkShape,\n\tEncodedFieldBatch,\n\tEncodedInlineArray,\n\tEncodedNestedArray,\n\tEncodedTreeShape,\n\tEncodedValueShape,\n} from \"./format.js\";\nimport {\n\tChunkDecoder,\n\tStreamCursor,\n\tgetChecked,\n\treadStream,\n\treadStreamBoolean,\n\treadStreamNumber,\n\treadStreamStream,\n\treadStreamValue,\n} from \"./chunkCodecUtilities.js\";\nimport {\n\tDecoderContext,\n\tdecode as genericDecode,\n\treadStreamIdentifier,\n} from \"./chunkDecodingGeneric.js\";\n\n/**\n * Decode `chunk` into a TreeChunk.\n */\nexport function decode(chunk: EncodedFieldBatch): TreeChunk[] {\n\treturn genericDecode(\n\t\tdecoderLibrary,\n\t\tnew DecoderContext(chunk.identifiers, chunk.shapes),\n\t\tchunk,\n\t\tanyDecoder,\n\t);\n}\n\nconst decoderLibrary = new DiscriminatedUnionDispatcher<\n\tEncodedChunkShape,\n\t[cache: DecoderContext<EncodedChunkShape>],\n\tChunkDecoder\n>({\n\ta(shape: EncodedNestedArray, cache): ChunkDecoder {\n\t\treturn new NestedArrayDecoder(shape);\n\t},\n\tb(shape: EncodedInlineArray, cache): ChunkDecoder {\n\t\treturn new InlineArrayDecoder(shape);\n\t},\n\tc(shape: EncodedTreeShape, cache): ChunkDecoder {\n\t\treturn new TreeDecoder(shape, cache);\n\t},\n\td(shape: EncodedAnyShape): ChunkDecoder {\n\t\treturn anyDecoder;\n\t},\n});\n\n/**\n * Decode a node's value from `stream` using its shape.\n */\nexport function readValue(stream: StreamCursor, shape: EncodedValueShape): Value {\n\tif (shape === undefined) {\n\t\treturn readStreamBoolean(stream) ? readStreamValue(stream) : undefined;\n\t} else {\n\t\tif (shape === true) {\n\t\t\treturn readStreamValue(stream);\n\t\t} else if (shape === false) {\n\t\t\treturn undefined;\n\t\t} else if (Array.isArray(shape)) {\n\t\t\tassert(shape.length === 1, 0x734 /* expected a single constant for value */);\n\t\t\treturn shape[0] as Value;\n\t\t} else {\n\t\t\t// EncodedCounter case:\n\t\t\tunreachableCase(shape, \"decoding values as deltas is not yet supported\");\n\t\t}\n\t}\n}\n\n/**\n * Normalize a {@link TreeChunk} into an array.\n *\n * Unwraps {@link SequenceChunk}s, and wraps other chunks.\n */\nexport function deaggregateChunks(chunk: TreeChunk): TreeChunk[] {\n\tif (chunk === emptyChunk) {\n\t\treturn [];\n\t}\n\t// TODO: when handling of SequenceChunks has better performance (for example in cursors),\n\t// consider keeping SequenceChunks here if they are longer than some threshold.\n\tif (chunk instanceof SequenceChunk) {\n\t\t// Could return [] here, however the logic in this file is designed to never produce an empty SequenceChunk, so its better to throw an error here to detect bugs.\n\t\tassert(chunk.subChunks.length > 0, 0x735 /* Unexpected empty sequence */);\n\t\t// Logic in this file is designed to never produce an unneeded (single item) SequenceChunks, so its better to throw an error here to detect bugs.\n\t\tassert(chunk.subChunks.length > 1, 0x736 /* Unexpected single item sequence */);\n\n\t\tfor (const sub of chunk.subChunks) {\n\t\t\t// The logic in this file is designed to never produce an nested SequenceChunks or emptyChunk, so its better to throw an error here to detect bugs.\n\t\t\tassert(!(sub instanceof SequenceChunk), 0x737 /* unexpected nested sequence */);\n\t\t\tassert(sub !== emptyChunk, 0x738 /* unexpected empty chunk */);\n\n\t\t\tsub.referenceAdded();\n\t\t}\n\n\t\tchunk.referenceRemoved();\n\t\treturn chunk.subChunks;\n\t} else {\n\t\treturn [chunk];\n\t}\n}\n\n/**\n * Normalize a {@link TreeChunk}[] into a single TreeChunk.\n *\n * Avoids creating nested or less than 2 child {@link SequenceChunk}s.\n */\nexport function aggregateChunks(input: TreeChunk[]): TreeChunk {\n\tconst chunks = input.flatMap(deaggregateChunks);\n\tswitch (chunks.length) {\n\t\tcase 0:\n\t\t\treturn emptyChunk;\n\t\tcase 1:\n\t\t\treturn chunks[0];\n\t\tdefault:\n\t\t\treturn new SequenceChunk(chunks);\n\t}\n}\n\n/**\n * Decoder for {@link EncodedNestedArray}s.\n */\nexport class NestedArrayDecoder implements ChunkDecoder {\n\tpublic constructor(private readonly shape: EncodedNestedArray) {}\n\tpublic decode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk {\n\t\tconst decoder = decoders[this.shape];\n\n\t\t// TODO: uniform chunk fast path\n\t\tconst chunks: TreeChunk[] = [];\n\n\t\tconst data = readStream(stream);\n\t\tif (typeof data === \"number\") {\n\t\t\t// This case means that the array contained only 0-sized items, and was thus encoded as the length of the array.\n\t\t\tconst inner = { data: [], offset: 0 };\n\t\t\tfor (let index = 0; index < data; index++) {\n\t\t\t\tchunks.push(decoder.decode(decoders, inner));\n\t\t\t}\n\t\t} else {\n\t\t\tassert(\n\t\t\t\tArray.isArray(data),\n\t\t\t\t0x739 /* expected number of array for encoding of nested array */,\n\t\t\t);\n\t\t\tconst inner = { data, offset: 0 };\n\t\t\twhile (inner.offset !== inner.data.length) {\n\t\t\t\tchunks.push(decoder.decode(decoders, inner));\n\t\t\t}\n\t\t}\n\n\t\treturn aggregateChunks(chunks);\n\t}\n}\n\n/**\n * Decoder for {@link EncodedInlineArray}s.\n */\nexport class InlineArrayDecoder implements ChunkDecoder {\n\tpublic constructor(private readonly shape: EncodedInlineArray) {}\n\tpublic decode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk {\n\t\tconst length = this.shape.length;\n\t\tconst decoder = decoders[this.shape.shape];\n\t\tconst chunks: TreeChunk[] = [];\n\t\tfor (let index = 0; index < length; index++) {\n\t\t\tchunks.push(decoder.decode(decoders, stream));\n\t\t}\n\t\treturn aggregateChunks(chunks);\n\t}\n}\n\n/**\n * Decoder for {@link EncodedAnyShape}s.\n */\nexport const anyDecoder: ChunkDecoder = {\n\tdecode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk {\n\t\tconst shapeIndex = readStreamNumber(stream);\n\t\tconst decoder = getChecked(decoders, shapeIndex);\n\t\treturn decoder.decode(decoders, stream);\n\t},\n};\n\n/**\n * Decoder for field.\n */\ntype BasicFieldDecoder = (\n\tdecoders: readonly ChunkDecoder[],\n\tstream: StreamCursor,\n) => [FieldKey, TreeChunk];\n\n/**\n * Get a decoder for fields of a provided (via `shape` and `cache`) {@link EncodedChunkShape}.\n */\nfunction fieldDecoder(\n\tcache: DecoderContext<EncodedChunkShape>,\n\tkey: FieldKey,\n\tshape: number,\n): BasicFieldDecoder {\n\tassertValidIndex(shape, cache.shapes);\n\treturn (decoders, stream) => [key, decoders[shape].decode(decoders, stream)];\n}\n\n/**\n * Decoder for {@link EncodedTreeShape}s.\n */\nexport class TreeDecoder implements ChunkDecoder {\n\tprivate readonly type?: TreeNodeSchemaIdentifier;\n\tprivate readonly fieldDecoders: readonly BasicFieldDecoder[];\n\tpublic constructor(\n\t\tprivate readonly shape: EncodedTreeShape,\n\t\tprivate readonly cache: DecoderContext<EncodedChunkShape>,\n\t) {\n\t\tthis.type = shape.type === undefined ? undefined : cache.identifier(shape.type);\n\n\t\tconst fieldDecoders: BasicFieldDecoder[] = [];\n\t\tfor (const [fieldKey, fieldShape] of shape.fields ?? []) {\n\t\t\tconst key: FieldKey = cache.identifier(fieldKey);\n\t\t\tfieldDecoders.push(fieldDecoder(cache, key, fieldShape));\n\t\t}\n\t\tthis.fieldDecoders = fieldDecoders;\n\t}\n\tpublic decode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk {\n\t\tconst type: TreeNodeSchemaIdentifier =\n\t\t\tthis.type ?? readStreamIdentifier(stream, this.cache);\n\t\t// TODO: Consider typechecking against stored schema in here somewhere.\n\n\t\tconst value = readValue(stream, this.shape.value);\n\t\tconst fields: Map<FieldKey, TreeChunk[]> = new Map();\n\n\t\t// Helper to add fields, but with unneeded array chunks removed.\n\t\tfunction addField(key: FieldKey, data: TreeChunk): void {\n\t\t\t// TODO: when handling of ArrayChunks has better performance (for example in cursors),\n\t\t\t// consider keeping array chunks here if they are longer than some threshold.\n\t\t\tconst chunks = deaggregateChunks(data);\n\n\t\t\tif (chunks.length !== 0) {\n\t\t\t\tfields.set(key, chunks);\n\t\t\t}\n\t\t}\n\n\t\tfor (const field of this.fieldDecoders) {\n\t\t\tconst [key, content] = field(decoders, stream);\n\t\t\taddField(key, content);\n\t\t}\n\n\t\tif (this.shape.extraFields !== undefined) {\n\t\t\tconst decoder = decoders[this.shape.extraFields];\n\t\t\tconst inner = readStreamStream(stream);\n\t\t\twhile (inner.offset !== inner.data.length) {\n\t\t\t\tconst key: FieldKey = readStreamIdentifier(inner, this.cache);\n\t\t\t\taddField(key, decoder.decode(decoders, inner));\n\t\t\t}\n\t\t}\n\n\t\treturn new BasicChunk(type, fields, value);\n\t}\n}\n"]}
1
+ {"version":3,"file":"chunkDecoding.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkDecoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAGN,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,cAAc,EACd,MAAM,IAAI,aAAa,EACvB,oBAAoB,GACpB,MAAM,2BAA2B,CAAC;AAWnC;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,KAAwB;IAC9C,OAAO,aAAa,CACnB,cAAc,EACd,IAAI,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,EACnD,KAAK,EACL,UAAU,CACV,CAAC;AACH,CAAC;AAED,MAAM,cAAc,GAAG,IAAI,4BAA4B,CAIrD;IACD,CAAC,CAAC,KAAyB,EAAE,KAAK;QACjC,OAAO,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IACD,CAAC,CAAC,KAAyB,EAAE,KAAK;QACjC,OAAO,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IACD,CAAC,CAAC,KA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*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport { DiscriminatedUnionDispatcher } from \"../../../codec/index.js\";\nimport { FieldKey, TreeNodeSchemaIdentifier, Value } from \"../../../core/index.js\";\nimport { assertValidIndex } from \"../../../util/index.js\";\nimport { BasicChunk } from \"../basicChunk.js\";\nimport { TreeChunk } from \"../chunk.js\";\nimport { emptyChunk } from \"../emptyChunk.js\";\nimport { SequenceChunk } from \"../sequenceChunk.js\";\n\nimport {\n\tChunkDecoder,\n\tStreamCursor,\n\tgetChecked,\n\treadStream,\n\treadStreamBoolean,\n\treadStreamNumber,\n\treadStreamStream,\n\treadStreamValue,\n} from \"./chunkCodecUtilities.js\";\nimport {\n\tDecoderContext,\n\tdecode as genericDecode,\n\treadStreamIdentifier,\n} from \"./chunkDecodingGeneric.js\";\nimport {\n\tEncodedAnyShape,\n\tEncodedChunkShape,\n\tEncodedFieldBatch,\n\tEncodedInlineArray,\n\tEncodedNestedArray,\n\tEncodedTreeShape,\n\tEncodedValueShape,\n} from \"./format.js\";\n\n/**\n * Decode `chunk` into a TreeChunk.\n */\nexport function decode(chunk: EncodedFieldBatch): TreeChunk[] {\n\treturn genericDecode(\n\t\tdecoderLibrary,\n\t\tnew DecoderContext(chunk.identifiers, chunk.shapes),\n\t\tchunk,\n\t\tanyDecoder,\n\t);\n}\n\nconst decoderLibrary = new DiscriminatedUnionDispatcher<\n\tEncodedChunkShape,\n\t[cache: DecoderContext<EncodedChunkShape>],\n\tChunkDecoder\n>({\n\ta(shape: EncodedNestedArray, cache): ChunkDecoder {\n\t\treturn new NestedArrayDecoder(shape);\n\t},\n\tb(shape: EncodedInlineArray, cache): ChunkDecoder {\n\t\treturn new InlineArrayDecoder(shape);\n\t},\n\tc(shape: EncodedTreeShape, cache): ChunkDecoder {\n\t\treturn new TreeDecoder(shape, cache);\n\t},\n\td(shape: EncodedAnyShape): ChunkDecoder {\n\t\treturn anyDecoder;\n\t},\n});\n\n/**\n * Decode a node's value from `stream` using its shape.\n */\nexport function readValue(stream: StreamCursor, shape: EncodedValueShape): Value {\n\tif (shape === undefined) {\n\t\treturn readStreamBoolean(stream) ? readStreamValue(stream) : undefined;\n\t} else {\n\t\tif (shape === true) {\n\t\t\treturn readStreamValue(stream);\n\t\t} else if (shape === false) {\n\t\t\treturn undefined;\n\t\t} else if (Array.isArray(shape)) {\n\t\t\tassert(shape.length === 1, 0x734 /* expected a single constant for value */);\n\t\t\treturn shape[0] as Value;\n\t\t} else {\n\t\t\t// EncodedCounter case:\n\t\t\tunreachableCase(shape, \"decoding values as deltas is not yet supported\");\n\t\t}\n\t}\n}\n\n/**\n * Normalize a {@link TreeChunk} into an array.\n *\n * Unwraps {@link SequenceChunk}s, and wraps other chunks.\n */\nexport function deaggregateChunks(chunk: TreeChunk): TreeChunk[] {\n\tif (chunk === emptyChunk) {\n\t\treturn [];\n\t}\n\t// TODO: when handling of SequenceChunks has better performance (for example in cursors),\n\t// consider keeping SequenceChunks here if they are longer than some threshold.\n\tif (chunk instanceof SequenceChunk) {\n\t\t// Could return [] here, however the logic in this file is designed to never produce an empty SequenceChunk, so its better to throw an error here to detect bugs.\n\t\tassert(chunk.subChunks.length > 0, 0x735 /* Unexpected empty sequence */);\n\t\t// Logic in this file is designed to never produce an unneeded (single item) SequenceChunks, so its better to throw an error here to detect bugs.\n\t\tassert(chunk.subChunks.length > 1, 0x736 /* Unexpected single item sequence */);\n\n\t\tfor (const sub of chunk.subChunks) {\n\t\t\t// The logic in this file is designed to never produce an nested SequenceChunks or emptyChunk, so its better to throw an error here to detect bugs.\n\t\t\tassert(!(sub instanceof SequenceChunk), 0x737 /* unexpected nested sequence */);\n\t\t\tassert(sub !== emptyChunk, 0x738 /* unexpected empty chunk */);\n\n\t\t\tsub.referenceAdded();\n\t\t}\n\n\t\tchunk.referenceRemoved();\n\t\treturn chunk.subChunks;\n\t} else {\n\t\treturn [chunk];\n\t}\n}\n\n/**\n * Normalize a {@link TreeChunk}[] into a single TreeChunk.\n *\n * Avoids creating nested or less than 2 child {@link SequenceChunk}s.\n */\nexport function aggregateChunks(input: TreeChunk[]): TreeChunk {\n\tconst chunks = input.flatMap(deaggregateChunks);\n\tswitch (chunks.length) {\n\t\tcase 0:\n\t\t\treturn emptyChunk;\n\t\tcase 1:\n\t\t\treturn chunks[0];\n\t\tdefault:\n\t\t\treturn new SequenceChunk(chunks);\n\t}\n}\n\n/**\n * Decoder for {@link EncodedNestedArray}s.\n */\nexport class NestedArrayDecoder implements ChunkDecoder {\n\tpublic constructor(private readonly shape: EncodedNestedArray) {}\n\tpublic decode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk {\n\t\tconst decoder = decoders[this.shape];\n\n\t\t// TODO: uniform chunk fast path\n\t\tconst chunks: TreeChunk[] = [];\n\n\t\tconst data = readStream(stream);\n\t\tif (typeof data === \"number\") {\n\t\t\t// This case means that the array contained only 0-sized items, and was thus encoded as the length of the array.\n\t\t\tconst inner = { data: [], offset: 0 };\n\t\t\tfor (let index = 0; index < data; index++) {\n\t\t\t\tchunks.push(decoder.decode(decoders, inner));\n\t\t\t}\n\t\t} else {\n\t\t\tassert(\n\t\t\t\tArray.isArray(data),\n\t\t\t\t0x739 /* expected number of array for encoding of nested array */,\n\t\t\t);\n\t\t\tconst inner = { data, offset: 0 };\n\t\t\twhile (inner.offset !== inner.data.length) {\n\t\t\t\tchunks.push(decoder.decode(decoders, inner));\n\t\t\t}\n\t\t}\n\n\t\treturn aggregateChunks(chunks);\n\t}\n}\n\n/**\n * Decoder for {@link EncodedInlineArray}s.\n */\nexport class InlineArrayDecoder implements ChunkDecoder {\n\tpublic constructor(private readonly shape: EncodedInlineArray) {}\n\tpublic decode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk {\n\t\tconst length = this.shape.length;\n\t\tconst decoder = decoders[this.shape.shape];\n\t\tconst chunks: TreeChunk[] = [];\n\t\tfor (let index = 0; index < length; index++) {\n\t\t\tchunks.push(decoder.decode(decoders, stream));\n\t\t}\n\t\treturn aggregateChunks(chunks);\n\t}\n}\n\n/**\n * Decoder for {@link EncodedAnyShape}s.\n */\nexport const anyDecoder: ChunkDecoder = {\n\tdecode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk {\n\t\tconst shapeIndex = readStreamNumber(stream);\n\t\tconst decoder = getChecked(decoders, shapeIndex);\n\t\treturn decoder.decode(decoders, stream);\n\t},\n};\n\n/**\n * Decoder for field.\n */\ntype BasicFieldDecoder = (\n\tdecoders: readonly ChunkDecoder[],\n\tstream: StreamCursor,\n) => [FieldKey, TreeChunk];\n\n/**\n * Get a decoder for fields of a provided (via `shape` and `cache`) {@link EncodedChunkShape}.\n */\nfunction fieldDecoder(\n\tcache: DecoderContext<EncodedChunkShape>,\n\tkey: FieldKey,\n\tshape: number,\n): BasicFieldDecoder {\n\tassertValidIndex(shape, cache.shapes);\n\treturn (decoders, stream) => [key, decoders[shape].decode(decoders, stream)];\n}\n\n/**\n * Decoder for {@link EncodedTreeShape}s.\n */\nexport class TreeDecoder implements ChunkDecoder {\n\tprivate readonly type?: TreeNodeSchemaIdentifier;\n\tprivate readonly fieldDecoders: readonly BasicFieldDecoder[];\n\tpublic constructor(\n\t\tprivate readonly shape: EncodedTreeShape,\n\t\tprivate readonly cache: DecoderContext<EncodedChunkShape>,\n\t) {\n\t\tthis.type = shape.type === undefined ? undefined : cache.identifier(shape.type);\n\n\t\tconst fieldDecoders: BasicFieldDecoder[] = [];\n\t\tfor (const [fieldKey, fieldShape] of shape.fields ?? []) {\n\t\t\tconst key: FieldKey = cache.identifier(fieldKey);\n\t\t\tfieldDecoders.push(fieldDecoder(cache, key, fieldShape));\n\t\t}\n\t\tthis.fieldDecoders = fieldDecoders;\n\t}\n\tpublic decode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk {\n\t\tconst type: TreeNodeSchemaIdentifier =\n\t\t\tthis.type ?? readStreamIdentifier(stream, this.cache);\n\t\t// TODO: Consider typechecking against stored schema in here somewhere.\n\n\t\tconst value = readValue(stream, this.shape.value);\n\t\tconst fields: Map<FieldKey, TreeChunk[]> = new Map();\n\n\t\t// Helper to add fields, but with unneeded array chunks removed.\n\t\tfunction addField(key: FieldKey, data: TreeChunk): void {\n\t\t\t// TODO: when handling of ArrayChunks has better performance (for example in cursors),\n\t\t\t// consider keeping array chunks here if they are longer than some threshold.\n\t\t\tconst chunks = deaggregateChunks(data);\n\n\t\t\tif (chunks.length !== 0) {\n\t\t\t\tfields.set(key, chunks);\n\t\t\t}\n\t\t}\n\n\t\tfor (const field of this.fieldDecoders) {\n\t\t\tconst [key, content] = field(decoders, stream);\n\t\t\taddField(key, content);\n\t\t}\n\n\t\tif (this.shape.extraFields !== undefined) {\n\t\t\tconst decoder = decoders[this.shape.extraFields];\n\t\t\tconst inner = readStreamStream(stream);\n\t\t\twhile (inner.offset !== inner.data.length) {\n\t\t\t\tconst key: FieldKey = readStreamIdentifier(inner, this.cache);\n\t\t\t\taddField(key, decoder.decode(decoders, inner));\n\t\t\t}\n\t\t}\n\n\t\treturn new BasicChunk(type, fields, value);\n\t}\n}\n"]}
@@ -2,11 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { BrandedType } from "../../../util/index.js";
6
5
  import { DiscriminatedUnionDispatcher } from "../../../codec/index.js";
6
+ import { BrandedType } from "../../../util/index.js";
7
7
  import { TreeChunk } from "../chunk.js";
8
- import { EncodedFieldBatchGeneric, IdentifierOrIndex } from "./formatGeneric.js";
9
8
  import { ChunkDecoder, StreamCursor } from "./chunkCodecUtilities.js";
9
+ import { EncodedFieldBatchGeneric, IdentifierOrIndex } from "./formatGeneric.js";
10
10
  /**
11
11
  * General purpose shape based tree decoder which gets its support for specific shapes from the caller.
12
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chunkDecodingGeneric.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,YAAY,EAA0B,MAAM,0BAA0B,CAAC;AAE9F;;GAEG;AACH,wBAAgB,MAAM,CAAC,aAAa,SAAS,MAAM,EAAE,MAAM,EAC1D,cAAc,EAAE,4BAA4B,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,YAAY,CAAC,EAC1F,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,wBAAwB,CAAC,aAAa,CAAC,EAC9C,WAAW,EAAE,YAAY,GACvB,SAAS,EAAE,CAcb;AAED;;GAEG;AACH,qBAAa,cAAc,CAAC,aAAa,GAAG,OAAO;aAKjC,WAAW,EAAE,SAAS,MAAM,EAAE;aAC9B,MAAM,EAAE,SAAS,aAAa,EAAE;IALjD;;OAEG;gBAEc,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,MAAM,EAAE,SAAS,aAAa,EAAE;IAG1C,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/D,OAAO,EAAE,iBAAiB,GACxB,CAAC;CAMJ;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAClF,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,cAAc,GACnB,CAAC,CAOH"}
1
+ {"version":3,"file":"chunkDecodingGeneric.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,YAAY,EAA0B,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEjF;;GAEG;AACH,wBAAgB,MAAM,CAAC,aAAa,SAAS,MAAM,EAAE,MAAM,EAC1D,cAAc,EAAE,4BAA4B,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,YAAY,CAAC,EAC1F,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,wBAAwB,CAAC,aAAa,CAAC,EAC9C,WAAW,EAAE,YAAY,GACvB,SAAS,EAAE,CAcb;AAED;;GAEG;AACH,qBAAa,cAAc,CAAC,aAAa,GAAG,OAAO;aAKjC,WAAW,EAAE,SAAS,MAAM,EAAE;aAC9B,MAAM,EAAE,SAAS,aAAa,EAAE;IALjD;;OAEG;gBAEc,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,MAAM,EAAE,SAAS,aAAa,EAAE;IAG1C,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/D,OAAO,EAAE,iBAAiB,GACxB,CAAC;CAMJ;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAClF,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,cAAc,GACnB,CAAC,CAOH"}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { assert } from "@fluidframework/core-utils";
5
+ import { assert } from "@fluidframework/core-utils/internal";
6
6
  import { getChecked, readStream } from "./chunkCodecUtilities.js";
7
7
  /**
8
8
  * General purpose shape based tree decoder which gets its support for specific shapes from the caller.
@@ -1 +1 @@
1
- {"version":3,"file":"chunkDecodingGeneric.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAKpD,OAAO,EAA8B,UAAU,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE9F;;GAEG;AACH,MAAM,UAAU,MAAM,CACrB,cAA0F,EAC1F,KAAa,EACb,KAA8C,EAC9C,WAAyB;IAEzB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACpF,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE;QAC/B,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAC1C,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACpD,MAAM,CACL,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,EACpC,KAAK,CAAC,4CAA4C,CAClD,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KACpB;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,cAAc;IAC1B;;OAEG;IACH,YACiB,WAA8B,EAC9B,MAAgC;QADhC,gBAAW,GAAX,WAAW,CAAmB;QAC9B,WAAM,GAAN,MAAM,CAA0B;IAC9C,CAAC;IAEG,UAAU,CAChB,OAA0B;QAE1B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAChC,OAAO,OAAY,CAAC;SACpB;QACD,OAAO,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAM,CAAC;IACnD,CAAC;CACD;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CACnC,MAAoB,EACpB,KAAqB;IAErB,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,CACL,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,EAC1D,KAAK,CAAC,sCAAsC,CAC5C,CAAC;IACF,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport { BrandedType } from \"../../../util/index.js\";\nimport { DiscriminatedUnionDispatcher } from \"../../../codec/index.js\";\nimport { TreeChunk } from \"../chunk.js\";\nimport { EncodedFieldBatchGeneric, IdentifierOrIndex } from \"./formatGeneric.js\";\nimport { ChunkDecoder, StreamCursor, getChecked, readStream } from \"./chunkCodecUtilities.js\";\n\n/**\n * General purpose shape based tree decoder which gets its support for specific shapes from the caller.\n */\nexport function decode<TEncodedShape extends object, TCache>(\n\tdecoderLibrary: DiscriminatedUnionDispatcher<TEncodedShape, [cache: TCache], ChunkDecoder>,\n\tcache: TCache,\n\tbatch: EncodedFieldBatchGeneric<TEncodedShape>,\n\trootDecoder: ChunkDecoder,\n): TreeChunk[] {\n\tconst decoders = batch.shapes.map((shape) => decoderLibrary.dispatch(shape, cache));\n\tconst chunks: TreeChunk[] = [];\n\tfor (const field of batch.data) {\n\t\tconst stream = { data: field, offset: 0 };\n\t\tconst result = rootDecoder.decode(decoders, stream);\n\t\tassert(\n\t\t\tstream.offset === stream.data.length,\n\t\t\t0x73a /* expected decode to consume full stream */,\n\t\t);\n\t\tchunks.push(result);\n\t}\n\n\treturn chunks;\n}\n\n/**\n * Shared data for use in constructing decoders.\n */\nexport class DecoderContext<TEncodedShape = unknown> {\n\t/**\n\t * @param identifiers - identifier substitution table (use to replace numeric identifier indexes with the actual identifiers from this table).\n\t */\n\tpublic constructor(\n\t\tpublic readonly identifiers: readonly string[],\n\t\tpublic readonly shapes: readonly TEncodedShape[],\n\t) {}\n\n\tpublic identifier<T extends string & BrandedType<string, string>>(\n\t\tencoded: IdentifierOrIndex,\n\t): T {\n\t\tif (typeof encoded === \"string\") {\n\t\t\treturn encoded as T;\n\t\t}\n\t\treturn getChecked(this.identifiers, encoded) as T;\n\t}\n}\n\n/**\n * Read one identifier from the stream, advancing the stream offset.\n */\nexport function readStreamIdentifier<T extends string & BrandedType<string, string>>(\n\tstream: StreamCursor,\n\tcache: DecoderContext,\n): T {\n\tconst content = readStream(stream);\n\tassert(\n\t\ttypeof content === \"number\" || typeof content === \"string\",\n\t\t0x73b /* content to be a number or string */,\n\t);\n\treturn cache.identifier(content);\n}\n"]}
1
+ {"version":3,"file":"chunkDecodingGeneric.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAM7D,OAAO,EAA8B,UAAU,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG9F;;GAEG;AACH,MAAM,UAAU,MAAM,CACrB,cAA0F,EAC1F,KAAa,EACb,KAA8C,EAC9C,WAAyB;IAEzB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACpF,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE;QAC/B,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAC1C,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACpD,MAAM,CACL,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,EACpC,KAAK,CAAC,4CAA4C,CAClD,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KACpB;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,cAAc;IAC1B;;OAEG;IACH,YACiB,WAA8B,EAC9B,MAAgC;QADhC,gBAAW,GAAX,WAAW,CAAmB;QAC9B,WAAM,GAAN,MAAM,CAA0B;IAC9C,CAAC;IAEG,UAAU,CAChB,OAA0B;QAE1B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAChC,OAAO,OAAY,CAAC;SACpB;QACD,OAAO,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAM,CAAC;IACnD,CAAC;CACD;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CACnC,MAAoB,EACpB,KAAqB;IAErB,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,CACL,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,EAC1D,KAAK,CAAC,sCAAsC,CAC5C,CAAC;IACF,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { DiscriminatedUnionDispatcher } from \"../../../codec/index.js\";\nimport { BrandedType } from \"../../../util/index.js\";\nimport { TreeChunk } from \"../chunk.js\";\n\nimport { ChunkDecoder, StreamCursor, getChecked, readStream } from \"./chunkCodecUtilities.js\";\nimport { EncodedFieldBatchGeneric, IdentifierOrIndex } from \"./formatGeneric.js\";\n\n/**\n * General purpose shape based tree decoder which gets its support for specific shapes from the caller.\n */\nexport function decode<TEncodedShape extends object, TCache>(\n\tdecoderLibrary: DiscriminatedUnionDispatcher<TEncodedShape, [cache: TCache], ChunkDecoder>,\n\tcache: TCache,\n\tbatch: EncodedFieldBatchGeneric<TEncodedShape>,\n\trootDecoder: ChunkDecoder,\n): TreeChunk[] {\n\tconst decoders = batch.shapes.map((shape) => decoderLibrary.dispatch(shape, cache));\n\tconst chunks: TreeChunk[] = [];\n\tfor (const field of batch.data) {\n\t\tconst stream = { data: field, offset: 0 };\n\t\tconst result = rootDecoder.decode(decoders, stream);\n\t\tassert(\n\t\t\tstream.offset === stream.data.length,\n\t\t\t0x73a /* expected decode to consume full stream */,\n\t\t);\n\t\tchunks.push(result);\n\t}\n\n\treturn chunks;\n}\n\n/**\n * Shared data for use in constructing decoders.\n */\nexport class DecoderContext<TEncodedShape = unknown> {\n\t/**\n\t * @param identifiers - identifier substitution table (use to replace numeric identifier indexes with the actual identifiers from this table).\n\t */\n\tpublic constructor(\n\t\tpublic readonly identifiers: readonly string[],\n\t\tpublic readonly shapes: readonly TEncodedShape[],\n\t) {}\n\n\tpublic identifier<T extends string & BrandedType<string, string>>(\n\t\tencoded: IdentifierOrIndex,\n\t): T {\n\t\tif (typeof encoded === \"string\") {\n\t\t\treturn encoded as T;\n\t\t}\n\t\treturn getChecked(this.identifiers, encoded) as T;\n\t}\n}\n\n/**\n * Read one identifier from the stream, advancing the stream offset.\n */\nexport function readStreamIdentifier<T extends string & BrandedType<string, string>>(\n\tstream: StreamCursor,\n\tcache: DecoderContext,\n): T {\n\tconst content = readStream(stream);\n\tassert(\n\t\ttypeof content === \"number\" || typeof content === \"string\",\n\t\t0x73b /* content to be a number or string */,\n\t);\n\treturn cache.identifier(content);\n}\n"]}
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { FluidSerializableReadOnly } from "../../valueUtilities.js";
6
- import { EncodedFieldBatchGeneric } from "./formatGeneric.js";
7
6
  import { Counter, CounterFilter, DeduplicationTable } from "./chunkCodecUtilities.js";
7
+ import { EncodedFieldBatchGeneric } from "./formatGeneric.js";
8
8
  /**
9
9
  * An identifier which can be compressed using {@link Counter}.
10
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"chunkEncodingGeneric.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACN,OAAO,EACP,aAAa,EACb,kBAAkB,EAElB,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;GAQG;AACH,qBAAa,eAAe;aACQ,UAAU,EAAE,MAAM;gBAAlB,UAAU,EAAE,MAAM;CACrD;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,aAAa,IAAI,CACvC,yBAAyB,GACzB,KAAK,CAAC,aAAa,CAAC,GACpB,eAAe,GACf,YAAY,CAAC,aAAa,CAAC,CAC7B,EAAE,CAAC;AAEJ;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,EACvD,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,CAAC,aAAa,CAAC,EAAE,EACrC,gBAAgB,GAAE,aAAa,CAAC,MAAM,CAAwB,GAC5D,wBAAwB,CAAC,aAAa,CAAC,CAwEzC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8BAAsB,KAAK,CAAC,aAAa;IACxC;;;;;;;;;OASG;aACa,KAAK,CACpB,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,IAAI,GAC3C,IAAI;IAEP;;;;;;;OAOG;aACa,WAAW,CAC1B,WAAW,EAAE,kBAAkB,CAAC,MAAM,CAAC,EACvC,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAC9C,aAAa;CAChB"}
1
+ {"version":3,"file":"chunkEncodingGeneric.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,EACN,OAAO,EACP,aAAa,EACb,kBAAkB,EAElB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D;;;;;;;;GAQG;AACH,qBAAa,eAAe;aACQ,UAAU,EAAE,MAAM;gBAAlB,UAAU,EAAE,MAAM;CACrD;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,aAAa,IAAI,CACvC,yBAAyB,GACzB,KAAK,CAAC,aAAa,CAAC,GACpB,eAAe,GACf,YAAY,CAAC,aAAa,CAAC,CAC7B,EAAE,CAAC;AAEJ;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,EACvD,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,CAAC,aAAa,CAAC,EAAE,EACrC,gBAAgB,GAAE,aAAa,CAAC,MAAM,CAAwB,GAC5D,wBAAwB,CAAC,aAAa,CAAC,CAwEzC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8BAAsB,KAAK,CAAC,aAAa;IACxC;;;;;;;;;OASG;aACa,KAAK,CACpB,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,IAAI,GAC3C,IAAI;IAEP;;;;;;;OAOG;aACa,WAAW,CAC1B,WAAW,EAAE,kBAAkB,CAAC,MAAM,CAAC,EACvC,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAC9C,aAAa;CAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"chunkEncodingGeneric.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAG9C,OAAO,EACN,OAAO,EAGP,oBAAoB,GACpB,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAe;IAC3B,YAAmC,UAAkB;QAAlB,eAAU,GAAV,UAAU,CAAQ;IAAG,CAAC;CACzD;AAeD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACzC,OAAe,EACf,MAAqC,EACrC,mBAA0C,oBAAoB;IAE9D,MAAM,WAAW,GAAG,IAAI,OAAO,EAAU,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAI,OAAO,EAAwB,CAAC;IACnD,+FAA+F;IAC/F,iCAAiC;IACjC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAwB,CAAC;IACnD,MAAM,YAAY,GAA2B,EAAE,CAAC;IAChD,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAE,EAAE;QACvD,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAClB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC3B,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACtB,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;IACF,CAAC,CAAC;IAEF,MAAM,MAAM,GAAkC,CAAC,MAAM,CAAC,CAAC;IACvD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC3B,KAAK,MAA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C;aACpF;iBAAM,IAAI,IAAI,YAAY,KAAK,EAAE;gBACjC,KAAK,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC;aAC1E;SACD;KACD;IAED,MAAM,aAAa,GAAG,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC3D,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,UAAU,CAAC,CAC9C,CAAC;IAEF,OAAO;QACN,OAAO;QACP,wDAAwD;QACxD,WAAW,EAAE,eAAe,CAAC,YAAwB;QACrD,MAAM,EAAE,aAAa;QACrB,IAAI,EAAE,MAAuB;KAC7B,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAgB,KAAK;CA4B1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TreeValue } from \"../../../core/index.js\";\nimport { fail } from \"../../../util/index.js\";\nimport { FluidSerializableReadOnly } from \"../../valueUtilities.js\";\nimport { EncodedFieldBatchGeneric } from \"./formatGeneric.js\";\nimport {\n\tCounter,\n\tCounterFilter,\n\tDeduplicationTable,\n\tjsonMinimizingFilter,\n} from \"./chunkCodecUtilities.js\";\n\n/**\n * An identifier which can be compressed using {@link Counter}.\n *\n * @remarks\n * Compression of Identifiers is done after the output is otherwise generated to enable counting all the usages.\n * To avoid having to decode the decode the data array to determine which data is an identifier and which is some other string,\n * some recognizable representation is required.\n * Using a class and checking its prototype works for this, and is why IdentifierToken is a class.\n */\nexport class IdentifierToken {\n\tpublic constructor(public readonly identifier: string) {}\n}\n\n/**\n * Format for data emitted during encoding, before dictionary compression of identifiers.\n *\n * @remarks\n * These buffers are mutated after construction if they contain identifiers or shapes.\n */\nexport type BufferFormat<TEncodedShape> = (\n\t| FluidSerializableReadOnly\n\t| Shape<TEncodedShape>\n\t| IdentifierToken\n\t| BufferFormat<TEncodedShape>\n)[];\n\n/**\n * Replace shapes and identifiers in buffer and any nested arrays.\n *\n * This looks inside nested arrays (including transitively) but not inside objects.\n *\n * Note that this modifies `buffer` to avoid having to copy it.\n */\nexport function handleShapesAndIdentifiers<TEncodedShape>(\n\tversion: number,\n\tbuffer: BufferFormat<TEncodedShape>[],\n\tidentifierFilter: CounterFilter<string> = jsonMinimizingFilter,\n): EncodedFieldBatchGeneric<TEncodedShape> {\n\tconst identifiers = new Counter<string>();\n\tconst shapes = new Counter<Shape<TEncodedShape>>();\n\t// Shapes can reference other shapes (and identifiers), so we need to traverse the shape graph.\n\t// These collections enable that.\n\tconst shapesSeen = new Set<Shape<TEncodedShape>>();\n\tconst shapeToCount: Shape<TEncodedShape>[] = [];\n\tconst shapeDiscovered = (shape: Shape<TEncodedShape>) => {\n\t\tshapes.add(shape);\n\t\tif (!shapesSeen.has(shape)) {\n\t\t\tshapesSeen.add(shape);\n\t\t\tshapeToCount.push(shape);\n\t\t}\n\t};\n\n\tconst arrays: BufferFormat<TEncodedShape>[] = [buffer];\n\tfor (const array of arrays) {\n\t\tfor (const item of array) {\n\t\t\tif (item instanceof IdentifierToken) {\n\t\t\t\tidentifiers.add(item.identifier);\n\t\t\t} else if (item instanceof Shape) {\n\t\t\t\tshapeDiscovered(item);\n\t\t\t} else if (Array.isArray(item)) {\n\t\t\t\t// In JS it is legal to push items to an array which is being iterated,\n\t\t\t\t// and they will be visited in order.\n\t\t\t\tarrays.push(item);\n\t\t\t} else if (\n\t\t\t\titem !== null &&\n\t\t\t\ttypeof item === \"object\" &&\n\t\t\t\t(item as any).shape instanceof Shape\n\t\t\t) {\n\t\t\t\t// because \"serializable\" is allowed in buffer and it has type `any`, its very easy to mess up including of shapes in the buffer.\n\t\t\t\t// This catches the easiest way to get it wrong.\n\t\t\t\tfail(\"encoder interface instead of shape written to stream\");\n\t\t\t}\n\t\t}\n\t}\n\n\t// Traverse shape graph, discovering and counting all shape to shape and shape to identifier references.\n\t{\n\t\tlet item: Shape<TEncodedShape> | undefined;\n\t\twhile ((item = shapeToCount.pop()) !== undefined) {\n\t\t\titem.count(identifiers, shapeDiscovered);\n\t\t}\n\t}\n\n\t// Determine substitutions for identifiers and shapes:\n\tconst identifierTable = identifiers.buildTable(identifierFilter);\n\tconst shapeTable = shapes.buildTable();\n\n\tfor (const array of arrays) {\n\t\tfor (let index = 0; index < array.length; index++) {\n\t\t\tconst item = array[index];\n\t\t\tif (item instanceof IdentifierToken) {\n\t\t\t\tarray[index] = identifierTable.valueToIndex.get(item.identifier) ?? item.identifier;\n\t\t\t} else if (item instanceof Shape) {\n\t\t\t\tarray[index] = shapeTable.valueToIndex.get(item) ?? fail(\"missing shape\");\n\t\t\t}\n\t\t}\n\t}\n\n\tconst encodedShapes = shapeTable.indexToValue.map((shape) =>\n\t\tshape.encodeShape(identifierTable, shapeTable),\n\t);\n\n\treturn {\n\t\tversion,\n\t\t// TODO: fix readonly typing issues to remove this cast.\n\t\tidentifiers: identifierTable.indexToValue as string[],\n\t\tshapes: encodedShapes,\n\t\tdata: buffer as TreeValue[][],\n\t};\n}\n\n/**\n * A tree shape.\n * This similar to a schema for a tree, though it may be more or less specific than the actual schema system used.\n * Can be encoded into a `TEncodedShape`: when doing so encodes references to shapes (if needed) using {@link Counter}:\n * this can include recursive references (direct or indirect).\n *\n * @remarks\n * Deduplication of shapes is done after the output is otherwise generated (including identifier dictionary encoding).\n * To avoid having to decode the data array to determine which data is a shape and which is some other object,\n * some recognizable representation is required.\n * Using a class and checking its prototype works for this, and is why Shape is a class.\n *\n * Note that deduplication compares shapes by object identity not by content, so encoders must ensure shapes are not duplicated to achieve efficient encoding.\n * Comparison by content would be difficult due to shape containing references to other shapes.\n *\n * @privateRemarks\n * Unlike with identifiers, conversion from the initial form (this class / IdentifierToken) is done by the `encodeShape` method, not by general purpose logic in `handleShapesAndIdentifiers`.\n * For `handleShapesAndIdentifiers` to do the conversion without help from `encodeShape`,\n * instances of this Shape class would have to either be or output an object that is identical to the `TEncodedShape` format except with all shape references as object references instead of indexes.\n * Those objects would have to be deeply traversed looking for shape objects to replace with reference indexes.\n * This is possible, but making it type safe would involve generating derived types from the `TEncodedShape` deeply replacing any shape references, as well as requiring deep traversal of all objects in the encoded output.\n * Such an approach seemed less maintainable and readable than the design taken here which avoids the need for those derived types.\n */\nexport abstract class Shape<TEncodedShape> {\n\t/**\n\t * Count this shape's contents.\n\t *\n\t * Used to discover referenced shapes (to ensure they are included in the `shapes` passed to `encodeShape`),\n\t * as well as count usages of shapes and identifiers for more efficient dictionary encoding. See {@link Counter}.\n\t *\n\t * @param shapes - must be invoked with each directly referenced shape (which must provided to `encodeShape`).\n\t * Can be invoked multiple times if a shape is referenced more than once for more efficient dictionary encoding.\n\t * Should not be invoked with `this` unless this shape references itself.\n\t */\n\tpublic abstract count(\n\t\tidentifiers: Counter<string>,\n\t\tshapes: (shape: Shape<TEncodedShape>) => void,\n\t): void;\n\n\t/**\n\t * Produce the final encoded format for this shape.\n\t *\n\t * @param identifiers - a subset of identifiers used in this tree, and their corresponding indexes to use for the dictionary encoding.\n\t * Can be used to encode identifiers referenced by this shape.\n\t * @param shapes - includes a superset of shapes reported by count.\n\t * Used to encode references to shapes as numbers.\n\t */\n\tpublic abstract encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape<TEncodedShape>>,\n\t): TEncodedShape;\n}\n"]}
1
+ {"version":3,"file":"chunkEncodingGeneric.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAG9C,OAAO,EACN,OAAO,EAGP,oBAAoB,GACpB,MAAM,0BAA0B,CAAC;AAGlC;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAe;IAC3B,YAAmC,UAAkB;QAAlB,eAAU,GAAV,UA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;;GAsBG;AACH,MAAM,OAAgB,KAAK;CA4B1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TreeValue } from \"../../../core/index.js\";\nimport { fail } from \"../../../util/index.js\";\nimport { FluidSerializableReadOnly } from \"../../valueUtilities.js\";\n\nimport {\n\tCounter,\n\tCounterFilter,\n\tDeduplicationTable,\n\tjsonMinimizingFilter,\n} from \"./chunkCodecUtilities.js\";\nimport { EncodedFieldBatchGeneric } from \"./formatGeneric.js\";\n\n/**\n * An identifier which can be compressed using {@link Counter}.\n *\n * @remarks\n * Compression of Identifiers is done after the output is otherwise generated to enable counting all the usages.\n * To avoid having to decode the decode the data array to determine which data is an identifier and which is some other string,\n * some recognizable representation is required.\n * Using a class and checking its prototype works for this, and is why IdentifierToken is a class.\n */\nexport class IdentifierToken {\n\tpublic constructor(public readonly identifier: string) {}\n}\n\n/**\n * Format for data emitted during encoding, before dictionary compression of identifiers.\n *\n * @remarks\n * These buffers are mutated after construction if they contain identifiers or shapes.\n */\nexport type BufferFormat<TEncodedShape> = (\n\t| FluidSerializableReadOnly\n\t| Shape<TEncodedShape>\n\t| IdentifierToken\n\t| BufferFormat<TEncodedShape>\n)[];\n\n/**\n * Replace shapes and identifiers in buffer and any nested arrays.\n *\n * This looks inside nested arrays (including transitively) but not inside objects.\n *\n * Note that this modifies `buffer` to avoid having to copy it.\n */\nexport function handleShapesAndIdentifiers<TEncodedShape>(\n\tversion: number,\n\tbuffer: BufferFormat<TEncodedShape>[],\n\tidentifierFilter: CounterFilter<string> = jsonMinimizingFilter,\n): EncodedFieldBatchGeneric<TEncodedShape> {\n\tconst identifiers = new Counter<string>();\n\tconst shapes = new Counter<Shape<TEncodedShape>>();\n\t// Shapes can reference other shapes (and identifiers), so we need to traverse the shape graph.\n\t// These collections enable that.\n\tconst shapesSeen = new Set<Shape<TEncodedShape>>();\n\tconst shapeToCount: Shape<TEncodedShape>[] = [];\n\tconst shapeDiscovered = (shape: Shape<TEncodedShape>) => {\n\t\tshapes.add(shape);\n\t\tif (!shapesSeen.has(shape)) {\n\t\t\tshapesSeen.add(shape);\n\t\t\tshapeToCount.push(shape);\n\t\t}\n\t};\n\n\tconst arrays: BufferFormat<TEncodedShape>[] = [buffer];\n\tfor (const array of arrays) {\n\t\tfor (const item of array) {\n\t\t\tif (item instanceof IdentifierToken) {\n\t\t\t\tidentifiers.add(item.identifier);\n\t\t\t} else if (item instanceof Shape) {\n\t\t\t\tshapeDiscovered(item);\n\t\t\t} else if (Array.isArray(item)) {\n\t\t\t\t// In JS it is legal to push items to an array which is being iterated,\n\t\t\t\t// and they will be visited in order.\n\t\t\t\tarrays.push(item);\n\t\t\t} else if (\n\t\t\t\titem !== null &&\n\t\t\t\ttypeof item === \"object\" &&\n\t\t\t\t(item as any).shape instanceof Shape\n\t\t\t) {\n\t\t\t\t// because \"serializable\" is allowed in buffer and it has type `any`, its very easy to mess up including of shapes in the buffer.\n\t\t\t\t// This catches the easiest way to get it wrong.\n\t\t\t\tfail(\"encoder interface instead of shape written to stream\");\n\t\t\t}\n\t\t}\n\t}\n\n\t// Traverse shape graph, discovering and counting all shape to shape and shape to identifier references.\n\t{\n\t\tlet item: Shape<TEncodedShape> | undefined;\n\t\twhile ((item = shapeToCount.pop()) !== undefined) {\n\t\t\titem.count(identifiers, shapeDiscovered);\n\t\t}\n\t}\n\n\t// Determine substitutions for identifiers and shapes:\n\tconst identifierTable = identifiers.buildTable(identifierFilter);\n\tconst shapeTable = shapes.buildTable();\n\n\tfor (const array of arrays) {\n\t\tfor (let index = 0; index < array.length; index++) {\n\t\t\tconst item = array[index];\n\t\t\tif (item instanceof IdentifierToken) {\n\t\t\t\tarray[index] = identifierTable.valueToIndex.get(item.identifier) ?? item.identifier;\n\t\t\t} else if (item instanceof Shape) {\n\t\t\t\tarray[index] = shapeTable.valueToIndex.get(item) ?? fail(\"missing shape\");\n\t\t\t}\n\t\t}\n\t}\n\n\tconst encodedShapes = shapeTable.indexToValue.map((shape) =>\n\t\tshape.encodeShape(identifierTable, shapeTable),\n\t);\n\n\treturn {\n\t\tversion,\n\t\t// TODO: fix readonly typing issues to remove this cast.\n\t\tidentifiers: identifierTable.indexToValue as string[],\n\t\tshapes: encodedShapes,\n\t\tdata: buffer as TreeValue[][],\n\t};\n}\n\n/**\n * A tree shape.\n * This similar to a schema for a tree, though it may be more or less specific than the actual schema system used.\n * Can be encoded into a `TEncodedShape`: when doing so encodes references to shapes (if needed) using {@link Counter}:\n * this can include recursive references (direct or indirect).\n *\n * @remarks\n * Deduplication of shapes is done after the output is otherwise generated (including identifier dictionary encoding).\n * To avoid having to decode the data array to determine which data is a shape and which is some other object,\n * some recognizable representation is required.\n * Using a class and checking its prototype works for this, and is why Shape is a class.\n *\n * Note that deduplication compares shapes by object identity not by content, so encoders must ensure shapes are not duplicated to achieve efficient encoding.\n * Comparison by content would be difficult due to shape containing references to other shapes.\n *\n * @privateRemarks\n * Unlike with identifiers, conversion from the initial form (this class / IdentifierToken) is done by the `encodeShape` method, not by general purpose logic in `handleShapesAndIdentifiers`.\n * For `handleShapesAndIdentifiers` to do the conversion without help from `encodeShape`,\n * instances of this Shape class would have to either be or output an object that is identical to the `TEncodedShape` format except with all shape references as object references instead of indexes.\n * Those objects would have to be deeply traversed looking for shape objects to replace with reference indexes.\n * This is possible, but making it type safe would involve generating derived types from the `TEncodedShape` deeply replacing any shape references, as well as requiring deep traversal of all objects in the encoded output.\n * Such an approach seemed less maintainable and readable than the design taken here which avoids the need for those derived types.\n */\nexport abstract class Shape<TEncodedShape> {\n\t/**\n\t * Count this shape's contents.\n\t *\n\t * Used to discover referenced shapes (to ensure they are included in the `shapes` passed to `encodeShape`),\n\t * as well as count usages of shapes and identifiers for more efficient dictionary encoding. See {@link Counter}.\n\t *\n\t * @param shapes - must be invoked with each directly referenced shape (which must provided to `encodeShape`).\n\t * Can be invoked multiple times if a shape is referenced more than once for more efficient dictionary encoding.\n\t * Should not be invoked with `this` unless this shape references itself.\n\t */\n\tpublic abstract count(\n\t\tidentifiers: Counter<string>,\n\t\tshapes: (shape: Shape<TEncodedShape>) => void,\n\t): void;\n\n\t/**\n\t * Produce the final encoded format for this shape.\n\t *\n\t * @param identifiers - a subset of identifiers used in this tree, and their corresponding indexes to use for the dictionary encoding.\n\t * Can be used to encode identifiers referenced by this shape.\n\t * @param shapes - includes a superset of shapes reported by count.\n\t * Used to encode references to shapes as numbers.\n\t */\n\tpublic abstract encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape<TEncodedShape>>,\n\t): TEncodedShape;\n}\n"]}
@@ -2,21 +2,16 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { StoredSchemaCollection } from "../../../core/index.js";
6
- import { JsonCompatibleReadOnly } from "../../../util/index.js";
7
5
  import { ICodecOptions, IJsonCodec } from "../../../codec/index.js";
8
- import { FullSchemaPolicy } from "../../modular-schema/index.js";
6
+ import { SchemaAndPolicy } from "../../../core/index.js";
7
+ import { JsonCompatibleReadOnly } from "../../../util/index.js";
9
8
  import { TreeCompressionStrategy } from "../../treeCompressionUtils.js";
10
- import { EncodedFieldBatch } from "./format.js";
11
9
  import { FieldBatch } from "./fieldBatch.js";
10
+ import { EncodedFieldBatch } from "./format.js";
12
11
  export interface FieldBatchEncodingContext {
13
12
  readonly encodeType: TreeCompressionStrategy;
14
13
  readonly schema?: SchemaAndPolicy;
15
14
  }
16
- export interface SchemaAndPolicy {
17
- readonly schema: StoredSchemaCollection;
18
- readonly policy: FullSchemaPolicy;
19
- }
20
15
  export type FieldBatchCodec = IJsonCodec<FieldBatch, EncodedFieldBatch, JsonCompatibleReadOnly, FieldBatchEncodingContext>;
21
- export declare function makeFieldBatchCodec(options: ICodecOptions): FieldBatchCodec;
16
+ export declare function makeFieldBatchCodec(options: ICodecOptions, writeVersion: number): FieldBatchCodec;
22
17
  //# sourceMappingURL=codecs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codecs.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/codecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAsB,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,UAAU,EAA+B,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAiB,MAAM,aAAa,CAAC;AAG/D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;CAClC;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CACvC,UAAU,EACV,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,CACzB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,eAAe,CA6C3E"}
1
+ {"version":3,"file":"codecs.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/codecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,UAAU,EAA+B,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAsB,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAGxE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAiB,MAAM,aAAa,CAAC;AAI/D,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CACvC,UAAU,EACV,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,CACzB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,GAAG,eAAe,CA8CjG"}
@@ -2,18 +2,19 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { assert, unreachableCase } from "@fluidframework/core-utils";
5
+ import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
6
6
  import { makeVersionedValidatedCodec } from "../../../codec/index.js";
7
7
  import { TreeCompressionStrategy } from "../../treeCompressionUtils.js";
8
- import { EncodedFieldBatch, validVersions } from "./format.js";
9
8
  import { decode } from "./chunkDecoding.js";
9
+ import { EncodedFieldBatch, validVersions } from "./format.js";
10
10
  import { schemaCompressedEncode } from "./schemaBasedEncoding.js";
11
11
  import { uncompressedEncode } from "./uncompressedEncode.js";
12
- export function makeFieldBatchCodec(options) {
12
+ export function makeFieldBatchCodec(options, writeVersion) {
13
13
  // Note: it's important that the decode function is schema-agnostic for this strategy/layering to work, since
14
14
  // the schema that an op was encoded in doesn't necessarily match the current schema for the document (e.g. if
15
15
  // decode is being run on a client that just submitted a schema change, but the op is from another client who has
16
16
  // yet to receive that change).
17
+ assert(validVersions.has(writeVersion), 0x935 /* Invalid write version for FieldBatch codec */);
17
18
  return makeVersionedValidatedCodec(options, validVersions, EncodedFieldBatch, {
18
19
  encode: (data, context) => {
19
20
  for (const cursor of data) {
@@ -1 +1 @@
1
- {"version":3,"file":"codecs.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/codecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGrE,OAAO,EAA6B,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEjG,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAmB7D,MAAM,UAAU,mBAAmB,CAAC,OAAsB;IACzD,6GAA6G;IAC7G,8GAA8G;IAC9G,iHAAiH;IACjH,+BAA+B;IAE/B,OAAO,2BAA2B,CAAC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE;QAC7E,MAAM,EAAE,CAAC,IAAgB,EAAE,OAAkC,EAAqB,EAAE;YACnF,KAAK,MAAM,MAAM,IAAI,IAAI,EAAE;gBAC1B,MAAM,CACL,MAAM,CAAC,IAAI,sCAA8B,EACzC,KAAK,CAAC,uCAAuC,CAC7C,CAAC;aACF;YACD,IAAI,OAA0B,CAAC;YAC/B,QAAQ,OAAO,CAAC,UAAU,EAAE;gBAC3B,KAAK,uBAAuB,CAAC,YAAY;oBACxC,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;oBACnC,MAAM;gBACP,KAAK,uBAAuB,CAAC,UAAU;oBACtC,kDAAkD;oBAClD,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE;wBACjC,OAAO,GAAG,sBAAsB,CAC/B,OAAO,CAAC,MAAM,CAAC,MAAM,EACrB,OAAO,CAAC,MAAM,CAAC,MAAM,EACrB,IAAI,CACJ,CAAC;qBACF;yBAAM;wBACN,mFAAmF;wBACnF,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;qBACnC;oBAED,MAAM;gBACP;oBACC,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;aACrC;YAED,oDAAoD;YACpD,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,MAAM,EAAE,CAAC,IAAuB,EAAc,EAAE;YAC/C,6CAA6C;YAC7C,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QACpD,CAAC;KACD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils\";\nimport { CursorLocationType, StoredSchemaCollection } from \"../../../core/index.js\";\nimport { JsonCompatibleReadOnly } from \"../../../util/index.js\";\nimport { ICodecOptions, IJsonCodec, makeVersionedValidatedCodec } from \"../../../codec/index.js\";\nimport { FullSchemaPolicy } from \"../../modular-schema/index.js\";\nimport { TreeCompressionStrategy } from \"../../treeCompressionUtils.js\";\nimport { EncodedFieldBatch, validVersions } from \"./format.js\";\nimport { decode } from \"./chunkDecoding.js\";\nimport { schemaCompressedEncode } from \"./schemaBasedEncoding.js\";\nimport { FieldBatch } from \"./fieldBatch.js\";\nimport { uncompressedEncode } from \"./uncompressedEncode.js\";\n\nexport interface FieldBatchEncodingContext {\n\treadonly encodeType: TreeCompressionStrategy;\n\treadonly schema?: SchemaAndPolicy;\n}\n\nexport interface SchemaAndPolicy {\n\treadonly schema: StoredSchemaCollection;\n\treadonly policy: FullSchemaPolicy;\n}\n\nexport type FieldBatchCodec = IJsonCodec<\n\tFieldBatch,\n\tEncodedFieldBatch,\n\tJsonCompatibleReadOnly,\n\tFieldBatchEncodingContext\n>;\n\nexport function makeFieldBatchCodec(options: ICodecOptions): FieldBatchCodec {\n\t// Note: it's important that the decode function is schema-agnostic for this strategy/layering to work, since\n\t// the schema that an op was encoded in doesn't necessarily match the current schema for the document (e.g. if\n\t// decode is being run on a client that just submitted a schema change, but the op is from another client who has\n\t// yet to receive that change).\n\n\treturn makeVersionedValidatedCodec(options, validVersions, EncodedFieldBatch, {\n\t\tencode: (data: FieldBatch, context: FieldBatchEncodingContext): EncodedFieldBatch => {\n\t\t\tfor (const cursor of data) {\n\t\t\t\tassert(\n\t\t\t\t\tcursor.mode === CursorLocationType.Fields,\n\t\t\t\t\t0x8a3 /* FieldBatch expects fields cursors */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tlet encoded: EncodedFieldBatch;\n\t\t\tswitch (context.encodeType) {\n\t\t\t\tcase TreeCompressionStrategy.Uncompressed:\n\t\t\t\t\tencoded = uncompressedEncode(data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TreeCompressionStrategy.Compressed:\n\t\t\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\t\t\tif (context.schema !== undefined) {\n\t\t\t\t\t\tencoded = schemaCompressedEncode(\n\t\t\t\t\t\t\tcontext.schema.schema,\n\t\t\t\t\t\t\tcontext.schema.policy,\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// TODO: consider enabling a somewhat compressed but not schema accelerated encode.\n\t\t\t\t\t\tencoded = uncompressedEncode(data);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(context.encodeType);\n\t\t\t}\n\n\t\t\t// TODO: consider checking input data was in schema.\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (data: EncodedFieldBatch): FieldBatch => {\n\t\t\t// TODO: consider checking data is in schema.\n\t\t\treturn decode(data).map((chunk) => chunk.cursor());\n\t\t},\n\t});\n}\n"]}
1
+ {"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AAG,sBAAsB,CAC/B,OAAO,CAAC,MAAM,CAAC,MAAM,EACrB,OAAO,CAAC,MAAM,CAAC,MAAM,EACrB,IAAI,CACJ,CAAC;qBACF;yBAAM;wBACN,mFAAmF;wBACnF,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;qBACnC;oBAED,MAAM;gBACP;oBACC,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;aACrC;YAED,oDAAoD;YACpD,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,MAAM,EAAE,CAAC,IAAuB,EAAc,EAAE;YAC/C,6CAA6C;YAC7C,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QACpD,CAAC;KACD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport { ICodecOptions, IJsonCodec, makeVersionedValidatedCodec } from \"../../../codec/index.js\";\nimport { CursorLocationType, SchemaAndPolicy } from \"../../../core/index.js\";\nimport { JsonCompatibleReadOnly } from \"../../../util/index.js\";\nimport { TreeCompressionStrategy } from \"../../treeCompressionUtils.js\";\n\nimport { decode } from \"./chunkDecoding.js\";\nimport { FieldBatch } from \"./fieldBatch.js\";\nimport { EncodedFieldBatch, validVersions } from \"./format.js\";\nimport { schemaCompressedEncode } from \"./schemaBasedEncoding.js\";\nimport { uncompressedEncode } from \"./uncompressedEncode.js\";\n\nexport interface FieldBatchEncodingContext {\n\treadonly encodeType: TreeCompressionStrategy;\n\treadonly schema?: SchemaAndPolicy;\n}\n\nexport type FieldBatchCodec = IJsonCodec<\n\tFieldBatch,\n\tEncodedFieldBatch,\n\tJsonCompatibleReadOnly,\n\tFieldBatchEncodingContext\n>;\n\nexport function makeFieldBatchCodec(options: ICodecOptions, writeVersion: number): FieldBatchCodec {\n\t// Note: it's important that the decode function is schema-agnostic for this strategy/layering to work, since\n\t// the schema that an op was encoded in doesn't necessarily match the current schema for the document (e.g. if\n\t// decode is being run on a client that just submitted a schema change, but the op is from another client who has\n\t// yet to receive that change).\n\tassert(validVersions.has(writeVersion), 0x935 /* Invalid write version for FieldBatch codec */);\n\n\treturn makeVersionedValidatedCodec(options, validVersions, EncodedFieldBatch, {\n\t\tencode: (data: FieldBatch, context: FieldBatchEncodingContext): EncodedFieldBatch => {\n\t\t\tfor (const cursor of data) {\n\t\t\t\tassert(\n\t\t\t\t\tcursor.mode === CursorLocationType.Fields,\n\t\t\t\t\t0x8a3 /* FieldBatch expects fields cursors */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tlet encoded: EncodedFieldBatch;\n\t\t\tswitch (context.encodeType) {\n\t\t\t\tcase TreeCompressionStrategy.Uncompressed:\n\t\t\t\t\tencoded = uncompressedEncode(data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TreeCompressionStrategy.Compressed:\n\t\t\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\t\t\tif (context.schema !== undefined) {\n\t\t\t\t\t\tencoded = schemaCompressedEncode(\n\t\t\t\t\t\t\tcontext.schema.schema,\n\t\t\t\t\t\t\tcontext.schema.policy,\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// TODO: consider enabling a somewhat compressed but not schema accelerated encode.\n\t\t\t\t\t\tencoded = uncompressedEncode(data);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(context.encodeType);\n\t\t\t}\n\n\t\t\t// TODO: consider checking input data was in schema.\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (data: EncodedFieldBatch): FieldBatch => {\n\t\t\t// TODO: consider checking data is in schema.\n\t\t\treturn decode(data).map((chunk) => chunk.cursor());\n\t\t},\n\t});\n}\n"]}
@@ -2,12 +2,12 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { FieldKey, TreeFieldStoredSchema, ITreeCursorSynchronous, TreeNodeSchemaIdentifier, Value, FieldKindIdentifier } from "../../../core/index.js";
5
+ import { FieldKey, FieldKindIdentifier, ITreeCursorSynchronous, TreeFieldStoredSchema, TreeNodeSchemaIdentifier, Value } from "../../../core/index.js";
6
6
  import { type FlexFieldKind } from "../../modular-schema/index.js";
7
- import { BufferFormat as BufferFormatGeneric, Shape as ShapeGeneric } from "./chunkEncodingGeneric.js";
8
7
  import { Counter, DeduplicationTable } from "./chunkCodecUtilities.js";
9
- import { EncodedChunkShape, EncodedValueShape, EncodedFieldBatch } from "./format.js";
8
+ import { BufferFormat as BufferFormatGeneric, Shape as ShapeGeneric } from "./chunkEncodingGeneric.js";
10
9
  import { FieldBatch } from "./fieldBatch.js";
10
+ import { EncodedChunkShape, EncodedFieldBatch, EncodedValueShape } from "./format.js";
11
11
  /**
12
12
  * Encode data from `FieldBatch` in into an `EncodedChunk`.
13
13
  *