@fluidframework/tree 2.118.1 → 3.0.1

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 (1234) hide show
  1. package/CHANGELOG.md +367 -75
  2. package/README.md +55 -52
  3. package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
  4. package/api-report/tree.alpha.api.md +130 -145
  5. package/api-report/tree.beta.api.md +122 -91
  6. package/api-report/tree.legacy.beta.api.md +122 -91
  7. package/api-report/tree.legacy.public.api.md +26 -43
  8. package/api-report/tree.public.api.md +26 -43
  9. package/dist/api.d.ts +9 -1
  10. package/dist/api.d.ts.map +1 -1
  11. package/dist/api.js +2 -3
  12. package/dist/api.js.map +1 -1
  13. package/dist/codec/codec.d.ts +2 -2
  14. package/dist/codec/codec.d.ts.map +1 -1
  15. package/dist/codec/codec.js +9 -7
  16. package/dist/codec/codec.js.map +1 -1
  17. package/dist/codec/discriminatedUnions.js +1 -0
  18. package/dist/codec/discriminatedUnions.js.map +1 -1
  19. package/dist/codec/versioned/codec.d.ts.map +1 -1
  20. package/dist/codec/versioned/codec.js +4 -2
  21. package/dist/codec/versioned/codec.js.map +1 -1
  22. package/dist/componentApi.d.ts.map +1 -1
  23. package/dist/componentApi.js +20 -17
  24. package/dist/componentApi.js.map +1 -1
  25. package/dist/core/change-family/editBuilder.js +1 -0
  26. package/dist/core/change-family/editBuilder.js.map +1 -1
  27. package/dist/core/forest/editableForest.js +1 -2
  28. package/dist/core/forest/editableForest.js.map +1 -1
  29. package/dist/core/forest/forest.js +3 -3
  30. package/dist/core/forest/forest.js.map +1 -1
  31. package/dist/core/index.d.ts +2 -2
  32. package/dist/core/index.d.ts.map +1 -1
  33. package/dist/core/index.js +9 -5
  34. package/dist/core/index.js.map +1 -1
  35. package/dist/core/rebase/changeRebaser.js +5 -5
  36. package/dist/core/rebase/changeRebaser.js.map +1 -1
  37. package/dist/core/rebase/index.d.ts +1 -1
  38. package/dist/core/rebase/index.d.ts.map +1 -1
  39. package/dist/core/rebase/index.js +2 -1
  40. package/dist/core/rebase/index.js.map +1 -1
  41. package/dist/core/rebase/revisionTagCodec.d.ts +1 -1
  42. package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
  43. package/dist/core/rebase/revisionTagCodec.js +3 -1
  44. package/dist/core/rebase/revisionTagCodec.js.map +1 -1
  45. package/dist/core/rebase/types.d.ts +12 -1
  46. package/dist/core/rebase/types.d.ts.map +1 -1
  47. package/dist/core/rebase/types.js +19 -15
  48. package/dist/core/rebase/types.js.map +1 -1
  49. package/dist/core/rebase/utils.js +9 -10
  50. package/dist/core/rebase/utils.js.map +1 -1
  51. package/dist/core/schema-stored/schema.js +9 -4
  52. package/dist/core/schema-stored/schema.js.map +1 -1
  53. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  54. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  55. package/dist/core/schema-stored/storedSchemaRepository.js +6 -4
  56. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  57. package/dist/core/tree/anchorSet.d.ts +1 -1
  58. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  59. package/dist/core/tree/anchorSet.js +62 -55
  60. package/dist/core/tree/anchorSet.js.map +1 -1
  61. package/dist/core/tree/chunk.js +2 -2
  62. package/dist/core/tree/chunk.js.map +1 -1
  63. package/dist/core/tree/cursor.js +12 -12
  64. package/dist/core/tree/cursor.js.map +1 -1
  65. package/dist/core/tree/deltaUtil.d.ts +34 -9
  66. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  67. package/dist/core/tree/deltaUtil.js +51 -17
  68. package/dist/core/tree/deltaUtil.js.map +1 -1
  69. package/dist/core/tree/detachedFieldIndex.js +23 -21
  70. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  71. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +10 -10
  72. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  73. package/dist/core/tree/detachedFieldIndexCodecCommon.js +1 -2
  74. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  75. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
  76. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  77. package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -2
  78. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  79. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +3 -3
  80. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  81. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +1 -1
  82. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
  83. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  84. package/dist/core/tree/index.d.ts +1 -1
  85. package/dist/core/tree/index.d.ts.map +1 -1
  86. package/dist/core/tree/index.js +7 -4
  87. package/dist/core/tree/index.js.map +1 -1
  88. package/dist/core/tree/mapTree.js +1 -2
  89. package/dist/core/tree/mapTree.js.map +1 -1
  90. package/dist/core/tree/pathTree.js +7 -8
  91. package/dist/core/tree/pathTree.js.map +1 -1
  92. package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
  93. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  94. package/dist/core/tree/sparseTree.js +17 -13
  95. package/dist/core/tree/sparseTree.js.map +1 -1
  96. package/dist/core/tree/treeTextFormat.js +4 -5
  97. package/dist/core/tree/treeTextFormat.js.map +1 -1
  98. package/dist/core/tree/types.js +3 -3
  99. package/dist/core/tree/types.js.map +1 -1
  100. package/dist/core/tree/visitDelta.js +1 -2
  101. package/dist/core/tree/visitDelta.js.map +1 -1
  102. package/dist/core/tree/visitorUtils.js +5 -6
  103. package/dist/core/tree/visitorUtils.js.map +1 -1
  104. package/dist/entrypoints/alpha.d.ts +1 -1
  105. package/dist/entrypoints/alpha.d.ts.map +1 -1
  106. package/dist/entrypoints/alpha.js +6 -4
  107. package/dist/entrypoints/alpha.js.map +1 -1
  108. package/dist/entrypoints/beta.d.ts +1 -1
  109. package/dist/entrypoints/beta.d.ts.map +1 -1
  110. package/dist/entrypoints/beta.js +2 -2
  111. package/dist/entrypoints/beta.js.map +1 -1
  112. package/dist/entrypoints/legacy.d.ts +1 -1
  113. package/dist/entrypoints/legacy.d.ts.map +1 -1
  114. package/dist/entrypoints/legacy.js +2 -2
  115. package/dist/entrypoints/legacy.js.map +1 -1
  116. package/dist/entrypoints/public.d.ts +1 -1
  117. package/dist/entrypoints/public.d.ts.map +1 -1
  118. package/dist/entrypoints/public.js +1 -2
  119. package/dist/entrypoints/public.js.map +1 -1
  120. package/dist/extensibleUnionNode.d.ts.map +1 -1
  121. package/dist/extensibleUnionNode.js +1 -1
  122. package/dist/extensibleUnionNode.js.map +1 -1
  123. package/dist/feature-libraries/changeAtomIdBTree.js +3 -4
  124. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  125. package/dist/feature-libraries/changeAtomIdCodec.js +1 -2
  126. package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
  127. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  128. package/dist/feature-libraries/chunked-forest/basicChunk.js +14 -1
  129. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  130. package/dist/feature-libraries/chunked-forest/chunkTree.js +28 -20
  131. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  132. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  133. package/dist/feature-libraries/chunked-forest/chunkedForest.js +22 -16
  134. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  135. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +9 -11
  136. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  137. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +15 -7
  138. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  139. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +7 -3
  140. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  141. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +3 -2
  142. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  143. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  144. package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -0
  145. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  146. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +33 -17
  147. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  148. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +2 -2
  149. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  150. package/dist/feature-libraries/chunked-forest/codec/format/versions.js +2 -2
  151. package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -1
  152. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +11 -2
  153. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  154. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +5 -6
  155. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  156. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -3
  157. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  158. package/dist/feature-libraries/chunked-forest/sequenceChunk.js +1 -0
  159. package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  160. package/dist/feature-libraries/chunked-forest/uniformChunk.js +73 -15
  161. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  162. package/dist/feature-libraries/comparison-forest/comparisonForest.js +79 -79
  163. package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -1
  164. package/dist/feature-libraries/cursorComparator.d.ts +8 -0
  165. package/dist/feature-libraries/cursorComparator.d.ts.map +1 -1
  166. package/dist/feature-libraries/cursorComparator.js +43 -10
  167. package/dist/feature-libraries/cursorComparator.js.map +1 -1
  168. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
  169. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  170. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +2 -2
  171. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  172. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +2 -0
  173. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  174. package/dist/feature-libraries/deltaUtils.js +2 -3
  175. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  176. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +2 -0
  177. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  178. package/dist/feature-libraries/editableTreeBinder.js +1 -2
  179. package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
  180. package/dist/feature-libraries/flex-tree/context.js +19 -3
  181. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  182. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +2 -2
  183. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  184. package/dist/feature-libraries/flex-tree/lazyEntity.js +14 -14
  185. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  186. package/dist/feature-libraries/flex-tree/lazyField.js +28 -30
  187. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  188. package/dist/feature-libraries/flex-tree/lazyNode.js +24 -23
  189. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  190. package/dist/feature-libraries/flex-tree/observer.js +2 -2
  191. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  192. package/dist/feature-libraries/flex-tree/utilities.js +5 -5
  193. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  194. package/dist/feature-libraries/forest-summary/forestSummarizer.js +122 -117
  195. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  196. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +49 -32
  197. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  198. package/dist/feature-libraries/forest-summary/summaryTypes.js +2 -3
  199. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  200. package/dist/feature-libraries/indexing/anchorTreeIndex.js +35 -31
  201. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  202. package/dist/feature-libraries/mapTreeCursor.js +6 -7
  203. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  204. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -3
  205. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  206. package/dist/feature-libraries/modular-schema/comparison.js +6 -7
  207. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  208. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -4
  209. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  210. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -12
  211. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  212. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +63 -10
  213. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  214. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +3 -3
  215. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  216. package/dist/feature-libraries/modular-schema/fieldKind.js +10 -0
  217. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  218. package/dist/feature-libraries/modular-schema/filterEdits.d.ts +13 -0
  219. package/dist/feature-libraries/modular-schema/filterEdits.d.ts.map +1 -0
  220. package/dist/feature-libraries/modular-schema/filterEdits.js +51 -0
  221. package/dist/feature-libraries/modular-schema/filterEdits.js.map +1 -0
  222. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  223. package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -4
  224. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  225. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -2
  226. package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
  227. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +2 -2
  228. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  229. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js +1 -2
  230. package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
  231. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  232. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  233. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  234. package/dist/feature-libraries/modular-schema/invert.d.ts +1 -1
  235. package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -1
  236. package/dist/feature-libraries/modular-schema/invert.js +5 -30
  237. package/dist/feature-libraries/modular-schema/invert.js.map +1 -1
  238. package/dist/feature-libraries/modular-schema/isNeverTree.js +4 -5
  239. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  240. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +5 -7
  241. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  242. package/dist/feature-libraries/modular-schema/minimizeModularChange.js +459 -10
  243. package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  244. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +14 -15
  245. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  246. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -2
  247. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  248. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +2 -2
  249. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  250. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -10
  251. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  252. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +30 -97
  253. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  254. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +9 -9
  255. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  256. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +4 -4
  257. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +1 -2
  258. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  259. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +13 -1
  260. package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -1
  261. package/dist/feature-libraries/modular-schema/modularChangeUtils.js +115 -12
  262. package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -1
  263. package/dist/feature-libraries/modular-schema/prune.d.ts +2 -3
  264. package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -1
  265. package/dist/feature-libraries/modular-schema/prune.js +25 -8
  266. package/dist/feature-libraries/modular-schema/prune.js.map +1 -1
  267. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -3
  268. package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  269. package/dist/feature-libraries/node-identifier/nodeIdentifier.js +2 -2
  270. package/dist/feature-libraries/node-identifier/nodeIdentifier.js.map +1 -1
  271. package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js +3 -3
  272. package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
  273. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  274. package/dist/feature-libraries/object-forest/objectForest.js +274 -267
  275. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  276. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  277. package/dist/feature-libraries/optional-field/optionalField.js +27 -35
  278. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  279. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +7 -7
  280. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  281. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +8 -8
  282. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  283. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +1 -2
  284. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  285. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  286. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +1 -2
  287. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  288. package/dist/feature-libraries/schema-index/schemaSummarizer.js +3 -0
  289. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  290. package/dist/feature-libraries/schemaChecker.js +5 -5
  291. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  292. package/dist/feature-libraries/sequence-field/compose.js +8 -2
  293. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  294. package/dist/feature-libraries/sequence-field/filterEdits.d.ts +3 -3
  295. package/dist/feature-libraries/sequence-field/filterEdits.d.ts.map +1 -1
  296. package/dist/feature-libraries/sequence-field/filterEdits.js +29 -11
  297. package/dist/feature-libraries/sequence-field/filterEdits.js.map +1 -1
  298. package/dist/feature-libraries/sequence-field/formatV1.d.ts +102 -102
  299. package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  300. package/dist/feature-libraries/sequence-field/formatV2.d.ts +79 -79
  301. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  302. package/dist/feature-libraries/sequence-field/formatV3.d.ts +56 -56
  303. package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  304. package/dist/feature-libraries/sequence-field/invert.js +1 -2
  305. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  306. package/dist/feature-libraries/sequence-field/markListFactory.js +3 -4
  307. package/dist/feature-libraries/sequence-field/markListFactory.js.map +1 -1
  308. package/dist/feature-libraries/sequence-field/markQueue.js +4 -2
  309. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  310. package/dist/feature-libraries/sequence-field/moveEffectTable.js +9 -9
  311. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  312. package/dist/feature-libraries/sequence-field/prune.js +1 -2
  313. package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
  314. package/dist/feature-libraries/sequence-field/rebase.js +7 -2
  315. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  316. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +1 -2
  317. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
  318. package/dist/feature-libraries/sequence-field/replaceRevisions.js +1 -2
  319. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  320. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +2 -3
  321. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  322. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +1 -2
  323. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  324. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  325. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +9 -9
  326. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  327. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -2
  328. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  329. package/dist/feature-libraries/sequence-field/utils.d.ts +2 -2
  330. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  331. package/dist/feature-libraries/sequence-field/utils.js +54 -67
  332. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  333. package/dist/feature-libraries/treeCursorUtils.js +19 -15
  334. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  335. package/dist/feature-libraries/treeTextCursor.js +8 -8
  336. package/dist/feature-libraries/treeTextCursor.js.map +1 -1
  337. package/dist/feature-libraries/valueUtilities.js +4 -5
  338. package/dist/feature-libraries/valueUtilities.js.map +1 -1
  339. package/dist/index.d.ts +4 -29
  340. package/dist/index.d.ts.map +1 -1
  341. package/dist/index.js +6 -9
  342. package/dist/index.js.map +1 -1
  343. package/dist/internalTypes.d.ts +1 -1
  344. package/dist/internalTypes.d.ts.map +1 -1
  345. package/dist/internalTypes.js.map +1 -1
  346. package/dist/packageVersion.d.ts +1 -1
  347. package/dist/packageVersion.d.ts.map +1 -1
  348. package/dist/packageVersion.js +1 -1
  349. package/dist/packageVersion.js.map +1 -1
  350. package/dist/serializableDomainSchema.d.ts +1 -1
  351. package/dist/shared-tree/history.d.ts.map +1 -1
  352. package/dist/shared-tree/history.js +32 -13
  353. package/dist/shared-tree/history.js.map +1 -1
  354. package/dist/shared-tree/independentView.d.ts +27 -3
  355. package/dist/shared-tree/independentView.d.ts.map +1 -1
  356. package/dist/shared-tree/independentView.js +36 -7
  357. package/dist/shared-tree/independentView.js.map +1 -1
  358. package/dist/shared-tree/index.d.ts +2 -1
  359. package/dist/shared-tree/index.d.ts.map +1 -1
  360. package/dist/shared-tree/index.js +6 -2
  361. package/dist/shared-tree/index.js.map +1 -1
  362. package/dist/shared-tree/isAuditableFromOutcome.js +1 -2
  363. package/dist/shared-tree/isAuditableFromOutcome.js.map +1 -1
  364. package/dist/shared-tree/schematizeTree.js +3 -4
  365. package/dist/shared-tree/schematizeTree.js.map +1 -1
  366. package/dist/shared-tree/schematizingTreeView.d.ts +2 -2
  367. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  368. package/dist/shared-tree/schematizingTreeView.js +59 -26
  369. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  370. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  371. package/dist/shared-tree/sharedTree.js +28 -19
  372. package/dist/shared-tree/sharedTree.js.map +1 -1
  373. package/dist/shared-tree/sharedTreeChangeCodecs.js +3 -3
  374. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  375. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  376. package/dist/shared-tree/sharedTreeChangeEnricher.js +12 -4
  377. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  378. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  379. package/dist/shared-tree/sharedTreeChangeFamily.js +11 -8
  380. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  381. package/dist/shared-tree/sharedTreeChangeFormat.js +2 -3
  382. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  383. package/dist/shared-tree/sharedTreeEditBuilder.js +2 -0
  384. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  385. package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
  386. package/dist/shared-tree/transactionMinimize.js +2 -1
  387. package/dist/shared-tree/transactionMinimize.js.map +1 -1
  388. package/dist/shared-tree/transactionPostProcessor.js +2 -3
  389. package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
  390. package/dist/shared-tree/tree.js +2 -2
  391. package/dist/shared-tree/tree.js.map +1 -1
  392. package/dist/shared-tree/treeAlpha.d.ts +5 -16
  393. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  394. package/dist/shared-tree/treeAlpha.js +18 -11
  395. package/dist/shared-tree/treeAlpha.js.map +1 -1
  396. package/{lib/simple-tree/api → dist/shared-tree}/treeBeta.d.ts +8 -65
  397. package/dist/shared-tree/treeBeta.d.ts.map +1 -0
  398. package/dist/shared-tree/treeBeta.js +70 -0
  399. package/dist/shared-tree/treeBeta.js.map +1 -0
  400. package/dist/shared-tree/treeCheckout.d.ts +5 -0
  401. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  402. package/dist/shared-tree/treeCheckout.js +986 -907
  403. package/dist/shared-tree/treeCheckout.js.map +1 -1
  404. package/dist/shared-tree/unhydratedTreeContext.js +3 -4
  405. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  406. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  407. package/dist/shared-tree-core/branch.js +24 -20
  408. package/dist/shared-tree-core/branch.js.map +1 -1
  409. package/dist/shared-tree-core/branchCommitCounter.js +35 -32
  410. package/dist/shared-tree-core/branchCommitCounter.js.map +1 -1
  411. package/dist/shared-tree-core/branchCommitEnricher.js +9 -8
  412. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  413. package/dist/shared-tree-core/branchIdCodec.js +2 -3
  414. package/dist/shared-tree-core/branchIdCodec.js.map +1 -1
  415. package/dist/shared-tree-core/customMetadataCodec.js +2 -3
  416. package/dist/shared-tree-core/customMetadataCodec.js.map +1 -1
  417. package/dist/shared-tree-core/customMetadataFormat.d.ts.map +1 -1
  418. package/dist/shared-tree-core/defaultResubmitMachine.js +11 -9
  419. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  420. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  421. package/dist/shared-tree-core/editManager.js +73 -44
  422. package/dist/shared-tree-core/editManager.js.map +1 -1
  423. package/dist/shared-tree-core/editManagerCodecs.js +3 -3
  424. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  425. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  426. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  427. package/dist/shared-tree-core/editManagerCodecsCommons.js +33 -36
  428. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  429. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -2
  430. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  431. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -2
  432. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  433. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +11 -11
  434. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  435. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +5 -4
  436. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  437. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +10 -9
  438. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  439. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  440. package/dist/shared-tree-core/editManagerSummarizer.js +6 -1
  441. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  442. package/dist/shared-tree-core/messageCodecV1ToV4.js +1 -2
  443. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  444. package/dist/shared-tree-core/messageCodecVSharedBranches.js +1 -2
  445. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  446. package/dist/shared-tree-core/messageCodecs.js +3 -3
  447. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  448. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
  449. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  450. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +3 -2
  451. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  452. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  453. package/dist/shared-tree-core/sharedTreeCore.js +44 -22
  454. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  455. package/dist/shared-tree-core/summaryTypes.js +2 -2
  456. package/dist/shared-tree-core/summaryTypes.js.map +1 -1
  457. package/dist/shared-tree-core/transaction.js +36 -39
  458. package/dist/shared-tree-core/transaction.js.map +1 -1
  459. package/dist/shared-tree-core/versionedSummarizer.js +4 -0
  460. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
  461. package/dist/simple-tree/api/cloneTree.d.ts +11 -0
  462. package/dist/simple-tree/api/cloneTree.d.ts.map +1 -0
  463. package/dist/simple-tree/api/cloneTree.js +31 -0
  464. package/dist/simple-tree/api/cloneTree.js.map +1 -0
  465. package/dist/simple-tree/api/conciseTree.js +2 -3
  466. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  467. package/dist/simple-tree/api/configuration.js +21 -2
  468. package/dist/simple-tree/api/configuration.js.map +1 -1
  469. package/dist/simple-tree/api/create.js +2 -3
  470. package/dist/simple-tree/api/create.js.map +1 -1
  471. package/dist/simple-tree/api/customTree.js +6 -6
  472. package/dist/simple-tree/api/customTree.js.map +1 -1
  473. package/dist/simple-tree/api/dirtyIndex.js +1 -2
  474. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  475. package/dist/simple-tree/api/discrepancies.js +2 -3
  476. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  477. package/dist/simple-tree/api/eraseSchemaDetails.js +2 -3
  478. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  479. package/dist/simple-tree/api/getJsonSchema.js +1 -2
  480. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  481. package/dist/simple-tree/api/getSimpleSchema.js +1 -2
  482. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  483. package/dist/simple-tree/api/identifierIndex.js +1 -2
  484. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  485. package/dist/simple-tree/api/incrementalAllowedTypes.js +2 -2
  486. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  487. package/dist/simple-tree/api/index.d.ts +3 -3
  488. package/dist/simple-tree/api/index.d.ts.map +1 -1
  489. package/dist/simple-tree/api/index.js +4 -7
  490. package/dist/simple-tree/api/index.js.map +1 -1
  491. package/dist/simple-tree/api/schemaCompatibilityTester.js +2 -3
  492. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  493. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -7
  494. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  495. package/dist/simple-tree/api/schemaCreationUtilities.js +6 -9
  496. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  497. package/dist/simple-tree/api/schemaFactory.d.ts +4 -9
  498. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  499. package/dist/simple-tree/api/schemaFactory.js +13 -12
  500. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  501. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +20 -22
  502. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  503. package/dist/simple-tree/api/schemaFactoryAlpha.js +78 -81
  504. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  505. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +7 -9
  506. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  507. package/dist/simple-tree/api/schemaFactoryBeta.js +32 -35
  508. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  509. package/dist/simple-tree/api/schemaFactoryRecursive.js +1 -2
  510. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  511. package/dist/simple-tree/api/schemaFromSimple.js +1 -2
  512. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  513. package/dist/simple-tree/api/schemaStatics.d.ts +7 -7
  514. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  515. package/dist/simple-tree/api/simpleSchemaCodec.js +2 -3
  516. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  517. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +2 -3
  518. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  519. package/dist/simple-tree/api/simpleTreeIndex.js +1 -2
  520. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  521. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +46 -2
  522. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  523. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +54 -12
  524. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  525. package/dist/simple-tree/api/storedSchema.js +2 -3
  526. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  527. package/dist/simple-tree/api/transactionTypes.d.ts +4 -4
  528. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  529. package/dist/simple-tree/api/tree.d.ts +80 -61
  530. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  531. package/dist/simple-tree/api/tree.js +3 -5
  532. package/dist/simple-tree/api/tree.js.map +1 -1
  533. package/dist/simple-tree/api/treeChangeEvents.d.ts +16 -4
  534. package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  535. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
  536. package/dist/simple-tree/api/treeChangeEventsBeta.d.ts +209 -0
  537. package/dist/simple-tree/api/treeChangeEventsBeta.d.ts.map +1 -0
  538. package/dist/simple-tree/api/{treeAlpha.js → treeChangeEventsBeta.js} +1 -1
  539. package/dist/simple-tree/api/treeChangeEventsBeta.js.map +1 -0
  540. package/dist/simple-tree/api/treeNodeApi.d.ts +1 -75
  541. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  542. package/dist/simple-tree/api/treeNodeApi.js +7 -7
  543. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  544. package/dist/simple-tree/api/typesUnsafe.d.ts +8 -6
  545. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  546. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  547. package/dist/simple-tree/api/verboseTree.js +5 -6
  548. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  549. package/dist/simple-tree/core/allowedTypes.js +22 -13
  550. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  551. package/dist/simple-tree/core/context.js +3 -0
  552. package/dist/simple-tree/core/context.js.map +1 -1
  553. package/dist/simple-tree/core/flexList.js +2 -3
  554. package/dist/simple-tree/core/flexList.js.map +1 -1
  555. package/dist/simple-tree/core/getOrCreateNode.js +2 -3
  556. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
  557. package/dist/simple-tree/core/index.d.ts +1 -1
  558. package/dist/simple-tree/core/index.d.ts.map +1 -1
  559. package/dist/simple-tree/core/index.js +2 -2
  560. package/dist/simple-tree/core/index.js.map +1 -1
  561. package/dist/simple-tree/core/treeNode.d.ts +3 -4
  562. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  563. package/dist/simple-tree/core/treeNode.js +31 -32
  564. package/dist/simple-tree/core/treeNode.js.map +1 -1
  565. package/dist/simple-tree/core/treeNodeKernel.js +194 -192
  566. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  567. package/dist/simple-tree/core/treeNodeSchema.js +3 -3
  568. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  569. package/dist/simple-tree/core/treeNodeValid.js +23 -23
  570. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  571. package/dist/simple-tree/core/types.js +1 -2
  572. package/dist/simple-tree/core/types.js.map +1 -1
  573. package/dist/simple-tree/core/unhydratedFlexTree.js +177 -150
  574. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  575. package/dist/simple-tree/core/walkSchema.js +2 -3
  576. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  577. package/dist/simple-tree/core/withType.d.ts +7 -9
  578. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  579. package/dist/simple-tree/core/withType.js +6 -7
  580. package/dist/simple-tree/core/withType.js.map +1 -1
  581. package/dist/simple-tree/createContext.js +2 -3
  582. package/dist/simple-tree/createContext.js.map +1 -1
  583. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  584. package/dist/simple-tree/fieldSchema.js +33 -15
  585. package/dist/simple-tree/fieldSchema.js.map +1 -1
  586. package/dist/simple-tree/getTreeNodeForField.js +1 -2
  587. package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
  588. package/dist/simple-tree/index.d.ts +2 -2
  589. package/dist/simple-tree/index.d.ts.map +1 -1
  590. package/dist/simple-tree/index.js +5 -8
  591. package/dist/simple-tree/index.js.map +1 -1
  592. package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
  593. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  594. package/dist/simple-tree/leafNodeSchema.js +18 -17
  595. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  596. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +3 -2
  597. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  598. package/dist/simple-tree/node-kinds/array/arrayNode.js +31 -33
  599. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  600. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  601. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js +2 -2
  602. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  603. package/dist/simple-tree/node-kinds/common.js +1 -2
  604. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  605. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +6 -6
  606. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  607. package/dist/simple-tree/node-kinds/map/mapNode.js +10 -16
  608. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  609. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  610. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js +2 -2
  611. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  612. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  613. package/dist/simple-tree/node-kinds/object/objectNode.js +27 -28
  614. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  615. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +1 -1
  616. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  617. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js +2 -2
  618. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  619. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  620. package/dist/simple-tree/node-kinds/record/recordNode.js +10 -13
  621. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  622. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -2
  623. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  624. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js +2 -2
  625. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  626. package/dist/simple-tree/prepareForInsertion.js +4 -5
  627. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  628. package/dist/simple-tree/toStoredSchema.js +11 -11
  629. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  630. package/dist/simple-tree/treeSchema.js +1 -2
  631. package/dist/simple-tree/treeSchema.js.map +1 -1
  632. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +3 -4
  633. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  634. package/dist/simple-tree/walkFieldSchema.js +1 -2
  635. package/dist/simple-tree/walkFieldSchema.js.map +1 -1
  636. package/dist/tableSchema.d.ts +2 -87
  637. package/dist/tableSchema.d.ts.map +1 -1
  638. package/dist/tableSchema.js +309 -275
  639. package/dist/tableSchema.js.map +1 -1
  640. package/dist/text/codePointUtils.d.ts +16 -3
  641. package/dist/text/codePointUtils.d.ts.map +1 -1
  642. package/dist/text/codePointUtils.js +24 -13
  643. package/dist/text/codePointUtils.js.map +1 -1
  644. package/dist/text/textDomain.d.ts +7 -1
  645. package/dist/text/textDomain.d.ts.map +1 -1
  646. package/dist/text/textDomain.js +32 -28
  647. package/dist/text/textDomain.js.map +1 -1
  648. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  649. package/dist/text/textDomainFormatted.js +45 -34
  650. package/dist/text/textDomainFormatted.js.map +1 -1
  651. package/dist/text/textDomainFormattedDefault.js +2 -5
  652. package/dist/text/textDomainFormattedDefault.js.map +1 -1
  653. package/dist/treeDataStore.js +2 -3
  654. package/dist/treeDataStore.js.map +1 -1
  655. package/dist/treeFactory.js +7 -7
  656. package/dist/treeFactory.js.map +1 -1
  657. package/dist/util/arrayUtilities.js +5 -6
  658. package/dist/util/arrayUtilities.js.map +1 -1
  659. package/dist/util/bTreeUtils.js +3 -4
  660. package/dist/util/bTreeUtils.js.map +1 -1
  661. package/dist/util/brand.js +6 -5
  662. package/dist/util/brand.js.map +1 -1
  663. package/dist/util/brandedMap.js +2 -3
  664. package/dist/util/brandedMap.js.map +1 -1
  665. package/dist/util/breakable.d.ts.map +1 -1
  666. package/dist/util/breakable.js +7 -4
  667. package/dist/util/breakable.js.map +1 -1
  668. package/dist/util/cloneWithReplacements.js +1 -2
  669. package/dist/util/cloneWithReplacements.js.map +1 -1
  670. package/dist/util/compressedIds.js +29 -7
  671. package/dist/util/compressedIds.js.map +1 -1
  672. package/dist/util/idAllocator.js +3 -3
  673. package/dist/util/idAllocator.js.map +1 -1
  674. package/dist/util/nestedMap.js +15 -17
  675. package/dist/util/nestedMap.js.map +1 -1
  676. package/dist/util/nestedSet.js +2 -3
  677. package/dist/util/nestedSet.js.map +1 -1
  678. package/dist/util/offsetList.js +2 -4
  679. package/dist/util/offsetList.js.map +1 -1
  680. package/dist/util/opaque.js +2 -3
  681. package/dist/util/opaque.js.map +1 -1
  682. package/dist/util/rangeMap.js +6 -2
  683. package/dist/util/rangeMap.js.map +1 -1
  684. package/dist/util/readSnapshotBlob.d.ts.map +1 -1
  685. package/dist/util/referenceCounting.js +1 -0
  686. package/dist/util/referenceCounting.js.map +1 -1
  687. package/dist/util/stackyIterator.js +3 -2
  688. package/dist/util/stackyIterator.js.map +1 -1
  689. package/dist/util/typeUtils.js +1 -2
  690. package/dist/util/typeUtils.js.map +1 -1
  691. package/dist/util/typeboxBrand.js +2 -3
  692. package/dist/util/typeboxBrand.js.map +1 -1
  693. package/dist/util/utils.d.ts +2 -2
  694. package/dist/util/utils.d.ts.map +1 -1
  695. package/dist/util/utils.js +32 -32
  696. package/dist/util/utils.js.map +1 -1
  697. package/lib/api.d.ts +9 -1
  698. package/lib/api.d.ts.map +1 -1
  699. package/lib/api.js.map +1 -1
  700. package/lib/codec/codec.d.ts +2 -2
  701. package/lib/codec/codec.d.ts.map +1 -1
  702. package/lib/codec/codec.js +2 -0
  703. package/lib/codec/codec.js.map +1 -1
  704. package/lib/codec/discriminatedUnions.js +1 -0
  705. package/lib/codec/discriminatedUnions.js.map +1 -1
  706. package/lib/codec/versioned/codec.d.ts.map +1 -1
  707. package/lib/codec/versioned/codec.js +2 -0
  708. package/lib/codec/versioned/codec.js.map +1 -1
  709. package/lib/componentApi.d.ts.map +1 -1
  710. package/lib/componentApi.js +20 -17
  711. package/lib/componentApi.js.map +1 -1
  712. package/lib/core/change-family/editBuilder.js +1 -0
  713. package/lib/core/change-family/editBuilder.js.map +1 -1
  714. package/lib/core/index.d.ts +2 -2
  715. package/lib/core/index.d.ts.map +1 -1
  716. package/lib/core/index.js +2 -2
  717. package/lib/core/index.js.map +1 -1
  718. package/lib/core/rebase/index.d.ts +1 -1
  719. package/lib/core/rebase/index.d.ts.map +1 -1
  720. package/lib/core/rebase/index.js +1 -1
  721. package/lib/core/rebase/index.js.map +1 -1
  722. package/lib/core/rebase/revisionTagCodec.js +3 -1
  723. package/lib/core/rebase/revisionTagCodec.js.map +1 -1
  724. package/lib/core/rebase/types.d.ts +12 -1
  725. package/lib/core/rebase/types.d.ts.map +1 -1
  726. package/lib/core/rebase/types.js +3 -0
  727. package/lib/core/rebase/types.js.map +1 -1
  728. package/lib/core/schema-stored/schema.js +5 -0
  729. package/lib/core/schema-stored/schema.js.map +1 -1
  730. package/lib/core/schema-stored/storedSchemaRepository.js +4 -2
  731. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  732. package/lib/core/tree/anchorSet.js +61 -54
  733. package/lib/core/tree/anchorSet.js.map +1 -1
  734. package/lib/core/tree/deltaUtil.d.ts +34 -9
  735. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  736. package/lib/core/tree/deltaUtil.js +41 -10
  737. package/lib/core/tree/deltaUtil.js.map +1 -1
  738. package/lib/core/tree/detachedFieldIndex.js +23 -21
  739. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  740. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +10 -10
  741. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  742. package/lib/core/tree/detachedFieldIndexCodecV1.js +2 -0
  743. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  744. package/lib/core/tree/detachedFieldIndexCodecV2.js +2 -0
  745. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  746. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +3 -3
  747. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  748. package/lib/core/tree/index.d.ts +1 -1
  749. package/lib/core/tree/index.d.ts.map +1 -1
  750. package/lib/core/tree/index.js +1 -1
  751. package/lib/core/tree/index.js.map +1 -1
  752. package/lib/core/tree/persistedTreeTextFormat.d.ts +4 -4
  753. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  754. package/lib/core/tree/sparseTree.js +15 -11
  755. package/lib/core/tree/sparseTree.js.map +1 -1
  756. package/lib/entrypoints/alpha.d.ts +1 -1
  757. package/lib/entrypoints/alpha.d.ts.map +1 -1
  758. package/lib/entrypoints/alpha.js +1 -1
  759. package/lib/entrypoints/alpha.js.map +1 -1
  760. package/lib/entrypoints/beta.d.ts +1 -1
  761. package/lib/entrypoints/beta.d.ts.map +1 -1
  762. package/lib/entrypoints/beta.js +1 -1
  763. package/lib/entrypoints/beta.js.map +1 -1
  764. package/lib/entrypoints/legacy.d.ts +1 -1
  765. package/lib/entrypoints/legacy.d.ts.map +1 -1
  766. package/lib/entrypoints/legacy.js +1 -1
  767. package/lib/entrypoints/legacy.js.map +1 -1
  768. package/lib/entrypoints/public.d.ts +1 -1
  769. package/lib/entrypoints/public.d.ts.map +1 -1
  770. package/lib/entrypoints/public.js +1 -1
  771. package/lib/entrypoints/public.js.map +1 -1
  772. package/lib/extensibleUnionNode.d.ts.map +1 -1
  773. package/lib/extensibleUnionNode.js +2 -2
  774. package/lib/extensibleUnionNode.js.map +1 -1
  775. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  776. package/lib/feature-libraries/chunked-forest/basicChunk.js +14 -1
  777. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  778. package/lib/feature-libraries/chunked-forest/chunkTree.js +14 -6
  779. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  780. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  781. package/lib/feature-libraries/chunked-forest/chunkedForest.js +18 -12
  782. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  783. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +1 -3
  784. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  785. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +8 -0
  786. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  787. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -0
  788. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  789. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +1 -0
  790. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  791. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  792. package/lib/feature-libraries/chunked-forest/codec/codecs.js +2 -0
  793. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  794. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +28 -12
  795. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  796. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +2 -2
  797. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  798. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +9 -0
  799. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  800. package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -0
  801. package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  802. package/lib/feature-libraries/chunked-forest/uniformChunk.js +71 -13
  803. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  804. package/lib/feature-libraries/comparison-forest/comparisonForest.js +79 -79
  805. package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -1
  806. package/lib/feature-libraries/cursorComparator.d.ts +8 -0
  807. package/lib/feature-libraries/cursorComparator.d.ts.map +1 -1
  808. package/lib/feature-libraries/cursorComparator.js +43 -9
  809. package/lib/feature-libraries/cursorComparator.js.map +1 -1
  810. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +3 -0
  811. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  812. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +2 -0
  813. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  814. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +2 -0
  815. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  816. package/lib/feature-libraries/flex-tree/context.js +19 -3
  817. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  818. package/lib/feature-libraries/flex-tree/lazyEntity.js +12 -12
  819. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  820. package/lib/feature-libraries/flex-tree/lazyField.js +25 -27
  821. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  822. package/lib/feature-libraries/flex-tree/lazyNode.js +22 -21
  823. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  824. package/lib/feature-libraries/forest-summary/forestSummarizer.js +122 -117
  825. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  826. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +49 -32
  827. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  828. package/lib/feature-libraries/indexing/anchorTreeIndex.js +33 -29
  829. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  830. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -12
  831. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  832. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +63 -10
  833. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  834. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  835. package/lib/feature-libraries/modular-schema/fieldKind.js +10 -0
  836. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  837. package/lib/feature-libraries/modular-schema/filterEdits.d.ts +13 -0
  838. package/lib/feature-libraries/modular-schema/filterEdits.d.ts.map +1 -0
  839. package/lib/feature-libraries/modular-schema/filterEdits.js +46 -0
  840. package/lib/feature-libraries/modular-schema/filterEdits.js.map +1 -0
  841. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  842. package/lib/feature-libraries/modular-schema/genericFieldKind.js +5 -2
  843. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  844. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +2 -2
  845. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  846. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  847. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  848. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  849. package/lib/feature-libraries/modular-schema/invert.d.ts +1 -1
  850. package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -1
  851. package/lib/feature-libraries/modular-schema/invert.js +6 -30
  852. package/lib/feature-libraries/modular-schema/invert.js.map +1 -1
  853. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +5 -7
  854. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
  855. package/lib/feature-libraries/modular-schema/minimizeModularChange.js +458 -8
  856. package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
  857. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -10
  858. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  859. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +20 -85
  860. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  861. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +13 -1
  862. package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -1
  863. package/lib/feature-libraries/modular-schema/modularChangeUtils.js +100 -3
  864. package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -1
  865. package/lib/feature-libraries/modular-schema/prune.d.ts +2 -3
  866. package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -1
  867. package/lib/feature-libraries/modular-schema/prune.js +25 -7
  868. package/lib/feature-libraries/modular-schema/prune.js.map +1 -1
  869. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -3
  870. package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
  871. package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js +1 -0
  872. package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
  873. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  874. package/lib/feature-libraries/object-forest/objectForest.js +273 -266
  875. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  876. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  877. package/lib/feature-libraries/optional-field/optionalField.js +24 -32
  878. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  879. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +1 -1
  880. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  881. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +1 -1
  882. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  883. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  884. package/lib/feature-libraries/schema-index/schemaSummarizer.js +3 -0
  885. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  886. package/lib/feature-libraries/sequence-field/compose.js +6 -0
  887. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  888. package/lib/feature-libraries/sequence-field/filterEdits.d.ts +3 -3
  889. package/lib/feature-libraries/sequence-field/filterEdits.d.ts.map +1 -1
  890. package/lib/feature-libraries/sequence-field/filterEdits.js +31 -12
  891. package/lib/feature-libraries/sequence-field/filterEdits.js.map +1 -1
  892. package/lib/feature-libraries/sequence-field/formatV1.d.ts +3 -3
  893. package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  894. package/lib/feature-libraries/sequence-field/formatV2.d.ts +3 -3
  895. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  896. package/lib/feature-libraries/sequence-field/formatV3.d.ts +2 -2
  897. package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
  898. package/lib/feature-libraries/sequence-field/markListFactory.js +3 -4
  899. package/lib/feature-libraries/sequence-field/markListFactory.js.map +1 -1
  900. package/lib/feature-libraries/sequence-field/markQueue.js +4 -2
  901. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  902. package/lib/feature-libraries/sequence-field/rebase.js +6 -0
  903. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  904. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  905. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +9 -9
  906. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  907. package/lib/feature-libraries/sequence-field/utils.d.ts +2 -2
  908. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  909. package/lib/feature-libraries/sequence-field/utils.js +3 -15
  910. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  911. package/lib/feature-libraries/treeCursorUtils.js +13 -9
  912. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  913. package/lib/index.d.ts +4 -29
  914. package/lib/index.d.ts.map +1 -1
  915. package/lib/index.js +2 -17
  916. package/lib/index.js.map +1 -1
  917. package/lib/internalTypes.d.ts +1 -1
  918. package/lib/internalTypes.d.ts.map +1 -1
  919. package/lib/internalTypes.js.map +1 -1
  920. package/lib/packageVersion.d.ts +1 -1
  921. package/lib/packageVersion.d.ts.map +1 -1
  922. package/lib/packageVersion.js +1 -1
  923. package/lib/packageVersion.js.map +1 -1
  924. package/lib/serializableDomainSchema.d.ts +1 -1
  925. package/lib/shared-tree/history.d.ts.map +1 -1
  926. package/lib/shared-tree/history.js +32 -13
  927. package/lib/shared-tree/history.js.map +1 -1
  928. package/lib/shared-tree/independentView.d.ts +27 -3
  929. package/lib/shared-tree/independentView.d.ts.map +1 -1
  930. package/lib/shared-tree/independentView.js +30 -2
  931. package/lib/shared-tree/independentView.js.map +1 -1
  932. package/lib/shared-tree/index.d.ts +2 -1
  933. package/lib/shared-tree/index.d.ts.map +1 -1
  934. package/lib/shared-tree/index.js +2 -1
  935. package/lib/shared-tree/index.js.map +1 -1
  936. package/lib/shared-tree/schematizingTreeView.d.ts +2 -2
  937. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  938. package/lib/shared-tree/schematizingTreeView.js +60 -27
  939. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  940. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  941. package/lib/shared-tree/sharedTree.js +24 -15
  942. package/lib/shared-tree/sharedTree.js.map +1 -1
  943. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  944. package/lib/shared-tree/sharedTreeChangeEnricher.js +12 -4
  945. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  946. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  947. package/lib/shared-tree/sharedTreeChangeFamily.js +6 -3
  948. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  949. package/lib/shared-tree/sharedTreeEditBuilder.js +2 -0
  950. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  951. package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
  952. package/lib/shared-tree/transactionMinimize.js +4 -3
  953. package/lib/shared-tree/transactionMinimize.js.map +1 -1
  954. package/lib/shared-tree/treeAlpha.d.ts +5 -16
  955. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  956. package/lib/shared-tree/treeAlpha.js +13 -6
  957. package/lib/shared-tree/treeAlpha.js.map +1 -1
  958. package/{dist/simple-tree/api → lib/shared-tree}/treeBeta.d.ts +8 -65
  959. package/lib/shared-tree/treeBeta.d.ts.map +1 -0
  960. package/lib/shared-tree/treeBeta.js +64 -0
  961. package/lib/shared-tree/treeBeta.js.map +1 -0
  962. package/lib/shared-tree/treeCheckout.d.ts +5 -0
  963. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  964. package/lib/shared-tree/treeCheckout.js +985 -906
  965. package/lib/shared-tree/treeCheckout.js.map +1 -1
  966. package/lib/shared-tree/unhydratedTreeContext.js +3 -4
  967. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  968. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  969. package/lib/shared-tree-core/branch.js +22 -18
  970. package/lib/shared-tree-core/branch.js.map +1 -1
  971. package/lib/shared-tree-core/branchCommitCounter.js +35 -32
  972. package/lib/shared-tree-core/branchCommitCounter.js.map +1 -1
  973. package/lib/shared-tree-core/branchCommitEnricher.js +9 -8
  974. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  975. package/lib/shared-tree-core/customMetadataFormat.d.ts.map +1 -1
  976. package/lib/shared-tree-core/defaultResubmitMachine.js +11 -9
  977. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  978. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  979. package/lib/shared-tree-core/editManager.js +73 -44
  980. package/lib/shared-tree-core/editManager.js.map +1 -1
  981. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  982. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  983. package/lib/shared-tree-core/editManagerCodecsCommons.js +32 -34
  984. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  985. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  986. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  987. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +4 -4
  988. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  989. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -1
  990. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  991. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +2 -1
  992. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  993. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  994. package/lib/shared-tree-core/editManagerSummarizer.js +6 -1
  995. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  996. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -1
  997. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  998. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +2 -1
  999. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  1000. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  1001. package/lib/shared-tree-core/sharedTreeCore.js +45 -23
  1002. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  1003. package/lib/shared-tree-core/transaction.js +36 -39
  1004. package/lib/shared-tree-core/transaction.js.map +1 -1
  1005. package/lib/shared-tree-core/versionedSummarizer.js +4 -0
  1006. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
  1007. package/lib/simple-tree/api/cloneTree.d.ts +11 -0
  1008. package/lib/simple-tree/api/cloneTree.d.ts.map +1 -0
  1009. package/lib/simple-tree/api/cloneTree.js +28 -0
  1010. package/lib/simple-tree/api/cloneTree.js.map +1 -0
  1011. package/lib/simple-tree/api/configuration.js +19 -0
  1012. package/lib/simple-tree/api/configuration.js.map +1 -1
  1013. package/lib/simple-tree/api/index.d.ts +3 -3
  1014. package/lib/simple-tree/api/index.d.ts.map +1 -1
  1015. package/lib/simple-tree/api/index.js +1 -1
  1016. package/lib/simple-tree/api/index.js.map +1 -1
  1017. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -7
  1018. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  1019. package/lib/simple-tree/api/schemaCreationUtilities.js +1 -3
  1020. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  1021. package/lib/simple-tree/api/schemaFactory.d.ts +4 -9
  1022. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  1023. package/lib/simple-tree/api/schemaFactory.js +9 -8
  1024. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  1025. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +18 -20
  1026. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  1027. package/lib/simple-tree/api/schemaFactoryAlpha.js +78 -81
  1028. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  1029. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +7 -9
  1030. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  1031. package/lib/simple-tree/api/schemaFactoryBeta.js +32 -35
  1032. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  1033. package/lib/simple-tree/api/schemaStatics.d.ts +7 -7
  1034. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  1035. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +46 -2
  1036. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  1037. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +48 -6
  1038. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  1039. package/lib/simple-tree/api/transactionTypes.d.ts +4 -4
  1040. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  1041. package/lib/simple-tree/api/tree.d.ts +80 -61
  1042. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  1043. package/lib/simple-tree/api/tree.js +2 -3
  1044. package/lib/simple-tree/api/tree.js.map +1 -1
  1045. package/lib/simple-tree/api/treeChangeEvents.d.ts +16 -4
  1046. package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  1047. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
  1048. package/lib/simple-tree/api/treeChangeEventsBeta.d.ts +209 -0
  1049. package/lib/simple-tree/api/treeChangeEventsBeta.d.ts.map +1 -0
  1050. package/lib/simple-tree/api/{treeAlpha.js → treeChangeEventsBeta.js} +1 -1
  1051. package/lib/simple-tree/api/treeChangeEventsBeta.js.map +1 -0
  1052. package/lib/simple-tree/api/treeNodeApi.d.ts +1 -75
  1053. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  1054. package/lib/simple-tree/api/treeNodeApi.js +1 -1
  1055. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  1056. package/lib/simple-tree/api/typesUnsafe.d.ts +8 -6
  1057. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  1058. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  1059. package/lib/simple-tree/core/allowedTypes.js +12 -3
  1060. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  1061. package/lib/simple-tree/core/context.js +3 -0
  1062. package/lib/simple-tree/core/context.js.map +1 -1
  1063. package/lib/simple-tree/core/index.d.ts +1 -1
  1064. package/lib/simple-tree/core/index.d.ts.map +1 -1
  1065. package/lib/simple-tree/core/index.js +1 -1
  1066. package/lib/simple-tree/core/index.js.map +1 -1
  1067. package/lib/simple-tree/core/treeNode.d.ts +3 -4
  1068. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  1069. package/lib/simple-tree/core/treeNode.js +29 -30
  1070. package/lib/simple-tree/core/treeNode.js.map +1 -1
  1071. package/lib/simple-tree/core/treeNodeKernel.js +181 -179
  1072. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  1073. package/lib/simple-tree/core/treeNodeValid.js +19 -19
  1074. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  1075. package/lib/simple-tree/core/unhydratedFlexTree.js +173 -146
  1076. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  1077. package/lib/simple-tree/core/withType.d.ts +7 -9
  1078. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  1079. package/lib/simple-tree/core/withType.js +5 -6
  1080. package/lib/simple-tree/core/withType.js.map +1 -1
  1081. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  1082. package/lib/simple-tree/fieldSchema.js +23 -5
  1083. package/lib/simple-tree/fieldSchema.js.map +1 -1
  1084. package/lib/simple-tree/index.d.ts +2 -2
  1085. package/lib/simple-tree/index.d.ts.map +1 -1
  1086. package/lib/simple-tree/index.js +2 -2
  1087. package/lib/simple-tree/index.js.map +1 -1
  1088. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  1089. package/lib/simple-tree/leafNodeSchema.js +16 -15
  1090. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  1091. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +3 -2
  1092. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  1093. package/lib/simple-tree/node-kinds/array/arrayNode.js +28 -32
  1094. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  1095. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  1096. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +6 -6
  1097. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  1098. package/lib/simple-tree/node-kinds/map/mapNode.js +10 -17
  1099. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  1100. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  1101. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  1102. package/lib/simple-tree/node-kinds/object/objectNode.js +25 -28
  1103. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  1104. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +1 -1
  1105. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  1106. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  1107. package/lib/simple-tree/node-kinds/record/recordNode.js +10 -14
  1108. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  1109. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -2
  1110. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  1111. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  1112. package/lib/tableSchema.d.ts +2 -87
  1113. package/lib/tableSchema.d.ts.map +1 -1
  1114. package/lib/tableSchema.js +309 -275
  1115. package/lib/tableSchema.js.map +1 -1
  1116. package/lib/text/codePointUtils.d.ts +16 -3
  1117. package/lib/text/codePointUtils.d.ts.map +1 -1
  1118. package/lib/text/codePointUtils.js +22 -10
  1119. package/lib/text/codePointUtils.js.map +1 -1
  1120. package/lib/text/textDomain.d.ts +7 -1
  1121. package/lib/text/textDomain.d.ts.map +1 -1
  1122. package/lib/text/textDomain.js +21 -17
  1123. package/lib/text/textDomain.js.map +1 -1
  1124. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  1125. package/lib/text/textDomainFormatted.js +43 -32
  1126. package/lib/text/textDomainFormatted.js.map +1 -1
  1127. package/lib/text/textDomainFormattedDefault.js +2 -5
  1128. package/lib/text/textDomainFormattedDefault.js.map +1 -1
  1129. package/lib/util/brand.js +1 -0
  1130. package/lib/util/brand.js.map +1 -1
  1131. package/lib/util/breakable.d.ts.map +1 -1
  1132. package/lib/util/breakable.js +3 -0
  1133. package/lib/util/breakable.js.map +1 -1
  1134. package/lib/util/compressedIds.js +22 -0
  1135. package/lib/util/compressedIds.js.map +1 -1
  1136. package/lib/util/nestedMap.js +2 -4
  1137. package/lib/util/nestedMap.js.map +1 -1
  1138. package/lib/util/offsetList.js +2 -4
  1139. package/lib/util/offsetList.js.map +1 -1
  1140. package/lib/util/rangeMap.js +4 -0
  1141. package/lib/util/rangeMap.js.map +1 -1
  1142. package/lib/util/readSnapshotBlob.d.ts.map +1 -1
  1143. package/lib/util/referenceCounting.js +1 -0
  1144. package/lib/util/referenceCounting.js.map +1 -1
  1145. package/lib/util/stackyIterator.js +3 -2
  1146. package/lib/util/stackyIterator.js.map +1 -1
  1147. package/lib/util/utils.d.ts +2 -2
  1148. package/lib/util/utils.d.ts.map +1 -1
  1149. package/package.json +67 -95
  1150. package/src/api.ts +11 -0
  1151. package/src/core/index.ts +6 -2
  1152. package/src/core/rebase/index.ts +1 -0
  1153. package/src/core/rebase/types.ts +16 -1
  1154. package/src/core/tree/anchorSet.ts +2 -2
  1155. package/src/core/tree/deltaUtil.ts +67 -13
  1156. package/src/core/tree/index.ts +5 -2
  1157. package/src/entrypoints/alpha.ts +19 -21
  1158. package/src/entrypoints/beta.ts +12 -5
  1159. package/src/entrypoints/legacy.ts +12 -5
  1160. package/src/entrypoints/public.ts +1 -5
  1161. package/src/extensibleUnionNode.ts +1 -2
  1162. package/src/feature-libraries/cursorComparator.ts +57 -9
  1163. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +77 -12
  1164. package/src/feature-libraries/modular-schema/filterEdits.ts +108 -0
  1165. package/src/feature-libraries/modular-schema/genericFieldKind.ts +7 -4
  1166. package/src/feature-libraries/modular-schema/index.ts +5 -2
  1167. package/src/feature-libraries/modular-schema/invert.ts +16 -61
  1168. package/src/feature-libraries/modular-schema/minimizeModularChange.ts +831 -10
  1169. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +10 -124
  1170. package/src/feature-libraries/modular-schema/modularChangeUtils.ts +164 -2
  1171. package/src/feature-libraries/modular-schema/prune.ts +52 -10
  1172. package/src/feature-libraries/optional-field/optionalField.ts +30 -42
  1173. package/src/feature-libraries/sequence-field/filterEdits.ts +62 -26
  1174. package/src/feature-libraries/sequence-field/utils.ts +7 -19
  1175. package/src/index.ts +7 -39
  1176. package/src/internalTypes.ts +1 -1
  1177. package/src/packageVersion.ts +1 -1
  1178. package/src/shared-tree/history.ts +41 -19
  1179. package/src/shared-tree/independentView.ts +40 -3
  1180. package/src/shared-tree/index.ts +5 -1
  1181. package/src/shared-tree/schematizingTreeView.ts +2 -2
  1182. package/src/shared-tree/sharedTree.ts +2 -1
  1183. package/src/shared-tree/transactionMinimize.ts +13 -4
  1184. package/src/shared-tree/treeAlpha.ts +17 -31
  1185. package/src/{simple-tree/api → shared-tree}/treeBeta.ts +56 -167
  1186. package/src/shared-tree/treeCheckout.ts +82 -9
  1187. package/src/shared-tree-core/editManager.ts +16 -8
  1188. package/src/shared-tree-core/editManagerCodecsCommons.ts +30 -34
  1189. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +1 -1
  1190. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -2
  1191. package/src/simple-tree/api/cloneTree.ts +47 -0
  1192. package/src/simple-tree/api/index.ts +15 -21
  1193. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
  1194. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +87 -6
  1195. package/src/simple-tree/api/transactionTypes.ts +4 -4
  1196. package/src/simple-tree/api/tree.ts +139 -85
  1197. package/src/simple-tree/api/treeChangeEvents.ts +16 -4
  1198. package/src/simple-tree/api/treeChangeEventsBeta.ts +245 -0
  1199. package/src/simple-tree/api/treeNodeApi.ts +6 -85
  1200. package/src/simple-tree/api/typesUnsafe.ts +8 -6
  1201. package/src/simple-tree/core/index.ts +1 -1
  1202. package/src/simple-tree/core/treeNode.ts +3 -10
  1203. package/src/simple-tree/core/withType.ts +8 -11
  1204. package/src/simple-tree/index.ts +3 -7
  1205. package/src/simple-tree/node-kinds/array/arrayNode.ts +14 -12
  1206. package/src/simple-tree/node-kinds/map/mapNode.ts +14 -15
  1207. package/src/simple-tree/node-kinds/object/objectNode.ts +3 -6
  1208. package/src/simple-tree/node-kinds/record/recordNode.ts +6 -8
  1209. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +2 -1
  1210. package/src/tableSchema.ts +8 -187
  1211. package/src/text/codePointUtils.ts +25 -14
  1212. package/src/text/textDomain.ts +15 -2
  1213. package/src/text/textDomainFormatted.ts +9 -4
  1214. package/tsconfig.json +1 -1
  1215. package/alpha.d.ts +0 -11
  1216. package/beta.d.ts +0 -11
  1217. package/dist/simple-tree/api/treeAlpha.d.ts +0 -126
  1218. package/dist/simple-tree/api/treeAlpha.d.ts.map +0 -1
  1219. package/dist/simple-tree/api/treeAlpha.js.map +0 -1
  1220. package/dist/simple-tree/api/treeBeta.d.ts.map +0 -1
  1221. package/dist/simple-tree/api/treeBeta.js +0 -83
  1222. package/dist/simple-tree/api/treeBeta.js.map +0 -1
  1223. package/docs/main/glossary.md +0 -163
  1224. package/internal.d.ts +0 -11
  1225. package/legacy.d.ts +0 -11
  1226. package/lib/simple-tree/api/treeAlpha.d.ts +0 -126
  1227. package/lib/simple-tree/api/treeAlpha.d.ts.map +0 -1
  1228. package/lib/simple-tree/api/treeAlpha.js.map +0 -1
  1229. package/lib/simple-tree/api/treeBeta.d.ts.map +0 -1
  1230. package/lib/simple-tree/api/treeBeta.js +0 -77
  1231. package/lib/simple-tree/api/treeBeta.js.map +0 -1
  1232. package/src/simple-tree/api/treeAlpha.ts +0 -153
  1233. /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
  1234. /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
@@ -2,11 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { EmptyKey, type TreeType, type Value, type TreeValue, AnchorSet, type DetachedField, type UpPath, type NormalizedUpPath, type INormalizedUpPath, type NormalizedFieldUpPath, type Range, type RangeUpPath, type PlaceUpPath, type PlaceIndex, type NodeIndex, type FieldUpPath, type Anchor, type RootField, type ChildCollection, type ChildLocation, type FieldMapObject, type NodeData, type GenericTreeNode, type JsonableTree, EncodedJsonableTree, rootFieldKey, rootField, type ITreeCursor, CursorLocationType, type ITreeCursorSynchronous, castCursorToSynchronous, type GenericFieldsNode, type AnchorLocator, genericTreeKeys, getGenericTreeField, genericTreeDeleteIfEmpty, getDepth, mapCursorField, mapCursorFields, iterateCursorField, type MapTree, detachedFieldAsKey, keyAsDetachedField, visitDelta, createAnnouncedVisitor, combineVisitors, makeBreakingVisitor, applyDelta, makeDetachedFieldIndex, setGenericTreeField, type DeltaVisitor, type AnnouncedVisitor, SparseNode, getDescendant, compareUpPaths, clonePath, topDownPath, compareFieldUpPaths, forEachNode, forEachNodeInSubtree, forEachField, type PathRootPrefix, deltaForRootInitialization, makeDetachedNodeId, offsetDetachId, emptyDelta, type AnchorSlot, type AnchorNode, anchorSlot, type UpPathDefault, isDetachedUpPath, inCursorField, inCursorNode, type AnchorEvents, type AnchorSetRootEvents, type ProtoNodes, CursorMarker, isCursor, DetachedFieldIndex, type DetachedFieldSummaryData, type ReadOnlyDetachedFieldIndex, type DetachedFieldIndexCheckpoint, type ForestRootId, getDetachedFieldContainingPath, aboveRootPlaceholder, type DeltaRoot, type DeltaMark, type DeltaDetachedNodeId, type DeltaFieldMap, type DeltaDetachedNodeChanges, type DeltaDetachedNodeBuild, type DeltaDetachedNodeDestruction, type DeltaDetachedNodeRename, type DeltaFieldChanges, type ExclusiveMapTree, deepCopyMapTree, type TreeChunk, dummyRoot, cursorChunk, tryGetChunk, type ChunkedCursor, DetachedFieldIndexFormatVersion, detachedFieldIndexCodecBuilder, areDetachedNodeIdsEqual, deltaFieldMapHasVisibleChanges, deltaFieldChangesHaveVisibleChanges, forEachNodeSubsequence, } from "./tree/index.js";
5
+ export { EmptyKey, type TreeType, type Value, type TreeValue, AnchorSet, type DetachedField, type UpPath, type NormalizedUpPath, type INormalizedUpPath, type NormalizedFieldUpPath, type Range, type RangeUpPath, type PlaceUpPath, type PlaceIndex, type NodeIndex, type FieldUpPath, type Anchor, type RootField, type ChildCollection, type ChildLocation, type FieldMapObject, type NodeData, type GenericTreeNode, type JsonableTree, EncodedJsonableTree, rootFieldKey, rootField, type ITreeCursor, CursorLocationType, type ITreeCursorSynchronous, castCursorToSynchronous, type GenericFieldsNode, type AnchorLocator, genericTreeKeys, getGenericTreeField, genericTreeDeleteIfEmpty, getDepth, mapCursorField, mapCursorFields, iterateCursorField, type MapTree, detachedFieldAsKey, keyAsDetachedField, visitDelta, createAnnouncedVisitor, combineVisitors, makeBreakingVisitor, applyDelta, makeDetachedFieldIndex, setGenericTreeField, type DeltaVisitor, type AnnouncedVisitor, SparseNode, getDescendant, compareUpPaths, clonePath, topDownPath, compareFieldUpPaths, forEachNode, forEachNodeInSubtree, forEachField, type PathRootPrefix, deltaForRootInitialization, makeDetachedNodeId, offsetDetachId, offsetDetachIdOpt, subtractDetachedNodeId, emptyDelta, type AnchorSlot, type AnchorNode, anchorSlot, type UpPathDefault, isDetachedUpPath, inCursorField, inCursorNode, type AnchorEvents, type AnchorSetRootEvents, type ProtoNodes, CursorMarker, isCursor, DetachedFieldIndex, type DetachedFieldSummaryData, type ReadOnlyDetachedFieldIndex, type DetachedFieldIndexCheckpoint, type ForestRootId, getDetachedFieldContainingPath, aboveRootPlaceholder, type DeltaRoot, type DeltaMark, type DeltaDetachedNodeId, type DeltaFieldMap, type DeltaDetachedNodeChanges, type DeltaDetachedNodeBuild, type DeltaDetachedNodeDestruction, type DeltaDetachedNodeRename, type DeltaFieldChanges, type ExclusiveMapTree, deepCopyMapTree, type TreeChunk, dummyRoot, cursorChunk, tryGetChunk, type ChunkedCursor, DetachedFieldIndexFormatVersion, detachedFieldIndexCodecBuilder, areDetachedNodeIdsEqual, deltaFieldMapHasChanges, deltaFieldChangesHaveChanges, getDeltaChangeProfile, forEachNodeSubsequence, } from "./tree/index.js";
6
6
  export { TreeNavigationResult, type IEditableForest, type IForestSubscription, type TreeLocation, type FieldLocation, type ForestLocation, type ITreeSubscriptionCursor, ITreeSubscriptionCursorState, type FieldAnchor, moveToDetachedField, type ForestEvents, } from "./forest/index.js";
7
7
  export { type FieldKey, type TreeNodeSchemaIdentifier, type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type TreeStoredSchemaSubscription, type MutableTreeStoredSchema, type FieldKindIdentifier, type FieldKindData, type TreeTypeSet, type TreeStoredSchema, TreeStoredSchemaRepository, schemaDataIsEmpty, type SchemaEvents, forbiddenFieldKindIdentifier, identifierFieldKindIdentifier, storedEmptyFieldSchema, type StoredSchemaCollection, schemaFormatV1, schemaFormatV2, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, decodeFieldSchema, encodeFieldSchemaV1, encodeFieldSchemaV2, storedSchemaDecodeDispatcher, type SchemaAndPolicy, Multiplicity, type SchemaPolicy, SchemaFormatVersion, } from "./schema-stored/index.js";
8
8
  export type { ChangeFamily, ChangeFamilyCodec, ChangeEncodingContext, ChangeDecodingContext, ChangeFamilyEditor, ProcessChangeFn, } from "./change-family/index.js";
9
9
  export { EditBuilder } from "./change-family/index.js";
10
- export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, type ChangeRebaser, findAncestor, findCommonAncestor, type GraphCommit, CommitKind, type CommitMetadata, CommitOutcome, type LocalCommitEvents, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, type LabelTree, type CustomMetadataTree, type TransactionLabels, type RevisionTag, RevisionTagSchema, RevisionTagCodec, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, type TaggedChange, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, flattenCustomMetadata, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, type RevisionMetadataSource, revisionMetadataSourceFromInfo, type RevisionInfo, type EncodedRevisionTag, type EncodedStableId, type EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceChange, type RebaseStats, type RebaseStatsWithDuration, isAncestor, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, comparePartialRevisions, compareChangesetLocalIds, comparePartialChangesetLocalIds, diffHistories, type RevisionReplacer, } from "./rebase/index.js";
10
+ export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, type ChangeRebaser, findAncestor, findCommonAncestor, type GraphCommit, CommitKind, type CommitMetadata, CommitOutcome, type LocalCommitEvents, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, type LabelTree, type CustomMetadataTree, type TransactionLabels, type RevisionTag, RevisionTagSchema, RevisionTagCodec, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, type TaggedChange, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, flattenCustomMetadata, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, type RevisionMetadataSource, revisionMetadataSourceFromInfo, type RevisionInfo, type EncodedRevisionTag, type EncodedStableId, type EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceChange, type RebaseStats, type RebaseStatsWithDuration, isAncestor, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, newChangeAtomIdTransform, comparePartialRevisions, compareChangesetLocalIds, comparePartialChangesetLocalIds, diffHistories, type RevisionReplacer, } from "./rebase/index.js";
11
11
  export { type Revertible, RevertibleStatus, type RevertibleFactory, type RevertibleAlphaFactory, type RevertibleAlpha, type RevertOptionsAlpha, type RevertToOptionsAlpha, } from "./revertible.js";
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,KAAK,WAAW,EAChB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EAC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,YAAY,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,8BAA8B,EAC9B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,UAAU,EACV,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,aAAa,EACb,KAAK,gBAAgB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,GACzB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,mBAAmB,EACnB,Y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xB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,8BAA8B,EAC9B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,UAAU,EACV,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,aAAa,EACb,KAAK,gBAAgB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,GACzB,MAAM,iBAAiB,CAAC"}
package/lib/core/index.js CHANGED
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { EmptyKey, AnchorSet, EncodedJsonableTree, rootFieldKey, rootField, CursorLocationType, castCursorToSynchronous, genericTreeKeys, getGenericTreeField, genericTreeDeleteIfEmpty, getDepth, mapCursorField, mapCursorFields, iterateCursorField, detachedFieldAsKey, keyAsDetachedField, visitDelta, createAnnouncedVisitor, combineVisitors, makeBreakingVisitor, applyDelta, makeDetachedFieldIndex, setGenericTreeField, SparseNode, getDescendant, compareUpPaths, clonePath, topDownPath, compareFieldUpPaths, forEachNode, forEachNodeInSubtree, forEachField, deltaForRootInitialization, makeDetachedNodeId, offsetDetachId, emptyDelta, anchorSlot, isDetachedUpPath, inCursorField, inCursorNode, CursorMarker, isCursor, DetachedFieldIndex, getDetachedFieldContainingPath, aboveRootPlaceholder, deepCopyMapTree, dummyRoot, cursorChunk, tryGetChunk, DetachedFieldIndexFormatVersion, detachedFieldIndexCodecBuilder, areDetachedNodeIdsEqual, deltaFieldMapHasVisibleChanges, deltaFieldChangesHaveVisibleChanges, forEachNodeSubsequence, } from "./tree/index.js";
5
+ export { EmptyKey, AnchorSet, EncodedJsonableTree, rootFieldKey, rootField, CursorLocationType, castCursorToSynchronous, genericTreeKeys, getGenericTreeField, genericTreeDeleteIfEmpty, getDepth, mapCursorField, mapCursorFields, iterateCursorField, detachedFieldAsKey, keyAsDetachedField, visitDelta, createAnnouncedVisitor, combineVisitors, makeBreakingVisitor, applyDelta, makeDetachedFieldIndex, setGenericTreeField, SparseNode, getDescendant, compareUpPaths, clonePath, topDownPath, compareFieldUpPaths, forEachNode, forEachNodeInSubtree, forEachField, deltaForRootInitialization, makeDetachedNodeId, offsetDetachId, offsetDetachIdOpt, subtractDetachedNodeId, emptyDelta, anchorSlot, isDetachedUpPath, inCursorField, inCursorNode, CursorMarker, isCursor, DetachedFieldIndex, getDetachedFieldContainingPath, aboveRootPlaceholder, deepCopyMapTree, dummyRoot, cursorChunk, tryGetChunk, DetachedFieldIndexFormatVersion, detachedFieldIndexCodecBuilder, areDetachedNodeIdsEqual, deltaFieldMapHasChanges, deltaFieldChangesHaveChanges, getDeltaChangeProfile, forEachNodeSubsequence, } from "./tree/index.js";
6
6
  export { TreeNavigationResult, ITreeSubscriptionCursorState, moveToDetachedField, } from "./forest/index.js";
7
7
  export { ValueSchema, TreeNodeStoredSchema, TreeStoredSchemaRepository, schemaDataIsEmpty, forbiddenFieldKindIdentifier, identifierFieldKindIdentifier, storedEmptyFieldSchema, schemaFormatV1, schemaFormatV2, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, decodeFieldSchema, encodeFieldSchemaV1, encodeFieldSchemaV2, storedSchemaDecodeDispatcher, Multiplicity, SchemaFormatVersion, } from "./schema-stored/index.js";
8
8
  export { EditBuilder } from "./change-family/index.js";
9
- export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, findAncestor, findCommonAncestor, CommitKind, CommitOutcome, RevisionTagSchema, RevisionTagCodec, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, flattenCustomMetadata, rebaseBranch, rebaseChange, rebaseChangeOverChanges, revisionMetadataSourceFromInfo, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceChange, isAncestor, newChangeAtomIdRangeMap, comparePartialRevisions, compareChangesetLocalIds, comparePartialChangesetLocalIds, diffHistories, } from "./rebase/index.js";
9
+ export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, findAncestor, findCommonAncestor, CommitKind, CommitOutcome, RevisionTagSchema, RevisionTagCodec, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, flattenCustomMetadata, rebaseBranch, rebaseChange, rebaseChangeOverChanges, revisionMetadataSourceFromInfo, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceChange, isAncestor, newChangeAtomIdRangeMap, newChangeAtomIdTransform, comparePartialRevisions, compareChangesetLocalIds, comparePartialChangesetLocalIds, diffHistories, } from "./rebase/index.js";
10
10
  export { RevertibleStatus, } from "./revertible.js";
11
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;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BAAwB,EACxB,gBAAgB,EAChB,cAAc,EAEd,YAAY,EACZ,kBAAkB,EAElB,UAAU,EAEV,aAAa,EASb,iBAAiB,EACjB,gBAAgB,EAKhB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,YAAY,EAEZ,YAAY,EACZ,uBAAuB,EAEvB,8BAA8B,EAK9B,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,aAAa,EAGb,UAAU,EAEV,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,aAAa,GAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAEN,gBAAgB,GAMhB,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype Value,\n\ttype TreeValue,\n\tAnchorSet,\n\ttype DetachedField,\n\ttype UpPath,\n\ttype NormalizedUpPath,\n\ttype INormalizedUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\ttype FieldUpPath,\n\ttype Anchor,\n\ttype RootField,\n\ttype ChildCollection,\n\ttype ChildLocation,\n\ttype FieldMapObject,\n\ttype NodeData,\n\ttype GenericTreeNode,\n\ttype JsonableTree,\n\tEncodedJsonableTree,\n\trootFieldKey,\n\trootField,\n\ttype ITreeCursor,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\tcastCursorToSynchronous,\n\ttype GenericFieldsNode,\n\ttype AnchorLocator,\n\tgenericTreeKeys,\n\tgetGenericTreeField,\n\tgenericTreeDeleteIfEmpty,\n\tgetDepth,\n\tmapCursorField,\n\tmapCursorFields,\n\titerateCursorField,\n\ttype MapTree,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\tvisitDelta,\n\tcreateAnnouncedVisitor,\n\tcombineVisitors,\n\tmakeBreakingVisitor,\n\tapplyDelta,\n\tmakeDetachedFieldIndex,\n\tsetGenericTreeField,\n\ttype DeltaVisitor,\n\ttype AnnouncedVisitor,\n\tSparseNode,\n\tgetDescendant,\n\tcompareUpPaths,\n\tclonePath,\n\ttopDownPath,\n\tcompareFieldUpPaths,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\ttype PathRootPrefix,\n\tdeltaForRootInitialization,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\temptyDelta,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype UpPathDefault,\n\tisDetachedUpPath,\n\tinCursorField,\n\tinCursorNode,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n\ttype ProtoNodes,\n\tCursorMarker,\n\tisCursor,\n\tDetachedFieldIndex,\n\ttype DetachedFieldSummaryData,\n\ttype ReadOnlyDetachedFieldIndex,\n\ttype DetachedFieldIndexCheckpoint,\n\ttype ForestRootId,\n\tgetDetachedFieldContainingPath,\n\taboveRootPlaceholder,\n\ttype DeltaRoot,\n\ttype DeltaMark,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaFieldMap,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaDetachedNodeDestruction,\n\ttype DeltaDetachedNodeRename,\n\ttype DeltaFieldChanges,\n\ttype ExclusiveMapTree,\n\tdeepCopyMapTree,\n\ttype TreeChunk,\n\tdummyRoot,\n\tcursorChunk,\n\ttryGetChunk,\n\ttype ChunkedCursor,\n\tDetachedFieldIndexFormatVersion,\n\tdetachedFieldIndexCodecBuilder,\n\tareDetachedNodeIdsEqual,\n\tdeltaFieldMapHasVisibleChanges,\n\tdeltaFieldChangesHaveVisibleChanges,\n\tforEachNodeSubsequence,\n} from \"./tree/index.js\";\n\nexport {\n\tTreeNavigationResult,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype TreeLocation,\n\ttype FieldLocation,\n\ttype ForestLocation,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\ttype FieldAnchor,\n\tmoveToDetachedField,\n\ttype ForestEvents,\n} from \"./forest/index.js\";\n\nexport {\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeStoredSchemaSubscription,\n\ttype MutableTreeStoredSchema,\n\ttype FieldKindIdentifier,\n\ttype FieldKindData,\n\ttype TreeTypeSet,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tschemaDataIsEmpty,\n\ttype SchemaEvents,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\tstoredEmptyFieldSchema,\n\ttype StoredSchemaCollection,\n\tschemaFormatV1,\n\tschemaFormatV2,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchemaV1,\n\tencodeFieldSchemaV2,\n\tstoredSchemaDecodeDispatcher,\n\ttype SchemaAndPolicy,\n\tMultiplicity,\n\ttype SchemaPolicy,\n\tSchemaFormatVersion,\n} from \"./schema-stored/index.js\";\n\nexport type {\n\tChangeFamily,\n\tChangeFamilyCodec,\n\tChangeEncodingContext,\n\tChangeDecodingContext,\n\tChangeFamilyEditor,\n\tProcessChangeFn,\n} from \"./change-family/index.js\";\nexport { EditBuilder } from \"./change-family/index.js\";\n\nexport {\n\tareEqualChangeAtomIds,\n\tareEqualChangeAtomIdOpts,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\ttype ChangeRebaser,\n\tfindAncestor,\n\tfindCommonAncestor,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\tCommitOutcome,\n\ttype LocalCommitEvents,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype LabelTree,\n\ttype CustomMetadataTree,\n\ttype TransactionLabels,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\tRevisionTagCodec,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\tSessionIdSchema,\n\tmintCommit,\n\tflattenCustomMetadata,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\ttype RevisionMetadataSource,\n\trevisionMetadataSourceFromInfo,\n\ttype RevisionInfo,\n\ttype EncodedRevisionTag,\n\ttype EncodedStableId,\n\ttype EncodedChangeAtomId,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\tStableIdSchema,\n\tsubtractChangeAtomIds,\n\treplaceChange,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n\tisAncestor,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tcomparePartialRevisions,\n\tcompareChangesetLocalIds,\n\tcomparePartialChangesetLocalIds,\n\tdiffHistories,\n\ttype RevisionReplacer,\n} from \"./rebase/index.js\";\n\nexport {\n\ttype Revertible,\n\tRevertibleStatus,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n\ttype RevertOptionsAlpha,\n\ttype RevertToOptionsAlpha,\n} from \"./revertible.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EAIR,SAAS,EAoBT,mBAAmB,EACnB,YAAY,EACZ,SAAS,EAET,kBAAkB,EAElB,uBAAuB,EAGvB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,QAAQ,EACR,cAAc,EACd,eAAe,EAC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EACf,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,YAAY,EAEZ,YAAY,EACZ,uBAAuB,EAEvB,8BAA8B,EAK9B,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,aAAa,EAGb,UAAU,EAEV,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,aAAa,GAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAEN,gBAAgB,GAMhB,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype Value,\n\ttype TreeValue,\n\tAnchorSet,\n\ttype DetachedField,\n\ttype UpPath,\n\ttype NormalizedUpPath,\n\ttype INormalizedUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\ttype FieldUpPath,\n\ttype Anchor,\n\ttype RootField,\n\ttype ChildCollection,\n\ttype ChildLocation,\n\ttype FieldMapObject,\n\ttype NodeData,\n\ttype GenericTreeNode,\n\ttype JsonableTree,\n\tEncodedJsonableTree,\n\trootFieldKey,\n\trootField,\n\ttype ITreeCursor,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\tcastCursorToSynchronous,\n\ttype GenericFieldsNode,\n\ttype AnchorLocator,\n\tgenericTreeKeys,\n\tgetGenericTreeField,\n\tgenericTreeDeleteIfEmpty,\n\tgetDepth,\n\tmapCursorField,\n\tmapCursorFields,\n\titerateCursorField,\n\ttype MapTree,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\tvisitDelta,\n\tcreateAnnouncedVisitor,\n\tcombineVisitors,\n\tmakeBreakingVisitor,\n\tapplyDelta,\n\tmakeDetachedFieldIndex,\n\tsetGenericTreeField,\n\ttype DeltaVisitor,\n\ttype AnnouncedVisitor,\n\tSparseNode,\n\tgetDescendant,\n\tcompareUpPaths,\n\tclonePath,\n\ttopDownPath,\n\tcompareFieldUpPaths,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\ttype PathRootPrefix,\n\tdeltaForRootInitialization,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\toffsetDetachIdOpt,\n\tsubtractDetachedNodeId,\n\temptyDelta,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype UpPathDefault,\n\tisDetachedUpPath,\n\tinCursorField,\n\tinCursorNode,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n\ttype ProtoNodes,\n\tCursorMarker,\n\tisCursor,\n\tDetachedFieldIndex,\n\ttype DetachedFieldSummaryData,\n\ttype ReadOnlyDetachedFieldIndex,\n\ttype DetachedFieldIndexCheckpoint,\n\ttype ForestRootId,\n\tgetDetachedFieldContainingPath,\n\taboveRootPlaceholder,\n\ttype DeltaRoot,\n\ttype DeltaMark,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaFieldMap,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaDetachedNodeDestruction,\n\ttype DeltaDetachedNodeRename,\n\ttype DeltaFieldChanges,\n\ttype ExclusiveMapTree,\n\tdeepCopyMapTree,\n\ttype TreeChunk,\n\tdummyRoot,\n\tcursorChunk,\n\ttryGetChunk,\n\ttype ChunkedCursor,\n\tDetachedFieldIndexFormatVersion,\n\tdetachedFieldIndexCodecBuilder,\n\tareDetachedNodeIdsEqual,\n\tdeltaFieldMapHasChanges,\n\tdeltaFieldChangesHaveChanges,\n\tgetDeltaChangeProfile,\n\tforEachNodeSubsequence,\n} from \"./tree/index.js\";\n\nexport {\n\tTreeNavigationResult,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype TreeLocation,\n\ttype FieldLocation,\n\ttype ForestLocation,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\ttype FieldAnchor,\n\tmoveToDetachedField,\n\ttype ForestEvents,\n} from \"./forest/index.js\";\n\nexport {\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeStoredSchemaSubscription,\n\ttype MutableTreeStoredSchema,\n\ttype FieldKindIdentifier,\n\ttype FieldKindData,\n\ttype TreeTypeSet,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tschemaDataIsEmpty,\n\ttype SchemaEvents,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\tstoredEmptyFieldSchema,\n\ttype StoredSchemaCollection,\n\tschemaFormatV1,\n\tschemaFormatV2,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchemaV1,\n\tencodeFieldSchemaV2,\n\tstoredSchemaDecodeDispatcher,\n\ttype SchemaAndPolicy,\n\tMultiplicity,\n\ttype SchemaPolicy,\n\tSchemaFormatVersion,\n} from \"./schema-stored/index.js\";\n\nexport type {\n\tChangeFamily,\n\tChangeFamilyCodec,\n\tChangeEncodingContext,\n\tChangeDecodingContext,\n\tChangeFamilyEditor,\n\tProcessChangeFn,\n} from \"./change-family/index.js\";\nexport { EditBuilder } from \"./change-family/index.js\";\n\nexport {\n\tareEqualChangeAtomIds,\n\tareEqualChangeAtomIdOpts,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\ttype ChangeRebaser,\n\tfindAncestor,\n\tfindCommonAncestor,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\tCommitOutcome,\n\ttype LocalCommitEvents,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype LabelTree,\n\ttype CustomMetadataTree,\n\ttype TransactionLabels,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\tRevisionTagCodec,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\tSessionIdSchema,\n\tmintCommit,\n\tflattenCustomMetadata,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\ttype RevisionMetadataSource,\n\trevisionMetadataSourceFromInfo,\n\ttype RevisionInfo,\n\ttype EncodedRevisionTag,\n\ttype EncodedStableId,\n\ttype EncodedChangeAtomId,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\tStableIdSchema,\n\tsubtractChangeAtomIds,\n\treplaceChange,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n\tisAncestor,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tnewChangeAtomIdTransform,\n\tcomparePartialRevisions,\n\tcompareChangesetLocalIds,\n\tcomparePartialChangesetLocalIds,\n\tdiffHistories,\n\ttype RevisionReplacer,\n} from \"./rebase/index.js\";\n\nexport {\n\ttype Revertible,\n\tRevertibleStatus,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n\ttype RevertOptionsAlpha,\n\ttype RevertToOptionsAlpha,\n} from \"./revertible.js\";\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, mintCommit, flattenCustomMetadata, type GraphCommit, CommitKind, type CommitMetadata, CommitOutcome, type LocalCommitEvents, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, type LabelTree, type CustomMetadataTree, type TransactionLabels, type RevisionTag, RevisionTagSchema, type EncodedRevisionTag, type EncodedChangeAtomId, type EncodedStableId, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, comparePartialRevisions, compareChangesetLocalIds, comparePartialChangesetLocalIds, } from "./types.js";
5
+ export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, mintCommit, flattenCustomMetadata, type GraphCommit, CommitKind, type CommitMetadata, CommitOutcome, type LocalCommitEvents, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, type LabelTree, type CustomMetadataTree, type TransactionLabels, type RevisionTag, RevisionTagSchema, type EncodedRevisionTag, type EncodedChangeAtomId, type EncodedStableId, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, newChangeAtomIdTransform, comparePartialRevisions, compareChangesetLocalIds, comparePartialChangesetLocalIds, } from "./types.js";
6
6
  export { RevisionTagCodec } from "./revisionTagCodec.js";
7
7
  export { type ChangeRebaser, type FinalChange, FinalChangeStatus, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, type TaggedChange, type RevisionMetadataSource, type RevisionInfo, type RevisionReplacer, } from "./changeRebaser.js";
8
8
  export { findAncestor, findCommonAncestor, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, revisionMetadataSourceFromInfo, type RebaseStats, type RebaseStatsWithDuration, replaceChange, isAncestor, diffHistories, } from "./utils.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,cAAc,EACnB,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,GAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,8BAA8B,EAC9B,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,aAAa,EACb,UAAU,EACV,aAAa,GACb,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,cAAc,EACnB,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,GAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,8BAA8B,EAC9B,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,aAAa,EACb,UAAU,EACV,aAAa,GACb,MAAM,YAAY,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, mintCommit, flattenCustomMetadata, CommitKind, CommitOutcome, RevisionTagSchema, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, newChangeAtomIdRangeMap, comparePartialRevisions, compareChangesetLocalIds, comparePartialChangesetLocalIds, } from "./types.js";
5
+ export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, mintCommit, flattenCustomMetadata, CommitKind, CommitOutcome, RevisionTagSchema, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, newChangeAtomIdRangeMap, newChangeAtomIdTransform, comparePartialRevisions, compareChangesetLocalIds, comparePartialChangesetLocalIds, } from "./types.js";
6
6
  export { RevisionTagCodec } from "./revisionTagCodec.js";
7
7
  export { FinalChangeStatus, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, } from "./changeRebaser.js";
8
8
  export { findAncestor, findCommonAncestor, rebaseBranch, rebaseChange, rebaseChangeOverChanges, revisionMetadataSourceFromInfo, replaceChange, isAncestor, diffHistories, } from "./utils.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,qBAAqB,EAErB,UAAU,EAEV,aAAa,EASb,iBAAiB,EAOjB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EAErB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,GAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAGN,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,GAKlB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,YAAY,EAEZ,YAAY,EACZ,uBAAuB,EACvB,8BAA8B,EAG9B,aAAa,EACb,UAAU,EACV,aAAa,GACb,MAAM,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tareEqualChangeAtomIds,\n\tareEqualChangeAtomIdOpts,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\tmintCommit,\n\tflattenCustomMetadata,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\tCommitOutcome,\n\ttype LocalCommitEvents,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype LabelTree,\n\ttype CustomMetadataTree,\n\ttype TransactionLabels,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\ttype EncodedRevisionTag,\n\ttype EncodedChangeAtomId,\n\ttype EncodedStableId,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\tSessionIdSchema,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\tStableIdSchema,\n\tsubtractChangeAtomIds,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tcomparePartialRevisions,\n\tcompareChangesetLocalIds,\n\tcomparePartialChangesetLocalIds,\n} from \"./types.js\";\nexport { RevisionTagCodec } from \"./revisionTagCodec.js\";\nexport {\n\ttype ChangeRebaser,\n\ttype FinalChange,\n\tFinalChangeStatus,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\ttype TaggedChange,\n\ttype RevisionMetadataSource,\n\ttype RevisionInfo,\n\ttype RevisionReplacer,\n} from \"./changeRebaser.js\";\nexport {\n\tfindAncestor,\n\tfindCommonAncestor,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\trevisionMetadataSourceFromInfo,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n\treplaceChange,\n\tisAncestor,\n\tdiffHistories,\n} from \"./utils.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,qBAAqB,EAErB,UAAU,EAEV,aAAa,EASb,iBAAiB,EAOjB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EAErB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,GAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAGN,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,GAKlB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,YAAY,EAEZ,YAAY,EACZ,uBAAuB,EACvB,8BAA8B,EAG9B,aAAa,EACb,UAAU,EACV,aAAa,GACb,MAAM,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tareEqualChangeAtomIds,\n\tareEqualChangeAtomIdOpts,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\tmintCommit,\n\tflattenCustomMetadata,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\tCommitOutcome,\n\ttype LocalCommitEvents,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype LabelTree,\n\ttype CustomMetadataTree,\n\ttype TransactionLabels,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\ttype EncodedRevisionTag,\n\ttype EncodedChangeAtomId,\n\ttype EncodedStableId,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\tSessionIdSchema,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\tStableIdSchema,\n\tsubtractChangeAtomIds,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tnewChangeAtomIdTransform,\n\tcomparePartialRevisions,\n\tcompareChangesetLocalIds,\n\tcomparePartialChangesetLocalIds,\n} from \"./types.js\";\nexport { RevisionTagCodec } from \"./revisionTagCodec.js\";\nexport {\n\ttype ChangeRebaser,\n\ttype FinalChange,\n\tFinalChangeStatus,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\ttype TaggedChange,\n\ttype RevisionMetadataSource,\n\ttype RevisionInfo,\n\ttype RevisionReplacer,\n} from \"./changeRebaser.js\";\nexport {\n\tfindAncestor,\n\tfindCommonAncestor,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\trevisionMetadataSourceFromInfo,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n\treplaceChange,\n\tisAncestor,\n\tdiffHistories,\n} from \"./utils.js\";\n"]}
@@ -5,9 +5,11 @@
5
5
  import { assert } from "@fluidframework/core-utils/internal";
6
6
  import { RevisionTagSchema } from "./types.js";
7
7
  export class RevisionTagCodec {
8
+ idCompressor;
9
+ localSessionId;
10
+ encodedSchema = RevisionTagSchema;
8
11
  constructor(idCompressor) {
9
12
  this.idCompressor = idCompressor;
10
- this.encodedSchema = RevisionTagSchema;
11
13
  this.localSessionId = idCompressor.localSessionId;
12
14
  }
13
15
  encode(tag) {
@@ -1 +1 @@
1
- {"version":3,"file":"revisionTagCodec.js","sourceRoot":"","sources":["../../../src/core/rebase/revisionTagCodec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAM7D,OAAO,EAAE,iBAAiB,EAA6C,MAAM,YAAY,CAAC;AAE1F,MAAM,OAAO,gBAAgB;IAM5B,YAAoC,YAA2B;QAA3B,iBAAY,GAAZ,YAAY,CAAe;QAF/C,kBAAa,GAAG,iBAAiB,CAAC;QAGjD,IAAI,CAAC,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC;IACnD,CAAC;IAEM,MAAM,CAAC,GAAgB;QAC7B,OAAO,GAAG,KAAK,MAAM;YACpB,CAAC,CAAC,GAAG;YACL,CAAC,CAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,CAAwB,CAAC;IACtE,CAAC;IACM,MAAM,CAAC,GAAuB,EAAE,OAA8B;QACpE,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;YACpB,OAAO,GAAG,CAAC;QACZ,CAAC;QAED,MAAM,CACL,OAAO,GAAG,KAAK,QAAQ,EACvB,KAAK,CAAC,oDAAoD,CAC1D,CAAC;QACF,OAAO,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7E,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { JsonCodecPart } from \"../../codec/index.js\";\nimport type { ChangeEncodingContext } from \"../change-family/index.js\";\n\nimport { RevisionTagSchema, type EncodedRevisionTag, type RevisionTag } from \"./types.js\";\n\nexport class RevisionTagCodec\n\timplements JsonCodecPart<RevisionTag, typeof RevisionTagSchema, ChangeEncodingContext>\n{\n\tpublic localSessionId: SessionId;\n\tpublic readonly encodedSchema = RevisionTagSchema;\n\n\tpublic constructor(private readonly idCompressor: IIdCompressor) {\n\t\tthis.localSessionId = idCompressor.localSessionId;\n\t}\n\n\tpublic encode(tag: RevisionTag): EncodedRevisionTag {\n\t\treturn tag === \"root\"\n\t\t\t? tag\n\t\t\t: (this.idCompressor.normalizeToOpSpace(tag) as EncodedRevisionTag);\n\t}\n\tpublic decode(tag: EncodedRevisionTag, context: ChangeEncodingContext): RevisionTag {\n\t\tif (tag === \"root\") {\n\t\t\treturn tag;\n\t\t}\n\n\t\tassert(\n\t\t\ttypeof tag === \"number\",\n\t\t\t0x88d /* String revision tag must be the literal 'root' */,\n\t\t);\n\t\treturn this.idCompressor.normalizeToSessionSpace(tag, context.originatorId);\n\t}\n}\n"]}
1
+ {"version":3,"file":"revisionTagCodec.js","sourceRoot":"","sources":["../../../src/core/rebase/revisionTagCodec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAM7D,OAAO,EAAE,iBAAiB,EAA6C,MAAM,YAAY,CAAC;AAE1F,MAAM,OAAO,gBAAgB;IAMQ;IAH7B,cAAc,CAAY;IACjB,aAAa,GAAG,iBAAiB,CAAC;IAElD,YAAoC,YAA2B;QAA3B,iBAAY,GAAZ,YAAY,CAAe;QAC9D,IAAI,CAAC,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC;IACnD,CAAC;IAEM,MAAM,CAAC,GAAgB;QAC7B,OAAO,GAAG,KAAK,MAAM;YACpB,CAAC,CAAC,GAAG;YACL,CAAC,CAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,CAAwB,CAAC;IACtE,CAAC;IACM,MAAM,CAAC,GAAuB,EAAE,OAA8B;QACpE,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;YACpB,OAAO,GAAG,CAAC;QACZ,CAAC;QAED,MAAM,CACL,OAAO,GAAG,KAAK,QAAQ,EACvB,KAAK,CAAC,oDAAoD,CAC1D,CAAC;QACF,OAAO,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7E,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { JsonCodecPart } from \"../../codec/index.js\";\nimport type { ChangeEncodingContext } from \"../change-family/index.js\";\n\nimport { RevisionTagSchema, type EncodedRevisionTag, type RevisionTag } from \"./types.js\";\n\nexport class RevisionTagCodec\n\timplements JsonCodecPart<RevisionTag, typeof RevisionTagSchema, ChangeEncodingContext>\n{\n\tpublic localSessionId: SessionId;\n\tpublic readonly encodedSchema = RevisionTagSchema;\n\n\tpublic constructor(private readonly idCompressor: IIdCompressor) {\n\t\tthis.localSessionId = idCompressor.localSessionId;\n\t}\n\n\tpublic encode(tag: RevisionTag): EncodedRevisionTag {\n\t\treturn tag === \"root\"\n\t\t\t? tag\n\t\t\t: (this.idCompressor.normalizeToOpSpace(tag) as EncodedRevisionTag);\n\t}\n\tpublic decode(tag: EncodedRevisionTag, context: ChangeEncodingContext): RevisionTag {\n\t\tif (tag === \"root\") {\n\t\t\treturn tag;\n\t\t}\n\n\t\tassert(\n\t\t\ttypeof tag === \"number\",\n\t\t\t0x88d /* String revision tag must be the literal 'root' */,\n\t\t);\n\t\treturn this.idCompressor.normalizeToSessionSpace(tag, context.originatorId);\n\t}\n}\n"]}
@@ -79,7 +79,11 @@ export interface GraphCommit<TChange> {
79
79
  readonly revision: RevisionTag;
80
80
  /** The change that will result from applying this commit */
81
81
  readonly change: TChange;
82
- /** The parent of this commit, on whose change this commit's change is based */
82
+ /**
83
+ * The parent of this commit, on whose change this commit's change is based.
84
+ * @remarks
85
+ * This property is only `undefined` for the trunk base commit, which is the root of the commit graph.
86
+ */
83
87
  readonly parent?: GraphCommit<TChange>;
84
88
  /**
85
89
  * Arbitrary, application-defined metadata that is persisted alongside this commit.
@@ -90,6 +94,12 @@ export interface GraphCommit<TChange> {
90
94
  * Always copy this property when copying a commit.
91
95
  */
92
96
  readonly customMetadata: CustomMetadataTree | undefined;
97
+ /**
98
+ * Indicates whether this commit was trimmed from the history.
99
+ * @remarks
100
+ * During trunk trimming, this property is set to `true` on all trimmed commits (including the new trunk base).
101
+ */
102
+ readonly wasTrimmed?: true;
93
103
  }
94
104
  /**
95
105
  * A tree representing the nesting structure of transaction metadata.
@@ -408,6 +418,7 @@ export type ChangeMetadata = LocalChangeMetadata | RemoteChangeMetadata;
408
418
  export declare function mintCommit<TChange>(parent: GraphCommit<TChange>, commit: Omit<GraphCommit<TChange>, "parent">): GraphCommit<TChange>;
409
419
  export type ChangeAtomIdRangeMap<V> = RangeMap<ChangeAtomId, V>;
410
420
  export declare function newChangeAtomIdRangeMap<V>(offsetValue?: (value: V, offset: number) => V): ChangeAtomIdRangeMap<V>;
421
+ export declare function newChangeAtomIdTransform(): ChangeAtomIdRangeMap<ChangeAtomId>;
411
422
  export declare function subtractChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): number;
412
423
  /**
413
424
  * Compares two {@link RevisionTag}s to form a strict total ordering.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EACX,mBAAmB,EACnB,SAAS,EACT,wBAAwB,EACxB,QAAQ,EACR,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EACN,KAAK,KAAK,EACV,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,SAAS,EACd,QAAQ,EAKR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,eAAe,yBAAiC,CAAC;AAE9D;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,wBAAwB,GAAG,MAAM,C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C,WAAW,CAAC,OAAO,CAAC,CAQtB;AAED,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;AAEhE,wBAAgB,uBAAuB,CAAC,CAAC,EACxC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC,GAC3C,oBAAoB,CAAC,CAAC,CAAC,CAEzB;AAED,wBAAgB,wBAAwB,IAAI,oBAAoB,CAAC,YAAY,CAAC,CAE7E;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,MAAM,CAO9E;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACtC,CAAC,EAAE,WAAW,GAAG,SAAS,EAC1B,CAAC,EAAE,WAAW,GAAG,SAAS,GACxB,MAAM,CAQR"}
@@ -172,6 +172,9 @@ export function mintCommit(parent, commit) {
172
172
  export function newChangeAtomIdRangeMap(offsetValue) {
173
173
  return new RangeMap(offsetChangeAtomId, subtractChangeAtomIds, offsetValue);
174
174
  }
175
+ export function newChangeAtomIdTransform() {
176
+ return new RangeMap(offsetChangeAtomId, subtractChangeAtomIds, offsetChangeAtomId);
177
+ }
175
178
  export function subtractChangeAtomIds(a, b) {
176
179
  const cmp = comparePartialRevisions(a.revision, b.revision);
177
180
  if (cmp !== 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAKN,QAAQ,EACR,KAAK,EACL,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,qBAAqB,CAAC;AAG7B;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,EAAa,CAAC;AAW9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,I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Ae;IACrE,MAAM,GAAG,GAAG,uBAAuB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC5D,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;QACf,OAAO,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACvC,CAAC;IAED,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACtC,CAA0B,EAC1B,CAA0B;IAE1B,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;SAAM,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,CAAC,CAAC,CAAC;IACX,CAAC;IAED,OAAO,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport type {\n\tOpSpaceCompressedId,\n\tSessionId,\n\tSessionSpaceCompressedId,\n\tStableId,\n} from \"@fluidframework/id-compressor\";\nimport * as Type from \"@sinclair/typebox\";\n\nimport {\n\ttype Brand,\n\ttype JsonCompatibleReadOnly,\n\ttype JsonCompatibleReadOnlyObject,\n\ttype NestedMap,\n\tRangeMap,\n\tbrand,\n\tbrandedNumberType,\n\tbrandedStringType,\n\tcomparePartialStrings,\n} from \"../../util/index.js\";\nimport type { RevertibleAlpha } from \"../revertible.js\";\n\n/**\n * The identifier for a particular session/user/client that can generate `GraphCommit`s\n */\nexport const SessionIdSchema = brandedStringType<SessionId>();\n\n/**\n * A unique identifier for a commit. Commits that have been rebased, but are semantically\n * the same, will share the same revision tag.\n *\n * The constant 'root' is reserved for the trunk base: minting a SessionSpaceCompressedId is not\n * possible on readonly clients. These clients generally don't need ids, but must be done at tree initialization time.\n */\nexport type RevisionTag = SessionSpaceCompressedId | \"root\";\nexport type EncodedRevisionTag = Brand<OpSpaceCompressedId, \"EncodedRevisionTag\"> | \"root\";\nexport const RevisionTagSchema = Type.Union([\n\tType.Literal(\"root\"),\n\tbrandedNumberType<Exclude<EncodedRevisionTag, string>>(),\n]);\n\nexport type EncodedStableId = Brand<StableId, \"EncodedStableId\">;\nexport const StableIdSchema = Type.String();\n\n/**\n * An ID which is unique within a revision of a `ModularChangeset`.\n * @remarks\n * Always a real number (never `NaN` or +/- `Infinity`).\n *\n * A `ModularChangeset` which is a composition of multiple revisions may contain duplicate `ChangesetLocalId`s,\n * but they are unique when qualified by the revision of the change they are used in.\n */\nexport type ChangesetLocalId = Brand<number, \"ChangesetLocalId\">;\n\n/**\n * A globally unique ID for an atom of change, or a node associated with the atom of change.\n * *\n * @privateRemarks\n * TODO: Rename this to be more general.\n */\nexport interface ChangeAtomId {\n\t/**\n\t * Uniquely identifies the changeset within which the change was made.\n\t * Only undefined when referring to an anonymous changesets.\n\t */\n\treadonly revision?: RevisionTag;\n\t/**\n\t * Uniquely identifies, in the scope of the changeset, the change made to the field.\n\t */\n\treadonly localId: ChangesetLocalId;\n}\n\nexport type EncodedChangeAtomId = [ChangesetLocalId, EncodedRevisionTag] | ChangesetLocalId;\n\nexport type ChangeAtomIdMap<T> = NestedMap<RevisionTag | undefined, ChangesetLocalId, T>;\n\n/**\n * Returns true iff `a` and `b` are the same.\n */\nexport function areEqualChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): boolean {\n\treturn a.localId === b.localId && a.revision === b.revision;\n}\n\nexport function areEqualChangeAtomIdOpts(\n\ta: ChangeAtomId | undefined,\n\tb: ChangeAtomId | undefined,\n): boolean {\n\tif (a === undefined || b === undefined) {\n\t\treturn a === b;\n\t}\n\n\treturn areEqualChangeAtomIds(a, b);\n}\n\n/**\n * Returns a ChangeAtomId with the given revision and local ID.\n */\nexport function makeChangeAtomId(\n\tlocalId: ChangesetLocalId,\n\trevision?: RevisionTag,\n): ChangeAtomId {\n\treturn revision === undefined ? { localId } : { localId, revision };\n}\n\nexport function asChangeAtomId(id: ChangesetLocalId | ChangeAtomId): ChangeAtomId {\n\treturn typeof id === \"object\" ? id : { localId: id };\n}\n\nexport function taggedAtomId(\n\tid: ChangeAtomId,\n\trevision: RevisionTag | undefined,\n): ChangeAtomId {\n\treturn makeChangeAtomId(id.localId, id.revision ?? revision);\n}\n\nexport function taggedOptAtomId(\n\tid: ChangeAtomId | undefined,\n\trevision: RevisionTag | undefined,\n): ChangeAtomId | undefined {\n\tif (id === undefined) {\n\t\treturn undefined;\n\t}\n\treturn taggedAtomId(id, revision);\n}\n\nexport function offsetChangeAtomId<T extends ChangeAtomId>(id: T, offset: number): T {\n\treturn { ...id, localId: brand(id.localId + offset) };\n}\n\n// #region These comparison functions are used instead of e.g. `compareNumbers` as a performance optimization\n\nexport function compareChangesetLocalIds(a: ChangesetLocalId, b: ChangesetLocalId): number {\n\treturn a - b; // No need to consider `NaN` or `Infinity` since ChangesetLocalId is always a real number\n}\n\nexport function comparePartialChangesetLocalIds(\n\ta: ChangesetLocalId | undefined,\n\tb: ChangesetLocalId | undefined,\n): number {\n\tif (a === undefined) {\n\t\treturn b === undefined ? 0 : -1;\n\t} else if (b === undefined) {\n\t\treturn 1;\n\t}\n\treturn compareChangesetLocalIds(a, b);\n}\n\n// #endregion\n\n/**\n * A node in a graph of commits. A commit's parent is the commit on which it was based.\n */\nexport interface GraphCommit<TChange> {\n\t/**\n\t * The tag for this commit.\n\t * @remarks\n\t * If this commit is rebased, the corresponding rebased commit will retain this tag.\n\t * With the exception of transaction commits (which all share the same tag), this tag is unique within a given branch history.\n\t */\n\treadonly revision: RevisionTag;\n\t/** The change that will result from applying this commit */\n\treadonly change: TChange;\n\t/** The parent of this commit, on whose change this commit's change is based */\n\treadonly parent?: GraphCommit<TChange>;\n\t/**\n\t * Arbitrary, application-defined metadata that is persisted alongside this commit.\n\t * @remarks\n\t * Set via {@link RunTransactionParamsAlpha.customMetadata}. This is a tree rather than a single\n\t * object because a commit may be produced by nested transactions.\n\t * @privateRemarks\n\t * Always copy this property when copying a commit.\n\t */\n\treadonly customMetadata: CustomMetadataTree | undefined;\n}\n\n/**\n * A tree representing the nesting structure of transaction metadata.\n *\n * @remarks\n * Each transaction contributes a node whose {@link CustomMetadataTree.metadata} is its\n * {@link RunTransactionParamsAlpha.customMetadata | metadata} (or `undefined` if none was provided).\n * When transactions are nested, inner transaction nodes become\n * {@link CustomMetadataTree.children | children} of outer ones.\n *\n * @sealed @alpha\n */\nexport interface CustomMetadataTree {\n\t/**\n\t * The metadata supplied by this transaction, or `undefined` if it supplied none.\n\t */\n\treadonly metadata: JsonCompatibleReadOnlyObject | undefined;\n\n\t/**\n\t * The metadata trees of any nested transactions within this one.\n\t */\n\treadonly children: readonly CustomMetadataTree[];\n}\n\n/**\n * Flattens a {@link CustomMetadataTree} into a single object.\n * @remarks\n * Where two transactions used the same property, the outermost one wins. Among siblings, the later one\n * wins. Returns `undefined` if no transaction in the tree supplied any metadata.\n */\nexport function flattenCustomMetadata(\n\ttree: CustomMetadataTree | undefined,\n): JsonCompatibleReadOnlyObject | undefined {\n\tif (tree === undefined) {\n\t\treturn undefined;\n\t}\n\tlet flattened: Record<string, JsonCompatibleReadOnly | undefined> | undefined;\n\tconst visit = (node: CustomMetadataTree): void => {\n\t\t// Descendants first, so that a containing transaction's metadata wins on conflict.\n\t\tfor (const child of node.children) {\n\t\t\tvisit(child);\n\t\t}\n\t\tif (node.metadata !== undefined) {\n\t\t\tflattened ??= {};\n\t\t\t// `defineProperty` rather than assignment: assigning the valid JSON key \"__proto__\" would\n\t\t\t// invoke the inherited setter and set the prototype instead of creating a property.\n\t\t\tfor (const key of Object.keys(node.metadata)) {\n\t\t\t\tObject.defineProperty(flattened, key, {\n\t\t\t\t\tvalue: node.metadata[key],\n\t\t\t\t\twritable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\tvisit(tree);\n\treturn flattened;\n}\n\n/**\n * The type of a commit. This is used to describe the context in which the commit was created.\n *\n * @public\n */\nexport enum CommitKind {\n\t/** A commit corresponding to a change that is not the result of an undo/redo from this client. */\n\tDefault,\n\t/** A commit that is the result of an undo from this client. */\n\tUndo,\n\t/** A commit that is the result of a redo from this client. */\n\tRedo,\n}\n\n/**\n * Information about a commit that has been applied.\n *\n * @sealed @public\n */\nexport interface CommitMetadata {\n\t/**\n\t * A {@link CommitKind} enum value describing whether the commit represents an Edit, an Undo, or a Redo.\n\t */\n\treadonly kind: CommitKind;\n\t/**\n\t * Indicates whether the commit is a local edit\n\t */\n\treadonly isLocal: boolean;\n}\n\n/**\n * Information about a change that has been applied by the local client.\n * @sealed @alpha\n */\nexport interface LocalChangeMetadata extends CommitMetadata {\n\t/**\n\t * Whether the change was made on the local machine/client or received from a remote client.\n\t */\n\treadonly isLocal: true;\n\t/**\n\t * Returns a serializable object that encodes the change.\n\t * @remarks This is only available for local changes.\n\t * This change object can be {@link UntypedTreeViewAlpha.applyChange | applied to another view} in the same state as the one which generated it.\n\t * The change object must be applied to a SharedTree with the same IdCompressor session ID as it was created from.\n\t * @privateRemarks\n\t * This is a `SerializedChange` from treeCheckout.ts.\n\t */\n\tgetChange(): JsonCompatibleReadOnly;\n\t/**\n\t * Returns an object (a {@link RevertibleAlpha | \"revertible\"}) that can be used to revert the change that produced this event.\n\t * @remarks This is only available for local changes.\n\t * If the change is not revertible (for example, it was a change to the application schema), then this will return `undefined`.\n\t * Revertibles should be disposed when they are no longer needed.\n\t * @param onDisposed - A callback that will be invoked when the `Revertible` is disposed.\n\t * This happens when the `Revertible` is disposed manually or when the `TreeView` that the `Revertible` belongs to is disposed - whichever happens first.\n\t * This is typically used to clean up any resources associated with the `Revertible` in the host application.\n\t * @throws Throws an error if called outside the scope of the `changed` event that provided it.\n\t */\n\tgetRevertible(\n\t\tonDisposed?: (revertible: RevertibleAlpha) => void,\n\t): RevertibleAlpha | undefined;\n\n\t/**\n\t * Optional label provided by the user when commit was created.\n\t * This can be used by undo/redo to group or classify edits.\n\t */\n\treadonly label?: unknown;\n\n\t/**\n\t * A set of {@link RunTransactionParamsBeta.label | labels} for all transactions (nested or otherwise)\n\t * that made up this change.\n\t * This can be used to identify, group, or filter changes — for example, to decide whether a change\n\t * should be included in an undo/redo stack.\n\t *\n\t * @remarks\n\t * The optional {@link TransactionLabels.tree | tree} property provides the structural nesting\n\t * of the transactions as a {@link LabelTree}.\n\t *\n\t * The `tree` property is present whenever the change was produced by a transaction that\n\t * includes at least one label. If the change was unlabeled,\n\t * `tree` is `undefined` and the set is empty.\n\t *\n\t * @example\n\t * Checking whether a change was produced by a specific kind of transaction:\n\t * ```typescript\n\t * branch.events.on(\"changed\", (metadata) => {\n\t * if (metadata.labels.has(\"testLabel\")) {\n\t * // This change came from a transaction labeled \"testLabel\"\n\t * }\n\t * });\n\t * ```\n\t *\n\t * @example\n\t * A nested transaction produces a tree that reflects the nesting:\n\t * ```typescript\n\t * tree.runTransaction(() => {\n\t * tree.runTransaction(() => { ... }, { label: \"inner\" });\n\t * }, { label: \"outer\" });\n\t * // metadata.labels.has(\"inner\") === true\n\t * // metadata.labels.tree will be:\n\t * // { label: \"outer\", sublabels: [{ label: \"inner\", sublabels: [] }] }\n\t * ```\n\t */\n\treadonly labels: TransactionLabels;\n\n\t/**\n\t * Events related to a local change that has been applied.\n\t */\n\treadonly events: Listenable<LocalCommitEvents>;\n}\n\n/**\n * Events related to a local commit that has been applied.\n * @sealed @alpha\n */\nexport interface LocalCommitEvents {\n\t/**\n\t * Fired once a commit has been ordered by the sequencing service.\n\t * @param outcome - information about what changes from the commit were applied or not\n\t *\n\t * @remarks\n\t * Once a commit is sequenced, the following guarantees hold:\n\t * 1. The changes carried by the commit have been persisted and other peers are able to see them.\n\t * 2. There can be no more concurrent changes sequenced before this commit, which means this commit has reached its settled form.\n\t *\n\t * This event can be used by applications to inform the end user that their changes have been saved (`CommitOutcome.FullyApplied`) or rejected (`CommitOutcome.FullyDropped` and `CommitOutcome.NewContentOnly`).\n\t * It can also be used to queue up a new attempt at making the rejected changes. Note however that new edits must be made outside of the event callback.\n\t * @example Notifying the user of the outcome and allowing them to retry:\n\t * ```typescript\n\t * // Use `asAlpha` API to access the settled event API\n\t * const view = asAlpha(tree.viewWith(config));\n\t *\n\t * // Function to clear all contents of the tree, with a precondition that no changes have occurred.\n\t * const clearAllContents = () => {\n\t * \tview.runTransaction(\n\t * \t\t() => {\n\t * \t\t\t// Remove all contents at the root\n\t * \t\t\tview.root.removeRange();\n\t * \t\t},\n\t * \t\t{ preconditions: [{ type: \"noChange\" }] },\n\t * \t);\n\t * };\n\t *\n\t * // Register the logic for notifying the user of the outcome and allow them to retry\n\t * view.events.on(\"changed\", (metadata) => {\n\t * \tif (metadata.isLocal) {\n\t * \t\tmetadata.events.on(\"settled\", (outcome) => {\n\t * \t\t\tif (outcome === CommitOutcome.FullyApplied) {\n\t * \t\t\t\talert(\"Clear operation succeeded.\");\n\t * \t\t\t} else {\n\t * \t\t\t\tconst shouldTryAgain = confirm(\n\t * \t\t\t\t\t\"The contents have changed. Do you still want to clear everything?\",\n\t * \t\t\t\t);\n\t * \t\t\t\tif (shouldTryAgain) {\n\t * \t\t\t\t\t// It is invalid to make edits during the event callback, so we schedule the retry to occur asynchronously.\n\t * \t\t\t\t\tsetTimeout(clearAllContents);\n\t * \t\t\t\t} else {\n\t * \t\t\t\t\talert(\"Clear operation aborted.\");\n\t * \t\t\t\t}\n\t * \t\t\t}\n\t * \t\t});\n\t * \t}\n\t * });\n\t *\n\t * // First attempt to clear all contents.\n\t * // This will synchronously trigger the changed \"event\" and register the listener for the settled event.\n\t * clearAllContents();\n\t * ```\n\t */\n\tsettled(outcome: CommitOutcome): void;\n}\n\n/**\n * A tree representing the nesting structure of transaction labels.\n *\n * @remarks\n * Each transaction contributes a node whose {@link LabelTree.label} is its\n * {@link RunTransactionParamsBeta.label | label} (or `undefined` if no label was provided).\n * When transactions are nested, inner transaction nodes become {@link LabelTree.sublabels | sublabels}\n * of outer ones.\n *\n * @sealed @alpha\n */\nexport interface LabelTree {\n\t/**\n\t * The label for this transaction, or `undefined` if no label was provided.\n\t */\n\tlabel: unknown;\n\n\t/**\n\t * The label trees of any nested transactions within this one.\n\t */\n\tsublabels: LabelTree[];\n}\n\n/**\n * A set of transaction labels with an optional structural tree.\n *\n * @remarks\n * The set contains all label values from the transactions that produced the change.\n * Use standard {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set | Set}\n * methods to check for specific labels.\n *\n * The optional {@link TransactionLabels.tree | tree} property provides the structural nesting\n * of the transactions as a {@link LabelTree}.\n *\n * @sealed @alpha\n */\nexport type TransactionLabels = Set<unknown> & { tree?: LabelTree };\n\n/**\n * Details about what changes from a commit were applied or not.\n * @alpha\n */\nexport enum CommitOutcome {\n\t/**\n\t * All of the changes in the commit were applied.\n\t */\n\tFullyApplied,\n\t/**\n\t * None of the changes in the commit were applied.\n\t * @remarks\n\t * This occurs when an implicit constraint has been violated.\n\t * Implicit constraints are those that are automatically enforced by SharedTree on all changes.\n\t *\n\t * Such a violation typically arises in one of two scenarios:\n\t * 1. A schema change conflicts with a concurrent data or schema change that was sequenced before it.\n\t * 2. A data change conflicts with a concurrent schema change that was sequenced before it.\n\t */\n\tFullyDropped,\n\t/**\n\t * Only the creation of new content was applied.\n\t * All other changes (including the insertion and/or modification of the new content) were dropped.\n\t * @remarks\n\t * This occurs when at least one explicit constraint has been violated\n\t * (and no implicit constraints were violated.)\n\t *\n\t * Explicit constraints are those that are explicitly added\n\t * through {@link RunTransactionParamsAlpha.preconditions | preconditions}\n\t * or {@link TransactionCallbackStatusAlpha.preconditionsOnRevert | preconditionsOnRevert}.\n\t *\n\t * The new content may be edited (and potentially inserted) by subsequent commits,\n\t * assuming those commits are not themselves subject to constraint violations.\n\t * Note that, if left uninserted, new content will eventually be garbage-collected from the document.\n\t *\n\t * Applications typically choose to treat this outcome as equivalent to {@link CommitOutcome.FullyDropped | FullyDropped}\n\t * and, when reattempting the change, generate a different copy of the new content if any.\n\t *\n\t * @privateRemarks\n\t * New content is preserved so that subsequent commits that reference it without having to carry their own copies of it.\n\t * This can become expensive: one extra copy per subsequent commit, included in both in cases where we know the prior commit was dropped and in cases where we don't yet know.\n\t * We could instead drop all subsequent commits that reference the new content, but that would create a greater risk of data loss.\n\t */\n\tNewContentOnly,\n}\n\n/**\n * Information about a change that has been applied by a remote client.\n * @sealed @alpha\n */\nexport interface RemoteChangeMetadata extends CommitMetadata {\n\t/**\n\t * Whether the change was made on the local machine/client or received from a remote client.\n\t */\n\treadonly isLocal: false;\n\t/**\n\t * Returns a serializable object that encodes the change.\n\t * @remarks This is only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly getChange?: undefined;\n\t/**\n\t * Returns an object (a {@link RevertibleAlpha | \"revertible\"}) that can be used to revert the change that produced this event.\n\t * @remarks This is only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly getRevertible?: undefined;\n\t/**\n\t * Label provided by the user when commit was created.\n\t * @remarks This is only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly label?: undefined;\n\t/**\n\t * A set of labels from nested transaction labels.\n\t * @remarks This is always empty for remote changes. Labels are only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly labels: TransactionLabels;\n}\n\n/**\n * Information about a {@link LocalChangeMetadata | local} or {@link RemoteChangeMetadata | remote} change that has been applied.\n * @sealed @alpha\n */\nexport type ChangeMetadata = LocalChangeMetadata | RemoteChangeMetadata;\n\n/**\n * Creates a new graph commit object. This is useful for creating copies of commits with different parentage.\n * @param parent - the parent of the new commit\n * @param commit - the contents of the new commit object\n * @returns the new commit object\n */\n// Note that this function is synchronous, and therefore it is not a Promise.\n// However, it is still a strong commit-mint.\nexport function mintCommit<TChange>(\n\tparent: GraphCommit<TChange>,\n\tcommit: Omit<GraphCommit<TChange>, \"parent\">,\n): GraphCommit<TChange> {\n\tconst { revision, change, customMetadata } = commit;\n\treturn {\n\t\trevision,\n\t\tchange,\n\t\tparent,\n\t\tcustomMetadata,\n\t};\n}\n\nexport type ChangeAtomIdRangeMap<V> = RangeMap<ChangeAtomId, V>;\n\nexport function newChangeAtomIdRangeMap<V>(\n\toffsetValue?: (value: V, offset: number) => V,\n): ChangeAtomIdRangeMap<V> {\n\treturn new RangeMap(offsetChangeAtomId, subtractChangeAtomIds, offsetValue);\n}\n\nexport function subtractChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): number {\n\tconst cmp = comparePartialRevisions(a.revision, b.revision);\n\tif (cmp !== 0) {\n\t\treturn cmp * Number.POSITIVE_INFINITY;\n\t}\n\n\treturn a.localId - b.localId;\n}\n\n/**\n * Compares two {@link RevisionTag}s to form a strict total ordering.\n * @remarks This function tolerates arbitrary strings, not just the string \"root\".\n * It sorts as follows: `undefined` \\< `string` \\< `number`\n */\nexport function comparePartialRevisions(\n\ta: RevisionTag | undefined,\n\tb: RevisionTag | undefined,\n): number {\n\tif (typeof a === \"number\") {\n\t\treturn typeof b === \"number\" ? a - b : 1;\n\t} else if (typeof b === \"number\") {\n\t\treturn -1;\n\t}\n\n\treturn comparePartialStrings(a, b);\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAKN,QAAQ,EACR,KAAK,EACL,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,qBAAqB,CAAC;AAG7B;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,EAAa,CAAC;AAW9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,KA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AkB,EAAE,qBAAqB,EAAE,kBAAkB,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,CAAe,EAAE,CAAe;IACrE,MAAM,GAAG,GAAG,uBAAuB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC5D,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;QACf,OAAO,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACvC,CAAC;IAED,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACtC,CAA0B,EAC1B,CAA0B;IAE1B,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;SAAM,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,CAAC,CAAC,CAAC;IACX,CAAC;IAED,OAAO,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport type {\n\tOpSpaceCompressedId,\n\tSessionId,\n\tSessionSpaceCompressedId,\n\tStableId,\n} from \"@fluidframework/id-compressor\";\nimport * as Type from \"@sinclair/typebox\";\n\nimport {\n\ttype Brand,\n\ttype JsonCompatibleReadOnly,\n\ttype JsonCompatibleReadOnlyObject,\n\ttype NestedMap,\n\tRangeMap,\n\tbrand,\n\tbrandedNumberType,\n\tbrandedStringType,\n\tcomparePartialStrings,\n} from \"../../util/index.js\";\nimport type { RevertibleAlpha } from \"../revertible.js\";\n\n/**\n * The identifier for a particular session/user/client that can generate `GraphCommit`s\n */\nexport const SessionIdSchema = brandedStringType<SessionId>();\n\n/**\n * A unique identifier for a commit. Commits that have been rebased, but are semantically\n * the same, will share the same revision tag.\n *\n * The constant 'root' is reserved for the trunk base: minting a SessionSpaceCompressedId is not\n * possible on readonly clients. These clients generally don't need ids, but must be done at tree initialization time.\n */\nexport type RevisionTag = SessionSpaceCompressedId | \"root\";\nexport type EncodedRevisionTag = Brand<OpSpaceCompressedId, \"EncodedRevisionTag\"> | \"root\";\nexport const RevisionTagSchema = Type.Union([\n\tType.Literal(\"root\"),\n\tbrandedNumberType<Exclude<EncodedRevisionTag, string>>(),\n]);\n\nexport type EncodedStableId = Brand<StableId, \"EncodedStableId\">;\nexport const StableIdSchema = Type.String();\n\n/**\n * An ID which is unique within a revision of a `ModularChangeset`.\n * @remarks\n * Always a real number (never `NaN` or +/- `Infinity`).\n *\n * A `ModularChangeset` which is a composition of multiple revisions may contain duplicate `ChangesetLocalId`s,\n * but they are unique when qualified by the revision of the change they are used in.\n */\nexport type ChangesetLocalId = Brand<number, \"ChangesetLocalId\">;\n\n/**\n * A globally unique ID for an atom of change, or a node associated with the atom of change.\n * *\n * @privateRemarks\n * TODO: Rename this to be more general.\n */\nexport interface ChangeAtomId {\n\t/**\n\t * Uniquely identifies the changeset within which the change was made.\n\t * Only undefined when referring to an anonymous changesets.\n\t */\n\treadonly revision?: RevisionTag;\n\t/**\n\t * Uniquely identifies, in the scope of the changeset, the change made to the field.\n\t */\n\treadonly localId: ChangesetLocalId;\n}\n\nexport type EncodedChangeAtomId = [ChangesetLocalId, EncodedRevisionTag] | ChangesetLocalId;\n\nexport type ChangeAtomIdMap<T> = NestedMap<RevisionTag | undefined, ChangesetLocalId, T>;\n\n/**\n * Returns true iff `a` and `b` are the same.\n */\nexport function areEqualChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): boolean {\n\treturn a.localId === b.localId && a.revision === b.revision;\n}\n\nexport function areEqualChangeAtomIdOpts(\n\ta: ChangeAtomId | undefined,\n\tb: ChangeAtomId | undefined,\n): boolean {\n\tif (a === undefined || b === undefined) {\n\t\treturn a === b;\n\t}\n\n\treturn areEqualChangeAtomIds(a, b);\n}\n\n/**\n * Returns a ChangeAtomId with the given revision and local ID.\n */\nexport function makeChangeAtomId(\n\tlocalId: ChangesetLocalId,\n\trevision?: RevisionTag,\n): ChangeAtomId {\n\treturn revision === undefined ? { localId } : { localId, revision };\n}\n\nexport function asChangeAtomId(id: ChangesetLocalId | ChangeAtomId): ChangeAtomId {\n\treturn typeof id === \"object\" ? id : { localId: id };\n}\n\nexport function taggedAtomId(\n\tid: ChangeAtomId,\n\trevision: RevisionTag | undefined,\n): ChangeAtomId {\n\treturn makeChangeAtomId(id.localId, id.revision ?? revision);\n}\n\nexport function taggedOptAtomId(\n\tid: ChangeAtomId | undefined,\n\trevision: RevisionTag | undefined,\n): ChangeAtomId | undefined {\n\tif (id === undefined) {\n\t\treturn undefined;\n\t}\n\treturn taggedAtomId(id, revision);\n}\n\nexport function offsetChangeAtomId<T extends ChangeAtomId>(id: T, offset: number): T {\n\treturn { ...id, localId: brand(id.localId + offset) };\n}\n\n// #region These comparison functions are used instead of e.g. `compareNumbers` as a performance optimization\n\nexport function compareChangesetLocalIds(a: ChangesetLocalId, b: ChangesetLocalId): number {\n\treturn a - b; // No need to consider `NaN` or `Infinity` since ChangesetLocalId is always a real number\n}\n\nexport function comparePartialChangesetLocalIds(\n\ta: ChangesetLocalId | undefined,\n\tb: ChangesetLocalId | undefined,\n): number {\n\tif (a === undefined) {\n\t\treturn b === undefined ? 0 : -1;\n\t} else if (b === undefined) {\n\t\treturn 1;\n\t}\n\treturn compareChangesetLocalIds(a, b);\n}\n\n// #endregion\n\n/**\n * A node in a graph of commits. A commit's parent is the commit on which it was based.\n */\nexport interface GraphCommit<TChange> {\n\t/**\n\t * The tag for this commit.\n\t * @remarks\n\t * If this commit is rebased, the corresponding rebased commit will retain this tag.\n\t * With the exception of transaction commits (which all share the same tag), this tag is unique within a given branch history.\n\t */\n\treadonly revision: RevisionTag;\n\t/** The change that will result from applying this commit */\n\treadonly change: TChange;\n\t/**\n\t * The parent of this commit, on whose change this commit's change is based.\n\t * @remarks\n\t * This property is only `undefined` for the trunk base commit, which is the root of the commit graph.\n\t */\n\treadonly parent?: GraphCommit<TChange>;\n\t/**\n\t * Arbitrary, application-defined metadata that is persisted alongside this commit.\n\t * @remarks\n\t * Set via {@link RunTransactionParamsAlpha.customMetadata}. This is a tree rather than a single\n\t * object because a commit may be produced by nested transactions.\n\t * @privateRemarks\n\t * Always copy this property when copying a commit.\n\t */\n\treadonly customMetadata: CustomMetadataTree | undefined;\n\n\t/**\n\t * Indicates whether this commit was trimmed from the history.\n\t * @remarks\n\t * During trunk trimming, this property is set to `true` on all trimmed commits (including the new trunk base).\n\t */\n\treadonly wasTrimmed?: true;\n}\n\n/**\n * A tree representing the nesting structure of transaction metadata.\n *\n * @remarks\n * Each transaction contributes a node whose {@link CustomMetadataTree.metadata} is its\n * {@link RunTransactionParamsAlpha.customMetadata | metadata} (or `undefined` if none was provided).\n * When transactions are nested, inner transaction nodes become\n * {@link CustomMetadataTree.children | children} of outer ones.\n *\n * @sealed @alpha\n */\nexport interface CustomMetadataTree {\n\t/**\n\t * The metadata supplied by this transaction, or `undefined` if it supplied none.\n\t */\n\treadonly metadata: JsonCompatibleReadOnlyObject | undefined;\n\n\t/**\n\t * The metadata trees of any nested transactions within this one.\n\t */\n\treadonly children: readonly CustomMetadataTree[];\n}\n\n/**\n * Flattens a {@link CustomMetadataTree} into a single object.\n * @remarks\n * Where two transactions used the same property, the outermost one wins. Among siblings, the later one\n * wins. Returns `undefined` if no transaction in the tree supplied any metadata.\n */\nexport function flattenCustomMetadata(\n\ttree: CustomMetadataTree | undefined,\n): JsonCompatibleReadOnlyObject | undefined {\n\tif (tree === undefined) {\n\t\treturn undefined;\n\t}\n\tlet flattened: Record<string, JsonCompatibleReadOnly | undefined> | undefined;\n\tconst visit = (node: CustomMetadataTree): void => {\n\t\t// Descendants first, so that a containing transaction's metadata wins on conflict.\n\t\tfor (const child of node.children) {\n\t\t\tvisit(child);\n\t\t}\n\t\tif (node.metadata !== undefined) {\n\t\t\tflattened ??= {};\n\t\t\t// `defineProperty` rather than assignment: assigning the valid JSON key \"__proto__\" would\n\t\t\t// invoke the inherited setter and set the prototype instead of creating a property.\n\t\t\tfor (const key of Object.keys(node.metadata)) {\n\t\t\t\tObject.defineProperty(flattened, key, {\n\t\t\t\t\tvalue: node.metadata[key],\n\t\t\t\t\twritable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\tvisit(tree);\n\treturn flattened;\n}\n\n/**\n * The type of a commit. This is used to describe the context in which the commit was created.\n *\n * @public\n */\nexport enum CommitKind {\n\t/** A commit corresponding to a change that is not the result of an undo/redo from this client. */\n\tDefault,\n\t/** A commit that is the result of an undo from this client. */\n\tUndo,\n\t/** A commit that is the result of a redo from this client. */\n\tRedo,\n}\n\n/**\n * Information about a commit that has been applied.\n *\n * @sealed @public\n */\nexport interface CommitMetadata {\n\t/**\n\t * A {@link CommitKind} enum value describing whether the commit represents an Edit, an Undo, or a Redo.\n\t */\n\treadonly kind: CommitKind;\n\t/**\n\t * Indicates whether the commit is a local edit\n\t */\n\treadonly isLocal: boolean;\n}\n\n/**\n * Information about a change that has been applied by the local client.\n * @sealed @alpha\n */\nexport interface LocalChangeMetadata extends CommitMetadata {\n\t/**\n\t * Whether the change was made on the local machine/client or received from a remote client.\n\t */\n\treadonly isLocal: true;\n\t/**\n\t * Returns a serializable object that encodes the change.\n\t * @remarks This is only available for local changes.\n\t * This change object can be {@link UntypedTreeViewAlpha.applyChange | applied to another view} in the same state as the one which generated it.\n\t * The change object must be applied to a SharedTree with the same IdCompressor session ID as it was created from.\n\t * @privateRemarks\n\t * This is a `SerializedChange` from treeCheckout.ts.\n\t */\n\tgetChange(): JsonCompatibleReadOnly;\n\t/**\n\t * Returns an object (a {@link RevertibleAlpha | \"revertible\"}) that can be used to revert the change that produced this event.\n\t * @remarks This is only available for local changes.\n\t * If the change is not revertible (for example, it was a change to the application schema), then this will return `undefined`.\n\t * Revertibles should be disposed when they are no longer needed.\n\t * @param onDisposed - A callback that will be invoked when the `Revertible` is disposed.\n\t * This happens when the `Revertible` is disposed manually or when the `TreeView` that the `Revertible` belongs to is disposed - whichever happens first.\n\t * This is typically used to clean up any resources associated with the `Revertible` in the host application.\n\t * @throws Throws an error if called outside the scope of the `changed` event that provided it.\n\t */\n\tgetRevertible(\n\t\tonDisposed?: (revertible: RevertibleAlpha) => void,\n\t): RevertibleAlpha | undefined;\n\n\t/**\n\t * Optional label provided by the user when commit was created.\n\t * This can be used by undo/redo to group or classify edits.\n\t */\n\treadonly label?: unknown;\n\n\t/**\n\t * A set of {@link RunTransactionParamsBeta.label | labels} for all transactions (nested or otherwise)\n\t * that made up this change.\n\t * This can be used to identify, group, or filter changes — for example, to decide whether a change\n\t * should be included in an undo/redo stack.\n\t *\n\t * @remarks\n\t * The optional {@link TransactionLabels.tree | tree} property provides the structural nesting\n\t * of the transactions as a {@link LabelTree}.\n\t *\n\t * The `tree` property is present whenever the change was produced by a transaction that\n\t * includes at least one label. If the change was unlabeled,\n\t * `tree` is `undefined` and the set is empty.\n\t *\n\t * @example\n\t * Checking whether a change was produced by a specific kind of transaction:\n\t * ```typescript\n\t * branch.events.on(\"changed\", (metadata) => {\n\t * if (metadata.labels.has(\"testLabel\")) {\n\t * // This change came from a transaction labeled \"testLabel\"\n\t * }\n\t * });\n\t * ```\n\t *\n\t * @example\n\t * A nested transaction produces a tree that reflects the nesting:\n\t * ```typescript\n\t * tree.runTransaction(() => {\n\t * tree.runTransaction(() => { ... }, { label: \"inner\" });\n\t * }, { label: \"outer\" });\n\t * // metadata.labels.has(\"inner\") === true\n\t * // metadata.labels.tree will be:\n\t * // { label: \"outer\", sublabels: [{ label: \"inner\", sublabels: [] }] }\n\t * ```\n\t */\n\treadonly labels: TransactionLabels;\n\n\t/**\n\t * Events related to a local change that has been applied.\n\t */\n\treadonly events: Listenable<LocalCommitEvents>;\n}\n\n/**\n * Events related to a local commit that has been applied.\n * @sealed @alpha\n */\nexport interface LocalCommitEvents {\n\t/**\n\t * Fired once a commit has been ordered by the sequencing service.\n\t * @param outcome - information about what changes from the commit were applied or not\n\t *\n\t * @remarks\n\t * Once a commit is sequenced, the following guarantees hold:\n\t * 1. The changes carried by the commit have been persisted and other peers are able to see them.\n\t * 2. There can be no more concurrent changes sequenced before this commit, which means this commit has reached its settled form.\n\t *\n\t * This event can be used by applications to inform the end user that their changes have been saved (`CommitOutcome.FullyApplied`) or rejected (`CommitOutcome.FullyDropped` and `CommitOutcome.NewContentOnly`).\n\t * It can also be used to queue up a new attempt at making the rejected changes. Note however that new edits must be made outside of the event callback.\n\t * @example Notifying the user of the outcome and allowing them to retry:\n\t * ```typescript\n\t * // Use `asAlpha` API to access the settled event API\n\t * const view = asAlpha(tree.viewWith(config));\n\t *\n\t * // Function to clear all contents of the tree, with a precondition that no changes have occurred.\n\t * const clearAllContents = () => {\n\t * \tview.runTransaction(\n\t * \t\t() => {\n\t * \t\t\t// Remove all contents at the root\n\t * \t\t\tview.root.removeRange();\n\t * \t\t},\n\t * \t\t{ preconditions: [{ type: \"noChange\" }] },\n\t * \t);\n\t * };\n\t *\n\t * // Register the logic for notifying the user of the outcome and allow them to retry\n\t * view.events.on(\"changed\", (metadata) => {\n\t * \tif (metadata.isLocal) {\n\t * \t\tmetadata.events.on(\"settled\", (outcome) => {\n\t * \t\t\tif (outcome === CommitOutcome.FullyApplied) {\n\t * \t\t\t\talert(\"Clear operation succeeded.\");\n\t * \t\t\t} else {\n\t * \t\t\t\tconst shouldTryAgain = confirm(\n\t * \t\t\t\t\t\"The contents have changed. Do you still want to clear everything?\",\n\t * \t\t\t\t);\n\t * \t\t\t\tif (shouldTryAgain) {\n\t * \t\t\t\t\t// It is invalid to make edits during the event callback, so we schedule the retry to occur asynchronously.\n\t * \t\t\t\t\tsetTimeout(clearAllContents);\n\t * \t\t\t\t} else {\n\t * \t\t\t\t\talert(\"Clear operation aborted.\");\n\t * \t\t\t\t}\n\t * \t\t\t}\n\t * \t\t});\n\t * \t}\n\t * });\n\t *\n\t * // First attempt to clear all contents.\n\t * // This will synchronously trigger the changed \"event\" and register the listener for the settled event.\n\t * clearAllContents();\n\t * ```\n\t */\n\tsettled(outcome: CommitOutcome): void;\n}\n\n/**\n * A tree representing the nesting structure of transaction labels.\n *\n * @remarks\n * Each transaction contributes a node whose {@link LabelTree.label} is its\n * {@link RunTransactionParamsBeta.label | label} (or `undefined` if no label was provided).\n * When transactions are nested, inner transaction nodes become {@link LabelTree.sublabels | sublabels}\n * of outer ones.\n *\n * @sealed @alpha\n */\nexport interface LabelTree {\n\t/**\n\t * The label for this transaction, or `undefined` if no label was provided.\n\t */\n\tlabel: unknown;\n\n\t/**\n\t * The label trees of any nested transactions within this one.\n\t */\n\tsublabels: LabelTree[];\n}\n\n/**\n * A set of transaction labels with an optional structural tree.\n *\n * @remarks\n * The set contains all label values from the transactions that produced the change.\n * Use standard {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set | Set}\n * methods to check for specific labels.\n *\n * The optional {@link TransactionLabels.tree | tree} property provides the structural nesting\n * of the transactions as a {@link LabelTree}.\n *\n * @sealed @alpha\n */\nexport type TransactionLabels = Set<unknown> & { tree?: LabelTree };\n\n/**\n * Details about what changes from a commit were applied or not.\n * @alpha\n */\nexport enum CommitOutcome {\n\t/**\n\t * All of the changes in the commit were applied.\n\t */\n\tFullyApplied,\n\t/**\n\t * None of the changes in the commit were applied.\n\t * @remarks\n\t * This occurs when an implicit constraint has been violated.\n\t * Implicit constraints are those that are automatically enforced by SharedTree on all changes.\n\t *\n\t * Such a violation typically arises in one of two scenarios:\n\t * 1. A schema change conflicts with a concurrent data or schema change that was sequenced before it.\n\t * 2. A data change conflicts with a concurrent schema change that was sequenced before it.\n\t */\n\tFullyDropped,\n\t/**\n\t * Only the creation of new content was applied.\n\t * All other changes (including the insertion and/or modification of the new content) were dropped.\n\t * @remarks\n\t * This occurs when at least one explicit constraint has been violated\n\t * (and no implicit constraints were violated.)\n\t *\n\t * Explicit constraints are those that are explicitly added\n\t * through {@link RunTransactionParamsAlpha.preconditions | preconditions}\n\t * or {@link TransactionCallbackStatusAlpha.preconditionsOnRevert | preconditionsOnRevert}.\n\t *\n\t * The new content may be edited (and potentially inserted) by subsequent commits,\n\t * assuming those commits are not themselves subject to constraint violations.\n\t * Note that, if left uninserted, new content will eventually be garbage-collected from the document.\n\t *\n\t * Applications typically choose to treat this outcome as equivalent to {@link CommitOutcome.FullyDropped | FullyDropped}\n\t * and, when reattempting the change, generate a different copy of the new content if any.\n\t *\n\t * @privateRemarks\n\t * New content is preserved so that subsequent commits that reference it without having to carry their own copies of it.\n\t * This can become expensive: one extra copy per subsequent commit, included in both in cases where we know the prior commit was dropped and in cases where we don't yet know.\n\t * We could instead drop all subsequent commits that reference the new content, but that would create a greater risk of data loss.\n\t */\n\tNewContentOnly,\n}\n\n/**\n * Information about a change that has been applied by a remote client.\n * @sealed @alpha\n */\nexport interface RemoteChangeMetadata extends CommitMetadata {\n\t/**\n\t * Whether the change was made on the local machine/client or received from a remote client.\n\t */\n\treadonly isLocal: false;\n\t/**\n\t * Returns a serializable object that encodes the change.\n\t * @remarks This is only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly getChange?: undefined;\n\t/**\n\t * Returns an object (a {@link RevertibleAlpha | \"revertible\"}) that can be used to revert the change that produced this event.\n\t * @remarks This is only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly getRevertible?: undefined;\n\t/**\n\t * Label provided by the user when commit was created.\n\t * @remarks This is only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly label?: undefined;\n\t/**\n\t * A set of labels from nested transaction labels.\n\t * @remarks This is always empty for remote changes. Labels are only available for {@link LocalChangeMetadata | local changes}.\n\t */\n\treadonly labels: TransactionLabels;\n}\n\n/**\n * Information about a {@link LocalChangeMetadata | local} or {@link RemoteChangeMetadata | remote} change that has been applied.\n * @sealed @alpha\n */\nexport type ChangeMetadata = LocalChangeMetadata | RemoteChangeMetadata;\n\n/**\n * Creates a new graph commit object. This is useful for creating copies of commits with different parentage.\n * @param parent - the parent of the new commit\n * @param commit - the contents of the new commit object\n * @returns the new commit object\n */\n// Note that this function is synchronous, and therefore it is not a Promise.\n// However, it is still a strong commit-mint.\nexport function mintCommit<TChange>(\n\tparent: GraphCommit<TChange>,\n\tcommit: Omit<GraphCommit<TChange>, \"parent\">,\n): GraphCommit<TChange> {\n\tconst { revision, change, customMetadata } = commit;\n\treturn {\n\t\trevision,\n\t\tchange,\n\t\tparent,\n\t\tcustomMetadata,\n\t};\n}\n\nexport type ChangeAtomIdRangeMap<V> = RangeMap<ChangeAtomId, V>;\n\nexport function newChangeAtomIdRangeMap<V>(\n\toffsetValue?: (value: V, offset: number) => V,\n): ChangeAtomIdRangeMap<V> {\n\treturn new RangeMap(offsetChangeAtomId, subtractChangeAtomIds, offsetValue);\n}\n\nexport function newChangeAtomIdTransform(): ChangeAtomIdRangeMap<ChangeAtomId> {\n\treturn new RangeMap(offsetChangeAtomId, subtractChangeAtomIds, offsetChangeAtomId);\n}\n\nexport function subtractChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): number {\n\tconst cmp = comparePartialRevisions(a.revision, b.revision);\n\tif (cmp !== 0) {\n\t\treturn cmp * Number.POSITIVE_INFINITY;\n\t}\n\n\treturn a.localId - b.localId;\n}\n\n/**\n * Compares two {@link RevisionTag}s to form a strict total ordering.\n * @remarks This function tolerates arbitrary strings, not just the string \"root\".\n * It sorts as follows: `undefined` \\< `string` \\< `number`\n */\nexport function comparePartialRevisions(\n\ta: RevisionTag | undefined,\n\tb: RevisionTag | undefined,\n): number {\n\tif (typeof a === \"number\") {\n\t\treturn typeof b === \"number\" ? a - b : 1;\n\t} else if (typeof b === \"number\") {\n\t\treturn -1;\n\t}\n\n\treturn comparePartialStrings(a, b);\n}\n"]}
@@ -60,6 +60,8 @@ export const storedEmptyFieldSchema = {
60
60
  */
61
61
  export const identifierFieldKindIdentifier = "Identifier";
62
62
  export class TreeNodeStoredSchema {
63
+ metadata;
64
+ _typeCheck;
63
65
  /**
64
66
  * Constructor for a TreeNodeStoredSchema.
65
67
  * @param metadata - Persisted metadata for this node schema.
@@ -69,6 +71,7 @@ export class TreeNodeStoredSchema {
69
71
  }
70
72
  }
71
73
  export class ObjectNodeStoredSchema extends TreeNodeStoredSchema {
74
+ objectNodeFields;
72
75
  /**
73
76
  * @param objectNodeFields - Schema for fields with keys scoped to this TreeNodeStoredSchema.
74
77
  * This refers to the TreeFieldStoredSchema directly
@@ -110,6 +113,7 @@ export class ObjectNodeStoredSchema extends TreeNodeStoredSchema {
110
113
  }
111
114
  }
112
115
  export class MapNodeStoredSchema extends TreeNodeStoredSchema {
116
+ mapFields;
113
117
  /**
114
118
  * @param mapFields - Allows using the fields as a map, with the keys being
115
119
  * FieldKeys and the values being constrained by this TreeFieldStoredSchema.
@@ -135,6 +139,7 @@ export class MapNodeStoredSchema extends TreeNodeStoredSchema {
135
139
  }
136
140
  }
137
141
  export class LeafNodeStoredSchema extends TreeNodeStoredSchema {
142
+ leafValue;
138
143
  /**
139
144
  * @param leafValue - There are several approaches for how to store actual data in the tree
140
145
  * (special node types, special field contents, data on nodes etc.)
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAE3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAIN,UAAU,EACV,SAAS,EACT,UAAU,GACV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAIN,oBAAoB,GAGpB,MAAM,eAAe,CAAC;AASvB;;GAEG;AACH,MAAM,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K,SAAS;QAC5C,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE;QACpB,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAA2B;IAC5D,MAAM,GAAG,GAA0B;QAClC,kFAAkF;QAClF,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;QAC5B,iBAAiB,EAAE,MAAM,CAAC,QAAQ;KAClC,CAAC;IACF,OAAO,GAAG,CAAC;AACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport { DiscriminatedUnionDispatcher } from \"../../codec/index.js\";\nimport {\n\ttype JsonCompatibleReadOnlyObject,\n\ttype MakeNominal,\n\ttype Values,\n\tbrandConst,\n\tinvertMap,\n\tstrictEnum,\n} from \"../../util/index.js\";\n\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype FieldSchemaFormat as FieldSchemaFormatV1,\n\tPersistedValueSchema,\n\ttype TreeNodeSchemaDataFormat as TreeNodeSchemaDataFormatV1,\n\ttype TreeNodeSchemaIdentifier,\n} from \"./formatV1.js\";\nimport type {\n\tFieldSchemaFormat as FieldSchemaFormatV2,\n\tPersistedMetadataFormat,\n\tTreeNodeSchemaUnionFormat,\n\tTreeNodeSchemaDataFormat as TreeNodeSchemaDataFormatV2,\n} from \"./formatV2.js\";\nimport type { Multiplicity } from \"./multiplicity.js\";\n\n/**\n * The format version for the schema.\n */\nexport const SchemaFormatVersion = strictEnum(\"SchemaFormatVersion\", {\n\tv1: 1,\n\t/**\n\t * Adds persisted metadata to the node schema and field schema.\n\t */\n\tv2: 2,\n});\nexport type SchemaFormatVersion = Values<typeof SchemaFormatVersion>;\n\ntype FieldSchemaFormat = FieldSchemaFormatV1 | FieldSchemaFormatV2;\n\n/**\n * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.\n * @privateRemarks\n * See also {@link TreeValue}.\n * If further stabilizing this,\n * consider the implications of how this might prevent adding of new leaf types in the future.\n * Maybe add a disclaimer that it might be extended like on {@link NodeKind}?\n * @alpha\n */\nexport enum ValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Set of allowed tree types.\n * Providing multiple values here allows polymorphism, tagged union style.\n *\n * In the future, this could be extended to allow inlining a TreeNodeStoredSchema here\n * (or some similar structural schema system).\n * For structural types which could go here, there are a few interesting options:\n *\n * - Allow replacing the whole set with a structural type for terminal / non-tree data,\n * and use this as a replacement for values on the tree nodes.\n *\n * - Allow expression structural constraints for child trees, for example requiring specific traits\n * (ex: via TreeNodeStoredSchema), instead of by type.\n *\n * There are two ways this could work:\n *\n * - Constrain the child nodes based on their shape:\n * this makes schema safe editing difficult because nodes would incur extra editing constraints to prevent them\n * from going out of schema based on their location in such a field.\n *\n * - Constrain the types allowed based on which types guarantee their data will always meet the constraints.\n *\n * Care would need to be taken to make sure this is sound for the schema updating mechanisms.\n */\nexport type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;\n\n/**\n * Declarative portion of a {@link FlexFieldKind}.\n *\n * @remarks\n * Enough info about a field kind to know if a given tree is is schema.\n *\n * Note that compatibility between trees and schema is not sufficient to evaluate if a schema upgrade should be allowed.\n * Currently schema upgrades are restricted to field kind changes which can not be cyclic (like version upgrades but not down grades).\n * See {@link FlexFieldKind.allowsFieldSuperset} for more details.\n */\nexport interface FieldKindData {\n\t/**\n\t * Globally scoped identifier.\n\t */\n\treadonly identifier: FieldKindIdentifier;\n\t/**\n\t * Bound on the number of children that fields of this kind may have.\n\t * TODO: consider replacing this with numeric upper and lower bounds.\n\t */\n\treadonly multiplicity: Multiplicity;\n}\n\n/**\n * Everything needed to define what it means for a tree to be in schema.\n */\nexport interface SchemaAndPolicy {\n\treadonly schema: StoredSchemaCollection;\n\treadonly policy: SchemaPolicy;\n}\n\n/**\n * Extra data needed to interpret stored schema.\n * @remarks\n * This contains information that describes the semantics of things which can be referenced in stored schema.\n * For example, field kind identifiers refer to specific field kinds, which imply specific rules around what is valid in a given field (the multiplicity).\n * This structure provides such information, allowing it to be possible to determine if a given tree complies with a particular stored schema.\n */\nexport interface SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handle fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindData>;\n}\n\n/**\n * Schema for a field.\n * Object implementing this interface should never be modified.\n */\nexport interface TreeFieldStoredSchema {\n\treadonly kind: FieldKindIdentifier;\n\n\t/**\n\t * The set of allowed child types.\n\t * If not specified, types are unconstrained.\n\t */\n\treadonly types: TreeTypeSet;\n\n\t/**\n\t * Portion of the metadata which can be persisted.\n\t * @remarks\n\t * Discarded when encoding to {@link SchemaFormatVersion.V1}.\n\t * @privateRemarks\n\t * This field corresponds to the `metadata` field in the persisted schema format.\n\t */\n\treadonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined;\n}\n\n/**\n * Identifier used for the FieldKind for fields which must be empty.\n *\n * @remarks\n * This mainly show up in:\n *\n * 1. The root default field for documents.\n *\n * 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.\n */\nexport const forbiddenFieldKindIdentifier = brandConst(\"Forbidden\")<FieldKindIdentifier>();\n\n/**\n * A schema for empty fields (fields which must always be empty).\n * There are multiple ways this could be encoded, but this is the most explicit.\n */\nexport const storedEmptyFieldSchema: TreeFieldStoredSchema = {\n\t// This kind requires the field to be empty.\n\tkind: forbiddenFieldKindIdentifier,\n\t// This type set also forces the field to be empty not not allowing any types as all.\n\ttypes: new Set(),\n\tpersistedMetadata: undefined,\n};\n\n/**\n * Identifier used for the FieldKind for fields of type identifier.\n */\nexport const identifierFieldKindIdentifier = \"Identifier\";\n\nexport abstract class TreeNodeStoredSchema {\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * Constructor for a TreeNodeStoredSchema.\n\t * @param metadata - Persisted metadata for this node schema.\n\t */\n\tpublic constructor(public readonly metadata: PersistedMetadataFormat | undefined) {}\n\n\t/**\n\t * Encode in the v1 schema format.\n\t */\n\tpublic abstract encodeV1(): TreeNodeSchemaDataFormatV1;\n\n\t/**\n\t * Encode in the v2 schema format.\n\t * @remarks Post-condition: if metadata was specified on the input schema, it will be present in the output.\n\t */\n\tpublic abstract encodeV2(): TreeNodeSchemaDataFormatV2;\n\n\t/**\n\t * Returns the schema for the provided field.\n\t */\n\tpublic abstract getFieldSchema(field: FieldKey): TreeFieldStoredSchema;\n}\n\nexport class ObjectNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param objectNodeFields - Schema for fields with keys scoped to this TreeNodeStoredSchema.\n\t * This refers to the TreeFieldStoredSchema directly\n\t * (as opposed to just supporting FieldSchemaIdentifier and having a central FieldKey -\\> TreeFieldStoredSchema map).\n\t * This allows us short friendly field keys which can be ergonomically used as field names in code.\n\t * It also interoperates well with mapFields being used as a map with arbitrary data as keys.\n\t */\n\tpublic constructor(\n\t\tpublic readonly objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>,\n\t\tmetadata?: PersistedMetadataFormat | undefined,\n\t) {\n\t\tsuper(metadata);\n\t}\n\n\tpublic override encodeV1(): TreeNodeSchemaDataFormatV1 {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> =\n\t\t\tthis.encodeFieldsObject(encodeFieldSchemaV1);\n\n\t\treturn {\n\t\t\tobject: fieldsObject,\n\t\t};\n\t}\n\n\tpublic override encodeV2(): TreeNodeSchemaDataFormatV2 {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> =\n\t\t\tthis.encodeFieldsObject(encodeFieldSchemaV2);\n\t\tconst kind = { object: fieldsObject };\n\n\t\treturn { kind, metadata: this.metadata };\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.objectNodeFields.get(field) ?? storedEmptyFieldSchema;\n\t}\n\n\tprivate encodeFieldsObject(\n\t\tencodeFieldSchema: (storedFieldSchema: TreeFieldStoredSchema) => FieldSchemaFormat,\n\t): Record<string, FieldSchemaFormat> {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> = Object.create(null) as Record<\n\t\t\tstring,\n\t\t\tFieldSchemaFormat\n\t\t>;\n\t\t// Sort fields to ensure output is identical for for equivalent schema (since field order is not considered significant).\n\t\t// This makes comparing schema easier, and ensures chunk reuse for schema summaries isn't needlessly broken.\n\t\tfor (const key of [...this.objectNodeFields.keys()].sort()) {\n\t\t\tObject.defineProperty(fieldsObject, key, {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: encodeFieldSchema(\n\t\t\t\t\tthis.objectNodeFields.get(key) ?? fail(0xae7 /* missing field */),\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\t\treturn fieldsObject;\n\t}\n}\n\nexport class MapNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param mapFields - Allows using the fields as a map, with the keys being\n\t * FieldKeys and the values being constrained by this TreeFieldStoredSchema.\n\t * Usually `FieldKind.Value` should NOT be used here\n\t * since no nodes can ever be in schema if you use `FieldKind.Value` here\n\t * (that would require infinite children).\n\t */\n\tpublic constructor(\n\t\tpublic readonly mapFields: TreeFieldStoredSchema,\n\t\tmetadata?: PersistedMetadataFormat | undefined,\n\t) {\n\t\tsuper(metadata);\n\t}\n\n\tpublic override encodeV1(): TreeNodeSchemaDataFormatV1 {\n\t\treturn {\n\t\t\tmap: encodeFieldSchemaV1(this.mapFields),\n\t\t};\n\t}\n\n\tpublic override encodeV2(): TreeNodeSchemaDataFormatV2 {\n\t\tconst kind = { map: encodeFieldSchemaV2(this.mapFields) };\n\t\treturn { kind, metadata: this.metadata };\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.mapFields;\n\t}\n}\n\nexport class LeafNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param leafValue - There are several approaches for how to store actual data in the tree\n\t * (special node types, special field contents, data on nodes etc.)\n\t * as well as several options about how the data should be modeled at this level\n\t * (byte sequence? javascript type? json?),\n\t * as well as options for how much of this would be exposed in the schema language\n\t * (ex: would all nodes with values be special built-ins, or could any schema add them?)\n\t * A simple easy to do in javascript approach is taken here:\n\t * this is not intended to be a suggestion of what approach to take, or what to expose in the schema language.\n\t * This is simply one approach that can work for modeling them in the internal schema representation.\n\t */\n\tpublic constructor(public readonly leafValue: ValueSchema) {\n\t\t// No metadata for leaf nodes.\n\t\tsuper(undefined);\n\t}\n\n\tpublic override encodeV1(): TreeNodeSchemaDataFormatV1 {\n\t\treturn {\n\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t};\n\t}\n\n\tpublic override encodeV2(): TreeNodeSchemaDataFormatV2 {\n\t\treturn {\n\t\t\t// No metadata for leaf nodes, so don't emit a metadata field.\n\t\t\tkind: {\n\t\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn storedEmptyFieldSchema;\n\t}\n}\n\n/**\n * Decoder wrapper function for {@link TreeNodeStoredSchema} implementations.\n * Curries the constructor so that the caller can inject metadata.\n */\ntype StoredSchemaDecoder = (\n\tmetadata: PersistedMetadataFormat | undefined,\n) => TreeNodeStoredSchema;\n\nexport const storedSchemaDecodeDispatcher: DiscriminatedUnionDispatcher<\n\tTreeNodeSchemaUnionFormat,\n\t[],\n\tStoredSchemaDecoder\n> = new DiscriminatedUnionDispatcher({\n\tleaf: (data: PersistedValueSchema) => (metadata) =>\n\t\tnew LeafNodeStoredSchema(decodeValueSchema(data)),\n\tobject: (data: Record<TreeNodeSchemaIdentifier, FieldSchemaFormat>) => (metadata) => {\n\t\tconst map = new Map();\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tmap.set(key, decodeFieldSchema(value));\n\t\t}\n\t\treturn new ObjectNodeStoredSchema(map, metadata);\n\t},\n\tmap: (data: FieldSchemaFormat) => (metadata) =>\n\t\tnew MapNodeStoredSchema(decodeFieldSchema(data), metadata),\n});\n\nconst valueSchemaEncode = new Map([\n\t[ValueSchema.Number, PersistedValueSchema.Number],\n\t[ValueSchema.String, PersistedValueSchema.String],\n\t[ValueSchema.Boolean, PersistedValueSchema.Boolean],\n\t[ValueSchema.FluidHandle, PersistedValueSchema.FluidHandle],\n\t[ValueSchema.Null, PersistedValueSchema.Null],\n]);\n\nconst valueSchemaDecode = invertMap(valueSchemaEncode);\n\nfunction encodeValueSchema(inMemory: ValueSchema): PersistedValueSchema {\n\treturn valueSchemaEncode.get(inMemory) ?? fail(0xae8 /* missing PersistedValueSchema */);\n}\n\nfunction decodeValueSchema(inMemory: PersistedValueSchema): ValueSchema {\n\treturn valueSchemaDecode.get(inMemory) ?? fail(0xae9 /* missing ValueSchema */);\n}\n\nexport function encodeFieldSchemaV1(schema: TreeFieldStoredSchema): FieldSchemaFormatV1 {\n\treturn {\n\t\tkind: schema.kind,\n\t\t// Types are sorted by identifier to improve stability of persisted data to increase chance of schema blob reuse.\n\t\ttypes: [...schema.types].sort(),\n\t};\n}\n\nexport function encodeFieldSchemaV2(schema: TreeFieldStoredSchema): FieldSchemaFormatV2 {\n\tconst fieldSchema: FieldSchemaFormatV1 = encodeFieldSchemaV1(schema);\n\n\t// Omit metadata from the output if it is undefined\n\treturn schema.persistedMetadata === undefined\n\t\t? { ...fieldSchema }\n\t\t: { ...fieldSchema, metadata: schema.persistedMetadata };\n}\n\nexport function decodeFieldSchema(schema: FieldSchemaFormatV2): TreeFieldStoredSchema {\n\tconst out: TreeFieldStoredSchema = {\n\t\t// TODO: maybe provide actual FieldKind objects here, error on unrecognized kinds.\n\t\tkind: schema.kind,\n\t\ttypes: new Set(schema.types),\n\t\tpersistedMetadata: schema.metadata,\n\t};\n\treturn out;\n}\n\n/**\n * Document schema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hand onto a specific version, make a copy.\n */\nexport interface TreeStoredSchema extends StoredSchemaCollection {\n\t/**\n\t * Schema for the root field which contains the whole tree.\n\t */\n\treadonly rootFieldSchema: TreeFieldStoredSchema;\n}\n\n/**\n * Collection of TreeNodeSchema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hang onto a specific version, make a copy.\n */\nexport interface StoredSchemaCollection {\n\t/**\n\t * {@inheritdoc StoredSchemaCollection}\n\t */\n\treadonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n}\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAE3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAIN,UAAU,EACV,SAAS,EACT,UAAU,GACV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAIN,oBAAoB,GAGpB,MAAM,eAAe,CAAC;AASvB;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC,qBAAqB,EAAE;IACpE,EAAE,EAAE,CAAC;IACL;;OAEG;IACH,EAAE,EAAE,CAAC;CACL,CAAC,CAAC;AAKH;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,WAMX;AAND,WAAY,WAAW;IACtB,iDAAM,CAAA;IACN,iDAAM,CAAA;IACN,mDAAO,CAAA;IACP,2DAAW,CAAA;IACX,6CAAI,CA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AI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;QAC5B,iBAAiB,EAAE,MAAM,CAAC,QAAQ;KAClC,CAAC;IACF,OAAO,GAAG,CAAC;AACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport { DiscriminatedUnionDispatcher } from \"../../codec/index.js\";\nimport {\n\ttype JsonCompatibleReadOnlyObject,\n\ttype MakeNominal,\n\ttype Values,\n\tbrandConst,\n\tinvertMap,\n\tstrictEnum,\n} from \"../../util/index.js\";\n\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype FieldSchemaFormat as FieldSchemaFormatV1,\n\tPersistedValueSchema,\n\ttype TreeNodeSchemaDataFormat as TreeNodeSchemaDataFormatV1,\n\ttype TreeNodeSchemaIdentifier,\n} from \"./formatV1.js\";\nimport type {\n\tFieldSchemaFormat as FieldSchemaFormatV2,\n\tPersistedMetadataFormat,\n\tTreeNodeSchemaUnionFormat,\n\tTreeNodeSchemaDataFormat as TreeNodeSchemaDataFormatV2,\n} from \"./formatV2.js\";\nimport type { Multiplicity } from \"./multiplicity.js\";\n\n/**\n * The format version for the schema.\n */\nexport const SchemaFormatVersion = strictEnum(\"SchemaFormatVersion\", {\n\tv1: 1,\n\t/**\n\t * Adds persisted metadata to the node schema and field schema.\n\t */\n\tv2: 2,\n});\nexport type SchemaFormatVersion = Values<typeof SchemaFormatVersion>;\n\ntype FieldSchemaFormat = FieldSchemaFormatV1 | FieldSchemaFormatV2;\n\n/**\n * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.\n * @privateRemarks\n * See also {@link TreeValue}.\n * If further stabilizing this,\n * consider the implications of how this might prevent adding of new leaf types in the future.\n * Maybe add a disclaimer that it might be extended like on {@link NodeKind}?\n * @alpha\n */\nexport enum ValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Set of allowed tree types.\n * Providing multiple values here allows polymorphism, tagged union style.\n *\n * In the future, this could be extended to allow inlining a TreeNodeStoredSchema here\n * (or some similar structural schema system).\n * For structural types which could go here, there are a few interesting options:\n *\n * - Allow replacing the whole set with a structural type for terminal / non-tree data,\n * and use this as a replacement for values on the tree nodes.\n *\n * - Allow expression structural constraints for child trees, for example requiring specific traits\n * (ex: via TreeNodeStoredSchema), instead of by type.\n *\n * There are two ways this could work:\n *\n * - Constrain the child nodes based on their shape:\n * this makes schema safe editing difficult because nodes would incur extra editing constraints to prevent them\n * from going out of schema based on their location in such a field.\n *\n * - Constrain the types allowed based on which types guarantee their data will always meet the constraints.\n *\n * Care would need to be taken to make sure this is sound for the schema updating mechanisms.\n */\nexport type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;\n\n/**\n * Declarative portion of a {@link FlexFieldKind}.\n *\n * @remarks\n * Enough info about a field kind to know if a given tree is is schema.\n *\n * Note that compatibility between trees and schema is not sufficient to evaluate if a schema upgrade should be allowed.\n * Currently schema upgrades are restricted to field kind changes which can not be cyclic (like version upgrades but not down grades).\n * See {@link FlexFieldKind.allowsFieldSuperset} for more details.\n */\nexport interface FieldKindData {\n\t/**\n\t * Globally scoped identifier.\n\t */\n\treadonly identifier: FieldKindIdentifier;\n\t/**\n\t * Bound on the number of children that fields of this kind may have.\n\t * TODO: consider replacing this with numeric upper and lower bounds.\n\t */\n\treadonly multiplicity: Multiplicity;\n}\n\n/**\n * Everything needed to define what it means for a tree to be in schema.\n */\nexport interface SchemaAndPolicy {\n\treadonly schema: StoredSchemaCollection;\n\treadonly policy: SchemaPolicy;\n}\n\n/**\n * Extra data needed to interpret stored schema.\n * @remarks\n * This contains information that describes the semantics of things which can be referenced in stored schema.\n * For example, field kind identifiers refer to specific field kinds, which imply specific rules around what is valid in a given field (the multiplicity).\n * This structure provides such information, allowing it to be possible to determine if a given tree complies with a particular stored schema.\n */\nexport interface SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handle fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindData>;\n}\n\n/**\n * Schema for a field.\n * Object implementing this interface should never be modified.\n */\nexport interface TreeFieldStoredSchema {\n\treadonly kind: FieldKindIdentifier;\n\n\t/**\n\t * The set of allowed child types.\n\t * If not specified, types are unconstrained.\n\t */\n\treadonly types: TreeTypeSet;\n\n\t/**\n\t * Portion of the metadata which can be persisted.\n\t * @remarks\n\t * Discarded when encoding to {@link SchemaFormatVersion.V1}.\n\t * @privateRemarks\n\t * This field corresponds to the `metadata` field in the persisted schema format.\n\t */\n\treadonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined;\n}\n\n/**\n * Identifier used for the FieldKind for fields which must be empty.\n *\n * @remarks\n * This mainly show up in:\n *\n * 1. The root default field for documents.\n *\n * 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.\n */\nexport const forbiddenFieldKindIdentifier = brandConst(\"Forbidden\")<FieldKindIdentifier>();\n\n/**\n * A schema for empty fields (fields which must always be empty).\n * There are multiple ways this could be encoded, but this is the most explicit.\n */\nexport const storedEmptyFieldSchema: TreeFieldStoredSchema = {\n\t// This kind requires the field to be empty.\n\tkind: forbiddenFieldKindIdentifier,\n\t// This type set also forces the field to be empty not not allowing any types as all.\n\ttypes: new Set(),\n\tpersistedMetadata: undefined,\n};\n\n/**\n * Identifier used for the FieldKind for fields of type identifier.\n */\nexport const identifierFieldKindIdentifier = \"Identifier\";\n\nexport abstract class TreeNodeStoredSchema {\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * Constructor for a TreeNodeStoredSchema.\n\t * @param metadata - Persisted metadata for this node schema.\n\t */\n\tpublic constructor(public readonly metadata: PersistedMetadataFormat | undefined) {}\n\n\t/**\n\t * Encode in the v1 schema format.\n\t */\n\tpublic abstract encodeV1(): TreeNodeSchemaDataFormatV1;\n\n\t/**\n\t * Encode in the v2 schema format.\n\t * @remarks Post-condition: if metadata was specified on the input schema, it will be present in the output.\n\t */\n\tpublic abstract encodeV2(): TreeNodeSchemaDataFormatV2;\n\n\t/**\n\t * Returns the schema for the provided field.\n\t */\n\tpublic abstract getFieldSchema(field: FieldKey): TreeFieldStoredSchema;\n}\n\nexport class ObjectNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param objectNodeFields - Schema for fields with keys scoped to this TreeNodeStoredSchema.\n\t * This refers to the TreeFieldStoredSchema directly\n\t * (as opposed to just supporting FieldSchemaIdentifier and having a central FieldKey -\\> TreeFieldStoredSchema map).\n\t * This allows us short friendly field keys which can be ergonomically used as field names in code.\n\t * It also interoperates well with mapFields being used as a map with arbitrary data as keys.\n\t */\n\tpublic constructor(\n\t\tpublic readonly objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>,\n\t\tmetadata?: PersistedMetadataFormat | undefined,\n\t) {\n\t\tsuper(metadata);\n\t}\n\n\tpublic override encodeV1(): TreeNodeSchemaDataFormatV1 {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> =\n\t\t\tthis.encodeFieldsObject(encodeFieldSchemaV1);\n\n\t\treturn {\n\t\t\tobject: fieldsObject,\n\t\t};\n\t}\n\n\tpublic override encodeV2(): TreeNodeSchemaDataFormatV2 {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> =\n\t\t\tthis.encodeFieldsObject(encodeFieldSchemaV2);\n\t\tconst kind = { object: fieldsObject };\n\n\t\treturn { kind, metadata: this.metadata };\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.objectNodeFields.get(field) ?? storedEmptyFieldSchema;\n\t}\n\n\tprivate encodeFieldsObject(\n\t\tencodeFieldSchema: (storedFieldSchema: TreeFieldStoredSchema) => FieldSchemaFormat,\n\t): Record<string, FieldSchemaFormat> {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> = Object.create(null) as Record<\n\t\t\tstring,\n\t\t\tFieldSchemaFormat\n\t\t>;\n\t\t// Sort fields to ensure output is identical for for equivalent schema (since field order is not considered significant).\n\t\t// This makes comparing schema easier, and ensures chunk reuse for schema summaries isn't needlessly broken.\n\t\tfor (const key of [...this.objectNodeFields.keys()].sort()) {\n\t\t\tObject.defineProperty(fieldsObject, key, {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: encodeFieldSchema(\n\t\t\t\t\tthis.objectNodeFields.get(key) ?? fail(0xae7 /* missing field */),\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\t\treturn fieldsObject;\n\t}\n}\n\nexport class MapNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param mapFields - Allows using the fields as a map, with the keys being\n\t * FieldKeys and the values being constrained by this TreeFieldStoredSchema.\n\t * Usually `FieldKind.Value` should NOT be used here\n\t * since no nodes can ever be in schema if you use `FieldKind.Value` here\n\t * (that would require infinite children).\n\t */\n\tpublic constructor(\n\t\tpublic readonly mapFields: TreeFieldStoredSchema,\n\t\tmetadata?: PersistedMetadataFormat | undefined,\n\t) {\n\t\tsuper(metadata);\n\t}\n\n\tpublic override encodeV1(): TreeNodeSchemaDataFormatV1 {\n\t\treturn {\n\t\t\tmap: encodeFieldSchemaV1(this.mapFields),\n\t\t};\n\t}\n\n\tpublic override encodeV2(): TreeNodeSchemaDataFormatV2 {\n\t\tconst kind = { map: encodeFieldSchemaV2(this.mapFields) };\n\t\treturn { kind, metadata: this.metadata };\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.mapFields;\n\t}\n}\n\nexport class LeafNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param leafValue - There are several approaches for how to store actual data in the tree\n\t * (special node types, special field contents, data on nodes etc.)\n\t * as well as several options about how the data should be modeled at this level\n\t * (byte sequence? javascript type? json?),\n\t * as well as options for how much of this would be exposed in the schema language\n\t * (ex: would all nodes with values be special built-ins, or could any schema add them?)\n\t * A simple easy to do in javascript approach is taken here:\n\t * this is not intended to be a suggestion of what approach to take, or what to expose in the schema language.\n\t * This is simply one approach that can work for modeling them in the internal schema representation.\n\t */\n\tpublic constructor(public readonly leafValue: ValueSchema) {\n\t\t// No metadata for leaf nodes.\n\t\tsuper(undefined);\n\t}\n\n\tpublic override encodeV1(): TreeNodeSchemaDataFormatV1 {\n\t\treturn {\n\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t};\n\t}\n\n\tpublic override encodeV2(): TreeNodeSchemaDataFormatV2 {\n\t\treturn {\n\t\t\t// No metadata for leaf nodes, so don't emit a metadata field.\n\t\t\tkind: {\n\t\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn storedEmptyFieldSchema;\n\t}\n}\n\n/**\n * Decoder wrapper function for {@link TreeNodeStoredSchema} implementations.\n * Curries the constructor so that the caller can inject metadata.\n */\ntype StoredSchemaDecoder = (\n\tmetadata: PersistedMetadataFormat | undefined,\n) => TreeNodeStoredSchema;\n\nexport const storedSchemaDecodeDispatcher: DiscriminatedUnionDispatcher<\n\tTreeNodeSchemaUnionFormat,\n\t[],\n\tStoredSchemaDecoder\n> = new DiscriminatedUnionDispatcher({\n\tleaf: (data: PersistedValueSchema) => (metadata) =>\n\t\tnew LeafNodeStoredSchema(decodeValueSchema(data)),\n\tobject: (data: Record<TreeNodeSchemaIdentifier, FieldSchemaFormat>) => (metadata) => {\n\t\tconst map = new Map();\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tmap.set(key, decodeFieldSchema(value));\n\t\t}\n\t\treturn new ObjectNodeStoredSchema(map, metadata);\n\t},\n\tmap: (data: FieldSchemaFormat) => (metadata) =>\n\t\tnew MapNodeStoredSchema(decodeFieldSchema(data), metadata),\n});\n\nconst valueSchemaEncode = new Map([\n\t[ValueSchema.Number, PersistedValueSchema.Number],\n\t[ValueSchema.String, PersistedValueSchema.String],\n\t[ValueSchema.Boolean, PersistedValueSchema.Boolean],\n\t[ValueSchema.FluidHandle, PersistedValueSchema.FluidHandle],\n\t[ValueSchema.Null, PersistedValueSchema.Null],\n]);\n\nconst valueSchemaDecode = invertMap(valueSchemaEncode);\n\nfunction encodeValueSchema(inMemory: ValueSchema): PersistedValueSchema {\n\treturn valueSchemaEncode.get(inMemory) ?? fail(0xae8 /* missing PersistedValueSchema */);\n}\n\nfunction decodeValueSchema(inMemory: PersistedValueSchema): ValueSchema {\n\treturn valueSchemaDecode.get(inMemory) ?? fail(0xae9 /* missing ValueSchema */);\n}\n\nexport function encodeFieldSchemaV1(schema: TreeFieldStoredSchema): FieldSchemaFormatV1 {\n\treturn {\n\t\tkind: schema.kind,\n\t\t// Types are sorted by identifier to improve stability of persisted data to increase chance of schema blob reuse.\n\t\ttypes: [...schema.types].sort(),\n\t};\n}\n\nexport function encodeFieldSchemaV2(schema: TreeFieldStoredSchema): FieldSchemaFormatV2 {\n\tconst fieldSchema: FieldSchemaFormatV1 = encodeFieldSchemaV1(schema);\n\n\t// Omit metadata from the output if it is undefined\n\treturn schema.persistedMetadata === undefined\n\t\t? { ...fieldSchema }\n\t\t: { ...fieldSchema, metadata: schema.persistedMetadata };\n}\n\nexport function decodeFieldSchema(schema: FieldSchemaFormatV2): TreeFieldStoredSchema {\n\tconst out: TreeFieldStoredSchema = {\n\t\t// TODO: maybe provide actual FieldKind objects here, error on unrecognized kinds.\n\t\tkind: schema.kind,\n\t\ttypes: new Set(schema.types),\n\t\tpersistedMetadata: schema.metadata,\n\t};\n\treturn out;\n}\n\n/**\n * Document schema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hand onto a specific version, make a copy.\n */\nexport interface TreeStoredSchema extends StoredSchemaCollection {\n\t/**\n\t * Schema for the root field which contains the whole tree.\n\t */\n\treadonly rootFieldSchema: TreeFieldStoredSchema;\n}\n\n/**\n * Collection of TreeNodeSchema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hang onto a specific version, make a copy.\n */\nexport interface StoredSchemaCollection {\n\t/**\n\t * {@inheritdoc StoredSchemaCollection}\n\t */\n\treadonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n}\n"]}
@@ -10,6 +10,10 @@ import { storedEmptyFieldSchema, } from "./schema.js";
10
10
  * Mutable TreeStoredSchema repository.
11
11
  */
12
12
  export class TreeStoredSchemaRepository {
13
+ nodeSchemaData;
14
+ rootFieldSchemaData;
15
+ _events = createEmitter();
16
+ events = this._events;
13
17
  /**
14
18
  * Copies in the provided schema. If `data` is an TreeStoredSchemaRepository, it will be cheap-cloned.
15
19
  * Otherwise, it will be deep-cloned.
@@ -24,8 +28,6 @@ export class TreeStoredSchemaRepository {
24
28
  * that might provide a decent alternative to mapFields (which is a bit odd).
25
29
  */
26
30
  constructor(data) {
27
- this._events = createEmitter();
28
- this.events = this._events;
29
31
  if (data === undefined) {
30
32
  this.rootFieldSchemaData = storedEmptyFieldSchema;
31
33
  this.nodeSchemaData = new BTree([], compareStrings);
@@ -1 +1 @@
1
- {"version":3,"file":"storedSchemaRepository.js","sourceRoot":"","sources":["../../../src/core/schema-stored/storedSchemaRepository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAKN,sBAAsB,GACtB,MAAM,aAAa,CAAC;AAyCrB;;GAEG;AACH,MAAM,OAAO,0BAA0B;IAM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AAI,0BAA0B,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CACD;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAsB;IACvD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,mBAAmB,CAC3B,UAAgD;IAEhD,kGAAkG;IAClG,MAAM,OAAO,GAAuD;QACnE,GAAG,UAAU,CAAC,OAAO,EAAE;KACvB,CAAC;IACF,OAAO,IAAI,KAAK,CAAiD,OAAO,EAAE,cAAc,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { Listenable } from \"@fluidframework/core-interfaces/internal\";\nimport { BTree } from \"@tylerbu/sorted-btree-es6\";\n\nimport { compareStrings } from \"../../util/index.js\";\n\nimport type { TreeNodeSchemaIdentifier } from \"./formatV1.js\";\nimport {\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tstoredEmptyFieldSchema,\n} from \"./schema.js\";\n\n/**\n * Events for {@link TreeStoredSchemaSubscription}.\n *\n * TODO: consider having before and after events per subtree instead while applying anchor (and this just shows what happens at the root).\n */\nexport interface SchemaEvents {\n\t/**\n\t * Schema change is about to be applied.\n\t */\n\tbeforeSchemaChange(newSchema: TreeStoredSchema): void;\n\n\t/**\n\t * Schema change was just applied.\n\t */\n\tafterSchemaChange(newSchema: TreeStoredSchema): void;\n}\n\n/**\n * A collection of stored schema that fires events in response to changes.\n */\nexport interface TreeStoredSchemaSubscription extends TreeStoredSchema {\n\t/**\n\t * Events for this schema subscription.\n\t */\n\treadonly events: Listenable<SchemaEvents>;\n}\n\n/**\n * Mutable collection of stored schema.\n */\nexport interface MutableTreeStoredSchema extends TreeStoredSchemaSubscription {\n\t/**\n\t * Mutates the stored schema.\n\t * Replaces all schemas with the provided schema.\n\t * Can overwrite preexisting schemas, and removes unmentioned schemas.\n\t */\n\tapply(newSchema: TreeStoredSchema): void;\n}\n\n/**\n * Mutable TreeStoredSchema repository.\n */\nexport class TreeStoredSchemaRepository implements MutableTreeStoredSchema {\n\tprotected nodeSchemaData: BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n\tprotected rootFieldSchemaData: TreeFieldStoredSchema;\n\tprotected readonly _events = createEmitter<SchemaEvents>();\n\tpublic readonly events: Listenable<SchemaEvents> = this._events;\n\n\t/**\n\t * Copies in the provided schema. If `data` is an TreeStoredSchemaRepository, it will be cheap-cloned.\n\t * Otherwise, it will be deep-cloned.\n\t *\n\t * We might not want to store schema in maps long term, as we might want a way to reserve a\n\t * large space of schema IDs within a schema.\n\t * The way mapFields has been structured mitigates the need for this, but it still might be useful.\n\t *\n\t * (ex: someone using data as field identifiers might want to\n\t * reserve all fields identifiers starting with \"foo.\" to have a specific schema).\n\t * Combined with support for such namespaces in the allowed sets in the schema objects,\n\t * that might provide a decent alternative to mapFields (which is a bit odd).\n\t */\n\tpublic constructor(data?: TreeStoredSchema) {\n\t\tif (data === undefined) {\n\t\t\tthis.rootFieldSchemaData = storedEmptyFieldSchema;\n\t\t\tthis.nodeSchemaData = new BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(\n\t\t\t\t[],\n\t\t\t\tcompareStrings,\n\t\t\t);\n\t\t} else {\n\t\t\tif (data instanceof TreeStoredSchemaRepository) {\n\t\t\t\tthis.rootFieldSchemaData = data.rootFieldSchema;\n\t\t\t\tthis.nodeSchemaData = data.nodeSchemaData.clone();\n\t\t\t} else {\n\t\t\t\tthis.rootFieldSchemaData = data.rootFieldSchema;\n\t\t\t\tthis.nodeSchemaData = cloneNodeSchemaData(data.nodeSchema);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get nodeSchema(): ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> {\n\t\t// Btree implements iterator, but not in a type-safe way\n\t\treturn this.nodeSchemaData as unknown as ReadonlyMap<\n\t\t\tTreeNodeSchemaIdentifier,\n\t\t\tTreeNodeStoredSchema\n\t\t>;\n\t}\n\n\tpublic get rootFieldSchema(): TreeFieldStoredSchema {\n\t\treturn this.rootFieldSchemaData;\n\t}\n\n\tpublic apply(newSchema: TreeStoredSchema): void {\n\t\tthis._events.emit(\"beforeSchemaChange\", newSchema);\n\t\tconst clone = new TreeStoredSchemaRepository(newSchema);\n\t\t// In the future, we could use btree's delta functionality to do a more efficient update\n\t\tthis.rootFieldSchemaData = clone.rootFieldSchemaData;\n\t\tthis.nodeSchemaData = clone.nodeSchemaData;\n\t\tthis._events.emit(\"afterSchemaChange\", newSchema);\n\t}\n\n\tpublic clone(): TreeStoredSchemaRepository {\n\t\treturn new TreeStoredSchemaRepository(this);\n\t}\n}\n\nexport function schemaDataIsEmpty(data: TreeStoredSchema): boolean {\n\treturn data.nodeSchema.size === 0;\n}\n\nfunction cloneNodeSchemaData(\n\tnodeSchema: StoredSchemaCollection[\"nodeSchema\"],\n): BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> {\n\t// Schema objects are immutable (unlike stored schema repositories), so this shallow copy is fine.\n\tconst entries: [TreeNodeSchemaIdentifier, TreeNodeStoredSchema][] = [\n\t\t...nodeSchema.entries(),\n\t];\n\treturn new BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(entries, compareStrings);\n}\n"]}
1
+ {"version":3,"file":"storedSchemaRepository.js","sourceRoot":"","sources":["../../../src/core/schema-stored/storedSchemaRepository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAKN,sBAAsB,GACtB,MAAM,aAAa,CAAC;AAyCrB;;GAEG;AAC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mB,EAAE,SAAS,CAAC,CAAC;IACnD,CAAC;IAEM,KAAK;QACX,OAAO,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CACD;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAsB;IACvD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,mBAAmB,CAC3B,UAAgD;IAEhD,kGAAkG;IAClG,MAAM,OAAO,GAAuD;QACnE,GAAG,UAAU,CAAC,OAAO,EAAE;KACvB,CAAC;IACF,OAAO,IAAI,KAAK,CAAiD,OAAO,EAAE,cAAc,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { Listenable } from \"@fluidframework/core-interfaces/internal\";\nimport { BTree } from \"@tylerbu/sorted-btree-es6\";\n\nimport { compareStrings } from \"../../util/index.js\";\n\nimport type { TreeNodeSchemaIdentifier } from \"./formatV1.js\";\nimport {\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tstoredEmptyFieldSchema,\n} from \"./schema.js\";\n\n/**\n * Events for {@link TreeStoredSchemaSubscription}.\n *\n * TODO: consider having before and after events per subtree instead while applying anchor (and this just shows what happens at the root).\n */\nexport interface SchemaEvents {\n\t/**\n\t * Schema change is about to be applied.\n\t */\n\tbeforeSchemaChange(newSchema: TreeStoredSchema): void;\n\n\t/**\n\t * Schema change was just applied.\n\t */\n\tafterSchemaChange(newSchema: TreeStoredSchema): void;\n}\n\n/**\n * A collection of stored schema that fires events in response to changes.\n */\nexport interface TreeStoredSchemaSubscription extends TreeStoredSchema {\n\t/**\n\t * Events for this schema subscription.\n\t */\n\treadonly events: Listenable<SchemaEvents>;\n}\n\n/**\n * Mutable collection of stored schema.\n */\nexport interface MutableTreeStoredSchema extends TreeStoredSchemaSubscription {\n\t/**\n\t * Mutates the stored schema.\n\t * Replaces all schemas with the provided schema.\n\t * Can overwrite preexisting schemas, and removes unmentioned schemas.\n\t */\n\tapply(newSchema: TreeStoredSchema): void;\n}\n\n/**\n * Mutable TreeStoredSchema repository.\n */\nexport class TreeStoredSchemaRepository implements MutableTreeStoredSchema {\n\tprotected nodeSchemaData: BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n\tprotected rootFieldSchemaData: TreeFieldStoredSchema;\n\tprotected readonly _events = createEmitter<SchemaEvents>();\n\tpublic readonly events: Listenable<SchemaEvents> = this._events;\n\n\t/**\n\t * Copies in the provided schema. If `data` is an TreeStoredSchemaRepository, it will be cheap-cloned.\n\t * Otherwise, it will be deep-cloned.\n\t *\n\t * We might not want to store schema in maps long term, as we might want a way to reserve a\n\t * large space of schema IDs within a schema.\n\t * The way mapFields has been structured mitigates the need for this, but it still might be useful.\n\t *\n\t * (ex: someone using data as field identifiers might want to\n\t * reserve all fields identifiers starting with \"foo.\" to have a specific schema).\n\t * Combined with support for such namespaces in the allowed sets in the schema objects,\n\t * that might provide a decent alternative to mapFields (which is a bit odd).\n\t */\n\tpublic constructor(data?: TreeStoredSchema) {\n\t\tif (data === undefined) {\n\t\t\tthis.rootFieldSchemaData = storedEmptyFieldSchema;\n\t\t\tthis.nodeSchemaData = new BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(\n\t\t\t\t[],\n\t\t\t\tcompareStrings,\n\t\t\t);\n\t\t} else {\n\t\t\tif (data instanceof TreeStoredSchemaRepository) {\n\t\t\t\tthis.rootFieldSchemaData = data.rootFieldSchema;\n\t\t\t\tthis.nodeSchemaData = data.nodeSchemaData.clone();\n\t\t\t} else {\n\t\t\t\tthis.rootFieldSchemaData = data.rootFieldSchema;\n\t\t\t\tthis.nodeSchemaData = cloneNodeSchemaData(data.nodeSchema);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get nodeSchema(): ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> {\n\t\t// Btree implements iterator, but not in a type-safe way\n\t\treturn this.nodeSchemaData as unknown as ReadonlyMap<\n\t\t\tTreeNodeSchemaIdentifier,\n\t\t\tTreeNodeStoredSchema\n\t\t>;\n\t}\n\n\tpublic get rootFieldSchema(): TreeFieldStoredSchema {\n\t\treturn this.rootFieldSchemaData;\n\t}\n\n\tpublic apply(newSchema: TreeStoredSchema): void {\n\t\tthis._events.emit(\"beforeSchemaChange\", newSchema);\n\t\tconst clone = new TreeStoredSchemaRepository(newSchema);\n\t\t// In the future, we could use btree's delta functionality to do a more efficient update\n\t\tthis.rootFieldSchemaData = clone.rootFieldSchemaData;\n\t\tthis.nodeSchemaData = clone.nodeSchemaData;\n\t\tthis._events.emit(\"afterSchemaChange\", newSchema);\n\t}\n\n\tpublic clone(): TreeStoredSchemaRepository {\n\t\treturn new TreeStoredSchemaRepository(this);\n\t}\n}\n\nexport function schemaDataIsEmpty(data: TreeStoredSchema): boolean {\n\treturn data.nodeSchema.size === 0;\n}\n\nfunction cloneNodeSchemaData(\n\tnodeSchema: StoredSchemaCollection[\"nodeSchema\"],\n): BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> {\n\t// Schema objects are immutable (unlike stored schema repositories), so this shallow copy is fine.\n\tconst entries: [TreeNodeSchemaIdentifier, TreeNodeStoredSchema][] = [\n\t\t...nodeSchema.entries(),\n\t];\n\treturn new BTree<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(entries, compareStrings);\n}\n"]}