@fluidframework/tree 2.74.0-370705 → 2.80.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 (1421) hide show
  1. package/.eslintrc.cjs +1 -16
  2. package/.vscode/settings.json +2 -0
  3. package/CHANGELOG.md +29 -0
  4. package/api-report/tree.alpha.api.md +39 -17
  5. package/assertTagging.config.mjs +1 -1
  6. package/dist/alpha.d.ts +7 -0
  7. package/dist/codec/codec.d.ts +63 -20
  8. package/dist/codec/codec.d.ts.map +1 -1
  9. package/dist/codec/codec.js +50 -24
  10. package/dist/codec/codec.js.map +1 -1
  11. package/dist/codec/index.d.ts +2 -2
  12. package/dist/codec/index.d.ts.map +1 -1
  13. package/dist/codec/index.js +2 -2
  14. package/dist/codec/index.js.map +1 -1
  15. package/dist/codec/versioned/codec.d.ts +80 -22
  16. package/dist/codec/versioned/codec.d.ts.map +1 -1
  17. package/dist/codec/versioned/codec.js +137 -15
  18. package/dist/codec/versioned/codec.js.map +1 -1
  19. package/dist/codec/versioned/index.d.ts +1 -1
  20. package/dist/codec/versioned/index.d.ts.map +1 -1
  21. package/dist/codec/versioned/index.js +2 -2
  22. package/dist/codec/versioned/index.js.map +1 -1
  23. package/dist/core/change-family/changeFamily.d.ts +1 -4
  24. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  25. package/dist/core/change-family/changeFamily.js.map +1 -1
  26. package/dist/core/change-family/index.d.ts +1 -1
  27. package/dist/core/change-family/index.d.ts.map +1 -1
  28. package/dist/core/change-family/index.js.map +1 -1
  29. package/dist/core/index.d.ts +3 -3
  30. package/dist/core/index.d.ts.map +1 -1
  31. package/dist/core/index.js +5 -8
  32. package/dist/core/index.js.map +1 -1
  33. package/dist/core/rebase/changeRebaser.d.ts +37 -8
  34. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  35. package/dist/core/rebase/changeRebaser.js.map +1 -1
  36. package/dist/core/rebase/index.d.ts +2 -2
  37. package/dist/core/rebase/index.d.ts.map +1 -1
  38. package/dist/core/rebase/index.js +1 -3
  39. package/dist/core/rebase/index.js.map +1 -1
  40. package/dist/core/rebase/types.d.ts +27 -5
  41. package/dist/core/rebase/types.d.ts.map +1 -1
  42. package/dist/core/rebase/types.js +1 -16
  43. package/dist/core/rebase/types.js.map +1 -1
  44. package/dist/core/rebase/utils.d.ts.map +1 -1
  45. package/dist/core/rebase/utils.js +10 -28
  46. package/dist/core/rebase/utils.js.map +1 -1
  47. package/dist/core/schema-stored/schema.d.ts +4 -7
  48. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  49. package/dist/core/schema-stored/schema.js +5 -5
  50. package/dist/core/schema-stored/schema.js.map +1 -1
  51. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  52. package/dist/core/tree/anchorSet.js +3 -4
  53. package/dist/core/tree/anchorSet.js.map +1 -1
  54. package/dist/core/tree/detachedFieldIndex.d.ts +1 -8
  55. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  56. package/dist/core/tree/detachedFieldIndex.js +12 -65
  57. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  58. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
  59. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  60. package/dist/core/tree/detachedFieldIndexCodecCommon.js +6 -6
  61. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  62. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
  63. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  64. package/dist/core/tree/detachedFieldIndexCodecV1.js +4 -5
  65. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  66. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
  67. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  68. package/dist/core/tree/detachedFieldIndexCodecV2.js +4 -6
  69. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  70. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
  71. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  72. package/dist/core/tree/detachedFieldIndexCodecs.js +11 -41
  73. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  74. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
  75. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  76. package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -2
  77. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  78. package/dist/core/tree/index.d.ts +2 -2
  79. package/dist/core/tree/index.d.ts.map +1 -1
  80. package/dist/core/tree/index.js +4 -5
  81. package/dist/core/tree/index.js.map +1 -1
  82. package/dist/core/tree/mapTree.js +1 -1
  83. package/dist/core/tree/mapTree.js.map +1 -1
  84. package/dist/core/tree/pathTree.d.ts +3 -11
  85. package/dist/core/tree/pathTree.d.ts.map +1 -1
  86. package/dist/core/tree/pathTree.js +2 -14
  87. package/dist/core/tree/pathTree.js.map +1 -1
  88. package/dist/core/tree/sparseTree.d.ts.map +1 -1
  89. package/dist/core/tree/sparseTree.js +1 -0
  90. package/dist/core/tree/sparseTree.js.map +1 -1
  91. package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
  92. package/dist/core/tree/treeTextFormat.js +5 -9
  93. package/dist/core/tree/treeTextFormat.js.map +1 -1
  94. package/dist/feature-libraries/changeAtomIdBTree.d.ts +10 -0
  95. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
  96. package/dist/feature-libraries/changeAtomIdBTree.js +16 -0
  97. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -0
  98. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  99. package/dist/feature-libraries/chunked-forest/basicChunk.js +1 -8
  100. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  101. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  102. package/dist/feature-libraries/chunked-forest/chunkTree.js +1 -4
  103. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  104. package/dist/feature-libraries/chunked-forest/chunkedForest.js +6 -6
  105. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  106. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  107. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +7 -4
  108. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  109. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  110. package/dist/feature-libraries/chunked-forest/codec/codecs.js +19 -11
  111. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  112. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
  113. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  114. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
  115. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  116. package/dist/feature-libraries/chunked-forest/codec/format.js +4 -4
  117. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  118. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
  119. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  120. package/dist/feature-libraries/chunked-forest/uniformChunk.js +1 -1
  121. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  122. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +54 -93
  123. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  124. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +81 -245
  125. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  126. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
  127. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  128. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +6 -5
  129. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  130. package/dist/feature-libraries/default-schema/index.d.ts +1 -2
  131. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  132. package/dist/feature-libraries/default-schema/index.js +2 -5
  133. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  134. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +8 -7
  135. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  136. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +6 -15
  137. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  138. package/dist/feature-libraries/deltaUtils.d.ts +0 -1
  139. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  140. package/dist/feature-libraries/deltaUtils.js +1 -6
  141. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  142. package/dist/feature-libraries/flex-tree/context.d.ts +0 -9
  143. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  144. package/dist/feature-libraries/flex-tree/context.js +0 -6
  145. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  146. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  147. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  148. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  149. package/dist/feature-libraries/flex-tree/lazyField.d.ts +7 -8
  150. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  151. package/dist/feature-libraries/flex-tree/lazyField.js +16 -47
  152. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  153. package/dist/feature-libraries/forest-summary/codec.d.ts +8 -2
  154. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  155. package/dist/feature-libraries/forest-summary/codec.js +13 -11
  156. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  157. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
  158. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  159. package/dist/feature-libraries/forest-summary/forestSummarizer.js +18 -9
  160. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  161. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
  162. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
  163. package/dist/feature-libraries/forest-summary/{format.js → formatCommon.js} +9 -6
  164. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -0
  165. package/dist/feature-libraries/forest-summary/{format.d.ts → formatV1.d.ts} +6 -14
  166. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
  167. package/dist/feature-libraries/forest-summary/formatV1.js +11 -0
  168. package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -0
  169. package/dist/feature-libraries/forest-summary/formatV2.d.ts +51 -0
  170. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
  171. package/dist/feature-libraries/forest-summary/formatV2.js +11 -0
  172. package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -0
  173. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +7 -15
  174. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  175. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +11 -20
  176. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  177. package/dist/feature-libraries/forest-summary/index.d.ts +1 -2
  178. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  179. package/dist/feature-libraries/forest-summary/index.js +3 -5
  180. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  181. package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
  182. package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
  183. package/dist/feature-libraries/forest-summary/summaryFormatCommon.js +43 -0
  184. package/dist/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
  185. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
  186. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
  187. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js +14 -0
  188. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
  189. package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
  190. package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
  191. package/dist/feature-libraries/forest-summary/summaryFormatV3.js +21 -0
  192. package/dist/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
  193. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +7 -37
  194. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
  195. package/dist/feature-libraries/forest-summary/summaryTypes.js +23 -45
  196. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  197. package/dist/feature-libraries/index.d.ts +5 -4
  198. package/dist/feature-libraries/index.d.ts.map +1 -1
  199. package/dist/feature-libraries/index.js +10 -12
  200. package/dist/feature-libraries/index.js.map +1 -1
  201. package/dist/feature-libraries/indexing/anchorTreeIndex.js +6 -6
  202. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  203. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  204. package/dist/feature-libraries/mapTreeCursor.js +0 -1
  205. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  206. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  207. package/dist/feature-libraries/mitigatedChangeFamily.js +12 -3
  208. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  209. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  210. package/dist/feature-libraries/modular-schema/comparison.js +13 -10
  211. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  212. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +21 -97
  213. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  214. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +7 -4
  215. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  216. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
  217. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
  218. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +59 -0
  219. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
  220. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +52 -20
  221. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  222. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  223. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  224. package/dist/feature-libraries/modular-schema/genericFieldKind.js +13 -7
  225. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  226. package/dist/feature-libraries/modular-schema/index.d.ts +7 -5
  227. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  228. package/dist/feature-libraries/modular-schema/index.js +7 -7
  229. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  230. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +41 -9
  231. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  232. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +263 -336
  233. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  234. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +7 -9
  235. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  236. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +8 -390
  237. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  238. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  239. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +24 -11
  240. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  241. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +27 -55
  242. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  243. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +622 -1433
  244. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  245. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +3 -4
  246. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  247. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +4 -4
  248. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  249. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +14 -48
  250. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  251. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +10 -21
  252. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  253. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +18 -48
  254. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  255. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -24
  256. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  257. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
  258. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  259. package/dist/feature-libraries/object-forest/objectForest.js +4 -4
  260. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  261. package/dist/feature-libraries/optional-field/index.d.ts +2 -2
  262. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  263. package/dist/feature-libraries/optional-field/index.js +2 -1
  264. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  265. package/dist/feature-libraries/optional-field/optionalField.d.ts +26 -5
  266. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  267. package/dist/feature-libraries/optional-field/optionalField.js +447 -218
  268. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  269. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +33 -24
  270. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  271. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  272. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  273. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  274. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +28 -57
  275. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  276. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  277. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  278. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  279. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  280. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +15 -4
  281. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  282. package/dist/feature-libraries/schema-index/codec.d.ts +7 -21
  283. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  284. package/dist/feature-libraries/schema-index/codec.js +28 -70
  285. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  286. package/dist/feature-libraries/schema-index/formatV1.d.ts +1 -1
  287. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
  288. package/dist/feature-libraries/schema-index/index.d.ts +2 -2
  289. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  290. package/dist/feature-libraries/schema-index/index.js +2 -5
  291. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  292. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
  293. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  294. package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -12
  295. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  296. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
  297. package/dist/feature-libraries/schemaChecker.js +11 -6
  298. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  299. package/dist/feature-libraries/sequence-field/compose.d.ts +7 -6
  300. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  301. package/dist/feature-libraries/sequence-field/compose.js +264 -84
  302. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  303. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
  304. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  305. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  306. package/dist/feature-libraries/sequence-field/index.d.ts +3 -2
  307. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  308. package/dist/feature-libraries/sequence-field/index.js +3 -1
  309. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  310. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  311. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  312. package/dist/feature-libraries/sequence-field/invert.js +169 -66
  313. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  314. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  315. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  316. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  317. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +56 -4
  318. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  319. package/dist/feature-libraries/sequence-field/moveEffectTable.js +93 -8
  320. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  321. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  322. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  323. package/dist/feature-libraries/sequence-field/rebase.js +127 -113
  324. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  325. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
  326. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
  327. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +50 -0
  328. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
  329. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
  330. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  331. package/dist/feature-libraries/sequence-field/replaceRevisions.js +49 -27
  332. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  333. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  334. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +2 -0
  335. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  336. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
  337. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  338. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +187 -358
  339. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  340. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  341. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +62 -20
  342. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  343. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  344. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  345. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  346. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  347. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +2 -3
  348. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  349. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +115 -17
  350. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  351. package/dist/feature-libraries/sequence-field/types.d.ts +59 -30
  352. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  353. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  354. package/dist/feature-libraries/sequence-field/utils.d.ts +24 -15
  355. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  356. package/dist/feature-libraries/sequence-field/utils.js +334 -127
  357. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  358. package/dist/feature-libraries/treeCursorUtils.js +7 -7
  359. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  360. package/dist/feature-libraries/treeTextCursor.js +2 -2
  361. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  362. package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
  363. package/dist/feature-libraries/valueUtilities.js +16 -8
  364. package/dist/feature-libraries/valueUtilities.js.map +1 -1
  365. package/dist/index.d.ts +3 -3
  366. package/dist/index.d.ts.map +1 -1
  367. package/dist/index.js +3 -1
  368. package/dist/index.js.map +1 -1
  369. package/dist/packageVersion.d.ts +1 -1
  370. package/dist/packageVersion.d.ts.map +1 -1
  371. package/dist/packageVersion.js +1 -1
  372. package/dist/packageVersion.js.map +1 -1
  373. package/dist/shared-tree/independentView.d.ts.map +1 -1
  374. package/dist/shared-tree/independentView.js +1 -1
  375. package/dist/shared-tree/independentView.js.map +1 -1
  376. package/dist/shared-tree/index.d.ts +1 -1
  377. package/dist/shared-tree/index.d.ts.map +1 -1
  378. package/dist/shared-tree/index.js.map +1 -1
  379. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  380. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  381. package/dist/shared-tree/schematizeTree.js +1 -2
  382. package/dist/shared-tree/schematizeTree.js.map +1 -1
  383. package/dist/shared-tree/schematizingTreeView.d.ts +9 -5
  384. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  385. package/dist/shared-tree/schematizingTreeView.js +56 -41
  386. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  387. package/dist/shared-tree/sharedTree.d.ts +3 -9
  388. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  389. package/dist/shared-tree/sharedTree.js +57 -50
  390. package/dist/shared-tree/sharedTree.js.map +1 -1
  391. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  392. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  393. package/dist/shared-tree/sharedTreeChangeCodecs.js +11 -11
  394. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  395. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  396. package/dist/shared-tree/sharedTreeChangeEnricher.js +5 -3
  397. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  398. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +7 -6
  399. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  400. package/dist/shared-tree/sharedTreeChangeFamily.js +23 -24
  401. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  402. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
  403. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  404. package/dist/shared-tree/sharedTreeEditBuilder.js +7 -14
  405. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  406. package/dist/shared-tree/treeAlpha.d.ts +35 -29
  407. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  408. package/dist/shared-tree/treeAlpha.js +21 -23
  409. package/dist/shared-tree/treeAlpha.js.map +1 -1
  410. package/dist/shared-tree/treeCheckout.d.ts +17 -12
  411. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  412. package/dist/shared-tree/treeCheckout.js +85 -66
  413. package/dist/shared-tree/treeCheckout.js.map +1 -1
  414. package/dist/shared-tree-core/branch.d.ts +5 -4
  415. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  416. package/dist/shared-tree-core/branch.js +7 -6
  417. package/dist/shared-tree-core/branch.js.map +1 -1
  418. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  419. package/dist/shared-tree-core/branchCommitEnricher.js +1 -1
  420. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  421. package/dist/shared-tree-core/editManager.d.ts +2 -2
  422. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  423. package/dist/shared-tree-core/editManager.js +10 -10
  424. package/dist/shared-tree-core/editManager.js.map +1 -1
  425. package/dist/shared-tree-core/editManagerCodecs.d.ts +0 -4
  426. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  427. package/dist/shared-tree-core/editManagerCodecs.js +13 -16
  428. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  429. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  430. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  431. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +9 -44
  432. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  433. package/dist/shared-tree-core/editManagerFormatCommons.js +8 -8
  434. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  435. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  436. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  437. package/dist/shared-tree-core/editManagerFormatV1toV4.js +1 -1
  438. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  439. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  440. package/dist/shared-tree-core/editManagerSummarizer.js +3 -3
  441. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  442. package/dist/shared-tree-core/index.d.ts +3 -2
  443. package/dist/shared-tree-core/index.d.ts.map +1 -1
  444. package/dist/shared-tree-core/index.js +2 -3
  445. package/dist/shared-tree-core/index.js.map +1 -1
  446. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  447. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  448. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  449. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  450. package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -1
  451. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  452. package/dist/shared-tree-core/messageCodecs.d.ts +0 -4
  453. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  454. package/dist/shared-tree-core/messageCodecs.js +15 -19
  455. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  456. package/dist/shared-tree-core/messageFormat.d.ts +10 -50
  457. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  458. package/dist/shared-tree-core/messageFormat.js +9 -8
  459. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  460. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  461. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  462. package/dist/shared-tree-core/messageFormatV1ToV4.js +1 -1
  463. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  464. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +1 -1
  465. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  466. package/dist/shared-tree-core/sequenceIdUtils.js +4 -4
  467. package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
  468. package/dist/shared-tree-core/sharedTreeCore.d.ts +0 -1
  469. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  470. package/dist/shared-tree-core/sharedTreeCore.js +13 -9
  471. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  472. package/dist/shared-tree-core/transaction.d.ts +25 -8
  473. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  474. package/dist/shared-tree-core/transaction.js +65 -30
  475. package/dist/shared-tree-core/transaction.js.map +1 -1
  476. package/dist/shared-tree-core/transactionEnricher.d.ts +2 -2
  477. package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  478. package/dist/shared-tree-core/transactionEnricher.js +3 -3
  479. package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
  480. package/dist/shared-tree-core/versionedSummarizer.d.ts +6 -1
  481. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  482. package/dist/shared-tree-core/versionedSummarizer.js +4 -3
  483. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
  484. package/dist/simple-tree/api/configuration.js +1 -1
  485. package/dist/simple-tree/api/configuration.js.map +1 -1
  486. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  487. package/dist/simple-tree/api/customTree.js +13 -9
  488. package/dist/simple-tree/api/customTree.js.map +1 -1
  489. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  490. package/dist/simple-tree/api/discrepancies.js +21 -17
  491. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  492. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
  493. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
  494. package/dist/simple-tree/api/eraseSchemaDetails.js +97 -0
  495. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -0
  496. package/dist/simple-tree/api/index.d.ts +2 -1
  497. package/dist/simple-tree/api/index.d.ts.map +1 -1
  498. package/dist/simple-tree/api/index.js +5 -1
  499. package/dist/simple-tree/api/index.js.map +1 -1
  500. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  501. package/dist/simple-tree/api/schemaFactory.js +12 -8
  502. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  503. package/dist/simple-tree/api/schemaFromSimple.js +18 -9
  504. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  505. package/dist/simple-tree/api/simpleSchemaCodec.js +10 -5
  506. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  507. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  508. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +15 -11
  509. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  510. package/dist/simple-tree/api/simpleTreeIndex.js +10 -10
  511. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  512. package/dist/simple-tree/api/storedSchema.d.ts +1 -1
  513. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  514. package/dist/simple-tree/api/storedSchema.js +3 -5
  515. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  516. package/dist/simple-tree/api/transactionTypes.d.ts +17 -4
  517. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  518. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  519. package/dist/simple-tree/api/tree.d.ts +15 -2
  520. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  521. package/dist/simple-tree/api/tree.js.map +1 -1
  522. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  523. package/dist/simple-tree/api/treeNodeApi.js +21 -13
  524. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  525. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  526. package/dist/simple-tree/api/verboseTree.js +14 -9
  527. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  528. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  529. package/dist/simple-tree/core/treeNode.js +1 -0
  530. package/dist/simple-tree/core/treeNode.js.map +1 -1
  531. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  532. package/dist/simple-tree/core/treeNodeKernel.js +6 -3
  533. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  534. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  535. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  536. package/dist/simple-tree/core/unhydratedFlexTree.js +28 -74
  537. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  538. package/dist/simple-tree/createContext.d.ts.map +1 -1
  539. package/dist/simple-tree/createContext.js +1 -1
  540. package/dist/simple-tree/createContext.js.map +1 -1
  541. package/dist/simple-tree/fieldSchema.d.ts +4 -4
  542. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  543. package/dist/simple-tree/fieldSchema.js.map +1 -1
  544. package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -1
  545. package/dist/simple-tree/getTreeNodeForField.js +2 -1
  546. package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
  547. package/dist/simple-tree/index.d.ts +3 -3
  548. package/dist/simple-tree/index.d.ts.map +1 -1
  549. package/dist/simple-tree/index.js +5 -3
  550. package/dist/simple-tree/index.js.map +1 -1
  551. package/dist/simple-tree/leafNodeSchema.js +9 -6
  552. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  553. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  554. package/dist/simple-tree/node-kinds/array/arrayNode.js +18 -20
  555. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  556. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  557. package/dist/simple-tree/node-kinds/common.js +1 -1
  558. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  559. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  560. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  561. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  562. package/dist/simple-tree/node-kinds/object/objectNode.js +21 -22
  563. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  564. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  565. package/dist/simple-tree/node-kinds/record/recordNode.js +4 -7
  566. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  567. package/dist/simple-tree/prepareForInsertion.d.ts +47 -54
  568. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  569. package/dist/simple-tree/prepareForInsertion.js +125 -183
  570. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  571. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  572. package/dist/simple-tree/toStoredSchema.js +12 -8
  573. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  574. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +4 -13
  575. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  576. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +11 -29
  577. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  578. package/dist/tableSchema.d.ts +3 -14
  579. package/dist/tableSchema.d.ts.map +1 -1
  580. package/dist/tableSchema.js +2 -2
  581. package/dist/tableSchema.js.map +1 -1
  582. package/dist/treeFactory.d.ts.map +1 -1
  583. package/dist/treeFactory.js +2 -12
  584. package/dist/treeFactory.js.map +1 -1
  585. package/dist/util/bTreeUtils.js +1 -1
  586. package/dist/util/bTreeUtils.js.map +1 -1
  587. package/dist/util/brand.d.ts +49 -0
  588. package/dist/util/brand.d.ts.map +1 -1
  589. package/dist/util/brand.js +47 -1
  590. package/dist/util/brand.js.map +1 -1
  591. package/dist/util/breakable.js +7 -9
  592. package/dist/util/breakable.js.map +1 -1
  593. package/dist/util/idAllocator.d.ts.map +1 -1
  594. package/dist/util/idAllocator.js +1 -2
  595. package/dist/util/idAllocator.js.map +1 -1
  596. package/dist/util/index.d.ts +2 -2
  597. package/dist/util/index.d.ts.map +1 -1
  598. package/dist/util/index.js +4 -3
  599. package/dist/util/index.js.map +1 -1
  600. package/dist/util/nestedMap.d.ts.map +1 -1
  601. package/dist/util/nestedMap.js +1 -1
  602. package/dist/util/nestedMap.js.map +1 -1
  603. package/dist/util/rangeMap.d.ts +12 -24
  604. package/dist/util/rangeMap.d.ts.map +1 -1
  605. package/dist/util/rangeMap.js +6 -46
  606. package/dist/util/rangeMap.js.map +1 -1
  607. package/dist/util/utils.d.ts.map +1 -1
  608. package/dist/util/utils.js +16 -15
  609. package/dist/util/utils.js.map +1 -1
  610. package/docs/main/sequence-field/move-composition.md +46 -0
  611. package/eslint.config.mts +83 -0
  612. package/lib/alpha.d.ts +7 -0
  613. package/lib/codec/codec.d.ts +63 -20
  614. package/lib/codec/codec.d.ts.map +1 -1
  615. package/lib/codec/codec.js +44 -18
  616. package/lib/codec/codec.js.map +1 -1
  617. package/lib/codec/index.d.ts +2 -2
  618. package/lib/codec/index.d.ts.map +1 -1
  619. package/lib/codec/index.js +1 -1
  620. package/lib/codec/index.js.map +1 -1
  621. package/lib/codec/versioned/codec.d.ts +80 -22
  622. package/lib/codec/versioned/codec.d.ts.map +1 -1
  623. package/lib/codec/versioned/codec.js +138 -15
  624. package/lib/codec/versioned/codec.js.map +1 -1
  625. package/lib/codec/versioned/index.d.ts +1 -1
  626. package/lib/codec/versioned/index.d.ts.map +1 -1
  627. package/lib/codec/versioned/index.js +1 -1
  628. package/lib/codec/versioned/index.js.map +1 -1
  629. package/lib/core/change-family/changeFamily.d.ts +1 -4
  630. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  631. package/lib/core/change-family/changeFamily.js.map +1 -1
  632. package/lib/core/change-family/index.d.ts +1 -1
  633. package/lib/core/change-family/index.d.ts.map +1 -1
  634. package/lib/core/change-family/index.js.map +1 -1
  635. package/lib/core/index.d.ts +3 -3
  636. package/lib/core/index.d.ts.map +1 -1
  637. package/lib/core/index.js +2 -2
  638. package/lib/core/index.js.map +1 -1
  639. package/lib/core/rebase/changeRebaser.d.ts +37 -8
  640. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  641. package/lib/core/rebase/changeRebaser.js.map +1 -1
  642. package/lib/core/rebase/index.d.ts +2 -2
  643. package/lib/core/rebase/index.d.ts.map +1 -1
  644. package/lib/core/rebase/index.js +1 -1
  645. package/lib/core/rebase/index.js.map +1 -1
  646. package/lib/core/rebase/types.d.ts +27 -5
  647. package/lib/core/rebase/types.d.ts.map +1 -1
  648. package/lib/core/rebase/types.js +0 -13
  649. package/lib/core/rebase/types.js.map +1 -1
  650. package/lib/core/rebase/utils.d.ts.map +1 -1
  651. package/lib/core/rebase/utils.js +10 -28
  652. package/lib/core/rebase/utils.js.map +1 -1
  653. package/lib/core/schema-stored/schema.d.ts +4 -7
  654. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  655. package/lib/core/schema-stored/schema.js +6 -6
  656. package/lib/core/schema-stored/schema.js.map +1 -1
  657. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  658. package/lib/core/tree/anchorSet.js +3 -4
  659. package/lib/core/tree/anchorSet.js.map +1 -1
  660. package/lib/core/tree/detachedFieldIndex.d.ts +1 -8
  661. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  662. package/lib/core/tree/detachedFieldIndex.js +14 -67
  663. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  664. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +18 -10
  665. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  666. package/lib/core/tree/detachedFieldIndexCodecCommon.js +4 -4
  667. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  668. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +2 -3
  669. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  670. package/lib/core/tree/detachedFieldIndexCodecV1.js +4 -5
  671. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  672. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts +2 -3
  673. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  674. package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -6
  675. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  676. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -6
  677. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  678. package/lib/core/tree/detachedFieldIndexCodecs.js +12 -39
  679. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  680. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
  681. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  682. package/lib/core/tree/detachedFieldIndexFormatCommon.js +3 -3
  683. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  684. package/lib/core/tree/index.d.ts +2 -2
  685. package/lib/core/tree/index.d.ts.map +1 -1
  686. package/lib/core/tree/index.js +2 -2
  687. package/lib/core/tree/index.js.map +1 -1
  688. package/lib/core/tree/mapTree.js +1 -1
  689. package/lib/core/tree/mapTree.js.map +1 -1
  690. package/lib/core/tree/pathTree.d.ts +3 -11
  691. package/lib/core/tree/pathTree.d.ts.map +1 -1
  692. package/lib/core/tree/pathTree.js +1 -12
  693. package/lib/core/tree/pathTree.js.map +1 -1
  694. package/lib/core/tree/sparseTree.d.ts.map +1 -1
  695. package/lib/core/tree/sparseTree.js +1 -0
  696. package/lib/core/tree/sparseTree.js.map +1 -1
  697. package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
  698. package/lib/core/tree/treeTextFormat.js +5 -9
  699. package/lib/core/tree/treeTextFormat.js.map +1 -1
  700. package/lib/feature-libraries/changeAtomIdBTree.d.ts +10 -0
  701. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -0
  702. package/lib/feature-libraries/changeAtomIdBTree.js +11 -0
  703. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -0
  704. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  705. package/lib/feature-libraries/chunked-forest/basicChunk.js +2 -9
  706. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  707. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  708. package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -4
  709. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  710. package/lib/feature-libraries/chunked-forest/chunkedForest.js +6 -6
  711. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  712. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  713. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +7 -4
  714. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  715. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  716. package/lib/feature-libraries/chunked-forest/codec/codecs.js +20 -12
  717. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  718. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
  719. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  720. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
  721. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  722. package/lib/feature-libraries/chunked-forest/codec/format.js +5 -5
  723. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  724. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +9 -5
  725. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  726. package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
  727. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  728. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +54 -93
  729. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  730. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +82 -243
  731. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  732. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
  733. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  734. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +6 -5
  735. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  736. package/lib/feature-libraries/default-schema/index.d.ts +1 -2
  737. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  738. package/lib/feature-libraries/default-schema/index.js +1 -2
  739. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  740. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +8 -7
  741. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  742. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +6 -15
  743. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  744. package/lib/feature-libraries/deltaUtils.d.ts +0 -1
  745. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  746. package/lib/feature-libraries/deltaUtils.js +1 -5
  747. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  748. package/lib/feature-libraries/flex-tree/context.d.ts +0 -9
  749. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  750. package/lib/feature-libraries/flex-tree/context.js +0 -6
  751. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  752. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  753. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  754. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  755. package/lib/feature-libraries/flex-tree/lazyField.d.ts +7 -8
  756. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  757. package/lib/feature-libraries/flex-tree/lazyField.js +17 -48
  758. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  759. package/lib/feature-libraries/forest-summary/codec.d.ts +8 -2
  760. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  761. package/lib/feature-libraries/forest-summary/codec.js +12 -11
  762. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  763. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
  764. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  765. package/lib/feature-libraries/forest-summary/forestSummarizer.js +19 -10
  766. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  767. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
  768. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
  769. package/lib/feature-libraries/forest-summary/{format.js → formatCommon.js} +8 -6
  770. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -0
  771. package/lib/feature-libraries/forest-summary/{format.d.ts → formatV1.d.ts} +6 -14
  772. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
  773. package/lib/feature-libraries/forest-summary/formatV1.js +8 -0
  774. package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -0
  775. package/lib/feature-libraries/forest-summary/formatV2.d.ts +51 -0
  776. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
  777. package/lib/feature-libraries/forest-summary/formatV2.js +8 -0
  778. package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -0
  779. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +7 -15
  780. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  781. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +11 -20
  782. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  783. package/lib/feature-libraries/forest-summary/index.d.ts +1 -2
  784. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  785. package/lib/feature-libraries/forest-summary/index.js +1 -2
  786. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  787. package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
  788. package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
  789. package/lib/feature-libraries/forest-summary/summaryFormatCommon.js +40 -0
  790. package/lib/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
  791. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
  792. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
  793. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js +11 -0
  794. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
  795. package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
  796. package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
  797. package/lib/feature-libraries/forest-summary/summaryFormatV3.js +18 -0
  798. package/lib/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
  799. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +7 -37
  800. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
  801. package/lib/feature-libraries/forest-summary/summaryTypes.js +20 -43
  802. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  803. package/lib/feature-libraries/index.d.ts +5 -4
  804. package/lib/feature-libraries/index.d.ts.map +1 -1
  805. package/lib/feature-libraries/index.js +5 -4
  806. package/lib/feature-libraries/index.js.map +1 -1
  807. package/lib/feature-libraries/indexing/anchorTreeIndex.js +6 -6
  808. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  809. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  810. package/lib/feature-libraries/mapTreeCursor.js +1 -2
  811. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  812. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  813. package/lib/feature-libraries/mitigatedChangeFamily.js +12 -3
  814. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  815. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  816. package/lib/feature-libraries/modular-schema/comparison.js +13 -10
  817. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  818. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +21 -97
  819. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  820. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +5 -3
  821. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  822. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +25 -0
  823. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -0
  824. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +55 -0
  825. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -0
  826. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +52 -20
  827. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  828. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  829. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  830. package/lib/feature-libraries/modular-schema/genericFieldKind.js +14 -8
  831. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  832. package/lib/feature-libraries/modular-schema/index.d.ts +7 -5
  833. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  834. package/lib/feature-libraries/modular-schema/index.js +5 -4
  835. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  836. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +41 -9
  837. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  838. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +248 -334
  839. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  840. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +7 -9
  841. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  842. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +10 -392
  843. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  844. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  845. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +24 -11
  846. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  847. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +27 -55
  848. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  849. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +549 -1352
  850. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  851. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +3 -4
  852. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  853. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -2
  854. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  855. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +14 -48
  856. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  857. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +10 -21
  858. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  859. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +18 -48
  860. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  861. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +2 -20
  862. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  863. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
  864. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  865. package/lib/feature-libraries/object-forest/objectForest.js +4 -4
  866. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  867. package/lib/feature-libraries/optional-field/index.d.ts +2 -2
  868. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  869. package/lib/feature-libraries/optional-field/index.js +1 -1
  870. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  871. package/lib/feature-libraries/optional-field/optionalField.d.ts +26 -5
  872. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  873. package/lib/feature-libraries/optional-field/optionalField.js +445 -218
  874. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  875. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +33 -24
  876. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  877. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  878. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  879. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  880. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +26 -55
  881. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  882. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  883. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  884. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  885. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  886. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +16 -5
  887. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  888. package/lib/feature-libraries/schema-index/codec.d.ts +7 -21
  889. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  890. package/lib/feature-libraries/schema-index/codec.js +29 -67
  891. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  892. package/lib/feature-libraries/schema-index/formatV1.d.ts +1 -1
  893. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
  894. package/lib/feature-libraries/schema-index/index.d.ts +2 -2
  895. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  896. package/lib/feature-libraries/schema-index/index.js +2 -2
  897. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  898. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +1 -9
  899. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  900. package/lib/feature-libraries/schema-index/schemaSummarizer.js +0 -10
  901. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  902. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
  903. package/lib/feature-libraries/schemaChecker.js +11 -6
  904. package/lib/feature-libraries/schemaChecker.js.map +1 -1
  905. package/lib/feature-libraries/sequence-field/compose.d.ts +7 -6
  906. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  907. package/lib/feature-libraries/sequence-field/compose.js +266 -86
  908. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  909. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
  910. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  911. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  912. package/lib/feature-libraries/sequence-field/index.d.ts +3 -2
  913. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  914. package/lib/feature-libraries/sequence-field/index.js +1 -0
  915. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  916. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  917. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  918. package/lib/feature-libraries/sequence-field/invert.js +171 -68
  919. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  920. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  921. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  922. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  923. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +56 -4
  924. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  925. package/lib/feature-libraries/sequence-field/moveEffectTable.js +87 -7
  926. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  927. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  928. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  929. package/lib/feature-libraries/sequence-field/rebase.js +129 -115
  930. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  931. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
  932. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
  933. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +46 -0
  934. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
  935. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
  936. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  937. package/lib/feature-libraries/sequence-field/replaceRevisions.js +50 -28
  938. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  939. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  940. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +2 -0
  941. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  942. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
  943. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  944. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +183 -350
  945. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  946. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  947. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +63 -21
  948. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  949. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  950. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  951. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  952. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  953. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +2 -3
  954. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  955. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +115 -17
  956. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  957. package/lib/feature-libraries/sequence-field/types.d.ts +59 -30
  958. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  959. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  960. package/lib/feature-libraries/sequence-field/utils.d.ts +24 -15
  961. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  962. package/lib/feature-libraries/sequence-field/utils.js +327 -123
  963. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  964. package/lib/feature-libraries/treeCursorUtils.js +7 -7
  965. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  966. package/lib/feature-libraries/treeTextCursor.js +2 -2
  967. package/lib/feature-libraries/treeTextCursor.js.map +1 -1
  968. package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
  969. package/lib/feature-libraries/valueUtilities.js +16 -8
  970. package/lib/feature-libraries/valueUtilities.js.map +1 -1
  971. package/lib/index.d.ts +3 -3
  972. package/lib/index.d.ts.map +1 -1
  973. package/lib/index.js +1 -1
  974. package/lib/index.js.map +1 -1
  975. package/lib/packageVersion.d.ts +1 -1
  976. package/lib/packageVersion.d.ts.map +1 -1
  977. package/lib/packageVersion.js +1 -1
  978. package/lib/packageVersion.js.map +1 -1
  979. package/lib/shared-tree/independentView.d.ts.map +1 -1
  980. package/lib/shared-tree/independentView.js +2 -2
  981. package/lib/shared-tree/independentView.js.map +1 -1
  982. package/lib/shared-tree/index.d.ts +1 -1
  983. package/lib/shared-tree/index.d.ts.map +1 -1
  984. package/lib/shared-tree/index.js.map +1 -1
  985. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  986. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  987. package/lib/shared-tree/schematizeTree.js +2 -3
  988. package/lib/shared-tree/schematizeTree.js.map +1 -1
  989. package/lib/shared-tree/schematizingTreeView.d.ts +9 -5
  990. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  991. package/lib/shared-tree/schematizingTreeView.js +59 -44
  992. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  993. package/lib/shared-tree/sharedTree.d.ts +3 -9
  994. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  995. package/lib/shared-tree/sharedTree.js +26 -19
  996. package/lib/shared-tree/sharedTree.js.map +1 -1
  997. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  998. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  999. package/lib/shared-tree/sharedTreeChangeCodecs.js +11 -11
  1000. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  1001. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  1002. package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -4
  1003. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  1004. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +7 -6
  1005. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  1006. package/lib/shared-tree/sharedTreeChangeFamily.js +24 -25
  1007. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  1008. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
  1009. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  1010. package/lib/shared-tree/sharedTreeEditBuilder.js +6 -12
  1011. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  1012. package/lib/shared-tree/treeAlpha.d.ts +35 -29
  1013. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  1014. package/lib/shared-tree/treeAlpha.js +21 -23
  1015. package/lib/shared-tree/treeAlpha.js.map +1 -1
  1016. package/lib/shared-tree/treeCheckout.d.ts +17 -12
  1017. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  1018. package/lib/shared-tree/treeCheckout.js +89 -70
  1019. package/lib/shared-tree/treeCheckout.js.map +1 -1
  1020. package/lib/shared-tree-core/branch.d.ts +5 -4
  1021. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  1022. package/lib/shared-tree-core/branch.js +7 -6
  1023. package/lib/shared-tree-core/branch.js.map +1 -1
  1024. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  1025. package/lib/shared-tree-core/branchCommitEnricher.js +2 -2
  1026. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  1027. package/lib/shared-tree-core/editManager.d.ts +2 -2
  1028. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  1029. package/lib/shared-tree-core/editManager.js +10 -10
  1030. package/lib/shared-tree-core/editManager.js.map +1 -1
  1031. package/lib/shared-tree-core/editManagerCodecs.d.ts +0 -4
  1032. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  1033. package/lib/shared-tree-core/editManagerCodecs.js +13 -15
  1034. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  1035. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  1036. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  1037. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +9 -44
  1038. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  1039. package/lib/shared-tree-core/editManagerFormatCommons.js +9 -9
  1040. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  1041. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  1042. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  1043. package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -1
  1044. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  1045. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  1046. package/lib/shared-tree-core/editManagerSummarizer.js +3 -3
  1047. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  1048. package/lib/shared-tree-core/index.d.ts +3 -2
  1049. package/lib/shared-tree-core/index.d.ts.map +1 -1
  1050. package/lib/shared-tree-core/index.js +2 -2
  1051. package/lib/shared-tree-core/index.js.map +1 -1
  1052. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  1053. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  1054. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  1055. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  1056. package/lib/shared-tree-core/messageCodecVSharedBranches.js +2 -1
  1057. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  1058. package/lib/shared-tree-core/messageCodecs.d.ts +0 -4
  1059. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  1060. package/lib/shared-tree-core/messageCodecs.js +15 -18
  1061. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  1062. package/lib/shared-tree-core/messageFormat.d.ts +10 -50
  1063. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  1064. package/lib/shared-tree-core/messageFormat.js +9 -8
  1065. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  1066. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  1067. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  1068. package/lib/shared-tree-core/messageFormatV1ToV4.js +1 -1
  1069. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  1070. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +1 -1
  1071. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  1072. package/lib/shared-tree-core/sequenceIdUtils.js +4 -4
  1073. package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
  1074. package/lib/shared-tree-core/sharedTreeCore.d.ts +0 -1
  1075. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  1076. package/lib/shared-tree-core/sharedTreeCore.js +13 -9
  1077. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  1078. package/lib/shared-tree-core/transaction.d.ts +25 -8
  1079. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  1080. package/lib/shared-tree-core/transaction.js +67 -32
  1081. package/lib/shared-tree-core/transaction.js.map +1 -1
  1082. package/lib/shared-tree-core/transactionEnricher.d.ts +2 -2
  1083. package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  1084. package/lib/shared-tree-core/transactionEnricher.js +3 -3
  1085. package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
  1086. package/lib/shared-tree-core/versionedSummarizer.d.ts +6 -1
  1087. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  1088. package/lib/shared-tree-core/versionedSummarizer.js +4 -3
  1089. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
  1090. package/lib/simple-tree/api/configuration.js +1 -1
  1091. package/lib/simple-tree/api/configuration.js.map +1 -1
  1092. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  1093. package/lib/simple-tree/api/customTree.js +13 -9
  1094. package/lib/simple-tree/api/customTree.js.map +1 -1
  1095. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  1096. package/lib/simple-tree/api/discrepancies.js +21 -17
  1097. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  1098. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
  1099. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
  1100. package/lib/simple-tree/api/eraseSchemaDetails.js +92 -0
  1101. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -0
  1102. package/lib/simple-tree/api/index.d.ts +2 -1
  1103. package/lib/simple-tree/api/index.d.ts.map +1 -1
  1104. package/lib/simple-tree/api/index.js +1 -0
  1105. package/lib/simple-tree/api/index.js.map +1 -1
  1106. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  1107. package/lib/simple-tree/api/schemaFactory.js +12 -8
  1108. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  1109. package/lib/simple-tree/api/schemaFromSimple.js +18 -9
  1110. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  1111. package/lib/simple-tree/api/simpleSchemaCodec.js +10 -5
  1112. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  1113. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  1114. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +15 -11
  1115. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  1116. package/lib/simple-tree/api/simpleTreeIndex.js +10 -10
  1117. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  1118. package/lib/simple-tree/api/storedSchema.d.ts +1 -1
  1119. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  1120. package/lib/simple-tree/api/storedSchema.js +5 -9
  1121. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  1122. package/lib/simple-tree/api/transactionTypes.d.ts +17 -4
  1123. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  1124. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  1125. package/lib/simple-tree/api/tree.d.ts +15 -2
  1126. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  1127. package/lib/simple-tree/api/tree.js.map +1 -1
  1128. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  1129. package/lib/simple-tree/api/treeNodeApi.js +21 -13
  1130. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  1131. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  1132. package/lib/simple-tree/api/verboseTree.js +14 -9
  1133. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  1134. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  1135. package/lib/simple-tree/core/treeNode.js +1 -0
  1136. package/lib/simple-tree/core/treeNode.js.map +1 -1
  1137. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  1138. package/lib/simple-tree/core/treeNodeKernel.js +6 -3
  1139. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  1140. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
  1141. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  1142. package/lib/simple-tree/core/unhydratedFlexTree.js +28 -73
  1143. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  1144. package/lib/simple-tree/createContext.d.ts.map +1 -1
  1145. package/lib/simple-tree/createContext.js +1 -1
  1146. package/lib/simple-tree/createContext.js.map +1 -1
  1147. package/lib/simple-tree/fieldSchema.d.ts +4 -4
  1148. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  1149. package/lib/simple-tree/fieldSchema.js.map +1 -1
  1150. package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -1
  1151. package/lib/simple-tree/getTreeNodeForField.js +2 -1
  1152. package/lib/simple-tree/getTreeNodeForField.js.map +1 -1
  1153. package/lib/simple-tree/index.d.ts +3 -3
  1154. package/lib/simple-tree/index.d.ts.map +1 -1
  1155. package/lib/simple-tree/index.js +2 -2
  1156. package/lib/simple-tree/index.js.map +1 -1
  1157. package/lib/simple-tree/leafNodeSchema.js +9 -6
  1158. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  1159. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  1160. package/lib/simple-tree/node-kinds/array/arrayNode.js +19 -21
  1161. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  1162. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  1163. package/lib/simple-tree/node-kinds/common.js +2 -2
  1164. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  1165. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  1166. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  1167. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  1168. package/lib/simple-tree/node-kinds/object/objectNode.js +22 -23
  1169. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  1170. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  1171. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -7
  1172. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  1173. package/lib/simple-tree/prepareForInsertion.d.ts +47 -54
  1174. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  1175. package/lib/simple-tree/prepareForInsertion.js +124 -183
  1176. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  1177. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  1178. package/lib/simple-tree/toStoredSchema.js +12 -8
  1179. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  1180. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +4 -13
  1181. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  1182. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +9 -26
  1183. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  1184. package/lib/tableSchema.d.ts +3 -14
  1185. package/lib/tableSchema.d.ts.map +1 -1
  1186. package/lib/tableSchema.js +3 -3
  1187. package/lib/tableSchema.js.map +1 -1
  1188. package/lib/treeFactory.d.ts.map +1 -1
  1189. package/lib/treeFactory.js +3 -13
  1190. package/lib/treeFactory.js.map +1 -1
  1191. package/lib/util/bTreeUtils.js +1 -1
  1192. package/lib/util/bTreeUtils.js.map +1 -1
  1193. package/lib/util/brand.d.ts +49 -0
  1194. package/lib/util/brand.d.ts.map +1 -1
  1195. package/lib/util/brand.js +44 -0
  1196. package/lib/util/brand.js.map +1 -1
  1197. package/lib/util/breakable.js +7 -9
  1198. package/lib/util/breakable.js.map +1 -1
  1199. package/lib/util/idAllocator.d.ts.map +1 -1
  1200. package/lib/util/idAllocator.js +1 -2
  1201. package/lib/util/idAllocator.js.map +1 -1
  1202. package/lib/util/index.d.ts +2 -2
  1203. package/lib/util/index.d.ts.map +1 -1
  1204. package/lib/util/index.js +2 -2
  1205. package/lib/util/index.js.map +1 -1
  1206. package/lib/util/nestedMap.d.ts.map +1 -1
  1207. package/lib/util/nestedMap.js +1 -1
  1208. package/lib/util/nestedMap.js.map +1 -1
  1209. package/lib/util/rangeMap.d.ts +12 -24
  1210. package/lib/util/rangeMap.d.ts.map +1 -1
  1211. package/lib/util/rangeMap.js +5 -44
  1212. package/lib/util/rangeMap.js.map +1 -1
  1213. package/lib/util/utils.d.ts.map +1 -1
  1214. package/lib/util/utils.js +16 -15
  1215. package/lib/util/utils.js.map +1 -1
  1216. package/package.json +33 -32
  1217. package/src/codec/codec.ts +82 -26
  1218. package/src/codec/index.ts +4 -1
  1219. package/src/codec/versioned/codec.ts +340 -22
  1220. package/src/codec/versioned/index.ts +3 -1
  1221. package/src/core/change-family/changeFamily.ts +0 -5
  1222. package/src/core/change-family/index.ts +0 -1
  1223. package/src/core/index.ts +4 -6
  1224. package/src/core/rebase/changeRebaser.ts +41 -12
  1225. package/src/core/rebase/index.ts +2 -2
  1226. package/src/core/rebase/types.ts +32 -26
  1227. package/src/core/rebase/utils.ts +10 -34
  1228. package/src/core/schema-stored/schema.ts +8 -10
  1229. package/src/core/tree/anchorSet.ts +3 -4
  1230. package/src/core/tree/detachedFieldIndex.ts +14 -91
  1231. package/src/core/tree/detachedFieldIndexCodecCommon.ts +4 -8
  1232. package/src/core/tree/detachedFieldIndexCodecV1.ts +3 -7
  1233. package/src/core/tree/detachedFieldIndexCodecV2.ts +5 -9
  1234. package/src/core/tree/detachedFieldIndexCodecs.ts +21 -64
  1235. package/src/core/tree/detachedFieldIndexFormatCommon.ts +4 -7
  1236. package/src/core/tree/index.ts +2 -3
  1237. package/src/core/tree/mapTree.ts +1 -1
  1238. package/src/core/tree/pathTree.ts +4 -16
  1239. package/src/core/tree/sparseTree.ts +1 -0
  1240. package/src/core/tree/treeTextFormat.ts +5 -9
  1241. package/src/feature-libraries/changeAtomIdBTree.ts +24 -0
  1242. package/src/feature-libraries/chunked-forest/basicChunk.ts +2 -8
  1243. package/src/feature-libraries/chunked-forest/chunkTree.ts +1 -6
  1244. package/src/feature-libraries/chunked-forest/chunkedForest.ts +5 -5
  1245. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +7 -4
  1246. package/src/feature-libraries/chunked-forest/codec/codecs.ts +20 -11
  1247. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +3 -3
  1248. package/src/feature-libraries/chunked-forest/codec/format.ts +6 -9
  1249. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -5
  1250. package/src/feature-libraries/chunked-forest/uniformChunk.ts +1 -1
  1251. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +163 -403
  1252. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +9 -7
  1253. package/src/feature-libraries/default-schema/index.ts +5 -17
  1254. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +15 -35
  1255. package/src/feature-libraries/deltaUtils.ts +1 -6
  1256. package/src/feature-libraries/flex-tree/context.ts +0 -17
  1257. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +8 -7
  1258. package/src/feature-libraries/flex-tree/lazyField.ts +31 -74
  1259. package/src/feature-libraries/forest-summary/codec.ts +25 -13
  1260. package/src/feature-libraries/forest-summary/forestSummarizer.ts +37 -12
  1261. package/src/feature-libraries/forest-summary/{format.ts → formatCommon.ts} +10 -11
  1262. package/src/feature-libraries/forest-summary/formatV1.ts +12 -0
  1263. package/src/feature-libraries/forest-summary/formatV2.ts +12 -0
  1264. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +18 -21
  1265. package/src/feature-libraries/forest-summary/index.ts +1 -2
  1266. package/src/feature-libraries/forest-summary/summaryFormatCommon.ts +41 -0
  1267. package/src/feature-libraries/forest-summary/summaryFormatV1ToV2.ts +11 -0
  1268. package/src/feature-libraries/forest-summary/summaryFormatV3.ts +18 -0
  1269. package/src/feature-libraries/forest-summary/summaryTypes.ts +26 -46
  1270. package/src/feature-libraries/index.ts +18 -27
  1271. package/src/feature-libraries/indexing/anchorTreeIndex.ts +5 -5
  1272. package/src/feature-libraries/mapTreeCursor.ts +1 -2
  1273. package/src/feature-libraries/mitigatedChangeFamily.ts +12 -9
  1274. package/src/feature-libraries/modular-schema/comparison.ts +14 -10
  1275. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +44 -142
  1276. package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +70 -0
  1277. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +58 -40
  1278. package/src/feature-libraries/modular-schema/genericFieldKind.ts +23 -13
  1279. package/src/feature-libraries/modular-schema/index.ts +18 -21
  1280. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +543 -572
  1281. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +44 -745
  1282. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +37 -51
  1283. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +862 -2636
  1284. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +3 -4
  1285. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +17 -45
  1286. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +18 -97
  1287. package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +1 -1
  1288. package/src/feature-libraries/object-forest/objectForest.ts +4 -4
  1289. package/src/feature-libraries/optional-field/index.ts +3 -1
  1290. package/src/feature-libraries/optional-field/optionalField.ts +566 -321
  1291. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +38 -24
  1292. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +35 -89
  1293. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
  1294. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +19 -5
  1295. package/src/feature-libraries/schema-index/codec.ts +30 -92
  1296. package/src/feature-libraries/schema-index/index.ts +2 -4
  1297. package/src/feature-libraries/schema-index/schemaSummarizer.ts +0 -17
  1298. package/src/feature-libraries/schemaChecker.ts +11 -6
  1299. package/src/feature-libraries/sequence-field/compose.ts +527 -138
  1300. package/src/feature-libraries/sequence-field/helperTypes.ts +19 -34
  1301. package/src/feature-libraries/sequence-field/index.ts +9 -0
  1302. package/src/feature-libraries/sequence-field/invert.ts +229 -103
  1303. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1304. package/src/feature-libraries/sequence-field/moveEffectTable.ts +198 -9
  1305. package/src/feature-libraries/sequence-field/rebase.ts +218 -175
  1306. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +57 -0
  1307. package/src/feature-libraries/sequence-field/replaceRevisions.ts +76 -59
  1308. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +2 -0
  1309. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +228 -643
  1310. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +70 -56
  1311. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +27 -25
  1312. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +135 -22
  1313. package/src/feature-libraries/sequence-field/types.ts +64 -34
  1314. package/src/feature-libraries/sequence-field/utils.ts +382 -150
  1315. package/src/feature-libraries/treeCursorUtils.ts +7 -7
  1316. package/src/feature-libraries/treeTextCursor.ts +2 -2
  1317. package/src/feature-libraries/valueUtilities.ts +16 -8
  1318. package/src/index.ts +7 -0
  1319. package/src/packageVersion.ts +1 -1
  1320. package/src/shared-tree/independentView.ts +1 -2
  1321. package/src/shared-tree/index.ts +2 -3
  1322. package/src/shared-tree/schematizeTree.ts +8 -21
  1323. package/src/shared-tree/schematizingTreeView.ts +96 -63
  1324. package/src/shared-tree/sharedTree.ts +29 -29
  1325. package/src/shared-tree/sharedTreeChangeCodecs.ts +12 -15
  1326. package/src/shared-tree/sharedTreeChangeEnricher.ts +4 -4
  1327. package/src/shared-tree/sharedTreeChangeFamily.ts +34 -34
  1328. package/src/shared-tree/sharedTreeEditBuilder.ts +9 -39
  1329. package/src/shared-tree/treeAlpha.ts +60 -51
  1330. package/src/shared-tree/treeCheckout.ts +158 -132
  1331. package/src/shared-tree-core/branch.ts +10 -11
  1332. package/src/shared-tree-core/branchCommitEnricher.ts +3 -8
  1333. package/src/shared-tree-core/editManager.ts +3 -17
  1334. package/src/shared-tree-core/editManagerCodecs.ts +13 -18
  1335. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +1 -1
  1336. package/src/shared-tree-core/editManagerFormatCommons.ts +12 -15
  1337. package/src/shared-tree-core/editManagerFormatV1toV4.ts +2 -2
  1338. package/src/shared-tree-core/editManagerSummarizer.ts +3 -3
  1339. package/src/shared-tree-core/index.ts +3 -2
  1340. package/src/shared-tree-core/messageCodecV1ToV4.ts +1 -1
  1341. package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -1
  1342. package/src/shared-tree-core/messageCodecs.ts +15 -21
  1343. package/src/shared-tree-core/messageFormat.ts +12 -15
  1344. package/src/shared-tree-core/messageFormatV1ToV4.ts +2 -2
  1345. package/src/shared-tree-core/sequenceIdUtils.ts +4 -4
  1346. package/src/shared-tree-core/sharedTreeCore.ts +12 -11
  1347. package/src/shared-tree-core/transaction.ts +115 -56
  1348. package/src/shared-tree-core/transactionEnricher.ts +5 -6
  1349. package/src/shared-tree-core/versionedSummarizer.ts +10 -3
  1350. package/src/simple-tree/api/configuration.ts +1 -1
  1351. package/src/simple-tree/api/customTree.ts +14 -10
  1352. package/src/simple-tree/api/discrepancies.ts +23 -17
  1353. package/src/simple-tree/api/eraseSchemaDetails.ts +123 -0
  1354. package/src/simple-tree/api/index.ts +6 -0
  1355. package/src/simple-tree/api/schemaFactory.ts +11 -7
  1356. package/src/simple-tree/api/schemaFromSimple.ts +18 -9
  1357. package/src/simple-tree/api/simpleSchemaCodec.ts +10 -5
  1358. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +17 -13
  1359. package/src/simple-tree/api/simpleTreeIndex.ts +8 -8
  1360. package/src/simple-tree/api/storedSchema.ts +12 -9
  1361. package/src/simple-tree/api/transactionTypes.ts +19 -4
  1362. package/src/simple-tree/api/tree.ts +16 -1
  1363. package/src/simple-tree/api/treeNodeApi.ts +21 -13
  1364. package/src/simple-tree/api/verboseTree.ts +14 -9
  1365. package/src/simple-tree/core/treeNode.ts +1 -0
  1366. package/src/simple-tree/core/treeNodeKernel.ts +6 -3
  1367. package/src/simple-tree/core/unhydratedFlexTree.ts +58 -104
  1368. package/src/simple-tree/createContext.ts +4 -1
  1369. package/src/simple-tree/fieldSchema.ts +4 -6
  1370. package/src/simple-tree/getTreeNodeForField.ts +2 -1
  1371. package/src/simple-tree/index.ts +5 -2
  1372. package/src/simple-tree/leafNodeSchema.ts +8 -5
  1373. package/src/simple-tree/node-kinds/array/arrayNode.ts +28 -30
  1374. package/src/simple-tree/node-kinds/common.ts +5 -2
  1375. package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
  1376. package/src/simple-tree/node-kinds/object/objectNode.ts +28 -29
  1377. package/src/simple-tree/node-kinds/record/recordNode.ts +11 -13
  1378. package/src/simple-tree/prepareForInsertion.ts +200 -343
  1379. package/src/simple-tree/toStoredSchema.ts +12 -8
  1380. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +14 -42
  1381. package/src/tableSchema.ts +13 -18
  1382. package/src/treeFactory.ts +5 -14
  1383. package/src/util/bTreeUtils.ts +1 -1
  1384. package/src/util/brand.ts +61 -0
  1385. package/src/util/breakable.ts +9 -9
  1386. package/src/util/idAllocator.ts +1 -2
  1387. package/src/util/index.ts +3 -3
  1388. package/src/util/nestedMap.ts +1 -3
  1389. package/src/util/rangeMap.ts +18 -72
  1390. package/src/util/utils.ts +14 -13
  1391. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -36
  1392. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
  1393. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -126
  1394. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
  1395. package/dist/feature-libraries/forest-summary/format.d.ts.map +0 -1
  1396. package/dist/feature-libraries/forest-summary/format.js.map +0 -1
  1397. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +0 -23
  1398. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +0 -1
  1399. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +0 -31
  1400. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +0 -1
  1401. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +0 -12
  1402. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +0 -1
  1403. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +0 -57
  1404. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +0 -1
  1405. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -36
  1406. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
  1407. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -122
  1408. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
  1409. package/lib/feature-libraries/forest-summary/format.d.ts.map +0 -1
  1410. package/lib/feature-libraries/forest-summary/format.js.map +0 -1
  1411. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +0 -23
  1412. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +0 -1
  1413. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +0 -27
  1414. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +0 -1
  1415. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +0 -12
  1416. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +0 -1
  1417. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +0 -53
  1418. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +0 -1
  1419. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +0 -180
  1420. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +0 -45
  1421. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +0 -94
@@ -1 +1 @@
1
- {"version":3,"file":"discrepancies.js","sourceRoot":"","sources":["../../../src/simple-tree/api/discrepancies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EACN,QAAQ,EAGR,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GAOtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EACN,QAAQ,EACR,yCAAyC,GAGzC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,GAElB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACN,iBAAiB,EACjB,SAAS,EACT,gBAAgB,GAEhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AA2F9D,SAAS,uBAAuB,CAAC,UAAgC;IAChE,IAAI,UAAU,YAAY,sBAAsB,EAAE,CAAC;QAClD,OAAO,sBAAsB,CAAC;IAC/B,CAAC;IACD,IAAI,UAAU,YAAY,mBA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AAC,qBAAqB,CAAC,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC/E,CAAC;IACF,CAAC;IAED,KAAK,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC1D,IAAI,MAAM,CAAC,IAAI,KAAK,4BAA4B,EAAE,CAAC;YAClD,0DAA0D;YAC1D,qFAAqF;YACrF,2BAA2B;YAC3B,SAAS;QACV,CAAC;QAED,iEAAiE;QACjE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,2FAA2F;YAC3F,gFAAgF;YAChF,IAAI,CAAC,IAAI,CAAC,0BAA0B,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;gBACxF,MAAM;oBACL,UAAU;oBACV,QAAQ;oBACR,QAAQ,EAAE,WAAW;oBACrB,IAAI,EAAE,sBAAsB,CAAC,IAAI;oBACjC,MAAM,EAAE,MAAM,CAAC,IAAI;iBACY,CAAC;YAClC,CAAC;QACF,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tEmptyKey,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tstoredEmptyFieldSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n} from \"../../core/index.js\";\nimport { brand } from \"../../util/index.js\";\nimport {\n\tNodeKind,\n\tnormalizeAndEvaluateAnnotatedAllowedTypes,\n\ttype AnnotatedAllowedType,\n\ttype TreeNodeSchema,\n} from \"../core/index.js\";\nimport {\n\tisArrayNodeSchema,\n\tisMapNodeSchema,\n\tisObjectNodeSchema,\n\tisRecordNodeSchema,\n\ttype ObjectNodeSchemaPrivate,\n} from \"../node-kinds/index.js\";\nimport { convertFieldKind } from \"../toStoredSchema.js\";\nimport {\n\tcreateFieldSchema,\n\tFieldKind,\n\tFieldSchemaAlpha,\n\ttype FieldSchema,\n} from \"../fieldSchema.js\";\nimport { LeafNodeSchema } from \"../leafNodeSchema.js\";\nimport type { TreeSchema } from \"../treeSchema.js\";\nimport { tryStoredSchemaAsArray } from \"./customTree.js\";\nimport { FieldKinds } from \"../../feature-libraries/index.js\";\n\n/**\n * Discriminated union (keyed on `mismatch`) of discrepancies between a view and stored schema which\n * make it possible for content matching the stored schema to be incompatible with the view schema.\n */\nexport type Discrepancy = FieldDiscrepancy | NodeKindDiscrepancy;\n\n/**\n * A discrepancy in the declaration of a field.\n */\nexport type FieldDiscrepancy =\n\t| AllowedTypeDiscrepancy\n\t| FieldKindDiscrepancy\n\t| ValueSchemaDiscrepancy;\n\n/**\n * Information about where a field discrepancy is located within a collection of schema.\n */\nexport interface FieldDiscrepancyLocation {\n\t/**\n\t * The {@link TreeNodeSchemaIdentifier} that contains the discrepancy.\n\t *\n\t * Undefined iff the discrepancy is part of the root field schema.\n\t */\n\treadonly identifier: TreeNodeSchemaIdentifier | undefined;\n\t/**\n\t * The {@link FieldKey} for the field that contains the discrepancy.\n\t * Undefined when:\n\t * - the discrepancy is part of the root field schema\n\t * - the discrepancy is for 'all fields' of a map node\n\t */\n\treadonly fieldKey: FieldKey | undefined;\n}\n\n/**\n * A discrepancy in the allowed types of a field.\n *\n * @remarks\n * This reports the symmetric difference of allowed types.\n */\nexport interface AllowedTypeDiscrepancy extends FieldDiscrepancyLocation {\n\treadonly mismatch: \"allowedTypes\";\n\t/**\n\t * Annotated allowed types in viewed schema\n\t * (excluding {@link SchemaStaticsBeta.staged | staged} schema) which are not allowed in stored schema.\n\t */\n\treadonly view: readonly AnnotatedAllowedType<TreeNodeSchema>[];\n\t/**\n\t * Allowed type identifiers in stored schema which are not allowed in view schema\n\t * (including the view schema's {@link SchemaStaticsBeta.staged | staged} schema).\n\t */\n\treadonly stored: readonly TreeNodeSchemaIdentifier[];\n}\n\n/**\n * Differences in `FieldKindIdentifier` between two schema.\n */\nexport interface FieldKindDiscrepancy extends FieldDiscrepancyLocation {\n\treadonly mismatch: \"fieldKind\";\n\treadonly view: FieldKindIdentifier;\n\treadonly stored: FieldKindIdentifier;\n}\n\n/**\n * Differences in the `ValueSchema` of two `LeafNodeStoredSchema` objects.\n */\nexport interface ValueSchemaDiscrepancy {\n\tidentifier: TreeNodeSchemaIdentifier;\n\tmismatch: \"valueSchema\";\n\tview: ValueSchema | undefined;\n\tstored: ValueSchema | undefined;\n}\n\n/**\n * Differences in the kind of node schema.\n *\n * Includes when stored object schema are expected to be compatible with an array node schema.\n */\nexport interface NodeKindDiscrepancy {\n\tidentifier: TreeNodeSchemaIdentifier;\n\tmismatch: \"nodeKind\";\n\tview: NodeKind;\n\tstored: SchemaFactoryNodeKind;\n}\n\ntype SchemaFactoryNodeKind =\n\t| typeof ObjectNodeStoredSchema\n\t| typeof MapNodeStoredSchema\n\t| typeof LeafNodeStoredSchema;\n\nfunction getStoredNodeSchemaType(nodeSchema: TreeNodeStoredSchema): SchemaFactoryNodeKind {\n\tif (nodeSchema instanceof ObjectNodeStoredSchema) {\n\t\treturn ObjectNodeStoredSchema;\n\t}\n\tif (nodeSchema instanceof MapNodeStoredSchema) {\n\t\treturn MapNodeStoredSchema;\n\t}\n\tif (nodeSchema instanceof LeafNodeStoredSchema) {\n\t\treturn LeafNodeStoredSchema;\n\t}\n\tfail(0xbe8 /* Invalid stored node schema type */);\n}\n\nfunction doesNodeKindMatchStoredNodeKind(\n\tviewKind: NodeKind,\n\tstoredType: SchemaFactoryNodeKind,\n): boolean {\n\tswitch (viewKind) {\n\t\tcase NodeKind.Leaf:\n\t\t\treturn storedType === LeafNodeStoredSchema;\n\t\tcase NodeKind.Array:\n\t\tcase NodeKind.Object:\n\t\t\treturn storedType === ObjectNodeStoredSchema;\n\t\tcase NodeKind.Map:\n\t\tcase NodeKind.Record:\n\t\t\treturn storedType === MapNodeStoredSchema;\n\t\tdefault:\n\t\t\tunreachableCase(viewKind);\n\t}\n}\n\n/**\n * Finds and reports discrepancies between a view schema and a stored schema which make \"canView\" false.\n * @remarks\n * See documentation on {@link Discrepancy} and its subtypes for details of possible discrepancies.\n */\nexport function* getDiscrepanciesInAllowedContent(\n\tview: TreeSchema,\n\tstored: TreeStoredSchema,\n): Iterable<Discrepancy> {\n\t// check root field discrepancies\n\tyield* getFieldDiscrepancies(view.root, stored.rootFieldSchema, undefined, undefined);\n\n\t// Check all of the stored nodes, including their fields for discrepancies.\n\tfor (const [identifier, storedSchema] of stored.nodeSchema) {\n\t\tconst viewSchema = view.definitions.get(identifier);\n\n\t\t// if the view schema has a node that's also in the stored schema, check it.\n\t\tif (viewSchema !== undefined) {\n\t\t\tyield* getNodeDiscrepancies(identifier, viewSchema, storedSchema);\n\t\t}\n\t\t// Note that nodes that are missing in the view schema are only a problem if other stored schema nodes actually reference them which will produce its own discrepancy, so we can rely on that to produce any needed discrepancies.\n\t}\n}\n\nfunction* getNodeDiscrepancies(\n\tidentifier: TreeNodeSchemaIdentifier,\n\tview: TreeNodeSchema,\n\tstored: TreeNodeStoredSchema,\n): Iterable<Discrepancy> {\n\tif (!doesNodeKindMatchStoredNodeKind(view.kind, getStoredNodeSchemaType(stored))) {\n\t\tyield {\n\t\t\tidentifier,\n\t\t\tmismatch: \"nodeKind\",\n\t\t\tview: view.kind,\n\t\t\tstored: getStoredNodeSchemaType(stored),\n\t\t};\n\t\treturn;\n\t}\n\n\tswitch (view.kind) {\n\t\tcase NodeKind.Object: {\n\t\t\tassert(\n\t\t\t\tisObjectNodeSchema(view),\n\t\t\t\t0xbe9 /* schema with node kind of object must implement ObjectNodeSchema */,\n\t\t\t);\n\t\t\tyield* computeObjectNodeDiscrepancies(\n\t\t\t\tidentifier,\n\t\t\t\tview,\n\t\t\t\tstored as ObjectNodeStoredSchema,\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Array: {\n\t\t\tassert(\n\t\t\t\tisArrayNodeSchema(view),\n\t\t\t\t0xbea /* schema with node kind of array must implement ArrayNodeSchema */,\n\t\t\t);\n\n\t\t\tconst arrayStoredSchema = tryStoredSchemaAsArray(stored);\n\t\t\tif (arrayStoredSchema === undefined) {\n\t\t\t\tyield {\n\t\t\t\t\tidentifier,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: NodeKind.Array,\n\t\t\t\t\tstored: getStoredNodeSchemaType(stored),\n\t\t\t\t};\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tyield* getAllowedTypeDiscrepancies(\n\t\t\t\tnormalizeAndEvaluateAnnotatedAllowedTypes(view.info).types,\n\t\t\t\tarrayStoredSchema,\n\t\t\t\tbrand(view.identifier),\n\t\t\t\tEmptyKey,\n\t\t\t);\n\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Map: {\n\t\t\tassert(\n\t\t\t\tisMapNodeSchema(view),\n\t\t\t\t0xbeb /* schema with node kind of map must implement MapNodeSchema */,\n\t\t\t);\n\n\t\t\tyield* getFieldDiscrepancies(\n\t\t\t\tcreateFieldSchema(FieldKind.Optional, view.info),\n\t\t\t\t(stored as MapNodeStoredSchema).mapFields,\n\t\t\t\tidentifier,\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Record: {\n\t\t\tassert(\n\t\t\t\tisRecordNodeSchema(view),\n\t\t\t\t0xbec /* schema with node kind of record must implement RecordNodeSchema */,\n\t\t\t);\n\n\t\t\tyield* getFieldDiscrepancies(\n\t\t\t\tcreateFieldSchema(FieldKind.Optional, view.info),\n\t\t\t\t(stored as MapNodeStoredSchema).mapFields,\n\t\t\t\tidentifier,\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Leaf: {\n\t\t\tassert(\n\t\t\t\tview instanceof LeafNodeSchema,\n\t\t\t\t0xbed /* schema with node kind of leaf must implement LeafNodeSchema */,\n\t\t\t);\n\t\t\t// TODO: leafKind seems like a bad name\n\t\t\tconst viewValue = view.leafKind;\n\t\t\tconst storedValue = (stored as LeafNodeStoredSchema).leafValue;\n\t\t\tif (viewValue !== storedValue) {\n\t\t\t\tyield {\n\t\t\t\t\tidentifier,\n\t\t\t\t\tmismatch: \"valueSchema\",\n\t\t\t\t\tview: viewValue,\n\t\t\t\t\tstored: storedValue,\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tbreak;\n\t}\n}\n\n/**\n * Returns the allowed types that are not present in both the given view and stored schemas.\n */\nexport function findExtraAllowedTypes(\n\tviewAllowedTypes: readonly AnnotatedAllowedType<TreeNodeSchema>[],\n\tstoredAllowedTypes: TreeTypeSet,\n): Pick<AllowedTypeDiscrepancy, \"view\" | \"stored\"> {\n\tconst viewNodeSchemaIdentifiers = new Set(\n\t\tviewAllowedTypes.map((value) => value.type.identifier),\n\t);\n\n\t// TODO:\n\t// Add detecting which SchemaUpgrades have been made.\n\t// When doing so, each will fall into one of three states: staged, partially applied, or fully applied.\n\t// This would allow for nicer compatibility errors and more detailed compatibility status in the future.\n\tconst view = viewAllowedTypes.filter(\n\t\t(value) =>\n\t\t\t!storedAllowedTypes.has(brand(value.type.identifier)) &&\n\t\t\tvalue.metadata.stagedSchemaUpgrade === undefined,\n\t);\n\tconst stored = [...storedAllowedTypes].filter(\n\t\t(value) => !viewNodeSchemaIdentifiers.has(value),\n\t);\n\treturn { view, stored };\n}\n\n/**\n * The function to track the discrepancies between a field view schema and a stored schema.\n *\n * @remarks\n * This function yields discrepancies in the following cases:\n * 1. If the view schema has allowed types that are not present in the stored schema.\n * 2. If the stored schema has allowed types that are not present in the view schema.\n * 3. If the field kind in the view schema is not compatible with the stored schema.\n *\n * This function does not recurse into the nodes of the view schema and only makes comparisons at the field level.\n *\n * @param fieldKey - If the key is missing, it indicates that this is the root field schema.\n */\nfunction* getFieldDiscrepancies(\n\tview: FieldSchema,\n\tstored: TreeFieldStoredSchema,\n\tidentifier: TreeNodeSchemaIdentifier | undefined,\n\tfieldKey: FieldKey | undefined,\n): Iterable<FieldDiscrepancy> {\n\tassert(\n\t\tview instanceof FieldSchemaAlpha,\n\t\t0xbee /* all field schema should be FieldSchemaAlpha */,\n\t);\n\tyield* getAllowedTypeDiscrepancies(\n\t\tview.allowedTypesFull.evaluate().types,\n\t\tstored.types,\n\t\tidentifier,\n\t\tfieldKey,\n\t);\n\n\tconst viewKind =\n\t\tconvertFieldKind.get(view.kind) ??\n\t\tfail(0xbef /* A conversion from a FieldKind to a FlexFieldKind should exist */);\n\n\t// This checks if the field kind in the view schema is not compatible with the stored schema.\n\tif (viewKind.identifier !== stored.kind) {\n\t\tyield {\n\t\t\tidentifier,\n\t\t\tfieldKey,\n\t\t\tmismatch: \"fieldKind\",\n\t\t\tview: viewKind.identifier,\n\t\t\tstored: stored.kind,\n\t\t} satisfies FieldKindDiscrepancy;\n\t}\n}\n\n/**\n * The function to track the discrepancies between a field view schema and a stored schema.\n *\n * @remarks\n * This function yields discrepancies in the following cases:\n * 1. If the view schema has allowed types that are not present in the stored schema.\n * 2. If the stored schema has allowed types that are not present in the view schema.\n *\n * This function does not recurse into the nodes of the view schema and only makes comparisons at the field level.\n *\n * @param fieldKey - If the key is missing, it indicates that this is the root field schema.\n */\nfunction* getAllowedTypeDiscrepancies(\n\tview: readonly AnnotatedAllowedType<TreeNodeSchema>[],\n\tstored: TreeTypeSet,\n\tidentifier: TreeNodeSchemaIdentifier | undefined,\n\tfieldKey: FieldKey | undefined,\n): Iterable<FieldDiscrepancy> {\n\tconst discrepancies = findExtraAllowedTypes(view, stored);\n\tif (discrepancies.view.length > 0 || discrepancies.stored.length > 0) {\n\t\tyield {\n\t\t\t...discrepancies,\n\t\t\tidentifier,\n\t\t\tfieldKey,\n\t\t\tmismatch: \"allowedTypes\",\n\t\t} satisfies AllowedTypeDiscrepancy;\n\t}\n}\n\n/**\n * Computes discrepancies between a view schema and a stored schema for nodes that are treated as object nodes in the stored schema.\n * This includes both view object nodes and view array nodes.\n *\n * This function yields discrepancies in the following cases:\n *\n * 1. If the view schema has fields that are not present in the stored schema.\n * 2. If the stored schema has fields that are not present in the view schema.\n * 3. If the field kind or allowed types of a field in the view schema is not compatible with the stored schema.\n *\n * This function includes discrepancies within the common fields and their allowed types, but does NOT recurse to report and discrepancies within the node types referenced by those fields.\n */\nfunction* computeObjectNodeDiscrepancies(\n\tidentifier: TreeNodeSchemaIdentifier,\n\tview: ObjectNodeSchemaPrivate,\n\tstored: ObjectNodeStoredSchema,\n): Iterable<FieldDiscrepancy> {\n\t/**\n\t * Similar to the logic used for tracking discrepancies between two node schemas, we will identify\n\t * three types of differences:\n\t * 1. Fields that exist in the view schema but not in the stored schema.\n\t * 2. Fields that exist in both schemas but have different contents.\n\t * 3. Fields that exist in the stored schema but not in the view schema.\n\t *\n\t * First, the view schema is iterated to track the first two types of differences.\n\t * Then, the stored schema is iterated to find the third type.\n\t */\n\n\tconst viewKeys = new Set<FieldKey>();\n\n\tfor (const [_, { storedKey: fieldKey, schema: fieldSchema }] of view.flexKeyMap) {\n\t\tconst storedSchema = stored.objectNodeFields.get(fieldKey);\n\t\tviewKeys.add(fieldKey);\n\n\t\t// If the view schema has a field that's not in the stored schema\n\t\tif (storedSchema === undefined) {\n\t\t\tconst viewKind =\n\t\t\t\tconvertFieldKind.get(fieldSchema.kind) ??\n\t\t\t\tfail(0xbf0 /* A conversion from a FieldKind to a FlexFieldKind should exist */);\n\t\t\tyield {\n\t\t\t\tidentifier,\n\t\t\t\tfieldKey,\n\t\t\t\tmismatch: \"fieldKind\",\n\t\t\t\tview: viewKind.identifier,\n\t\t\t\tstored: storedEmptyFieldSchema.kind,\n\t\t\t} satisfies FieldKindDiscrepancy;\n\t\t} else {\n\t\t\tyield* getFieldDiscrepancies(fieldSchema, storedSchema, identifier, fieldKey);\n\t\t}\n\t}\n\n\tfor (const [fieldKey, schema] of stored.objectNodeFields) {\n\t\tif (schema.kind === forbiddenFieldKindIdentifier) {\n\t\t\t// In the stored schema the field is explicitly forbidden.\n\t\t\t// This has the same semantics of the field not being mentioned in the stored schema,\n\t\t\t// and thus can be skipped.\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If the stored schema has a field that's not in the view schema\n\t\tif (!viewKeys.has(fieldKey)) {\n\t\t\t// When the application has opted into it, we allow viewing documents which have additional\n\t\t\t// optional fields in the stored schema that are not present in the view schema.\n\t\t\tif (!view.allowUnknownOptionalFields || schema.kind !== FieldKinds.optional.identifier) {\n\t\t\t\tyield {\n\t\t\t\t\tidentifier,\n\t\t\t\t\tfieldKey,\n\t\t\t\t\tmismatch: \"fieldKind\",\n\t\t\t\t\tview: storedEmptyFieldSchema.kind,\n\t\t\t\t\tstored: schema.kind,\n\t\t\t\t} satisfies FieldKindDiscrepancy;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"discrepancies.js","sourceRoot":"","sources":["../../../src/simple-tree/api/discrepancies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EACN,QAAQ,EAGR,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GAOtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EACN,QAAQ,EACR,yCAAyC,GAGzC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,GAElB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AC,IAAI;gBACjC,MAAM,EAAE,MAAM,CAAC,IAAI;aACY,CAAC;QAClC,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tEmptyKey,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tstoredEmptyFieldSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n} from \"../../core/index.js\";\nimport { brand } from \"../../util/index.js\";\nimport {\n\tNodeKind,\n\tnormalizeAndEvaluateAnnotatedAllowedTypes,\n\ttype AnnotatedAllowedType,\n\ttype TreeNodeSchema,\n} from \"../core/index.js\";\nimport {\n\tisArrayNodeSchema,\n\tisMapNodeSchema,\n\tisObjectNodeSchema,\n\tisRecordNodeSchema,\n\ttype ObjectNodeSchemaPrivate,\n} from \"../node-kinds/index.js\";\nimport { convertFieldKind } from \"../toStoredSchema.js\";\nimport {\n\tcreateFieldSchema,\n\tFieldKind,\n\tFieldSchemaAlpha,\n\ttype FieldSchema,\n} from \"../fieldSchema.js\";\nimport { LeafNodeSchema } from \"../leafNodeSchema.js\";\nimport type { TreeSchema } from \"../treeSchema.js\";\nimport { tryStoredSchemaAsArray } from \"./customTree.js\";\nimport { FieldKinds } from \"../../feature-libraries/index.js\";\n\n/**\n * Discriminated union (keyed on `mismatch`) of discrepancies between a view and stored schema which\n * make it possible for content matching the stored schema to be incompatible with the view schema.\n */\nexport type Discrepancy = FieldDiscrepancy | NodeKindDiscrepancy;\n\n/**\n * A discrepancy in the declaration of a field.\n */\nexport type FieldDiscrepancy =\n\t| AllowedTypeDiscrepancy\n\t| FieldKindDiscrepancy\n\t| ValueSchemaDiscrepancy;\n\n/**\n * Information about where a field discrepancy is located within a collection of schema.\n */\nexport interface FieldDiscrepancyLocation {\n\t/**\n\t * The {@link TreeNodeSchemaIdentifier} that contains the discrepancy.\n\t *\n\t * Undefined iff the discrepancy is part of the root field schema.\n\t */\n\treadonly identifier: TreeNodeSchemaIdentifier | undefined;\n\t/**\n\t * The {@link FieldKey} for the field that contains the discrepancy.\n\t * Undefined when:\n\t * - the discrepancy is part of the root field schema\n\t * - the discrepancy is for 'all fields' of a map node\n\t */\n\treadonly fieldKey: FieldKey | undefined;\n}\n\n/**\n * A discrepancy in the allowed types of a field.\n *\n * @remarks\n * This reports the symmetric difference of allowed types.\n */\nexport interface AllowedTypeDiscrepancy extends FieldDiscrepancyLocation {\n\treadonly mismatch: \"allowedTypes\";\n\t/**\n\t * Annotated allowed types in viewed schema\n\t * (excluding {@link SchemaStaticsBeta.staged | staged} schema) which are not allowed in stored schema.\n\t */\n\treadonly view: readonly AnnotatedAllowedType<TreeNodeSchema>[];\n\t/**\n\t * Allowed type identifiers in stored schema which are not allowed in view schema\n\t * (including the view schema's {@link SchemaStaticsBeta.staged | staged} schema).\n\t */\n\treadonly stored: readonly TreeNodeSchemaIdentifier[];\n}\n\n/**\n * Differences in `FieldKindIdentifier` between two schema.\n */\nexport interface FieldKindDiscrepancy extends FieldDiscrepancyLocation {\n\treadonly mismatch: \"fieldKind\";\n\treadonly view: FieldKindIdentifier;\n\treadonly stored: FieldKindIdentifier;\n}\n\n/**\n * Differences in the `ValueSchema` of two `LeafNodeStoredSchema` objects.\n */\nexport interface ValueSchemaDiscrepancy {\n\tidentifier: TreeNodeSchemaIdentifier;\n\tmismatch: \"valueSchema\";\n\tview: ValueSchema | undefined;\n\tstored: ValueSchema | undefined;\n}\n\n/**\n * Differences in the kind of node schema.\n *\n * Includes when stored object schema are expected to be compatible with an array node schema.\n */\nexport interface NodeKindDiscrepancy {\n\tidentifier: TreeNodeSchemaIdentifier;\n\tmismatch: \"nodeKind\";\n\tview: NodeKind;\n\tstored: SchemaFactoryNodeKind;\n}\n\ntype SchemaFactoryNodeKind =\n\t| typeof ObjectNodeStoredSchema\n\t| typeof MapNodeStoredSchema\n\t| typeof LeafNodeStoredSchema;\n\nfunction getStoredNodeSchemaType(nodeSchema: TreeNodeStoredSchema): SchemaFactoryNodeKind {\n\tif (nodeSchema instanceof ObjectNodeStoredSchema) {\n\t\treturn ObjectNodeStoredSchema;\n\t}\n\tif (nodeSchema instanceof MapNodeStoredSchema) {\n\t\treturn MapNodeStoredSchema;\n\t}\n\tif (nodeSchema instanceof LeafNodeStoredSchema) {\n\t\treturn LeafNodeStoredSchema;\n\t}\n\tfail(0xbe8 /* Invalid stored node schema type */);\n}\n\nfunction doesNodeKindMatchStoredNodeKind(\n\tviewKind: NodeKind,\n\tstoredType: SchemaFactoryNodeKind,\n): boolean {\n\tswitch (viewKind) {\n\t\tcase NodeKind.Leaf: {\n\t\t\treturn storedType === LeafNodeStoredSchema;\n\t\t}\n\t\tcase NodeKind.Array:\n\t\tcase NodeKind.Object: {\n\t\t\treturn storedType === ObjectNodeStoredSchema;\n\t\t}\n\t\tcase NodeKind.Map:\n\t\tcase NodeKind.Record: {\n\t\t\treturn storedType === MapNodeStoredSchema;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(viewKind);\n\t\t}\n\t}\n}\n\n/**\n * Finds and reports discrepancies between a view schema and a stored schema which make \"canView\" false.\n * @remarks\n * See documentation on {@link Discrepancy} and its subtypes for details of possible discrepancies.\n */\nexport function* getDiscrepanciesInAllowedContent(\n\tview: TreeSchema,\n\tstored: TreeStoredSchema,\n): Iterable<Discrepancy> {\n\t// check root field discrepancies\n\tyield* getFieldDiscrepancies(view.root, stored.rootFieldSchema, undefined, undefined);\n\n\t// Check all of the stored nodes, including their fields for discrepancies.\n\tfor (const [identifier, storedSchema] of stored.nodeSchema) {\n\t\tconst viewSchema = view.definitions.get(identifier);\n\n\t\t// if the view schema has a node that's also in the stored schema, check it.\n\t\tif (viewSchema !== undefined) {\n\t\t\tyield* getNodeDiscrepancies(identifier, viewSchema, storedSchema);\n\t\t}\n\t\t// Note that nodes that are missing in the view schema are only a problem if other stored schema nodes actually reference them which will produce its own discrepancy, so we can rely on that to produce any needed discrepancies.\n\t}\n}\n\nfunction* getNodeDiscrepancies(\n\tidentifier: TreeNodeSchemaIdentifier,\n\tview: TreeNodeSchema,\n\tstored: TreeNodeStoredSchema,\n): Iterable<Discrepancy> {\n\tif (!doesNodeKindMatchStoredNodeKind(view.kind, getStoredNodeSchemaType(stored))) {\n\t\tyield {\n\t\t\tidentifier,\n\t\t\tmismatch: \"nodeKind\",\n\t\t\tview: view.kind,\n\t\t\tstored: getStoredNodeSchemaType(stored),\n\t\t};\n\t\treturn;\n\t}\n\n\tswitch (view.kind) {\n\t\tcase NodeKind.Object: {\n\t\t\tassert(\n\t\t\t\tisObjectNodeSchema(view),\n\t\t\t\t0xbe9 /* schema with node kind of object must implement ObjectNodeSchema */,\n\t\t\t);\n\t\t\tyield* computeObjectNodeDiscrepancies(\n\t\t\t\tidentifier,\n\t\t\t\tview,\n\t\t\t\tstored as ObjectNodeStoredSchema,\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Array: {\n\t\t\tassert(\n\t\t\t\tisArrayNodeSchema(view),\n\t\t\t\t0xbea /* schema with node kind of array must implement ArrayNodeSchema */,\n\t\t\t);\n\n\t\t\tconst arrayStoredSchema = tryStoredSchemaAsArray(stored);\n\t\t\tif (arrayStoredSchema === undefined) {\n\t\t\t\tyield {\n\t\t\t\t\tidentifier,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: NodeKind.Array,\n\t\t\t\t\tstored: getStoredNodeSchemaType(stored),\n\t\t\t\t};\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tyield* getAllowedTypeDiscrepancies(\n\t\t\t\tnormalizeAndEvaluateAnnotatedAllowedTypes(view.info).types,\n\t\t\t\tarrayStoredSchema,\n\t\t\t\tbrand(view.identifier),\n\t\t\t\tEmptyKey,\n\t\t\t);\n\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Map: {\n\t\t\tassert(\n\t\t\t\tisMapNodeSchema(view),\n\t\t\t\t0xbeb /* schema with node kind of map must implement MapNodeSchema */,\n\t\t\t);\n\n\t\t\tyield* getFieldDiscrepancies(\n\t\t\t\tcreateFieldSchema(FieldKind.Optional, view.info),\n\t\t\t\t(stored as MapNodeStoredSchema).mapFields,\n\t\t\t\tidentifier,\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Record: {\n\t\t\tassert(\n\t\t\t\tisRecordNodeSchema(view),\n\t\t\t\t0xbec /* schema with node kind of record must implement RecordNodeSchema */,\n\t\t\t);\n\n\t\t\tyield* getFieldDiscrepancies(\n\t\t\t\tcreateFieldSchema(FieldKind.Optional, view.info),\n\t\t\t\t(stored as MapNodeStoredSchema).mapFields,\n\t\t\t\tidentifier,\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Leaf: {\n\t\t\tassert(\n\t\t\t\tview instanceof LeafNodeSchema,\n\t\t\t\t0xbed /* schema with node kind of leaf must implement LeafNodeSchema */,\n\t\t\t);\n\t\t\t// TODO: leafKind seems like a bad name\n\t\t\tconst viewValue = view.leafKind;\n\t\t\tconst storedValue = (stored as LeafNodeStoredSchema).leafValue;\n\t\t\tif (viewValue !== storedValue) {\n\t\t\t\tyield {\n\t\t\t\t\tidentifier,\n\t\t\t\t\tmismatch: \"valueSchema\",\n\t\t\t\t\tview: viewValue,\n\t\t\t\t\tstored: storedValue,\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/**\n * Returns the allowed types that are not present in both the given view and stored schemas.\n */\nexport function findExtraAllowedTypes(\n\tviewAllowedTypes: readonly AnnotatedAllowedType<TreeNodeSchema>[],\n\tstoredAllowedTypes: TreeTypeSet,\n): Pick<AllowedTypeDiscrepancy, \"view\" | \"stored\"> {\n\tconst viewNodeSchemaIdentifiers = new Set(\n\t\tviewAllowedTypes.map((value) => value.type.identifier),\n\t);\n\n\t// TODO:\n\t// Add detecting which SchemaUpgrades have been made.\n\t// When doing so, each will fall into one of three states: staged, partially applied, or fully applied.\n\t// This would allow for nicer compatibility errors and more detailed compatibility status in the future.\n\tconst view = viewAllowedTypes.filter(\n\t\t(value) =>\n\t\t\t!storedAllowedTypes.has(brand(value.type.identifier)) &&\n\t\t\tvalue.metadata.stagedSchemaUpgrade === undefined,\n\t);\n\tconst stored = [...storedAllowedTypes].filter(\n\t\t(value) => !viewNodeSchemaIdentifiers.has(value),\n\t);\n\treturn { view, stored };\n}\n\n/**\n * The function to track the discrepancies between a field view schema and a stored schema.\n *\n * @remarks\n * This function yields discrepancies in the following cases:\n * 1. If the view schema has allowed types that are not present in the stored schema.\n * 2. If the stored schema has allowed types that are not present in the view schema.\n * 3. If the field kind in the view schema is not compatible with the stored schema.\n *\n * This function does not recurse into the nodes of the view schema and only makes comparisons at the field level.\n *\n * @param fieldKey - If the key is missing, it indicates that this is the root field schema.\n */\nfunction* getFieldDiscrepancies(\n\tview: FieldSchema,\n\tstored: TreeFieldStoredSchema,\n\tidentifier: TreeNodeSchemaIdentifier | undefined,\n\tfieldKey: FieldKey | undefined,\n): Iterable<FieldDiscrepancy> {\n\tassert(\n\t\tview instanceof FieldSchemaAlpha,\n\t\t0xbee /* all field schema should be FieldSchemaAlpha */,\n\t);\n\tyield* getAllowedTypeDiscrepancies(\n\t\tview.allowedTypesFull.evaluate().types,\n\t\tstored.types,\n\t\tidentifier,\n\t\tfieldKey,\n\t);\n\n\tconst viewKind =\n\t\tconvertFieldKind.get(view.kind) ??\n\t\tfail(0xbef /* A conversion from a FieldKind to a FlexFieldKind should exist */);\n\n\t// This checks if the field kind in the view schema is not compatible with the stored schema.\n\tif (viewKind.identifier !== stored.kind) {\n\t\tyield {\n\t\t\tidentifier,\n\t\t\tfieldKey,\n\t\t\tmismatch: \"fieldKind\",\n\t\t\tview: viewKind.identifier,\n\t\t\tstored: stored.kind,\n\t\t} satisfies FieldKindDiscrepancy;\n\t}\n}\n\n/**\n * The function to track the discrepancies between a field view schema and a stored schema.\n *\n * @remarks\n * This function yields discrepancies in the following cases:\n * 1. If the view schema has allowed types that are not present in the stored schema.\n * 2. If the stored schema has allowed types that are not present in the view schema.\n *\n * This function does not recurse into the nodes of the view schema and only makes comparisons at the field level.\n *\n * @param fieldKey - If the key is missing, it indicates that this is the root field schema.\n */\nfunction* getAllowedTypeDiscrepancies(\n\tview: readonly AnnotatedAllowedType<TreeNodeSchema>[],\n\tstored: TreeTypeSet,\n\tidentifier: TreeNodeSchemaIdentifier | undefined,\n\tfieldKey: FieldKey | undefined,\n): Iterable<FieldDiscrepancy> {\n\tconst discrepancies = findExtraAllowedTypes(view, stored);\n\tif (discrepancies.view.length > 0 || discrepancies.stored.length > 0) {\n\t\tyield {\n\t\t\t...discrepancies,\n\t\t\tidentifier,\n\t\t\tfieldKey,\n\t\t\tmismatch: \"allowedTypes\",\n\t\t} satisfies AllowedTypeDiscrepancy;\n\t}\n}\n\n/**\n * Computes discrepancies between a view schema and a stored schema for nodes that are treated as object nodes in the stored schema.\n * This includes both view object nodes and view array nodes.\n *\n * This function yields discrepancies in the following cases:\n *\n * 1. If the view schema has fields that are not present in the stored schema.\n * 2. If the stored schema has fields that are not present in the view schema.\n * 3. If the field kind or allowed types of a field in the view schema is not compatible with the stored schema.\n *\n * This function includes discrepancies within the common fields and their allowed types, but does NOT recurse to report and discrepancies within the node types referenced by those fields.\n */\nfunction* computeObjectNodeDiscrepancies(\n\tidentifier: TreeNodeSchemaIdentifier,\n\tview: ObjectNodeSchemaPrivate,\n\tstored: ObjectNodeStoredSchema,\n): Iterable<FieldDiscrepancy> {\n\t/**\n\t * Similar to the logic used for tracking discrepancies between two node schemas, we will identify\n\t * three types of differences:\n\t * 1. Fields that exist in the view schema but not in the stored schema.\n\t * 2. Fields that exist in both schemas but have different contents.\n\t * 3. Fields that exist in the stored schema but not in the view schema.\n\t *\n\t * First, the view schema is iterated to track the first two types of differences.\n\t * Then, the stored schema is iterated to find the third type.\n\t */\n\n\tconst viewKeys = new Set<FieldKey>();\n\n\tfor (const [_, { storedKey: fieldKey, schema: fieldSchema }] of view.flexKeyMap) {\n\t\tconst storedSchema = stored.objectNodeFields.get(fieldKey);\n\t\tviewKeys.add(fieldKey);\n\n\t\t// If the view schema has a field that's not in the stored schema\n\t\tif (storedSchema === undefined) {\n\t\t\tconst viewKind =\n\t\t\t\tconvertFieldKind.get(fieldSchema.kind) ??\n\t\t\t\tfail(0xbf0 /* A conversion from a FieldKind to a FlexFieldKind should exist */);\n\t\t\tyield {\n\t\t\t\tidentifier,\n\t\t\t\tfieldKey,\n\t\t\t\tmismatch: \"fieldKind\",\n\t\t\t\tview: viewKind.identifier,\n\t\t\t\tstored: storedEmptyFieldSchema.kind,\n\t\t\t} satisfies FieldKindDiscrepancy;\n\t\t} else {\n\t\t\tyield* getFieldDiscrepancies(fieldSchema, storedSchema, identifier, fieldKey);\n\t\t}\n\t}\n\n\tfor (const [fieldKey, schema] of stored.objectNodeFields) {\n\t\tif (schema.kind === forbiddenFieldKindIdentifier) {\n\t\t\t// In the stored schema the field is explicitly forbidden.\n\t\t\t// This has the same semantics of the field not being mentioned in the stored schema,\n\t\t\t// and thus can be skipped.\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If the stored schema has a field that's not in the view schema\n\t\t// When the application has opted into it, we allow viewing documents which have additional\n\t\t// optional fields in the stored schema that are not present in the view schema.\n\t\tif (\n\t\t\t!viewKeys.has(fieldKey) &&\n\t\t\t(!view.allowUnknownOptionalFields || schema.kind !== FieldKinds.optional.identifier)\n\t\t) {\n\t\t\tyield {\n\t\t\t\tidentifier,\n\t\t\t\tfieldKey,\n\t\t\t\tmismatch: \"fieldKind\",\n\t\t\t\tview: storedEmptyFieldSchema.kind,\n\t\t\t\tstored: schema.kind,\n\t\t\t} satisfies FieldKindDiscrepancy;\n\t\t}\n\t}\n}\n"]}
@@ -0,0 +1,89 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { TreeNode, TreeNodeSchema, NodeKind, TreeNodeSchemaClass, WithType } from "../core/index.js";
6
+ /**
7
+ * Type-erase details of a schema.
8
+ *
9
+ * @typeParam TNode - The type to narrow the node to.
10
+ * Typically {@link TreeNode} intersected with the public interface for the component.
11
+ * @typeParam ExtraSchemaProperties - Properties of the schema (statics on the schema class) to retain in addition to the basic {@link TreeNodeSchema}.
12
+ * Typically includes at least one static factory method for creating nodes.
13
+ * @remarks
14
+ * This can be used to type erase the details of a schema including the node's type (such as its fields and APIs for modifying those fields).
15
+ * This is intended for use on component boundaries to support encapsulation of implementation details, including the exact schema.
16
+ *
17
+ * This is best applied to a top level "component node" which wraps the actual component content (in a single required object node field) allowing more cases of schema evolution to be carried out as implementation details of the component.
18
+ *
19
+ * Since this type-erases the schema details, the remaining API will need to provide ways to construct instances of the node and access its contents.
20
+ * Typically construction is done via static functions on the schema which can be included in `ExtraSchemaProperties`,
21
+ * and access to contents is done via properties of TNode (usually methods).
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * const schema = new SchemaFactory("com.example");
26
+ *
27
+ * interface SquareNode {
28
+ * readonly area: number;
29
+ * }
30
+ *
31
+ * interface SquareSchema {
32
+ * create(sideLength: number): Square;
33
+ * }
34
+ *
35
+ * class SquareInternal
36
+ * extends schema.object("Demo", { hidden: schema.number })
37
+ * implements SquareNode
38
+ * {
39
+ * public get area(): number {
40
+ * return this.hidden * this.hidden;
41
+ * }
42
+ *
43
+ * public static create(sideLength: number): SquareInternal {
44
+ * return new SquareInternal({ hidden: sideLength });
45
+ * }
46
+ * }
47
+ *
48
+ * const Square = eraseSchemaDetails<Square, SquareSchema>()(SquareInternal);
49
+ * type Square = SquareNode & TreeNode & WithType<"com.example.Demo">;
50
+ * ```
51
+ * @privateRemarks
52
+ * See "example" test for an executable version of this example.
53
+ * @alpha
54
+ */
55
+ export declare function eraseSchemaDetails<TNode, ExtraSchemaProperties = unknown>(): <T extends ExtraSchemaProperties & TreeNodeSchema<string, NodeKind, TNode & TreeNode>>(schema: T) => ExtraSchemaProperties & TreeNodeSchema<T["identifier"], NodeKind, TNode & TreeNode & WithType<T["identifier"]>, never, false>;
56
+ /**
57
+ * Like {@link eraseSchemaDetails} but allows the returned schema to be subclassed.
58
+ * @example
59
+ * ```typescript
60
+ * const schema = new SchemaFactory("com.example");
61
+ *
62
+ * interface SquareInterface {
63
+ * readonly area: number;
64
+ * }
65
+ *
66
+ * class SquareInternal
67
+ * extends schema.object("Demo", { size: schema.number })
68
+ * implements SquareInterface
69
+ * {
70
+ * public get area(): number {
71
+ * return this.size * this.size;
72
+ * }
73
+ * }
74
+ *
75
+ * class Square extends eraseSchemaDetailsSubclassable<SquareInterface>()(SquareInternal) {
76
+ * public static create(sideLength: number): Square {
77
+ * return new (this as TreeNodeSchema as typeof SquareInternal)({ size: sideLength });
78
+ * }
79
+ * }
80
+ *
81
+ * const square = Square.create(10);
82
+ * assert.equal(square.area, 100);
83
+ * ```
84
+ * @privateRemarks
85
+ * See "example" test for an executable version of this example.
86
+ * @alpha
87
+ */
88
+ export declare function eraseSchemaDetailsSubclassable<TNode, ExtraSchemaProperties = unknown>(): <T extends ExtraSchemaProperties & TreeNodeSchemaClass<string, NodeKind, TNode & TreeNode>>(schema: T) => ExtraSchemaProperties & TreeNodeSchemaClass<T["identifier"], NodeKind, TNode & TreeNode & WithType<T["identifier"]>, never, false>;
89
+ //# sourceMappingURL=eraseSchemaDetails.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eraseSchemaDetails.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/eraseSchemaDetails.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,mBAAmB,EACnB,QAAQ,EACR,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,KAAK,CAC7E,CAAC,SAAS,qBAAqB,GAAG,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC,EAEpF,MAAM,EAAE,CAAC,KACL,qBAAqB,GACzB,cAAc,CACb,CAAC,CAAC,YAAY,CAAC,EACf,QAAQ,EACR,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,EAC5C,KAAK,EACL,KAAK,CACL,CAED;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,KAAK,CACzF,CAAC,SAAS,qBAAqB,GAAG,mBAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC,EAEzF,MAAM,EAAE,CAAC,KACL,qBAAqB,GACzB,mBAAmB,CAClB,CAAC,CAAC,YAAY,CAAC,EACf,QAAQ,EACR,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,EAC5C,KAAK,EACL,KAAK,CACL,CAED"}
@@ -0,0 +1,92 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Type-erase details of a schema.
7
+ *
8
+ * @typeParam TNode - The type to narrow the node to.
9
+ * Typically {@link TreeNode} intersected with the public interface for the component.
10
+ * @typeParam ExtraSchemaProperties - Properties of the schema (statics on the schema class) to retain in addition to the basic {@link TreeNodeSchema}.
11
+ * Typically includes at least one static factory method for creating nodes.
12
+ * @remarks
13
+ * This can be used to type erase the details of a schema including the node's type (such as its fields and APIs for modifying those fields).
14
+ * This is intended for use on component boundaries to support encapsulation of implementation details, including the exact schema.
15
+ *
16
+ * This is best applied to a top level "component node" which wraps the actual component content (in a single required object node field) allowing more cases of schema evolution to be carried out as implementation details of the component.
17
+ *
18
+ * Since this type-erases the schema details, the remaining API will need to provide ways to construct instances of the node and access its contents.
19
+ * Typically construction is done via static functions on the schema which can be included in `ExtraSchemaProperties`,
20
+ * and access to contents is done via properties of TNode (usually methods).
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * const schema = new SchemaFactory("com.example");
25
+ *
26
+ * interface SquareNode {
27
+ * readonly area: number;
28
+ * }
29
+ *
30
+ * interface SquareSchema {
31
+ * create(sideLength: number): Square;
32
+ * }
33
+ *
34
+ * class SquareInternal
35
+ * extends schema.object("Demo", { hidden: schema.number })
36
+ * implements SquareNode
37
+ * {
38
+ * public get area(): number {
39
+ * return this.hidden * this.hidden;
40
+ * }
41
+ *
42
+ * public static create(sideLength: number): SquareInternal {
43
+ * return new SquareInternal({ hidden: sideLength });
44
+ * }
45
+ * }
46
+ *
47
+ * const Square = eraseSchemaDetails<Square, SquareSchema>()(SquareInternal);
48
+ * type Square = SquareNode & TreeNode & WithType<"com.example.Demo">;
49
+ * ```
50
+ * @privateRemarks
51
+ * See "example" test for an executable version of this example.
52
+ * @alpha
53
+ */
54
+ export function eraseSchemaDetails() {
55
+ return (schema) => schema;
56
+ }
57
+ /**
58
+ * Like {@link eraseSchemaDetails} but allows the returned schema to be subclassed.
59
+ * @example
60
+ * ```typescript
61
+ * const schema = new SchemaFactory("com.example");
62
+ *
63
+ * interface SquareInterface {
64
+ * readonly area: number;
65
+ * }
66
+ *
67
+ * class SquareInternal
68
+ * extends schema.object("Demo", { size: schema.number })
69
+ * implements SquareInterface
70
+ * {
71
+ * public get area(): number {
72
+ * return this.size * this.size;
73
+ * }
74
+ * }
75
+ *
76
+ * class Square extends eraseSchemaDetailsSubclassable<SquareInterface>()(SquareInternal) {
77
+ * public static create(sideLength: number): Square {
78
+ * return new (this as TreeNodeSchema as typeof SquareInternal)({ size: sideLength });
79
+ * }
80
+ * }
81
+ *
82
+ * const square = Square.create(10);
83
+ * assert.equal(square.area, 100);
84
+ * ```
85
+ * @privateRemarks
86
+ * See "example" test for an executable version of this example.
87
+ * @alpha
88
+ */
89
+ export function eraseSchemaDetailsSubclassable() {
90
+ return (schema) => schema;
91
+ }
92
+ //# sourceMappingURL=eraseSchemaDetails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eraseSchemaDetails.js","sourceRoot":"","sources":["../../../src/simple-tree/api/eraseSchemaDetails.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,UAAU,kBAAkB;IAYjC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,MAAe,CAAC;AACpC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,8BAA8B;IAY7C,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,MAAe,CAAC;AACpC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tTreeNode,\n\tTreeNodeSchema,\n\tNodeKind,\n\tTreeNodeSchemaClass,\n\tWithType,\n} from \"../core/index.js\";\n\n/**\n * Type-erase details of a schema.\n *\n * @typeParam TNode - The type to narrow the node to.\n * Typically {@link TreeNode} intersected with the public interface for the component.\n * @typeParam ExtraSchemaProperties - Properties of the schema (statics on the schema class) to retain in addition to the basic {@link TreeNodeSchema}.\n * Typically includes at least one static factory method for creating nodes.\n * @remarks\n * This can be used to type erase the details of a schema including the node's type (such as its fields and APIs for modifying those fields).\n * This is intended for use on component boundaries to support encapsulation of implementation details, including the exact schema.\n *\n * This is best applied to a top level \"component node\" which wraps the actual component content (in a single required object node field) allowing more cases of schema evolution to be carried out as implementation details of the component.\n *\n * Since this type-erases the schema details, the remaining API will need to provide ways to construct instances of the node and access its contents.\n * Typically construction is done via static functions on the schema which can be included in `ExtraSchemaProperties`,\n * and access to contents is done via properties of TNode (usually methods).\n *\n * @example\n * ```typescript\n * const schema = new SchemaFactory(\"com.example\");\n *\n * interface SquareNode {\n * \treadonly area: number;\n * }\n *\n * interface SquareSchema {\n * \tcreate(sideLength: number): Square;\n * }\n *\n * class SquareInternal\n * \textends schema.object(\"Demo\", { hidden: schema.number })\n * \timplements SquareNode\n * {\n * \tpublic get area(): number {\n * \t\treturn this.hidden * this.hidden;\n * \t}\n *\n * \tpublic static create(sideLength: number): SquareInternal {\n * \t\treturn new SquareInternal({ hidden: sideLength });\n * \t}\n * }\n *\n * const Square = eraseSchemaDetails<Square, SquareSchema>()(SquareInternal);\n * type Square = SquareNode & TreeNode & WithType<\"com.example.Demo\">;\n * ```\n * @privateRemarks\n * See \"example\" test for an executable version of this example.\n * @alpha\n */\nexport function eraseSchemaDetails<TNode, ExtraSchemaProperties = unknown>(): <\n\tT extends ExtraSchemaProperties & TreeNodeSchema<string, NodeKind, TNode & TreeNode>,\n>(\n\tschema: T,\n) => ExtraSchemaProperties &\n\tTreeNodeSchema<\n\t\tT[\"identifier\"],\n\t\tNodeKind,\n\t\tTNode & TreeNode & WithType<T[\"identifier\"]>,\n\t\tnever,\n\t\tfalse\n\t> {\n\treturn (schema) => schema as never;\n}\n\n/**\n * Like {@link eraseSchemaDetails} but allows the returned schema to be subclassed.\n * @example\n * ```typescript\n * const schema = new SchemaFactory(\"com.example\");\n *\n * interface SquareInterface {\n * \treadonly area: number;\n * }\n *\n * class SquareInternal\n * \textends schema.object(\"Demo\", { size: schema.number })\n * \timplements SquareInterface\n * {\n * \tpublic get area(): number {\n * \t\treturn this.size * this.size;\n * \t}\n * }\n *\n * class Square extends eraseSchemaDetailsSubclassable<SquareInterface>()(SquareInternal) {\n * \tpublic static create(sideLength: number): Square {\n * \t\treturn new (this as TreeNodeSchema as typeof SquareInternal)({ size: sideLength });\n * \t}\n * }\n *\n * const square = Square.create(10);\n * assert.equal(square.area, 100);\n * ```\n * @privateRemarks\n * See \"example\" test for an executable version of this example.\n * @alpha\n */\nexport function eraseSchemaDetailsSubclassable<TNode, ExtraSchemaProperties = unknown>(): <\n\tT extends ExtraSchemaProperties & TreeNodeSchemaClass<string, NodeKind, TNode & TreeNode>,\n>(\n\tschema: T,\n) => ExtraSchemaProperties &\n\tTreeNodeSchemaClass<\n\t\tT[\"identifier\"],\n\t\tNodeKind,\n\t\tTNode & TreeNode & WithType<T[\"identifier\"]>,\n\t\tnever,\n\t\tfalse\n\t> {\n\treturn (schema) => schema as never;\n}\n"]}
@@ -10,6 +10,7 @@ export { type SchemaStatics, schemaStatics } from "./schemaStatics.js";
10
10
  export { SchemaFactory, scoped, type ScopedSchemaName, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, type SchemaFactory_base, } from "./schemaFactory.js";
11
11
  export { SchemaFactoryBeta, type SchemaStaticsBeta } from "./schemaFactoryBeta.js";
12
12
  export { SchemaFactoryAlpha } from "./schemaFactoryAlpha.js";
13
+ export { eraseSchemaDetails, eraseSchemaDetailsSubclassable, } from "./eraseSchemaDetails.js";
13
14
  export type { ValidateRecursiveSchema, FixRecursiveArraySchema, ValidateRecursiveSchemaTemplate, FixRecursiveRecursionLimit, } from "./schemaFactoryRecursive.js";
14
15
  export { allowUnused } from "./schemaFactoryRecursive.js";
15
16
  export { adaptEnum, enumFromStrings, singletonSchema, } from "./schemaCreationUtilities.js";
@@ -29,7 +30,7 @@ export { borrowCursorFromTreeNodeOrValue, exportConcise, importConcise, type Nod
29
30
  export { createSimpleTreeIndex, type SimpleTreeIndex } from "./simpleTreeIndex.js";
30
31
  export { createIdentifierIndex, type IdentifierIndex, } from "./identifierIndex.js";
31
32
  export { extractPersistedSchema, comparePersistedSchema, } from "./storedSchema.js";
32
- export { type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, } from "./transactionTypes.js";
33
+ export { type TransactionConstraint, type TransactionConstraintAlpha, type NodeInDocumentConstraint, type NoChangeConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, } from "./transactionTypes.js";
33
34
  export { generateSchemaFromSimpleSchema } from "./schemaFromSimple.js";
34
35
  export type { TreeChangeEvents } from "./treeChangeEvents.js";
35
36
  export { incrementalEncodingPolicyForAllowedTypes, incrementalSummaryHint, } from "./incrementalAllowedTypes.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,sBAAsB,EACtB,yBAAyB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACX,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,yBAAyB,EACzB,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,UAAU,GACV,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,KAAK,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACN,aAAa,EACb,MAAM,EACN,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,K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,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACN,wCAAwC,EACxC,sBAAsB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,iCAAiC,EACjC,iCAAiC,GACjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,iCAAiC,EACjC,iCAAiC,EACjC,kBAAkB,GAClB,MAAM,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,sBAAsB,EACtB,yBAAyB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACX,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,yBAAyB,EACzB,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,UAAU,GACV,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,KAAK,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACN,aAAa,EACb,MAAM,EACN,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAClB,8BAA8B,GAC9B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,uBAAuB,EACvB,uBAAuB,EACvB,+BAA+B,EAC/B,0BAA0B,GAC1B,MAAM,6BAA6B,CAAC;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AM,mCAAmC,CAAC"}
@@ -8,6 +8,7 @@ export { schemaStatics } from "./schemaStatics.js";
8
8
  export { SchemaFactory, scoped, } from "./schemaFactory.js";
9
9
  export { SchemaFactoryBeta } from "./schemaFactoryBeta.js";
10
10
  export { SchemaFactoryAlpha } from "./schemaFactoryAlpha.js";
11
+ export { eraseSchemaDetails, eraseSchemaDetailsSubclassable, } from "./eraseSchemaDetails.js";
11
12
  export { allowUnused } from "./schemaFactoryRecursive.js";
12
13
  export { adaptEnum, enumFromStrings, singletonSchema, } from "./schemaCreationUtilities.js";
13
14
  export { getIdentifierFromNode, getPropertyKeyFromStoredKey, getStoredKey, treeNodeApi, tryGetSchema, } from "./treeNodeApi.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACN,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC;AAc5B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAsB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACN,aAAa,EACb,MAAM,GAON,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAA0B,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,qBAAqB,EACrB,2BAA2B,EAC3B,YAAY,EACZ,WAAW,EAEX,YAAY,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAEN,eAAe,GAEf,MAAM,iBAAiB,CAAC;AAmBzB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAiB3E,OAAO,EAGN,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEN,sBAAsB,EAGtB,sBAAsB,EACtB,cAAc,EAEd,kBAAkB,GAElB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEN,iBAAiB,EACjB,yBAAyB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,+BAA+B,EAC/B,aAAa,EACb,aAAa,EAEb,QAAQ,GAER,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAwB,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACN,qBAAqB,GAErB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,sBAAsB,EACtB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAUN,QAAQ,GACR,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EACN,wCAAwC,EACxC,sBAAsB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,iCAAiC,EACjC,iCAAiC,GACjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,iCAAiC,EACjC,iCAAiC,EACjC,kBAAkB,GAClB,MAAM,mCAAmC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tITreeViewConfiguration,\n\tITreeConfigurationOptions,\n} from \"./configuration.js\";\nexport {\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n} from \"./configuration.js\";\nexport type {\n\tITree,\n\tTreeView,\n\tViewableTree,\n\tTreeViewEvents,\n\tSchemaCompatibilityStatus,\n\tTreeViewAlpha,\n\tTreeViewBeta,\n\tTreeBranch,\n\tTreeBranchAlpha,\n\tTreeBranchEvents,\n\tITreeAlpha,\n} from \"./tree.js\";\nexport { asTreeViewAlpha } from \"./tree.js\";\nexport { type SchemaStatics, schemaStatics } from \"./schemaStatics.js\";\nexport {\n\tSchemaFactory,\n\tscoped,\n\ttype ScopedSchemaName,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype SchemaFactory_base,\n} from \"./schemaFactory.js\";\nexport { SchemaFactoryBeta, type SchemaStaticsBeta } from \"./schemaFactoryBeta.js\";\nexport { SchemaFactoryAlpha } from \"./schemaFactoryAlpha.js\";\nexport type {\n\tValidateRecursiveSchema,\n\tFixRecursiveArraySchema,\n\tValidateRecursiveSchemaTemplate,\n\tFixRecursiveRecursionLimit,\n} from \"./schemaFactoryRecursive.js\";\nexport { allowUnused } from \"./schemaFactoryRecursive.js\";\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n} from \"./schemaCreationUtilities.js\";\nexport {\n\tgetIdentifierFromNode,\n\tgetPropertyKeyFromStoredKey,\n\tgetStoredKey,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\ttryGetSchema,\n} from \"./treeNodeApi.js\";\nexport { createFromCursor } from \"./create.js\";\nexport {\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n} from \"./dirtyIndex.js\";\nexport {\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n} from \"./jsonSchema.js\";\nexport type { TreeSchemaEncodingOptions } from \"./getJsonSchema.js\";\nexport { getJsonSchema } from \"./getJsonSchema.js\";\nexport { getSimpleSchema } from \"./getSimpleSchema.js\";\nexport { SchemaCompatibilityTester } from \"./schemaCompatibilityTester.js\";\nexport type {\n\tUnenforced,\n\tFieldSchemaAlphaUnsafe,\n\tArrayNodeCustomizableSchemaUnsafe,\n\tMapNodeCustomizableSchemaUnsafe,\n\tSystem_Unsafe,\n\tTreeRecordNodeUnsafe,\n\tUnannotateAllowedTypeUnsafe,\n\tAnnotatedAllowedTypeUnsafe,\n\tAnnotatedAllowedTypesUnsafe,\n\tAllowedTypesFullUnsafe,\n\tAllowedTypesFullFromMixedUnsafe,\n\tUnannotateAllowedTypesListUnsafe,\n\tAnnotateAllowedTypesListUnsafe,\n} from \"./typesUnsafe.js\";\n\nexport {\n\ttype VerboseTreeNode,\n\ttype VerboseTree,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\treplaceVerboseTreeHandles,\n} from \"./verboseTree.js\";\n\nexport {\n\ttype TreeEncodingOptions,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\treplaceHandles,\n\ttype HandleConverter,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n} from \"./customTree.js\";\n\nexport {\n\ttype ConciseTree,\n\tconciseFromCursor,\n\treplaceConciseTreeHandles,\n} from \"./conciseTree.js\";\n\nexport {\n\tborrowCursorFromTreeNodeOrValue,\n\texportConcise,\n\timportConcise,\n\ttype NodeChangedData,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n} from \"./treeBeta.js\";\nexport { createSimpleTreeIndex, type SimpleTreeIndex } from \"./simpleTreeIndex.js\";\nexport {\n\tcreateIdentifierIndex,\n\ttype IdentifierIndex,\n} from \"./identifierIndex.js\";\n\nexport {\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n} from \"./storedSchema.js\";\n\nexport {\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n} from \"./transactionTypes.js\";\n\nexport { generateSchemaFromSimpleSchema } from \"./schemaFromSimple.js\";\nexport type { TreeChangeEvents } from \"./treeChangeEvents.js\";\nexport {\n\tincrementalEncodingPolicyForAllowedTypes,\n\tincrementalSummaryHint,\n} from \"./incrementalAllowedTypes.js\";\nexport {\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n} from \"./simpleSchemaCodec.js\";\nexport {\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n} from \"./snapshotCompatibilityChecker.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACN,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC;AAc5B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAsB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACN,aAAa,EACb,MAAM,GAON,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAA0B,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAClB,8BAA8B,GAC9B,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EACN,SAAS,EACT,eAAe,EACf,eA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AAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tITreeViewConfiguration,\n\tITreeConfigurationOptions,\n} from \"./configuration.js\";\nexport {\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n} from \"./configuration.js\";\nexport type {\n\tITree,\n\tTreeView,\n\tViewableTree,\n\tTreeViewEvents,\n\tSchemaCompatibilityStatus,\n\tTreeViewAlpha,\n\tTreeViewBeta,\n\tTreeBranch,\n\tTreeBranchAlpha,\n\tTreeBranchEvents,\n\tITreeAlpha,\n} from \"./tree.js\";\nexport { asTreeViewAlpha } from \"./tree.js\";\nexport { type SchemaStatics, schemaStatics } from \"./schemaStatics.js\";\nexport {\n\tSchemaFactory,\n\tscoped,\n\ttype ScopedSchemaName,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype SchemaFactory_base,\n} from \"./schemaFactory.js\";\nexport { SchemaFactoryBeta, type SchemaStaticsBeta } from \"./schemaFactoryBeta.js\";\nexport { SchemaFactoryAlpha } from \"./schemaFactoryAlpha.js\";\nexport {\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n} from \"./eraseSchemaDetails.js\";\nexport type {\n\tValidateRecursiveSchema,\n\tFixRecursiveArraySchema,\n\tValidateRecursiveSchemaTemplate,\n\tFixRecursiveRecursionLimit,\n} from \"./schemaFactoryRecursive.js\";\nexport { allowUnused } from \"./schemaFactoryRecursive.js\";\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n} from \"./schemaCreationUtilities.js\";\nexport {\n\tgetIdentifierFromNode,\n\tgetPropertyKeyFromStoredKey,\n\tgetStoredKey,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\ttryGetSchema,\n} from \"./treeNodeApi.js\";\nexport { createFromCursor } from \"./create.js\";\nexport {\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n} from \"./dirtyIndex.js\";\nexport {\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n} from \"./jsonSchema.js\";\nexport type { TreeSchemaEncodingOptions } from \"./getJsonSchema.js\";\nexport { getJsonSchema } from \"./getJsonSchema.js\";\nexport { getSimpleSchema } from \"./getSimpleSchema.js\";\nexport { SchemaCompatibilityTester } from \"./schemaCompatibilityTester.js\";\nexport type {\n\tUnenforced,\n\tFieldSchemaAlphaUnsafe,\n\tArrayNodeCustomizableSchemaUnsafe,\n\tMapNodeCustomizableSchemaUnsafe,\n\tSystem_Unsafe,\n\tTreeRecordNodeUnsafe,\n\tUnannotateAllowedTypeUnsafe,\n\tAnnotatedAllowedTypeUnsafe,\n\tAnnotatedAllowedTypesUnsafe,\n\tAllowedTypesFullUnsafe,\n\tAllowedTypesFullFromMixedUnsafe,\n\tUnannotateAllowedTypesListUnsafe,\n\tAnnotateAllowedTypesListUnsafe,\n} from \"./typesUnsafe.js\";\n\nexport {\n\ttype VerboseTreeNode,\n\ttype VerboseTree,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\treplaceVerboseTreeHandles,\n} from \"./verboseTree.js\";\n\nexport {\n\ttype TreeEncodingOptions,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\treplaceHandles,\n\ttype HandleConverter,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n} from \"./customTree.js\";\n\nexport {\n\ttype ConciseTree,\n\tconciseFromCursor,\n\treplaceConciseTreeHandles,\n} from \"./conciseTree.js\";\n\nexport {\n\tborrowCursorFromTreeNodeOrValue,\n\texportConcise,\n\timportConcise,\n\ttype NodeChangedData,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n} from \"./treeBeta.js\";\nexport { createSimpleTreeIndex, type SimpleTreeIndex } from \"./simpleTreeIndex.js\";\nexport {\n\tcreateIdentifierIndex,\n\ttype IdentifierIndex,\n} from \"./identifierIndex.js\";\n\nexport {\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n} from \"./storedSchema.js\";\n\nexport {\n\ttype TransactionConstraint,\n\ttype TransactionConstraintAlpha,\n\ttype NodeInDocumentConstraint,\n\ttype NoChangeConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n} from \"./transactionTypes.js\";\n\nexport { generateSchemaFromSimpleSchema } from \"./schemaFromSimple.js\";\nexport type { TreeChangeEvents } from \"./treeChangeEvents.js\";\nexport {\n\tincrementalEncodingPolicyForAllowedTypes,\n\tincrementalSummaryHint,\n} from \"./incrementalAllowedTypes.js\";\nexport {\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n} from \"./simpleSchemaCodec.js\";\nexport {\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n} from \"./snapshotCompatibilityChecker.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"schemaFactory.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,OAAO,EACN,KAAK,4BAA4B,EACjC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G;AACH,MAAM,WAAW,iBAAiB,CAAC,GAAG,CAAC,eAAe,GAAG,OAAO;IAC/D;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,GAAG,SAAS,CAAC;CACpE;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB,CAAC,GAAG,CAAC,eAAe,GAAG,OAAO,CACpE,SAAQ,iBAAiB,CAAC,eAAe,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,4BAA4B,GAAG,SAAS,CAAC;CACtE"}
@@ -18,12 +18,15 @@ import { schemaStatics } from "./schemaStatics.js";
18
18
  */
19
19
  export function schemaFromValue(value) {
20
20
  switch (typeof value) {
21
- case "boolean":
21
+ case "boolean": {
22
22
  return booleanSchema;
23
- case "number":
23
+ }
24
+ case "number": {
24
25
  return numberSchema;
25
- case "string":
26
+ }
27
+ case "string": {
26
28
  return stringSchema;
29
+ }
27
30
  case "object": {
28
31
  if (value === null) {
29
32
  return nullSchema;
@@ -31,8 +34,9 @@ export function schemaFromValue(value) {
31
34
  assert(isFluidHandle(value), 0x87e /* invalid TreeValue */);
32
35
  return handleSchema;
33
36
  }
34
- default:
37
+ default: {
35
38
  unreachableCase(value);
39
+ }
36
40
  }
37
41
  }
38
42
  /**
@@ -397,10 +401,7 @@ export class SchemaFactory extends SchemaFactory_base {
397
401
  }
398
402
  export function structuralName(collectionName, allowedTypes) {
399
403
  let inner;
400
- if (!isReadonlyArray(allowedTypes)) {
401
- return structuralName(collectionName, [allowedTypes]);
402
- }
403
- else {
404
+ if (isReadonlyArray(allowedTypes)) {
404
405
  const names = allowedTypes.map((t) => {
405
406
  // Ensure that lazy types (functions) don't slip through here.
406
407
  assert(!isLazy(t), 0x83d /* invalid type provided */);
@@ -414,6 +415,9 @@ export function structuralName(collectionName, allowedTypes) {
414
415
  // The outer `[]` around the result were needed so that a single type name "Any" would not collide with the "any" case which used to exist.
415
416
  inner = JSON.stringify(names);
416
417
  }
418
+ else {
419
+ return structuralName(collectionName, [allowedTypes]);
420
+ }
417
421
  return `${collectionName}<${inner}>`;
418
422
  }
419
423
  export function scoped(factory, name) {