@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
@@ -3,6 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ import type { ErasedType } from "@fluidframework/core-interfaces";
7
+
6
8
  import type { TreeNode } from "../core/index.js";
7
9
 
8
10
  /**
@@ -50,87 +52,148 @@ export interface NoChangeConstraint {
50
52
 
51
53
  /**
52
54
  * Contains a value returned from a transaction.
53
- * @alpha
55
+ * @input
56
+ * @beta
54
57
  */
55
58
  export interface WithValue<TValue> {
56
59
  /** The user-supplied value. */
57
- value: TValue;
60
+ readonly value: TValue;
58
61
  }
59
62
 
60
63
  /**
61
- * Contains a value and status returned from a user-supplied {@link TreeBranchAlpha.(runTransaction:1) | transaction callback}.
62
- * @alpha
64
+ * Contains a value and status returned from a user-supplied {@link TreeViewBeta.runTransaction | transaction callback}.
65
+ * @input
66
+ * @beta
63
67
  */
64
- export type TransactionCallbackStatus<TSuccessValue, TFailureValue> = (
68
+ export type TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> =
65
69
  | (WithValue<TSuccessValue> & {
66
70
  /** Indicates that the transaction callback ran successfully. */
67
- rollback?: false;
71
+ readonly rollback?: false;
68
72
  })
69
73
  | (WithValue<TFailureValue> & {
70
74
  /** Indicates that the transaction callback failed and the transaction should be rolled back. */
71
- rollback: true;
72
- })
73
- ) & {
74
- /**
75
- * An optional list of {@link TransactionConstraintAlpha | constraints} that will be checked when the commit corresponding
76
- * to this transaction is reverted. If any of these constraints are not met when the revert is being applied either
77
- * locally or on remote clients, the revert will be ignored.
78
- * These constraints must also be met at the time they are first introduced. If they are not met after the transaction
79
- * callback returns, then `runTransaction` (which invokes the transaction callback) will throw a `UsageError`.
80
- */
81
- preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
82
- };
75
+ readonly rollback: true;
76
+ });
77
+
78
+ /**
79
+ * The result of a {@link TreeViewBeta.runTransaction | transaction} that doesn't return a value.
80
+ * @input
81
+ * @beta
82
+ */
83
+ export type VoidTransactionCallbackStatusBeta = Omit<
84
+ TransactionCallbackStatusBeta<unknown, unknown>,
85
+ "value"
86
+ >;
87
+
88
+ /**
89
+ * {@link TransactionCallbackStatusBeta} extended with alpha-only {@link TransactionConstraintAlpha | constraint} options.
90
+ * @input
91
+ * @alpha
92
+ */
93
+ export type TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue> =
94
+ TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> & {
95
+ /**
96
+ * An optional list of {@link TransactionConstraintAlpha | constraints} that will be checked when the commit corresponding
97
+ * to this transaction is reverted. If any of these constraints are not met when the revert is being applied either
98
+ * locally or on remote clients, the revert will be ignored.
99
+ * These constraints must also be met at the time they are first introduced. If they are not met after the transaction
100
+ * callback returns, then `runTransaction` (which invokes the transaction callback) will throw a `UsageError`.
101
+ */
102
+ readonly preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
103
+ };
83
104
 
84
105
  /**
85
106
  * The result of a {@link TreeBranchAlpha.(runTransaction:2) | transaction} that doesn't return a value.
107
+ * @input
86
108
  * @alpha
87
109
  */
88
- export type VoidTransactionCallbackStatus = Omit<
89
- TransactionCallbackStatus<unknown, unknown>,
110
+ export type VoidTransactionCallbackStatusAlpha = Omit<
111
+ TransactionCallbackStatusAlpha<unknown, unknown>,
90
112
  "value"
91
113
  >;
92
114
 
93
115
  /**
94
- * The result of a {@link TreeBranchAlpha.(runTransaction:1) | transaction} that completed successfully.
95
- * @alpha
116
+ * The result of a {@link TreeViewBeta.(runTransaction:1) | transaction} that completed successfully.
117
+ * @sealed
118
+ * @beta
96
119
  */
97
120
  export interface TransactionResultSuccess<TSuccessValue> extends WithValue<TSuccessValue> {
98
- /** The success flag for a transaction that completed without being {@link TransactionCallbackStatus | rolled back}. */
99
- success: true;
121
+ /** The success flag for a transaction that completed without being {@link TransactionCallbackStatusBeta | rolled back}. */
122
+ readonly success: true;
100
123
  }
101
124
 
102
125
  /**
103
- * The result of a {@link TreeBranchAlpha.(runTransaction:1) | transaction} that was rolled back.
104
- * @alpha
126
+ * The result of a {@link TreeViewBeta.runTransaction | transaction} that was rolled back.
127
+ * @sealed
128
+ * @beta
105
129
  */
106
130
  export interface TransactionResultFailed<TFailureValue> extends WithValue<TFailureValue> {
107
- /** The failure flag for a transaction that was {@link TransactionCallbackStatus | rolled back}. */
108
- success: false;
131
+ /** The failure flag for a transaction that was {@link TransactionCallbackStatusBeta | rolled back}. */
132
+ readonly success: false;
109
133
  }
110
134
 
111
135
  /**
112
136
  * The result of the {@link RunTransaction | RunTransaction} API.
113
- * @alpha
137
+ * @sealed
138
+ * @beta
114
139
  */
115
- export type TransactionResultExt<TSuccessValue, TFailureValue> =
140
+ export type TransactionValueResult<TSuccessValue, TFailureValue> =
116
141
  | TransactionResultSuccess<TSuccessValue>
117
142
  | TransactionResultFailed<TFailureValue>;
118
143
 
119
144
  /**
120
- * The result of the {@link RunTransaction | RunTransaction} API. This is the same as {@link TransactionResultExt}
145
+ * The result of the {@link RunTransaction | RunTransaction} API. This is the same as {@link TransactionValueResult}
121
146
  * but with the `value` field omitted. This is useful when the transaction callback doesn't need to return a value.
122
- * @alpha
147
+ * @sealed
148
+ * @beta
123
149
  */
124
- export type TransactionResult =
150
+ export type TransactionVoidResult =
125
151
  | Omit<TransactionResultSuccess<unknown>, "value">
126
152
  | Omit<TransactionResultFailed<unknown>, "value">;
127
153
 
128
154
  /**
129
- * The parameters for the {@link RunTransaction | RunTransaction} API.
155
+ * A type-erased function that post-processes the change produced when a transaction is committed.
156
+ *
157
+ * @remarks
158
+ * Supply one via {@link RunTransactionParamsAlpha.postProcessor} to process/alter
159
+ * the change that a transaction produces. For example a post-processor could
160
+ * remove extraneous information, so that the resulting squashed change contains
161
+ * no extraneous information.
162
+ *
163
+ * This type intentionally hides its internal representation: its concrete shape
164
+ * is an implementation detail of `@fluidframework/tree`. Obtain a value of this
165
+ * type from a `@fluidframework/tree` helper or constant rather than constructing
166
+ * one directly.
167
+ *
130
168
  * @alpha
169
+ * @sealed
170
+ * @system
171
+ */
172
+ export interface TransactionPostProcessor
173
+ extends ErasedType<"@fluidframework/tree.TransactionPostProcessor"> {}
174
+
175
+ /**
176
+ * The parameters for the {@link RunTransaction | RunTransaction} API.
177
+ * @input
178
+ * @beta
179
+ */
180
+ export interface RunTransactionParamsBeta {
181
+ /**
182
+ * A label for this transaction that allows it to be correlated with later edits (e.g. for controlling undo/redo grouping).
183
+ * @remarks
184
+ * If this transaction is applied to a {@link TreeBranchAlpha | branch}, the label will be available in the {@link LocalChangeMetadata.label | metadata} of the {@link TreeBranchEvents.changed | `changed`} event.
185
+ *
186
+ * If there is a nested transaction, only the outermost transaction label will be used.
187
+ */
188
+ readonly label?: unknown;
189
+ }
190
+
191
+ /**
192
+ * The parameters for the {@link RunTransaction | RunTransaction} API, extended with alpha-only {@link TransactionConstraintAlpha | constraint} options.
131
193
  * @input
194
+ * @alpha
132
195
  */
133
- export interface RunTransactionParams {
196
+ export interface RunTransactionParamsAlpha extends RunTransactionParamsBeta {
134
197
  /**
135
198
  * An optional list of {@link TransactionConstraintAlpha | constraints} that are checked just before the transaction begins.
136
199
  * @remarks
@@ -138,12 +201,21 @@ export interface RunTransactionParams {
138
201
  * If any of the constraints are not met after the transaction has been ordered by the service, it will be rolled back on this client and ignored by all other clients.
139
202
  */
140
203
  readonly preconditions?: readonly TransactionConstraintAlpha[];
204
+
141
205
  /**
142
- * A label for this transaction that allows it to be correlated with later edits (e.g. for controlling undo/redo grouping).
206
+ * An optional {@link TransactionPostProcessor | post-processor} applied to
207
+ * the change produced when this transaction is committed.
143
208
  * @remarks
144
- * If this transaction is applied to a {@link TreeBranchAlpha | branch}, the label will be available in the {@link LocalChangeMetadata.label | metadata} of the {@link TreeBranchEvents.changed | `changed`} event.
209
+ * When omitted, the transaction's edits are squashed without any such processing.
145
210
  *
146
- * If there is a nested transaction, only the outermost transaction label will be used.
211
+ * Specific post-processors are applied according to their own rules for
212
+ * optimization and other post-processing tasks in a transaction stack. For
213
+ * example a "minimization" post-processor may be applied once for the
214
+ * outermost transaction in a stack as it will process all nested edits and
215
+ * there is no benefit from multiple applications.
216
+ *
217
+ * Note: minimization is not yet implemented. Supplying a post-processor currently has no observable effect beyond
218
+ * reserving the behavior; a real post-processor will be provided in a future change.
147
219
  */
148
- readonly label?: unknown;
220
+ readonly postProcessor?: TransactionPostProcessor;
149
221
  }
@@ -11,17 +11,14 @@ import type {
11
11
  RevertibleAlphaFactory,
12
12
  RevertibleFactory,
13
13
  } from "../../core/index.js";
14
- // This is referenced by doc comments.
15
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
14
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- This is referenced by doc comments.
16
15
  import type { TreeStatus } from "../../feature-libraries/index.js";
17
16
  import type {
18
- // This is referenced by doc comments.
19
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports
17
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports -- This is referenced by doc comments.
20
18
  TreeAlpha,
21
19
  } from "../../shared-tree/index.js";
22
20
  import type { JsonCompatibleReadOnly } from "../../util/index.js";
23
- // This is referenced by doc comments.
24
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
21
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- This is referenced by doc comments.
25
22
  import type { Unhydrated } from "../core/index.js";
26
23
  import type {
27
24
  ImplicitFieldSchema,
@@ -36,11 +33,14 @@ import type { UnsafeUnknownSchema } from "../unsafeUnknownSchema.js";
36
33
 
37
34
  import type { TreeViewConfiguration } from "./configuration.js";
38
35
  import type {
39
- RunTransactionParams,
40
- TransactionCallbackStatus,
41
- TransactionResult,
42
- TransactionResultExt,
43
- VoidTransactionCallbackStatus,
36
+ RunTransactionParamsAlpha,
37
+ RunTransactionParamsBeta,
38
+ TransactionCallbackStatusAlpha,
39
+ TransactionCallbackStatusBeta,
40
+ TransactionVoidResult,
41
+ TransactionValueResult,
42
+ VoidTransactionCallbackStatusAlpha,
43
+ VoidTransactionCallbackStatusBeta,
44
44
  WithValue,
45
45
  } from "./transactionTypes.js";
46
46
  import type { VerboseTree } from "./verboseTree.js";
@@ -193,8 +193,8 @@ export interface TreeContextAlpha {
193
193
  * Run a synchronous transaction which groups sequential edits to the tree into a single atomic edit if possible.
194
194
  * @param transaction - A callback run during the transaction to perform user-supplied operations.
195
195
  * It may optionally return a {@link WithValue | value }, which will be returned by the `runTransaction` call.
196
- * @param params - Optional {@link RunTransactionParams | parameters} for the transaction.
197
- * @returns A {@link TransactionResultExt | value } indicating whether or not the transaction succeeded, and containing the value returned by `transaction`.
196
+ * @param params - Optional {@link RunTransactionParamsAlpha | parameters} for the transaction.
197
+ * @returns A {@link TransactionValueResult | value } indicating whether or not the transaction succeeded, and containing the value returned by `transaction`.
198
198
  * @remarks
199
199
  * All of the changes in the transaction are applied synchronously and therefore no other changes from a remote client can be interleaved with those changes.
200
200
  * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
@@ -215,11 +215,20 @@ export interface TreeContextAlpha {
215
215
  */
216
216
  runTransaction<TValue>(
217
217
  transaction: () => WithValue<TValue>,
218
- params?: RunTransactionParams,
219
- ): TransactionResultExt<TValue, TValue>;
218
+ params?: RunTransactionParamsAlpha,
219
+ ): TransactionValueResult<TValue, TValue>;
220
220
 
221
- /** An overload of {@link TreeContextAlpha.(runTransaction:1) | runTransaction } which does not return a value. */
222
- runTransaction(transaction: () => void, params?: RunTransactionParams): TransactionResult;
221
+ /**
222
+ * An overload of {@link TreeContextAlpha.(runTransaction:1) | runTransaction } which does not return a value.
223
+ *
224
+ * @privateRemarks
225
+ * TODO: Consider updating these methods to avoid the need for overloads.
226
+ * See {@link TreeViewBeta.runTransaction} for an example of how to do this.
227
+ */
228
+ runTransaction(
229
+ transaction: () => void,
230
+ params?: RunTransactionParamsAlpha,
231
+ ): TransactionVoidResult;
223
232
 
224
233
  /**
225
234
  * An asynchronous version of {@link TreeContextAlpha.(runTransaction:1) | runTransaction}.
@@ -234,14 +243,20 @@ export interface TreeContextAlpha {
234
243
  */
235
244
  runTransactionAsync<TValue>(
236
245
  transaction: () => Promise<WithValue<TValue>>,
237
- params?: RunTransactionParams,
238
- ): Promise<TransactionResultExt<TValue, TValue>>;
246
+ params?: RunTransactionParamsAlpha,
247
+ ): Promise<TransactionValueResult<TValue, TValue>>;
239
248
 
240
- /** An overload of {@link TreeContextAlpha.(runTransactionAsync:1) | runTransactionAsync } which does not return a value. */
249
+ /**
250
+ * An overload of {@link TreeContextAlpha.(runTransactionAsync:1) | runTransactionAsync } which does not return a value.
251
+ *
252
+ * @privateRemarks
253
+ * TODO: Consider updating these methods to avoid the need for overloads.
254
+ * See {@link TreeViewBeta.runTransactionAsync} for an example of how to do this.
255
+ */
241
256
  runTransactionAsync(
242
257
  transaction: () => Promise<void>,
243
- params?: RunTransactionParams,
244
- ): Promise<TransactionResult>;
258
+ params?: RunTransactionParamsAlpha,
259
+ ): Promise<TransactionVoidResult>;
245
260
 
246
261
  /**
247
262
  * True if this context is associated with a {@link TreeBranchAlpha | branch} and false if it is associated with an {@link Unhydrated | unhydrated } node.
@@ -295,22 +310,26 @@ export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
295
310
 
296
311
  /**
297
312
  * {@link TreeContextAlpha.(runTransaction:1) | Run a transaction} on a branch of the SharedTree.
298
- * @param transaction - The function to run as the body of the transaction, which may optionally return a {@link TransactionCallbackStatus | value or rollback signal}.
313
+ * @param transaction - The function to run as the body of the transaction, which may optionally return a {@link TransactionCallbackStatusAlpha | value or rollback signal}.
299
314
  * @remarks
300
315
  * If the transaction is rolled back, a corresponding {@link TreeBranchEvents.changed | `changed`} event will also be emitted for the rollback.
301
316
  */
302
317
  runTransaction<TSuccessValue, TFailureValue>(
303
- transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>,
304
- params?: RunTransactionParams,
305
- ): TransactionResultExt<TSuccessValue, TFailureValue>;
318
+ transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>,
319
+ params?: RunTransactionParamsAlpha,
320
+ ): TransactionValueResult<TSuccessValue, TFailureValue>;
306
321
 
307
322
  /**
308
323
  * An overload of {@link TreeBranchAlpha.(runTransaction:1) | runTransaction } which does not return a value.
324
+ *
325
+ * @privateRemarks
326
+ * TODO: Consider updating these methods to avoid the need for overloads.
327
+ * See {@link TreeViewBeta.runTransaction} for an example of how to do this.
309
328
  */
310
329
  runTransaction(
311
- transaction: () => VoidTransactionCallbackStatus | void,
312
- params?: RunTransactionParams,
313
- ): TransactionResult;
330
+ transaction: () => VoidTransactionCallbackStatusAlpha | void,
331
+ params?: RunTransactionParamsAlpha,
332
+ ): TransactionVoidResult;
314
333
 
315
334
  /**
316
335
  * An asynchronous version of {@link TreeBranchAlpha.(runTransaction:1) | runTransaction}.
@@ -318,17 +337,21 @@ export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
318
337
  */
319
338
 
320
339
  runTransactionAsync<TSuccessValue, TFailureValue>(
321
- transaction: () => Promise<TransactionCallbackStatus<TSuccessValue, TFailureValue>>,
322
- params?: RunTransactionParams,
323
- ): Promise<TransactionResultExt<TSuccessValue, TFailureValue>>;
340
+ transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>,
341
+ params?: RunTransactionParamsAlpha,
342
+ ): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
324
343
 
325
344
  /**
326
345
  * An overload of {@link TreeBranchAlpha.(runTransactionAsync:1) | runTransactionAsync } which does not return a value.
346
+ *
347
+ * @privateRemarks
348
+ * TODO: Consider updating these methods to avoid the need for overloads.
349
+ * See {@link TreeViewBeta.runTransactionAsync} for an example of how to do this.
327
350
  */
328
351
  runTransactionAsync(
329
- transaction: () => Promise<VoidTransactionCallbackStatus | void>,
330
- params?: RunTransactionParams,
331
- ): Promise<TransactionResult>;
352
+ transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>,
353
+ params?: RunTransactionParamsAlpha,
354
+ ): Promise<TransactionVoidResult>;
332
355
 
333
356
  /**
334
357
  * Apply a serialized change to this branch.
@@ -449,13 +472,92 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
449
472
  readonly schema: TSchema;
450
473
  }
451
474
 
475
+ /**
476
+ * {@link TreeView} with additional beta APIs.
477
+ * @sealed @beta
478
+ */
479
+ export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema>
480
+ extends TreeView<TSchema>,
481
+ TreeBranch {
482
+ // Override the base branch method to return a typed view rather than merely a branch.
483
+ fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
484
+
485
+ /**
486
+ * Run a synchronous transaction which groups sequential edits to the tree into a single atomic edit if possible.
487
+ *
488
+ * @param transaction - The function to run as the body of the transaction, which may optionally return a {@link TransactionCallbackStatusBeta | value or rollback signal}.
489
+ * It may optionally return a {@link WithValue | value }, which will be returned by the `runTransaction` call.
490
+ *
491
+ * @param params - Optional {@link RunTransactionParamsBeta | parameters} for the transaction.
492
+ *
493
+ * @returns A {@link TransactionValueResult | value } indicating whether or not the transaction succeeded, and containing the value returned by `transaction`.
494
+ *
495
+ * @remarks
496
+ * All of the changes in the transaction are applied synchronously and therefore no other changes from a remote client can be interleaved with those changes.
497
+ * Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
498
+ *
499
+ * {@link (TreeBeta:interface).on | Change events } will be emitted for changed nodes on this client _as each edit happens_, just as they would be if the changes were made outside of a transaction.
500
+ * Any other/future clients or contexts will process the transaction "squashed", i.e. they will apply its changes all at once, emitting only a single event per node (even if that node was edited multiple times in the transaction).
501
+ * Edits to the tree are not permitted within these event callbacks, therefore no other local changes from this client will be interleaved with the changes in this transaction.
502
+ *
503
+ * Using a transaction has the following additional consequences:
504
+ *
505
+ * - If {@link Revertible | reverted } (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
506
+ * Only the "outermost" transaction commits a change to the synchronized tree state and therefore only the outermost transaction can be reverted.
507
+ * If a transaction is started and completed while another transaction is already in progress, then the inner transaction will be reverted together with the outer transaction.
508
+ * - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
509
+ *
510
+ * If the transaction is rolled back, a corresponding {@link TreeBranchEvents.changed | `changed`} event will also be emitted for the rollback.
511
+ */
512
+ runTransaction<
513
+ TOut extends
514
+ | TransactionCallbackStatusBeta<unknown, unknown>
515
+ | VoidTransactionCallbackStatusBeta
516
+ | void,
517
+ >(
518
+ transaction: () => TOut,
519
+ params?: RunTransactionParamsBeta,
520
+ ): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue>
521
+ ? TransactionValueResult<TSuccessValue, TFailureValue>
522
+ : TransactionVoidResult;
523
+
524
+ /**
525
+ * An asynchronous version of {@link TreeViewBeta.runTransaction | runTransaction}.
526
+ *
527
+ * @remarks
528
+ * As with synchronous transactions, all of the changes in an asynchronous transaction are treated as a unit.
529
+ * Therefore, no other changes (either from this client or from a remote client) can be interleaved with the transaction changes.
530
+ *
531
+ * Unlike with synchronous transactions, it is possible that other changes (e.g. from a remote client) may be applied to the branch while this transaction is in progress.
532
+ * Those other changes will be not be reflected on the branch until after this transaction completes, at which point the transaction changes will be applied after those other changes.
533
+ *
534
+ * An asynchronous transaction may not be started while any other transaction is in progress in this view.
535
+ */
536
+ runTransactionAsync<
537
+ TOut extends
538
+ | TransactionCallbackStatusBeta<unknown, unknown>
539
+ | VoidTransactionCallbackStatusBeta
540
+ | void,
541
+ >(
542
+ transaction: () => Promise<TOut>,
543
+ params?: RunTransactionParamsBeta,
544
+ ): Promise<
545
+ TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue>
546
+ ? TransactionValueResult<TSuccessValue, TFailureValue>
547
+ : TransactionVoidResult
548
+ >;
549
+ }
550
+
452
551
  /**
453
552
  * {@link TreeView} with proposed changes to the schema aware typing to allow use with `UnsafeUnknownSchema`.
454
553
  * @sealed @alpha
455
554
  */
456
555
  export interface TreeViewAlpha<
457
556
  in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema,
458
- > extends Omit<TreeViewBeta<ReadSchema<TSchema>>, "root" | "initialize" | "fork">,
557
+ > extends Omit<
558
+ TreeViewBeta<ReadSchema<TSchema>>,
559
+ "root" | "initialize" | "fork" | "runTransaction" | "runTransactionAsync"
560
+ >,
459
561
  TreeBranchAlpha {
460
562
  get root(): ReadableField<TSchema>;
461
563
 
@@ -469,23 +571,15 @@ export interface TreeViewAlpha<
469
571
  fork(): ReturnType<TreeBranch["fork"]> & TreeViewAlpha<TSchema>;
470
572
  }
471
573
 
472
- /**
473
- * {@link TreeView} with additional beta APIs.
474
- * @sealed @beta
475
- */
476
- export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema>
477
- extends TreeView<TSchema>,
478
- TreeBranch {
479
- // Override the base branch method to return a typed view rather than merely a branch.
480
- fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
481
- }
482
-
483
574
  /**
484
575
  * Information about a view schema's compatibility with the document's stored schema.
485
576
  *
577
+ * @see
486
578
  * See SharedTree's README for more information about choosing a compatibility policy.
579
+ *
487
580
  * @privateRemarks
488
581
  * See {@link SchemaCompatibilityTester} for the implementation of this compatibility checking.
582
+ *
489
583
  * @sealed @public
490
584
  */
491
585
  export interface SchemaCompatibilityStatus {
@@ -37,6 +37,8 @@ import type { InsertableField, UnsafeUnknownSchema } from "../unsafeUnknownSchem
37
37
  import { conciseFromCursor, type ConciseTree } from "./conciseTree.js";
38
38
  import { createFromCursor } from "./create.js";
39
39
  import type { TreeEncodingOptions } from "./customTree.js";
40
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Used by docs
41
+ import type { ObjectSchemaOptions } from "./schemaFactory.js";
40
42
  import type { TreeChangeEvents } from "./treeChangeEvents.js";
41
43
  import { treeNodeApi } from "./treeNodeApi.js";
42
44
  import { cursorFromVerbose } from "./verboseTree.js";
@@ -290,18 +290,18 @@ export interface TreeNodeSchemaCore<
290
290
  readonly implicitlyConstructable: ImplicitlyConstructable;
291
291
 
292
292
  /**
293
- * All possible schema that a direct child of a node with this schema could have.
293
+ * All possible schemas that a direct child of a node with this schema could have.
294
294
  *
295
- * Equivalently, this is also all schema directly referenced when defining this schema's allowed child types,
296
- * which is also the same as the set of schema referenced directly by the `Info` type parameter and the `info` property.
295
+ * Equivalently, this is also all schemas directly referenced when defining this schema's allowed child types,
296
+ * which is also the same as the set of schemas referenced directly by the `Info` type parameter and the `info` property.
297
297
  * This property is simply re-exposing that information in an easier to traverse format consistent across all node kinds.
298
298
  * @remarks
299
299
  * Some kinds of nodes may have additional restrictions on children:
300
- * this set simply enumerates all directly referenced schema, and can be use to walk over all referenced schema types.
300
+ * this set simply enumerates all directly referenced schemas, and can be use to walk over all referenced schema types.
301
301
  *
302
- * This set cannot be used before the schema in it have been defined:
303
- * more specifically, when using lazy schema references (for example to make foreword references to schema which have not yet been defined),
304
- * users must wait until after the schema are defined to access this set.
302
+ * This set cannot be used before the schemas in it have been defined:
303
+ * more specifically, when using lazy schema references (for example to make foreword references to schemas which have not yet been defined),
304
+ * users must wait until after the schemas are defined to access this set.
305
305
  * @privateRemarks
306
306
  * Currently there isn't much use for this in the public API,
307
307
  * and it's possible this will want to be tweaked or renamed as part of a larger schema reflection API surface that might be added later.
@@ -175,17 +175,21 @@ export {
175
175
  tryStoredSchemaAsArray,
176
176
  type SchemaStatics,
177
177
  type ITreeAlpha,
178
+ type NoChangeConstraint,
179
+ type NodeInDocumentConstraint,
180
+ type RunTransactionParamsAlpha,
181
+ type RunTransactionParamsBeta,
182
+ type TransactionCallbackStatusAlpha,
183
+ type TransactionCallbackStatusBeta,
178
184
  type TransactionConstraint,
179
185
  type TransactionConstraintAlpha,
180
- type NodeInDocumentConstraint,
181
- type NoChangeConstraint,
182
- type RunTransactionParams,
183
- type VoidTransactionCallbackStatus,
184
- type TransactionCallbackStatus,
185
- type TransactionResult,
186
- type TransactionResultExt,
187
- type TransactionResultSuccess,
186
+ type TransactionPostProcessor,
188
187
  type TransactionResultFailed,
188
+ type TransactionResultSuccess,
189
+ type TransactionValueResult,
190
+ type TransactionVoidResult,
191
+ type VoidTransactionCallbackStatusAlpha,
192
+ type VoidTransactionCallbackStatusBeta,
189
193
  rollback,
190
194
  generateSchemaFromSimpleSchema,
191
195
  replaceConciseTreeHandles,
package/src/text/index.ts CHANGED
@@ -5,4 +5,5 @@
5
5
 
6
6
  export { TextAsTree } from "./textDomain.js";
7
7
  export { FormattedTextAsTree } from "./textDomainFormatted.js";
8
+ export { FormattedTextAsTreeDefault } from "./textDomainFormattedDefault.js";
8
9
  export { codePointCount, utf16LengthForCodePoints } from "./codePointUtils.js";