@fluidframework/tree 2.74.0-365691 → 2.74.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 (856) hide show
  1. package/.vscode/settings.json +4 -2
  2. package/CHANGELOG.md +11 -0
  3. package/api-report/tree.alpha.api.md +125 -87
  4. package/api-report/tree.beta.api.md +0 -1
  5. package/api-report/tree.legacy.beta.api.md +0 -1
  6. package/api-report/tree.legacy.public.api.md +0 -1
  7. package/api-report/tree.public.api.md +0 -1
  8. package/assertTagging.config.mjs +1 -1
  9. package/dist/alpha.d.ts +6 -2
  10. package/dist/codec/codec.d.ts +41 -13
  11. package/dist/codec/codec.d.ts.map +1 -1
  12. package/dist/codec/codec.js +46 -19
  13. package/dist/codec/codec.js.map +1 -1
  14. package/dist/codec/versioned/codec.d.ts +1 -1
  15. package/dist/codec/versioned/codec.d.ts.map +1 -1
  16. package/dist/codec/versioned/codec.js.map +1 -1
  17. package/dist/codec/versioned/format.d.ts +4 -1
  18. package/dist/codec/versioned/format.d.ts.map +1 -1
  19. package/dist/codec/versioned/format.js +4 -1
  20. package/dist/codec/versioned/format.js.map +1 -1
  21. package/dist/core/index.d.ts +2 -2
  22. package/dist/core/index.d.ts.map +1 -1
  23. package/dist/core/index.js +4 -3
  24. package/dist/core/index.js.map +1 -1
  25. package/dist/core/rebase/index.d.ts +1 -1
  26. package/dist/core/rebase/index.d.ts.map +1 -1
  27. package/dist/core/rebase/index.js.map +1 -1
  28. package/dist/core/rebase/types.d.ts +20 -1
  29. package/dist/core/rebase/types.d.ts.map +1 -1
  30. package/dist/core/rebase/types.js.map +1 -1
  31. package/dist/core/schema-stored/schema.d.ts +4 -7
  32. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  33. package/dist/core/schema-stored/schema.js +2 -2
  34. package/dist/core/schema-stored/schema.js.map +1 -1
  35. package/dist/core/tree/detachedFieldIndex.d.ts +34 -13
  36. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  37. package/dist/core/tree/detachedFieldIndex.js +12 -12
  38. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  39. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
  40. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  41. package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -2
  42. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  43. package/dist/core/tree/index.d.ts +3 -2
  44. package/dist/core/tree/index.d.ts.map +1 -1
  45. package/dist/core/tree/index.js +3 -0
  46. package/dist/core/tree/index.js.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  48. package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -2
  49. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  50. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
  51. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  52. package/dist/feature-libraries/chunked-forest/codec/format.js +4 -4
  53. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  54. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  55. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  56. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  58. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  59. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
  60. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  61. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +22 -26
  62. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  63. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  64. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  65. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
  66. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  67. package/dist/feature-libraries/forest-summary/codec.d.ts +7 -1
  68. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  69. package/dist/feature-libraries/forest-summary/codec.js +13 -11
  70. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  71. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -13
  72. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  73. package/dist/feature-libraries/forest-summary/forestSummarizer.js +35 -31
  74. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  75. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
  76. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
  77. package/dist/feature-libraries/forest-summary/formatCommon.js +27 -0
  78. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -0
  79. package/dist/feature-libraries/forest-summary/formatV1.d.ts +51 -0
  80. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
  81. package/dist/feature-libraries/forest-summary/formatV1.js +11 -0
  82. package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -0
  83. package/dist/feature-libraries/forest-summary/formatV2.d.ts +51 -0
  84. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
  85. package/dist/feature-libraries/forest-summary/formatV2.js +11 -0
  86. package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -0
  87. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +18 -24
  88. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  89. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +21 -43
  90. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  91. package/dist/feature-libraries/forest-summary/index.d.ts +2 -2
  92. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  93. package/dist/feature-libraries/forest-summary/index.js +3 -4
  94. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  95. package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
  96. package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
  97. package/dist/feature-libraries/forest-summary/summaryFormatCommon.js +43 -0
  98. package/dist/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
  99. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
  100. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
  101. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js +14 -0
  102. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
  103. package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
  104. package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
  105. package/dist/feature-libraries/forest-summary/summaryFormatV3.js +21 -0
  106. package/dist/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
  107. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +17 -0
  108. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  109. package/dist/feature-libraries/forest-summary/summaryTypes.js +35 -0
  110. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  111. package/dist/feature-libraries/index.d.ts +1 -1
  112. package/dist/feature-libraries/index.d.ts.map +1 -1
  113. package/dist/feature-libraries/index.js +3 -2
  114. package/dist/feature-libraries/index.js.map +1 -1
  115. package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
  116. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  117. package/dist/feature-libraries/modular-schema/comparison.js +54 -3
  118. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  119. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  120. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  121. package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
  122. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  123. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  124. package/dist/feature-libraries/modular-schema/genericFieldKind.js +4 -1
  125. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  126. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  127. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  128. package/dist/feature-libraries/modular-schema/index.js +2 -1
  129. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  130. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  131. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
  132. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  133. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  134. package/dist/feature-libraries/schema-index/codec.js +4 -4
  135. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  136. package/dist/feature-libraries/schema-index/formatV1.d.ts +1 -1
  137. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
  138. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  139. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  140. package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
  141. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  142. package/dist/index.d.ts +2 -2
  143. package/dist/index.d.ts.map +1 -1
  144. package/dist/index.js +5 -3
  145. package/dist/index.js.map +1 -1
  146. package/dist/packageVersion.d.ts +1 -1
  147. package/dist/packageVersion.d.ts.map +1 -1
  148. package/dist/packageVersion.js +1 -1
  149. package/dist/packageVersion.js.map +1 -1
  150. package/dist/shared-tree/independentView.d.ts +1 -1
  151. package/dist/shared-tree/independentView.d.ts.map +1 -1
  152. package/dist/shared-tree/independentView.js +1 -1
  153. package/dist/shared-tree/independentView.js.map +1 -1
  154. package/dist/shared-tree/schematizingTreeView.d.ts +2 -1
  155. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  156. package/dist/shared-tree/schematizingTreeView.js +3 -0
  157. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  158. package/dist/shared-tree/sharedTree.d.ts +2 -2
  159. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  160. package/dist/shared-tree/sharedTree.js +4 -4
  161. package/dist/shared-tree/sharedTree.js.map +1 -1
  162. package/dist/shared-tree/sharedTreeChangeCodecs.js +2 -2
  163. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  164. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  165. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  166. package/dist/shared-tree/sharedTreeChangeEnricher.js +25 -11
  167. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  168. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  169. package/dist/shared-tree/treeAlpha.js +1 -1
  170. package/dist/shared-tree/treeAlpha.js.map +1 -1
  171. package/dist/shared-tree/treeCheckout.d.ts +10 -5
  172. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  173. package/dist/shared-tree/treeCheckout.js +72 -17
  174. package/dist/shared-tree/treeCheckout.js.map +1 -1
  175. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  176. package/dist/shared-tree-core/editManagerCodecs.js +10 -8
  177. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  178. package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  179. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  180. package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
  181. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  182. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +8 -30
  183. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  184. package/dist/shared-tree-core/editManagerFormatCommons.js +18 -9
  185. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  186. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +1 -1
  187. package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  188. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  189. package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  190. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  191. package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  192. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  193. package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
  194. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  195. package/dist/shared-tree-core/index.d.ts +5 -2
  196. package/dist/shared-tree-core/index.d.ts.map +1 -1
  197. package/dist/shared-tree-core/index.js +7 -1
  198. package/dist/shared-tree-core/index.js.map +1 -1
  199. package/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  200. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  201. package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
  202. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  203. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  204. package/dist/shared-tree-core/messageCodecs.js +12 -10
  205. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  206. package/dist/shared-tree-core/messageFormat.d.ts +9 -36
  207. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  208. package/dist/shared-tree-core/messageFormat.js +19 -9
  209. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  210. package/{lib/shared-tree-core/messageFormatV5.d.ts → dist/shared-tree-core/messageFormatVSharedBranches.d.ts} +5 -7
  211. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  212. package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  213. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  214. package/dist/shared-tree-core/sharedTreeCore.d.ts +13 -47
  215. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  216. package/dist/shared-tree-core/sharedTreeCore.js +29 -17
  217. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  218. package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
  219. package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
  220. package/dist/shared-tree-core/summaryTypes.js +47 -0
  221. package/dist/shared-tree-core/summaryTypes.js.map +1 -0
  222. package/dist/shared-tree-core/versionedSummarizer.d.ts +72 -0
  223. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  224. package/dist/shared-tree-core/versionedSummarizer.js +64 -0
  225. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
  226. package/dist/simple-tree/api/configuration.d.ts +3 -26
  227. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  228. package/dist/simple-tree/api/configuration.js +10 -21
  229. package/dist/simple-tree/api/configuration.js.map +1 -1
  230. package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
  231. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  232. package/dist/simple-tree/api/dirtyIndex.js +7 -0
  233. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  234. package/dist/simple-tree/api/discrepancies.d.ts +1 -1
  235. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  236. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  237. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
  238. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
  239. package/dist/simple-tree/api/eraseSchemaDetails.js +97 -0
  240. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -0
  241. package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
  242. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  243. package/dist/simple-tree/api/getSimpleSchema.js +9 -3
  244. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  245. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  246. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  247. package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
  248. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  249. package/dist/simple-tree/api/index.d.ts +4 -4
  250. package/dist/simple-tree/api/index.d.ts.map +1 -1
  251. package/dist/simple-tree/api/index.js +8 -5
  252. package/dist/simple-tree/api/index.js.map +1 -1
  253. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  254. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  255. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  256. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  257. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  258. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  259. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  260. package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
  261. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  262. package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
  263. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  264. package/dist/simple-tree/api/schemaFromSimple.js +5 -0
  265. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  266. package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
  267. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  268. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  269. package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
  270. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  271. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  272. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  273. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  274. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  275. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  276. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
  277. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  278. package/dist/simple-tree/api/storedSchema.d.ts +1 -1
  279. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  280. package/dist/simple-tree/api/storedSchema.js +1 -2
  281. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  282. package/dist/simple-tree/api/tree.d.ts +15 -2
  283. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  284. package/dist/simple-tree/api/tree.js.map +1 -1
  285. package/dist/simple-tree/api/typesUnsafe.d.ts +3 -3
  286. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  287. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  288. package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
  289. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  290. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  291. package/dist/simple-tree/core/index.d.ts +1 -1
  292. package/dist/simple-tree/core/index.d.ts.map +1 -1
  293. package/dist/simple-tree/core/index.js +2 -3
  294. package/dist/simple-tree/core/index.js.map +1 -1
  295. package/dist/simple-tree/core/toStored.d.ts +17 -15
  296. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  297. package/dist/simple-tree/core/toStored.js +5 -40
  298. package/dist/simple-tree/core/toStored.js.map +1 -1
  299. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  300. package/dist/simple-tree/core/treeNode.js +1 -0
  301. package/dist/simple-tree/core/treeNode.js.map +1 -1
  302. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  303. package/dist/simple-tree/core/walkSchema.js +4 -0
  304. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  305. package/dist/simple-tree/createContext.d.ts.map +1 -1
  306. package/dist/simple-tree/createContext.js +20 -5
  307. package/dist/simple-tree/createContext.js.map +1 -1
  308. package/dist/simple-tree/fieldSchema.d.ts +3 -3
  309. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  310. package/dist/simple-tree/fieldSchema.js.map +1 -1
  311. package/dist/simple-tree/index.d.ts +6 -5
  312. package/dist/simple-tree/index.d.ts.map +1 -1
  313. package/dist/simple-tree/index.js +16 -11
  314. package/dist/simple-tree/index.js.map +1 -1
  315. package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
  316. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  317. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  318. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  319. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  320. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  321. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  322. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  323. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  324. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  325. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  326. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  327. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  328. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  329. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  330. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  331. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  332. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  333. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  334. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  335. package/dist/simple-tree/simpleSchema.d.ts +55 -23
  336. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  337. package/dist/simple-tree/simpleSchema.js +17 -0
  338. package/dist/simple-tree/simpleSchema.js.map +1 -1
  339. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  340. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  341. package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
  342. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  343. package/dist/simple-tree/toStoredSchema.d.ts +58 -11
  344. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  345. package/dist/simple-tree/toStoredSchema.js +205 -30
  346. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  347. package/dist/simple-tree/treeSchema.d.ts +23 -0
  348. package/dist/simple-tree/treeSchema.d.ts.map +1 -0
  349. package/dist/simple-tree/treeSchema.js +25 -0
  350. package/dist/simple-tree/treeSchema.js.map +1 -0
  351. package/dist/tableSchema.d.ts +107 -64
  352. package/dist/tableSchema.d.ts.map +1 -1
  353. package/dist/tableSchema.js +161 -60
  354. package/dist/tableSchema.js.map +1 -1
  355. package/dist/util/brand.d.ts +49 -0
  356. package/dist/util/brand.d.ts.map +1 -1
  357. package/dist/util/brand.js +47 -1
  358. package/dist/util/brand.js.map +1 -1
  359. package/dist/util/index.d.ts +2 -1
  360. package/dist/util/index.d.ts.map +1 -1
  361. package/dist/util/index.js +6 -2
  362. package/dist/util/index.js.map +1 -1
  363. package/dist/util/readSnapshotBlob.d.ts +13 -0
  364. package/dist/util/readSnapshotBlob.d.ts.map +1 -0
  365. package/dist/util/readSnapshotBlob.js +18 -0
  366. package/dist/util/readSnapshotBlob.js.map +1 -0
  367. package/eslint.config.mts +98 -0
  368. package/lib/alpha.d.ts +6 -2
  369. package/lib/codec/codec.d.ts +41 -13
  370. package/lib/codec/codec.d.ts.map +1 -1
  371. package/lib/codec/codec.js +40 -13
  372. package/lib/codec/codec.js.map +1 -1
  373. package/lib/codec/versioned/codec.d.ts +1 -1
  374. package/lib/codec/versioned/codec.d.ts.map +1 -1
  375. package/lib/codec/versioned/codec.js.map +1 -1
  376. package/lib/codec/versioned/format.d.ts +4 -1
  377. package/lib/codec/versioned/format.d.ts.map +1 -1
  378. package/lib/codec/versioned/format.js +4 -1
  379. package/lib/codec/versioned/format.js.map +1 -1
  380. package/lib/core/index.d.ts +2 -2
  381. package/lib/core/index.d.ts.map +1 -1
  382. package/lib/core/index.js +1 -1
  383. package/lib/core/index.js.map +1 -1
  384. package/lib/core/rebase/index.d.ts +1 -1
  385. package/lib/core/rebase/index.d.ts.map +1 -1
  386. package/lib/core/rebase/index.js.map +1 -1
  387. package/lib/core/rebase/types.d.ts +20 -1
  388. package/lib/core/rebase/types.d.ts.map +1 -1
  389. package/lib/core/rebase/types.js.map +1 -1
  390. package/lib/core/schema-stored/schema.d.ts +4 -7
  391. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  392. package/lib/core/schema-stored/schema.js +3 -3
  393. package/lib/core/schema-stored/schema.js.map +1 -1
  394. package/lib/core/tree/detachedFieldIndex.d.ts +34 -13
  395. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  396. package/lib/core/tree/detachedFieldIndex.js +12 -12
  397. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  398. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
  399. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  400. package/lib/core/tree/detachedFieldIndexFormatCommon.js +3 -3
  401. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  402. package/lib/core/tree/index.d.ts +3 -2
  403. package/lib/core/tree/index.d.ts.map +1 -1
  404. package/lib/core/tree/index.js +2 -1
  405. package/lib/core/tree/index.js.map +1 -1
  406. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  407. package/lib/feature-libraries/chunked-forest/codec/codecs.js +3 -3
  408. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  409. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
  410. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  411. package/lib/feature-libraries/chunked-forest/codec/format.js +5 -5
  412. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  413. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  414. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  415. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  416. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  417. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  418. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
  419. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  420. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +23 -27
  421. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  422. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  423. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  424. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
  425. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  426. package/lib/feature-libraries/forest-summary/codec.d.ts +7 -1
  427. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  428. package/lib/feature-libraries/forest-summary/codec.js +12 -11
  429. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  430. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -13
  431. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  432. package/lib/feature-libraries/forest-summary/forestSummarizer.js +33 -29
  433. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  434. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
  435. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
  436. package/lib/feature-libraries/forest-summary/formatCommon.js +23 -0
  437. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -0
  438. package/lib/feature-libraries/forest-summary/formatV1.d.ts +51 -0
  439. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
  440. package/lib/feature-libraries/forest-summary/formatV1.js +8 -0
  441. package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -0
  442. package/lib/feature-libraries/forest-summary/formatV2.d.ts +51 -0
  443. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
  444. package/lib/feature-libraries/forest-summary/formatV2.js +8 -0
  445. package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -0
  446. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +18 -24
  447. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  448. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +20 -42
  449. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  450. package/lib/feature-libraries/forest-summary/index.d.ts +2 -2
  451. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  452. package/lib/feature-libraries/forest-summary/index.js +2 -2
  453. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  454. package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
  455. package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
  456. package/lib/feature-libraries/forest-summary/summaryFormatCommon.js +40 -0
  457. package/lib/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
  458. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
  459. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
  460. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js +11 -0
  461. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
  462. package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
  463. package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
  464. package/lib/feature-libraries/forest-summary/summaryFormatV3.js +18 -0
  465. package/lib/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
  466. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +17 -0
  467. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  468. package/lib/feature-libraries/forest-summary/summaryTypes.js +30 -0
  469. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  470. package/lib/feature-libraries/index.d.ts +1 -1
  471. package/lib/feature-libraries/index.d.ts.map +1 -1
  472. package/lib/feature-libraries/index.js +1 -1
  473. package/lib/feature-libraries/index.js.map +1 -1
  474. package/lib/feature-libraries/modular-schema/comparison.d.ts +18 -2
  475. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  476. package/lib/feature-libraries/modular-schema/comparison.js +55 -5
  477. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  478. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  479. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  480. package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
  481. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  482. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  483. package/lib/feature-libraries/modular-schema/genericFieldKind.js +4 -1
  484. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  485. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  486. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  487. package/lib/feature-libraries/modular-schema/index.js +1 -1
  488. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  489. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  490. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
  491. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  492. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  493. package/lib/feature-libraries/schema-index/codec.js +5 -5
  494. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  495. package/lib/feature-libraries/schema-index/formatV1.d.ts +1 -1
  496. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
  497. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  498. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  499. package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
  500. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  501. package/lib/index.d.ts +2 -2
  502. package/lib/index.d.ts.map +1 -1
  503. package/lib/index.js +1 -1
  504. package/lib/index.js.map +1 -1
  505. package/lib/packageVersion.d.ts +1 -1
  506. package/lib/packageVersion.d.ts.map +1 -1
  507. package/lib/packageVersion.js +1 -1
  508. package/lib/packageVersion.js.map +1 -1
  509. package/lib/shared-tree/independentView.d.ts +1 -1
  510. package/lib/shared-tree/independentView.d.ts.map +1 -1
  511. package/lib/shared-tree/independentView.js +2 -2
  512. package/lib/shared-tree/independentView.js.map +1 -1
  513. package/lib/shared-tree/schematizingTreeView.d.ts +2 -1
  514. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  515. package/lib/shared-tree/schematizingTreeView.js +3 -0
  516. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  517. package/lib/shared-tree/sharedTree.d.ts +2 -2
  518. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  519. package/lib/shared-tree/sharedTree.js +4 -4
  520. package/lib/shared-tree/sharedTree.js.map +1 -1
  521. package/lib/shared-tree/sharedTreeChangeCodecs.js +2 -2
  522. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  523. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  524. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  525. package/lib/shared-tree/sharedTreeChangeEnricher.js +25 -11
  526. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  527. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  528. package/lib/shared-tree/treeAlpha.js +2 -2
  529. package/lib/shared-tree/treeAlpha.js.map +1 -1
  530. package/lib/shared-tree/treeCheckout.d.ts +10 -5
  531. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  532. package/lib/shared-tree/treeCheckout.js +73 -18
  533. package/lib/shared-tree/treeCheckout.js.map +1 -1
  534. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  535. package/lib/shared-tree-core/editManagerCodecs.js +11 -9
  536. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  537. package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  538. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  539. package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
  540. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  541. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +8 -30
  542. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  543. package/lib/shared-tree-core/editManagerFormatCommons.js +19 -10
  544. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  545. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +1 -1
  546. package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  547. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  548. package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  549. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  550. package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  551. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  552. package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
  553. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  554. package/lib/shared-tree-core/index.d.ts +5 -2
  555. package/lib/shared-tree-core/index.d.ts.map +1 -1
  556. package/lib/shared-tree-core/index.js +3 -1
  557. package/lib/shared-tree-core/index.js.map +1 -1
  558. package/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  559. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  560. package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
  561. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  562. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  563. package/lib/shared-tree-core/messageCodecs.js +13 -11
  564. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  565. package/lib/shared-tree-core/messageFormat.d.ts +9 -36
  566. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  567. package/lib/shared-tree-core/messageFormat.js +19 -9
  568. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  569. package/{dist/shared-tree-core/messageFormatV5.d.ts → lib/shared-tree-core/messageFormatVSharedBranches.d.ts} +5 -7
  570. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  571. package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  572. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  573. package/lib/shared-tree-core/sharedTreeCore.d.ts +13 -47
  574. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  575. package/lib/shared-tree-core/sharedTreeCore.js +27 -15
  576. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  577. package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
  578. package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
  579. package/lib/shared-tree-core/summaryTypes.js +43 -0
  580. package/lib/shared-tree-core/summaryTypes.js.map +1 -0
  581. package/lib/shared-tree-core/versionedSummarizer.d.ts +72 -0
  582. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  583. package/lib/shared-tree-core/versionedSummarizer.js +60 -0
  584. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
  585. package/lib/simple-tree/api/configuration.d.ts +3 -26
  586. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  587. package/lib/simple-tree/api/configuration.js +14 -25
  588. package/lib/simple-tree/api/configuration.js.map +1 -1
  589. package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
  590. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  591. package/lib/simple-tree/api/dirtyIndex.js +7 -0
  592. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  593. package/lib/simple-tree/api/discrepancies.d.ts +1 -1
  594. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  595. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  596. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
  597. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
  598. package/lib/simple-tree/api/eraseSchemaDetails.js +92 -0
  599. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -0
  600. package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
  601. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  602. package/lib/simple-tree/api/getSimpleSchema.js +9 -3
  603. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  604. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  605. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  606. package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
  607. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  608. package/lib/simple-tree/api/index.d.ts +4 -4
  609. package/lib/simple-tree/api/index.d.ts.map +1 -1
  610. package/lib/simple-tree/api/index.js +3 -3
  611. package/lib/simple-tree/api/index.js.map +1 -1
  612. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  613. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  614. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  615. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  616. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  617. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  618. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  619. package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
  620. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  621. package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
  622. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  623. package/lib/simple-tree/api/schemaFromSimple.js +5 -0
  624. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  625. package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
  626. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  627. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  628. package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
  629. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  630. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  631. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  632. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  633. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  634. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  635. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
  636. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  637. package/lib/simple-tree/api/storedSchema.d.ts +1 -1
  638. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  639. package/lib/simple-tree/api/storedSchema.js +1 -2
  640. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  641. package/lib/simple-tree/api/tree.d.ts +15 -2
  642. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  643. package/lib/simple-tree/api/tree.js.map +1 -1
  644. package/lib/simple-tree/api/typesUnsafe.d.ts +3 -3
  645. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  646. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  647. package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
  648. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  649. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  650. package/lib/simple-tree/core/index.d.ts +1 -1
  651. package/lib/simple-tree/core/index.d.ts.map +1 -1
  652. package/lib/simple-tree/core/index.js +1 -1
  653. package/lib/simple-tree/core/index.js.map +1 -1
  654. package/lib/simple-tree/core/toStored.d.ts +17 -15
  655. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  656. package/lib/simple-tree/core/toStored.js +4 -37
  657. package/lib/simple-tree/core/toStored.js.map +1 -1
  658. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  659. package/lib/simple-tree/core/treeNode.js +1 -0
  660. package/lib/simple-tree/core/treeNode.js.map +1 -1
  661. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  662. package/lib/simple-tree/core/walkSchema.js +5 -1
  663. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  664. package/lib/simple-tree/createContext.d.ts.map +1 -1
  665. package/lib/simple-tree/createContext.js +20 -5
  666. package/lib/simple-tree/createContext.js.map +1 -1
  667. package/lib/simple-tree/fieldSchema.d.ts +3 -3
  668. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  669. package/lib/simple-tree/fieldSchema.js.map +1 -1
  670. package/lib/simple-tree/index.d.ts +6 -5
  671. package/lib/simple-tree/index.d.ts.map +1 -1
  672. package/lib/simple-tree/index.js +5 -4
  673. package/lib/simple-tree/index.js.map +1 -1
  674. package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
  675. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  676. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  677. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  678. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  679. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  680. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  681. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  682. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  683. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  684. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  685. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  686. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  687. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  688. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  689. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  690. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  691. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  692. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  693. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  694. package/lib/simple-tree/simpleSchema.d.ts +55 -23
  695. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  696. package/lib/simple-tree/simpleSchema.js +16 -1
  697. package/lib/simple-tree/simpleSchema.js.map +1 -1
  698. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  699. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  700. package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
  701. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  702. package/lib/simple-tree/toStoredSchema.d.ts +58 -11
  703. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  704. package/lib/simple-tree/toStoredSchema.js +204 -31
  705. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  706. package/lib/simple-tree/treeSchema.d.ts +23 -0
  707. package/lib/simple-tree/treeSchema.d.ts.map +1 -0
  708. package/lib/simple-tree/treeSchema.js +21 -0
  709. package/lib/simple-tree/treeSchema.js.map +1 -0
  710. package/lib/tableSchema.d.ts +107 -64
  711. package/lib/tableSchema.d.ts.map +1 -1
  712. package/lib/tableSchema.js +162 -61
  713. package/lib/tableSchema.js.map +1 -1
  714. package/lib/util/brand.d.ts +49 -0
  715. package/lib/util/brand.d.ts.map +1 -1
  716. package/lib/util/brand.js +44 -0
  717. package/lib/util/brand.js.map +1 -1
  718. package/lib/util/index.d.ts +2 -1
  719. package/lib/util/index.d.ts.map +1 -1
  720. package/lib/util/index.js +2 -1
  721. package/lib/util/index.js.map +1 -1
  722. package/lib/util/readSnapshotBlob.d.ts +13 -0
  723. package/lib/util/readSnapshotBlob.d.ts.map +1 -0
  724. package/lib/util/readSnapshotBlob.js +14 -0
  725. package/lib/util/readSnapshotBlob.js.map +1 -0
  726. package/package.json +24 -23
  727. package/src/codec/codec.ts +44 -14
  728. package/src/codec/versioned/codec.ts +1 -1
  729. package/src/codec/versioned/format.ts +4 -1
  730. package/src/core/index.ts +4 -1
  731. package/src/core/rebase/index.ts +1 -0
  732. package/src/core/rebase/types.ts +25 -0
  733. package/src/core/schema-stored/schema.ts +5 -7
  734. package/src/core/tree/detachedFieldIndex.ts +54 -13
  735. package/src/core/tree/detachedFieldIndexFormatCommon.ts +4 -7
  736. package/src/core/tree/index.ts +7 -2
  737. package/src/feature-libraries/chunked-forest/codec/codecs.ts +3 -2
  738. package/src/feature-libraries/chunked-forest/codec/format.ts +6 -9
  739. package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
  740. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
  741. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +22 -33
  742. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
  743. package/src/feature-libraries/forest-summary/codec.ts +22 -10
  744. package/src/feature-libraries/forest-summary/forestSummarizer.ts +77 -44
  745. package/src/feature-libraries/forest-summary/{format.ts → formatCommon.ts} +12 -13
  746. package/src/feature-libraries/forest-summary/formatV1.ts +12 -0
  747. package/src/feature-libraries/forest-summary/formatV2.ts +12 -0
  748. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +37 -56
  749. package/src/feature-libraries/forest-summary/index.ts +2 -2
  750. package/src/feature-libraries/forest-summary/summaryFormatCommon.ts +41 -0
  751. package/src/feature-libraries/forest-summary/summaryFormatV1ToV2.ts +11 -0
  752. package/src/feature-libraries/forest-summary/summaryFormatV3.ts +18 -0
  753. package/src/feature-libraries/forest-summary/summaryTypes.ts +41 -0
  754. package/src/feature-libraries/index.ts +1 -1
  755. package/src/feature-libraries/modular-schema/comparison.ts +64 -5
  756. package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
  757. package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -1
  758. package/src/feature-libraries/modular-schema/index.ts +1 -0
  759. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +2 -3
  760. package/src/feature-libraries/schema-index/codec.ts +7 -9
  761. package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
  762. package/src/index.ts +6 -2
  763. package/src/packageVersion.ts +1 -1
  764. package/src/shared-tree/independentView.ts +2 -3
  765. package/src/shared-tree/schematizingTreeView.ts +5 -0
  766. package/src/shared-tree/sharedTree.ts +20 -9
  767. package/src/shared-tree/sharedTreeChangeCodecs.ts +2 -2
  768. package/src/shared-tree/sharedTreeChangeEnricher.ts +31 -11
  769. package/src/shared-tree/treeAlpha.ts +2 -3
  770. package/src/shared-tree/treeCheckout.ts +103 -20
  771. package/src/shared-tree-core/editManagerCodecs.ts +11 -9
  772. package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
  773. package/src/shared-tree-core/editManagerFormatCommons.ts +22 -16
  774. package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
  775. package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
  776. package/src/shared-tree-core/index.ts +12 -3
  777. package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
  778. package/src/shared-tree-core/messageCodecs.ts +13 -11
  779. package/src/shared-tree-core/messageFormat.ts +23 -16
  780. package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
  781. package/src/shared-tree-core/sharedTreeCore.ts +63 -75
  782. package/src/shared-tree-core/summaryTypes.ts +122 -0
  783. package/src/shared-tree-core/versionedSummarizer.ts +114 -0
  784. package/src/simple-tree/api/configuration.ts +21 -68
  785. package/src/simple-tree/api/dirtyIndex.ts +11 -0
  786. package/src/simple-tree/api/discrepancies.ts +1 -1
  787. package/src/simple-tree/api/eraseSchemaDetails.ts +123 -0
  788. package/src/simple-tree/api/getSimpleSchema.ts +13 -6
  789. package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
  790. package/src/simple-tree/api/index.ts +7 -4
  791. package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
  792. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
  793. package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
  794. package/src/simple-tree/api/schemaFromSimple.ts +11 -5
  795. package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
  796. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  797. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
  798. package/src/simple-tree/api/storedSchema.ts +2 -2
  799. package/src/simple-tree/api/tree.ts +16 -1
  800. package/src/simple-tree/api/typesUnsafe.ts +7 -3
  801. package/src/simple-tree/core/allowedTypes.ts +3 -3
  802. package/src/simple-tree/core/index.ts +2 -2
  803. package/src/simple-tree/core/toStored.ts +22 -55
  804. package/src/simple-tree/core/treeNode.ts +1 -0
  805. package/src/simple-tree/core/walkSchema.ts +6 -0
  806. package/src/simple-tree/createContext.ts +29 -11
  807. package/src/simple-tree/fieldSchema.ts +10 -3
  808. package/src/simple-tree/index.ts +12 -10
  809. package/src/simple-tree/node-kinds/array/arrayNode.ts +5 -2
  810. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
  811. package/src/simple-tree/node-kinds/map/mapNode.ts +5 -2
  812. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
  813. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
  814. package/src/simple-tree/node-kinds/record/recordNode.ts +5 -2
  815. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
  816. package/src/simple-tree/simpleSchema.ts +79 -32
  817. package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
  818. package/src/simple-tree/toStoredSchema.ts +319 -61
  819. package/src/simple-tree/treeSchema.ts +54 -0
  820. package/src/tableSchema.ts +487 -173
  821. package/src/util/brand.ts +61 -0
  822. package/src/util/index.ts +5 -0
  823. package/src/util/readSnapshotBlob.ts +23 -0
  824. package/dist/feature-libraries/forest-summary/format.d.ts +0 -23
  825. package/dist/feature-libraries/forest-summary/format.d.ts.map +0 -1
  826. package/dist/feature-libraries/forest-summary/format.js +0 -24
  827. package/dist/feature-libraries/forest-summary/format.js.map +0 -1
  828. package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  829. package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  830. package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  831. package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
  832. package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  833. package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
  834. package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  835. package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
  836. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  837. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  838. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
  839. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  840. package/lib/feature-libraries/forest-summary/format.d.ts +0 -23
  841. package/lib/feature-libraries/forest-summary/format.d.ts.map +0 -1
  842. package/lib/feature-libraries/forest-summary/format.js +0 -21
  843. package/lib/feature-libraries/forest-summary/format.js.map +0 -1
  844. package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  845. package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  846. package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  847. package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
  848. package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  849. package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
  850. package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  851. package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
  852. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  853. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  854. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
  855. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  856. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
@@ -4,9 +4,9 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getCodecTreeForDetachedFieldIndexFormat = exports.tryGetChunk = exports.cursorChunk = exports.dummyRoot = exports.deepCopyMapTree = exports.aboveRootPlaceholder = exports.getDetachedFieldContainingPath = exports.DetachedFieldIndex = exports.isCursor = exports.CursorMarker = exports.inCursorNode = exports.inCursorField = exports.isDetachedUpPath = exports.anchorSlot = exports.emptyDelta = exports.offsetDetachId = exports.makeDetachedNodeId = exports.deltaForRootInitialization = exports.forEachField = exports.forEachNodeInSubtree = exports.forEachNode = exports.compareFieldUpPaths = exports.topDownPath = exports.clonePath = exports.compareUpPaths = exports.getDescendant = exports.SparseNode = exports.setGenericTreeField = exports.makeDetachedFieldIndex = exports.applyDelta = exports.announceDelta = exports.combineVisitors = exports.createAnnouncedVisitor = exports.visitDelta = exports.keyAsDetachedField = exports.detachedFieldAsKey = exports.iterateCursorField = exports.mapCursorFields = exports.mapCursorField = exports.getDepth = exports.genericTreeDeleteIfEmpty = exports.getGenericTreeField = exports.genericTreeKeys = exports.castCursorToSynchronous = exports.CursorLocationType = exports.rootField = exports.rootFieldKey = exports.EncodedJsonableTree = exports.AnchorSet = exports.EmptyKey = void 0;
8
- exports.newChangeAtomIdRangeMap = exports.isAncestor = exports.replaceChange = exports.replaceAtomRevisions = exports.subtractChangeAtomIds = exports.StableIdSchema = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.revisionMetadataSourceFromInfo = exports.rebaseChangeOverChanges = exports.rebaseChange = exports.rebaseBranch = exports.mintCommit = exports.SessionIdSchema = exports.tagRollbackInverse = exports.mapTaggedChange = exports.tagChange = exports.makeAnonChange = exports.RevisionTagCodec = exports.RevisionTagSchema = exports.CommitKind = exports.findCommonAncestor = exports.findAncestor = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIdOpts = exports.areEqualChangeAtomIds = exports.EditBuilder = exports.SchemaFormatVersion = exports.Multiplicity = exports.storedSchemaDecodeDispatcher = exports.encodeFieldSchemaV2 = exports.encodeFieldSchemaV1 = exports.decodeFieldSchema = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.LeafNodeStoredSchema = exports.schemaFormatV2 = exports.schemaFormatV1 = exports.storedEmptyFieldSchema = exports.identifierFieldKindIdentifier = exports.forbiddenFieldKindIdentifier = exports.schemaDataIsEmpty = exports.TreeStoredSchemaRepository = exports.TreeNodeStoredSchema = exports.ValueSchema = exports.moveToDetachedField = exports.ITreeSubscriptionCursorState = exports.TreeNavigationResult = void 0;
9
- exports.RevertibleStatus = exports.AdaptedViewSchema = exports.diffHistories = exports.compareRevisions = void 0;
7
+ exports.DetachedFieldIndexFormatVersion = exports.tryGetChunk = exports.cursorChunk = exports.dummyRoot = exports.deepCopyMapTree = exports.aboveRootPlaceholder = exports.getDetachedFieldContainingPath = exports.DetachedFieldIndex = exports.isCursor = exports.CursorMarker = exports.inCursorNode = exports.inCursorField = exports.isDetachedUpPath = exports.anchorSlot = exports.emptyDelta = exports.offsetDetachId = exports.makeDetachedNodeId = exports.deltaForRootInitialization = exports.forEachField = exports.forEachNodeInSubtree = exports.forEachNode = exports.compareFieldUpPaths = exports.topDownPath = exports.clonePath = exports.compareUpPaths = exports.getDescendant = exports.SparseNode = exports.setGenericTreeField = exports.makeDetachedFieldIndex = exports.applyDelta = exports.announceDelta = exports.combineVisitors = exports.createAnnouncedVisitor = exports.visitDelta = exports.keyAsDetachedField = exports.detachedFieldAsKey = exports.iterateCursorField = exports.mapCursorFields = exports.mapCursorField = exports.getDepth = exports.genericTreeDeleteIfEmpty = exports.getGenericTreeField = exports.genericTreeKeys = exports.castCursorToSynchronous = exports.CursorLocationType = exports.rootField = exports.rootFieldKey = exports.EncodedJsonableTree = exports.AnchorSet = exports.EmptyKey = void 0;
8
+ exports.isAncestor = exports.replaceChange = exports.replaceAtomRevisions = exports.subtractChangeAtomIds = exports.StableIdSchema = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.revisionMetadataSourceFromInfo = exports.rebaseChangeOverChanges = exports.rebaseChange = exports.rebaseBranch = exports.mintCommit = exports.SessionIdSchema = exports.tagRollbackInverse = exports.mapTaggedChange = exports.tagChange = exports.makeAnonChange = exports.RevisionTagCodec = exports.RevisionTagSchema = exports.CommitKind = exports.findCommonAncestor = exports.findAncestor = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIdOpts = exports.areEqualChangeAtomIds = exports.EditBuilder = exports.SchemaFormatVersion = exports.Multiplicity = exports.storedSchemaDecodeDispatcher = exports.encodeFieldSchemaV2 = exports.encodeFieldSchemaV1 = exports.decodeFieldSchema = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.LeafNodeStoredSchema = exports.schemaFormatV2 = exports.schemaFormatV1 = exports.storedEmptyFieldSchema = exports.identifierFieldKindIdentifier = exports.forbiddenFieldKindIdentifier = exports.schemaDataIsEmpty = exports.TreeStoredSchemaRepository = exports.TreeNodeStoredSchema = exports.ValueSchema = exports.moveToDetachedField = exports.ITreeSubscriptionCursorState = exports.TreeNavigationResult = exports.getCodecTreeForDetachedFieldIndexFormat = void 0;
9
+ exports.RevertibleStatus = exports.AdaptedViewSchema = exports.diffHistories = exports.compareRevisions = exports.newChangeAtomIdRangeMap = void 0;
10
10
  var index_js_1 = require("./tree/index.js");
11
11
  Object.defineProperty(exports, "EmptyKey", { enumerable: true, get: function () { return index_js_1.EmptyKey; } });
12
12
  Object.defineProperty(exports, "AnchorSet", { enumerable: true, get: function () { return index_js_1.AnchorSet; } });
@@ -57,6 +57,7 @@ Object.defineProperty(exports, "deepCopyMapTree", { enumerable: true, get: funct
57
57
  Object.defineProperty(exports, "dummyRoot", { enumerable: true, get: function () { return index_js_1.dummyRoot; } });
58
58
  Object.defineProperty(exports, "cursorChunk", { enumerable: true, get: function () { return index_js_1.cursorChunk; } });
59
59
  Object.defineProperty(exports, "tryGetChunk", { enumerable: true, get: function () { return index_js_1.tryGetChunk; } });
60
+ Object.defineProperty(exports, "DetachedFieldIndexFormatVersion", { enumerable: true, get: function () { return index_js_1.DetachedFieldIndexFormatVersion; } });
60
61
  Object.defineProperty(exports, "getCodecTreeForDetachedFieldIndexFormat", { enumerable: true, get: function () { return index_js_1.getCodecTreeForDetachedFieldIndexFormat; } });
61
62
  var index_js_2 = require("./forest/index.js");
62
63
  Object.defineProperty(exports, "TreeNavigationResult", { enumerable: true, get: function () { return index_js_2.TreeNavigationResult; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAEH,4CAqGyB;AApGxB,oGAAA,QAAQ,OAAA;AAIR,qGAAA,SAAS,OAAA;AAoBT,+GAAA,mBAAmB,OAAA;AACnB,wGAAA,YAAY,OAAA;AACZ,qGAAA,SAAS,OAAA;AAET,8GAAA,kBAAkB,OAAA;AAElB,mHAAA,uBAAuB,OAAA;AAGvB,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,oHAAA,wBAAwB,OAAA;AACxB,oGAAA,QAAQ,OAAA;AACR,0GAAA,cAAc,OAAA;AACd,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAElB,8GAAA,kBAAkB,OAAA;AAClB,8GAAA,kBAAkB,OAAA;AAClB,sGAAA,UAAU,OAAA;AACV,kHAAA,sBAAsB,OAAA;AACt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BAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AACnB,6GAAA,iBAAiB,OAAA;AACjB,+GAAA,mBAAmB,OAAA;AACnB,+GAAA,mBAAmB,OAAA;AACnB,wHAAA,4BAA4B,OAAA;AAE5B,wGAAA,YAAY,OAAA;AAEZ,+GAAA,mBAAmB,OAAA;AAGpB,qDAMkC;AADjC,uGAAA,WAAW,OAAA;AAGZ,8CAgD2B;AA/C1B,iHAAA,qBAAqB,OAAA;AACrB,oHAAA,wBAAwB,OAAA;AACxB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AAEd,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAElB,sGAAA,UAAU,OAAA;AAGV,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAKhB,0GAAA,cAAc,OAAA;AACd,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,sGAAA,UAAU,OAAA;AACV,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AAEvB,0HAAA,8BAA8B,OAAA;AAK9B,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,0GAAA,cAAc,OAAA;AACd,iHAAA,qBAAqB,OAAA;AACrB,gHAAA,oBAAoB,OAAA;AACpB,yGAAA,aAAa,OAAA;AAGb,sGAAA,UAAU,OAAA;AAEV,mHAAA,uBAAuB,OAAA;AACvB,4GAAA,gBAAgB,OAAA;AAChB,yGAAA,aAAa,OAAA;AAGd,mDAIgC;AAF/B,6GAAA,iBAAiB,OAAA;AAIlB,iDAMyB;AAJxB,iHAAA,gBAAgB,OAAA","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 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\ttype DetachedFieldIndexFormatVersion,\n\tgetCodecTreeForDetachedFieldIndexFormat,\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 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\treplaceAtomRevisions,\n\treplaceChange,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n\tisAncestor,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tcompareRevisions,\n\tdiffHistories,\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"]}
1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eAAe,OAAA;AACf,sGAAA,UAAU,OAAA;AACV,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AAEvB,0HAAA,8BAA8B,OAAA;AAK9B,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,0GAAA,cAAc,OAAA;AACd,iHAAA,qBAAqB,OAAA;AACrB,gHAAA,oBAAoB,OAAA;AACpB,yGAAA,aAAa,OAAA;AAGb,sGAAA,UAAU,OAAA;AAEV,mHAAA,uBAAuB,OAAA;AACvB,4GAAA,gBAAgB,OAAA;AAChB,yGAAA,aAAa,OAAA;AAGd,mDAIgC;AAF/B,6GAAA,iBAAiB,OAAA;AAIlB,iDAMyB;AAJxB,iHAAA,gBAAgB,OAAA","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\tgetCodecTreeForDetachedFieldIndexFormat,\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 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\treplaceAtomRevisions,\n\treplaceChange,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n\tisAncestor,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tcompareRevisions,\n\tdiffHistories,\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"]}
@@ -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 RevisionTag, RevisionTagSchema, type EncodedRevisionTag, type EncodedChangeAtomId, type EncodedStableId, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceAtomRevisions, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, compareRevisions, } from "./types.js";
5
+ export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, mintCommit, type GraphCommit, CommitKind, type CommitMetadata, type ChangeMetadata, type RevisionTag, RevisionTagSchema, type EncodedRevisionTag, type EncodedChangeAtomId, type EncodedStableId, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceAtomRevisions, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, compareRevisions, } 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, } 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,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,oBAAoB,EACpB,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,GACjB,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,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,oBAAoB,EACpB,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,GACjB,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 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCA2BoB;AA1BnB,iHAAA,qBAAqB,OAAA;AACrB,oHAAA,wBAAwB,OAAA;AACxB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AACd,sGAAA,UAAU,OAAA;AAEV,sGAAA,UAAU,OAAA;AAGV,6GAAA,iBAAiB,OAAA;AAOjB,2GAAA,eAAe,OAAA;AACf,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,0GAAA,cAAc,OAAA;AACd,iHAAA,qBAAqB,OAAA;AACrB,gHAAA,oBAAoB,OAAA;AAEpB,mHAAA,uBAAuB,OAAA;AACvB,4GAAA,gBAAgB,OAAA;AAEjB,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA;AACzB,uDAW4B;AAR3B,qHAAA,iBAAiB,OAAA;AACjB,kHAAA,cAAc,OAAA;AACd,6GAAA,SAAS,OAAA;AACT,mHAAA,eAAe,OAAA;AACf,sHAAA,kBAAkB,OAAA;AAKnB,uCAaoB;AAZnB,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AACvB,0HAAA,8BAA8B,OAAA;AAG9B,yGAAA,aAAa,OAAA;AACb,sGAAA,UAAU,OAAA;AACV,yGAAA,aAAa,OAAA","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 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\treplaceAtomRevisions,\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} 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,uCA4BoB;AA3BnB,iHAAA,qBAAqB,OAAA;AACrB,oHAAA,wBAAwB,OAAA;AACxB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AACd,sGAAA,UAAU,OAAA;AAEV,sGAAA,UAAU,OAAA;AAIV,6GAAA,iBAAiB,OAAA;AAOjB,2GAAA,eAAe,OAAA;AACf,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,0GAAA,cAAc,OAAA;AACd,iHAAA,qBAAqB,OAAA;AACrB,gHAAA,oBAAoB,OAAA;AAEpB,mHAAA,uBAAuB,OAAA;AACvB,4GAAA,gBAAgB,OAAA;AAEjB,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA;AACzB,uDAW4B;AAR3B,qHAAA,iBAAiB,OAAA;AACjB,kHAAA,cAAc,OAAA;AACd,6GAAA,SAAS,OAAA;AACT,mHAAA,eAAe,OAAA;AACf,sHAAA,kBAAkB,OAAA;AAKnB,uCAaoB;AAZnB,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AACvB,0HAAA,8BAA8B,OAAA;AAG9B,yGAAA,aAAa,OAAA;AACb,sGAAA,UAAU,OAAA;AACV,yGAAA,aAAa,OAAA","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 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\treplaceAtomRevisions,\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} 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"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { OpSpaceCompressedId, SessionId, SessionSpaceCompressedId, StableId } from "@fluidframework/id-compressor";
6
- import { type Brand, type NestedMap, RangeMap } from "../../util/index.js";
6
+ import { type Brand, type JsonCompatibleReadOnly, type NestedMap, RangeMap } from "../../util/index.js";
7
7
  /**
8
8
  * The identifier for a particular session/user/client that can generate `GraphCommit`s
9
9
  */
@@ -98,6 +98,25 @@ export interface CommitMetadata {
98
98
  */
99
99
  readonly isLocal: boolean;
100
100
  }
101
+ /**
102
+ * Information about a commit that has been applied.
103
+ *
104
+ * @sealed @alpha
105
+ */
106
+ export type ChangeMetadata = CommitMetadata & ({
107
+ readonly isLocal: true;
108
+ /**
109
+ * A serializable object that encodes the change.
110
+ * @remarks This change object can be {@link TreeBranchAlpha.applyChange | applied to another branch} in the same state as the one which generated it.
111
+ * The change object must be applied to a SharedTree with the same IdCompressor session ID as it was created from.
112
+ * @privateRemarks
113
+ * This is a `SerializedChange` from treeCheckout.ts.
114
+ */
115
+ getChange(): JsonCompatibleReadOnly;
116
+ } | {
117
+ readonly isLocal: false;
118
+ readonly getChange?: undefined;
119
+ });
101
120
  /**
102
121
  * Creates a new graph commit object. This is useful for creating copies of commits with different parentage.
103
122
  * @param parent - the parent of the new commit
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","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AC,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;AAfD,4CAeC","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 NestedMap,\n\tRangeMap,\n\tbrand,\n\tbrandedNumberType,\n\tbrandedStringType,\n} from \"../../util/index.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\nexport function replaceAtomRevisions(\n\tid: ChangeAtomId,\n\toldRevisions: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): ChangeAtomId {\n\treturn oldRevisions.has(id.revision) ? atomWithRevision(id, newRevision) : id;\n}\n\nfunction atomWithRevision(id: ChangeAtomId, revision: RevisionTag | undefined): ChangeAtomId {\n\tconst updated = { ...id, revision };\n\tif (revision === undefined) {\n\t\tdelete updated.revision;\n\t}\n\n\treturn updated;\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/** The tag for this commit. If this commit is rebased, the corresponding rebased commit will retain this tag. */\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 * 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,+CAAyC;AAEzC,kDAQ6B;AAE7B;;GAEG;AACU,QAAA,eAAe,GAAG,IAAA,4BAAiB,GAAa,CAAC;AAWjD,QAAA,iBAAiB,GAAG,cAAI,CAAC,KAAK,CAAC;IAC3C,cAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IACpB,IAAA,4BAAiB,GAAuC;CACxD,CAAC,CAAC;AAGU,QAAA,cAAc,GAAG,cAAI,CAAC,MAAM,EAAE,CAAC;AA+B5C;;GAEG;AACH,SAAgB,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;AAFD,sDAEC;AAED,SAAgB,wBAAwB,CACvC,CAA2B,EAC3B,CAA2B;IAE3B,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QAC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B;IAE1B,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACrB,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;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;AAfD,4CAeC","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\";\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\nexport function replaceAtomRevisions(\n\tid: ChangeAtomId,\n\toldRevisions: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): ChangeAtomId {\n\treturn oldRevisions.has(id.revision) ? atomWithRevision(id, newRevision) : id;\n}\n\nfunction atomWithRevision(id: ChangeAtomId, revision: RevisionTag | undefined): ChangeAtomId {\n\tconst updated = { ...id, revision };\n\tif (revision === undefined) {\n\t\tdelete updated.revision;\n\t}\n\n\treturn updated;\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/** The tag for this commit. If this commit is rebased, the corresponding rebased commit will retain this tag. */\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 commit that has been applied.\n *\n * @sealed @alpha\n */\nexport type ChangeMetadata = CommitMetadata &\n\t(\n\t\t| {\n\t\t\t\treadonly isLocal: true;\n\t\t\t\t/**\n\t\t\t\t * A serializable object that encodes the change.\n\t\t\t\t * @remarks This change object can be {@link TreeBranchAlpha.applyChange | applied to another branch} in the same state as the one which generated it.\n\t\t\t\t * The change object must be applied to a SharedTree with the same IdCompressor session ID as it was created from.\n\t\t\t\t * @privateRemarks\n\t\t\t\t * This is a `SerializedChange` from treeCheckout.ts.\n\t\t\t\t */\n\t\t\t\tgetChange(): JsonCompatibleReadOnly;\n\t\t }\n\t\t| {\n\t\t\t\treadonly isLocal: false;\n\t\t\t\treadonly getChange?: undefined;\n\t\t }\n\t);\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"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { DiscriminatedUnionDispatcher } from "../../codec/index.js";
6
- import { type Brand, type JsonCompatibleReadOnlyObject, type MakeNominal } from "../../util/index.js";
6
+ import { type JsonCompatibleReadOnlyObject, type MakeNominal, type Values } from "../../util/index.js";
7
7
  import { type FieldKey, type FieldKindIdentifier, type FieldSchemaFormat as FieldSchemaFormatV1, type TreeNodeSchemaDataFormat as TreeNodeSchemaDataFormatV1, type TreeNodeSchemaIdentifier } from "./formatV1.js";
8
8
  import type { FieldSchemaFormat as FieldSchemaFormatV2, PersistedMetadataFormat, TreeNodeSchemaUnionFormat, TreeNodeSchemaDataFormat as TreeNodeSchemaDataFormatV2 } from "./formatV2.js";
9
9
  import type { Multiplicity } from "./multiplicity.js";
@@ -11,13 +11,10 @@ import type { Multiplicity } from "./multiplicity.js";
11
11
  * The format version for the schema.
12
12
  */
13
13
  export declare const SchemaFormatVersion: {
14
- readonly v1: 1;
15
- /**
16
- * Adds persisted metadata to the node schema and field schema.
17
- */
18
- readonly v2: 2;
14
+ readonly v1: import("../../util/brand.js").Brand<1, "SchemaFormatVersion">;
15
+ readonly v2: import("../../util/brand.js").Brand<2, "SchemaFormatVersion">;
19
16
  };
20
- export type SchemaFormatVersion = Brand<(typeof SchemaFormatVersion)[keyof typeof SchemaFormatVersion], "SchemaFormatVersion">;
17
+ export type SchemaFormatVersion = Values<typeof SchemaFormatVersion>;
21
18
  /**
22
19
  * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.
23
20
  * @privateRemarks
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EACN,KAAK,KAAK,EACV,KAAK,4BAA4B,EACjC,KAAK,WAAW,EAGhB,MAAM,qBAAqB,CA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C,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,qBAAqB;CAGtE;AAED,qBAAa,oBAAqB,SAAQ,oBAAoB;aAY1B,SAAS,EAAE,WAAW;IAXzD;;;;;;;;;;OAUG;gBACgC,SAAS,EAAE,WAAW;IAKzC,QAAQ,IAAI,0BAA0B;IAMtC,QAAQ,IAAI,0BAA0B;IAStC,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,qBAAqB;CAGtE;AAED;;;GAGG;AACH,KAAK,mBAAmB,GAAG,CAC1B,QAAQ,EAAE,uBAAuB,GAAG,SAAS,KACzC,oBAAoB,CAAC;AAE1B,eAAO,MAAM,4BAA4B,EAAE,4BAA4B,CACtE,yBAAyB,EACzB;CAAE,EACF,mBAAmB,CAalB,CAAC;AAoBH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,qBAAqB,GAAG,mBAAmB,CAMtF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,qBAAqB,GAAG,mBAAmB,CAOtF;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,mBAAmB,GAAG,qBAAqB,CAQpF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC/D;;OAEG;IACH,QAAQ,CAAC,eAAe,EAAE,qBAAqB,CAAC;CAChD;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAC;CACjF"}
@@ -12,13 +12,13 @@ const formatV1_js_1 = require("./formatV1.js");
12
12
  /**
13
13
  * The format version for the schema.
14
14
  */
15
- exports.SchemaFormatVersion = {
15
+ exports.SchemaFormatVersion = (0, index_js_2.strictEnum)("SchemaFormatVersion", {
16
16
  v1: 1,
17
17
  /**
18
18
  * Adds persisted metadata to the node schema and field schema.
19
19
  */
20
20
  v2: 2,
21
- };
21
+ });
22
22
  /**
23
23
  * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.
24
24
  * @privateRemarks
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAE3D,mDAAoE;AACpE,kDAM6B;AAE7B,+CAOuB;AASvB;;GAEG;AACU,QAAA,mBAAmB,GAAG;IAClC,EAAE,EAAE,CAAC;IACL;;OAEG;IACH,EAAE,EAAE,CAAC;CACI,CAAC;AAQX;;;;;;;;GAQG;AACH,IAAY,WAMX;AAND,WAAY,WAAW;IACtB,iDAAM,CAAA;IACN,iDAAM,CAAA;IACN,mDAAO,CAAA;IACP,2DAAW,CAAA;IACX,6CAAI,CAAA;AACL,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAmGD;;;;;;;;;GASG;AACU,QAAA,4BAA4B,GAAG,IAAA,qBAAU,EAAC,WAAW,CAAC,EAAuB,CAAC;AAE3F;;;GAGG;AACU,QAAA,sBAAsB,GAA0B;IAC5D,4CAA4C;IAC5C,IAAI,EAAE,oCAA4B;IAClC,qFAAqF;IACrF,KAAK,EAAE,IAAI,GAAG,EAAE;IAChB,iBAAiB,EAAE,SAAS;CAC5B,CAAC;AAEF;;GAEG;AACU,QAAA,6BAA6B,GAAG,YAAY,CAAC;AAE1D,MAAsB,oBAAoB;IAGzC;;;OAGG;IACH,YAAmC,QAA6C;QAA7C,aAAQ,GAAR,QAAQ,CAAqC;IAAG,CAAC;CAiBpF;AAxBD,oDAwBC;AAED,MAAa,sBAAuB,SAAQ,oBAAoB;IAC/D;;;;;;OAMG;IACH,YACiB,gBAA8D,EAC9E,QAA8C;QAE9C,KAAK,CAAC,QAAQ,CAAC,CAAC;QAHA,qBAAgB,GAAhB,gBAAgB,CAA8C;IAI/E,CAAC;IAEe,QAAQ;QACvB,MAAM,YAAY,GACjB,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;QAE9C,OAAO;YACN,MA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,CAAC,CAAC,IAAI,EAAE;KAC/B,CAAC;AACH,CAAC;AAND,kDAMC;AAED,SAAgB,mBAAmB,CAAC,MAA6B;IAChE,MAAM,WAAW,GAAwB,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAErE,mDAAmD;IACnD,OAAO,MAAM,CAAC,iBAAiB,KAAK,SAAS;QAC5C,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,iBAAiB,EAAE;QACxD,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC;AACvB,CAAC;AAPD,kDAOC;AAED,SAAgB,iBAAiB,CAAC,MAA2B;IAC5D,MAAM,GAAG,GAA0B;QAClC,kFAAkF;QAClF,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;QAC5B,iBAAiB,EAAE,MAAM,CAAC,QAAQ;KAClC,CAAC;IACF,OAAO,GAAG,CAAC;AACZ,CAAC;AARD,8CAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport { DiscriminatedUnionDispatcher } from \"../../codec/index.js\";\nimport {\n\ttype Brand,\n\ttype JsonCompatibleReadOnlyObject,\n\ttype MakeNominal,\n\tbrandConst,\n\tinvertMap,\n} from \"../../util/index.js\";\n\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype FieldSchemaFormat as FieldSchemaFormatV1,\n\tPersistedValueSchema,\n\ttype TreeNodeSchemaDataFormat as TreeNodeSchemaDataFormatV1,\n\ttype TreeNodeSchemaIdentifier,\n} from \"./formatV1.js\";\nimport type {\n\tFieldSchemaFormat as FieldSchemaFormatV2,\n\tPersistedMetadataFormat,\n\tTreeNodeSchemaUnionFormat,\n\tTreeNodeSchemaDataFormat as TreeNodeSchemaDataFormatV2,\n} from \"./formatV2.js\";\nimport type { Multiplicity } from \"./multiplicity.js\";\n\n/**\n * The format version for the schema.\n */\nexport const SchemaFormatVersion = {\n\tv1: 1,\n\t/**\n\t * Adds persisted metadata to the node schema and field schema.\n\t */\n\tv2: 2,\n} as const;\nexport type SchemaFormatVersion = Brand<\n\t(typeof SchemaFormatVersion)[keyof typeof SchemaFormatVersion],\n\t\"SchemaFormatVersion\"\n>;\n\ntype FieldSchemaFormat = FieldSchemaFormatV1 | FieldSchemaFormatV2;\n\n/**\n * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.\n * @privateRemarks\n * See also {@link TreeValue}.\n * If further stabilizing this,\n * consider the implications of how this might prevent adding of new leaf types in the future.\n * Maybe add a disclaimer that it might be extended like on {@link NodeKind}?\n * @alpha\n */\nexport enum ValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Set of allowed tree types.\n * Providing multiple values here allows polymorphism, tagged union style.\n *\n * In the future, this could be extended to allow inlining a TreeNodeStoredSchema here\n * (or some similar structural schema system).\n * For structural types which could go here, there are a few interesting options:\n *\n * - Allow replacing the whole set with a structural type for terminal / non-tree data,\n * and use this as a replacement for values on the tree nodes.\n *\n * - Allow expression structural constraints for child trees, for example requiring specific traits\n * (ex: via TreeNodeStoredSchema), instead of by type.\n *\n * There are two ways this could work:\n *\n * - Constrain the child nodes based on their shape:\n * this makes schema safe editing difficult because nodes would incur extra editing constraints to prevent them\n * from going out of schema based on their location in such a field.\n *\n * - Constrain the types allowed based on which types guarantee their data will always meet the constraints.\n *\n * Care would need to be taken to make sure this is sound for the schema updating mechanisms.\n */\nexport type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;\n\n/**\n * Declarative portion of a {@link FlexFieldKind}.\n *\n * @remarks\n * Enough info about a field kind to know if a given tree is is schema.\n *\n * Note that compatibility between trees and schema is not sufficient to evaluate if a schema upgrade should be allowed.\n * Currently schema upgrades are restricted to field kind changes which can not be cyclic (like version upgrades but not down grades).\n * See {@link FlexFieldKind.allowsFieldSuperset} for more details.\n */\nexport interface FieldKindData {\n\t/**\n\t * Globally scoped identifier.\n\t */\n\treadonly identifier: FieldKindIdentifier;\n\t/**\n\t * Bound on the number of children that fields of this kind may have.\n\t * TODO: consider replacing this with numeric upper and lower bounds.\n\t */\n\treadonly multiplicity: Multiplicity;\n}\n\n/**\n * Everything needed to define what it means for a tree to be in schema.\n */\nexport interface SchemaAndPolicy {\n\treadonly schema: StoredSchemaCollection;\n\treadonly policy: SchemaPolicy;\n}\n\n/**\n * Extra data needed to interpret stored schema.\n * @remarks\n * This contains information that describes the semantics of things which can be referenced in stored schema.\n * For example, field kind identifiers refer to specific field kinds, which imply specific rules around what is valid in a given field (the multiplicity).\n * This structure provides such information, allowing it to be possible to determine if a given tree complies with a particular stored schema.\n */\nexport interface SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handle fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindData>;\n}\n\n/**\n * Schema for a field.\n * Object implementing this interface should never be modified.\n */\nexport interface TreeFieldStoredSchema {\n\treadonly kind: FieldKindIdentifier;\n\n\t/**\n\t * The set of allowed child types.\n\t * If not specified, types are unconstrained.\n\t */\n\treadonly types: TreeTypeSet;\n\n\t/**\n\t * Portion of the metadata which can be persisted.\n\t * @remarks\n\t * Discarded when encoding to {@link SchemaFormatVersion.V1}.\n\t * @privateRemarks\n\t * This field corresponds to the `metadata` field in the persisted schema format.\n\t */\n\treadonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined;\n}\n\n/**\n * Identifier used for the FieldKind for fields which must be empty.\n *\n * @remarks\n * This mainly show up in:\n *\n * 1. The root default field for documents.\n *\n * 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.\n */\nexport const forbiddenFieldKindIdentifier = brandConst(\"Forbidden\")<FieldKindIdentifier>();\n\n/**\n * A schema for empty fields (fields which must always be empty).\n * There are multiple ways this could be encoded, but this is the most explicit.\n */\nexport const storedEmptyFieldSchema: TreeFieldStoredSchema = {\n\t// This kind requires the field to be empty.\n\tkind: forbiddenFieldKindIdentifier,\n\t// This type set also forces the field to be empty not not allowing any types as all.\n\ttypes: new Set(),\n\tpersistedMetadata: undefined,\n};\n\n/**\n * Identifier used for the FieldKind for fields of type identifier.\n */\nexport const identifierFieldKindIdentifier = \"Identifier\";\n\nexport abstract class TreeNodeStoredSchema {\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * Constructor for a TreeNodeStoredSchema.\n\t * @param metadata - Persisted metadata for this node schema.\n\t */\n\tpublic constructor(public readonly metadata: PersistedMetadataFormat | undefined) {}\n\n\t/**\n\t * Encode in the v1 schema format.\n\t */\n\tpublic abstract encodeV1(): TreeNodeSchemaDataFormatV1;\n\n\t/**\n\t * Encode in the v2 schema format.\n\t * @remarks Post-condition: if metadata was specified on the input schema, it will be present in the output.\n\t */\n\tpublic abstract encodeV2(): TreeNodeSchemaDataFormatV2;\n\n\t/**\n\t * Returns the schema for the provided field.\n\t */\n\tpublic abstract getFieldSchema(field: FieldKey): TreeFieldStoredSchema;\n}\n\nexport class ObjectNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param objectNodeFields - Schema for fields with keys scoped to this TreeNodeStoredSchema.\n\t * This refers to the TreeFieldStoredSchema directly\n\t * (as opposed to just supporting FieldSchemaIdentifier and having a central FieldKey -\\> TreeFieldStoredSchema map).\n\t * This allows us short friendly field keys which can be ergonomically used as field names in code.\n\t * It also interoperates well with mapFields being used as a map with arbitrary data as keys.\n\t */\n\tpublic constructor(\n\t\tpublic readonly objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>,\n\t\tmetadata?: PersistedMetadataFormat | undefined,\n\t) {\n\t\tsuper(metadata);\n\t}\n\n\tpublic override encodeV1(): TreeNodeSchemaDataFormatV1 {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> =\n\t\t\tthis.encodeFieldsObject(encodeFieldSchemaV1);\n\n\t\treturn {\n\t\t\tobject: fieldsObject,\n\t\t};\n\t}\n\n\tpublic override encodeV2(): TreeNodeSchemaDataFormatV2 {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> =\n\t\t\tthis.encodeFieldsObject(encodeFieldSchemaV2);\n\t\tconst kind = { object: fieldsObject };\n\n\t\treturn { kind, metadata: this.metadata };\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.objectNodeFields.get(field) ?? storedEmptyFieldSchema;\n\t}\n\n\tprivate encodeFieldsObject(\n\t\tencodeFieldSchema: (storedFieldSchema: TreeFieldStoredSchema) => FieldSchemaFormat,\n\t): Record<string, FieldSchemaFormat> {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> = Object.create(null);\n\t\t// Sort fields to ensure output is identical for for equivalent schema (since field order is not considered significant).\n\t\t// This makes comparing schema easier, and ensures chunk reuse for schema summaries isn't needlessly broken.\n\t\tfor (const key of [...this.objectNodeFields.keys()].sort()) {\n\t\t\tObject.defineProperty(fieldsObject, key, {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: encodeFieldSchema(\n\t\t\t\t\tthis.objectNodeFields.get(key) ?? fail(0xae7 /* missing field */),\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\t\treturn fieldsObject;\n\t}\n}\n\nexport class MapNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param mapFields - Allows using the fields as a map, with the keys being\n\t * FieldKeys and the values being constrained by this TreeFieldStoredSchema.\n\t * Usually `FieldKind.Value` should NOT be used here\n\t * since no nodes can ever be in schema if you use `FieldKind.Value` here\n\t * (that would require infinite children).\n\t */\n\tpublic constructor(\n\t\tpublic readonly mapFields: TreeFieldStoredSchema,\n\t\tmetadata?: PersistedMetadataFormat | undefined,\n\t) {\n\t\tsuper(metadata);\n\t}\n\n\tpublic override encodeV1(): TreeNodeSchemaDataFormatV1 {\n\t\treturn {\n\t\t\tmap: encodeFieldSchemaV1(this.mapFields),\n\t\t};\n\t}\n\n\tpublic override encodeV2(): TreeNodeSchemaDataFormatV2 {\n\t\tconst kind = { map: encodeFieldSchemaV2(this.mapFields) };\n\t\treturn { kind, metadata: this.metadata };\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.mapFields;\n\t}\n}\n\nexport class LeafNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param leafValue - There are several approaches for how to store actual data in the tree\n\t * (special node types, special field contents, data on nodes etc.)\n\t * as well as several options about how the data should be modeled at this level\n\t * (byte sequence? javascript type? json?),\n\t * as well as options for how much of this would be exposed in the schema language\n\t * (ex: would all nodes with values be special built-ins, or could any schema add them?)\n\t * A simple easy to do in javascript approach is taken here:\n\t * this is not intended to be a suggestion of what approach to take, or what to expose in the schema language.\n\t * This is simply one approach that can work for modeling them in the internal schema representation.\n\t */\n\tpublic constructor(public readonly leafValue: ValueSchema) {\n\t\t// No metadata for leaf nodes.\n\t\tsuper(undefined);\n\t}\n\n\tpublic override encodeV1(): TreeNodeSchemaDataFormatV1 {\n\t\treturn {\n\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t};\n\t}\n\n\tpublic override encodeV2(): TreeNodeSchemaDataFormatV2 {\n\t\treturn {\n\t\t\t// No metadata for leaf nodes, so don't emit a metadata field.\n\t\t\tkind: {\n\t\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn storedEmptyFieldSchema;\n\t}\n}\n\n/**\n * Decoder wrapper function for {@link TreeNodeStoredSchema} implementations.\n * Curries the constructor so that the caller can inject metadata.\n */\ntype StoredSchemaDecoder = (\n\tmetadata: PersistedMetadataFormat | undefined,\n) => TreeNodeStoredSchema;\n\nexport const storedSchemaDecodeDispatcher: DiscriminatedUnionDispatcher<\n\tTreeNodeSchemaUnionFormat,\n\t[],\n\tStoredSchemaDecoder\n> = new DiscriminatedUnionDispatcher({\n\tleaf: (data: PersistedValueSchema) => (metadata) =>\n\t\tnew LeafNodeStoredSchema(decodeValueSchema(data)),\n\tobject: (data: Record<TreeNodeSchemaIdentifier, FieldSchemaFormat>) => (metadata) => {\n\t\tconst map = new Map();\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tmap.set(key, decodeFieldSchema(value));\n\t\t}\n\t\treturn new ObjectNodeStoredSchema(map, metadata);\n\t},\n\tmap: (data: FieldSchemaFormat) => (metadata) =>\n\t\tnew MapNodeStoredSchema(decodeFieldSchema(data), metadata),\n});\n\nconst valueSchemaEncode = new Map([\n\t[ValueSchema.Number, PersistedValueSchema.Number],\n\t[ValueSchema.String, PersistedValueSchema.String],\n\t[ValueSchema.Boolean, PersistedValueSchema.Boolean],\n\t[ValueSchema.FluidHandle, PersistedValueSchema.FluidHandle],\n\t[ValueSchema.Null, PersistedValueSchema.Null],\n]);\n\nconst valueSchemaDecode = invertMap(valueSchemaEncode);\n\nfunction encodeValueSchema(inMemory: ValueSchema): PersistedValueSchema {\n\treturn valueSchemaEncode.get(inMemory) ?? fail(0xae8 /* missing PersistedValueSchema */);\n}\n\nfunction decodeValueSchema(inMemory: PersistedValueSchema): ValueSchema {\n\treturn valueSchemaDecode.get(inMemory) ?? fail(0xae9 /* missing ValueSchema */);\n}\n\nexport function encodeFieldSchemaV1(schema: TreeFieldStoredSchema): FieldSchemaFormatV1 {\n\treturn {\n\t\tkind: schema.kind,\n\t\t// Types are sorted by identifier to improve stability of persisted data to increase chance of schema blob reuse.\n\t\ttypes: [...schema.types].sort(),\n\t};\n}\n\nexport function encodeFieldSchemaV2(schema: TreeFieldStoredSchema): FieldSchemaFormatV2 {\n\tconst fieldSchema: FieldSchemaFormatV1 = encodeFieldSchemaV1(schema);\n\n\t// Omit metadata from the output if it is undefined\n\treturn schema.persistedMetadata !== undefined\n\t\t? { ...fieldSchema, metadata: schema.persistedMetadata }\n\t\t: { ...fieldSchema };\n}\n\nexport function decodeFieldSchema(schema: FieldSchemaFormatV2): TreeFieldStoredSchema {\n\tconst out: TreeFieldStoredSchema = {\n\t\t// TODO: maybe provide actual FieldKind objects here, error on unrecognized kinds.\n\t\tkind: schema.kind,\n\t\ttypes: new Set(schema.types),\n\t\tpersistedMetadata: schema.metadata,\n\t};\n\treturn out;\n}\n\n/**\n * Document schema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hand onto a specific version, make a copy.\n */\nexport interface TreeStoredSchema extends StoredSchemaCollection {\n\t/**\n\t * Schema for the root field which contains the whole tree.\n\t */\n\treadonly rootFieldSchema: TreeFieldStoredSchema;\n}\n\n/**\n * Collection of TreeNodeSchema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hang onto a specific version, make a copy.\n */\nexport interface StoredSchemaCollection {\n\t/**\n\t * {@inheritdoc StoredSchemaCollection}\n\t */\n\treadonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n}\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAE3D,mDAAoE;AACpE,kDAO6B;AAE7B,+CAOuB;AASvB;;GAEG;AACU,QAAA,mBAAmB,GAAG,IAAA,qBAAU,EAAC,qBAAqB,EAAE;IACpE,EAAE,EAAE,CAAC;IACL;;OAEG;IACH,EAAE,EAAE,CAAC;CACL,CAAC,CAAC;AAKH;;;;;;;;GAQG;AACH,IAAY,WAMX;AAND,WAAY,WAAW;IACtB,iDAAM,CAAA;IACN,iDAAM,CAAA;IACN,mDAAO,CAAA;IACP,2DAAW,CAAA;I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ClF,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;QAC5B,iBAAiB,EAAE,MAAM,CAAC,QAAQ;KAClC,CAAC;IACF,OAAO,GAAG,CAAC;AACZ,CAAC;AARD,8CAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport { DiscriminatedUnionDispatcher } from \"../../codec/index.js\";\nimport {\n\ttype JsonCompatibleReadOnlyObject,\n\ttype MakeNominal,\n\ttype Values,\n\tbrandConst,\n\tinvertMap,\n\tstrictEnum,\n} from \"../../util/index.js\";\n\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype FieldSchemaFormat as FieldSchemaFormatV1,\n\tPersistedValueSchema,\n\ttype TreeNodeSchemaDataFormat as TreeNodeSchemaDataFormatV1,\n\ttype TreeNodeSchemaIdentifier,\n} from \"./formatV1.js\";\nimport type {\n\tFieldSchemaFormat as FieldSchemaFormatV2,\n\tPersistedMetadataFormat,\n\tTreeNodeSchemaUnionFormat,\n\tTreeNodeSchemaDataFormat as TreeNodeSchemaDataFormatV2,\n} from \"./formatV2.js\";\nimport type { Multiplicity } from \"./multiplicity.js\";\n\n/**\n * The format version for the schema.\n */\nexport const SchemaFormatVersion = strictEnum(\"SchemaFormatVersion\", {\n\tv1: 1,\n\t/**\n\t * Adds persisted metadata to the node schema and field schema.\n\t */\n\tv2: 2,\n});\nexport type SchemaFormatVersion = Values<typeof SchemaFormatVersion>;\n\ntype FieldSchemaFormat = FieldSchemaFormatV1 | FieldSchemaFormatV2;\n\n/**\n * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.\n * @privateRemarks\n * See also {@link TreeValue}.\n * If further stabilizing this,\n * consider the implications of how this might prevent adding of new leaf types in the future.\n * Maybe add a disclaimer that it might be extended like on {@link NodeKind}?\n * @alpha\n */\nexport enum ValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Set of allowed tree types.\n * Providing multiple values here allows polymorphism, tagged union style.\n *\n * In the future, this could be extended to allow inlining a TreeNodeStoredSchema here\n * (or some similar structural schema system).\n * For structural types which could go here, there are a few interesting options:\n *\n * - Allow replacing the whole set with a structural type for terminal / non-tree data,\n * and use this as a replacement for values on the tree nodes.\n *\n * - Allow expression structural constraints for child trees, for example requiring specific traits\n * (ex: via TreeNodeStoredSchema), instead of by type.\n *\n * There are two ways this could work:\n *\n * - Constrain the child nodes based on their shape:\n * this makes schema safe editing difficult because nodes would incur extra editing constraints to prevent them\n * from going out of schema based on their location in such a field.\n *\n * - Constrain the types allowed based on which types guarantee their data will always meet the constraints.\n *\n * Care would need to be taken to make sure this is sound for the schema updating mechanisms.\n */\nexport type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;\n\n/**\n * Declarative portion of a {@link FlexFieldKind}.\n *\n * @remarks\n * Enough info about a field kind to know if a given tree is is schema.\n *\n * Note that compatibility between trees and schema is not sufficient to evaluate if a schema upgrade should be allowed.\n * Currently schema upgrades are restricted to field kind changes which can not be cyclic (like version upgrades but not down grades).\n * See {@link FlexFieldKind.allowsFieldSuperset} for more details.\n */\nexport interface FieldKindData {\n\t/**\n\t * Globally scoped identifier.\n\t */\n\treadonly identifier: FieldKindIdentifier;\n\t/**\n\t * Bound on the number of children that fields of this kind may have.\n\t * TODO: consider replacing this with numeric upper and lower bounds.\n\t */\n\treadonly multiplicity: Multiplicity;\n}\n\n/**\n * Everything needed to define what it means for a tree to be in schema.\n */\nexport interface SchemaAndPolicy {\n\treadonly schema: StoredSchemaCollection;\n\treadonly policy: SchemaPolicy;\n}\n\n/**\n * Extra data needed to interpret stored schema.\n * @remarks\n * This contains information that describes the semantics of things which can be referenced in stored schema.\n * For example, field kind identifiers refer to specific field kinds, which imply specific rules around what is valid in a given field (the multiplicity).\n * This structure provides such information, allowing it to be possible to determine if a given tree complies with a particular stored schema.\n */\nexport interface SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handle fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindData>;\n}\n\n/**\n * Schema for a field.\n * Object implementing this interface should never be modified.\n */\nexport interface TreeFieldStoredSchema {\n\treadonly kind: FieldKindIdentifier;\n\n\t/**\n\t * The set of allowed child types.\n\t * If not specified, types are unconstrained.\n\t */\n\treadonly types: TreeTypeSet;\n\n\t/**\n\t * Portion of the metadata which can be persisted.\n\t * @remarks\n\t * Discarded when encoding to {@link SchemaFormatVersion.V1}.\n\t * @privateRemarks\n\t * This field corresponds to the `metadata` field in the persisted schema format.\n\t */\n\treadonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined;\n}\n\n/**\n * Identifier used for the FieldKind for fields which must be empty.\n *\n * @remarks\n * This mainly show up in:\n *\n * 1. The root default field for documents.\n *\n * 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.\n */\nexport const forbiddenFieldKindIdentifier = brandConst(\"Forbidden\")<FieldKindIdentifier>();\n\n/**\n * A schema for empty fields (fields which must always be empty).\n * There are multiple ways this could be encoded, but this is the most explicit.\n */\nexport const storedEmptyFieldSchema: TreeFieldStoredSchema = {\n\t// This kind requires the field to be empty.\n\tkind: forbiddenFieldKindIdentifier,\n\t// This type set also forces the field to be empty not not allowing any types as all.\n\ttypes: new Set(),\n\tpersistedMetadata: undefined,\n};\n\n/**\n * Identifier used for the FieldKind for fields of type identifier.\n */\nexport const identifierFieldKindIdentifier = \"Identifier\";\n\nexport abstract class TreeNodeStoredSchema {\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * Constructor for a TreeNodeStoredSchema.\n\t * @param metadata - Persisted metadata for this node schema.\n\t */\n\tpublic constructor(public readonly metadata: PersistedMetadataFormat | undefined) {}\n\n\t/**\n\t * Encode in the v1 schema format.\n\t */\n\tpublic abstract encodeV1(): TreeNodeSchemaDataFormatV1;\n\n\t/**\n\t * Encode in the v2 schema format.\n\t * @remarks Post-condition: if metadata was specified on the input schema, it will be present in the output.\n\t */\n\tpublic abstract encodeV2(): TreeNodeSchemaDataFormatV2;\n\n\t/**\n\t * Returns the schema for the provided field.\n\t */\n\tpublic abstract getFieldSchema(field: FieldKey): TreeFieldStoredSchema;\n}\n\nexport class ObjectNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param objectNodeFields - Schema for fields with keys scoped to this TreeNodeStoredSchema.\n\t * This refers to the TreeFieldStoredSchema directly\n\t * (as opposed to just supporting FieldSchemaIdentifier and having a central FieldKey -\\> TreeFieldStoredSchema map).\n\t * This allows us short friendly field keys which can be ergonomically used as field names in code.\n\t * It also interoperates well with mapFields being used as a map with arbitrary data as keys.\n\t */\n\tpublic constructor(\n\t\tpublic readonly objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>,\n\t\tmetadata?: PersistedMetadataFormat | undefined,\n\t) {\n\t\tsuper(metadata);\n\t}\n\n\tpublic override encodeV1(): TreeNodeSchemaDataFormatV1 {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> =\n\t\t\tthis.encodeFieldsObject(encodeFieldSchemaV1);\n\n\t\treturn {\n\t\t\tobject: fieldsObject,\n\t\t};\n\t}\n\n\tpublic override encodeV2(): TreeNodeSchemaDataFormatV2 {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> =\n\t\t\tthis.encodeFieldsObject(encodeFieldSchemaV2);\n\t\tconst kind = { object: fieldsObject };\n\n\t\treturn { kind, metadata: this.metadata };\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.objectNodeFields.get(field) ?? storedEmptyFieldSchema;\n\t}\n\n\tprivate encodeFieldsObject(\n\t\tencodeFieldSchema: (storedFieldSchema: TreeFieldStoredSchema) => FieldSchemaFormat,\n\t): Record<string, FieldSchemaFormat> {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> = Object.create(null);\n\t\t// Sort fields to ensure output is identical for for equivalent schema (since field order is not considered significant).\n\t\t// This makes comparing schema easier, and ensures chunk reuse for schema summaries isn't needlessly broken.\n\t\tfor (const key of [...this.objectNodeFields.keys()].sort()) {\n\t\t\tObject.defineProperty(fieldsObject, key, {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: encodeFieldSchema(\n\t\t\t\t\tthis.objectNodeFields.get(key) ?? fail(0xae7 /* missing field */),\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\t\treturn fieldsObject;\n\t}\n}\n\nexport class MapNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param mapFields - Allows using the fields as a map, with the keys being\n\t * FieldKeys and the values being constrained by this TreeFieldStoredSchema.\n\t * Usually `FieldKind.Value` should NOT be used here\n\t * since no nodes can ever be in schema if you use `FieldKind.Value` here\n\t * (that would require infinite children).\n\t */\n\tpublic constructor(\n\t\tpublic readonly mapFields: TreeFieldStoredSchema,\n\t\tmetadata?: PersistedMetadataFormat | undefined,\n\t) {\n\t\tsuper(metadata);\n\t}\n\n\tpublic override encodeV1(): TreeNodeSchemaDataFormatV1 {\n\t\treturn {\n\t\t\tmap: encodeFieldSchemaV1(this.mapFields),\n\t\t};\n\t}\n\n\tpublic override encodeV2(): TreeNodeSchemaDataFormatV2 {\n\t\tconst kind = { map: encodeFieldSchemaV2(this.mapFields) };\n\t\treturn { kind, metadata: this.metadata };\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.mapFields;\n\t}\n}\n\nexport class LeafNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param leafValue - There are several approaches for how to store actual data in the tree\n\t * (special node types, special field contents, data on nodes etc.)\n\t * as well as several options about how the data should be modeled at this level\n\t * (byte sequence? javascript type? json?),\n\t * as well as options for how much of this would be exposed in the schema language\n\t * (ex: would all nodes with values be special built-ins, or could any schema add them?)\n\t * A simple easy to do in javascript approach is taken here:\n\t * this is not intended to be a suggestion of what approach to take, or what to expose in the schema language.\n\t * This is simply one approach that can work for modeling them in the internal schema representation.\n\t */\n\tpublic constructor(public readonly leafValue: ValueSchema) {\n\t\t// No metadata for leaf nodes.\n\t\tsuper(undefined);\n\t}\n\n\tpublic override encodeV1(): TreeNodeSchemaDataFormatV1 {\n\t\treturn {\n\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t};\n\t}\n\n\tpublic override encodeV2(): TreeNodeSchemaDataFormatV2 {\n\t\treturn {\n\t\t\t// No metadata for leaf nodes, so don't emit a metadata field.\n\t\t\tkind: {\n\t\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn storedEmptyFieldSchema;\n\t}\n}\n\n/**\n * Decoder wrapper function for {@link TreeNodeStoredSchema} implementations.\n * Curries the constructor so that the caller can inject metadata.\n */\ntype StoredSchemaDecoder = (\n\tmetadata: PersistedMetadataFormat | undefined,\n) => TreeNodeStoredSchema;\n\nexport const storedSchemaDecodeDispatcher: DiscriminatedUnionDispatcher<\n\tTreeNodeSchemaUnionFormat,\n\t[],\n\tStoredSchemaDecoder\n> = new DiscriminatedUnionDispatcher({\n\tleaf: (data: PersistedValueSchema) => (metadata) =>\n\t\tnew LeafNodeStoredSchema(decodeValueSchema(data)),\n\tobject: (data: Record<TreeNodeSchemaIdentifier, FieldSchemaFormat>) => (metadata) => {\n\t\tconst map = new Map();\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tmap.set(key, decodeFieldSchema(value));\n\t\t}\n\t\treturn new ObjectNodeStoredSchema(map, metadata);\n\t},\n\tmap: (data: FieldSchemaFormat) => (metadata) =>\n\t\tnew MapNodeStoredSchema(decodeFieldSchema(data), metadata),\n});\n\nconst valueSchemaEncode = new Map([\n\t[ValueSchema.Number, PersistedValueSchema.Number],\n\t[ValueSchema.String, PersistedValueSchema.String],\n\t[ValueSchema.Boolean, PersistedValueSchema.Boolean],\n\t[ValueSchema.FluidHandle, PersistedValueSchema.FluidHandle],\n\t[ValueSchema.Null, PersistedValueSchema.Null],\n]);\n\nconst valueSchemaDecode = invertMap(valueSchemaEncode);\n\nfunction encodeValueSchema(inMemory: ValueSchema): PersistedValueSchema {\n\treturn valueSchemaEncode.get(inMemory) ?? fail(0xae8 /* missing PersistedValueSchema */);\n}\n\nfunction decodeValueSchema(inMemory: PersistedValueSchema): ValueSchema {\n\treturn valueSchemaDecode.get(inMemory) ?? fail(0xae9 /* missing ValueSchema */);\n}\n\nexport function encodeFieldSchemaV1(schema: TreeFieldStoredSchema): FieldSchemaFormatV1 {\n\treturn {\n\t\tkind: schema.kind,\n\t\t// Types are sorted by identifier to improve stability of persisted data to increase chance of schema blob reuse.\n\t\ttypes: [...schema.types].sort(),\n\t};\n}\n\nexport function encodeFieldSchemaV2(schema: TreeFieldStoredSchema): FieldSchemaFormatV2 {\n\tconst fieldSchema: FieldSchemaFormatV1 = encodeFieldSchemaV1(schema);\n\n\t// Omit metadata from the output if it is undefined\n\treturn schema.persistedMetadata !== undefined\n\t\t? { ...fieldSchema, metadata: schema.persistedMetadata }\n\t\t: { ...fieldSchema };\n}\n\nexport function decodeFieldSchema(schema: FieldSchemaFormatV2): TreeFieldStoredSchema {\n\tconst out: TreeFieldStoredSchema = {\n\t\t// TODO: maybe provide actual FieldKind objects here, error on unrecognized kinds.\n\t\tkind: schema.kind,\n\t\ttypes: new Set(schema.types),\n\t\tpersistedMetadata: schema.metadata,\n\t};\n\treturn out;\n}\n\n/**\n * Document schema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hand onto a specific version, make a copy.\n */\nexport interface TreeStoredSchema extends StoredSchemaCollection {\n\t/**\n\t * Schema for the root field which contains the whole tree.\n\t */\n\treadonly rootFieldSchema: TreeFieldStoredSchema;\n}\n\n/**\n * Collection of TreeNodeSchema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hang onto a specific version, make a copy.\n */\nexport interface StoredSchemaCollection {\n\t/**\n\t * {@inheritdoc StoredSchemaCollection}\n\t */\n\treadonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n}\n"]}
@@ -9,10 +9,39 @@ import type { RevisionTag, RevisionTagCodec } from "../rebase/index.js";
9
9
  import type { FieldKey } from "../schema-stored/index.js";
10
10
  import type * as Delta from "./delta.js";
11
11
  import type { ForestRootId, Major } from "./detachedFieldIndexTypes.js";
12
+ /**
13
+ * Readonly interface for {@link DetachedFieldIndex}.
14
+ */
15
+ export interface ReadOnlyDetachedFieldIndex {
16
+ /**
17
+ * Creates a deep clone of this `DetachedFieldIndex`.
18
+ */
19
+ clone(): DetachedFieldIndex;
20
+ /**
21
+ * Returns a field key for the given ID.
22
+ * This does not save the field key on the index. To do so, call {@link createEntry}.
23
+ */
24
+ toFieldKey(id: ForestRootId): FieldKey;
25
+ /**
26
+ * Returns the `ForestRootId` associated with the given id.
27
+ * Returns undefined if no such id is known to the index.
28
+ */
29
+ tryGetEntry(id: Delta.DetachedNodeId): ForestRootId | undefined;
30
+ /**
31
+ * Returns the `ForestRootId` associated with the given id.
32
+ * Fails if no such id is known to the index.
33
+ */
34
+ getEntry(id: Delta.DetachedNodeId): ForestRootId;
35
+ }
36
+ /**
37
+ * Restores the originating DetachedFieldIndex to the state it was in when the checkpoint was created.
38
+ * Can be invoked multiple times.
39
+ */
40
+ export type DetachedFieldIndexCheckpoint = () => void;
12
41
  /**
13
42
  * The tree index records detached field IDs and associates them with a change atom ID.
14
43
  */
15
- export declare class DetachedFieldIndex {
44
+ export declare class DetachedFieldIndex implements ReadOnlyDetachedFieldIndex {
16
45
  private readonly name;
17
46
  private rootIdAllocator;
18
47
  private readonly revisionTagCodec;
@@ -46,6 +75,10 @@ export declare class DetachedFieldIndex {
46
75
  */
47
76
  constructor(name: string, rootIdAllocator: IdAllocator<ForestRootId>, revisionTagCodec: RevisionTagCodec, idCompressor: IIdCompressor, options?: CodecWriteOptions);
48
77
  clone(): DetachedFieldIndex;
78
+ /**
79
+ * Creates a restorable checkpoint of the current state of the DetachedFieldIndex.
80
+ */
81
+ createCheckpoint(): DetachedFieldIndexCheckpoint;
49
82
  entries(): Generator<{
50
83
  root: ForestRootId;
51
84
  latestRelevantRevision?: RevisionTag;
@@ -56,20 +89,8 @@ export declare class DetachedFieldIndex {
56
89
  */
57
90
  purge(): void;
58
91
  updateMajor(current: Major, updated: Major): void;
59
- /**
60
- * Returns a field key for the given ID.
61
- * This does not save the field key on the index. To do so, call {@link createEntry}.
62
- */
63
92
  toFieldKey(id: ForestRootId): FieldKey;
64
- /**
65
- * Returns the FieldKey associated with the given id.
66
- * Returns undefined if no such id is known to the index.
67
- */
68
93
  tryGetEntry(id: Delta.DetachedNodeId): ForestRootId | undefined;
69
- /**
70
- * Returns the FieldKey associated with the given id.
71
- * Fails if no such id is known to the index.
72
- */
73
94
  getEntry(id: Delta.DetachedNodeId): ForestRootId;
74
95
  /**
75
96
  * Returns the detached root IDs for all the trees that were detached or last modified by the given revision.
@@ -1 +1 @@
1
- {"version":3,"file":"detachedFieldIndex.d.ts","sourceRoot":"","sources":["../../../src/core/tree/detachedFieldIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EACN,KAAK,iBAAiB,EAItB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAS3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CA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BF;;OAEG;IACI,KAAK,IAAI,IAAI;IAKb,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,GAAG,IAAI;IAiEjD,UAAU,CAAC,EAAE,EAAE,YAAY,GAAG,QAAQ;IAItC,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,GAAG,YAAY,GAAG,SAAS;IAI/D,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,GAAG,YAAY;IAMvD;;OAEG;IACK,6BAA6B,CAAC,QAAQ,EAAE,WAAW,GAAG,QAAQ,CAAC,YAAY,CAAC;IAOpF;;OAEG;IACI,gCAAgC,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI;IAiB7D,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,GAAG,IAAI;IAWtD;;;;;;;OAOG;IACI,WAAW,CACjB,MAAM,CAAC,EAAE,KAAK,CAAC,cAAc,EAC7B,QAAQ,CAAC,EAAE,WAAW,EACtB,KAAK,GAAE,MAAU,GACf,YAAY;IAsBf;;OAEG;IACI,oBAAoB,CAC1B,EAAE,EAAE,KAAK,CAAC,cAAc,EACxB,QAAQ,EAAE,WAAW,GAAG,SAAS,GAC/B,IAAI;IAmBA,MAAM,IAAI,sBAAsB;IAOvC;;OAEG;IACI,QAAQ,CAAC,IAAI,EAAE,sBAAsB,GAAG,IAAI;IAmBnD;;;;OAIG;IACI,yBAAyB,CAAC,cAAc,EAAE,WAAW,GAAG,IAAI;CAqBnE"}
@@ -55,6 +55,18 @@ class DetachedFieldIndex {
55
55
  (0, index_js_2.populateNestedMap)(this.latestRelevantRevisionToFields, clone.latestRelevantRevisionToFields, true);
56
56
  return clone;
57
57
  }
58
+ /**
59
+ * Creates a restorable checkpoint of the current state of the DetachedFieldIndex.
60
+ */
61
+ createCheckpoint() {
62
+ const clone = this.clone();
63
+ return () => {
64
+ this.purge();
65
+ (0, index_js_2.populateNestedMap)(clone.detachedNodeToField, this.detachedNodeToField, true);
66
+ (0, index_js_2.populateNestedMap)(clone.latestRelevantRevisionToFields, this.latestRelevantRevisionToFields, true);
67
+ this.rootIdAllocator = (0, index_js_2.idAllocatorFromMaxId)(clone.rootIdAllocator.getMaxId());
68
+ };
69
+ }
58
70
  *entries() {
59
71
  for (const [major, innerMap] of this.detachedNodeToField) {
60
72
  if (major !== undefined) {
@@ -128,24 +140,12 @@ class DetachedFieldIndex {
128
140
  }
129
141
  }
130
142
  }
131
- /**
132
- * Returns a field key for the given ID.
133
- * This does not save the field key on the index. To do so, call {@link createEntry}.
134
- */
135
143
  toFieldKey(id) {
136
144
  return (0, index_js_2.brand)(`${this.name}-${id}`);
137
145
  }
138
- /**
139
- * Returns the FieldKey associated with the given id.
140
- * Returns undefined if no such id is known to the index.
141
- */
142
146
  tryGetEntry(id) {
143
147
  return (0, index_js_2.tryGetFromNestedMap)(this.detachedNodeToField, id.major, id.minor)?.root;
144
148
  }
145
- /**
146
- * Returns the FieldKey associated with the given id.
147
- * Fails if no such id is known to the index.
148
- */
149
149
  getEntry(id) {
150
150
  const key = this.tryGetEntry(id);
151
151
  (0, internal_1.assert)(key !== undefined, 0x7aa /* Unknown removed node ID */);