@fluidframework/tree 2.103.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 (530) hide show
  1. package/.vscode/settings.json +1 -0
  2. package/CHANGELOG.md +109 -0
  3. package/api-report/tree.alpha.api.md +60 -34
  4. package/api-report/tree.beta.api.md +49 -3
  5. package/api-report/tree.legacy.beta.api.md +49 -3
  6. package/dist/codec/versioned/format.js +2 -24
  7. package/dist/codec/versioned/format.js.map +1 -1
  8. package/dist/core/change-family/changeFamily.d.ts +3 -10
  9. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  10. package/dist/core/change-family/changeFamily.js.map +1 -1
  11. package/dist/core/rebase/types.d.ts +2 -2
  12. package/dist/core/rebase/types.js +2 -24
  13. package/dist/core/rebase/types.js.map +1 -1
  14. package/dist/core/schema-stored/formatV1.js +2 -24
  15. package/dist/core/schema-stored/formatV1.js.map +1 -1
  16. package/dist/core/schema-stored/formatV2.js +2 -24
  17. package/dist/core/schema-stored/formatV2.js.map +1 -1
  18. package/dist/core/schema-stored/index.js +3 -25
  19. package/dist/core/schema-stored/index.js.map +1 -1
  20. package/dist/core/schema-stored/storedSchemaRepository.d.ts +2 -2
  21. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  22. package/dist/core/tree/anchorSet.js +4 -8
  23. package/dist/core/tree/anchorSet.js.map +1 -1
  24. package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -24
  25. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  26. package/dist/core/tree/detachedFieldIndexFormatV2.js +2 -24
  27. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  28. package/dist/core/tree/persistedTreeTextFormat.js +2 -24
  29. package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
  30. package/dist/entrypoints/alpha.d.ts +1 -1
  31. package/dist/entrypoints/alpha.d.ts.map +1 -1
  32. package/dist/entrypoints/alpha.js.map +1 -1
  33. package/dist/entrypoints/beta.d.ts +1 -1
  34. package/dist/entrypoints/beta.d.ts.map +1 -1
  35. package/dist/entrypoints/beta.js.map +1 -1
  36. package/dist/entrypoints/internal.js +2 -15
  37. package/dist/entrypoints/internal.js.map +1 -1
  38. package/dist/entrypoints/legacy.d.ts +1 -1
  39. package/dist/entrypoints/legacy.d.ts.map +1 -1
  40. package/dist/entrypoints/legacy.js.map +1 -1
  41. package/dist/feature-libraries/chunked-forest/chunkedForest.js +7 -11
  42. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  43. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
  44. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  45. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +13 -32
  46. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
  48. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  49. package/dist/feature-libraries/chunked-forest/codec/codecs.js +83 -9
  50. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  51. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
  52. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  53. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +11 -0
  54. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  55. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js +2 -24
  56. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +2 -24
  58. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +2 -24
  60. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js +2 -24
  62. package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
  66. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  67. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
  68. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  69. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
  70. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  71. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  72. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  73. package/dist/feature-libraries/chunked-forest/index.js +2 -1
  74. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  75. package/dist/feature-libraries/flex-tree/lazyEntity.js +9 -19
  76. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  77. package/dist/feature-libraries/flex-tree/lazyNode.js +3 -13
  78. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  79. package/dist/feature-libraries/forest-summary/codec.d.ts +3 -3
  80. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  81. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  82. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
  83. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  84. package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -6
  85. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  86. package/dist/feature-libraries/forest-summary/formatCommon.js +2 -24
  87. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  88. package/dist/feature-libraries/index.d.ts +1 -1
  89. package/dist/feature-libraries/index.d.ts.map +1 -1
  90. package/dist/feature-libraries/index.js +4 -25
  91. package/dist/feature-libraries/index.js.map +1 -1
  92. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js +2 -24
  93. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  94. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  95. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +9 -9
  96. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  97. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  98. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +10 -30
  99. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  100. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -24
  101. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  102. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +2 -24
  103. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  104. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -5
  105. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  106. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  107. package/dist/feature-libraries/object-forest/objectForest.js +11 -55
  108. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  109. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +2 -24
  110. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
  111. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +2 -24
  112. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
  113. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js +2 -24
  114. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  115. package/dist/feature-libraries/schema-index/formatV1.js +2 -24
  116. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
  117. package/dist/feature-libraries/schema-index/formatV2.js +2 -24
  118. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  119. package/dist/feature-libraries/sequence-field/formatV1.js +2 -24
  120. package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -1
  121. package/dist/feature-libraries/sequence-field/formatV2.js +2 -24
  122. package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
  123. package/dist/feature-libraries/sequence-field/formatV3.js +2 -24
  124. package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
  125. package/dist/index.d.ts +2 -2
  126. package/dist/index.d.ts.map +1 -1
  127. package/dist/index.js +4 -25
  128. package/dist/index.js.map +1 -1
  129. package/dist/packageVersion.d.ts +1 -1
  130. package/dist/packageVersion.js +1 -1
  131. package/dist/packageVersion.js.map +1 -1
  132. package/dist/shared-tree/independentView.d.ts.map +1 -1
  133. package/dist/shared-tree/independentView.js +4 -7
  134. package/dist/shared-tree/independentView.js.map +1 -1
  135. package/dist/shared-tree/index.d.ts +1 -1
  136. package/dist/shared-tree/index.d.ts.map +1 -1
  137. package/dist/shared-tree/index.js.map +1 -1
  138. package/dist/shared-tree/schematizingTreeView.d.ts +6 -5
  139. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  140. package/dist/shared-tree/schematizingTreeView.js +7 -41
  141. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  142. package/dist/shared-tree/sharedTree.d.ts +5 -1
  143. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  144. package/dist/shared-tree/sharedTree.js +13 -49
  145. package/dist/shared-tree/sharedTree.js.map +1 -1
  146. package/dist/shared-tree/sharedTreeChangeFormat.js +2 -24
  147. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  148. package/dist/shared-tree/transactionPostProcessor.d.ts +28 -0
  149. package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -0
  150. package/dist/shared-tree/transactionPostProcessor.js +28 -0
  151. package/dist/shared-tree/transactionPostProcessor.js.map +1 -0
  152. package/dist/shared-tree/treeAlpha.js +3 -3
  153. package/dist/shared-tree/treeAlpha.js.map +1 -1
  154. package/dist/shared-tree/treeCheckout.d.ts +28 -15
  155. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  156. package/dist/shared-tree/treeCheckout.js +124 -145
  157. package/dist/shared-tree/treeCheckout.js.map +1 -1
  158. package/dist/shared-tree/unhydratedTreeContext.d.ts +5 -5
  159. package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
  160. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  161. package/dist/shared-tree-core/branch.js +13 -17
  162. package/dist/shared-tree-core/branch.js.map +1 -1
  163. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -2
  164. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  165. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  166. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
  167. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  168. package/dist/shared-tree-core/editManagerCodecsCommons.js +2 -4
  169. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  170. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
  171. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  172. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  173. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
  174. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  175. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  176. package/dist/shared-tree-core/editManagerFormatCommons.js +2 -24
  177. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  178. package/dist/shared-tree-core/editManagerFormatV1toV4.js +2 -24
  179. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  180. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +2 -24
  181. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  182. package/dist/shared-tree-core/editManagerSummarizer.d.ts +5 -9
  183. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  184. package/dist/shared-tree-core/editManagerSummarizer.js +5 -10
  185. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  186. package/dist/shared-tree-core/index.d.ts +1 -1
  187. package/dist/shared-tree-core/index.d.ts.map +1 -1
  188. package/dist/shared-tree-core/index.js +3 -2
  189. package/dist/shared-tree-core/index.js.map +1 -1
  190. package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -24
  191. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  192. package/dist/shared-tree-core/messageFormatV1ToV4.js +2 -24
  193. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  194. package/dist/shared-tree-core/messageFormatVSharedBranches.js +2 -24
  195. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  196. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  197. package/dist/shared-tree-core/sharedTreeCore.js +9 -44
  198. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  199. package/dist/shared-tree-core/transaction.d.ts +84 -9
  200. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  201. package/dist/shared-tree-core/transaction.js +94 -37
  202. package/dist/shared-tree-core/transaction.js.map +1 -1
  203. package/dist/simple-tree/api/index.d.ts +1 -1
  204. package/dist/simple-tree/api/index.d.ts.map +1 -1
  205. package/dist/simple-tree/api/index.js.map +1 -1
  206. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
  207. package/dist/simple-tree/api/schemaCreationUtilities.js +3 -3
  208. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  209. package/dist/simple-tree/api/schemaFactory.d.ts +1 -1
  210. package/dist/simple-tree/api/schemaFactory.js +2 -2
  211. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  212. package/dist/simple-tree/api/simpleSchemaCodec.js +2 -24
  213. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  214. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
  215. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +4 -26
  216. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  217. package/dist/simple-tree/api/transactionTypes.d.ts +91 -28
  218. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  219. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  220. package/dist/simple-tree/api/tree.d.ts +96 -22
  221. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  222. package/dist/simple-tree/api/tree.js.map +1 -1
  223. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  224. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  225. package/dist/simple-tree/core/treeNodeKernel.js +83 -93
  226. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  227. package/dist/simple-tree/core/treeNodeSchema.d.ts +7 -7
  228. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  229. package/dist/simple-tree/core/unhydratedFlexTree.js +6 -10
  230. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  231. package/dist/simple-tree/index.d.ts +1 -1
  232. package/dist/simple-tree/index.d.ts.map +1 -1
  233. package/dist/simple-tree/index.js.map +1 -1
  234. package/dist/simple-tree/leafNodeSchema.js +2 -12
  235. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  236. package/dist/simple-tree/node-kinds/array/arrayNode.js +2 -6
  237. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  238. package/dist/simple-tree/simpleSchemaFormatV1.js +2 -24
  239. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  240. package/dist/tableSchema.d.ts +50 -4
  241. package/dist/tableSchema.d.ts.map +1 -1
  242. package/dist/tableSchema.js +202 -106
  243. package/dist/tableSchema.js.map +1 -1
  244. package/dist/text/index.d.ts +1 -0
  245. package/dist/text/index.d.ts.map +1 -1
  246. package/dist/text/index.js +3 -1
  247. package/dist/text/index.js.map +1 -1
  248. package/dist/text/textDomainFormatted.d.ts +69 -758
  249. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  250. package/dist/text/textDomainFormatted.js +275 -322
  251. package/dist/text/textDomainFormatted.js.map +1 -1
  252. package/dist/text/textDomainFormattedDefault.d.ts +273 -0
  253. package/dist/text/textDomainFormattedDefault.d.ts.map +1 -0
  254. package/dist/text/textDomainFormattedDefault.js +94 -0
  255. package/dist/text/textDomainFormattedDefault.js.map +1 -0
  256. package/dist/util/arrayUtilities.d.ts +20 -0
  257. package/dist/util/arrayUtilities.d.ts.map +1 -1
  258. package/dist/util/arrayUtilities.js +24 -1
  259. package/dist/util/arrayUtilities.js.map +1 -1
  260. package/dist/util/compressedIds.d.ts +118 -0
  261. package/dist/util/compressedIds.d.ts.map +1 -0
  262. package/dist/util/compressedIds.js +133 -0
  263. package/dist/util/compressedIds.js.map +1 -0
  264. package/dist/util/index.d.ts +2 -1
  265. package/dist/util/index.d.ts.map +1 -1
  266. package/dist/util/index.js +11 -2
  267. package/dist/util/index.js.map +1 -1
  268. package/dist/util/rangeMap.d.ts +13 -0
  269. package/dist/util/rangeMap.d.ts.map +1 -1
  270. package/dist/util/rangeMap.js +69 -8
  271. package/dist/util/rangeMap.js.map +1 -1
  272. package/dist/util/typeboxBrand.js +2 -24
  273. package/dist/util/typeboxBrand.js.map +1 -1
  274. package/dist/util/utils.js +2 -24
  275. package/dist/util/utils.js.map +1 -1
  276. package/eslint.config.mts +0 -30
  277. package/lib/core/change-family/changeFamily.d.ts +3 -10
  278. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  279. package/lib/core/change-family/changeFamily.js.map +1 -1
  280. package/lib/core/rebase/types.d.ts +2 -2
  281. package/lib/core/rebase/types.js.map +1 -1
  282. package/lib/core/schema-stored/storedSchemaRepository.d.ts +2 -2
  283. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  284. package/lib/core/tree/anchorSet.js +1 -5
  285. package/lib/core/tree/anchorSet.js.map +1 -1
  286. package/lib/entrypoints/alpha.d.ts +1 -1
  287. package/lib/entrypoints/alpha.d.ts.map +1 -1
  288. package/lib/entrypoints/alpha.js.map +1 -1
  289. package/lib/entrypoints/beta.d.ts +1 -1
  290. package/lib/entrypoints/beta.d.ts.map +1 -1
  291. package/lib/entrypoints/beta.js.map +1 -1
  292. package/lib/entrypoints/legacy.d.ts +1 -1
  293. package/lib/entrypoints/legacy.d.ts.map +1 -1
  294. package/lib/entrypoints/legacy.js.map +1 -1
  295. package/lib/feature-libraries/chunked-forest/chunkedForest.js +1 -5
  296. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  297. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
  298. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  299. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +14 -33
  300. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  301. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
  302. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  303. package/lib/feature-libraries/chunked-forest/codec/codecs.js +82 -9
  304. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  305. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
  306. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  307. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +12 -1
  308. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  309. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  310. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  311. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  312. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  313. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
  314. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  315. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
  316. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  317. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  318. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  319. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  320. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  321. package/lib/feature-libraries/flex-tree/lazyEntity.js +1 -11
  322. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  323. package/lib/feature-libraries/flex-tree/lazyNode.js +1 -11
  324. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  325. package/lib/feature-libraries/forest-summary/codec.d.ts +3 -3
  326. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  327. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  328. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
  329. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  330. package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -6
  331. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  332. package/lib/feature-libraries/index.d.ts +1 -1
  333. package/lib/feature-libraries/index.d.ts.map +1 -1
  334. package/lib/feature-libraries/index.js +1 -1
  335. package/lib/feature-libraries/index.js.map +1 -1
  336. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  337. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +10 -10
  338. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  339. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  340. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +10 -30
  341. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  342. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -5
  343. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  344. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  345. package/lib/feature-libraries/object-forest/objectForest.js +1 -45
  346. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  347. package/lib/index.d.ts +2 -2
  348. package/lib/index.d.ts.map +1 -1
  349. package/lib/index.js +1 -1
  350. package/lib/index.js.map +1 -1
  351. package/lib/packageVersion.d.ts +1 -1
  352. package/lib/packageVersion.js +1 -1
  353. package/lib/packageVersion.js.map +1 -1
  354. package/lib/shared-tree/independentView.d.ts.map +1 -1
  355. package/lib/shared-tree/independentView.js +5 -8
  356. package/lib/shared-tree/independentView.js.map +1 -1
  357. package/lib/shared-tree/index.d.ts +1 -1
  358. package/lib/shared-tree/index.d.ts.map +1 -1
  359. package/lib/shared-tree/index.js.map +1 -1
  360. package/lib/shared-tree/schematizingTreeView.d.ts +6 -5
  361. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  362. package/lib/shared-tree/schematizingTreeView.js +4 -38
  363. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  364. package/lib/shared-tree/sharedTree.d.ts +5 -1
  365. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  366. package/lib/shared-tree/sharedTree.js +9 -45
  367. package/lib/shared-tree/sharedTree.js.map +1 -1
  368. package/lib/shared-tree/transactionPostProcessor.d.ts +28 -0
  369. package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -0
  370. package/lib/shared-tree/transactionPostProcessor.js +23 -0
  371. package/lib/shared-tree/transactionPostProcessor.js.map +1 -0
  372. package/lib/shared-tree/treeAlpha.js +3 -3
  373. package/lib/shared-tree/treeAlpha.js.map +1 -1
  374. package/lib/shared-tree/treeCheckout.d.ts +28 -15
  375. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  376. package/lib/shared-tree/treeCheckout.js +80 -101
  377. package/lib/shared-tree/treeCheckout.js.map +1 -1
  378. package/lib/shared-tree/unhydratedTreeContext.d.ts +5 -5
  379. package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
  380. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  381. package/lib/shared-tree-core/branch.js +1 -5
  382. package/lib/shared-tree-core/branch.js.map +1 -1
  383. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -2
  384. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  385. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  386. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
  387. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  388. package/lib/shared-tree-core/editManagerCodecsCommons.js +3 -5
  389. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  390. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
  391. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  392. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  393. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
  394. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  395. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  396. package/lib/shared-tree-core/editManagerSummarizer.d.ts +5 -9
  397. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  398. package/lib/shared-tree-core/editManagerSummarizer.js +5 -10
  399. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  400. package/lib/shared-tree-core/index.d.ts +1 -1
  401. package/lib/shared-tree-core/index.d.ts.map +1 -1
  402. package/lib/shared-tree-core/index.js +1 -1
  403. package/lib/shared-tree-core/index.js.map +1 -1
  404. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  405. package/lib/shared-tree-core/sharedTreeCore.js +4 -39
  406. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  407. package/lib/shared-tree-core/transaction.d.ts +84 -9
  408. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  409. package/lib/shared-tree-core/transaction.js +74 -17
  410. package/lib/shared-tree-core/transaction.js.map +1 -1
  411. package/lib/simple-tree/api/index.d.ts +1 -1
  412. package/lib/simple-tree/api/index.d.ts.map +1 -1
  413. package/lib/simple-tree/api/index.js.map +1 -1
  414. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
  415. package/lib/simple-tree/api/schemaCreationUtilities.js +3 -3
  416. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  417. package/lib/simple-tree/api/schemaFactory.d.ts +1 -1
  418. package/lib/simple-tree/api/schemaFactory.js +2 -2
  419. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  420. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
  421. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  422. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  423. package/lib/simple-tree/api/transactionTypes.d.ts +91 -28
  424. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  425. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  426. package/lib/simple-tree/api/tree.d.ts +96 -22
  427. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  428. package/lib/simple-tree/api/tree.js.map +1 -1
  429. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  430. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  431. package/lib/simple-tree/core/treeNodeKernel.js +1 -11
  432. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  433. package/lib/simple-tree/core/treeNodeSchema.d.ts +7 -7
  434. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  435. package/lib/simple-tree/core/unhydratedFlexTree.js +1 -5
  436. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  437. package/lib/simple-tree/index.d.ts +1 -1
  438. package/lib/simple-tree/index.d.ts.map +1 -1
  439. package/lib/simple-tree/index.js.map +1 -1
  440. package/lib/simple-tree/leafNodeSchema.js +1 -11
  441. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  442. package/lib/simple-tree/node-kinds/array/arrayNode.js +1 -5
  443. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  444. package/lib/tableSchema.d.ts +50 -4
  445. package/lib/tableSchema.d.ts.map +1 -1
  446. package/lib/tableSchema.js +171 -75
  447. package/lib/tableSchema.js.map +1 -1
  448. package/lib/text/index.d.ts +1 -0
  449. package/lib/text/index.d.ts.map +1 -1
  450. package/lib/text/index.js +1 -0
  451. package/lib/text/index.js.map +1 -1
  452. package/lib/text/textDomainFormatted.d.ts +69 -758
  453. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  454. package/lib/text/textDomainFormatted.js +277 -324
  455. package/lib/text/textDomainFormatted.js.map +1 -1
  456. package/lib/text/textDomainFormattedDefault.d.ts +273 -0
  457. package/lib/text/textDomainFormattedDefault.d.ts.map +1 -0
  458. package/lib/text/textDomainFormattedDefault.js +91 -0
  459. package/lib/text/textDomainFormattedDefault.js.map +1 -0
  460. package/lib/util/arrayUtilities.d.ts +20 -0
  461. package/lib/util/arrayUtilities.d.ts.map +1 -1
  462. package/lib/util/arrayUtilities.js +22 -0
  463. package/lib/util/arrayUtilities.js.map +1 -1
  464. package/lib/util/compressedIds.d.ts +118 -0
  465. package/lib/util/compressedIds.d.ts.map +1 -0
  466. package/lib/util/compressedIds.js +124 -0
  467. package/lib/util/compressedIds.js.map +1 -0
  468. package/lib/util/index.d.ts +2 -1
  469. package/lib/util/index.d.ts.map +1 -1
  470. package/lib/util/index.js +2 -1
  471. package/lib/util/index.js.map +1 -1
  472. package/lib/util/rangeMap.d.ts +13 -0
  473. package/lib/util/rangeMap.d.ts.map +1 -1
  474. package/lib/util/rangeMap.js +69 -8
  475. package/lib/util/rangeMap.js.map +1 -1
  476. package/package.json +25 -24
  477. package/src/core/change-family/changeFamily.ts +3 -12
  478. package/src/core/rebase/types.ts +2 -2
  479. package/src/core/schema-stored/storedSchemaRepository.ts +2 -2
  480. package/src/entrypoints/alpha.ts +12 -8
  481. package/src/entrypoints/beta.ts +8 -0
  482. package/src/entrypoints/legacy.ts +8 -0
  483. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +35 -64
  484. package/src/feature-libraries/chunked-forest/codec/codecs.ts +138 -42
  485. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +32 -4
  486. package/src/feature-libraries/chunked-forest/codec/index.ts +1 -0
  487. package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +7 -19
  488. package/src/feature-libraries/chunked-forest/index.ts +3 -0
  489. package/src/feature-libraries/forest-summary/codec.ts +5 -3
  490. package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -5
  491. package/src/feature-libraries/index.ts +3 -0
  492. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +13 -9
  493. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -47
  494. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +0 -5
  495. package/src/index.ts +13 -8
  496. package/src/packageVersion.ts +1 -1
  497. package/src/shared-tree/independentView.ts +5 -10
  498. package/src/shared-tree/index.ts +1 -0
  499. package/src/shared-tree/schematizingTreeView.ts +29 -25
  500. package/src/shared-tree/sharedTree.ts +18 -10
  501. package/src/shared-tree/transactionPostProcessor.ts +40 -0
  502. package/src/shared-tree/treeAlpha.ts +3 -3
  503. package/src/shared-tree/treeCheckout.ts +120 -95
  504. package/src/shared-tree/unhydratedTreeContext.ts +18 -15
  505. package/src/shared-tree-core/editManagerCodecs.ts +3 -2
  506. package/src/shared-tree-core/editManagerCodecsCommons.ts +10 -14
  507. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -2
  508. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -2
  509. package/src/shared-tree-core/editManagerSummarizer.ts +5 -9
  510. package/src/shared-tree-core/index.ts +8 -5
  511. package/src/shared-tree-core/sharedTreeCore.ts +3 -2
  512. package/src/shared-tree-core/transaction.ts +148 -18
  513. package/src/simple-tree/api/index.ts +13 -9
  514. package/src/simple-tree/api/schemaCreationUtilities.ts +3 -3
  515. package/src/simple-tree/api/schemaFactory.ts +2 -2
  516. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +2 -2
  517. package/src/simple-tree/api/transactionTypes.ts +111 -39
  518. package/src/simple-tree/api/tree.ts +152 -47
  519. package/src/simple-tree/api/treeBeta.ts +2 -0
  520. package/src/simple-tree/core/treeNodeSchema.ts +7 -7
  521. package/src/simple-tree/index.ts +12 -8
  522. package/src/tableSchema.ts +306 -80
  523. package/src/text/index.ts +1 -0
  524. package/src/text/textDomainFormatted.ts +520 -415
  525. package/src/text/textDomainFormattedDefault.ts +150 -0
  526. package/src/util/arrayUtilities.ts +35 -0
  527. package/src/util/compressedIds.ts +216 -0
  528. package/src/util/index.ts +17 -0
  529. package/src/util/rangeMap.ts +108 -9
  530. package/tsconfig.json +5 -0
@@ -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,114 @@
1
1
  # @fluidframework/tree
2
2
 
3
+ ## 2.111.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 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)
8
+
9
+ `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.
10
+
11
+ `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.
12
+
13
+ Note: minimization is the first intended implementation and use of post-processing, but it is not yet available.
14
+
15
+ - TreeView transaction APIs have been promoted to beta ([#27592](https://github.com/microsoft/FluidFramework/pull/27592)) [1ed11dbeddd](https://github.com/microsoft/FluidFramework/commit/1ed11dbeddd98fd0b788aad6f74b6d480249ce28)
16
+
17
+ The [TreeViewBeta](https://fluidframework.com/docs/api/fluid-framework/treeviewbeta-interface) interface exposes `runTransaction` and `runTransactionAsync` methods.
18
+
19
+ The [asBeta](https://fluidframework.com/docs/api/fluid-framework/#asbeta-function) helper function can be used to down-cast a `TreeView` to a `TreeViewBeta`.
20
+
21
+ ```typescript
22
+ import { asBeta } from "fluid-framework/beta";
23
+ // ...
24
+ const view = asBeta(tree.viewWith(config));
25
+ const result = view.runTransaction(() => {
26
+ // ... make edits to the tree ...
27
+ });
28
+ if (result.success === false) {
29
+ // ... handle the failed transaction ...
30
+ }
31
+ ```
32
+
33
+ > [!IMPORTANT]
34
+ > Transaction constraints are not yet available as a part of the beta transaction APIs.
35
+ > These capabilities can still be accessed via the updated alpha APIs.
36
+
37
+ **Type Name Changes**
38
+
39
+ With the introduction of new beta types, existing alpha types have been replaced with new alpha and beta variants.
40
+
41
+ | Old | New Alpha | New Beta |
42
+ | ------------------------------- | ------------------------------------ | ----------------------------------- |
43
+ | `RunTransactionParams` | `RunTransactionParamsAlpha` | `RunTransactionParamsBeta` |
44
+ | `TransactionCallbackStatus` | `TransactionCallbackStatusAlpha` | `TransactionCallbackStatusBeta` |
45
+ | `VoidTransactionCallbackStatus` | `VoidTransactionCallbackStatusAlpha` | `VoidTransactionCallbackStatusBeta` |
46
+
47
+ **Other Renames**
48
+ - `TransactionResult` (alpha) -> `TransactionVoidResult` (beta)
49
+ - `TransactionResultExt` (alpha) -> `TransactionValueResult` (beta)
50
+
51
+ ## 2.110.0
52
+
53
+ ### Minor Changes
54
+
55
+ - TreeBranchAlpha.isMissingEditsFrom ([#27583](https://github.com/microsoft/FluidFramework/pull/27583)) [ef92f1f1cd8](https://github.com/microsoft/FluidFramework/commit/ef92f1f1cd880ed361e9f8efa49fb23c4ee64ca3)
56
+
57
+ Adds a new method (`isMissingEditsFrom(branch: TreeBranch): boolean`) to `TreeBranchAlpha`.
58
+ `isMissingEditsFrom` can be used to determine whether there are edits on the given `branch` that have not yet been merged into this branch.
59
+
60
+ - Forks created on "changed" event are no longer auto-disposed ([#27580](https://github.com/microsoft/FluidFramework/pull/27580)) [ae64be7688e](https://github.com/microsoft/FluidFramework/commit/ae64be7688e26da9bfc5c0286e50d3df0647ff3a)
61
+
62
+ The "changed" event is emitted from a `TreeBranch` when a change is made to the branch.
63
+ Previously, when this event was fired due to a transaction being committed, it was possible to fork the branch in response to the "changed" event, but such a fork would be automatically disposed immediately after the event callback.
64
+ This was a bug. Such forks are no longer disposed automatically.
65
+
66
+ - Editing a SharedTree during its change-event callbacks now consistently throws ([#27285](https://github.com/microsoft/FluidFramework/pull/27285)) [255d4505ed5](https://github.com/microsoft/FluidFramework/commit/255d4505ed574676735c6f2078199e5b29dede2a)
67
+
68
+ Editing a `SharedTree` from inside one of its change-event callbacks has always been forbidden, but some paths were not being caught: edits and the start of a transaction (along with branch operations, reverts, etc.) made while the tree was emitting its post-change notification ran to completion instead of throwing.
69
+
70
+ Such edits would apply to the tree, trigger further change notifications, and could re-enter the same listener for the resulting commits.
71
+ This can produce infinite edit loops, redundant work across clients, incorrect attribution, broken undo/redo grouping, and pollution of the outer commit's label data.
72
+
73
+ This release closes those gaps: both editing the tree and starting a transaction during a change-event callback now throw the same canonical `UsageError` as the other change-event callbacks:
74
+
75
+ > Editing the tree is forbidden during a change event callback
76
+
77
+ > Running a transaction is forbidden during a change event callback
78
+
79
+ More generally, edits should not be made in response to changes to the document.
80
+ See [Editing in response to change events](https://fluidframework.com/docs/data-structures/tree/events#editing-in-response-to-change-events) for why, and for the recommended alternatives.
81
+
82
+ - TableSchema (beta) methods now accept positional arguments ([#27545](https://github.com/microsoft/FluidFramework/pull/27545)) [e121ff71f3e](https://github.com/microsoft/FluidFramework/commit/e121ff71f3ebed80c656315486933fe2d6859b32)
83
+
84
+ The `insertColumns`, `insertRows`, `setCell`, and `removeCell` methods on `TableSchema.Table` now accept positional arguments in addition to the existing property-bag form.
85
+ The new overloads remove a layer of object construction at call sites and make the common cases more concise.
86
+
87
+ The existing property-bag overloads continue to work but are now deprecated.
88
+ They will be removed in a future release.
89
+
90
+ #### Migration
91
+
92
+ ```typescript
93
+ // ...
94
+
95
+ // Before
96
+ table.insertColumns({ columns: [columnA, columnB] });
97
+ table.insertColumns({ index: 0, columns: [columnA] });
98
+ table.insertRows({ rows: [rowA, rowB] });
99
+ table.insertRows({ index: 0, rows: [rowA] });
100
+ table.setCell({ key: { column, row }, cell });
101
+ table.removeCell({ column, row });
102
+
103
+ // After
104
+ table.insertColumns([columnA, columnB]);
105
+ table.insertColumns([columnA], 0);
106
+ table.insertRows([rowA, rowB]);
107
+ table.insertRows([rowA], 0);
108
+ table.setCell(row, column, cell);
109
+ table.removeCell(row, column);
110
+ ```
111
+
3
112
  ## 2.103.0
4
113
 
5
114
  Dependency updates only.
@@ -1074,11 +1074,16 @@ export interface RunTransaction {
1074
1074
  }
1075
1075
 
1076
1076
  // @alpha @input
1077
- export interface RunTransactionParams {
1078
- readonly label?: unknown;
1077
+ export interface RunTransactionParamsAlpha extends RunTransactionParamsBeta {
1078
+ readonly postProcessor?: TransactionPostProcessor;
1079
1079
  readonly preconditions?: readonly TransactionConstraintAlpha[];
1080
1080
  }
1081
1081
 
1082
+ // @beta @input
1083
+ export interface RunTransactionParamsBeta {
1084
+ readonly label?: unknown;
1085
+ }
1086
+
1082
1087
  // @public @sealed
1083
1088
  export interface SchemaCompatibilityStatus {
1084
1089
  readonly canInitialize: boolean;
@@ -1522,12 +1527,12 @@ export namespace TableSchema {
1522
1527
  export function column<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateColumnOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
1523
1528
  readonly props: TProps;
1524
1529
  }): System_TableSchema.ColumnSchemaBase<TUserScope, TCell, TProps>;
1525
- // @input
1530
+ // @deprecated @input
1526
1531
  export interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
1527
1532
  readonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];
1528
1533
  readonly index?: number | undefined;
1529
1534
  }
1530
- // @input
1535
+ // @deprecated @input
1531
1536
  export interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
1532
1537
  readonly index?: number | undefined;
1533
1538
  readonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];
@@ -1542,7 +1547,7 @@ export namespace TableSchema {
1542
1547
  export function row<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateRowOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
1543
1548
  readonly props: TProps;
1544
1549
  }): System_TableSchema.RowSchemaBase<TUserScope, TCell, TProps>;
1545
- // @input
1550
+ // @deprecated @input
1546
1551
  export interface SetCellParameters<TCell extends ImplicitAllowedTypes, TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
1547
1552
  readonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;
1548
1553
  readonly key: CellKey<TColumn, TRow>;
@@ -1555,8 +1560,14 @@ export namespace TableSchema {
1555
1560
  getColumn(index: number): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
1556
1561
  getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
1557
1562
  getRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
1563
+ insertColumns(columns: readonly InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[], index?: number): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1564
+ // @deprecated
1558
1565
  insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1566
+ insertRows(rows: readonly InsertableTreeNodeFromImplicitAllowedTypes<TRow>[], index?: number): TreeNodeFromImplicitAllowedTypes<TRow>[];
1567
+ // @deprecated
1559
1568
  insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];
1569
+ removeCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1570
+ // @deprecated
1560
1571
  removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1561
1572
  removeColumns(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1562
1573
  removeColumns(columns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
@@ -1565,6 +1576,8 @@ export namespace TableSchema {
1565
1576
  removeRows(rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
1566
1577
  removeRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
1567
1578
  readonly rows: System_TableSchema.RearrangeableList<TRow>;
1579
+ setCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>, cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
1580
+ // @deprecated
1568
1581
  setCell(params: SetCellParameters<TCell, TColumn, TRow>): void;
1569
1582
  }
1570
1583
  export function table<const TUserScope extends string, const TCell extends ImplicitAllowedTypes>(params: System_TableSchema.TableFactoryOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell>): System_TableSchema.TableSchemaBase<TUserScope, TCell, System_TableSchema.ColumnSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>, System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>>;
@@ -1624,15 +1637,18 @@ export namespace TextAsTree {
1624
1637
  // @alpha
1625
1638
  export function trackDirtyNodes(view: TreeViewAlpha<ImplicitFieldSchema>, dirty: DirtyTreeMap): () => void;
1626
1639
 
1627
- // @alpha
1628
- export type TransactionCallbackStatus<TSuccessValue, TFailureValue> = ((WithValue<TSuccessValue> & {
1629
- rollback?: false;
1630
- }) | (WithValue<TFailureValue> & {
1631
- rollback: true;
1632
- })) & {
1633
- preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
1640
+ // @alpha @input
1641
+ export type TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue> = TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> & {
1642
+ readonly preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
1634
1643
  };
1635
1644
 
1645
+ // @beta @input
1646
+ export type TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> = (WithValue<TSuccessValue> & {
1647
+ readonly rollback?: false;
1648
+ }) | (WithValue<TFailureValue> & {
1649
+ readonly rollback: true;
1650
+ });
1651
+
1636
1652
  // @public
1637
1653
  export type TransactionConstraint = NodeInDocumentConstraint;
1638
1654
 
@@ -1644,22 +1660,26 @@ export type TransactionLabels = Set<unknown> & {
1644
1660
  tree?: LabelTree;
1645
1661
  };
1646
1662
 
1647
- // @alpha
1648
- export type TransactionResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
1649
-
1650
- // @alpha
1651
- export type TransactionResultExt<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
1663
+ // @alpha @sealed @system
1664
+ export interface TransactionPostProcessor extends ErasedType<"@fluidframework/tree.TransactionPostProcessor"> {
1665
+ }
1652
1666
 
1653
- // @alpha
1667
+ // @beta @sealed
1654
1668
  export interface TransactionResultFailed<TFailureValue> extends WithValue<TFailureValue> {
1655
- success: false;
1669
+ readonly success: false;
1656
1670
  }
1657
1671
 
1658
- // @alpha
1672
+ // @beta @sealed
1659
1673
  export interface TransactionResultSuccess<TSuccessValue> extends WithValue<TSuccessValue> {
1660
- success: true;
1674
+ readonly success: true;
1661
1675
  }
1662
1676
 
1677
+ // @beta @sealed
1678
+ export type TransactionValueResult<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
1679
+
1680
+ // @beta @sealed
1681
+ export type TransactionVoidResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
1682
+
1663
1683
  // @public @sealed
1664
1684
  export interface Tree extends TreeNodeApi {
1665
1685
  contains(node: TreeNode, other: TreeNode): boolean;
@@ -1760,10 +1780,11 @@ export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
1760
1780
  // (undocumented)
1761
1781
  fork(): TreeBranchAlpha;
1762
1782
  hasRootSchema<TSchema extends ImplicitFieldSchema>(schema: TSchema): this is TreeViewAlpha<TSchema>;
1763
- runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>, params?: RunTransactionParams): TransactionResultExt<TSuccessValue, TFailureValue>;
1764
- runTransaction(transaction: () => VoidTransactionCallbackStatus | void, params?: RunTransactionParams): TransactionResult;
1765
- runTransactionAsync<TSuccessValue, TFailureValue>(transaction: () => Promise<TransactionCallbackStatus<TSuccessValue, TFailureValue>>, params?: RunTransactionParams): Promise<TransactionResultExt<TSuccessValue, TFailureValue>>;
1766
- runTransactionAsync(transaction: () => Promise<VoidTransactionCallbackStatus | void>, params?: RunTransactionParams): Promise<TransactionResult>;
1783
+ isMissingEditsFrom(branch: TreeBranch): boolean;
1784
+ runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>, params?: RunTransactionParamsAlpha): TransactionValueResult<TSuccessValue, TFailureValue>;
1785
+ runTransaction(transaction: () => VoidTransactionCallbackStatusAlpha | void, params?: RunTransactionParamsAlpha): TransactionVoidResult;
1786
+ runTransactionAsync<TSuccessValue, TFailureValue>(transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>, params?: RunTransactionParamsAlpha): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
1787
+ runTransactionAsync(transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>, params?: RunTransactionParamsAlpha): Promise<TransactionVoidResult>;
1767
1788
  }
1768
1789
 
1769
1790
  // @alpha @sealed
@@ -1798,10 +1819,10 @@ export enum TreeCompressionStrategy {
1798
1819
  // @alpha
1799
1820
  export interface TreeContextAlpha {
1800
1821
  isBranch(): this is TreeBranchAlpha;
1801
- runTransaction<TValue>(transaction: () => WithValue<TValue>, params?: RunTransactionParams): TransactionResultExt<TValue, TValue>;
1802
- runTransaction(transaction: () => void, params?: RunTransactionParams): TransactionResult;
1803
- runTransactionAsync<TValue>(transaction: () => Promise<WithValue<TValue>>, params?: RunTransactionParams): Promise<TransactionResultExt<TValue, TValue>>;
1804
- runTransactionAsync(transaction: () => Promise<void>, params?: RunTransactionParams): Promise<TransactionResult>;
1822
+ runTransaction<TValue>(transaction: () => WithValue<TValue>, params?: RunTransactionParamsAlpha): TransactionValueResult<TValue, TValue>;
1823
+ runTransaction(transaction: () => void, params?: RunTransactionParamsAlpha): TransactionVoidResult;
1824
+ runTransactionAsync<TValue>(transaction: () => Promise<WithValue<TValue>>, params?: RunTransactionParamsAlpha): Promise<TransactionValueResult<TValue, TValue>>;
1825
+ runTransactionAsync(transaction: () => Promise<void>, params?: RunTransactionParamsAlpha): Promise<TransactionVoidResult>;
1805
1826
  }
1806
1827
 
1807
1828
  // @beta @input
@@ -1955,7 +1976,7 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
1955
1976
  }
1956
1977
 
1957
1978
  // @alpha @sealed
1958
- export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> extends Omit<TreeViewBeta<ReadSchema<TSchema>>, "root" | "initialize" | "fork">, TreeBranchAlpha {
1979
+ export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> extends Omit<TreeViewBeta<ReadSchema<TSchema>>, "root" | "initialize" | "fork" | "runTransaction" | "runTransactionAsync">, TreeBranchAlpha {
1959
1980
  // (undocumented)
1960
1981
  readonly events: Listenable_2<TreeViewEvents & TreeBranchEvents>;
1961
1982
  // (undocumented)
@@ -1971,6 +1992,8 @@ export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | Unsa
1971
1992
  export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>, TreeBranch {
1972
1993
  // (undocumented)
1973
1994
  fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
1995
+ runTransaction<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => TOut, params?: RunTransactionParamsBeta): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult;
1996
+ 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>;
1974
1997
  }
1975
1998
 
1976
1999
  // @public @sealed
@@ -2095,8 +2118,11 @@ export interface ViewContent {
2095
2118
  readonly tree: JsonCompatible<IFluidHandle>;
2096
2119
  }
2097
2120
 
2098
- // @alpha
2099
- export type VoidTransactionCallbackStatus = Omit<TransactionCallbackStatus<unknown, unknown>, "value">;
2121
+ // @alpha @input
2122
+ export type VoidTransactionCallbackStatusAlpha = Omit<TransactionCallbackStatusAlpha<unknown, unknown>, "value">;
2123
+
2124
+ // @beta @input
2125
+ export type VoidTransactionCallbackStatusBeta = Omit<TransactionCallbackStatusBeta<unknown, unknown>, "value">;
2100
2126
 
2101
2127
  // @public @sealed
2102
2128
  export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind, out TInfo = unknown> {
@@ -2105,9 +2131,9 @@ export interface WithType<out TName extends string = string, out TKind extends N
2105
2131
  get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;
2106
2132
  }
2107
2133
 
2108
- // @alpha
2134
+ // @beta @input
2109
2135
  export interface WithValue<TValue> {
2110
- value: TValue;
2136
+ readonly value: TValue;
2111
2137
  }
2112
2138
 
2113
2139
  // (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;
@@ -805,12 +810,12 @@ export namespace TableSchema {
805
810
  export function column<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateColumnOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
806
811
  readonly props: TProps;
807
812
  }): System_TableSchema.ColumnSchemaBase<TUserScope, TCell, TProps>;
808
- // @input
813
+ // @deprecated @input
809
814
  export interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
810
815
  readonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];
811
816
  readonly index?: number | undefined;
812
817
  }
813
- // @input
818
+ // @deprecated @input
814
819
  export interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
815
820
  readonly index?: number | undefined;
816
821
  readonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];
@@ -825,7 +830,7 @@ export namespace TableSchema {
825
830
  export function row<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateRowOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
826
831
  readonly props: TProps;
827
832
  }): System_TableSchema.RowSchemaBase<TUserScope, TCell, TProps>;
828
- // @input
833
+ // @deprecated @input
829
834
  export interface SetCellParameters<TCell extends ImplicitAllowedTypes, TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
830
835
  readonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;
831
836
  readonly key: CellKey<TColumn, TRow>;
@@ -838,8 +843,14 @@ export namespace TableSchema {
838
843
  getColumn(index: number): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
839
844
  getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
840
845
  getRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
846
+ insertColumns(columns: readonly InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[], index?: number): TreeNodeFromImplicitAllowedTypes<TColumn>[];
847
+ // @deprecated
841
848
  insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];
849
+ insertRows(rows: readonly InsertableTreeNodeFromImplicitAllowedTypes<TRow>[], index?: number): TreeNodeFromImplicitAllowedTypes<TRow>[];
850
+ // @deprecated
842
851
  insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];
852
+ removeCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
853
+ // @deprecated
843
854
  removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
844
855
  removeColumns(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TColumn>[];
845
856
  removeColumns(columns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
@@ -848,6 +859,8 @@ export namespace TableSchema {
848
859
  removeRows(rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
849
860
  removeRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
850
861
  readonly rows: System_TableSchema.RearrangeableList<TRow>;
862
+ setCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>, cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
863
+ // @deprecated
851
864
  setCell(params: SetCellParameters<TCell, TColumn, TRow>): void;
852
865
  }
853
866
  export function table<const TUserScope extends string, const TCell extends ImplicitAllowedTypes>(params: System_TableSchema.TableFactoryOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell>): System_TableSchema.TableSchemaBase<TUserScope, TCell, System_TableSchema.ColumnSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>, System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>>;
@@ -868,9 +881,32 @@ export namespace TableSchema {
868
881
  }
869
882
  }
870
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
+
871
891
  // @public
872
892
  export type TransactionConstraint = NodeInDocumentConstraint;
873
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
+
874
910
  // @public @sealed
875
911
  export interface Tree extends TreeNodeApi {
876
912
  contains(node: TreeNode, other: TreeNode): boolean;
@@ -1067,6 +1103,8 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
1067
1103
  export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>, TreeBranch {
1068
1104
  // (undocumented)
1069
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>;
1070
1108
  }
1071
1109
 
1072
1110
  // @public @sealed
@@ -1144,6 +1182,9 @@ export interface ViewableTree {
1144
1182
  viewWith<TRoot extends ImplicitFieldSchema>(config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
1145
1183
  }
1146
1184
 
1185
+ // @beta @input
1186
+ export type VoidTransactionCallbackStatusBeta = Omit<TransactionCallbackStatusBeta<unknown, unknown>, "value">;
1187
+
1147
1188
  // @public @sealed
1148
1189
  export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind, out TInfo = unknown> {
1149
1190
  // @deprecated
@@ -1151,6 +1192,11 @@ export interface WithType<out TName extends string = string, out TKind extends N
1151
1192
  get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;
1152
1193
  }
1153
1194
 
1195
+ // @beta @input
1196
+ export interface WithValue<TValue> {
1197
+ readonly value: TValue;
1198
+ }
1199
+
1154
1200
  // (No @packageDocumentation comment for this package)
1155
1201
 
1156
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;
@@ -817,12 +822,12 @@ export namespace TableSchema {
817
822
  export function column<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateColumnOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
818
823
  readonly props: TProps;
819
824
  }): System_TableSchema.ColumnSchemaBase<TUserScope, TCell, TProps>;
820
- // @input
825
+ // @deprecated @input
821
826
  export interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
822
827
  readonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];
823
828
  readonly index?: number | undefined;
824
829
  }
825
- // @input
830
+ // @deprecated @input
826
831
  export interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
827
832
  readonly index?: number | undefined;
828
833
  readonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];
@@ -837,7 +842,7 @@ export namespace TableSchema {
837
842
  export function row<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateRowOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
838
843
  readonly props: TProps;
839
844
  }): System_TableSchema.RowSchemaBase<TUserScope, TCell, TProps>;
840
- // @input
845
+ // @deprecated @input
841
846
  export interface SetCellParameters<TCell extends ImplicitAllowedTypes, TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
842
847
  readonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;
843
848
  readonly key: CellKey<TColumn, TRow>;
@@ -850,8 +855,14 @@ export namespace TableSchema {
850
855
  getColumn(index: number): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
851
856
  getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
852
857
  getRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
858
+ insertColumns(columns: readonly InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[], index?: number): TreeNodeFromImplicitAllowedTypes<TColumn>[];
859
+ // @deprecated
853
860
  insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];
861
+ insertRows(rows: readonly InsertableTreeNodeFromImplicitAllowedTypes<TRow>[], index?: number): TreeNodeFromImplicitAllowedTypes<TRow>[];
862
+ // @deprecated
854
863
  insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];
864
+ removeCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
865
+ // @deprecated
855
866
  removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
856
867
  removeColumns(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TColumn>[];
857
868
  removeColumns(columns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
@@ -860,6 +871,8 @@ export namespace TableSchema {
860
871
  removeRows(rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
861
872
  removeRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
862
873
  readonly rows: System_TableSchema.RearrangeableList<TRow>;
874
+ setCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>, cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
875
+ // @deprecated
863
876
  setCell(params: SetCellParameters<TCell, TColumn, TRow>): void;
864
877
  }
865
878
  export function table<const TUserScope extends string, const TCell extends ImplicitAllowedTypes>(params: System_TableSchema.TableFactoryOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell>): System_TableSchema.TableSchemaBase<TUserScope, TCell, System_TableSchema.ColumnSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>, System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>>;
@@ -880,9 +893,32 @@ export namespace TableSchema {
880
893
  }
881
894
  }
882
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
+
883
903
  // @public
884
904
  export type TransactionConstraint = NodeInDocumentConstraint;
885
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
+
886
922
  // @public @sealed
887
923
  export interface Tree extends TreeNodeApi {
888
924
  contains(node: TreeNode, other: TreeNode): boolean;
@@ -1079,6 +1115,8 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
1079
1115
  export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>, TreeBranch {
1080
1116
  // (undocumented)
1081
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>;
1082
1120
  }
1083
1121
 
1084
1122
  // @public @sealed
@@ -1156,6 +1194,9 @@ export interface ViewableTree {
1156
1194
  viewWith<TRoot extends ImplicitFieldSchema>(config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
1157
1195
  }
1158
1196
 
1197
+ // @beta @input
1198
+ export type VoidTransactionCallbackStatusBeta = Omit<TransactionCallbackStatusBeta<unknown, unknown>, "value">;
1199
+
1159
1200
  // @public @sealed
1160
1201
  export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind, out TInfo = unknown> {
1161
1202
  // @deprecated
@@ -1163,6 +1204,11 @@ export interface WithType<out TName extends string = string, out TKind extends N
1163
1204
  get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;
1164
1205
  }
1165
1206
 
1207
+ // @beta @input
1208
+ export interface WithValue<TValue> {
1209
+ readonly value: TValue;
1210
+ }
1211
+
1166
1212
  // (No @packageDocumentation comment for this package)
1167
1213
 
1168
1214
  ```
@@ -3,32 +3,10 @@
3
3
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
4
  * Licensed under the MIT License.
5
5
  */
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || function (mod) {
23
- if (mod && mod.__esModule) return mod;
24
- var result = {};
25
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
- __setModuleDefault(result, mod);
27
- return result;
28
- };
29
6
  Object.defineProperty(exports, "__esModule", { value: true });
30
7
  exports.Versioned = exports.versionField = void 0;
31
- const Type = __importStar(require("@sinclair/typebox"));
8
+ const tslib_1 = require("tslib");
9
+ const Type = tslib_1.__importStar(require("@sinclair/typebox"));
32
10
  /**
33
11
  * A field to use in TypeBox schemas for the version field of a versioned format.
34
12
  * @remarks
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/codec/versioned/format.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,wDAA0C;AAG1C;;;;;GAKG;AACU,QAAA,YAAY,GAAG;IAC3B;;;;;OAKG;IACH,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;CAC1C,CAAC;AAEX;;GAEG;AACU,QAAA,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as Type from \"@sinclair/typebox\";\nimport type { Static } from \"@sinclair/typebox\";\n\n/**\n * A field to use in TypeBox schemas for the version field of a versioned format.\n * @remarks\n * Spread this into the top level object schema for the format.\n * The version field is required for all versioned formats, and is used by the {@link VersionDispatchingCodecBuilder} to determine which codec version to use when decoding.\n */\nexport const versionField = {\n\t/**\n\t * String versions are used for formats that are not yet officially supported. See {@link FormatVersion} for details.\n\t * @remarks\n\t * Having this schema be particularly strict is not too important since\n\t * checking that the contents are the exact value expected is done by `makeVersionedCodec` in the {@link VersionDispatchingCodecBuilder}.\n\t */\n\tversion: Type.Union([Type.Number(), Type.String()]),\n} as const;\n\n/**\n * An object which has a {@link versionField}.\n */\nexport const Versioned = Type.Object(versionField);\n\nexport type Versioned = Static<typeof Versioned>;\n"]}
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/codec/versioned/format.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,gEAA0C;AAG1C;;;;;GAKG;AACU,QAAA,YAAY,GAAG;IAC3B;;;;;OAKG;IACH,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;CAC1C,CAAC;AAEX;;GAEG;AACU,QAAA,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as Type from \"@sinclair/typebox\";\nimport type { Static } from \"@sinclair/typebox\";\n\n/**\n * A field to use in TypeBox schemas for the version field of a versioned format.\n * @remarks\n * Spread this into the top level object schema for the format.\n * The version field is required for all versioned formats, and is used by the {@link VersionDispatchingCodecBuilder} to determine which codec version to use when decoding.\n */\nexport const versionField = {\n\t/**\n\t * String versions are used for formats that are not yet officially supported. See {@link FormatVersion} for details.\n\t * @remarks\n\t * Having this schema be particularly strict is not too important since\n\t * checking that the contents are the exact value expected is done by `makeVersionedCodec` in the {@link VersionDispatchingCodecBuilder}.\n\t */\n\tversion: Type.Union([Type.Number(), Type.String()]),\n} as const;\n\n/**\n * An object which has a {@link versionField}.\n */\nexport const Versioned = Type.Object(versionField);\n\nexport type Versioned = Static<typeof Versioned>;\n"]}