@fluidframework/tree 2.110.0 → 2.111.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 (374) hide show
  1. package/.vscode/settings.json +1 -0
  2. package/CHANGELOG.md +48 -0
  3. package/api-report/tree.alpha.api.md +48 -31
  4. package/api-report/tree.beta.api.md +38 -0
  5. package/api-report/tree.legacy.beta.api.md +38 -0
  6. package/dist/core/change-family/changeFamily.d.ts +3 -10
  7. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  8. package/dist/core/change-family/changeFamily.js.map +1 -1
  9. package/dist/core/rebase/types.d.ts +2 -2
  10. package/dist/core/rebase/types.js.map +1 -1
  11. package/dist/core/schema-stored/storedSchemaRepository.d.ts +2 -2
  12. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  13. package/dist/entrypoints/alpha.d.ts +1 -1
  14. package/dist/entrypoints/alpha.d.ts.map +1 -1
  15. package/dist/entrypoints/alpha.js.map +1 -1
  16. package/dist/entrypoints/beta.d.ts +1 -1
  17. package/dist/entrypoints/beta.d.ts.map +1 -1
  18. package/dist/entrypoints/beta.js.map +1 -1
  19. package/dist/entrypoints/legacy.d.ts +1 -1
  20. package/dist/entrypoints/legacy.d.ts.map +1 -1
  21. package/dist/entrypoints/legacy.js.map +1 -1
  22. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
  23. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  24. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +13 -32
  25. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  26. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
  27. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  28. package/dist/feature-libraries/chunked-forest/codec/codecs.js +83 -9
  29. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  30. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
  31. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  32. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +11 -0
  33. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  34. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  35. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  36. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
  37. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  38. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
  39. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  40. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
  41. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  42. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  43. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  44. package/dist/feature-libraries/chunked-forest/index.js +2 -1
  45. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  46. package/dist/feature-libraries/forest-summary/codec.d.ts +3 -3
  47. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  48. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  49. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
  50. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  51. package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -6
  52. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  53. package/dist/feature-libraries/index.d.ts +1 -1
  54. package/dist/feature-libraries/index.d.ts.map +1 -1
  55. package/dist/feature-libraries/index.js +2 -1
  56. package/dist/feature-libraries/index.js.map +1 -1
  57. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  58. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +9 -9
  59. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  60. package/dist/index.d.ts +2 -2
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.js +2 -1
  63. package/dist/index.js.map +1 -1
  64. package/dist/packageVersion.d.ts +1 -1
  65. package/dist/packageVersion.js +1 -1
  66. package/dist/packageVersion.js.map +1 -1
  67. package/dist/shared-tree/independentView.d.ts.map +1 -1
  68. package/dist/shared-tree/independentView.js +4 -7
  69. package/dist/shared-tree/independentView.js.map +1 -1
  70. package/dist/shared-tree/index.d.ts +1 -1
  71. package/dist/shared-tree/index.d.ts.map +1 -1
  72. package/dist/shared-tree/index.js.map +1 -1
  73. package/dist/shared-tree/schematizingTreeView.d.ts +5 -5
  74. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  75. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  76. package/dist/shared-tree/sharedTree.d.ts +5 -0
  77. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  78. package/dist/shared-tree/sharedTree.js +7 -4
  79. package/dist/shared-tree/sharedTree.js.map +1 -1
  80. package/dist/shared-tree/transactionPostProcessor.d.ts +28 -0
  81. package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -0
  82. package/dist/shared-tree/transactionPostProcessor.js +28 -0
  83. package/dist/shared-tree/transactionPostProcessor.js.map +1 -0
  84. package/dist/shared-tree/treeAlpha.js +3 -3
  85. package/dist/shared-tree/treeAlpha.js.map +1 -1
  86. package/dist/shared-tree/treeCheckout.d.ts +16 -12
  87. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  88. package/dist/shared-tree/treeCheckout.js +18 -9
  89. package/dist/shared-tree/treeCheckout.js.map +1 -1
  90. package/dist/shared-tree/unhydratedTreeContext.d.ts +5 -5
  91. package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
  92. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  93. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -2
  94. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  95. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  96. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
  97. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  98. package/dist/shared-tree-core/editManagerCodecsCommons.js +2 -4
  99. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  100. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
  101. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  102. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  103. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
  104. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  105. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  106. package/dist/shared-tree-core/editManagerSummarizer.d.ts +5 -9
  107. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  108. package/dist/shared-tree-core/editManagerSummarizer.js +5 -10
  109. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  110. package/dist/shared-tree-core/index.d.ts +1 -1
  111. package/dist/shared-tree-core/index.d.ts.map +1 -1
  112. package/dist/shared-tree-core/index.js +3 -2
  113. package/dist/shared-tree-core/index.js.map +1 -1
  114. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  115. package/dist/shared-tree-core/sharedTreeCore.js +3 -1
  116. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  117. package/dist/shared-tree-core/transaction.d.ts +84 -9
  118. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  119. package/dist/shared-tree-core/transaction.js +74 -7
  120. package/dist/shared-tree-core/transaction.js.map +1 -1
  121. package/dist/simple-tree/api/index.d.ts +1 -1
  122. package/dist/simple-tree/api/index.d.ts.map +1 -1
  123. package/dist/simple-tree/api/index.js.map +1 -1
  124. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
  125. package/dist/simple-tree/api/schemaCreationUtilities.js +3 -3
  126. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  127. package/dist/simple-tree/api/schemaFactory.d.ts +1 -1
  128. package/dist/simple-tree/api/schemaFactory.js +2 -2
  129. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  130. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
  131. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  132. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  133. package/dist/simple-tree/api/transactionTypes.d.ts +91 -28
  134. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  135. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  136. package/dist/simple-tree/api/tree.d.ts +86 -22
  137. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  138. package/dist/simple-tree/api/tree.js.map +1 -1
  139. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  140. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  141. package/dist/simple-tree/core/treeNodeSchema.d.ts +7 -7
  142. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  143. package/dist/simple-tree/index.d.ts +1 -1
  144. package/dist/simple-tree/index.d.ts.map +1 -1
  145. package/dist/simple-tree/index.js.map +1 -1
  146. package/dist/text/index.d.ts +1 -0
  147. package/dist/text/index.d.ts.map +1 -1
  148. package/dist/text/index.js +3 -1
  149. package/dist/text/index.js.map +1 -1
  150. package/dist/text/textDomainFormatted.d.ts +69 -758
  151. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  152. package/dist/text/textDomainFormatted.js +275 -322
  153. package/dist/text/textDomainFormatted.js.map +1 -1
  154. package/dist/text/textDomainFormattedDefault.d.ts +273 -0
  155. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -0
  156. package/dist/text/textDomainFormattedDefault.js +94 -0
  157. package/dist/text/textDomainFormattedDefault.js.map +1 -0
  158. package/dist/util/compressedIds.d.ts +118 -0
  159. package/dist/util/compressedIds.d.ts.map +1 -0
  160. package/dist/util/compressedIds.js +133 -0
  161. package/dist/util/compressedIds.js.map +1 -0
  162. package/dist/util/index.d.ts +1 -0
  163. package/dist/util/index.d.ts.map +1 -1
  164. package/dist/util/index.js +9 -1
  165. package/dist/util/index.js.map +1 -1
  166. package/lib/core/change-family/changeFamily.d.ts +3 -10
  167. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  168. package/lib/core/change-family/changeFamily.js.map +1 -1
  169. package/lib/core/rebase/types.d.ts +2 -2
  170. package/lib/core/rebase/types.js.map +1 -1
  171. package/lib/core/schema-stored/storedSchemaRepository.d.ts +2 -2
  172. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  173. package/lib/entrypoints/alpha.d.ts +1 -1
  174. package/lib/entrypoints/alpha.d.ts.map +1 -1
  175. package/lib/entrypoints/alpha.js.map +1 -1
  176. package/lib/entrypoints/beta.d.ts +1 -1
  177. package/lib/entrypoints/beta.d.ts.map +1 -1
  178. package/lib/entrypoints/beta.js.map +1 -1
  179. package/lib/entrypoints/legacy.d.ts +1 -1
  180. package/lib/entrypoints/legacy.d.ts.map +1 -1
  181. package/lib/entrypoints/legacy.js.map +1 -1
  182. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
  183. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  184. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +14 -33
  185. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  186. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
  187. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  188. package/lib/feature-libraries/chunked-forest/codec/codecs.js +82 -9
  189. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  190. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
  191. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  192. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +12 -1
  193. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  194. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  195. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  196. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  197. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  198. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
  199. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  200. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
  201. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  202. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  203. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  204. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  205. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  206. package/lib/feature-libraries/forest-summary/codec.d.ts +3 -3
  207. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  208. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  209. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
  210. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  211. package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -6
  212. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  213. package/lib/feature-libraries/index.d.ts +1 -1
  214. package/lib/feature-libraries/index.d.ts.map +1 -1
  215. package/lib/feature-libraries/index.js +1 -1
  216. package/lib/feature-libraries/index.js.map +1 -1
  217. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  218. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +10 -10
  219. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  220. package/lib/index.d.ts +2 -2
  221. package/lib/index.d.ts.map +1 -1
  222. package/lib/index.js +1 -1
  223. package/lib/index.js.map +1 -1
  224. package/lib/packageVersion.d.ts +1 -1
  225. package/lib/packageVersion.js +1 -1
  226. package/lib/packageVersion.js.map +1 -1
  227. package/lib/shared-tree/independentView.d.ts.map +1 -1
  228. package/lib/shared-tree/independentView.js +5 -8
  229. package/lib/shared-tree/independentView.js.map +1 -1
  230. package/lib/shared-tree/index.d.ts +1 -1
  231. package/lib/shared-tree/index.d.ts.map +1 -1
  232. package/lib/shared-tree/index.js.map +1 -1
  233. package/lib/shared-tree/schematizingTreeView.d.ts +5 -5
  234. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  235. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  236. package/lib/shared-tree/sharedTree.d.ts +5 -0
  237. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  238. package/lib/shared-tree/sharedTree.js +8 -5
  239. package/lib/shared-tree/sharedTree.js.map +1 -1
  240. package/lib/shared-tree/transactionPostProcessor.d.ts +28 -0
  241. package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -0
  242. package/lib/shared-tree/transactionPostProcessor.js +23 -0
  243. package/lib/shared-tree/transactionPostProcessor.js.map +1 -0
  244. package/lib/shared-tree/treeAlpha.js +3 -3
  245. package/lib/shared-tree/treeAlpha.js.map +1 -1
  246. package/lib/shared-tree/treeCheckout.d.ts +16 -12
  247. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  248. package/lib/shared-tree/treeCheckout.js +18 -9
  249. package/lib/shared-tree/treeCheckout.js.map +1 -1
  250. package/lib/shared-tree/unhydratedTreeContext.d.ts +5 -5
  251. package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
  252. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  253. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -2
  254. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  255. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  256. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
  257. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  258. package/lib/shared-tree-core/editManagerCodecsCommons.js +3 -5
  259. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  260. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
  261. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  262. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  263. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
  264. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  265. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  266. package/lib/shared-tree-core/editManagerSummarizer.d.ts +5 -9
  267. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  268. package/lib/shared-tree-core/editManagerSummarizer.js +5 -10
  269. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  270. package/lib/shared-tree-core/index.d.ts +1 -1
  271. package/lib/shared-tree-core/index.d.ts.map +1 -1
  272. package/lib/shared-tree-core/index.js +1 -1
  273. package/lib/shared-tree-core/index.js.map +1 -1
  274. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  275. package/lib/shared-tree-core/sharedTreeCore.js +3 -1
  276. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  277. package/lib/shared-tree-core/transaction.d.ts +84 -9
  278. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  279. package/lib/shared-tree-core/transaction.js +73 -6
  280. package/lib/shared-tree-core/transaction.js.map +1 -1
  281. package/lib/simple-tree/api/index.d.ts +1 -1
  282. package/lib/simple-tree/api/index.d.ts.map +1 -1
  283. package/lib/simple-tree/api/index.js.map +1 -1
  284. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
  285. package/lib/simple-tree/api/schemaCreationUtilities.js +3 -3
  286. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  287. package/lib/simple-tree/api/schemaFactory.d.ts +1 -1
  288. package/lib/simple-tree/api/schemaFactory.js +2 -2
  289. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  290. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
  291. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  292. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  293. package/lib/simple-tree/api/transactionTypes.d.ts +91 -28
  294. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  295. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  296. package/lib/simple-tree/api/tree.d.ts +86 -22
  297. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  298. package/lib/simple-tree/api/tree.js.map +1 -1
  299. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  300. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  301. package/lib/simple-tree/core/treeNodeSchema.d.ts +7 -7
  302. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  303. package/lib/simple-tree/index.d.ts +1 -1
  304. package/lib/simple-tree/index.d.ts.map +1 -1
  305. package/lib/simple-tree/index.js.map +1 -1
  306. package/lib/text/index.d.ts +1 -0
  307. package/lib/text/index.d.ts.map +1 -1
  308. package/lib/text/index.js +1 -0
  309. package/lib/text/index.js.map +1 -1
  310. package/lib/text/textDomainFormatted.d.ts +69 -758
  311. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  312. package/lib/text/textDomainFormatted.js +277 -324
  313. package/lib/text/textDomainFormatted.js.map +1 -1
  314. package/lib/text/textDomainFormattedDefault.d.ts +273 -0
  315. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -0
  316. package/lib/text/textDomainFormattedDefault.js +91 -0
  317. package/lib/text/textDomainFormattedDefault.js.map +1 -0
  318. package/lib/util/compressedIds.d.ts +118 -0
  319. package/lib/util/compressedIds.d.ts.map +1 -0
  320. package/lib/util/compressedIds.js +124 -0
  321. package/lib/util/compressedIds.js.map +1 -0
  322. package/lib/util/index.d.ts +1 -0
  323. package/lib/util/index.d.ts.map +1 -1
  324. package/lib/util/index.js +1 -0
  325. package/lib/util/index.js.map +1 -1
  326. package/package.json +23 -23
  327. package/src/core/change-family/changeFamily.ts +3 -12
  328. package/src/core/rebase/types.ts +2 -2
  329. package/src/core/schema-stored/storedSchemaRepository.ts +2 -2
  330. package/src/entrypoints/alpha.ts +12 -8
  331. package/src/entrypoints/beta.ts +8 -0
  332. package/src/entrypoints/legacy.ts +8 -0
  333. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +35 -64
  334. package/src/feature-libraries/chunked-forest/codec/codecs.ts +138 -42
  335. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +32 -4
  336. package/src/feature-libraries/chunked-forest/codec/index.ts +1 -0
  337. package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +7 -19
  338. package/src/feature-libraries/chunked-forest/index.ts +3 -0
  339. package/src/feature-libraries/forest-summary/codec.ts +5 -3
  340. package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -5
  341. package/src/feature-libraries/index.ts +3 -0
  342. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +13 -9
  343. package/src/index.ts +13 -8
  344. package/src/packageVersion.ts +1 -1
  345. package/src/shared-tree/independentView.ts +5 -10
  346. package/src/shared-tree/index.ts +1 -0
  347. package/src/shared-tree/schematizingTreeView.ts +25 -25
  348. package/src/shared-tree/sharedTree.ts +16 -4
  349. package/src/shared-tree/transactionPostProcessor.ts +40 -0
  350. package/src/shared-tree/treeAlpha.ts +3 -3
  351. package/src/shared-tree/treeCheckout.ts +61 -44
  352. package/src/shared-tree/unhydratedTreeContext.ts +18 -15
  353. package/src/shared-tree-core/editManagerCodecs.ts +3 -2
  354. package/src/shared-tree-core/editManagerCodecsCommons.ts +10 -14
  355. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -2
  356. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -2
  357. package/src/shared-tree-core/editManagerSummarizer.ts +5 -9
  358. package/src/shared-tree-core/index.ts +8 -5
  359. package/src/shared-tree-core/sharedTreeCore.ts +3 -2
  360. package/src/shared-tree-core/transaction.ts +148 -18
  361. package/src/simple-tree/api/index.ts +13 -9
  362. package/src/simple-tree/api/schemaCreationUtilities.ts +3 -3
  363. package/src/simple-tree/api/schemaFactory.ts +2 -2
  364. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +2 -2
  365. package/src/simple-tree/api/transactionTypes.ts +111 -39
  366. package/src/simple-tree/api/tree.ts +141 -47
  367. package/src/simple-tree/api/treeBeta.ts +2 -0
  368. package/src/simple-tree/core/treeNodeSchema.ts +7 -7
  369. package/src/simple-tree/index.ts +12 -8
  370. package/src/text/index.ts +1 -0
  371. package/src/text/textDomainFormatted.ts +520 -415
  372. package/src/text/textDomainFormattedDefault.ts +150 -0
  373. package/src/util/compressedIds.ts +216 -0
  374. package/src/util/index.ts +15 -0
package/src/index.ts CHANGED
@@ -273,17 +273,21 @@ export {
273
273
  type NodeSchemaMetadata,
274
274
  type SchemaStatics,
275
275
  type ITreeAlpha,
276
+ type NoChangeConstraint,
277
+ type NodeInDocumentConstraint,
278
+ type RunTransactionParamsAlpha,
279
+ type RunTransactionParamsBeta,
280
+ type TransactionCallbackStatusAlpha,
281
+ type TransactionCallbackStatusBeta,
276
282
  type TransactionConstraint,
277
283
  type TransactionConstraintAlpha,
278
- type NodeInDocumentConstraint,
279
- type NoChangeConstraint,
280
- type RunTransactionParams,
281
- type VoidTransactionCallbackStatus,
282
- type TransactionCallbackStatus,
283
- type TransactionResult,
284
- type TransactionResultExt,
285
- type TransactionResultSuccess,
284
+ type TransactionPostProcessor,
286
285
  type TransactionResultFailed,
286
+ type TransactionResultSuccess,
287
+ type TransactionValueResult,
288
+ type TransactionVoidResult,
289
+ type VoidTransactionCallbackStatusAlpha,
290
+ type VoidTransactionCallbackStatusBeta,
287
291
  rollback,
288
292
  generateSchemaFromSimpleSchema,
289
293
  evaluateLazySchema,
@@ -406,6 +410,7 @@ export { asAlpha, asBeta } from "./api.js";
406
410
  export {
407
411
  TextAsTree,
408
412
  FormattedTextAsTree,
413
+ FormattedTextAsTreeDefault,
409
414
  codePointCount,
410
415
  utf16LengthForCodePoints,
411
416
  } from "./text/index.js";
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/tree";
9
- export const pkgVersion = "2.110.0";
9
+ export const pkgVersion = "2.111.0";
@@ -19,9 +19,7 @@ import {
19
19
  import {
20
20
  createNodeIdentifierManager,
21
21
  fieldBatchCodecBuilder,
22
- type FieldBatchEncodingContext,
23
- defaultSchemaPolicy,
24
- TreeCompressionStrategy,
22
+ FieldBatchDecodingContext,
25
23
  defaultIncrementalEncodingPolicy,
26
24
  schemaCodecBuilder,
27
25
  } from "../feature-libraries/index.js";
@@ -233,14 +231,11 @@ export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSc
233
231
  const fieldBatchCodec = fieldBatchCodecBuilder.buildDecoder(options);
234
232
  const newSchema = schemaCodec.decode(options.content.schema);
235
233
 
236
- const context: FieldBatchEncodingContext = {
237
- encodeType: TreeCompressionStrategy.Compressed,
234
+ // TreeAlpha.exportCompressed encodes this payload in originatorless-safe form
235
+ // (finalized compressed ids or strings), so summary-style decode is correct.
236
+ const context = FieldBatchDecodingContext.forSummary({
238
237
  idCompressor,
239
- originatorId: idCompressor.localSessionId, // Is this right? If so, why is is needed?
240
- schema: { schema: newSchema, policy: defaultSchemaPolicy },
241
- // Not a summary blob — this is a synthetic decode of inline content.
242
- isSummary: false,
243
- };
238
+ });
244
239
  const fieldCursors = fieldBatchCodec.decode(
245
240
  options.content.tree as JsonCompatibleReadOnly,
246
241
  context,
@@ -30,6 +30,7 @@ export {
30
30
  TreeCheckout,
31
31
  type ITreeCheckout,
32
32
  type CheckoutEvents,
33
+ type TreeTransactor,
33
34
  } from "./treeCheckout.js";
34
35
 
35
36
  export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
@@ -41,11 +41,11 @@ import {
41
41
  type ReadSchema,
42
42
  type UnsafeUnknownSchema,
43
43
  type TreeBranchEvents,
44
- type VoidTransactionCallbackStatus,
45
- type TransactionCallbackStatus,
46
- type TransactionResult,
47
- type TransactionResultExt,
48
- type RunTransactionParams,
44
+ type VoidTransactionCallbackStatusAlpha,
45
+ type TransactionCallbackStatusAlpha,
46
+ type TransactionVoidResult,
47
+ type TransactionValueResult,
48
+ type RunTransactionParamsAlpha,
49
49
  HydratedContext,
50
50
  SimpleContextSlot,
51
51
  areImplicitFieldSchemaEqual,
@@ -272,40 +272,40 @@ export class SchematizingSimpleTreeView<
272
272
  }
273
273
 
274
274
  public runTransaction<TSuccessValue, TFailureValue>(
275
- transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>,
276
- params?: RunTransactionParams,
277
- ): TransactionResultExt<TSuccessValue, TFailureValue>;
275
+ transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>,
276
+ params?: RunTransactionParamsAlpha,
277
+ ): TransactionValueResult<TSuccessValue, TFailureValue>;
278
278
  public runTransaction(
279
- transaction: () => VoidTransactionCallbackStatus | void,
280
- params?: RunTransactionParams,
281
- ): TransactionResult;
279
+ transaction: () => VoidTransactionCallbackStatusAlpha | void,
280
+ params?: RunTransactionParamsAlpha,
281
+ ): TransactionVoidResult;
282
282
  public runTransaction<TSuccessValue, TFailureValue>(
283
283
  transaction: () =>
284
- | TransactionCallbackStatus<TSuccessValue, TFailureValue>
285
- | VoidTransactionCallbackStatus
284
+ | TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
285
+ | VoidTransactionCallbackStatusAlpha
286
286
  | void,
287
- params?: RunTransactionParams,
288
- ): TransactionResultExt<TSuccessValue, TFailureValue> | TransactionResult {
287
+ params?: RunTransactionParamsAlpha,
288
+ ): TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult {
289
289
  this.ensureUndisposed();
290
290
  return this.checkout.runTransaction(transaction, params);
291
291
  }
292
292
 
293
293
  public runTransactionAsync<TSuccessValue, TFailureValue>(
294
- transaction: () => Promise<TransactionCallbackStatus<TSuccessValue, TFailureValue>>,
295
- params?: RunTransactionParams,
296
- ): Promise<TransactionResultExt<TSuccessValue, TFailureValue>>;
294
+ transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>,
295
+ params?: RunTransactionParamsAlpha,
296
+ ): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
297
297
  public runTransactionAsync(
298
- transaction: () => Promise<VoidTransactionCallbackStatus | void>,
299
- params?: RunTransactionParams,
300
- ): Promise<TransactionResult>;
298
+ transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>,
299
+ params?: RunTransactionParamsAlpha,
300
+ ): Promise<TransactionVoidResult>;
301
301
  public async runTransactionAsync<TSuccessValue, TFailureValue>(
302
302
  transaction: () => Promise<
303
- | TransactionCallbackStatus<TSuccessValue, TFailureValue>
304
- | VoidTransactionCallbackStatus
303
+ | TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
304
+ | VoidTransactionCallbackStatusAlpha
305
305
  | void
306
306
  >,
307
- params: RunTransactionParams | undefined,
308
- ): Promise<TransactionResultExt<TSuccessValue, TFailureValue> | TransactionResult> {
307
+ params: RunTransactionParamsAlpha | undefined,
308
+ ): Promise<TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult> {
309
309
  this.ensureUndisposed();
310
310
  if (this.checkout.transaction.size > 0) {
311
311
  // breaker.break() sets brokenBy synchronously before throwing.
@@ -45,6 +45,7 @@ import {
45
45
  } from "../core/index.js";
46
46
  import {
47
47
  DetachedFieldIndexSummarizer,
48
+ FieldBatchDecodingContext,
48
49
  FieldKinds,
49
50
  ForestSummarizer,
50
51
  SchemaSummarizer,
@@ -58,6 +59,7 @@ import {
58
59
  jsonableTreeFromFieldCursor,
59
60
  makeMitigatedChangeFamily,
60
61
  makeTreeChunker,
62
+ type FieldBatchEncodingContext,
61
63
  type IncrementalEncodingPolicy,
62
64
  } from "../feature-libraries/index.js";
63
65
  import { schemaCodecBuilder } from "../feature-libraries/index.js";
@@ -235,24 +237,29 @@ export class SharedTreeKernel
235
237
  );
236
238
  const fieldBatchCodec = fieldBatchCodecBuilder.build(options);
237
239
 
238
- const encoderContext = {
240
+ const encoderContext: FieldBatchEncodingContext = {
239
241
  schema: {
240
242
  schema,
241
243
  policy: defaultSchemaPolicy,
242
244
  },
243
245
  encodeType: options.treeEncodeType,
244
- originatorId: idCompressor.localSessionId,
245
246
  idCompressor,
246
247
  // ForestSummarizer is the only consumer of this context, and it
247
248
  // only invokes the codec in summary encode / load paths.
248
249
  isSummary: true,
249
- healUnresolvableIdentifiersOnDecode: options.healUnresolvableIdentifiersOnDecode,
250
- sharedObjectId: sharedObject.id,
251
250
  };
251
+ const decoderContext = FieldBatchDecodingContext.forSummary({
252
+ idCompressor,
253
+ healing:
254
+ options.healUnresolvableIdentifiersOnDecode === true
255
+ ? { sharedObjectId: sharedObject.id }
256
+ : undefined,
257
+ });
252
258
  const forestSummarizer = new ForestSummarizer(
253
259
  forest,
254
260
  revisionTagCodec,
255
261
  encoderContext,
262
+ decoderContext,
256
263
  options,
257
264
  idCompressor,
258
265
  initialSequenceNumber,
@@ -603,6 +610,11 @@ export interface SharedTreeOptionsBeta extends ForestOptions, Partial<CodecWrite
603
610
  * "Unresolvable" in the public-facing remarks corresponds to non-finalized short IDs persisted without
604
611
  * any corresponding context for their originating session. See id-compressor internal documentation
605
612
  * for more details.
613
+ *
614
+ * Internally this boolean is translated into {@link IdentifierHealingConfig} once the shared-object
615
+ * id is known (in `SharedTreeCore`'s constructor) and threaded through the codec contexts as a
616
+ * single `healing?` field from there on. The presence/absence of that config is the heal-on/heal-off
617
+ * discriminator inside the codec layer.
606
618
  */
607
619
  readonly healUnresolvableIdentifiersOnDecode?: boolean;
608
620
  }
@@ -0,0 +1,40 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import type { ChangeProcessor } from "../shared-tree-core/index.js";
7
+ import type { TransactionPostProcessor } from "../simple-tree/index.js";
8
+
9
+ import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
10
+
11
+ /**
12
+ * The internal representation of a {@link TransactionPostProcessor}: a {@link ChangeProcessor} over
13
+ * {@link SharedTreeChange}.
14
+ * @remarks This is the (non-type-erased) form used internally to apply a transaction's post-processor.
15
+ */
16
+ export type TransactionPostProcessorInternal = ChangeProcessor<SharedTreeChange>;
17
+
18
+ /**
19
+ * Type-erases an internal {@link TransactionPostProcessorInternal | change processor} as a public
20
+ * {@link TransactionPostProcessor}.
21
+ * @remarks This is the only sanctioned way to produce a {@link TransactionPostProcessor}. The inverse conversion is
22
+ * {@link extractTransactionChangeProcessor}.
23
+ */
24
+ export function createTransactionPostProcessor(
25
+ processor: TransactionPostProcessorInternal,
26
+ ): TransactionPostProcessor {
27
+ return processor as unknown as TransactionPostProcessor;
28
+ }
29
+
30
+ /**
31
+ * Recovers the internal {@link TransactionPostProcessorInternal | change processor} from a type-erased
32
+ * {@link TransactionPostProcessor}.
33
+ * @remarks This reverses {@link createTransactionPostProcessor}. It is assumed that only code which produces these
34
+ * type-erased handles performs this conversion, allowing them to be treated as opaque elsewhere.
35
+ */
36
+ export function extractTransactionChangeProcessor(
37
+ postProcessor: TransactionPostProcessor | undefined,
38
+ ): TransactionPostProcessorInternal | undefined {
39
+ return postProcessor as unknown as TransactionPostProcessorInternal;
40
+ }
@@ -952,10 +952,10 @@ export const TreeAlpha: TreeAlpha = {
952
952
  const context: FieldBatchEncodingContext = {
953
953
  encodeType: TreeCompressionStrategy.Compressed,
954
954
  idCompressor,
955
- originatorId: idCompressor.localSessionId, // TODO: Why is this needed?
956
955
  schema: { schema: storedSchema, policy: defaultSchemaPolicy },
957
- // Not a summary blob this is `TreeAlpha`'s ad-hoc encoder.
958
- isSummary: false,
956
+ // Encode using summary-style identifier rules so the payload can be decoded
957
+ // without any originator session context.
958
+ isSummary: true,
959
959
  };
960
960
  const result = codec.encode(batch, context);
961
961
  // TODO: codecs should better track which ones can contain handles, and which cannot. When done properly, casts like this can be removed.
@@ -76,6 +76,7 @@ import {
76
76
  SharedTreeBranch,
77
77
  TransactionResult as InternalTransactionResult,
78
78
  type SharedTreeBranchChange,
79
+ type SquashingTransactionOptions,
79
80
  type Transactor,
80
81
  } from "../shared-tree-core/index.js";
81
82
  import {
@@ -88,11 +89,11 @@ import {
88
89
  type TreeBranch,
89
90
  type TreeBranchAlpha,
90
91
  type VerboseTree,
91
- type VoidTransactionCallbackStatus,
92
- type TransactionCallbackStatus,
93
- type TransactionResult,
94
- type TransactionResultExt,
95
- type RunTransactionParams,
92
+ type VoidTransactionCallbackStatusAlpha,
93
+ type TransactionCallbackStatusAlpha,
94
+ type TransactionVoidResult,
95
+ type TransactionValueResult,
96
+ type RunTransactionParamsAlpha,
96
97
  type TransactionConstraintAlpha,
97
98
  type TreeViewAlpha,
98
99
  getInnerNode,
@@ -117,6 +118,7 @@ import { SharedTreeChangeEnricher } from "./sharedTreeChangeEnricher.js";
117
118
  import { SharedTreeChangeFamily, hasSchemaChange } from "./sharedTreeChangeFamily.js";
118
119
  import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
119
120
  import type { ISharedTreeEditor, SharedTreeEditBuilder } from "./sharedTreeEditBuilder.js";
121
+ import { extractTransactionChangeProcessor } from "./transactionPostProcessor.js";
120
122
 
121
123
  /**
122
124
  * Yields all defined (non-`undefined`) labels from a {@link LabelTree}, depth-first.
@@ -205,6 +207,11 @@ export interface CheckoutEvents {
205
207
  dispose(): void;
206
208
  }
207
209
 
210
+ /**
211
+ * A collection of functions for managing transactions on a {@link ITreeCheckout}.
212
+ */
213
+ export type TreeTransactor = Transactor<SquashingTransactionOptions<SharedTreeChange>>;
214
+
208
215
  /**
209
216
  * Provides a means for interacting with a SharedTree.
210
217
  * This includes reading data from the tree and running transactions to mutate the tree.
@@ -251,13 +258,13 @@ export interface ITreeCheckout
251
258
  /**
252
259
  * A collection of functions for managing transactions.
253
260
  */
254
- readonly transaction: Transactor;
261
+ readonly transaction: TreeTransactor;
255
262
 
256
263
  fork(): ITreeCheckout;
257
264
 
258
265
  /**
259
- * Replaces all schema with the provided schema.
260
- * Can over-write preexisting schema, and removes unmentioned schema.
266
+ * Replaces all schemas with the provided schema.
267
+ * Can overwrite preexisting schemas, and removes unmentioned schemas.
261
268
  *
262
269
  * @param newSchema - The new schema to replace the existing schema.
263
270
  * @param allowNonSupersetSchema - Whether to allow non-superset schemas.
@@ -390,7 +397,7 @@ function getCheckout(context: TreeBranch): TreeCheckout {
390
397
  * @param constraintsOnRevert - If true, use {@link ISharedTreeEditor.addNodeExistsConstraintOnRevert}.
391
398
  * @param constraints - The constraints to add to the transaction.
392
399
  *
393
- * @see {@link RunTransactionParams.preconditions}.
400
+ * @see {@link RunTransactionParamsAlpha.preconditions}.
394
401
  */
395
402
  export function addConstraintsToTransaction(
396
403
  checkout: ITreeCheckout,
@@ -483,9 +490,9 @@ export class TreeCheckout implements ITreeCheckout {
483
490
  private readonly views = new Set<TreeView<ImplicitFieldSchema>>();
484
491
 
485
492
  /**
486
- * Set of revertibles maintained for automatic disposal
493
+ * Revertibles maintained for automatic disposal
487
494
  */
488
- private readonly revertibles = new Set<RevertibleAlpha>();
495
+ private readonly revertibles = new Map<RevisionTag, RevertibleAlpha>();
489
496
 
490
497
  /**
491
498
  * Each branch's head commit corresponds to a revertible commit.
@@ -746,7 +753,7 @@ export class TreeCheckout implements ITreeCheckout {
746
753
  revision,
747
754
  this.#transaction.activeBranch.fork(commit),
748
755
  );
749
- this.revertibles.add(revertible);
756
+ this.revertibles.set(revision, revertible);
750
757
  return revertible;
751
758
  };
752
759
 
@@ -785,6 +792,11 @@ export class TreeCheckout implements ITreeCheckout {
785
792
  });
786
793
  withinEventContext = false;
787
794
  }
795
+ } else if (event.type === "remove") {
796
+ // Commits that are rolled back should no longer be revertible
797
+ for (const commit of event.removedCommits) {
798
+ this.revertibles.get(commit.revision)?.dispose();
799
+ }
788
800
  } else if (this.isRemoteChangeEvent(event)) {
789
801
  // TODO: figure out how to plumb through commit kind info for remote changes
790
802
  this.emitChangedLocked(() => {
@@ -885,49 +897,52 @@ export class TreeCheckout implements ITreeCheckout {
885
897
  }
886
898
 
887
899
  public runTransaction<TSuccessValue, TFailureValue>(
888
- transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>,
889
- params?: RunTransactionParams,
890
- ): TransactionResultExt<TSuccessValue, TFailureValue>;
900
+ transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>,
901
+ params?: RunTransactionParamsAlpha,
902
+ ): TransactionValueResult<TSuccessValue, TFailureValue>;
891
903
  public runTransaction(
892
- transaction: () => VoidTransactionCallbackStatus | void,
893
- params?: RunTransactionParams,
894
- ): TransactionResult;
904
+ transaction: () => VoidTransactionCallbackStatusAlpha | void,
905
+ params?: RunTransactionParamsAlpha,
906
+ ): TransactionVoidResult;
895
907
  @breakingMethod
896
908
  public runTransaction<TSuccessValue, TFailureValue>(
897
909
  transaction: () =>
898
- | TransactionCallbackStatus<TSuccessValue, TFailureValue>
899
- | VoidTransactionCallbackStatus
910
+ | TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
911
+ | VoidTransactionCallbackStatusAlpha
900
912
  | void,
901
- params?: RunTransactionParams,
902
- ): TransactionResultExt<TSuccessValue, TFailureValue> | TransactionResult {
913
+ params?: RunTransactionParamsAlpha,
914
+ ): TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult {
903
915
  this.mountTransaction(params, false);
904
916
  const transactionCallbackStatus = transaction();
905
917
  return this.unmountTransaction(transactionCallbackStatus, params);
906
918
  }
907
919
 
908
920
  public runTransactionAsync<TSuccessValue, TFailureValue>(
909
- transaction: () => Promise<TransactionCallbackStatus<TSuccessValue, TFailureValue>>,
910
- params?: RunTransactionParams,
911
- ): Promise<TransactionResultExt<TSuccessValue, TFailureValue>>;
921
+ transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>,
922
+ params?: RunTransactionParamsAlpha,
923
+ ): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
912
924
  public runTransactionAsync(
913
- transaction: () => Promise<VoidTransactionCallbackStatus | void>,
914
- params?: RunTransactionParams,
915
- ): Promise<TransactionResult>;
925
+ transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>,
926
+ params?: RunTransactionParamsAlpha,
927
+ ): Promise<TransactionVoidResult>;
916
928
  @breakingMethod
917
929
  public async runTransactionAsync<TSuccessValue, TFailureValue>(
918
930
  transaction: () => Promise<
919
- | TransactionCallbackStatus<TSuccessValue, TFailureValue>
920
- | VoidTransactionCallbackStatus
931
+ | TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
932
+ | VoidTransactionCallbackStatusAlpha
921
933
  | void
922
934
  >,
923
- params: RunTransactionParams | undefined,
924
- ): Promise<TransactionResultExt<TSuccessValue, TFailureValue> | TransactionResult> {
935
+ params: RunTransactionParamsAlpha | undefined,
936
+ ): Promise<TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult> {
925
937
  this.mountTransaction(params, true);
926
938
  const transactionCallbackStatus = await transaction();
927
939
  return this.unmountTransaction(transactionCallbackStatus, params);
928
940
  }
929
941
 
930
- private mountTransaction(params: RunTransactionParams | undefined, isAsync: boolean): void {
942
+ private mountTransaction(
943
+ params: RunTransactionParamsAlpha | undefined,
944
+ isAsync: boolean,
945
+ ): void {
931
946
  this.checkNotDisposed();
932
947
  // Starting a transaction is an edit, so it is forbidden from within a change-event
933
948
  // callback (where the edit lock is held), the same as direct edits. For the async
@@ -944,22 +959,24 @@ export class TreeCheckout implements ITreeCheckout {
944
959
  );
945
960
  }
946
961
  this.pushLabelFrame(params?.label);
947
- this.transaction.start();
962
+ this.transaction.start({
963
+ postProcessor: extractTransactionChangeProcessor(params?.postProcessor),
964
+ });
948
965
 
949
966
  addConstraintsToTransaction(this, false, params?.preconditions);
950
967
  }
951
968
 
952
969
  private unmountTransaction<TSuccessValue, TFailureValue>(
953
970
  transactionCallbackStatus:
954
- | TransactionCallbackStatus<TSuccessValue, TFailureValue>
955
- | VoidTransactionCallbackStatus
971
+ | TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
972
+ | VoidTransactionCallbackStatusAlpha
956
973
  | void,
957
- params: RunTransactionParams | undefined,
958
- ): TransactionResultExt<TSuccessValue, TFailureValue> | TransactionResult {
974
+ params: RunTransactionParamsAlpha | undefined,
975
+ ): TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult {
959
976
  this.checkNotDisposed();
960
977
  const rollback = transactionCallbackStatus?.rollback;
961
978
  const value = (
962
- transactionCallbackStatus as TransactionCallbackStatus<TSuccessValue, TFailureValue>
979
+ transactionCallbackStatus as TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
963
980
  )?.value;
964
981
 
965
982
  if (rollback === true) {
@@ -1127,7 +1144,7 @@ export class TreeCheckout implements ITreeCheckout {
1127
1144
  "Unable to dispose a revertible that has already been disposed.",
1128
1145
  );
1129
1146
  }
1130
- checkout.disposeRevertible(revertible, revision);
1147
+ checkout.disposeRevertible(revision);
1131
1148
  onRevertibleDisposed?.(revertible);
1132
1149
  },
1133
1150
  };
@@ -1175,7 +1192,7 @@ export class TreeCheckout implements ITreeCheckout {
1175
1192
  return this.forest.anchors.locate(anchor);
1176
1193
  }
1177
1194
 
1178
- public get transaction(): Transactor {
1195
+ public get transaction(): TreeTransactor {
1179
1196
  return this.#transaction;
1180
1197
  }
1181
1198
  /**
@@ -1380,15 +1397,15 @@ export class TreeCheckout implements ITreeCheckout {
1380
1397
  }
1381
1398
 
1382
1399
  private purgeRevertibles(): void {
1383
- for (const revertible of this.revertibles) {
1400
+ for (const revertible of this.revertibles.values()) {
1384
1401
  revertible.dispose();
1385
1402
  }
1386
1403
  }
1387
1404
 
1388
- private disposeRevertible(revertible: RevertibleAlpha, revision: RevisionTag): void {
1405
+ private disposeRevertible(revision: RevisionTag): void {
1389
1406
  this.revertibleCommitBranches.get(revision)?.dispose();
1390
1407
  this.revertibleCommitBranches.delete(revision);
1391
- this.revertibles.delete(revertible);
1408
+ this.revertibles.delete(revision);
1392
1409
  }
1393
1410
 
1394
1411
  private revertRevertible(
@@ -8,9 +8,9 @@ import { UsageError } from "@fluidframework/telemetry-utils/internal";
8
8
  import type {
9
9
  TreeContextAlpha,
10
10
  TreeBranchAlpha,
11
- RunTransactionParams,
12
- TransactionResult,
13
- TransactionResultExt,
11
+ RunTransactionParamsAlpha,
12
+ TransactionVoidResult,
13
+ TransactionValueResult,
14
14
  WithValue,
15
15
  } from "../simple-tree/index.js";
16
16
 
@@ -30,13 +30,16 @@ export class UnhydratedTreeContext implements TreeContextAlpha {
30
30
 
31
31
  public runTransaction<TValue>(
32
32
  t: () => WithValue<TValue>,
33
- params?: RunTransactionParams,
34
- ): TransactionResultExt<TValue, TValue>;
35
- public runTransaction(t: () => void, _params?: RunTransactionParams): TransactionResult;
33
+ params?: RunTransactionParamsAlpha,
34
+ ): TransactionValueResult<TValue, TValue>;
35
+ public runTransaction(
36
+ t: () => void,
37
+ _params?: RunTransactionParamsAlpha,
38
+ ): TransactionVoidResult;
36
39
  public runTransaction(
37
40
  t: () => WithValue<unknown> | void,
38
- params?: RunTransactionParams,
39
- ): TransactionResultExt<unknown, unknown> | TransactionResult {
41
+ params?: RunTransactionParamsAlpha,
42
+ ): TransactionValueResult<unknown, unknown> | TransactionVoidResult {
40
43
  for (const constraint of params?.preconditions ?? []) {
41
44
  assertValidConstraint(constraint, false);
42
45
  }
@@ -50,16 +53,16 @@ export class UnhydratedTreeContext implements TreeContextAlpha {
50
53
 
51
54
  public runTransactionAsync<TValue>(
52
55
  t: () => Promise<WithValue<TValue>>,
53
- params?: RunTransactionParams,
54
- ): Promise<TransactionResultExt<TValue, TValue>>;
56
+ params?: RunTransactionParamsAlpha,
57
+ ): Promise<TransactionValueResult<TValue, TValue>>;
55
58
  public runTransactionAsync(
56
59
  t: () => Promise<void>,
57
- params?: RunTransactionParams,
58
- ): Promise<TransactionResult>;
60
+ params?: RunTransactionParamsAlpha,
61
+ ): Promise<TransactionVoidResult>;
59
62
  public async runTransactionAsync(
60
63
  t: () => Promise<WithValue<unknown> | void>,
61
- params?: RunTransactionParams,
62
- ): Promise<TransactionResultExt<unknown, unknown> | TransactionResult> {
64
+ params?: RunTransactionParamsAlpha,
65
+ ): Promise<TransactionValueResult<unknown, unknown> | TransactionVoidResult> {
63
66
  if (this.transactionCount > 0) {
64
67
  throw new UsageError(
65
68
  "An asynchronous transaction cannot be started while another transaction is already in progress.",
@@ -78,7 +81,7 @@ export class UnhydratedTreeContext implements TreeContextAlpha {
78
81
 
79
82
  private static wrapTransactionResult<TValue>(
80
83
  value: WithValue<TValue> | void,
81
- ): TransactionResultExt<TValue, TValue> | TransactionResult {
84
+ ): TransactionValueResult<TValue, TValue> | TransactionVoidResult {
82
85
  if (value?.value !== undefined) {
83
86
  return { success: true, value: value.value };
84
87
  }
@@ -24,6 +24,7 @@ import type {
24
24
  RevisionTag,
25
25
  SchemaAndPolicy,
26
26
  } from "../core/index.js";
27
+ import type { IdentifierHealingConfig } from "../util/index.js";
27
28
 
28
29
  import type { SummaryData } from "./editManager.js";
29
30
  import { makeV1toV4andV6CodecWithVersion } from "./editManagerCodecsV1toV4.js";
@@ -37,8 +38,8 @@ export interface EditManagerEncodingContext {
37
38
  idCompressor: IIdCompressor;
38
39
  readonly schema?: SchemaAndPolicy;
39
40
  readonly isSummary: boolean;
40
- readonly healUnresolvableIdentifiersOnDecode?: boolean;
41
- readonly sharedObjectId?: string;
41
+ /** See {@link IdentifierHealingConfig}. */
42
+ readonly healing?: IdentifierHealingConfig;
42
43
  }
43
44
 
44
45
  /**
@@ -13,7 +13,12 @@ import type {
13
13
  RevisionTag,
14
14
  SchemaAndPolicy,
15
15
  } from "../core/index.js";
16
- import { mapIterable, type JsonCompatibleReadOnly, type Mutable } from "../util/index.js";
16
+ import {
17
+ mapIterable,
18
+ type IdentifierHealingConfig,
19
+ type JsonCompatibleReadOnly,
20
+ type Mutable,
21
+ } from "../util/index.js";
17
22
 
18
23
  import { decodeBranchId, encodeBranchId } from "./branchIdCodec.js";
19
24
  import type { SharedBranchSummaryData } from "./editManager.js";
@@ -34,14 +39,8 @@ export interface EditManagerEncodingContext {
34
39
  * but it is carried explicitly so downstream codecs can read it.
35
40
  */
36
41
  readonly isSummary: boolean;
37
- /**
38
- * See {@link ChangeEncodingContext.healUnresolvableIdentifiersOnDecode}.
39
- */
40
- readonly healUnresolvableIdentifiersOnDecode?: boolean;
41
- /**
42
- * See {@link ChangeEncodingContext.sharedObjectId}.
43
- */
44
- readonly sharedObjectId?: string;
42
+ /** See {@link IdentifierHealingConfig}. */
43
+ readonly healing?: IdentifierHealingConfig;
45
44
  }
46
45
 
47
46
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
@@ -207,8 +206,7 @@ export function decodeSharedBranch<TChangeset>(
207
206
  idCompressor: context.idCompressor,
208
207
  revision: undefined,
209
208
  isSummary: context.isSummary,
210
- healUnresolvableIdentifiersOnDecode: context.healUnresolvableIdentifiersOnDecode,
211
- sharedObjectId: context.sharedObjectId,
209
+ healing: context.healing,
212
210
  }),
213
211
  ),
214
212
  peerLocalBranches: new Map(
@@ -232,9 +230,7 @@ export function decodeSharedBranch<TChangeset>(
232
230
  idCompressor: context.idCompressor,
233
231
  revision: undefined,
234
232
  isSummary: context.isSummary,
235
- healUnresolvableIdentifiersOnDecode:
236
- context.healUnresolvableIdentifiersOnDecode,
237
- sharedObjectId: context.sharedObjectId,
233
+ healing: context.healing,
238
234
  },
239
235
  ),
240
236
  ),