@fluidframework/tree 2.81.1 → 2.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (579) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/api-report/tree.alpha.api.md +54 -22
  3. package/api-report/tree.beta.api.md +150 -1
  4. package/api-report/tree.legacy.beta.api.md +150 -1
  5. package/api-report/tree.legacy.public.api.md +1 -0
  6. package/api-report/tree.public.api.md +1 -0
  7. package/dist/alpha.d.ts +8 -2
  8. package/dist/beta.d.ts +3 -0
  9. package/dist/codec/codec.d.ts +17 -8
  10. package/dist/codec/codec.d.ts.map +1 -1
  11. package/dist/codec/codec.js +8 -1
  12. package/dist/codec/codec.js.map +1 -1
  13. package/dist/codec/index.d.ts +1 -1
  14. package/dist/codec/index.d.ts.map +1 -1
  15. package/dist/codec/index.js +2 -1
  16. package/dist/codec/index.js.map +1 -1
  17. package/dist/codec/versioned/codec.d.ts +1 -1
  18. package/dist/codec/versioned/codec.d.ts.map +1 -1
  19. package/dist/codec/versioned/codec.js.map +1 -1
  20. package/dist/core/index.d.ts +1 -1
  21. package/dist/core/index.d.ts.map +1 -1
  22. package/dist/core/index.js +4 -2
  23. package/dist/core/index.js.map +1 -1
  24. package/dist/core/rebase/changeRebaser.d.ts +3 -2
  25. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  26. package/dist/core/rebase/changeRebaser.js.map +1 -1
  27. package/dist/core/rebase/index.d.ts +1 -1
  28. package/dist/core/rebase/index.d.ts.map +1 -1
  29. package/dist/core/rebase/index.js +4 -2
  30. package/dist/core/rebase/index.js.map +1 -1
  31. package/dist/core/rebase/types.d.ts +23 -3
  32. package/dist/core/rebase/types.d.ts.map +1 -1
  33. package/dist/core/rebase/types.js +30 -16
  34. package/dist/core/rebase/types.js.map +1 -1
  35. package/dist/core/schema-stored/formatV1.d.ts +2 -2
  36. package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
  37. package/dist/core/schema-stored/formatV1.js +0 -5
  38. package/dist/core/schema-stored/formatV1.js.map +1 -1
  39. package/dist/core/schema-stored/formatV2.d.ts +11 -10
  40. package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
  41. package/dist/core/schema-stored/formatV2.js +1 -6
  42. package/dist/core/schema-stored/formatV2.js.map +1 -1
  43. package/dist/core/schema-stored/index.d.ts.map +1 -1
  44. package/dist/core/schema-stored/index.js.map +1 -1
  45. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  46. package/dist/core/schema-stored/schema.js.map +1 -1
  47. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  48. package/dist/core/tree/anchorSet.js.map +1 -1
  49. package/dist/core/tree/delta.d.ts +9 -7
  50. package/dist/core/tree/delta.d.ts.map +1 -1
  51. package/dist/core/tree/delta.js.map +1 -1
  52. package/dist/core/tree/deltaUtil.js +1 -1
  53. package/dist/core/tree/deltaUtil.js.map +1 -1
  54. package/dist/core/tree/visitDelta.js +2 -2
  55. package/dist/core/tree/visitDelta.js.map +1 -1
  56. package/dist/extensibleSchemaUnion.d.ts +72 -0
  57. package/dist/extensibleSchemaUnion.d.ts.map +1 -0
  58. package/dist/extensibleSchemaUnion.js +79 -0
  59. package/dist/extensibleSchemaUnion.js.map +1 -0
  60. package/dist/feature-libraries/changeAtomIdBTree.d.ts +4 -2
  61. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  62. package/dist/feature-libraries/changeAtomIdBTree.js +9 -1
  63. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  64. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -3
  65. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  66. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +20 -21
  67. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  68. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  69. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  70. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  71. package/dist/feature-libraries/forest-summary/codec.d.ts +2 -1
  72. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  73. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  74. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  75. package/dist/feature-libraries/forest-summary/forestSummarizer.js +5 -2
  76. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  77. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +1 -39
  78. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  79. package/dist/feature-libraries/forest-summary/formatCommon.js +1 -2
  80. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  81. package/dist/feature-libraries/forest-summary/formatV1.d.ts +1 -39
  82. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  83. package/dist/feature-libraries/forest-summary/formatV2.d.ts +1 -39
  84. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  85. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +1 -1
  86. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  87. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +1 -1
  88. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  89. package/dist/feature-libraries/index.d.ts +3 -3
  90. package/dist/feature-libraries/index.d.ts.map +1 -1
  91. package/dist/feature-libraries/index.js +4 -3
  92. package/dist/feature-libraries/index.js.map +1 -1
  93. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +2 -2
  94. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  95. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +42 -22
  96. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  97. package/dist/feature-libraries/modular-schema/genericFieldKind.js +1 -1
  98. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  99. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  100. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  101. package/dist/feature-libraries/modular-schema/index.js +2 -1
  102. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  103. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
  104. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  105. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +9 -5
  106. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  107. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +11 -1
  108. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  109. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +30 -7
  110. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  111. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  112. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +38 -27
  113. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  114. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +10 -127
  115. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  116. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -4
  117. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  118. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +3 -79
  119. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  120. package/dist/feature-libraries/optional-field/optionalField.js +1 -1
  121. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  122. package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  123. package/dist/feature-libraries/optional-field/requiredField.js.map +1 -1
  124. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  125. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  126. package/dist/feature-libraries/schema-index/formatV2.d.ts +4 -4
  127. package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -1
  128. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  129. package/dist/feature-libraries/sequence-field/invert.js +2 -2
  130. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  131. package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -16
  132. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  133. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -1
  134. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  135. package/dist/index.d.ts +5 -5
  136. package/dist/index.d.ts.map +1 -1
  137. package/dist/index.js +4 -1
  138. package/dist/index.js.map +1 -1
  139. package/dist/legacy.d.ts +3 -0
  140. package/dist/packageVersion.d.ts +1 -1
  141. package/dist/packageVersion.js +1 -1
  142. package/dist/packageVersion.js.map +1 -1
  143. package/dist/shared-tree/independentView.d.ts +36 -13
  144. package/dist/shared-tree/independentView.d.ts.map +1 -1
  145. package/dist/shared-tree/independentView.js +1 -0
  146. package/dist/shared-tree/independentView.js.map +1 -1
  147. package/dist/shared-tree/index.d.ts +1 -1
  148. package/dist/shared-tree/index.d.ts.map +1 -1
  149. package/dist/shared-tree/index.js.map +1 -1
  150. package/dist/shared-tree/schematizingTreeView.d.ts +10 -0
  151. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  152. package/dist/shared-tree/schematizingTreeView.js +25 -9
  153. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  154. package/dist/shared-tree/sharedTree.d.ts +3 -3
  155. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  156. package/dist/shared-tree/sharedTree.js +8 -32
  157. package/dist/shared-tree/sharedTree.js.map +1 -1
  158. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +11 -3
  159. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  160. package/dist/shared-tree/sharedTreeChangeCodecs.js +38 -4
  161. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  162. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +4 -4
  163. package/dist/shared-tree/tree.js +1 -1
  164. package/dist/shared-tree/tree.js.map +1 -1
  165. package/dist/shared-tree/treeCheckout.d.ts +20 -0
  166. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  167. package/dist/shared-tree/treeCheckout.js +39 -3
  168. package/dist/shared-tree/treeCheckout.js.map +1 -1
  169. package/dist/shared-tree-core/editManagerSummarizer.js +1 -1
  170. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  171. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  172. package/dist/shared-tree-core/messageCodecV1ToV4.js +2 -2
  173. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  174. package/dist/shared-tree-core/transaction.d.ts +14 -3
  175. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  176. package/dist/shared-tree-core/transaction.js +59 -16
  177. package/dist/shared-tree-core/transaction.js.map +1 -1
  178. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  179. package/dist/shared-tree-core/versionedSummarizer.js +1 -1
  180. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
  181. package/dist/simple-tree/api/index.d.ts +1 -1
  182. package/dist/simple-tree/api/index.d.ts.map +1 -1
  183. package/dist/simple-tree/api/index.js +3 -2
  184. package/dist/simple-tree/api/index.js.map +1 -1
  185. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +9 -0
  186. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  187. package/dist/simple-tree/api/schemaCreationUtilities.js +16 -1
  188. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  189. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  190. package/dist/simple-tree/api/transactionTypes.d.ts +10 -0
  191. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  192. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  193. package/dist/simple-tree/api/tree.d.ts +81 -6
  194. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  195. package/dist/simple-tree/api/tree.js.map +1 -1
  196. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  197. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  198. package/dist/simple-tree/index.d.ts +2 -2
  199. package/dist/simple-tree/index.d.ts.map +1 -1
  200. package/dist/simple-tree/index.js +4 -2
  201. package/dist/simple-tree/index.js.map +1 -1
  202. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  203. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  204. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +63 -0
  205. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  206. package/dist/simple-tree/node-kinds/array/arrayNode.js +43 -1
  207. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  208. package/dist/simple-tree/node-kinds/array/index.d.ts +1 -1
  209. package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  210. package/dist/simple-tree/node-kinds/array/index.js +2 -1
  211. package/dist/simple-tree/node-kinds/array/index.js.map +1 -1
  212. package/dist/simple-tree/node-kinds/index.d.ts +1 -1
  213. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  214. package/dist/simple-tree/node-kinds/index.js +2 -1
  215. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  216. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  217. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  218. package/dist/tableSchema.d.ts +71 -48
  219. package/dist/tableSchema.d.ts.map +1 -1
  220. package/dist/tableSchema.js +200 -98
  221. package/dist/tableSchema.js.map +1 -1
  222. package/dist/text/textDomainFormatted.js +1 -1
  223. package/dist/text/textDomainFormatted.js.map +1 -1
  224. package/dist/util/bTreeUtils.d.ts +30 -4
  225. package/dist/util/bTreeUtils.d.ts.map +1 -1
  226. package/dist/util/bTreeUtils.js +29 -17
  227. package/dist/util/bTreeUtils.js.map +1 -1
  228. package/dist/util/brand.d.ts.map +1 -1
  229. package/dist/util/brand.js.map +1 -1
  230. package/dist/util/brandedMap.d.ts.map +1 -1
  231. package/dist/util/brandedMap.js.map +1 -1
  232. package/dist/util/breakable.d.ts.map +1 -1
  233. package/dist/util/breakable.js +2 -1
  234. package/dist/util/breakable.js.map +1 -1
  235. package/dist/util/index.d.ts +2 -2
  236. package/dist/util/index.d.ts.map +1 -1
  237. package/dist/util/index.js +6 -3
  238. package/dist/util/index.js.map +1 -1
  239. package/dist/util/opaque.d.ts.map +1 -1
  240. package/dist/util/opaque.js.map +1 -1
  241. package/dist/util/rangeMap.d.ts +3 -2
  242. package/dist/util/rangeMap.d.ts.map +1 -1
  243. package/dist/util/rangeMap.js +7 -1
  244. package/dist/util/rangeMap.js.map +1 -1
  245. package/dist/util/readSnapshotBlob.d.ts +1 -1
  246. package/dist/util/readSnapshotBlob.d.ts.map +1 -1
  247. package/dist/util/readSnapshotBlob.js.map +1 -1
  248. package/dist/util/typeCheck.d.ts.map +1 -1
  249. package/dist/util/typeCheck.js.map +1 -1
  250. package/dist/util/utils.d.ts +20 -16
  251. package/dist/util/utils.d.ts.map +1 -1
  252. package/dist/util/utils.js +49 -17
  253. package/dist/util/utils.js.map +1 -1
  254. package/eslint.config.mts +0 -9
  255. package/lib/alpha.d.ts +8 -2
  256. package/lib/beta.d.ts +3 -0
  257. package/lib/codec/codec.d.ts +17 -8
  258. package/lib/codec/codec.d.ts.map +1 -1
  259. package/lib/codec/codec.js +6 -0
  260. package/lib/codec/codec.js.map +1 -1
  261. package/lib/codec/index.d.ts +1 -1
  262. package/lib/codec/index.d.ts.map +1 -1
  263. package/lib/codec/index.js +1 -1
  264. package/lib/codec/index.js.map +1 -1
  265. package/lib/codec/versioned/codec.d.ts +1 -1
  266. package/lib/codec/versioned/codec.d.ts.map +1 -1
  267. package/lib/codec/versioned/codec.js.map +1 -1
  268. package/lib/core/index.d.ts +1 -1
  269. package/lib/core/index.d.ts.map +1 -1
  270. package/lib/core/index.js +1 -1
  271. package/lib/core/index.js.map +1 -1
  272. package/lib/core/rebase/changeRebaser.d.ts +3 -2
  273. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  274. package/lib/core/rebase/changeRebaser.js.map +1 -1
  275. package/lib/core/rebase/index.d.ts +1 -1
  276. package/lib/core/rebase/index.d.ts.map +1 -1
  277. package/lib/core/rebase/index.js +1 -1
  278. package/lib/core/rebase/index.js.map +1 -1
  279. package/lib/core/rebase/types.d.ts +23 -3
  280. package/lib/core/rebase/types.d.ts.map +1 -1
  281. package/lib/core/rebase/types.js +27 -15
  282. package/lib/core/rebase/types.js.map +1 -1
  283. package/lib/core/schema-stored/formatV1.d.ts +2 -2
  284. package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
  285. package/lib/core/schema-stored/formatV1.js +0 -5
  286. package/lib/core/schema-stored/formatV1.js.map +1 -1
  287. package/lib/core/schema-stored/formatV2.d.ts +11 -10
  288. package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
  289. package/lib/core/schema-stored/formatV2.js +1 -6
  290. package/lib/core/schema-stored/formatV2.js.map +1 -1
  291. package/lib/core/schema-stored/index.d.ts.map +1 -1
  292. package/lib/core/schema-stored/index.js +2 -0
  293. package/lib/core/schema-stored/index.js.map +1 -1
  294. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  295. package/lib/core/schema-stored/schema.js.map +1 -1
  296. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  297. package/lib/core/tree/anchorSet.js.map +1 -1
  298. package/lib/core/tree/delta.d.ts +9 -7
  299. package/lib/core/tree/delta.d.ts.map +1 -1
  300. package/lib/core/tree/delta.js.map +1 -1
  301. package/lib/core/tree/deltaUtil.js +1 -1
  302. package/lib/core/tree/deltaUtil.js.map +1 -1
  303. package/lib/core/tree/visitDelta.js +2 -2
  304. package/lib/core/tree/visitDelta.js.map +1 -1
  305. package/lib/extensibleSchemaUnion.d.ts +72 -0
  306. package/lib/extensibleSchemaUnion.d.ts.map +1 -0
  307. package/lib/extensibleSchemaUnion.js +76 -0
  308. package/lib/extensibleSchemaUnion.js.map +1 -0
  309. package/lib/feature-libraries/changeAtomIdBTree.d.ts +4 -2
  310. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  311. package/lib/feature-libraries/changeAtomIdBTree.js +7 -0
  312. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  313. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -3
  314. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  315. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +4 -5
  316. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  317. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  318. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  319. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  320. package/lib/feature-libraries/forest-summary/codec.d.ts +2 -1
  321. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  322. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  323. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  324. package/lib/feature-libraries/forest-summary/forestSummarizer.js +6 -3
  325. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  326. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +1 -39
  327. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  328. package/lib/feature-libraries/forest-summary/formatCommon.js +2 -3
  329. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  330. package/lib/feature-libraries/forest-summary/formatV1.d.ts +1 -39
  331. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  332. package/lib/feature-libraries/forest-summary/formatV2.d.ts +1 -39
  333. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  334. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +1 -1
  335. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  336. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +1 -1
  337. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  338. package/lib/feature-libraries/index.d.ts +3 -3
  339. package/lib/feature-libraries/index.d.ts.map +1 -1
  340. package/lib/feature-libraries/index.js +3 -3
  341. package/lib/feature-libraries/index.js.map +1 -1
  342. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +2 -2
  343. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  344. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +41 -21
  345. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  346. package/lib/feature-libraries/modular-schema/genericFieldKind.js +1 -1
  347. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  348. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  349. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  350. package/lib/feature-libraries/modular-schema/index.js +1 -1
  351. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  352. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
  353. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  354. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +10 -6
  355. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  356. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +11 -1
  357. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  358. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +29 -6
  359. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  360. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  361. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +41 -30
  362. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  363. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +10 -127
  364. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  365. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -4
  366. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  367. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +3 -79
  368. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  369. package/lib/feature-libraries/optional-field/optionalField.js +1 -1
  370. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  371. package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  372. package/lib/feature-libraries/optional-field/requiredField.js.map +1 -1
  373. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  374. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  375. package/lib/feature-libraries/schema-index/formatV2.d.ts +4 -4
  376. package/lib/feature-libraries/schema-index/schemaSummarizer.js +1 -1
  377. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  378. package/lib/feature-libraries/sequence-field/invert.js +2 -2
  379. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  380. package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -16
  381. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  382. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -1
  383. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  384. package/lib/index.d.ts +5 -5
  385. package/lib/index.d.ts.map +1 -1
  386. package/lib/index.js +4 -3
  387. package/lib/index.js.map +1 -1
  388. package/lib/legacy.d.ts +3 -0
  389. package/lib/packageVersion.d.ts +1 -1
  390. package/lib/packageVersion.js +1 -1
  391. package/lib/packageVersion.js.map +1 -1
  392. package/lib/shared-tree/independentView.d.ts +36 -13
  393. package/lib/shared-tree/independentView.d.ts.map +1 -1
  394. package/lib/shared-tree/independentView.js +1 -0
  395. package/lib/shared-tree/independentView.js.map +1 -1
  396. package/lib/shared-tree/index.d.ts +1 -1
  397. package/lib/shared-tree/index.d.ts.map +1 -1
  398. package/lib/shared-tree/index.js.map +1 -1
  399. package/lib/shared-tree/schematizingTreeView.d.ts +10 -0
  400. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  401. package/lib/shared-tree/schematizingTreeView.js +25 -9
  402. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  403. package/lib/shared-tree/sharedTree.d.ts +3 -3
  404. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  405. package/lib/shared-tree/sharedTree.js +10 -34
  406. package/lib/shared-tree/sharedTree.js.map +1 -1
  407. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +11 -3
  408. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  409. package/lib/shared-tree/sharedTreeChangeCodecs.js +39 -5
  410. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  411. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +4 -4
  412. package/lib/shared-tree/tree.js +1 -1
  413. package/lib/shared-tree/tree.js.map +1 -1
  414. package/lib/shared-tree/treeCheckout.d.ts +20 -0
  415. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  416. package/lib/shared-tree/treeCheckout.js +39 -3
  417. package/lib/shared-tree/treeCheckout.js.map +1 -1
  418. package/lib/shared-tree-core/editManagerSummarizer.js +1 -1
  419. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  420. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  421. package/lib/shared-tree-core/messageCodecV1ToV4.js +2 -2
  422. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  423. package/lib/shared-tree-core/transaction.d.ts +14 -3
  424. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  425. package/lib/shared-tree-core/transaction.js +61 -18
  426. package/lib/shared-tree-core/transaction.js.map +1 -1
  427. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  428. package/lib/shared-tree-core/versionedSummarizer.js +1 -1
  429. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
  430. package/lib/simple-tree/api/index.d.ts +1 -1
  431. package/lib/simple-tree/api/index.d.ts.map +1 -1
  432. package/lib/simple-tree/api/index.js +1 -1
  433. package/lib/simple-tree/api/index.js.map +1 -1
  434. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +9 -0
  435. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  436. package/lib/simple-tree/api/schemaCreationUtilities.js +14 -0
  437. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  438. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  439. package/lib/simple-tree/api/transactionTypes.d.ts +10 -0
  440. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  441. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  442. package/lib/simple-tree/api/tree.d.ts +81 -6
  443. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  444. package/lib/simple-tree/api/tree.js.map +1 -1
  445. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  446. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  447. package/lib/simple-tree/index.d.ts +2 -2
  448. package/lib/simple-tree/index.d.ts.map +1 -1
  449. package/lib/simple-tree/index.js +2 -2
  450. package/lib/simple-tree/index.js.map +1 -1
  451. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  452. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  453. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +63 -0
  454. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  455. package/lib/simple-tree/node-kinds/array/arrayNode.js +41 -0
  456. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  457. package/lib/simple-tree/node-kinds/array/index.d.ts +1 -1
  458. package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  459. package/lib/simple-tree/node-kinds/array/index.js +1 -1
  460. package/lib/simple-tree/node-kinds/array/index.js.map +1 -1
  461. package/lib/simple-tree/node-kinds/index.d.ts +1 -1
  462. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  463. package/lib/simple-tree/node-kinds/index.js +1 -1
  464. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  465. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  466. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  467. package/lib/tableSchema.d.ts +71 -48
  468. package/lib/tableSchema.d.ts.map +1 -1
  469. package/lib/tableSchema.js +201 -99
  470. package/lib/tableSchema.js.map +1 -1
  471. package/lib/text/textDomainFormatted.js +1 -1
  472. package/lib/text/textDomainFormatted.js.map +1 -1
  473. package/lib/util/bTreeUtils.d.ts +30 -4
  474. package/lib/util/bTreeUtils.d.ts.map +1 -1
  475. package/lib/util/bTreeUtils.js +27 -16
  476. package/lib/util/bTreeUtils.js.map +1 -1
  477. package/lib/util/brand.d.ts.map +1 -1
  478. package/lib/util/brand.js.map +1 -1
  479. package/lib/util/brandedMap.d.ts.map +1 -1
  480. package/lib/util/brandedMap.js.map +1 -1
  481. package/lib/util/breakable.d.ts.map +1 -1
  482. package/lib/util/breakable.js +2 -1
  483. package/lib/util/breakable.js.map +1 -1
  484. package/lib/util/index.d.ts +2 -2
  485. package/lib/util/index.d.ts.map +1 -1
  486. package/lib/util/index.js +2 -2
  487. package/lib/util/index.js.map +1 -1
  488. package/lib/util/opaque.d.ts.map +1 -1
  489. package/lib/util/opaque.js.map +1 -1
  490. package/lib/util/rangeMap.d.ts +3 -2
  491. package/lib/util/rangeMap.d.ts.map +1 -1
  492. package/lib/util/rangeMap.js +7 -1
  493. package/lib/util/rangeMap.js.map +1 -1
  494. package/lib/util/readSnapshotBlob.d.ts +1 -1
  495. package/lib/util/readSnapshotBlob.d.ts.map +1 -1
  496. package/lib/util/readSnapshotBlob.js.map +1 -1
  497. package/lib/util/typeCheck.d.ts.map +1 -1
  498. package/lib/util/typeCheck.js.map +1 -1
  499. package/lib/util/utils.d.ts +20 -16
  500. package/lib/util/utils.d.ts.map +1 -1
  501. package/lib/util/utils.js +44 -15
  502. package/lib/util/utils.js.map +1 -1
  503. package/package.json +22 -22
  504. package/src/codec/codec.ts +30 -11
  505. package/src/codec/index.ts +2 -0
  506. package/src/codec/versioned/codec.ts +9 -13
  507. package/src/core/index.ts +3 -1
  508. package/src/core/rebase/changeRebaser.ts +3 -2
  509. package/src/core/rebase/index.ts +3 -1
  510. package/src/core/rebase/types.ts +51 -13
  511. package/src/core/schema-stored/formatV1.ts +2 -4
  512. package/src/core/schema-stored/formatV2.ts +9 -7
  513. package/src/core/schema-stored/index.ts +2 -0
  514. package/src/core/schema-stored/schema.ts +4 -1
  515. package/src/core/tree/anchorSet.ts +1 -3
  516. package/src/core/tree/delta.ts +9 -7
  517. package/src/core/tree/deltaUtil.ts +1 -1
  518. package/src/core/tree/visitDelta.ts +2 -2
  519. package/src/extensibleSchemaUnion.ts +135 -0
  520. package/src/feature-libraries/changeAtomIdBTree.ts +17 -2
  521. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +5 -6
  522. package/src/feature-libraries/default-schema/index.ts +0 -1
  523. package/src/feature-libraries/forest-summary/codec.ts +7 -2
  524. package/src/feature-libraries/forest-summary/forestSummarizer.ts +15 -3
  525. package/src/feature-libraries/forest-summary/formatCommon.ts +2 -3
  526. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +4 -5
  527. package/src/feature-libraries/index.ts +3 -2
  528. package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +57 -31
  529. package/src/feature-libraries/modular-schema/genericFieldKind.ts +1 -1
  530. package/src/feature-libraries/modular-schema/index.ts +4 -1
  531. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +7 -6
  532. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +32 -7
  533. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +54 -33
  534. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +2 -4
  535. package/src/feature-libraries/optional-field/optionalField.ts +1 -1
  536. package/src/feature-libraries/optional-field/requiredField.ts +2 -4
  537. package/src/feature-libraries/schema-index/codec.ts +1 -1
  538. package/src/feature-libraries/schema-index/schemaSummarizer.ts +1 -1
  539. package/src/feature-libraries/sequence-field/invert.ts +2 -2
  540. package/src/feature-libraries/sequence-field/replaceRevisions.ts +17 -10
  541. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +1 -1
  542. package/src/index.ts +12 -7
  543. package/src/packageVersion.ts +1 -1
  544. package/src/shared-tree/independentView.ts +42 -6
  545. package/src/shared-tree/index.ts +2 -0
  546. package/src/shared-tree/schematizingTreeView.ts +63 -18
  547. package/src/shared-tree/sharedTree.ts +19 -37
  548. package/src/shared-tree/sharedTreeChangeCodecs.ts +43 -9
  549. package/src/shared-tree/tree.ts +1 -1
  550. package/src/shared-tree/treeCheckout.ts +50 -3
  551. package/src/shared-tree-core/editManagerSummarizer.ts +1 -1
  552. package/src/shared-tree-core/messageCodecV1ToV4.ts +4 -3
  553. package/src/shared-tree-core/transaction.ts +125 -23
  554. package/src/shared-tree-core/versionedSummarizer.ts +3 -2
  555. package/src/simple-tree/api/index.ts +1 -0
  556. package/src/simple-tree/api/schemaCreationUtilities.ts +35 -5
  557. package/src/simple-tree/api/simpleTreeIndex.ts +1 -1
  558. package/src/simple-tree/api/transactionTypes.ts +10 -0
  559. package/src/simple-tree/api/tree.ts +88 -6
  560. package/src/simple-tree/core/treeNodeSchema.ts +5 -8
  561. package/src/simple-tree/index.ts +3 -0
  562. package/src/simple-tree/leafNodeSchema.ts +3 -2
  563. package/src/simple-tree/node-kinds/array/arrayNode.ts +86 -0
  564. package/src/simple-tree/node-kinds/array/index.ts +2 -0
  565. package/src/simple-tree/node-kinds/index.ts +2 -0
  566. package/src/simple-tree/node-kinds/object/objectNode.ts +19 -18
  567. package/src/tableSchema.ts +280 -140
  568. package/src/text/textDomainFormatted.ts +1 -1
  569. package/src/util/bTreeUtils.ts +45 -26
  570. package/src/util/brand.ts +4 -12
  571. package/src/util/brandedMap.ts +2 -6
  572. package/src/util/breakable.ts +3 -2
  573. package/src/util/index.ts +9 -3
  574. package/src/util/opaque.ts +2 -6
  575. package/src/util/rangeMap.ts +11 -5
  576. package/src/util/readSnapshotBlob.ts +3 -3
  577. package/src/util/typeCheck.ts +11 -9
  578. package/src/util/utils.ts +57 -28
  579. package/biome.jsonc +0 -4
@@ -1 +1 @@
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,EACf,kBAAkB,EAElB,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EAGnB,UAAU,EACV,aAAa,EACb,cAAc,EACd,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,YAAY,EAEZ,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,UAAU,EAGV,UAAU,EAEV,gBAAgB,EAChB,aAAa,EACb,YAAY,EAIZ,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAIlB,8BAA8B,EAC9B,oBAAoB,EAWpB,eAAe,EAEf,SAAS,EACT,WAAW,EACX,WAAW,EAEX,+BAA+B,EAC/B,8BAA8B,GAC9B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,oBAAoB,EAOpB,4BAA4B,EAE5B,mBAAmB,GAEnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAIN,WAAW,EACX,oBAAoB,EAOpB,0BAA0B,EAC1B,iBAAiB,EAEjB,4BAA4B,EAC5B,6BAA6B,EAC7B,sBAAsB,EAEtB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,EAE5B,YAAY,EAEZ,mBAAmB,GACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAKN,WAAW,GACX,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACN,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EAEd,YAAY,EACZ,kBAAkB,EAElB,UAAU,EAMV,iBAAiB,EACjB,gBAAgB,EAKhB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,YAAY,EAEZ,YAAY,EACZ,uBAAuB,EAEvB,8BAA8B,EAK9B,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,aAAa,EAGb,UAAU,EAEV,uBAAuB,EACvB,gBAAgB,EAChB,aAAa,GAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAEN,iBAAiB,GAEjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAEN,gBAAgB,GAIhB,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\tannounceDelta,\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 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} 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 {\n\ttype ChangeFamily,\n\ttype ChangeFamilyCodec,\n\ttype ChangeEncodingContext,\n\ttype ChangeFamilyEditor,\n\tEditBuilder,\n} 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\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\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\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\tcompareRevisions,\n\tdiffHistories,\n\ttype RevisionReplacer,\n} from \"./rebase/index.js\";\n\nexport {\n\ttype Adapters,\n\tAdaptedViewSchema,\n\ttype TreeAdapter,\n} from \"./schema-view/index.js\";\n\nexport {\n\ttype Revertible,\n\tRevertibleStatus,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./revertible.js\";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AqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EAEd,YAAY,EACZ,kBAAkB,EAElB,UAAU,EAMV,iBAAiB,EACjB,gBAAgB,EAKhB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,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,iBAAiB,GAEjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAEN,gBAAgB,GAIhB,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\tannounceDelta,\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 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} 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 {\n\ttype ChangeFamily,\n\ttype ChangeFamilyCodec,\n\ttype ChangeEncodingContext,\n\ttype ChangeFamilyEditor,\n\tEditBuilder,\n} 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\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\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\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 Adapters,\n\tAdaptedViewSchema,\n\ttype TreeAdapter,\n} from \"./schema-view/index.js\";\n\nexport {\n\ttype Revertible,\n\tRevertibleStatus,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./revertible.js\";\n"]}
@@ -102,13 +102,14 @@ export interface RevisionReplacer {
102
102
  isObsolete(revision: RevisionTag | undefined): boolean;
103
103
  /**
104
104
  * Returns the updated ID for the given ID.
105
- * @param id - The ID to update.
105
+ * @param id - The ID of the first change atom to update.
106
+ * @param count - The number of contiguous change atoms to update. Defaults to 1.
106
107
  * @returns an updated ID iff the given `id` needs updating, otherwise returns the given `id`.
107
108
  * @remarks
108
109
  * This function always maps the same input {@link ChangeAtomId.revision | revision} and {@link ChangeAtomId.localId | local ID} to the same output revision local ID.
109
110
  * This means multiple references to the same atom of change will remain consistent after revision replacement.
110
111
  */
111
- getUpdatedAtomId<T extends ChangeAtomId>(id: T): T;
112
+ getUpdatedAtomId<T extends ChangeAtomId>(id: T, count?: number): T;
112
113
  }
113
114
  export interface TaggedChange<TChangeset, TTag = RevisionTag | undefined> {
114
115
  readonly revision: TTag;
@@ -1 +1 @@
1
- {"version":3,"file":"changeRebaser.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/changeRebaser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,aAAa,CAAC,UAAU;IACxC,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAEnC;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,EAAE,GAAG,UAAU,CAAC;IAEzD;;;;;;;;;;;;OAYG;IACH,MAAM,CACL,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,EACjC,UAAU,EAAE,OAAO,EACnB,QAAQ,EAAE,WAAW,GACnB,UAAU,CAAC;IAEd;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CACL,MAAM,EAAE,YAAY,CAAC,UAAU,CAAC,EAChC,IAAI,EAAE,YAAY,CAAC,UAAU,CAAC,EAC9B,gBAAgB,EAAE,sBAAsB,GACtC,UAAU,CAAC;IAEd;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAE/D;;;;;OAKG;IACH,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CAAC;CAC3E;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC;IAEtC;;;;OAIG;IACH,UAAU,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,GAA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IACV,+DAAO,CAAA;IACP,iEAAQ,CAAA;AACT,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Invariant } from \"../../util/index.js\";\n\nimport type { ChangeAtomId, RevisionTag } from \"./types.js\";\n\n/**\n * Rebasing logic for a particular kind of change.\n *\n * This interface is used to provide rebase policy to `Rebaser`.\n *\n * The implementation must ensure TChangeset forms a {@link https://en.wikipedia.org/wiki/Group_(mathematics | group}) where:\n * - `compose([])` is the identity element.\n * - associativity is defined as `compose([...a, ...b])` is equal to\n * `compose([compose(a), compose(b)])` for all `a` and `b`.\n * - `inverse(a)` gives the inverse element of `a`.\n *\n * In these requirements the definition of equality is up to the implementer,\n * but it is required that any two changes which are considered equal:\n * - have the same impact when applied to any tree.\n * - can be substituted for each-other in all methods on this\n * interface and produce equal (by this same definition) results.\n *\n * For the sake of testability, implementations will likely want to have a concrete equality implementation.\n *\n * This API uses `compose` on arrays instead of an explicit identity element and associative binary operator\n * to allow the implementation more room for optimization,\n * but should otherwise be equivalent to the identity element and binary operator group approach.\n *\n * TODO:\n * Be more specific about the above requirements.\n * For example, would something that is close to forming a group but has precision issues\n * (ex: the floating point numbers and addition) be ok?\n * Would this cause decoherence (and thus be absolutely not ok),\n * or just minor semantic precision issues, which could be tolerated.\n * For now assume that such issues are not ok.\n */\nexport interface ChangeRebaser<TChangeset> {\n\t_typeCheck?: Invariant<TChangeset>;\n\n\t/**\n\t * Compose a collection of changesets into a single one.\n\t * See {@link ChangeRebaser} for requirements.\n\t */\n\tcompose(changes: TaggedChange<TChangeset>[]): TChangeset;\n\n\t/**\n\t * @param changes - The changes to invert.\n\t * @param isRollback - Whether the inverted change is meant to rollback a change on a branch as is the case when\n\t * performing a sandwich rebase.\n\t * @param revision - The revision for the invert changeset.\n\t * This flag is relevant to merge semantics that are dependent on edit sequencing order:\n\t * - In the context of an undo, this function inverts a change that is sequenced and applied before the produced inverse.\n\t * - In the context of a rollback, this function inverts a change that is sequenced after but applied before the produced inverse.\n\t * @returns the inverse of `changes`.\n\t *\n\t * `compose([changes, inverse(changes)])` be equal to `compose([])`:\n\t * See {@link ChangeRebaser} for details.\n\t */\n\tinvert(\n\t\tchanges: TaggedChange<TChangeset>,\n\t\tisRollback: boolean,\n\t\trevision: RevisionTag,\n\t): TChangeset;\n\n\t/**\n\t * Rebase `change` over `over`.\n\t *\n\t * The resulting changeset should, as much as possible, replicate the same semantics as `change`,\n\t * except be valid to apply after `over` instead of before it.\n\t *\n\t * When rebasing `change` onto a new branch, `revisionMetadata` should include entries for all changesets\n\t * from the source which are being rebased onto the target branch.\n\t *\n\t * Requirements:\n\t * The implementation must ensure that for all possible changesets `a`, `b` and `c`:\n\t * - `rebase(a, compose([b, c])` is equal to `rebase(rebase(a, b), c)`.\n\t * - `rebase(compose([a, b]), c)` is equal to\n\t * `compose([rebase(a, c), rebase(b, compose([inverse(a), c, rebase(a, c)])])`.\n\t * - `rebase(a, compose([]))` is equal to `a`.\n\t * - `rebase(compose([]), a)` is equal to `compose([])`.\n\t */\n\trebase(\n\t\tchange: TaggedChange<TChangeset>,\n\t\tover: TaggedChange<TChangeset>,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): TChangeset;\n\n\t/**\n\t * Retrieves the set of revisions associated with the given change.\n\t */\n\tgetRevisions(change: TChangeset): Set<RevisionTag | undefined>;\n\n\t/**\n\t * Produces a changeset that is equivalent to the given `change`, but with all references to its own revisions replaced according to the given `replacer`.\n\t * @param change - The change to update. Not modified.\n\t * @param replacer - The replacer to use.\n\t * @returns A changeset equivalent to `change`, but with all references to its own revision replaced according to `replacer`.\n\t */\n\tchangeRevision(change: TChangeset, replacer: RevisionReplacer): TChangeset;\n}\n\n/**\n * A type that can update references to a set of obsolete revisions across multiple changesets.\n */\nexport interface RevisionReplacer {\n\t/**\n\t * The revision to use in place of the obsolete revisions.\n\t */\n\treadonly updatedRevision: RevisionTag;\n\n\t/**\n\t * Predicate to determine if a revision needs replacing.\n\t * @param revision - The revision that may need replacing.\n\t * @returns true iff the given `revision` needs replacing.\n\t */\n\tisObsolete(revision: RevisionTag | undefined): boolean;\n\n\t/**\n\t * Returns the updated ID for the given ID.\n\t * @param id - The ID to update.\n\t * @returns an updated ID iff the given `id` needs updating, otherwise returns the given `id`.\n\t * @remarks\n\t * This function always maps the same input {@link ChangeAtomId.revision | revision} and {@link ChangeAtomId.localId | local ID} to the same output revision local ID.\n\t * This means multiple references to the same atom of change will remain consistent after revision replacement.\n\t */\n\tgetUpdatedAtomId<T extends ChangeAtomId>(id: T): T;\n}\n\nexport interface TaggedChange<TChangeset, TTag = RevisionTag | undefined> {\n\treadonly revision: TTag;\n\t/**\n\t * When populated, indicates that the changeset is a rollback for the purpose of a rebase sandwich.\n\t * The value corresponds to the `revision` of the original changeset being rolled back.\n\t */\n\treadonly rollbackOf?: RevisionTag;\n\treadonly change: TChangeset;\n}\n\nexport function mapTaggedChange<TIn, TOut>(\n\tinput: TaggedChange<TIn>,\n\tchange: TOut,\n): TaggedChange<TOut> {\n\treturn { ...input, change };\n}\n\n/**\n * A callback that returns the index of the changeset associated with the given RevisionTag among the changesets being\n * composed or rebased. This index is solely meant to communicate relative ordering, and is only valid within the scope of the\n * compose or rebase operation.\n *\n * During composition, the index reflects the order of the changeset within the overall composed changeset that is\n * being produced.\n *\n * During rebase, the indices of the base changes are all lower than the indices of the change being rebased.\n */\nexport type RevisionIndexer = (tag: RevisionTag) => number | undefined;\n\nexport interface RevisionMetadataSource {\n\treadonly getIndex: RevisionIndexer;\n\treadonly tryGetInfo: (tag: RevisionTag | undefined) => RevisionInfo | undefined;\n\treadonly hasRollback: (tag: RevisionTag) => boolean;\n}\n\nexport interface RevisionInfo {\n\treadonly revision: RevisionTag;\n\t/**\n\t * When populated, indicates that the changeset is a rollback for the purpose of a rebase sandwich.\n\t * The value corresponds to the `revision` of the original changeset being rolled back.\n\t */\n\treadonly rollbackOf?: RevisionTag;\n}\n\nexport function tagChange<T>(change: T, revision: RevisionTag | undefined): TaggedChange<T> {\n\treturn { revision, change };\n}\n\nexport function tagRollbackInverse<TChange, TTag>(\n\tinverseChange: TChange,\n\trevision: TTag,\n\trollbackOf: RevisionTag | undefined,\n): TaggedChange<TChange, TTag> {\n\treturn {\n\t\trevision,\n\t\tchange: inverseChange,\n\t\trollbackOf,\n\t};\n}\n\nexport function makeAnonChange<T>(change: T): TaggedChange<T> {\n\treturn { revision: undefined, change };\n}\n\nexport interface FinalChange {\n\treadonly status: FinalChangeStatus;\n}\n\nexport enum FinalChangeStatus {\n\tconflicted,\n\trebased,\n\tcommuted,\n}\n"]}
1
+ {"version":3,"file":"changeRebaser.js","sourceRoot":"","sources":["../../../src/core/rebase/changeRebaser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA4IH,MAAM,UAAU,eAAe,CAC9B,KAAwB,EACxB,MAAY;IAEZ,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;AA6BD,MAAM,UAAU,SAAS,CAAI,MAAS,EAAE,QAAiC;IACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,kBAAkB,CACjC,aAAsB,EACtB,QAAc,EACd,UAAmC;IAEnC,OAAO;QACN,QAAQ;QACR,MAAM,EAAE,aAAa;QACrB,UAAU;KACV,CAAC;AACH,CAAC;AAED,MAAM,UAAU,cAAc,CAAI,MAAS;IAC1C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC;AAMD,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC5B,qEAAU,CAAA;IACV,+DAAO,CAAA;IACP,iEAAQ,CAAA;AACT,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Invariant } from \"../../util/index.js\";\n\nimport type { ChangeAtomId, RevisionTag } from \"./types.js\";\n\n/**\n * Rebasing logic for a particular kind of change.\n *\n * This interface is used to provide rebase policy to `Rebaser`.\n *\n * The implementation must ensure TChangeset forms a {@link https://en.wikipedia.org/wiki/Group_(mathematics | group}) where:\n * - `compose([])` is the identity element.\n * - associativity is defined as `compose([...a, ...b])` is equal to\n * `compose([compose(a), compose(b)])` for all `a` and `b`.\n * - `inverse(a)` gives the inverse element of `a`.\n *\n * In these requirements the definition of equality is up to the implementer,\n * but it is required that any two changes which are considered equal:\n * - have the same impact when applied to any tree.\n * - can be substituted for each-other in all methods on this\n * interface and produce equal (by this same definition) results.\n *\n * For the sake of testability, implementations will likely want to have a concrete equality implementation.\n *\n * This API uses `compose` on arrays instead of an explicit identity element and associative binary operator\n * to allow the implementation more room for optimization,\n * but should otherwise be equivalent to the identity element and binary operator group approach.\n *\n * TODO:\n * Be more specific about the above requirements.\n * For example, would something that is close to forming a group but has precision issues\n * (ex: the floating point numbers and addition) be ok?\n * Would this cause decoherence (and thus be absolutely not ok),\n * or just minor semantic precision issues, which could be tolerated.\n * For now assume that such issues are not ok.\n */\nexport interface ChangeRebaser<TChangeset> {\n\t_typeCheck?: Invariant<TChangeset>;\n\n\t/**\n\t * Compose a collection of changesets into a single one.\n\t * See {@link ChangeRebaser} for requirements.\n\t */\n\tcompose(changes: TaggedChange<TChangeset>[]): TChangeset;\n\n\t/**\n\t * @param changes - The changes to invert.\n\t * @param isRollback - Whether the inverted change is meant to rollback a change on a branch as is the case when\n\t * performing a sandwich rebase.\n\t * @param revision - The revision for the invert changeset.\n\t * This flag is relevant to merge semantics that are dependent on edit sequencing order:\n\t * - In the context of an undo, this function inverts a change that is sequenced and applied before the produced inverse.\n\t * - In the context of a rollback, this function inverts a change that is sequenced after but applied before the produced inverse.\n\t * @returns the inverse of `changes`.\n\t *\n\t * `compose([changes, inverse(changes)])` be equal to `compose([])`:\n\t * See {@link ChangeRebaser} for details.\n\t */\n\tinvert(\n\t\tchanges: TaggedChange<TChangeset>,\n\t\tisRollback: boolean,\n\t\trevision: RevisionTag,\n\t): TChangeset;\n\n\t/**\n\t * Rebase `change` over `over`.\n\t *\n\t * The resulting changeset should, as much as possible, replicate the same semantics as `change`,\n\t * except be valid to apply after `over` instead of before it.\n\t *\n\t * When rebasing `change` onto a new branch, `revisionMetadata` should include entries for all changesets\n\t * from the source which are being rebased onto the target branch.\n\t *\n\t * Requirements:\n\t * The implementation must ensure that for all possible changesets `a`, `b` and `c`:\n\t * - `rebase(a, compose([b, c])` is equal to `rebase(rebase(a, b), c)`.\n\t * - `rebase(compose([a, b]), c)` is equal to\n\t * `compose([rebase(a, c), rebase(b, compose([inverse(a), c, rebase(a, c)])])`.\n\t * - `rebase(a, compose([]))` is equal to `a`.\n\t * - `rebase(compose([]), a)` is equal to `compose([])`.\n\t */\n\trebase(\n\t\tchange: TaggedChange<TChangeset>,\n\t\tover: TaggedChange<TChangeset>,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): TChangeset;\n\n\t/**\n\t * Retrieves the set of revisions associated with the given change.\n\t */\n\tgetRevisions(change: TChangeset): Set<RevisionTag | undefined>;\n\n\t/**\n\t * Produces a changeset that is equivalent to the given `change`, but with all references to its own revisions replaced according to the given `replacer`.\n\t * @param change - The change to update. Not modified.\n\t * @param replacer - The replacer to use.\n\t * @returns A changeset equivalent to `change`, but with all references to its own revision replaced according to `replacer`.\n\t */\n\tchangeRevision(change: TChangeset, replacer: RevisionReplacer): TChangeset;\n}\n\n/**\n * A type that can update references to a set of obsolete revisions across multiple changesets.\n */\nexport interface RevisionReplacer {\n\t/**\n\t * The revision to use in place of the obsolete revisions.\n\t */\n\treadonly updatedRevision: RevisionTag;\n\n\t/**\n\t * Predicate to determine if a revision needs replacing.\n\t * @param revision - The revision that may need replacing.\n\t * @returns true iff the given `revision` needs replacing.\n\t */\n\tisObsolete(revision: RevisionTag | undefined): boolean;\n\n\t/**\n\t * Returns the updated ID for the given ID.\n\t * @param id - The ID of the first change atom to update.\n\t * @param count - The number of contiguous change atoms to update. Defaults to 1.\n\t * @returns an updated ID iff the given `id` needs updating, otherwise returns the given `id`.\n\t * @remarks\n\t * This function always maps the same input {@link ChangeAtomId.revision | revision} and {@link ChangeAtomId.localId | local ID} to the same output revision local ID.\n\t * This means multiple references to the same atom of change will remain consistent after revision replacement.\n\t */\n\tgetUpdatedAtomId<T extends ChangeAtomId>(id: T, count?: number): T;\n}\n\nexport interface TaggedChange<TChangeset, TTag = RevisionTag | undefined> {\n\treadonly revision: TTag;\n\t/**\n\t * When populated, indicates that the changeset is a rollback for the purpose of a rebase sandwich.\n\t * The value corresponds to the `revision` of the original changeset being rolled back.\n\t */\n\treadonly rollbackOf?: RevisionTag;\n\treadonly change: TChangeset;\n}\n\nexport function mapTaggedChange<TIn, TOut>(\n\tinput: TaggedChange<TIn>,\n\tchange: TOut,\n): TaggedChange<TOut> {\n\treturn { ...input, change };\n}\n\n/**\n * A callback that returns the index of the changeset associated with the given RevisionTag among the changesets being\n * composed or rebased. This index is solely meant to communicate relative ordering, and is only valid within the scope of the\n * compose or rebase operation.\n *\n * During composition, the index reflects the order of the changeset within the overall composed changeset that is\n * being produced.\n *\n * During rebase, the indices of the base changes are all lower than the indices of the change being rebased.\n */\nexport type RevisionIndexer = (tag: RevisionTag) => number | undefined;\n\nexport interface RevisionMetadataSource {\n\treadonly getIndex: RevisionIndexer;\n\treadonly tryGetInfo: (tag: RevisionTag | undefined) => RevisionInfo | undefined;\n\treadonly hasRollback: (tag: RevisionTag) => boolean;\n}\n\nexport interface RevisionInfo {\n\treadonly revision: RevisionTag;\n\t/**\n\t * When populated, indicates that the changeset is a rollback for the purpose of a rebase sandwich.\n\t * The value corresponds to the `revision` of the original changeset being rolled back.\n\t */\n\treadonly rollbackOf?: RevisionTag;\n}\n\nexport function tagChange<T>(change: T, revision: RevisionTag | undefined): TaggedChange<T> {\n\treturn { revision, change };\n}\n\nexport function tagRollbackInverse<TChange, TTag>(\n\tinverseChange: TChange,\n\trevision: TTag,\n\trollbackOf: RevisionTag | undefined,\n): TaggedChange<TChange, TTag> {\n\treturn {\n\t\trevision,\n\t\tchange: inverseChange,\n\t\trollbackOf,\n\t};\n}\n\nexport function makeAnonChange<T>(change: T): TaggedChange<T> {\n\treturn { revision: undefined, change };\n}\n\nexport interface FinalChange {\n\treadonly status: FinalChangeStatus;\n}\n\nexport enum FinalChangeStatus {\n\tconflicted,\n\trebased,\n\tcommuted,\n}\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, type GraphCommit, CommitKind, type CommitMetadata, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, type RevisionTag, RevisionTagSchema, type EncodedRevisionTag, type EncodedChangeAtomId, type EncodedStableId, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, compareRevisions, } from "./types.js";
5
+ export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, mintCommit, type GraphCommit, CommitKind, type CommitMetadata, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, 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";
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,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,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,gBAAgB,GAChB,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,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,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"}
@@ -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, CommitKind, RevisionTagSchema, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, newChangeAtomIdRangeMap, compareRevisions, } from "./types.js";
5
+ export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, mintCommit, CommitKind, RevisionTagSchema, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, newChangeAtomIdRangeMap, 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,EAEV,UAAU,EAMV,iBAAiB,EAOjB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EAErB,uBAAuB,EACvB,gBAAgB,GAChB,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\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\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\tcompareRevisions,\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,EAEV,UAAU,EAMV,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\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\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"]}
@@ -23,6 +23,9 @@ export type EncodedStableId = Brand<StableId, "EncodedStableId">;
23
23
  export declare const StableIdSchema: import("@sinclair/typebox").TString;
24
24
  /**
25
25
  * An ID which is unique within a revision of a `ModularChangeset`.
26
+ * @remarks
27
+ * Always a real number (never `NaN` or +/- `Infinity`).
28
+ *
26
29
  * A `ModularChangeset` which is a composition of multiple revisions may contain duplicate `ChangesetLocalId`s,
27
30
  * but they are unique when qualified by the revision of the change they are used in.
28
31
  */
@@ -58,7 +61,9 @@ export declare function makeChangeAtomId(localId: ChangesetLocalId, revision?: R
58
61
  export declare function asChangeAtomId(id: ChangesetLocalId | ChangeAtomId): ChangeAtomId;
59
62
  export declare function taggedAtomId(id: ChangeAtomId, revision: RevisionTag | undefined): ChangeAtomId;
60
63
  export declare function taggedOptAtomId(id: ChangeAtomId | undefined, revision: RevisionTag | undefined): ChangeAtomId | undefined;
61
- export declare function offsetChangeAtomId(id: ChangeAtomId, offset: number): ChangeAtomId;
64
+ export declare function offsetChangeAtomId<T extends ChangeAtomId>(id: T, offset: number): T;
65
+ export declare function compareChangesetLocalIds(a: ChangesetLocalId, b: ChangesetLocalId): number;
66
+ export declare function comparePartialChangesetLocalIds(a: ChangesetLocalId | undefined, b: ChangesetLocalId | undefined): number;
62
67
  /**
63
68
  * A node in a graph of commits. A commit's parent is the commit on which it was based.
64
69
  */
@@ -132,6 +137,11 @@ export interface LocalChangeMetadata extends CommitMetadata {
132
137
  * @throws Throws an error if called outside the scope of the `changed` event that provided it.
133
138
  */
134
139
  getRevertible(onDisposed?: (revertible: RevertibleAlpha) => void): RevertibleAlpha | undefined;
140
+ /**
141
+ * Optional label provided by the user when commit was created.
142
+ * This can be used by undo/redo to group or classify edits.
143
+ */
144
+ readonly label?: unknown;
135
145
  }
136
146
  /**
137
147
  * Information about a change that has been applied by a remote client.
@@ -152,6 +162,11 @@ export interface RemoteChangeMetadata extends CommitMetadata {
152
162
  * @remarks This is only available for {@link LocalChangeMetadata | local changes}.
153
163
  */
154
164
  readonly getRevertible?: undefined;
165
+ /**
166
+ * Label provided by the user when commit was created.
167
+ * @remarks This is only available for {@link LocalChangeMetadata | local changes}.
168
+ */
169
+ readonly label?: undefined;
155
170
  }
156
171
  /**
157
172
  * Information about a {@link LocalChangeMetadata | local} or {@link RemoteChangeMetadata | remote} change that has been applied.
@@ -166,7 +181,12 @@ export type ChangeMetadata = LocalChangeMetadata | RemoteChangeMetadata;
166
181
  */
167
182
  export declare function mintCommit<TChange>(parent: GraphCommit<TChange>, commit: Omit<GraphCommit<TChange>, "parent">): GraphCommit<TChange>;
168
183
  export type ChangeAtomIdRangeMap<V> = RangeMap<ChangeAtomId, V>;
169
- export declare function newChangeAtomIdRangeMap<V>(): ChangeAtomIdRangeMap<V>;
184
+ export declare function newChangeAtomIdRangeMap<V>(offsetValue?: (value: V, offset: number) => V): ChangeAtomIdRangeMap<V>;
170
185
  export declare function subtractChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): number;
171
- export declare function compareRevisions(a: RevisionTag | undefined, b: RevisionTag | undefined): number;
186
+ /**
187
+ * Compares two {@link RevisionTag}s to form a strict total ordering.
188
+ * @remarks This function tolerates arbitrary strings, not just the string "root".
189
+ * It sorts as follows: `undefined` \< `string` \< `number`
190
+ */
191
+ export declare function comparePartialRevisions(a: RevisionTag | undefined, b: RevisionTag | undefined): number;
172
192
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,SAAS,EACT,wBAAwB,EACxB,QAAQ,EACR,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACN,KAAK,KAAK,EACV,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,QAAQ,EAIR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,eAAe,gDAAiC,CAAC;AAE9D;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,wBAAwB,GAAG,MAAM,CAAC;AAC5D,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,GAAG,MAAM,CAAC;AAC3F,eAAO,MAAM,iBAAiB,2KAG5B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AACjE,eAAO,MAAM,cAAc,qCAAgB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;CACnC;AAED,MAAM,MAAM,mBAAmB,GAAG,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,GAAG,gBAAgB,CAAC;AAE5F,MAAM,MA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C,CAOtB;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,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"}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { Type } from "@sinclair/typebox";
6
- import { RangeMap, brand, brandedNumberType, brandedStringType, } from "../../util/index.js";
6
+ import { RangeMap, brand, brandedNumberType, brandedStringType, comparePartialStrings, } from "../../util/index.js";
7
7
  /**
8
8
  * The identifier for a particular session/user/client that can generate `GraphCommit`s
9
9
  */
@@ -46,6 +46,19 @@ export function taggedOptAtomId(id, revision) {
46
46
  export function offsetChangeAtomId(id, offset) {
47
47
  return { ...id, localId: brand(id.localId + offset) };
48
48
  }
49
+ // #region These comparison functions are used instead of e.g. `compareNumbers` as a performance optimization
50
+ export function compareChangesetLocalIds(a, b) {
51
+ return a - b; // No need to consider `NaN` or `Infinity` since ChangesetLocalId is always a real number
52
+ }
53
+ export function comparePartialChangesetLocalIds(a, b) {
54
+ if (a === undefined) {
55
+ return b === undefined ? 0 : -1;
56
+ }
57
+ else if (b === undefined) {
58
+ return 1;
59
+ }
60
+ return compareChangesetLocalIds(a, b);
61
+ }
49
62
  /**
50
63
  * The type of a commit. This is used to describe the context in which the commit was created.
51
64
  *
@@ -76,29 +89,28 @@ export function mintCommit(parent, commit) {
76
89
  parent,
77
90
  };
78
91
  }
79
- export function newChangeAtomIdRangeMap() {
80
- return new RangeMap(offsetChangeAtomId, subtractChangeAtomIds);
92
+ export function newChangeAtomIdRangeMap(offsetValue) {
93
+ return new RangeMap(offsetChangeAtomId, subtractChangeAtomIds, offsetValue);
81
94
  }
82
95
  export function subtractChangeAtomIds(a, b) {
83
- const cmp = compareRevisions(a.revision, b.revision);
96
+ const cmp = comparePartialRevisions(a.revision, b.revision);
84
97
  if (cmp !== 0) {
85
98
  return cmp * Number.POSITIVE_INFINITY;
86
99
  }
87
100
  return a.localId - b.localId;
88
101
  }
89
- export function compareRevisions(a, b) {
90
- if (a === undefined) {
91
- return b === undefined ? 0 : -1;
92
- }
93
- else if (b === undefined) {
94
- return 1;
102
+ /**
103
+ * Compares two {@link RevisionTag}s to form a strict total ordering.
104
+ * @remarks This function tolerates arbitrary strings, not just the string "root".
105
+ * It sorts as follows: `undefined` \< `string` \< `number`
106
+ */
107
+ export function comparePartialRevisions(a, b) {
108
+ if (typeof a === "number") {
109
+ return typeof b === "number" ? a - b : 1;
95
110
  }
96
- else if (a < b) {
111
+ else if (typeof b === "number") {
97
112
  return -1;
98
113
  }
99
- else if (a > b) {
100
- return 1;
101
- }
102
- return 0;
114
+ return comparePartialStrings(a, b);
103
115
  }
104
116
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAIN,QAAQ,EACR,KAAK,EACL,iBAAiB,EACjB,iBAAiB,GACjB,MAAM,qBAAqB,CAAC;AAG7B;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,EAAa,CAAC;AAW9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC;IAC3C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IACpB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AC;IACjC,CAAC;SAAM,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,CAAC,CAAC;IACV,CAAC;SAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAClB,OAAO,CAAC,CAAC,CAAC;IACX,CAAC;SAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAClB,OAAO,CAAC,CAAC;IACV,CAAC;IAED,OAAO,CAAC,CAAC;AACV,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tOpSpaceCompressedId,\n\tSessionId,\n\tSessionSpaceCompressedId,\n\tStableId,\n} from \"@fluidframework/id-compressor\";\nimport { Type } from \"@sinclair/typebox\";\n\nimport {\n\ttype Brand,\n\ttype JsonCompatibleReadOnly,\n\ttype NestedMap,\n\tRangeMap,\n\tbrand,\n\tbrandedNumberType,\n\tbrandedStringType,\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 * 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(id: ChangeAtomId, offset: number): ChangeAtomId {\n\treturn { ...id, localId: brand(id.localId + offset) };\n}\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}\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 TreeBranchAlpha.applyChange | applied to another branch} 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\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}\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 } = commit;\n\treturn {\n\t\trevision,\n\t\tchange,\n\t\tparent,\n\t};\n}\n\nexport type ChangeAtomIdRangeMap<V> = RangeMap<ChangeAtomId, V>;\n\nexport function newChangeAtomIdRangeMap<V>(): ChangeAtomIdRangeMap<V> {\n\treturn new RangeMap(offsetChangeAtomId, subtractChangeAtomIds);\n}\n\nexport function subtractChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): number {\n\tconst cmp = compareRevisions(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\nexport function compareRevisions(\n\ta: RevisionTag | undefined,\n\tb: RevisionTag | 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} else if (a < b) {\n\t\treturn -1;\n\t} else if (a > b) {\n\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAIN,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,KAAK,CAAC;IAC3C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IACpB,iBAAiB,EAAuC;CACxD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;AAkC5C;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,CAAe,EAAE,CAAe;IACrE,OAAO,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ,CAAC;AAC7D,CAAC;AAED,MAAM,U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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 {\n\tOpSpaceCompressedId,\n\tSessionId,\n\tSessionSpaceCompressedId,\n\tStableId,\n} from \"@fluidframework/id-compressor\";\nimport { Type } from \"@sinclair/typebox\";\n\nimport {\n\ttype Brand,\n\ttype JsonCompatibleReadOnly,\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}\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 TreeBranchAlpha.applyChange | applied to another branch} 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\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}\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 } = commit;\n\treturn {\n\t\trevision,\n\t\tchange,\n\t\tparent,\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"]}
@@ -33,6 +33,7 @@ export declare const FieldKindIdentifierSchema: import("@sinclair/typebox").TUns
33
33
  * TypeBox Schema for encoding {@link TreeNodeSchemaIdentifiers} in persisted data.
34
34
  */
35
35
  export declare const TreeNodeSchemaIdentifierSchema: import("@sinclair/typebox").TUnsafe<TreeNodeSchemaIdentifier<string>>;
36
+ export type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;
36
37
  export declare const FieldSchemaFormat: import("@sinclair/typebox").TObject<{
37
38
  kind: import("@sinclair/typebox").TUnsafe<FieldKindIdentifier>;
38
39
  types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<TreeNodeSchemaIdentifier<string>>>;
@@ -52,6 +53,7 @@ export declare enum PersistedValueSchema {
52
53
  *
53
54
  * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
54
55
  */
56
+ export type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;
55
57
  export declare const TreeNodeSchemaDataFormat: import("@sinclair/typebox").TObject<{
56
58
  /**
57
59
  * Object node union member.
@@ -72,6 +74,4 @@ export declare const TreeNodeSchemaDataFormat: import("@sinclair/typebox").TObje
72
74
  */
73
75
  leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof PersistedValueSchema>>;
74
76
  }>;
75
- export type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;
76
- export type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;
77
77
  //# sourceMappingURL=formatV1.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatV1.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAG1E,OAAO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;AAEtD;;GAEG;AACH,eAAO,MAAM,cAAc,+CAAgC,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,KAAK,CAC1E,KAAK,EACL,+BAA+B,CAC/B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;AAC5E,eAAO,MAAM,yBAAyB,0DAA2C,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,8BAA8B,uEAAgD,CAAC;AAS5F,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,eAAO,MAAM,iBAAiB;;;EAA6D,CAAC;AAE5F;;GAEG;AACH,oBAAY,oBAAoB;IAC/B,MAAM,IAAA;IACN,MAAM,IAAA;IACN,OAAO,IAAA;IACP,WAAW,IAAA;IACX,IAAI,IAAA;CACJ;AAED;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,eAAO,MAAM,wBAAwB;IAEnC;;OAEG;;;;;IAEH;;OAEG;;;;;IAEH;;OAEG;;EAIJ,CAAC"}
@@ -31,11 +31,6 @@ export var PersistedValueSchema;
31
31
  PersistedValueSchema[PersistedValueSchema["FluidHandle"] = 3] = "FluidHandle";
32
32
  PersistedValueSchema[PersistedValueSchema["Null"] = 4] = "Null";
33
33
  })(PersistedValueSchema || (PersistedValueSchema = {}));
34
- /**
35
- * Discriminated union content of tree node schema.
36
- *
37
- * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
38
- */
39
34
  export const TreeNodeSchemaDataFormat = Type.Object({
40
35
  /**
41
36
  * Object node union member.
@@ -1 +1 @@
1
- {"version":3,"file":"formatV1.js","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAA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AAC,oBAAoB,CAAC,CAAC;CACpD,EACD,YAAY,CACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../codec/index.js\";\nimport { type Brand, brandedStringType } from \"../../util/index.js\";\n\n/**\n * Key (aka Name or Label) for a field which is scoped to a specific TreeNodeStoredSchema.\n *\n * Stable identifier, used when persisting data.\n */\nexport type FieldKey = Brand<string, \"tree.FieldKey\">;\n\n/**\n * TypeBox Schema for encoding {@link FieldKey} in persisted data.\n */\nexport const FieldKeySchema = brandedStringType<FieldKey>();\n\n/**\n * Identifier for a TreeNode schema.\n * Also known as \"Definition\"\n *\n * Stable identifier, used when persisting data.\n */\nexport type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<\n\tTName,\n\t\"tree.TreeNodeSchemaIdentifier\"\n>;\n\n/**\n * Identifier for a FieldKind.\n * Refers to an exact stable policy (ex: specific version of a policy),\n * for how to handle (ex: edit and merge edits to) fields marked with this kind.\n * Persisted in documents as part of stored schema.\n */\nexport type FieldKindIdentifier = Brand<string, \"tree.FieldKindIdentifier\">;\nexport const FieldKindIdentifierSchema = brandedStringType<FieldKindIdentifier>();\n\n/**\n * TypeBox Schema for encoding {@link TreeNodeSchemaIdentifiers} in persisted data.\n */\nexport const TreeNodeSchemaIdentifierSchema = brandedStringType<TreeNodeSchemaIdentifier>();\n\nconst FieldSchemaFormatBase = Type.Object({\n\tkind: FieldKindIdentifierSchema,\n\ttypes: Type.Array(TreeNodeSchemaIdentifierSchema),\n});\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport const FieldSchemaFormat = Type.Composite([FieldSchemaFormatBase], noAdditionalProps);\n\n/**\n * Persisted version of {@link ValueSchema}.\n */\nexport enum PersistedValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Discriminated union content of tree node schema.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const TreeNodeSchemaDataFormat = Type.Object(\n\t{\n\t\t/**\n\t\t * Object node union member.\n\t\t */\n\t\tobject: Type.Optional(Type.Record(Type.String(), FieldSchemaFormat)),\n\t\t/**\n\t\t * Map node union member.\n\t\t */\n\t\tmap: Type.Optional(FieldSchemaFormat),\n\t\t/**\n\t\t * Leaf node union member.\n\t\t */\n\t\tleaf: Type.Optional(Type.Enum(PersistedValueSchema)),\n\t},\n\tunionOptions,\n);\n\nexport type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;\n\nexport type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;\n"]}
1
+ {"version":3,"file":"formatV1.js","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAmC,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAc,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AASpE;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,EAAY,CAAC;AAoB5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,EAAuB,CAAC;AAElF;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,iBAAiB,EAA4B,CAAC;AAE5F,MAAM,qBAAqB,GAAG,IAAI,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC;CACjD,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAGzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAE5F;;GAEG;AACH,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC/B,mEAAM,CAAA;IACN,mEAAM,CAAA;IACN,qEAAO,CAAA;IACP,6EAAW,CAAA;IACX,+DAAI,CAAA;AACL,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B;AAQD,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,MAAM,CAClD;IACC;;OAEG;IACH,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC,CAAC;IACpE;;OAEG;IACH,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACrC;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;CACpD,EACD,YAAY,CACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../codec/index.js\";\nimport { type Brand, brandedStringType } from \"../../util/index.js\";\n\n/**\n * Key (aka Name or Label) for a field which is scoped to a specific TreeNodeStoredSchema.\n *\n * Stable identifier, used when persisting data.\n */\nexport type FieldKey = Brand<string, \"tree.FieldKey\">;\n\n/**\n * TypeBox Schema for encoding {@link FieldKey} in persisted data.\n */\nexport const FieldKeySchema = brandedStringType<FieldKey>();\n\n/**\n * Identifier for a TreeNode schema.\n * Also known as \"Definition\"\n *\n * Stable identifier, used when persisting data.\n */\nexport type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<\n\tTName,\n\t\"tree.TreeNodeSchemaIdentifier\"\n>;\n\n/**\n * Identifier for a FieldKind.\n * Refers to an exact stable policy (ex: specific version of a policy),\n * for how to handle (ex: edit and merge edits to) fields marked with this kind.\n * Persisted in documents as part of stored schema.\n */\nexport type FieldKindIdentifier = Brand<string, \"tree.FieldKindIdentifier\">;\nexport const FieldKindIdentifierSchema = brandedStringType<FieldKindIdentifier>();\n\n/**\n * TypeBox Schema for encoding {@link TreeNodeSchemaIdentifiers} in persisted data.\n */\nexport const TreeNodeSchemaIdentifierSchema = brandedStringType<TreeNodeSchemaIdentifier>();\n\nconst FieldSchemaFormatBase = Type.Object({\n\tkind: FieldKindIdentifierSchema,\n\ttypes: Type.Array(TreeNodeSchemaIdentifierSchema),\n});\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;\nexport const FieldSchemaFormat = Type.Composite([FieldSchemaFormatBase], noAdditionalProps);\n\n/**\n * Persisted version of {@link ValueSchema}.\n */\nexport enum PersistedValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Discriminated union content of tree node schema.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;\nexport const TreeNodeSchemaDataFormat = Type.Object(\n\t{\n\t\t/**\n\t\t * Object node union member.\n\t\t */\n\t\tobject: Type.Optional(Type.Record(Type.String(), FieldSchemaFormat)),\n\t\t/**\n\t\t * Map node union member.\n\t\t */\n\t\tmap: Type.Optional(FieldSchemaFormat),\n\t\t/**\n\t\t * Leaf node union member.\n\t\t */\n\t\tleaf: Type.Optional(Type.Enum(PersistedValueSchema)),\n\t},\n\tunionOptions,\n);\n"]}
@@ -3,12 +3,15 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { type Static } from "@sinclair/typebox";
6
+ import type { JsonCompatibleReadOnlyObject } from "../../util/index.js";
6
7
  import { PersistedValueSchema } from "./formatV1.js";
7
- export declare const PersistedMetadataFormat: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
8
+ export type PersistedMetadataFormat = Static<typeof PersistedMetadataFormat>;
9
+ export declare const PersistedMetadataFormat: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<JsonCompatibleReadOnlyObject>>;
10
+ export type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;
8
11
  export declare const FieldSchemaFormat: import("@sinclair/typebox").TObject<{
9
12
  kind: import("@sinclair/typebox").TUnsafe<import("./formatV1.js").FieldKindIdentifier>;
10
13
  types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("./formatV1.js").TreeNodeSchemaIdentifier<string>>>;
11
- metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
14
+ metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<JsonCompatibleReadOnlyObject>>;
12
15
  }>;
13
16
  /**
14
17
  * Format for the content of a {@link TreeNodeStoredSchema}.
@@ -22,7 +25,7 @@ export declare const TreeNodeSchemaUnionFormat: import("@sinclair/typebox").TObj
22
25
  object: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
23
26
  kind: import("@sinclair/typebox").TUnsafe<import("./formatV1.js").FieldKindIdentifier>;
24
27
  types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("./formatV1.js").TreeNodeSchemaIdentifier<string>>>;
25
- metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
28
+ metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<JsonCompatibleReadOnlyObject>>;
26
29
  }>>>;
27
30
  /**
28
31
  * Map node union member.
@@ -30,7 +33,7 @@ export declare const TreeNodeSchemaUnionFormat: import("@sinclair/typebox").TObj
30
33
  map: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
31
34
  kind: import("@sinclair/typebox").TUnsafe<import("./formatV1.js").FieldKindIdentifier>;
32
35
  types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("./formatV1.js").TreeNodeSchemaIdentifier<string>>>;
33
- metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
36
+ metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<JsonCompatibleReadOnlyObject>>;
34
37
  }>>;
35
38
  /**
36
39
  * Leaf node union member.
@@ -43,6 +46,7 @@ export type TreeNodeSchemaUnionFormat = Static<typeof TreeNodeSchemaUnionFormat>
43
46
  *
44
47
  * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
45
48
  */
49
+ export type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;
46
50
  export declare const TreeNodeSchemaDataFormat: import("@sinclair/typebox").TObject<{
47
51
  /**
48
52
  * Node kind specific data.
@@ -54,7 +58,7 @@ export declare const TreeNodeSchemaDataFormat: import("@sinclair/typebox").TObje
54
58
  object: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
55
59
  kind: import("@sinclair/typebox").TUnsafe<import("./formatV1.js").FieldKindIdentifier>;
56
60
  types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("./formatV1.js").TreeNodeSchemaIdentifier<string>>>;
57
- metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
61
+ metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<JsonCompatibleReadOnlyObject>>;
58
62
  }>>>;
59
63
  /**
60
64
  * Map node union member.
@@ -62,7 +66,7 @@ export declare const TreeNodeSchemaDataFormat: import("@sinclair/typebox").TObje
62
66
  map: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
63
67
  kind: import("@sinclair/typebox").TUnsafe<import("./formatV1.js").FieldKindIdentifier>;
64
68
  types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("./formatV1.js").TreeNodeSchemaIdentifier<string>>>;
65
- metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
69
+ metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<JsonCompatibleReadOnlyObject>>;
66
70
  }>>;
67
71
  /**
68
72
  * Leaf node union member.
@@ -72,9 +76,6 @@ export declare const TreeNodeSchemaDataFormat: import("@sinclair/typebox").TObje
72
76
  /**
73
77
  * Leaf node union member.
74
78
  */
75
- metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
79
+ metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<JsonCompatibleReadOnlyObject>>;
76
80
  }>;
77
- export type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;
78
- export type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;
79
- export type PersistedMetadataFormat = Static<typeof PersistedMetadataFormat>;
80
81
  //# sourceMappingURL=formatV2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatV2.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAK1E,OAAO,EAEN,oBAAoB,EAEpB,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,uBAAuB,yEAA8C,CAAC;AAUnF,eAAO,MAAM,iBAAiB;;;;EAA6D,CAAC;AAE5F;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;IAEpC;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;EAIJ,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;IAEnC;;OAEG;;QA3BH;;WAEG;;;;;;QAEH;;WAEG;;;;;;QAEH;;WAEG;;;IAqBH;;OAEG;;EAIJ,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE/E,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEjE,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"formatV2.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAG1E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAGxE,OAAO,EAEN,oBAAoB,EAEpB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,eAAO,MAAM,uBAAuB,0GAInC,CAAC;AAUF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,eAAO,MAAM,iBAAiB;;;;EAA6D,CAAC;AAE5F;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;IAEpC;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;EAIJ,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAEjF;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,eAAO,MAAM,wBAAwB;IAEnC;;OAEG;;QA5BH;;WAEG;;;;;;QAEH;;WAEG;;;;;;QAEH;;WAEG;;;IAsBH;;OAEG;;EAIJ,CAAC"}
@@ -6,7 +6,7 @@ import { Type } from "@sinclair/typebox";
6
6
  import { unionOptions } from "../../codec/index.js";
7
7
  import { JsonCompatibleReadOnlySchema } from "../../util/index.js";
8
8
  import { FieldKindIdentifierSchema, PersistedValueSchema, TreeNodeSchemaIdentifierSchema, } from "./formatV1.js";
9
- export const PersistedMetadataFormat = Type.Optional(JsonCompatibleReadOnlySchema);
9
+ export const PersistedMetadataFormat = Type.Optional(Type.Unsafe(Type.Record(Type.String(), JsonCompatibleReadOnlySchema)));
10
10
  const FieldSchemaFormatBase = Type.Object({
11
11
  kind: FieldKindIdentifierSchema,
12
12
  types: Type.Array(TreeNodeSchemaIdentifierSchema),
@@ -33,11 +33,6 @@ export const TreeNodeSchemaUnionFormat = Type.Object({
33
33
  */
34
34
  leaf: Type.Optional(Type.Enum(PersistedValueSchema)),
35
35
  }, unionOptions);
36
- /**
37
- * Format for {@link TreeNodeStoredSchema}.
38
- *
39
- * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
40
- */
41
36
  export const TreeNodeSchemaDataFormat = Type.Object({
42
37
  /**
43
38
  * Node kind specific data.
@@ -1 +1 @@
1
- {"version":3,"file":"formatV2.js","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAmC,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EACN,yBAAyB,EACzB,oBAAoB,EACpB,8BAA8B,GAC9B,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC;AAEnF,MAAM,qBAAqB,GAAG,IAAI,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC;IACjD,QAAQ,EAAE,uBAAuB;CACjC,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAEzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAE5F;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,MAAM,CACnD;IACC;;OAEG;IACH,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC,CAAC;IACpE;;OAEG;IACH,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACrC;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;CACpD,EACD,YAAY,CACZ,CAAC;AAIF;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,MAAM,CAClD;IACC;;OAEG;IACH,IAAI,EAAE,yBAAyB;IAE/B,2CAA2C;IAC3C;;OAEG;IACH,QAAQ,EAAE,uBAAuB;CACjC,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../codec/index.js\";\nimport { JsonCompatibleReadOnlySchema } from \"../../util/index.js\";\n\nimport {\n\tFieldKindIdentifierSchema,\n\tPersistedValueSchema,\n\tTreeNodeSchemaIdentifierSchema,\n} from \"./formatV1.js\";\n\nexport const PersistedMetadataFormat = Type.Optional(JsonCompatibleReadOnlySchema);\n\nconst FieldSchemaFormatBase = Type.Object({\n\tkind: FieldKindIdentifierSchema,\n\ttypes: Type.Array(TreeNodeSchemaIdentifierSchema),\n\tmetadata: PersistedMetadataFormat,\n});\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport const FieldSchemaFormat = Type.Composite([FieldSchemaFormatBase], noAdditionalProps);\n\n/**\n * Format for the content of a {@link TreeNodeStoredSchema}.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const TreeNodeSchemaUnionFormat = Type.Object(\n\t{\n\t\t/**\n\t\t * Object node union member.\n\t\t */\n\t\tobject: Type.Optional(Type.Record(Type.String(), FieldSchemaFormat)),\n\t\t/**\n\t\t * Map node union member.\n\t\t */\n\t\tmap: Type.Optional(FieldSchemaFormat),\n\t\t/**\n\t\t * Leaf node union member.\n\t\t */\n\t\tleaf: Type.Optional(Type.Enum(PersistedValueSchema)),\n\t},\n\tunionOptions,\n);\n\nexport type TreeNodeSchemaUnionFormat = Static<typeof TreeNodeSchemaUnionFormat>;\n\n/**\n * Format for {@link TreeNodeStoredSchema}.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const TreeNodeSchemaDataFormat = Type.Object(\n\t{\n\t\t/**\n\t\t * Node kind specific data.\n\t\t */\n\t\tkind: TreeNodeSchemaUnionFormat,\n\n\t\t// Data in common for all TreeNode schemas:\n\t\t/**\n\t\t * Leaf node union member.\n\t\t */\n\t\tmetadata: PersistedMetadataFormat,\n\t},\n\tnoAdditionalProps,\n);\n\nexport type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;\n\nexport type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;\n\nexport type PersistedMetadataFormat = Static<typeof PersistedMetadataFormat>;\n"]}
1
+ {"version":3,"file":"formatV2.js","sourceRoot":"","sources":["../../../src/core/schema-stored/formatV2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAmC,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EACN,yBAAyB,EACzB,oBAAoB,EACpB,8BAA8B,GAC9B,MAAM,eAAe,CAAC;AAGvB,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,QAAQ,CACnD,IAAI,CAAC,MAAM,CACV,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,4BAA4B,CAAC,CACxD,CACD,CAAC;AAEF,MAAM,qBAAqB,GAAG,IAAI,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC;IACjD,QAAQ,EAAE,uBAAuB;CACjC,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAGzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAE5F;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,MAAM,CACnD;IACC;;OAEG;IACH,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC,CAAC;IACpE;;OAEG;IACH,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACrC;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;CACpD,EACD,YAAY,CACZ,CAAC;AAUF,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,MAAM,CAClD;IACC;;OAEG;IACH,IAAI,EAAE,yBAAyB;IAE/B,2CAA2C;IAC3C;;OAEG;IACH,QAAQ,EAAE,uBAAuB;CACjC,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../codec/index.js\";\nimport type { JsonCompatibleReadOnlyObject } from \"../../util/index.js\";\nimport { JsonCompatibleReadOnlySchema } from \"../../util/index.js\";\n\nimport {\n\tFieldKindIdentifierSchema,\n\tPersistedValueSchema,\n\tTreeNodeSchemaIdentifierSchema,\n} from \"./formatV1.js\";\n\nexport type PersistedMetadataFormat = Static<typeof PersistedMetadataFormat>;\nexport const PersistedMetadataFormat = Type.Optional(\n\tType.Unsafe<JsonCompatibleReadOnlyObject>(\n\t\tType.Record(Type.String(), JsonCompatibleReadOnlySchema),\n\t),\n);\n\nconst FieldSchemaFormatBase = Type.Object({\n\tkind: FieldKindIdentifierSchema,\n\ttypes: Type.Array(TreeNodeSchemaIdentifierSchema),\n\tmetadata: PersistedMetadataFormat,\n});\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport type FieldSchemaFormat = Static<typeof FieldSchemaFormat>;\nexport const FieldSchemaFormat = Type.Composite([FieldSchemaFormatBase], noAdditionalProps);\n\n/**\n * Format for the content of a {@link TreeNodeStoredSchema}.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const TreeNodeSchemaUnionFormat = Type.Object(\n\t{\n\t\t/**\n\t\t * Object node union member.\n\t\t */\n\t\tobject: Type.Optional(Type.Record(Type.String(), FieldSchemaFormat)),\n\t\t/**\n\t\t * Map node union member.\n\t\t */\n\t\tmap: Type.Optional(FieldSchemaFormat),\n\t\t/**\n\t\t * Leaf node union member.\n\t\t */\n\t\tleaf: Type.Optional(Type.Enum(PersistedValueSchema)),\n\t},\n\tunionOptions,\n);\n\nexport type TreeNodeSchemaUnionFormat = Static<typeof TreeNodeSchemaUnionFormat>;\n\n/**\n * Format for {@link TreeNodeStoredSchema}.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport type TreeNodeSchemaDataFormat = Static<typeof TreeNodeSchemaDataFormat>;\nexport const TreeNodeSchemaDataFormat = Type.Object(\n\t{\n\t\t/**\n\t\t * Node kind specific data.\n\t\t */\n\t\tkind: TreeNodeSchemaUnionFormat,\n\n\t\t// Data in common for all TreeNode schemas:\n\t\t/**\n\t\t * Leaf node union member.\n\t\t */\n\t\tmetadata: PersistedMetadataFormat,\n\t},\n\tnoAdditionalProps,\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,qBAAqB,EAC1B,WAAW,EACX,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,6BAA6B,EAC7B,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,EAC5B,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,mBAAmB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,iBAAiB,EACjB,KAAK,YAAY,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,YAAY,EAAE,wBAAwB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE7F,OAAO,KAAK,cAAc,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,OAAO,KAAK,cAAc,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,qBAAqB,EAC1B,WAAW,EACX,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,6BAA6B,EAC7B,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,EAC5B,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,mBAAmB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,iBAAiB,EACjB,KAAK,YAAY,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,YAAY,EAAE,wBAAwB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE7F,OAAO,KAAK,cAAc,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,OAAO,KAAK,cAAc,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -6,7 +6,9 @@ export { ValueSchema, TreeNodeStoredSchema, forbiddenFieldKindIdentifier, identi
6
6
  export { TreeStoredSchemaRepository, schemaDataIsEmpty, } from "./storedSchemaRepository.js";
7
7
  export { Multiplicity } from "./multiplicity.js";
8
8
  import * as schemaFormatV1 from "./formatV1.js";
9
+ // eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor) or named exports (changes public API)
9
10
  export { schemaFormatV1 };
10
11
  import * as schemaFormatV2 from "./formatV2.js";
12
+ // eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor) or named exports (changes public API)
11
13
  export { schemaFormatV2 };
12
14
  //# sourceMappingURL=index.js.map