@fluidframework/tree 2.110.0 → 2.112.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 (598) hide show
  1. package/.vscode/settings.json +1 -0
  2. package/CHANGELOG.md +193 -0
  3. package/api-report/tree.alpha.api.md +96 -36
  4. package/api-report/tree.beta.api.md +39 -1
  5. package/api-report/tree.legacy.beta.api.md +39 -1
  6. package/api-report/tree.legacy.public.api.md +1 -1
  7. package/api-report/tree.public.api.md +1 -1
  8. package/dist/componentApi.d.ts +198 -0
  9. package/dist/componentApi.d.ts.map +1 -0
  10. package/dist/componentApi.js +138 -0
  11. package/dist/componentApi.js.map +1 -0
  12. package/dist/core/change-family/changeFamily.d.ts +3 -10
  13. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  14. package/dist/core/change-family/changeFamily.js.map +1 -1
  15. package/dist/core/rebase/types.d.ts +2 -2
  16. package/dist/core/rebase/types.js.map +1 -1
  17. package/dist/core/schema-stored/storedSchemaRepository.d.ts +2 -2
  18. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  19. package/dist/entrypoints/alpha.d.ts +1 -1
  20. package/dist/entrypoints/alpha.d.ts.map +1 -1
  21. package/dist/entrypoints/alpha.js +4 -2
  22. package/dist/entrypoints/alpha.js.map +1 -1
  23. package/dist/entrypoints/beta.d.ts +1 -1
  24. package/dist/entrypoints/beta.d.ts.map +1 -1
  25. package/dist/entrypoints/beta.js.map +1 -1
  26. package/dist/entrypoints/legacy.d.ts +1 -1
  27. package/dist/entrypoints/legacy.d.ts.map +1 -1
  28. package/dist/entrypoints/legacy.js.map +1 -1
  29. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -20
  30. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  31. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +13 -32
  32. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  33. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -2
  34. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  35. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  36. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +73 -28
  37. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  38. package/dist/feature-libraries/chunked-forest/codec/codecs.js +76 -9
  39. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  40. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
  41. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  42. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +11 -0
  43. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  44. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  45. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  46. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
  47. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  48. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
  49. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  50. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
  51. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  52. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  53. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  54. package/dist/feature-libraries/chunked-forest/index.js +2 -1
  55. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  56. package/dist/feature-libraries/forest-summary/codec.d.ts +3 -3
  57. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  58. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  59. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
  60. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  61. package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -6
  62. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  63. package/dist/feature-libraries/index.d.ts +3 -3
  64. package/dist/feature-libraries/index.d.ts.map +1 -1
  65. package/dist/feature-libraries/index.js +4 -2
  66. package/dist/feature-libraries/index.js.map +1 -1
  67. package/dist/feature-libraries/modular-schema/index.d.ts +1 -0
  68. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  69. package/dist/feature-libraries/modular-schema/index.js +3 -1
  70. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  71. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +25 -0
  72. package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -0
  73. package/dist/feature-libraries/modular-schema/minimizeModularChange.js +29 -0
  74. package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -0
  75. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  76. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +9 -9
  77. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  78. package/dist/feature-libraries/schemaChecker.d.ts +22 -3
  79. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
  80. package/dist/feature-libraries/schemaChecker.js +48 -5
  81. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  82. package/dist/index.d.ts +4 -3
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +6 -2
  85. package/dist/index.js.map +1 -1
  86. package/dist/packageVersion.d.ts +1 -1
  87. package/dist/packageVersion.js +1 -1
  88. package/dist/packageVersion.js.map +1 -1
  89. package/dist/shared-tree/independentView.d.ts +17 -4
  90. package/dist/shared-tree/independentView.d.ts.map +1 -1
  91. package/dist/shared-tree/independentView.js +15 -12
  92. package/dist/shared-tree/independentView.js.map +1 -1
  93. package/dist/shared-tree/index.d.ts +3 -2
  94. package/dist/shared-tree/index.d.ts.map +1 -1
  95. package/dist/shared-tree/index.js +3 -1
  96. package/dist/shared-tree/index.js.map +1 -1
  97. package/dist/shared-tree/schematizingTreeView.d.ts +6 -5
  98. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  99. package/dist/shared-tree/schematizingTreeView.js +6 -3
  100. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  101. package/dist/shared-tree/serializedChange.d.ts +41 -0
  102. package/dist/shared-tree/serializedChange.d.ts.map +1 -0
  103. package/dist/shared-tree/serializedChange.js +87 -0
  104. package/dist/shared-tree/serializedChange.js.map +1 -0
  105. package/dist/shared-tree/sharedTree.d.ts +18 -0
  106. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  107. package/dist/shared-tree/sharedTree.js +9 -4
  108. package/dist/shared-tree/sharedTree.js.map +1 -1
  109. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +7 -0
  110. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  111. package/dist/shared-tree/sharedTreeChangeFamily.js +8 -1
  112. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  113. package/dist/shared-tree/transactionMinimize.d.ts +35 -0
  114. package/dist/shared-tree/transactionMinimize.d.ts.map +1 -0
  115. package/dist/shared-tree/transactionMinimize.js +65 -0
  116. package/dist/shared-tree/transactionMinimize.js.map +1 -0
  117. package/dist/shared-tree/transactionPostProcessor.d.ts +28 -0
  118. package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -0
  119. package/dist/shared-tree/transactionPostProcessor.js +28 -0
  120. package/dist/shared-tree/transactionPostProcessor.js.map +1 -0
  121. package/dist/shared-tree/treeAlpha.js +3 -3
  122. package/dist/shared-tree/treeAlpha.js.map +1 -1
  123. package/dist/shared-tree/treeCheckout.d.ts +19 -13
  124. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  125. package/dist/shared-tree/treeCheckout.js +54 -71
  126. package/dist/shared-tree/treeCheckout.js.map +1 -1
  127. package/dist/shared-tree/unhydratedTreeContext.d.ts +5 -5
  128. package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
  129. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  130. package/dist/shared-tree-core/editManager.d.ts +6 -3
  131. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  132. package/dist/shared-tree-core/editManager.js +35 -14
  133. package/dist/shared-tree-core/editManager.js.map +1 -1
  134. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -2
  135. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  136. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  137. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
  138. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  139. package/dist/shared-tree-core/editManagerCodecsCommons.js +2 -4
  140. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  141. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
  142. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  143. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  144. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
  145. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  146. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  147. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +1 -1
  148. package/dist/shared-tree-core/editManagerFormatCommons.js +1 -1
  149. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  150. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  151. package/dist/shared-tree-core/editManagerSummarizer.d.ts +5 -9
  152. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  153. package/dist/shared-tree-core/editManagerSummarizer.js +5 -10
  154. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  155. package/dist/shared-tree-core/index.d.ts +1 -1
  156. package/dist/shared-tree-core/index.d.ts.map +1 -1
  157. package/dist/shared-tree-core/index.js +3 -2
  158. package/dist/shared-tree-core/index.js.map +1 -1
  159. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  160. package/dist/shared-tree-core/messageCodecVSharedBranches.js +8 -2
  161. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  162. package/dist/shared-tree-core/messageFormat.d.ts +1 -1
  163. package/dist/shared-tree-core/messageFormat.js +1 -1
  164. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  165. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +10 -1
  166. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  167. package/dist/shared-tree-core/messageFormatVSharedBranches.js +1 -0
  168. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  169. package/dist/shared-tree-core/messageTypes.d.ts +1 -0
  170. package/dist/shared-tree-core/messageTypes.d.ts.map +1 -1
  171. package/dist/shared-tree-core/messageTypes.js.map +1 -1
  172. package/dist/shared-tree-core/sharedTreeCore.d.ts +9 -3
  173. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  174. package/dist/shared-tree-core/sharedTreeCore.js +27 -12
  175. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  176. package/dist/shared-tree-core/transaction.d.ts +84 -9
  177. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  178. package/dist/shared-tree-core/transaction.js +88 -7
  179. package/dist/shared-tree-core/transaction.js.map +1 -1
  180. package/dist/simple-tree/api/index.d.ts +2 -2
  181. package/dist/simple-tree/api/index.d.ts.map +1 -1
  182. package/dist/simple-tree/api/index.js +2 -2
  183. package/dist/simple-tree/api/index.js.map +1 -1
  184. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +9 -24
  185. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  186. package/dist/simple-tree/api/schemaCompatibilityTester.js +31 -44
  187. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  188. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
  189. package/dist/simple-tree/api/schemaCreationUtilities.js +3 -3
  190. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  191. package/dist/simple-tree/api/schemaFactory.d.ts +1 -1
  192. package/dist/simple-tree/api/schemaFactory.js +2 -2
  193. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  194. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +56 -15
  195. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  196. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  197. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +0 -3
  198. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  199. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  200. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
  201. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  202. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +3 -4
  203. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  204. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  205. package/dist/simple-tree/api/storedSchema.js +1 -2
  206. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  207. package/dist/simple-tree/api/transactionTypes.d.ts +91 -28
  208. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  209. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  210. package/dist/simple-tree/api/tree.d.ts +108 -24
  211. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  212. package/dist/simple-tree/api/tree.js.map +1 -1
  213. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  214. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  215. package/dist/simple-tree/api/typesUnsafe.d.ts +2 -2
  216. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  217. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  218. package/dist/simple-tree/core/treeNodeSchema.d.ts +7 -7
  219. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  220. package/dist/simple-tree/index.d.ts +1 -1
  221. package/dist/simple-tree/index.d.ts.map +1 -1
  222. package/dist/simple-tree/index.js +2 -2
  223. package/dist/simple-tree/index.js.map +1 -1
  224. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +83 -4
  225. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  226. package/dist/simple-tree/node-kinds/array/arrayNode.js +39 -0
  227. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  228. package/dist/simple-tree/simpleSchemaFormatV1.js +1 -1
  229. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  230. package/dist/text/index.d.ts +1 -0
  231. package/dist/text/index.d.ts.map +1 -1
  232. package/dist/text/index.js +3 -1
  233. package/dist/text/index.js.map +1 -1
  234. package/dist/text/textDomainFormatted.d.ts +69 -758
  235. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  236. package/dist/text/textDomainFormatted.js +275 -322
  237. package/dist/text/textDomainFormatted.js.map +1 -1
  238. package/dist/text/textDomainFormattedDefault.d.ts +273 -0
  239. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -0
  240. package/dist/text/textDomainFormattedDefault.js +94 -0
  241. package/dist/text/textDomainFormattedDefault.js.map +1 -0
  242. package/dist/treeFactory.js +1 -1
  243. package/dist/treeFactory.js.map +1 -1
  244. package/dist/util/breakable.d.ts +16 -1
  245. package/dist/util/breakable.d.ts.map +1 -1
  246. package/dist/util/breakable.js +9 -1
  247. package/dist/util/breakable.js.map +1 -1
  248. package/dist/util/compressedIds.d.ts +185 -0
  249. package/dist/util/compressedIds.d.ts.map +1 -0
  250. package/dist/util/compressedIds.js +164 -0
  251. package/dist/util/compressedIds.js.map +1 -0
  252. package/dist/util/index.d.ts +2 -1
  253. package/dist/util/index.d.ts.map +1 -1
  254. package/dist/util/index.js +10 -2
  255. package/dist/util/index.js.map +1 -1
  256. package/dist/util/nestedMap.d.ts.map +1 -1
  257. package/dist/util/nestedMap.js +16 -3
  258. package/dist/util/nestedMap.js.map +1 -1
  259. package/dist/util/nestedSet.d.ts +1 -1
  260. package/dist/util/nestedSet.d.ts.map +1 -1
  261. package/dist/util/nestedSet.js.map +1 -1
  262. package/dist/util/utils.d.ts +0 -6
  263. package/dist/util/utils.d.ts.map +1 -1
  264. package/dist/util/utils.js +1 -15
  265. package/dist/util/utils.js.map +1 -1
  266. package/lib/componentApi.d.ts +198 -0
  267. package/lib/componentApi.d.ts.map +1 -0
  268. package/lib/componentApi.js +135 -0
  269. package/lib/componentApi.js.map +1 -0
  270. package/lib/core/change-family/changeFamily.d.ts +3 -10
  271. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  272. package/lib/core/change-family/changeFamily.js.map +1 -1
  273. package/lib/core/rebase/types.d.ts +2 -2
  274. package/lib/core/rebase/types.js.map +1 -1
  275. package/lib/core/schema-stored/storedSchemaRepository.d.ts +2 -2
  276. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  277. package/lib/entrypoints/alpha.d.ts +1 -1
  278. package/lib/entrypoints/alpha.d.ts.map +1 -1
  279. package/lib/entrypoints/alpha.js +1 -1
  280. package/lib/entrypoints/alpha.js.map +1 -1
  281. package/lib/entrypoints/beta.d.ts +1 -1
  282. package/lib/entrypoints/beta.d.ts.map +1 -1
  283. package/lib/entrypoints/beta.js.map +1 -1
  284. package/lib/entrypoints/legacy.d.ts +1 -1
  285. package/lib/entrypoints/legacy.d.ts.map +1 -1
  286. package/lib/entrypoints/legacy.js.map +1 -1
  287. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -20
  288. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  289. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +14 -33
  290. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  291. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -2
  292. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  293. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  294. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +73 -28
  295. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  296. package/lib/feature-libraries/chunked-forest/codec/codecs.js +75 -9
  297. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  298. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
  299. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  300. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +12 -1
  301. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  302. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  303. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  304. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  305. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  306. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
  307. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  308. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
  309. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  310. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  311. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  312. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  313. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  314. package/lib/feature-libraries/forest-summary/codec.d.ts +3 -3
  315. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  316. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  317. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
  318. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  319. package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -6
  320. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  321. package/lib/feature-libraries/index.d.ts +3 -3
  322. package/lib/feature-libraries/index.d.ts.map +1 -1
  323. package/lib/feature-libraries/index.js +2 -2
  324. package/lib/feature-libraries/index.js.map +1 -1
  325. package/lib/feature-libraries/modular-schema/index.d.ts +1 -0
  326. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  327. package/lib/feature-libraries/modular-schema/index.js +1 -0
  328. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  329. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +25 -0
  330. package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -0
  331. package/lib/feature-libraries/modular-schema/minimizeModularChange.js +25 -0
  332. package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -0
  333. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  334. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +10 -10
  335. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  336. package/lib/feature-libraries/schemaChecker.d.ts +22 -3
  337. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
  338. package/lib/feature-libraries/schemaChecker.js +48 -5
  339. package/lib/feature-libraries/schemaChecker.js.map +1 -1
  340. package/lib/index.d.ts +4 -3
  341. package/lib/index.d.ts.map +1 -1
  342. package/lib/index.js +3 -2
  343. package/lib/index.js.map +1 -1
  344. package/lib/packageVersion.d.ts +1 -1
  345. package/lib/packageVersion.js +1 -1
  346. package/lib/packageVersion.js.map +1 -1
  347. package/lib/shared-tree/independentView.d.ts +17 -4
  348. package/lib/shared-tree/independentView.d.ts.map +1 -1
  349. package/lib/shared-tree/independentView.js +13 -10
  350. package/lib/shared-tree/independentView.js.map +1 -1
  351. package/lib/shared-tree/index.d.ts +3 -2
  352. package/lib/shared-tree/index.d.ts.map +1 -1
  353. package/lib/shared-tree/index.js +1 -0
  354. package/lib/shared-tree/index.js.map +1 -1
  355. package/lib/shared-tree/schematizingTreeView.d.ts +6 -5
  356. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  357. package/lib/shared-tree/schematizingTreeView.js +7 -4
  358. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  359. package/lib/shared-tree/serializedChange.d.ts +41 -0
  360. package/lib/shared-tree/serializedChange.d.ts.map +1 -0
  361. package/lib/shared-tree/serializedChange.js +84 -0
  362. package/lib/shared-tree/serializedChange.js.map +1 -0
  363. package/lib/shared-tree/sharedTree.d.ts +18 -0
  364. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  365. package/lib/shared-tree/sharedTree.js +10 -5
  366. package/lib/shared-tree/sharedTree.js.map +1 -1
  367. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +7 -0
  368. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  369. package/lib/shared-tree/sharedTreeChangeFamily.js +7 -1
  370. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  371. package/lib/shared-tree/transactionMinimize.d.ts +35 -0
  372. package/lib/shared-tree/transactionMinimize.d.ts.map +1 -0
  373. package/lib/shared-tree/transactionMinimize.js +62 -0
  374. package/lib/shared-tree/transactionMinimize.js.map +1 -0
  375. package/lib/shared-tree/transactionPostProcessor.d.ts +28 -0
  376. package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -0
  377. package/lib/shared-tree/transactionPostProcessor.js +23 -0
  378. package/lib/shared-tree/transactionPostProcessor.js.map +1 -0
  379. package/lib/shared-tree/treeAlpha.js +3 -3
  380. package/lib/shared-tree/treeAlpha.js.map +1 -1
  381. package/lib/shared-tree/treeCheckout.d.ts +19 -13
  382. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  383. package/lib/shared-tree/treeCheckout.js +36 -53
  384. package/lib/shared-tree/treeCheckout.js.map +1 -1
  385. package/lib/shared-tree/unhydratedTreeContext.d.ts +5 -5
  386. package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
  387. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  388. package/lib/shared-tree-core/editManager.d.ts +6 -3
  389. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  390. package/lib/shared-tree-core/editManager.js +36 -15
  391. package/lib/shared-tree-core/editManager.js.map +1 -1
  392. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -2
  393. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  394. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  395. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
  396. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  397. package/lib/shared-tree-core/editManagerCodecsCommons.js +3 -5
  398. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  399. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
  400. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  401. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  402. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
  403. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  404. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  405. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +1 -1
  406. package/lib/shared-tree-core/editManagerFormatCommons.js +1 -1
  407. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  408. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  409. package/lib/shared-tree-core/editManagerSummarizer.d.ts +5 -9
  410. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  411. package/lib/shared-tree-core/editManagerSummarizer.js +5 -10
  412. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  413. package/lib/shared-tree-core/index.d.ts +1 -1
  414. package/lib/shared-tree-core/index.d.ts.map +1 -1
  415. package/lib/shared-tree-core/index.js +1 -1
  416. package/lib/shared-tree-core/index.js.map +1 -1
  417. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  418. package/lib/shared-tree-core/messageCodecVSharedBranches.js +8 -2
  419. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  420. package/lib/shared-tree-core/messageFormat.d.ts +1 -1
  421. package/lib/shared-tree-core/messageFormat.js +1 -1
  422. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  423. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +10 -1
  424. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  425. package/lib/shared-tree-core/messageFormatVSharedBranches.js +1 -0
  426. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  427. package/lib/shared-tree-core/messageTypes.d.ts +1 -0
  428. package/lib/shared-tree-core/messageTypes.d.ts.map +1 -1
  429. package/lib/shared-tree-core/messageTypes.js.map +1 -1
  430. package/lib/shared-tree-core/sharedTreeCore.d.ts +9 -3
  431. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  432. package/lib/shared-tree-core/sharedTreeCore.js +28 -13
  433. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  434. package/lib/shared-tree-core/transaction.d.ts +84 -9
  435. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  436. package/lib/shared-tree-core/transaction.js +87 -6
  437. package/lib/shared-tree-core/transaction.js.map +1 -1
  438. package/lib/simple-tree/api/index.d.ts +2 -2
  439. package/lib/simple-tree/api/index.d.ts.map +1 -1
  440. package/lib/simple-tree/api/index.js +1 -1
  441. package/lib/simple-tree/api/index.js.map +1 -1
  442. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +9 -24
  443. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  444. package/lib/simple-tree/api/schemaCompatibilityTester.js +29 -42
  445. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  446. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
  447. package/lib/simple-tree/api/schemaCreationUtilities.js +3 -3
  448. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  449. package/lib/simple-tree/api/schemaFactory.d.ts +1 -1
  450. package/lib/simple-tree/api/schemaFactory.js +2 -2
  451. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  452. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +56 -15
  453. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  454. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  455. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +0 -3
  456. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  457. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  458. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
  459. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  460. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +4 -5
  461. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  462. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  463. package/lib/simple-tree/api/storedSchema.js +2 -3
  464. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  465. package/lib/simple-tree/api/transactionTypes.d.ts +91 -28
  466. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  467. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  468. package/lib/simple-tree/api/tree.d.ts +108 -24
  469. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  470. package/lib/simple-tree/api/tree.js.map +1 -1
  471. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  472. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  473. package/lib/simple-tree/api/typesUnsafe.d.ts +2 -2
  474. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  475. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  476. package/lib/simple-tree/core/treeNodeSchema.d.ts +7 -7
  477. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  478. package/lib/simple-tree/index.d.ts +1 -1
  479. package/lib/simple-tree/index.d.ts.map +1 -1
  480. package/lib/simple-tree/index.js +1 -1
  481. package/lib/simple-tree/index.js.map +1 -1
  482. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +83 -4
  483. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  484. package/lib/simple-tree/node-kinds/array/arrayNode.js +39 -0
  485. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  486. package/lib/simple-tree/simpleSchemaFormatV1.js +1 -1
  487. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  488. package/lib/text/index.d.ts +1 -0
  489. package/lib/text/index.d.ts.map +1 -1
  490. package/lib/text/index.js +1 -0
  491. package/lib/text/index.js.map +1 -1
  492. package/lib/text/textDomainFormatted.d.ts +69 -758
  493. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  494. package/lib/text/textDomainFormatted.js +277 -324
  495. package/lib/text/textDomainFormatted.js.map +1 -1
  496. package/lib/text/textDomainFormattedDefault.d.ts +273 -0
  497. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -0
  498. package/lib/text/textDomainFormattedDefault.js +91 -0
  499. package/lib/text/textDomainFormattedDefault.js.map +1 -0
  500. package/lib/treeFactory.js +1 -1
  501. package/lib/treeFactory.js.map +1 -1
  502. package/lib/util/breakable.d.ts +16 -1
  503. package/lib/util/breakable.d.ts.map +1 -1
  504. package/lib/util/breakable.js +9 -1
  505. package/lib/util/breakable.js.map +1 -1
  506. package/lib/util/compressedIds.d.ts +185 -0
  507. package/lib/util/compressedIds.d.ts.map +1 -0
  508. package/lib/util/compressedIds.js +154 -0
  509. package/lib/util/compressedIds.js.map +1 -0
  510. package/lib/util/index.d.ts +2 -1
  511. package/lib/util/index.d.ts.map +1 -1
  512. package/lib/util/index.js +2 -1
  513. package/lib/util/index.js.map +1 -1
  514. package/lib/util/nestedMap.d.ts.map +1 -1
  515. package/lib/util/nestedMap.js +17 -4
  516. package/lib/util/nestedMap.js.map +1 -1
  517. package/lib/util/nestedSet.d.ts +1 -1
  518. package/lib/util/nestedSet.d.ts.map +1 -1
  519. package/lib/util/nestedSet.js.map +1 -1
  520. package/lib/util/utils.d.ts +0 -6
  521. package/lib/util/utils.d.ts.map +1 -1
  522. package/lib/util/utils.js +0 -13
  523. package/lib/util/utils.js.map +1 -1
  524. package/package.json +23 -23
  525. package/src/componentApi.ts +354 -0
  526. package/src/core/change-family/changeFamily.ts +3 -12
  527. package/src/core/rebase/types.ts +2 -2
  528. package/src/core/schema-stored/storedSchemaRepository.ts +2 -2
  529. package/src/entrypoints/alpha.ts +15 -8
  530. package/src/entrypoints/beta.ts +8 -0
  531. package/src/entrypoints/legacy.ts +8 -0
  532. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +22 -72
  533. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -2
  534. package/src/feature-libraries/chunked-forest/codec/codecs.ts +110 -41
  535. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +32 -4
  536. package/src/feature-libraries/chunked-forest/codec/index.ts +1 -0
  537. package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +7 -19
  538. package/src/feature-libraries/chunked-forest/index.ts +3 -0
  539. package/src/feature-libraries/forest-summary/codec.ts +5 -3
  540. package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -5
  541. package/src/feature-libraries/index.ts +5 -0
  542. package/src/feature-libraries/modular-schema/index.ts +1 -0
  543. package/src/feature-libraries/modular-schema/minimizeModularChange.ts +33 -0
  544. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +13 -9
  545. package/src/feature-libraries/schemaChecker.ts +86 -9
  546. package/src/index.ts +16 -8
  547. package/src/packageVersion.ts +1 -1
  548. package/src/shared-tree/independentView.ts +40 -15
  549. package/src/shared-tree/index.ts +4 -0
  550. package/src/shared-tree/schematizingTreeView.ts +40 -30
  551. package/src/shared-tree/serializedChange.ts +127 -0
  552. package/src/shared-tree/sharedTree.ts +32 -4
  553. package/src/shared-tree/sharedTreeChangeFamily.ts +7 -1
  554. package/src/shared-tree/transactionMinimize.ts +74 -0
  555. package/src/shared-tree/transactionPostProcessor.ts +40 -0
  556. package/src/shared-tree/treeAlpha.ts +3 -3
  557. package/src/shared-tree/treeCheckout.ts +103 -101
  558. package/src/shared-tree/unhydratedTreeContext.ts +18 -15
  559. package/src/shared-tree-core/editManager.ts +42 -6
  560. package/src/shared-tree-core/editManagerCodecs.ts +3 -2
  561. package/src/shared-tree-core/editManagerCodecsCommons.ts +10 -14
  562. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -2
  563. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -2
  564. package/src/shared-tree-core/editManagerFormatCommons.ts +1 -1
  565. package/src/shared-tree-core/editManagerSummarizer.ts +5 -9
  566. package/src/shared-tree-core/index.ts +8 -5
  567. package/src/shared-tree-core/messageCodecVSharedBranches.ts +8 -1
  568. package/src/shared-tree-core/messageFormat.ts +1 -1
  569. package/src/shared-tree-core/messageFormatVSharedBranches.ts +10 -0
  570. package/src/shared-tree-core/messageTypes.ts +1 -0
  571. package/src/shared-tree-core/sharedTreeCore.ts +36 -12
  572. package/src/shared-tree-core/transaction.ts +165 -18
  573. package/src/simple-tree/api/index.ts +14 -10
  574. package/src/simple-tree/api/schemaCompatibilityTester.ts +36 -48
  575. package/src/simple-tree/api/schemaCreationUtilities.ts +3 -3
  576. package/src/simple-tree/api/schemaFactory.ts +2 -2
  577. package/src/simple-tree/api/schemaFactoryAlpha.ts +56 -15
  578. package/src/simple-tree/api/schemaFactoryBeta.ts +0 -3
  579. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +4 -5
  580. package/src/simple-tree/api/storedSchema.ts +2 -3
  581. package/src/simple-tree/api/transactionTypes.ts +111 -39
  582. package/src/simple-tree/api/tree.ts +165 -49
  583. package/src/simple-tree/api/treeBeta.ts +2 -0
  584. package/src/simple-tree/api/typesUnsafe.ts +2 -1
  585. package/src/simple-tree/core/treeNodeSchema.ts +7 -7
  586. package/src/simple-tree/index.ts +13 -9
  587. package/src/simple-tree/node-kinds/array/arrayNode.ts +168 -4
  588. package/src/simple-tree/simpleSchemaFormatV1.ts +1 -1
  589. package/src/text/index.ts +1 -0
  590. package/src/text/textDomainFormatted.ts +520 -415
  591. package/src/text/textDomainFormattedDefault.ts +150 -0
  592. package/src/treeFactory.ts +1 -1
  593. package/src/util/breakable.ts +8 -1
  594. package/src/util/compressedIds.ts +304 -0
  595. package/src/util/index.ts +18 -1
  596. package/src/util/nestedMap.ts +21 -4
  597. package/src/util/nestedSet.ts +1 -1
  598. package/src/util/utils.ts +0 -18
@@ -28,6 +28,7 @@
28
28
  "fluidframework",
29
29
  "insertable",
30
30
  "jsonable",
31
+ "Originatorless",
31
32
  "parameterizing",
32
33
  "Poset",
33
34
  "rebaser",
package/CHANGELOG.md CHANGED
@@ -1,5 +1,198 @@
1
1
  # @fluidframework/tree
2
2
 
3
+ ## 2.112.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add Component utilities for composing open-polymorphic schema ([#27628](https://github.com/microsoft/FluidFramework/pull/27628)) [7a56d096bf](https://github.com/microsoft/FluidFramework/commit/7a56d096bffab133ab4e7ab9c8f9c465b7ba9e81)
8
+
9
+ A new `@alpha` `Component` namespace is now exported from `@fluidframework/tree` (and re-exported from `fluid-framework`). It provides utilities for composing independently authored application "components" that contribute to a shared configuration, which is useful for implementing ["open polymorphism"](<https://en.wikipedia.org/wiki/Polymorphism_(computer_science)>) schema patterns where the set of allowed types for a field or collection can be extended by separate libraries.
10
+
11
+ Each component is expressed as a `Component.Factory`: a function which receives a lazy reference to the composed configuration and returns the content that component contributes. Because the configuration is provided lazily, components may reference (including recursively) types contributed by other components. `Component.compose` combines a set of components into a `Component.Composed`, from which the aggregated configuration and per-component content can be read.
12
+
13
+ ```typescript
14
+ /** Example application component content type. */
15
+ interface MyAppComponentContent {
16
+ /**
17
+ * Item types contributed by this component.
18
+ * We are just typing them as TreeNodeSchema here to keep things simple.
19
+ * Real use would often provide some static factory to be able to create instances, as well as some APIs all item nodes should implement.
20
+ */
21
+ readonly items: Component.LazyArray<TreeNodeSchema>;
22
+ }
23
+
24
+ type MyAppComponent = Component.Factory<MyAppComponentContent>;
25
+
26
+ // A simple component, which does not depend on any other context.
27
+ const textComponent: MyAppComponent = () => ({
28
+ items: () => [() => TextItem],
29
+ });
30
+
31
+ // A component which creates an item type which recursively depends on all item types.
32
+ const containerComponent: MyAppComponent = (config) => ({
33
+ items: () => [
34
+ () =>
35
+ class extends sf.array("Container", config().getComposed("items")) {},
36
+ ],
37
+ });
38
+
39
+ const appConfig = Component.compose([containerComponent, textComponent]);
40
+
41
+ // The config's items can now be used to create a TreeViewConfiguration, root schema, or whatever else is needed.
42
+ class Root extends sf.object("Root", {
43
+ content: appConfig.getComposed("items"),
44
+ }) {}
45
+ ```
46
+
47
+ See the worked examples in [openPolymorphism.integration.ts](https://github.com/microsoft/FluidFramework/blob/main/packages/dds/tree/src/test/openPolymorphism.integration.ts) for end-to-end usage with SharedTree schema.
48
+
49
+ - Independent tree views now accept an optional telemetry logger ([#27567](https://github.com/microsoft/FluidFramework/pull/27567)) [5fbbcab0af](https://github.com/microsoft/FluidFramework/commit/5fbbcab0aff87519ae6f112611f0c1e62f30d97e)
50
+
51
+ The alpha `independentView`, `independentInitializedView`, and `createIndependentTreeAlpha` APIs now accept an optional `logger` on their options.
52
+ Previously these standalone (non-`SharedTree`) views had no way to surface telemetry,
53
+ so internal events—including those emitted when the tree enters a broken state—were dropped.
54
+ Passing a logger forwards those events to the caller's telemetry pipeline.
55
+ This makes it possible to diagnose failures in scenarios that use independent tree views, such as snapshot import/export, schema migration, and other out-of-container workflows.
56
+
57
+ Events emitted by an independent tree view are tagged with the `independentView` namespace.
58
+ If no logger is provided, behavior is unchanged and telemetry events continue to be dropped.
59
+
60
+ The `logger` option is typed as `ITelemetryBaseLogger` from `@fluidframework/core-interfaces`,
61
+ so any standard Fluid telemetry logger can be passed directly.
62
+
63
+ ```typescript
64
+ // ...
65
+ const view = independentView(
66
+ new TreeViewConfiguration({ schema: MySchema }),
67
+ {
68
+ logger: myTelemetryLogger,
69
+ },
70
+ );
71
+ // ...
72
+ ```
73
+
74
+ - Shared branch names ([#27708](https://github.com/microsoft/FluidFramework/pull/27708)) [1f08b9210b](https://github.com/microsoft/FluidFramework/commit/1f08b9210bf7ba3adbc98c45b02ab8a6a58929f5)
75
+
76
+ The existing [`createSharedBranch`](https://fluidframework.com/docs/api/tree/itreealpha-interface#createsharedbranch-methodsignature) alpha API now takes an optional `name` string parameter that is associated with the shared branch.
77
+ This name can be retrieved by passing the shared branch ID to `getSharedBranchName`.
78
+
79
+ Note that, unlike the shared branch IDs, shared branch names are not guaranteed to be unique.
80
+
81
+ #### Compatibility Implications
82
+
83
+ This change breaks compatibility in the following ways:
84
+ - A document written by a client running an earlier FF version cannot be opened by a client running this version.
85
+ - A document written by a client running this version cannot be opened by a client running an earlier FF version.
86
+ - Clients running earlier FF versions will crash upon receiving ops from clients running this version.
87
+ - Clients running this version will crash upon receiving ops from clients running earlier FF versions.
88
+
89
+ These breaks are only applicable for clients with `enableSharedBranches` turned on. Other clients are unaffected.
90
+
91
+ - Add at, pop, shift, unshift, findLast, and findLastIndex methods to TreeArrayNodeAlpha ([#27686](https://github.com/microsoft/FluidFramework/pull/27686)) [59669008b9](https://github.com/microsoft/FluidFramework/commit/59669008b9f9f70ccb94030a6382afcdf8f28cd4)
92
+
93
+ `TreeArrayNodeAlpha` now has `at`, `pop`, `shift`, `unshift`, `findLast`, and `findLastIndex` methods, further aligning it with JavaScript's built-in Array API:
94
+ - `at(index)` `at` was already implemented at runtime, and consumers compiling with `lib: ES2022` or later could already see it through the inherited `ReadonlyArray` typings. This change adds no new runtime behavior, but makes `at` an explicitly declared, documented part of the API, independent of the consumer's TypeScript `lib` configuration.
95
+ - `unshift(...items)` is an alias for `insertAtStart`, mirroring how `push` aliases `insertAtEnd`: it inserts new item(s) at the start of the array. Unlike `Array.prototype.unshift`, it does not return the new length of the array.
96
+ - `pop()` removes and returns the last item in the array, or returns `undefined` (without modifying the array) if it is empty.
97
+ - `shift()` removes and returns the first item in the array, or returns `undefined` (without modifying the array) if it is empty.
98
+ - `findLast(predicate, thisArg?)` and `findLastIndex(predicate, thisArg?)` search the array from the last item to the first, returning the last matching item (or `undefined`) and its index (or `-1`) respectively, like their `Array.prototype` equivalents. As with `Array.prototype.findLast`, passing a type guard as the `findLast` predicate narrows the returned item's type.
99
+
100
+ These methods are available on `TreeArrayNodeAlpha`, which can be obtained from an existing `TreeArrayNode` via `asAlpha`, or by declaring the schema with `SchemaFactoryAlpha`'s `arrayAlpha`.
101
+
102
+ #### Usage
103
+
104
+ ```typescript
105
+ import { SchemaFactory, asAlpha } from "@fluidframework/tree/alpha";
106
+
107
+ const sf = new SchemaFactory("example");
108
+ const Inventory = sf.array("Inventory", sf.string);
109
+ const inventory = asAlpha(new Inventory(["Apples", "Bananas", "Pears"]));
110
+
111
+ // inventory: ["Apples", "Bananas", "Pears"]
112
+ inventory.unshift("Oranges", "Grapes");
113
+ // inventory: ["Oranges", "Grapes", "Apples", "Bananas", "Pears"]
114
+
115
+ inventory.at(0); // "Oranges"
116
+ inventory.at(-1); // "Pears"
117
+ inventory.at(10); // undefined
118
+
119
+ inventory.findLast((item) => item.startsWith("G")); // "Grapes"
120
+ inventory.findLastIndex((item) => item.startsWith("G")); // 1
121
+
122
+ // inventory: ["Oranges", "Grapes", "Apples", "Bananas", "Pears"]
123
+ inventory.pop(); // "Pears"
124
+ // inventory ["Oranges", "Grapes", "Apples", "Bananas"]
125
+
126
+ inventory.shift(); // "Oranges"
127
+ // inventory: ["Grapes", "Apples", "Bananas"]
128
+ ```
129
+
130
+ - Retain history option ([#27696](https://github.com/microsoft/FluidFramework/pull/27696)) [2fa44c6ed2](https://github.com/microsoft/FluidFramework/commit/2fa44c6ed222a8ed88a632a0bf3cad0c26e72514)
131
+
132
+ Adds a new `retainHistory` flag to [`SharedTreeOptions`](https://fluidframework.com/docs/api/tree/sharedtreeoptions-interface) (defaults to `false`).
133
+ Setting `retainHistory` to `true` will prevent SharedTree from garbage-collecting historical data about old changes.
134
+ Note that this will cause unbounded growth both in memory on the client and in summaries/snapshots (the at-rest data representing a Fluid document).
135
+ For these reasons, this option is only intended for debugging and experimentation.
136
+
137
+ ### Patch Changes
138
+
139
+ - Fix insertable types when using typesRecursive with multiple allowed types ([#27698](https://github.com/microsoft/FluidFramework/pull/27698)) [b72f836d09](https://github.com/microsoft/FluidFramework/commit/b72f836d09437654e0ef5787625073f9da41cf9f)
140
+
141
+ The allowed types produced by `SchemaFactoryBeta.typesRecursive` (and `SchemaFactoryAlpha.typesRecursive`) are now processed correctly when used in a recursive schema that permits more than one type.
142
+
143
+ Previously, passing their output to a recursive schema (for example `factory.arrayRecursive` or `factory.mapRecursive`) computed the node's insertable content type as `never`.
144
+ This caused valid insertions to fail to compile.
145
+ Recursive schemas built from a `typesRecursive` list with two or more types now accept insertable content for each of the allowed types as expected.
146
+ Recursive schemas that use a single type were unaffected.
147
+
148
+ ## 2.111.0
149
+
150
+ ### Minor Changes
151
+
152
+ - Add an opt-in postProcessor option when running a transaction ([#27610](https://github.com/microsoft/FluidFramework/pull/27610)) [ee981100f3f](https://github.com/microsoft/FluidFramework/commit/ee981100f3fa5fb9b5ea26b9ef62efa7e0691b69)
153
+
154
+ `RunTransactionParams` now accepts an optional `postProcessor` (used by `runTransaction` and `runTransactionAsync`). When supplied, the edits made during the transaction are post-processed when the transaction is committed, transforming the resulting squashed change. For example, post-processing could be used to "minimize" the change so that it contains no extraneous information. Such extraneous information includes data for nodes that were both created and removed within the transaction, or changes whose effects cancel out to nothing.
155
+
156
+ `postProcessor` is a type-erased handle (`TransactionPostProcessor`) whose concrete representation is an implementation detail of `@fluidframework/tree`. It is opt-in: when it is omitted the existing behavior is preserved.
157
+
158
+ Note: minimization is the first intended implementation and use of post-processing, but it is not yet available.
159
+
160
+ - TreeView transaction APIs have been promoted to beta ([#27592](https://github.com/microsoft/FluidFramework/pull/27592)) [1ed11dbeddd](https://github.com/microsoft/FluidFramework/commit/1ed11dbeddd98fd0b788aad6f74b6d480249ce28)
161
+
162
+ The [TreeViewBeta](https://fluidframework.com/docs/api/fluid-framework/treeviewbeta-interface) interface exposes `runTransaction` and `runTransactionAsync` methods.
163
+
164
+ The [asBeta](https://fluidframework.com/docs/api/fluid-framework/#asbeta-function) helper function can be used to down-cast a `TreeView` to a `TreeViewBeta`.
165
+
166
+ ```typescript
167
+ import { asBeta } from "fluid-framework/beta";
168
+ // ...
169
+ const view = asBeta(tree.viewWith(config));
170
+ const result = view.runTransaction(() => {
171
+ // ... make edits to the tree ...
172
+ });
173
+ if (result.success === false) {
174
+ // ... handle the failed transaction ...
175
+ }
176
+ ```
177
+
178
+ > [!IMPORTANT]
179
+ > Transaction constraints are not yet available as a part of the beta transaction APIs.
180
+ > These capabilities can still be accessed via the updated alpha APIs.
181
+
182
+ **Type Name Changes**
183
+
184
+ With the introduction of new beta types, existing alpha types have been replaced with new alpha and beta variants.
185
+
186
+ | Old | New Alpha | New Beta |
187
+ | ------------------------------- | ------------------------------------ | ----------------------------------- |
188
+ | `RunTransactionParams` | `RunTransactionParamsAlpha` | `RunTransactionParamsBeta` |
189
+ | `TransactionCallbackStatus` | `TransactionCallbackStatusAlpha` | `TransactionCallbackStatusBeta` |
190
+ | `VoidTransactionCallbackStatus` | `VoidTransactionCallbackStatusAlpha` | `VoidTransactionCallbackStatusBeta` |
191
+
192
+ **Other Renames**
193
+ - `TransactionResult` (alpha) -> `TransactionVoidResult` (beta)
194
+ - `TransactionResultExt` (alpha) -> `TransactionValueResult` (beta)
195
+
3
196
  ## 2.110.0
4
197
 
5
198
  ### Minor Changes
@@ -218,6 +218,31 @@ export interface CommitMetadata {
218
218
  // @alpha
219
219
  export function comparePersistedSchema(persisted: JsonCompatible, view: ImplicitFieldSchema, options: ICodecOptions): Omit<SchemaCompatibilityStatus, "canInitialize">;
220
220
 
221
+ // @alpha
222
+ export namespace Component {
223
+ export function compose<TComponent>(allComponents: readonly Factory<TComponent>[]): Composed<TComponent>;
224
+ export function compose<TComponent, TConfig>(allComponents: readonly Factory<TComponent, TConfig>[], lazyConfiguration: (composed: Composed<TComponent, TConfig>) => TConfig): Composed<TComponent, TConfig>;
225
+ const memoize: <T>(factory: () => T) => (() => T);
226
+ // @sealed
227
+ export interface Composed<TComponent, TConfig = ComposedDefault<TComponent>> {
228
+ readonly components: readonly TComponent[];
229
+ readonly config: TConfig;
230
+ getComponent<TFactory extends Factory<TComponent, TConfig>>(factory: TFactory): ReturnType<TFactory>;
231
+ getComposed<TKey extends keyof {
232
+ [Property in keyof TComponent as TComponent[Property] extends LazyArray<unknown> | undefined ? Property : never]: boolean;
233
+ }>(property: TKey): readonly (Exclude<TComponent[TKey], undefined> extends LazyArray<infer U> ? () => U : never)[];
234
+ getConfigured<TConfigurable extends Configurable<TConfig, unknown, TComponent>>(configurable: TConfigurable): ReturnType<TConfigurable["configure"]>;
235
+ }
236
+ // @sealed
237
+ export type ComposedDefault<TComponent> = Composed<TComponent, ComposedDefault<TComponent>>;
238
+ export interface Configurable<TConfigPartial, out TResult, TComponent> {
239
+ configure(config: TConfigPartial, components: Composed<TComponent, TConfigPartial>): TResult;
240
+ }
241
+ // @input
242
+ export type Factory<TComponent, TConfig = ComposedDefault<TComponent>> = (lazyConfiguration: () => TConfig) => TComponent;
243
+ export type LazyArray<T> = () => readonly (() => T)[];
244
+ }
245
+
221
246
  // @beta
222
247
  export type ConciseTree<THandle = IFluidHandle> = Exclude<TreeLeafValue, IFluidHandle> | THandle | ConciseTree<THandle>[] | {
223
248
  [key: string]: ConciseTree<THandle>;
@@ -242,7 +267,7 @@ export function createIdentifierIndex<TSchema extends ImplicitFieldSchema>(view:
242
267
  export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSchema>(options?: CreateIndependentTreeAlphaOptions): ViewableTree & Pick<ITreeAlpha, "exportVerbose" | "exportSimpleSchema">;
243
268
 
244
269
  // @alpha
245
- export type CreateIndependentTreeAlphaOptions = ForestOptions & ((IndependentViewOptions & {
270
+ export type CreateIndependentTreeAlphaOptions = ForestOptions & IndependentViewTelemetryOptions & ((IndependentViewOptions & {
246
271
  content?: never;
247
272
  }) | (ICodecOptions & {
248
273
  content: ViewContent;
@@ -538,16 +563,21 @@ export function incrementalEncodingPolicyForAllowedTypes(rootSchema: TreeSchema)
538
563
  export const incrementalSummaryHint: unique symbol;
539
564
 
540
565
  // @alpha
541
- export function independentInitializedView<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options: ForestOptions & ICodecOptions, content: ViewContent): TreeViewAlpha<TSchema>;
566
+ export function independentInitializedView<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options: ForestOptions & ICodecOptions & IndependentViewTelemetryOptions, content: ViewContent): TreeViewAlpha<TSchema>;
542
567
 
543
568
  // @alpha
544
569
  export function independentView<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options?: IndependentViewOptions): TreeViewAlpha<TSchema>;
545
570
 
546
571
  // @alpha @input
547
- export interface IndependentViewOptions extends ForestOptions, Partial<CodecWriteOptions> {
572
+ export interface IndependentViewOptions extends ForestOptions, Partial<CodecWriteOptions>, IndependentViewTelemetryOptions {
548
573
  idCompressor?: IIdCompressor | undefined;
549
574
  }
550
575
 
576
+ // @alpha @input
577
+ export interface IndependentViewTelemetryOptions {
578
+ readonly logger?: ITelemetryBaseLogger | undefined;
579
+ }
580
+
551
581
  // @public @system
552
582
  type _InlineTrick = 0;
553
583
 
@@ -648,10 +678,11 @@ export interface ITree extends ViewableTree, IFluidLoadable {
648
678
 
649
679
  // @alpha @sealed
650
680
  export interface ITreeAlpha extends ITree {
651
- createSharedBranch(): string;
681
+ createSharedBranch(name?: string): string;
652
682
  exportSimpleSchema(): SimpleTreeSchema;
653
683
  exportVerbose(): VerboseTree | undefined;
654
684
  getSharedBranchIds(): string[];
685
+ getSharedBranchName(branchId: string): string | undefined;
655
686
  viewSharedBranchWith<TRoot extends ImplicitFieldSchema>(branchId: string, config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
656
687
  }
657
688
 
@@ -844,6 +875,9 @@ export const MapNodeSchema: {
844
875
  readonly [Symbol.hasInstance]: (value: TreeNodeSchema) => value is MapNodeSchema;
845
876
  };
846
877
 
878
+ // @alpha @deprecated
879
+ export const minimize: TransactionPostProcessor;
880
+
847
881
  // @alpha
848
882
  export interface NoChangeConstraint {
849
883
  // (undocumented)
@@ -1074,11 +1108,16 @@ export interface RunTransaction {
1074
1108
  }
1075
1109
 
1076
1110
  // @alpha @input
1077
- export interface RunTransactionParams {
1078
- readonly label?: unknown;
1111
+ export interface RunTransactionParamsAlpha extends RunTransactionParamsBeta {
1112
+ readonly postProcessor?: TransactionPostProcessor;
1079
1113
  readonly preconditions?: readonly TransactionConstraintAlpha[];
1080
1114
  }
1081
1115
 
1116
+ // @beta @input
1117
+ export interface RunTransactionParamsBeta {
1118
+ readonly label?: unknown;
1119
+ }
1120
+
1082
1121
  // @public @sealed
1083
1122
  export interface SchemaCompatibilityStatus {
1084
1123
  readonly canInitialize: boolean;
@@ -1243,6 +1282,7 @@ export interface SharedTreeFormatOptions {
1243
1282
  // @alpha @input
1244
1283
  export interface SharedTreeOptions extends SharedTreeOptionsBeta, Partial<CodecWriteOptions>, Partial<SharedTreeFormatOptions> {
1245
1284
  readonly enableSharedBranches?: boolean;
1285
+ readonly retainHistory?: boolean;
1246
1286
  shouldEncodeIncrementally?: IncrementalEncodingPolicy;
1247
1287
  }
1248
1288
 
@@ -1449,7 +1489,7 @@ export namespace System_Unsafe {
1449
1489
  // @system
1450
1490
  export type InsertableTreeNodeFromAllowedTypesUnsafe<TList extends AllowedTypesUnsafe> = IsUnion<TList> extends true ? never : {
1451
1491
  readonly [Property in keyof TList]: TList[Property] extends LazyItem<infer TSchema extends TreeNodeSchemaUnsafe> ? InsertableTypedNodeUnsafe<TSchema> : never;
1452
- }[number];
1492
+ }[NumberKeys<TList>];
1453
1493
  // @system
1454
1494
  export type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends ImplicitAllowedTypesUnsafe> = [TSchema] extends [TreeNodeSchemaUnsafe] ? InsertableTypedNodeUnsafe<TSchema> : [TSchema] extends [AllowedTypesUnsafe] ? InsertableTreeNodeFromAllowedTypesUnsafe<TSchema> : never;
1455
1495
  // @system
@@ -1632,15 +1672,18 @@ export namespace TextAsTree {
1632
1672
  // @alpha
1633
1673
  export function trackDirtyNodes(view: TreeViewAlpha<ImplicitFieldSchema>, dirty: DirtyTreeMap): () => void;
1634
1674
 
1635
- // @alpha
1636
- export type TransactionCallbackStatus<TSuccessValue, TFailureValue> = ((WithValue<TSuccessValue> & {
1637
- rollback?: false;
1638
- }) | (WithValue<TFailureValue> & {
1639
- rollback: true;
1640
- })) & {
1641
- preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
1675
+ // @alpha @input
1676
+ export type TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue> = TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> & {
1677
+ readonly preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
1642
1678
  };
1643
1679
 
1680
+ // @beta @input
1681
+ export type TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> = (WithValue<TSuccessValue> & {
1682
+ readonly rollback?: false;
1683
+ }) | (WithValue<TFailureValue> & {
1684
+ readonly rollback: true;
1685
+ });
1686
+
1644
1687
  // @public
1645
1688
  export type TransactionConstraint = NodeInDocumentConstraint;
1646
1689
 
@@ -1652,22 +1695,26 @@ export type TransactionLabels = Set<unknown> & {
1652
1695
  tree?: LabelTree;
1653
1696
  };
1654
1697
 
1655
- // @alpha
1656
- export type TransactionResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
1657
-
1658
- // @alpha
1659
- export type TransactionResultExt<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
1698
+ // @alpha @sealed @system
1699
+ export interface TransactionPostProcessor extends ErasedType<"@fluidframework/tree.TransactionPostProcessor"> {
1700
+ }
1660
1701
 
1661
- // @alpha
1702
+ // @beta @sealed
1662
1703
  export interface TransactionResultFailed<TFailureValue> extends WithValue<TFailureValue> {
1663
- success: false;
1704
+ readonly success: false;
1664
1705
  }
1665
1706
 
1666
- // @alpha
1707
+ // @beta @sealed
1667
1708
  export interface TransactionResultSuccess<TSuccessValue> extends WithValue<TSuccessValue> {
1668
- success: true;
1709
+ readonly success: true;
1669
1710
  }
1670
1711
 
1712
+ // @beta @sealed
1713
+ export type TransactionValueResult<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
1714
+
1715
+ // @beta @sealed
1716
+ export type TransactionVoidResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
1717
+
1671
1718
  // @public @sealed
1672
1719
  export interface Tree extends TreeNodeApi {
1673
1720
  contains(node: TreeNode, other: TreeNode): boolean;
@@ -1737,7 +1784,14 @@ export const TreeArrayNode: {
1737
1784
 
1738
1785
  // @alpha @sealed
1739
1786
  export interface TreeArrayNodeAlpha<TAllowedTypes extends System_Unsafe.ImplicitAllowedTypesUnsafe = ImplicitAllowedTypes, out T = [TAllowedTypes] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TAllowedTypes> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, in TNew = [TAllowedTypes] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes> : InsertableTreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>> extends TreeArrayNode<TAllowedTypes, T, TNew> {
1787
+ at(index: number): T | undefined;
1788
+ findLast<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: unknown): S | undefined;
1789
+ findLast(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: unknown): T | undefined;
1790
+ findLastIndex(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: unknown): number;
1791
+ pop(): T | undefined;
1792
+ shift(): T | undefined;
1740
1793
  splice(start: number, deleteCount?: number, ...items: readonly (TNew | IterableTreeArrayContent<TNew>)[]): T[];
1794
+ unshift(...value: readonly (TNew | IterableTreeArrayContent<TNew>)[]): void;
1741
1795
  }
1742
1796
 
1743
1797
  // @beta @sealed
@@ -1764,15 +1818,16 @@ export interface TreeBranch extends IDisposable {
1764
1818
  // @alpha @sealed
1765
1819
  export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
1766
1820
  applyChange(change: JsonCompatibleReadOnly): void;
1821
+ computeNetChangeIfRebasedOnto(branch: TreeBranch): JsonCompatibleReadOnly | undefined;
1767
1822
  readonly events: Listenable_2<TreeBranchEvents>;
1768
1823
  // (undocumented)
1769
1824
  fork(): TreeBranchAlpha;
1770
1825
  hasRootSchema<TSchema extends ImplicitFieldSchema>(schema: TSchema): this is TreeViewAlpha<TSchema>;
1771
1826
  isMissingEditsFrom(branch: TreeBranch): boolean;
1772
- runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>, params?: RunTransactionParams): TransactionResultExt<TSuccessValue, TFailureValue>;
1773
- runTransaction(transaction: () => VoidTransactionCallbackStatus | void, params?: RunTransactionParams): TransactionResult;
1774
- runTransactionAsync<TSuccessValue, TFailureValue>(transaction: () => Promise<TransactionCallbackStatus<TSuccessValue, TFailureValue>>, params?: RunTransactionParams): Promise<TransactionResultExt<TSuccessValue, TFailureValue>>;
1775
- runTransactionAsync(transaction: () => Promise<VoidTransactionCallbackStatus | void>, params?: RunTransactionParams): Promise<TransactionResult>;
1827
+ runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>, params?: RunTransactionParamsAlpha): TransactionValueResult<TSuccessValue, TFailureValue>;
1828
+ runTransaction(transaction: () => VoidTransactionCallbackStatusAlpha | void, params?: RunTransactionParamsAlpha): TransactionVoidResult;
1829
+ runTransactionAsync<TSuccessValue, TFailureValue>(transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>, params?: RunTransactionParamsAlpha): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
1830
+ runTransactionAsync(transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>, params?: RunTransactionParamsAlpha): Promise<TransactionVoidResult>;
1776
1831
  }
1777
1832
 
1778
1833
  // @alpha @sealed
@@ -1807,10 +1862,10 @@ export enum TreeCompressionStrategy {
1807
1862
  // @alpha
1808
1863
  export interface TreeContextAlpha {
1809
1864
  isBranch(): this is TreeBranchAlpha;
1810
- runTransaction<TValue>(transaction: () => WithValue<TValue>, params?: RunTransactionParams): TransactionResultExt<TValue, TValue>;
1811
- runTransaction(transaction: () => void, params?: RunTransactionParams): TransactionResult;
1812
- runTransactionAsync<TValue>(transaction: () => Promise<WithValue<TValue>>, params?: RunTransactionParams): Promise<TransactionResultExt<TValue, TValue>>;
1813
- runTransactionAsync(transaction: () => Promise<void>, params?: RunTransactionParams): Promise<TransactionResult>;
1865
+ runTransaction<TValue>(transaction: () => WithValue<TValue>, params?: RunTransactionParamsAlpha): TransactionValueResult<TValue, TValue>;
1866
+ runTransaction(transaction: () => void, params?: RunTransactionParamsAlpha): TransactionVoidResult;
1867
+ runTransactionAsync<TValue>(transaction: () => Promise<WithValue<TValue>>, params?: RunTransactionParamsAlpha): Promise<TransactionValueResult<TValue, TValue>>;
1868
+ runTransactionAsync(transaction: () => Promise<void>, params?: RunTransactionParamsAlpha): Promise<TransactionVoidResult>;
1814
1869
  }
1815
1870
 
1816
1871
  // @beta @input
@@ -1964,7 +2019,7 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
1964
2019
  }
1965
2020
 
1966
2021
  // @alpha @sealed
1967
- export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> extends Omit<TreeViewBeta<ReadSchema<TSchema>>, "root" | "initialize" | "fork">, TreeBranchAlpha {
2022
+ export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> extends Omit<TreeViewBeta<ReadSchema<TSchema>>, "root" | "initialize" | "fork" | "runTransaction" | "runTransactionAsync">, TreeBranchAlpha {
1968
2023
  // (undocumented)
1969
2024
  readonly events: Listenable_2<TreeViewEvents & TreeBranchEvents>;
1970
2025
  // (undocumented)
@@ -1980,6 +2035,8 @@ export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | Unsa
1980
2035
  export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>, TreeBranch {
1981
2036
  // (undocumented)
1982
2037
  fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
2038
+ runTransaction<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => TOut, params?: RunTransactionParamsBeta): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult;
2039
+ runTransactionAsync<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => Promise<TOut>, params?: RunTransactionParamsBeta): Promise<TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult>;
1983
2040
  }
1984
2041
 
1985
2042
  // @public @sealed
@@ -2104,8 +2161,11 @@ export interface ViewContent {
2104
2161
  readonly tree: JsonCompatible<IFluidHandle>;
2105
2162
  }
2106
2163
 
2107
- // @alpha
2108
- export type VoidTransactionCallbackStatus = Omit<TransactionCallbackStatus<unknown, unknown>, "value">;
2164
+ // @alpha @input
2165
+ export type VoidTransactionCallbackStatusAlpha = Omit<TransactionCallbackStatusAlpha<unknown, unknown>, "value">;
2166
+
2167
+ // @beta @input
2168
+ export type VoidTransactionCallbackStatusBeta = Omit<TransactionCallbackStatusBeta<unknown, unknown>, "value">;
2109
2169
 
2110
2170
  // @public @sealed
2111
2171
  export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind, out TInfo = unknown> {
@@ -2114,9 +2174,9 @@ export interface WithType<out TName extends string = string, out TKind extends N
2114
2174
  get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;
2115
2175
  }
2116
2176
 
2117
- // @alpha
2177
+ // @beta @input
2118
2178
  export interface WithValue<TValue> {
2119
- value: TValue;
2179
+ readonly value: TValue;
2120
2180
  }
2121
2181
 
2122
2182
  // (No @packageDocumentation comment for this package)
@@ -501,6 +501,11 @@ export interface RunTransaction {
501
501
  readonly rollback: typeof rollback;
502
502
  }
503
503
 
504
+ // @beta @input
505
+ export interface RunTransactionParamsBeta {
506
+ readonly label?: unknown;
507
+ }
508
+
504
509
  // @public @sealed
505
510
  export interface SchemaCompatibilityStatus {
506
511
  readonly canInitialize: boolean;
@@ -732,7 +737,7 @@ export namespace System_Unsafe {
732
737
  // @system
733
738
  export type InsertableTreeNodeFromAllowedTypesUnsafe<TList extends AllowedTypesUnsafe> = IsUnion<TList> extends true ? never : {
734
739
  readonly [Property in keyof TList]: TList[Property] extends LazyItem<infer TSchema extends TreeNodeSchemaUnsafe> ? InsertableTypedNodeUnsafe<TSchema> : never;
735
- }[number];
740
+ }[NumberKeys<TList>];
736
741
  // @system
737
742
  export type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends ImplicitAllowedTypesUnsafe> = [TSchema] extends [TreeNodeSchemaUnsafe] ? InsertableTypedNodeUnsafe<TSchema> : [TSchema] extends [AllowedTypesUnsafe] ? InsertableTreeNodeFromAllowedTypesUnsafe<TSchema> : never;
738
743
  // @system
@@ -876,9 +881,32 @@ export namespace TableSchema {
876
881
  }
877
882
  }
878
883
 
884
+ // @beta @input
885
+ export type TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> = (WithValue<TSuccessValue> & {
886
+ readonly rollback?: false;
887
+ }) | (WithValue<TFailureValue> & {
888
+ readonly rollback: true;
889
+ });
890
+
879
891
  // @public
880
892
  export type TransactionConstraint = NodeInDocumentConstraint;
881
893
 
894
+ // @beta @sealed
895
+ export interface TransactionResultFailed<TFailureValue> extends WithValue<TFailureValue> {
896
+ readonly success: false;
897
+ }
898
+
899
+ // @beta @sealed
900
+ export interface TransactionResultSuccess<TSuccessValue> extends WithValue<TSuccessValue> {
901
+ readonly success: true;
902
+ }
903
+
904
+ // @beta @sealed
905
+ export type TransactionValueResult<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
906
+
907
+ // @beta @sealed
908
+ export type TransactionVoidResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
909
+
882
910
  // @public @sealed
883
911
  export interface Tree extends TreeNodeApi {
884
912
  contains(node: TreeNode, other: TreeNode): boolean;
@@ -1075,6 +1103,8 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
1075
1103
  export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>, TreeBranch {
1076
1104
  // (undocumented)
1077
1105
  fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
1106
+ runTransaction<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => TOut, params?: RunTransactionParamsBeta): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult;
1107
+ runTransactionAsync<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => Promise<TOut>, params?: RunTransactionParamsBeta): Promise<TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult>;
1078
1108
  }
1079
1109
 
1080
1110
  // @public @sealed
@@ -1152,6 +1182,9 @@ export interface ViewableTree {
1152
1182
  viewWith<TRoot extends ImplicitFieldSchema>(config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
1153
1183
  }
1154
1184
 
1185
+ // @beta @input
1186
+ export type VoidTransactionCallbackStatusBeta = Omit<TransactionCallbackStatusBeta<unknown, unknown>, "value">;
1187
+
1155
1188
  // @public @sealed
1156
1189
  export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind, out TInfo = unknown> {
1157
1190
  // @deprecated
@@ -1159,6 +1192,11 @@ export interface WithType<out TName extends string = string, out TKind extends N
1159
1192
  get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;
1160
1193
  }
1161
1194
 
1195
+ // @beta @input
1196
+ export interface WithValue<TValue> {
1197
+ readonly value: TValue;
1198
+ }
1199
+
1162
1200
  // (No @packageDocumentation comment for this package)
1163
1201
 
1164
1202
  ```
@@ -504,6 +504,11 @@ export interface RunTransaction {
504
504
  readonly rollback: typeof rollback;
505
505
  }
506
506
 
507
+ // @beta @input
508
+ export interface RunTransactionParamsBeta {
509
+ readonly label?: unknown;
510
+ }
511
+
507
512
  // @public @sealed
508
513
  export interface SchemaCompatibilityStatus {
509
514
  readonly canInitialize: boolean;
@@ -744,7 +749,7 @@ export namespace System_Unsafe {
744
749
  // @system
745
750
  export type InsertableTreeNodeFromAllowedTypesUnsafe<TList extends AllowedTypesUnsafe> = IsUnion<TList> extends true ? never : {
746
751
  readonly [Property in keyof TList]: TList[Property] extends LazyItem<infer TSchema extends TreeNodeSchemaUnsafe> ? InsertableTypedNodeUnsafe<TSchema> : never;
747
- }[number];
752
+ }[NumberKeys<TList>];
748
753
  // @system
749
754
  export type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends ImplicitAllowedTypesUnsafe> = [TSchema] extends [TreeNodeSchemaUnsafe] ? InsertableTypedNodeUnsafe<TSchema> : [TSchema] extends [AllowedTypesUnsafe] ? InsertableTreeNodeFromAllowedTypesUnsafe<TSchema> : never;
750
755
  // @system
@@ -888,9 +893,32 @@ export namespace TableSchema {
888
893
  }
889
894
  }
890
895
 
896
+ // @beta @input
897
+ export type TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> = (WithValue<TSuccessValue> & {
898
+ readonly rollback?: false;
899
+ }) | (WithValue<TFailureValue> & {
900
+ readonly rollback: true;
901
+ });
902
+
891
903
  // @public
892
904
  export type TransactionConstraint = NodeInDocumentConstraint;
893
905
 
906
+ // @beta @sealed
907
+ export interface TransactionResultFailed<TFailureValue> extends WithValue<TFailureValue> {
908
+ readonly success: false;
909
+ }
910
+
911
+ // @beta @sealed
912
+ export interface TransactionResultSuccess<TSuccessValue> extends WithValue<TSuccessValue> {
913
+ readonly success: true;
914
+ }
915
+
916
+ // @beta @sealed
917
+ export type TransactionValueResult<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
918
+
919
+ // @beta @sealed
920
+ export type TransactionVoidResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
921
+
894
922
  // @public @sealed
895
923
  export interface Tree extends TreeNodeApi {
896
924
  contains(node: TreeNode, other: TreeNode): boolean;
@@ -1087,6 +1115,8 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
1087
1115
  export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>, TreeBranch {
1088
1116
  // (undocumented)
1089
1117
  fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
1118
+ runTransaction<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => TOut, params?: RunTransactionParamsBeta): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult;
1119
+ runTransactionAsync<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => Promise<TOut>, params?: RunTransactionParamsBeta): Promise<TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult>;
1090
1120
  }
1091
1121
 
1092
1122
  // @public @sealed
@@ -1164,6 +1194,9 @@ export interface ViewableTree {
1164
1194
  viewWith<TRoot extends ImplicitFieldSchema>(config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
1165
1195
  }
1166
1196
 
1197
+ // @beta @input
1198
+ export type VoidTransactionCallbackStatusBeta = Omit<TransactionCallbackStatusBeta<unknown, unknown>, "value">;
1199
+
1167
1200
  // @public @sealed
1168
1201
  export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind, out TInfo = unknown> {
1169
1202
  // @deprecated
@@ -1171,6 +1204,11 @@ export interface WithType<out TName extends string = string, out TKind extends N
1171
1204
  get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;
1172
1205
  }
1173
1206
 
1207
+ // @beta @input
1208
+ export interface WithValue<TValue> {
1209
+ readonly value: TValue;
1210
+ }
1211
+
1174
1212
  // (No @packageDocumentation comment for this package)
1175
1213
 
1176
1214
  ```