@fluidframework/tree 2.83.0 → 2.90.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 (412) hide show
  1. package/.vscode/settings.json +6 -5
  2. package/CHANGELOG.md +95 -0
  3. package/README.md +1 -1
  4. package/api-report/tree.alpha.api.md +63 -24
  5. package/api-report/tree.beta.api.md +30 -0
  6. package/api-report/tree.legacy.beta.api.md +30 -0
  7. package/dist/alpha.d.ts +10 -6
  8. package/dist/beta.d.ts +4 -1
  9. package/dist/codec/codec.d.ts +2 -0
  10. package/dist/codec/codec.d.ts.map +1 -1
  11. package/dist/codec/codec.js +4 -3
  12. package/dist/codec/codec.js.map +1 -1
  13. package/dist/codec/index.d.ts +1 -1
  14. package/dist/codec/index.d.ts.map +1 -1
  15. package/dist/codec/index.js +2 -1
  16. package/dist/codec/index.js.map +1 -1
  17. package/dist/codec/versioned/codec.d.ts +13 -1
  18. package/dist/codec/versioned/codec.d.ts.map +1 -1
  19. package/dist/codec/versioned/codec.js +18 -3
  20. package/dist/codec/versioned/codec.js.map +1 -1
  21. package/dist/codec/versioned/format.d.ts +22 -1
  22. package/dist/codec/versioned/format.d.ts.map +1 -1
  23. package/dist/codec/versioned/format.js +16 -3
  24. package/dist/codec/versioned/format.js.map +1 -1
  25. package/dist/codec/versioned/index.d.ts +1 -1
  26. package/dist/codec/versioned/index.d.ts.map +1 -1
  27. package/dist/codec/versioned/index.js +2 -1
  28. package/dist/codec/versioned/index.js.map +1 -1
  29. package/dist/core/index.d.ts +1 -2
  30. package/dist/core/index.d.ts.map +1 -1
  31. package/dist/core/index.js +1 -3
  32. package/dist/core/index.js.map +1 -1
  33. package/dist/core/rebase/index.d.ts +1 -1
  34. package/dist/core/rebase/index.d.ts.map +1 -1
  35. package/dist/core/rebase/index.js.map +1 -1
  36. package/dist/core/rebase/types.d.ts +78 -0
  37. package/dist/core/rebase/types.d.ts.map +1 -1
  38. package/dist/core/rebase/types.js.map +1 -1
  39. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -7
  40. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  41. package/dist/feature-libraries/chunked-forest/codec/codecs.js +22 -44
  42. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  43. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  44. package/dist/feature-libraries/chunked-forest/codec/format.js +11 -0
  45. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  46. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +3 -2
  47. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  48. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -4
  49. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  50. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  51. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  52. package/dist/feature-libraries/chunked-forest/index.js +2 -4
  53. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  54. package/dist/feature-libraries/flex-tree/observer.d.ts +17 -0
  55. package/dist/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  56. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  57. package/dist/feature-libraries/forest-summary/codec.d.ts +5 -12
  58. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  59. package/dist/feature-libraries/forest-summary/codec.js +33 -33
  60. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  61. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
  62. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  63. package/dist/feature-libraries/forest-summary/forestSummarizer.js +6 -7
  64. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  65. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +6 -4
  66. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  67. package/dist/feature-libraries/forest-summary/formatCommon.js +13 -11
  68. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  69. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -14
  70. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  71. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +31 -48
  72. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  73. package/dist/feature-libraries/forest-summary/index.d.ts +1 -1
  74. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  75. package/dist/feature-libraries/forest-summary/index.js +2 -2
  76. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  77. package/dist/feature-libraries/index.d.ts +3 -3
  78. package/dist/feature-libraries/index.d.ts.map +1 -1
  79. package/dist/feature-libraries/index.js +4 -5
  80. package/dist/feature-libraries/index.js.map +1 -1
  81. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -3
  82. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  83. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  84. package/dist/feature-libraries/indexing/index.d.ts +1 -1
  85. package/dist/feature-libraries/indexing/index.d.ts.map +1 -1
  86. package/dist/feature-libraries/indexing/index.js.map +1 -1
  87. package/dist/feature-libraries/indexing/types.d.ts +15 -13
  88. package/dist/feature-libraries/indexing/types.d.ts.map +1 -1
  89. package/dist/feature-libraries/indexing/types.js.map +1 -1
  90. package/dist/index.d.ts +3 -3
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +2 -2
  93. package/dist/index.js.map +1 -1
  94. package/dist/legacy.d.ts +4 -1
  95. package/dist/packageVersion.d.ts +1 -1
  96. package/dist/packageVersion.js +1 -1
  97. package/dist/packageVersion.js.map +1 -1
  98. package/dist/shared-tree/independentView.js +2 -2
  99. package/dist/shared-tree/independentView.js.map +1 -1
  100. package/dist/shared-tree/schematizingTreeView.d.ts +5 -0
  101. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  102. package/dist/shared-tree/schematizingTreeView.js +35 -7
  103. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  104. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  105. package/dist/shared-tree/sharedTree.js +7 -7
  106. package/dist/shared-tree/sharedTree.js.map +1 -1
  107. package/dist/shared-tree/tree.js +1 -1
  108. package/dist/shared-tree/tree.js.map +1 -1
  109. package/dist/shared-tree/treeAlpha.d.ts +8 -1
  110. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  111. package/dist/shared-tree/treeAlpha.js +48 -8
  112. package/dist/shared-tree/treeAlpha.js.map +1 -1
  113. package/dist/shared-tree/treeCheckout.d.ts +35 -3
  114. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  115. package/dist/shared-tree/treeCheckout.js +123 -17
  116. package/dist/shared-tree/treeCheckout.js.map +1 -1
  117. package/dist/shared-tree/unhydratedTreeContext.d.ts +20 -0
  118. package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -0
  119. package/dist/shared-tree/unhydratedTreeContext.js +56 -0
  120. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -0
  121. package/dist/shared-tree-core/transaction.d.ts +15 -27
  122. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  123. package/dist/shared-tree-core/transaction.js +7 -11
  124. package/dist/shared-tree-core/transaction.js.map +1 -1
  125. package/dist/simple-tree/api/configuration.d.ts +4 -0
  126. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  127. package/dist/simple-tree/api/configuration.js.map +1 -1
  128. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  129. package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -1
  130. package/dist/simple-tree/api/identifierIndex.js +1 -1
  131. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  132. package/dist/simple-tree/api/index.d.ts +3 -3
  133. package/dist/simple-tree/api/index.d.ts.map +1 -1
  134. package/dist/simple-tree/api/index.js +2 -2
  135. package/dist/simple-tree/api/index.js.map +1 -1
  136. package/dist/simple-tree/api/schemaFactory.d.ts +3 -2
  137. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  138. package/dist/simple-tree/api/schemaFactory.js +3 -2
  139. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  140. package/dist/simple-tree/api/simpleTreeIndex.d.ts +15 -13
  141. package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  142. package/dist/simple-tree/api/simpleTreeIndex.js +4 -4
  143. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  144. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +4 -4
  145. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  146. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  147. package/dist/simple-tree/api/transactionTypes.d.ts +22 -25
  148. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  149. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  150. package/dist/simple-tree/api/tree.d.ts +69 -132
  151. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  152. package/dist/simple-tree/api/tree.js.map +1 -1
  153. package/dist/simple-tree/index.d.ts +1 -1
  154. package/dist/simple-tree/index.d.ts.map +1 -1
  155. package/dist/simple-tree/index.js +2 -2
  156. package/dist/simple-tree/index.js.map +1 -1
  157. package/dist/text/textDomain.d.ts +27 -9
  158. package/dist/text/textDomain.d.ts.map +1 -1
  159. package/dist/text/textDomain.js +43 -7
  160. package/dist/text/textDomain.js.map +1 -1
  161. package/dist/text/textDomainFormatted.d.ts +14 -8
  162. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  163. package/dist/text/textDomainFormatted.js +97 -25
  164. package/dist/text/textDomainFormatted.js.map +1 -1
  165. package/dist/util/rangeMap.d.ts +1 -0
  166. package/dist/util/rangeMap.d.ts.map +1 -1
  167. package/dist/util/rangeMap.js +5 -6
  168. package/dist/util/rangeMap.js.map +1 -1
  169. package/lib/alpha.d.ts +10 -6
  170. package/lib/beta.d.ts +4 -1
  171. package/lib/codec/codec.d.ts +2 -0
  172. package/lib/codec/codec.d.ts.map +1 -1
  173. package/lib/codec/codec.js +4 -3
  174. package/lib/codec/codec.js.map +1 -1
  175. package/lib/codec/index.d.ts +1 -1
  176. package/lib/codec/index.d.ts.map +1 -1
  177. package/lib/codec/index.js +1 -1
  178. package/lib/codec/index.js.map +1 -1
  179. package/lib/codec/versioned/codec.d.ts +13 -1
  180. package/lib/codec/versioned/codec.d.ts.map +1 -1
  181. package/lib/codec/versioned/codec.js +18 -3
  182. package/lib/codec/versioned/codec.js.map +1 -1
  183. package/lib/codec/versioned/format.d.ts +22 -1
  184. package/lib/codec/versioned/format.d.ts.map +1 -1
  185. package/lib/codec/versioned/format.js +15 -2
  186. package/lib/codec/versioned/format.js.map +1 -1
  187. package/lib/codec/versioned/index.d.ts +1 -1
  188. package/lib/codec/versioned/index.d.ts.map +1 -1
  189. package/lib/codec/versioned/index.js +1 -1
  190. package/lib/codec/versioned/index.js.map +1 -1
  191. package/lib/core/index.d.ts +1 -2
  192. package/lib/core/index.d.ts.map +1 -1
  193. package/lib/core/index.js +0 -1
  194. package/lib/core/index.js.map +1 -1
  195. package/lib/core/rebase/index.d.ts +1 -1
  196. package/lib/core/rebase/index.d.ts.map +1 -1
  197. package/lib/core/rebase/index.js.map +1 -1
  198. package/lib/core/rebase/types.d.ts +78 -0
  199. package/lib/core/rebase/types.d.ts.map +1 -1
  200. package/lib/core/rebase/types.js.map +1 -1
  201. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -7
  202. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  203. package/lib/feature-libraries/chunked-forest/codec/codecs.js +25 -45
  204. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  205. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  206. package/lib/feature-libraries/chunked-forest/codec/format.js +11 -0
  207. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  208. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +3 -2
  209. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  210. package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
  211. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  212. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  213. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  214. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  215. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  216. package/lib/feature-libraries/flex-tree/observer.d.ts +17 -0
  217. package/lib/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  218. package/lib/feature-libraries/flex-tree/observer.js.map +1 -1
  219. package/lib/feature-libraries/forest-summary/codec.d.ts +5 -12
  220. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  221. package/lib/feature-libraries/forest-summary/codec.js +35 -32
  222. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  223. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
  224. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  225. package/lib/feature-libraries/forest-summary/forestSummarizer.js +7 -8
  226. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  227. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +6 -4
  228. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  229. package/lib/feature-libraries/forest-summary/formatCommon.js +7 -4
  230. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  231. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -14
  232. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  233. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +30 -47
  234. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  235. package/lib/feature-libraries/forest-summary/index.d.ts +1 -1
  236. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  237. package/lib/feature-libraries/forest-summary/index.js +1 -1
  238. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  239. package/lib/feature-libraries/index.d.ts +3 -3
  240. package/lib/feature-libraries/index.d.ts.map +1 -1
  241. package/lib/feature-libraries/index.js +2 -2
  242. package/lib/feature-libraries/index.js.map +1 -1
  243. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -3
  244. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  245. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  246. package/lib/feature-libraries/indexing/index.d.ts +1 -1
  247. package/lib/feature-libraries/indexing/index.d.ts.map +1 -1
  248. package/lib/feature-libraries/indexing/index.js.map +1 -1
  249. package/lib/feature-libraries/indexing/types.d.ts +15 -13
  250. package/lib/feature-libraries/indexing/types.d.ts.map +1 -1
  251. package/lib/feature-libraries/indexing/types.js.map +1 -1
  252. package/lib/index.d.ts +3 -3
  253. package/lib/index.d.ts.map +1 -1
  254. package/lib/index.js +1 -1
  255. package/lib/index.js.map +1 -1
  256. package/lib/legacy.d.ts +4 -1
  257. package/lib/packageVersion.d.ts +1 -1
  258. package/lib/packageVersion.js +1 -1
  259. package/lib/packageVersion.js.map +1 -1
  260. package/lib/shared-tree/independentView.js +3 -3
  261. package/lib/shared-tree/independentView.js.map +1 -1
  262. package/lib/shared-tree/schematizingTreeView.d.ts +5 -0
  263. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  264. package/lib/shared-tree/schematizingTreeView.js +33 -6
  265. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  266. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  267. package/lib/shared-tree/sharedTree.js +8 -8
  268. package/lib/shared-tree/sharedTree.js.map +1 -1
  269. package/lib/shared-tree/tree.js +1 -1
  270. package/lib/shared-tree/tree.js.map +1 -1
  271. package/lib/shared-tree/treeAlpha.d.ts +8 -1
  272. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  273. package/lib/shared-tree/treeAlpha.js +49 -9
  274. package/lib/shared-tree/treeAlpha.js.map +1 -1
  275. package/lib/shared-tree/treeCheckout.d.ts +35 -3
  276. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  277. package/lib/shared-tree/treeCheckout.js +124 -18
  278. package/lib/shared-tree/treeCheckout.js.map +1 -1
  279. package/lib/shared-tree/unhydratedTreeContext.d.ts +20 -0
  280. package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -0
  281. package/lib/shared-tree/unhydratedTreeContext.js +52 -0
  282. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -0
  283. package/lib/shared-tree-core/transaction.d.ts +15 -27
  284. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  285. package/lib/shared-tree-core/transaction.js +7 -11
  286. package/lib/shared-tree-core/transaction.js.map +1 -1
  287. package/lib/simple-tree/api/configuration.d.ts +4 -0
  288. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  289. package/lib/simple-tree/api/configuration.js.map +1 -1
  290. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  291. package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -1
  292. package/lib/simple-tree/api/identifierIndex.js +2 -2
  293. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  294. package/lib/simple-tree/api/index.d.ts +3 -3
  295. package/lib/simple-tree/api/index.d.ts.map +1 -1
  296. package/lib/simple-tree/api/index.js +1 -1
  297. package/lib/simple-tree/api/index.js.map +1 -1
  298. package/lib/simple-tree/api/schemaFactory.d.ts +3 -2
  299. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  300. package/lib/simple-tree/api/schemaFactory.js +3 -2
  301. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  302. package/lib/simple-tree/api/simpleTreeIndex.d.ts +15 -13
  303. package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  304. package/lib/simple-tree/api/simpleTreeIndex.js +2 -2
  305. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  306. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +4 -4
  307. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  308. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  309. package/lib/simple-tree/api/transactionTypes.d.ts +22 -25
  310. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  311. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  312. package/lib/simple-tree/api/tree.d.ts +69 -132
  313. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  314. package/lib/simple-tree/api/tree.js.map +1 -1
  315. package/lib/simple-tree/index.d.ts +1 -1
  316. package/lib/simple-tree/index.d.ts.map +1 -1
  317. package/lib/simple-tree/index.js +1 -1
  318. package/lib/simple-tree/index.js.map +1 -1
  319. package/lib/text/textDomain.d.ts +27 -9
  320. package/lib/text/textDomain.d.ts.map +1 -1
  321. package/lib/text/textDomain.js +45 -9
  322. package/lib/text/textDomain.js.map +1 -1
  323. package/lib/text/textDomainFormatted.d.ts +14 -8
  324. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  325. package/lib/text/textDomainFormatted.js +80 -8
  326. package/lib/text/textDomainFormatted.js.map +1 -1
  327. package/lib/util/rangeMap.d.ts +1 -0
  328. package/lib/util/rangeMap.d.ts.map +1 -1
  329. package/lib/util/rangeMap.js +5 -6
  330. package/lib/util/rangeMap.js.map +1 -1
  331. package/package.json +24 -24
  332. package/src/codec/codec.ts +5 -4
  333. package/src/codec/index.ts +1 -0
  334. package/src/codec/versioned/codec.ts +32 -6
  335. package/src/codec/versioned/format.ts +17 -2
  336. package/src/codec/versioned/index.ts +1 -1
  337. package/src/core/index.ts +2 -6
  338. package/src/core/rebase/index.ts +2 -0
  339. package/src/core/rebase/types.ts +80 -0
  340. package/src/feature-libraries/chunked-forest/codec/codecs.ts +59 -78
  341. package/src/feature-libraries/chunked-forest/codec/format.ts +11 -0
  342. package/src/feature-libraries/chunked-forest/codec/index.ts +3 -3
  343. package/src/feature-libraries/chunked-forest/index.ts +2 -3
  344. package/src/feature-libraries/flex-tree/observer.ts +17 -0
  345. package/src/feature-libraries/forest-summary/codec.ts +46 -56
  346. package/src/feature-libraries/forest-summary/forestSummarizer.ts +5 -14
  347. package/src/feature-libraries/forest-summary/formatCommon.ts +14 -19
  348. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +44 -74
  349. package/src/feature-libraries/forest-summary/index.ts +1 -1
  350. package/src/feature-libraries/index.ts +2 -4
  351. package/src/feature-libraries/indexing/anchorTreeIndex.ts +3 -5
  352. package/src/feature-libraries/indexing/index.ts +1 -1
  353. package/src/feature-libraries/indexing/types.ts +15 -17
  354. package/src/index.ts +6 -3
  355. package/src/packageVersion.ts +1 -1
  356. package/src/shared-tree/independentView.ts +3 -3
  357. package/src/shared-tree/schematizingTreeView.ts +43 -10
  358. package/src/shared-tree/sharedTree.ts +8 -10
  359. package/src/shared-tree/tree.ts +1 -1
  360. package/src/shared-tree/treeAlpha.ts +64 -11
  361. package/src/shared-tree/treeCheckout.ts +142 -21
  362. package/src/shared-tree/unhydratedTreeContext.ts +87 -0
  363. package/src/shared-tree-core/transaction.ts +19 -39
  364. package/src/simple-tree/api/configuration.ts +4 -0
  365. package/src/simple-tree/api/identifierIndex.ts +4 -4
  366. package/src/simple-tree/api/index.ts +3 -1
  367. package/src/simple-tree/api/schemaFactory.ts +3 -2
  368. package/src/simple-tree/api/simpleTreeIndex.ts +26 -20
  369. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +4 -4
  370. package/src/simple-tree/api/transactionTypes.ts +24 -26
  371. package/src/simple-tree/api/tree.ts +92 -131
  372. package/src/simple-tree/index.ts +4 -2
  373. package/src/text/textDomain.ts +91 -12
  374. package/src/text/textDomainFormatted.ts +127 -15
  375. package/src/util/rangeMap.ts +5 -11
  376. package/dist/core/schema-view/index.d.ts +0 -6
  377. package/dist/core/schema-view/index.d.ts.map +0 -1
  378. package/dist/core/schema-view/index.js +0 -10
  379. package/dist/core/schema-view/index.js.map +0 -1
  380. package/dist/core/schema-view/view.d.ts +0 -31
  381. package/dist/core/schema-view/view.d.ts.map +0 -1
  382. package/dist/core/schema-view/view.js +0 -18
  383. package/dist/core/schema-view/view.js.map +0 -1
  384. package/dist/feature-libraries/forest-summary/formatV1.d.ts +0 -12
  385. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +0 -1
  386. package/dist/feature-libraries/forest-summary/formatV1.js +0 -10
  387. package/dist/feature-libraries/forest-summary/formatV1.js.map +0 -1
  388. package/dist/feature-libraries/forest-summary/formatV2.d.ts +0 -12
  389. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +0 -1
  390. package/dist/feature-libraries/forest-summary/formatV2.js +0 -10
  391. package/dist/feature-libraries/forest-summary/formatV2.js.map +0 -1
  392. package/lib/core/schema-view/index.d.ts +0 -6
  393. package/lib/core/schema-view/index.d.ts.map +0 -1
  394. package/lib/core/schema-view/index.js +0 -6
  395. package/lib/core/schema-view/index.js.map +0 -1
  396. package/lib/core/schema-view/view.d.ts +0 -31
  397. package/lib/core/schema-view/view.d.ts.map +0 -1
  398. package/lib/core/schema-view/view.js +0 -14
  399. package/lib/core/schema-view/view.js.map +0 -1
  400. package/lib/feature-libraries/forest-summary/formatV1.d.ts +0 -12
  401. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +0 -1
  402. package/lib/feature-libraries/forest-summary/formatV1.js +0 -7
  403. package/lib/feature-libraries/forest-summary/formatV1.js.map +0 -1
  404. package/lib/feature-libraries/forest-summary/formatV2.d.ts +0 -12
  405. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +0 -1
  406. package/lib/feature-libraries/forest-summary/formatV2.js +0 -7
  407. package/lib/feature-libraries/forest-summary/formatV2.js.map +0 -1
  408. package/src/core/schema-view/README.md +0 -9
  409. package/src/core/schema-view/index.ts +0 -10
  410. package/src/core/schema-view/view.ts +0 -38
  411. package/src/feature-libraries/forest-summary/formatV1.ts +0 -11
  412. package/src/feature-libraries/forest-summary/formatV2.ts +0 -11
@@ -4,12 +4,13 @@
4
4
  // Also for unknown (but likely related reasons) this cannot be just "lib/test" which is used in the config.
5
5
  // This is not limited to "spec.js" so that benchmarks are included (which will be run in correctness mode).
6
6
  "mochaExplorer.files": ["lib/test/**/*.*js"],
7
- // "pruneFiles" is disabled because it causesd "source-map-support/register" to give `Unknown file extension ".ts"` errors.
7
+ // "pruneFiles" is disabled because it breaks some imports.
8
8
  // "mochaExplorer.pruneFiles": true,
9
- "mochaExplorer.require": [
10
- "node_modules/@fluid-internal/mocha-test-setup/dist/index.js",
11
- "source-map-support/register",
12
- ],
9
+ // Parallel testing disabled because of AB#59690.
10
+ // "mochaExplorer.parallel": true,
11
+ // We have moderately high test setup overhead, so tons of jobs doesn't work well.
12
+ // Less than 4 got slower results, and more did not offer any significant gains.
13
+ "mochaExplorer.jobs": 4,
13
14
  "mochaExplorer.configFile": ".mocharc.cjs",
14
15
  "mochaExplorer.timeout": 999999,
15
16
  // This extension appears to invoke mocha programmatically, meaning that the enablement of this option in the common
package/CHANGELOG.md CHANGED
@@ -1,5 +1,100 @@
1
1
  # @fluidframework/tree
2
2
 
3
+ ## 2.90.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add alpha TextAsTree domain for collaboratively editable text ([#26568](https://github.com/microsoft/FluidFramework/pull/26568)) [06736bd81de](https://github.com/microsoft/FluidFramework/commit/06736bd81dea4c8e44cb13304f471a7b1bca42bd)
8
+
9
+ A newly exported `TextAsTree` alpha namespace has been added with an initial version of collaboratively editable text.
10
+ Users of SharedTree can add `TextAsTree.Tree` nodes to their tree to experiment with it.
11
+
12
+ - Added new TreeAlpha.context(node) API ([#26432](https://github.com/microsoft/FluidFramework/pull/26432)) [ffa62f45e2c](https://github.com/microsoft/FluidFramework/commit/ffa62f45e2ca6c6106c67ed94f69359336823516)
13
+
14
+ This release introduces a node-scoped context that works for both hydrated and [unhydrated](https://fluidframework.com/docs/api/fluid-framework/unhydrated-typealias) [TreeNodes](https://fluidframework.com/docs/api/fluid-framework/treenode-class).
15
+ The new `TreeContextAlpha` interface exposes `runTransaction` / `runTransactionAsync` methods and an `isBranch()` type guard.
16
+ `TreeBranchAlpha` now extends `TreeContextAlpha`, so you can keep using branch APIs when available.
17
+
18
+ #### Migration
19
+
20
+ If you previously used `TreeAlpha.branch(node)` to discover a branch, switch to `TreeAlpha.context(node)` and check `isBranch()`:
21
+
22
+ ```ts
23
+ import { TreeAlpha } from "@fluidframework/tree/alpha";
24
+
25
+ const context = TreeAlpha.context(node);
26
+ if (context.isBranch()) {
27
+ // Same branch APIs as before
28
+ context.fork();
29
+ }
30
+ ```
31
+
32
+ `TreeAlpha.branch(node)` is now deprecated.
33
+ Prefer the context API above.
34
+
35
+ #### New transaction entry point
36
+
37
+ You can now run transactions from a node context, regardless of whether the node is hydrated:
38
+
39
+ ```ts
40
+ // A synchronous transaction without a return value
41
+ const context = TreeAlpha.context(node);
42
+ context.runTransaction(() => {
43
+ node.count += 1;
44
+ });
45
+ ```
46
+
47
+ ```ts
48
+ // An asynchronous transaction with a return value
49
+ const context = TreeAlpha.context(node);
50
+ const result = await context.runTransactionAsync(async () => {
51
+ await doWork(node);
52
+ return { value: node.foo };
53
+ });
54
+ ```
55
+
56
+ - Promote checkSchemaCompatibilitySnapshots to beta ([#26288](https://github.com/microsoft/FluidFramework/pull/26288)) [eb4ef62672d](https://github.com/microsoft/FluidFramework/commit/eb4ef62672d33f6a903e3726b58d1f65c24d9150)
57
+
58
+ [`checkSchemaCompatibilitySnapshots`](https://fluidframework.com/docs/api/fluid-framework#checkschemacompatibilitysnapshots-function) has been promoted to `@beta`.
59
+ It is recommended that all SharedTree applications use this API to write schema compatibility tests.
60
+
61
+ Usage should look something like:
62
+
63
+ ```typescript
64
+ import fs from "node:fs";
65
+ import path from "node:path";
66
+
67
+ import { snapshotSchemaCompatibility } from "@fluidframework/tree/beta";
68
+
69
+ // The TreeViewConfiguration the application uses, which contains the application's schema.
70
+ import { treeViewConfiguration } from "./schema.js";
71
+ // The next version of the application which will be released.
72
+ import { packageVersion } from "./version.js";
73
+
74
+ // Provide some way to run the check in "update" mode when updating snapshots is intended.
75
+ const regenerateSnapshots = process.argv.includes("--snapshot");
76
+
77
+ // Setup the actual test. In this case using Mocha syntax.
78
+ describe("schema", () => {
79
+ it("schema compatibility", () => {
80
+ // Select a path to save the snapshots in.
81
+ // This will depend on how your application organizes its test data.
82
+ const snapshotDirectory = path.join(
83
+ import.meta.dirname,
84
+ "../../../src/test/snapshotCompatibilityCheckerExample/schema-snapshots",
85
+ );
86
+ snapshotSchemaCompatibility({
87
+ snapshotDirectory,
88
+ fileSystem: { ...fs, ...path },
89
+ version: packageVersion,
90
+ minVersionForCollaboration: "2.0.0",
91
+ schema: treeViewConfiguration,
92
+ mode: regenerateSnapshots ? "update" : "assert",
93
+ });
94
+ });
95
+ });
96
+ ```
97
+
3
98
  ## 2.83.0
4
99
 
5
100
  ### Minor Changes
package/README.md CHANGED
@@ -53,7 +53,7 @@ API documentation for **@fluidframework/tree** is available at <https://fluidfra
53
53
 
54
54
  ## Status
55
55
 
56
- Notable considerations that users should be wary of:
56
+ Notable considerations that users should be aware of:
57
57
 
58
58
  - The persisted format is stable: documents created with released versions 2.0.0 or greater of this package are fully supported long term.
59
59
  - All range changes are currently atomized.
@@ -216,16 +216,16 @@ export type CreateIndependentTreeAlphaOptions = ForestOptions & ((IndependentVie
216
216
  export function createIndependentTreeBeta<const TSchema extends ImplicitFieldSchema>(options?: ForestOptions): ViewableTree;
217
217
 
218
218
  // @alpha
219
- export function createSimpleTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue>(view: TreeView<TFieldSchema>, indexer: (schema: TreeNodeSchema) => string | undefined, getValue: (nodes: TreeIndexNodes<TreeNode>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey): SimpleTreeIndex<TKey, TValue>;
219
+ export function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue>(view: TreeView<TFieldSchema>, indexer: (schema: TreeNodeSchema) => string | undefined, getValue: (nodes: TreeIndexNodes<TreeNode>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey): TreeIndex<TKey, TValue>;
220
220
 
221
221
  // @alpha
222
- export function createSimpleTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue, TSchema extends TreeNodeSchema>(view: TreeView<TFieldSchema>, indexer: (schema: TSchema) => string | undefined, getValue: (nodes: TreeIndexNodes<NodeFromSchema<TSchema>>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey, indexableSchema: readonly TSchema[]): SimpleTreeIndex<TKey, TValue>;
222
+ export function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue, TSchema extends TreeNodeSchema>(view: TreeView<TFieldSchema>, indexer: (schema: TSchema) => string | undefined, getValue: (nodes: TreeIndexNodes<NodeFromSchema<TSchema>>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey, indexableSchema: readonly TSchema[]): TreeIndex<TKey, TValue>;
223
223
 
224
224
  // @alpha
225
- export function createSimpleTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue>(view: TreeView<TFieldSchema>, indexer: Map<TreeNodeSchema, string>, getValue: (nodes: TreeIndexNodes<TreeNode>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey): SimpleTreeIndex<TKey, TValue>;
225
+ export function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue>(view: TreeView<TFieldSchema>, indexer: Map<TreeNodeSchema, string>, getValue: (nodes: TreeIndexNodes<TreeNode>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey): TreeIndex<TKey, TValue>;
226
226
 
227
227
  // @alpha
228
- export function createSimpleTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue, TSchema extends TreeNodeSchema>(view: TreeView<TFieldSchema>, indexer: Map<TreeNodeSchema, string>, getValue: (nodes: TreeIndexNodes<NodeFromSchema<TSchema>>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey, indexableSchema: readonly TSchema[]): SimpleTreeIndex<TKey, TValue>;
228
+ export function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue, TSchema extends TreeNodeSchema>(view: TreeView<TFieldSchema>, indexer: Map<TreeNodeSchema, string>, getValue: (nodes: TreeIndexNodes<NodeFromSchema<TSchema>>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey, indexableSchema: readonly TSchema[]): TreeIndex<TKey, TValue>;
229
229
 
230
230
  // @alpha
231
231
  export function decodeSchemaCompatibilitySnapshot(encodedSchema: JsonCompatibleReadOnly, validator?: FormatValidator): SimpleTreeSchema;
@@ -462,7 +462,7 @@ export interface ICodecOptions {
462
462
  }
463
463
 
464
464
  // @alpha
465
- export type IdentifierIndex = SimpleTreeIndex<string, TreeNode>;
465
+ export type IdentifierIndex = TreeIndex<string, TreeNode>;
466
466
 
467
467
  // @public
468
468
  export type ImplicitAllowedTypes = AllowedTypes | TreeNodeSchema;
@@ -711,6 +711,12 @@ export enum KeyEncodingOptions {
711
711
  usePropertyKeys = "usePropertyKeys"
712
712
  }
713
713
 
714
+ // @alpha @sealed
715
+ export interface LabelTree {
716
+ label: unknown;
717
+ sublabels: LabelTree[];
718
+ }
719
+
714
720
  // @public
715
721
  export type LazyItem<Item = unknown> = Item | (() => Item);
716
722
 
@@ -730,6 +736,7 @@ export interface LocalChangeMetadata extends CommitMetadata {
730
736
  getRevertible(onDisposed?: (revertible: RevertibleAlpha) => void): RevertibleAlpha | undefined;
731
737
  readonly isLocal: true;
732
738
  readonly label?: unknown;
739
+ readonly labels: TransactionLabels;
733
740
  }
734
741
 
735
742
  // @public @sealed
@@ -900,6 +907,7 @@ export interface RemoteChangeMetadata extends CommitMetadata {
900
907
  readonly getRevertible?: undefined;
901
908
  readonly isLocal: false;
902
909
  readonly label?: undefined;
910
+ readonly labels: TransactionLabels;
903
911
  }
904
912
 
905
913
  // @alpha
@@ -1183,9 +1191,6 @@ export interface SimpleRecordNodeSchema<Type extends SchemaType = SchemaType, ou
1183
1191
  readonly simpleAllowedTypes: ReadonlyMap<string, SimpleAllowedTypeAttributes<Type>>;
1184
1192
  }
1185
1193
 
1186
- // @alpha
1187
- export type SimpleTreeIndex<TKey extends TreeIndexKey, TValue> = TreeIndex<TKey, TValue>;
1188
-
1189
1194
  // @alpha @sealed
1190
1195
  export interface SimpleTreeSchema<Type extends SchemaType = SchemaType> {
1191
1196
  readonly definitions: ReadonlyMap<string, SimpleNodeSchema<Type>>;
@@ -1197,7 +1202,7 @@ export function singletonSchema<TScope extends string, TName extends string | nu
1197
1202
  readonly value: TName;
1198
1203
  }, Record<string, never>, true, Record<string, never>, undefined>;
1199
1204
 
1200
- // @alpha @input
1205
+ // @beta @input
1201
1206
  export interface SnapshotFileSystem {
1202
1207
  join(parentPath: string, childPath: string): string;
1203
1208
  mkdirSync(dir: string, options: {
@@ -1210,10 +1215,10 @@ export interface SnapshotFileSystem {
1210
1215
  }): void;
1211
1216
  }
1212
1217
 
1213
- // @alpha
1218
+ // @beta
1214
1219
  export function snapshotSchemaCompatibility(options: SnapshotSchemaCompatibilityOptions): void;
1215
1220
 
1216
- // @alpha @input
1221
+ // @beta @input
1217
1222
  export interface SnapshotSchemaCompatibilityOptions {
1218
1223
  readonly fileSystem: SnapshotFileSystem;
1219
1224
  readonly minVersionForCollaboration: string;
@@ -1453,17 +1458,32 @@ export namespace TableSchema {
1453
1458
  }
1454
1459
  }
1455
1460
 
1461
+ // @alpha
1462
+ export namespace TextAsTree {
1463
+ export interface Members {
1464
+ characterCount(): number;
1465
+ characters(): Iterable<string>;
1466
+ charactersCopy(): string[];
1467
+ fullString(): string;
1468
+ insertAt(index: number, additionalCharacters: string): void;
1469
+ removeRange(startIndex: number | undefined, endIndex: number | undefined): void;
1470
+ }
1471
+ export interface Statics {
1472
+ fromString(value: string): Tree;
1473
+ }
1474
+ const Tree: Statics & TreeNodeSchema<"com.fluidframework.text.Text", NodeKind, Members & TreeNode & WithType<"com.fluidframework.text.Text", NodeKind, unknown>, never, false>;
1475
+ export type Tree = Members & TreeNode & WithType<"com.fluidframework.text.Text">;
1476
+ }
1477
+
1456
1478
  // @alpha
1457
1479
  export function trackDirtyNodes(view: TreeViewAlpha<ImplicitFieldSchema>, dirty: DirtyTreeMap): () => void;
1458
1480
 
1459
1481
  // @alpha
1460
- export type TransactionCallbackStatus<TSuccessValue, TFailureValue> = ({
1482
+ export type TransactionCallbackStatus<TSuccessValue, TFailureValue> = ((WithValue<TSuccessValue> & {
1461
1483
  rollback?: false;
1462
- value: TSuccessValue;
1463
- } | {
1484
+ }) | (WithValue<TFailureValue> & {
1464
1485
  rollback: true;
1465
- value: TFailureValue;
1466
- }) & {
1486
+ })) & {
1467
1487
  preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
1468
1488
  };
1469
1489
 
@@ -1473,6 +1493,11 @@ export type TransactionConstraint = NodeInDocumentConstraint;
1473
1493
  // @alpha @sealed
1474
1494
  export type TransactionConstraintAlpha = TransactionConstraint | NoChangeConstraint;
1475
1495
 
1496
+ // @alpha @sealed
1497
+ export type TransactionLabels = Set<unknown> & {
1498
+ tree?: LabelTree;
1499
+ };
1500
+
1476
1501
  // @alpha
1477
1502
  export type TransactionResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
1478
1503
 
@@ -1480,15 +1505,13 @@ export type TransactionResult = Omit<TransactionResultSuccess<unknown>, "value">
1480
1505
  export type TransactionResultExt<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
1481
1506
 
1482
1507
  // @alpha
1483
- export interface TransactionResultFailed<TFailureValue> {
1508
+ export interface TransactionResultFailed<TFailureValue> extends WithValue<TFailureValue> {
1484
1509
  success: false;
1485
- value: TFailureValue;
1486
1510
  }
1487
1511
 
1488
1512
  // @alpha
1489
- export interface TransactionResultSuccess<TSuccessValue> {
1513
+ export interface TransactionResultSuccess<TSuccessValue> extends WithValue<TSuccessValue> {
1490
1514
  success: true;
1491
- value: TSuccessValue;
1492
1515
  }
1493
1516
 
1494
1517
  // @public @sealed
@@ -1502,9 +1525,11 @@ export const Tree: Tree;
1502
1525
 
1503
1526
  // @alpha @sealed
1504
1527
  export interface TreeAlpha {
1528
+ // @deprecated
1505
1529
  branch(node: TreeNode): TreeBranchAlpha | undefined;
1506
1530
  child(node: TreeNode, key: string | number): TreeNode | TreeLeafValue | undefined;
1507
1531
  children(node: TreeNode): Iterable<[propertyKey: string | number, child: TreeNode | TreeLeafValue]>;
1532
+ context(node: TreeNode): TreeContextAlpha;
1508
1533
  create<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(schema: UnsafeUnknownSchema extends TSchema ? ImplicitFieldSchema : TSchema & ImplicitFieldSchema, data: InsertableField<TSchema>): Unhydrated<TSchema extends ImplicitFieldSchema ? TreeFieldFromImplicitField<TSchema> : TreeNode | TreeLeafValue | undefined>;
1509
1534
  exportCompressed(tree: TreeNode | TreeLeafValue, options: {
1510
1535
  idCompressor?: IIdCompressor;
@@ -1577,7 +1602,7 @@ export interface TreeBranch extends IDisposable {
1577
1602
  }
1578
1603
 
1579
1604
  // @alpha @sealed
1580
- export interface TreeBranchAlpha extends TreeBranch {
1605
+ export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
1581
1606
  applyChange(change: JsonCompatibleReadOnly): void;
1582
1607
  readonly events: Listenable_2<TreeBranchEvents>;
1583
1608
  // (undocumented)
@@ -1618,6 +1643,15 @@ export enum TreeCompressionStrategy {
1618
1643
  Uncompressed = 1
1619
1644
  }
1620
1645
 
1646
+ // @alpha
1647
+ export interface TreeContextAlpha {
1648
+ isBranch(): this is TreeBranchAlpha;
1649
+ runTransaction<TValue>(transaction: () => WithValue<TValue>, params?: RunTransactionParams): TransactionResultExt<TValue, TValue>;
1650
+ runTransaction(transaction: () => void, params?: RunTransactionParams): TransactionResult;
1651
+ runTransactionAsync<TValue>(transaction: () => Promise<WithValue<TValue>>, params?: RunTransactionParams): Promise<TransactionResultExt<TValue, TValue>>;
1652
+ runTransactionAsync(transaction: () => Promise<void>, params?: RunTransactionParams): Promise<TransactionResult>;
1653
+ }
1654
+
1621
1655
  // @beta @input
1622
1656
  export interface TreeEncodingOptions<TKeyOptions = KeyEncodingOptions> {
1623
1657
  readonly keys?: TKeyOptions;
@@ -1635,13 +1669,13 @@ export interface TreeIdentifierUtils {
1635
1669
  shorten(branch: TreeBranch, nodeIdentifier: string): number | undefined;
1636
1670
  }
1637
1671
 
1638
- // @alpha
1639
- export interface TreeIndex<TKey extends TreeIndexKey, TValue> extends ReadonlyMap<TKey, TValue> {
1672
+ // @alpha @sealed
1673
+ export interface TreeIndex<TKey, TValue> extends ReadonlyMap<TKey, TValue> {
1640
1674
  dispose(): void;
1641
1675
  }
1642
1676
 
1643
1677
  // @alpha
1644
- export type TreeIndexKey = number | string | boolean | IFluidHandle | null;
1678
+ export type TreeIndexKey = TreeLeafValue;
1645
1679
 
1646
1680
  // @alpha
1647
1681
  export type TreeIndexNodes<TNode> = readonly [first: TNode, ...rest: TNode[]];
@@ -1915,6 +1949,11 @@ export interface WithType<out TName extends string = string, out TKind extends N
1915
1949
  get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;
1916
1950
  }
1917
1951
 
1952
+ // @alpha
1953
+ export interface WithValue<TValue> {
1954
+ value: TValue;
1955
+ }
1956
+
1918
1957
  // (No @packageDocumentation comment for this package)
1919
1958
 
1920
1959
  ```
@@ -592,6 +592,36 @@ export function singletonSchema<TScope extends string, TName extends string | nu
592
592
  readonly value: TName;
593
593
  }, Record<string, never>, true, Record<string, never>, undefined>;
594
594
 
595
+ // @beta @input
596
+ export interface SnapshotFileSystem {
597
+ join(parentPath: string, childPath: string): string;
598
+ mkdirSync(dir: string, options: {
599
+ recursive: true;
600
+ }): void;
601
+ readdirSync(dir: string): readonly string[];
602
+ readFileSync(file: string, encoding: "utf8"): string;
603
+ writeFileSync(file: string, data: string, options: {
604
+ encoding: "utf8";
605
+ }): void;
606
+ }
607
+
608
+ // @beta
609
+ export function snapshotSchemaCompatibility(options: SnapshotSchemaCompatibilityOptions): void;
610
+
611
+ // @beta @input
612
+ export interface SnapshotSchemaCompatibilityOptions {
613
+ readonly fileSystem: SnapshotFileSystem;
614
+ readonly minVersionForCollaboration: string;
615
+ readonly mode: "assert" | "update";
616
+ readonly rejectSchemaChangesWithNoVersionChange?: true;
617
+ readonly rejectVersionsWithNoSchemaChange?: true;
618
+ readonly schema: TreeViewConfiguration;
619
+ readonly snapshotDirectory: string;
620
+ readonly snapshotUnchangedVersions?: true;
621
+ readonly version: string;
622
+ readonly versionComparer?: (a: string, b: string) => number;
623
+ }
624
+
595
625
  // @beta @system
596
626
  export namespace System_TableSchema {
597
627
  // @sealed @system
@@ -604,6 +604,36 @@ export function singletonSchema<TScope extends string, TName extends string | nu
604
604
  readonly value: TName;
605
605
  }, Record<string, never>, true, Record<string, never>, undefined>;
606
606
 
607
+ // @beta @input
608
+ export interface SnapshotFileSystem {
609
+ join(parentPath: string, childPath: string): string;
610
+ mkdirSync(dir: string, options: {
611
+ recursive: true;
612
+ }): void;
613
+ readdirSync(dir: string): readonly string[];
614
+ readFileSync(file: string, encoding: "utf8"): string;
615
+ writeFileSync(file: string, data: string, options: {
616
+ encoding: "utf8";
617
+ }): void;
618
+ }
619
+
620
+ // @beta
621
+ export function snapshotSchemaCompatibility(options: SnapshotSchemaCompatibilityOptions): void;
622
+
623
+ // @beta @input
624
+ export interface SnapshotSchemaCompatibilityOptions {
625
+ readonly fileSystem: SnapshotFileSystem;
626
+ readonly minVersionForCollaboration: string;
627
+ readonly mode: "assert" | "update";
628
+ readonly rejectSchemaChangesWithNoVersionChange?: true;
629
+ readonly rejectVersionsWithNoSchemaChange?: true;
630
+ readonly schema: TreeViewConfiguration;
631
+ readonly snapshotDirectory: string;
632
+ readonly snapshotUnchangedVersions?: true;
633
+ readonly version: string;
634
+ readonly versionComparer?: (a: string, b: string) => number;
635
+ }
636
+
607
637
  // @beta @system
608
638
  export namespace System_TableSchema {
609
639
  // @sealed @system
package/dist/alpha.d.ts CHANGED
@@ -126,6 +126,8 @@ export {
126
126
  SchemaStaticsBeta,
127
127
  SchemaUpgrade,
128
128
  SharedTreeOptionsBeta,
129
+ SnapshotFileSystem,
130
+ SnapshotSchemaCompatibilityOptions,
129
131
  System_TableSchema,
130
132
  TableSchema,
131
133
  TreeBeta,
@@ -144,7 +146,8 @@ export {
144
146
  configuredSharedTreeBeta,
145
147
  createIndependentTreeBeta,
146
148
  enumFromStrings,
147
- singletonSchema,
149
+ singletonSchema,
150
+ snapshotSchemaCompatibility,
148
151
  // #endregion
149
152
 
150
153
  // #region @alpha APIs
@@ -198,6 +201,7 @@ export {
198
201
  JsonSchemaType,
199
202
  JsonStringKeyPatternProperties,
200
203
  JsonTreeSchema,
204
+ LabelTree,
201
205
  LocalChangeMetadata,
202
206
  MapNodeCustomizableSchema,
203
207
  MapNodeCustomizableSchemaUnsafe,
@@ -231,12 +235,11 @@ export {
231
235
  SimpleObjectFieldSchema,
232
236
  SimpleObjectNodeSchema,
233
237
  SimpleRecordNodeSchema,
234
- SimpleTreeIndex,
235
238
  SimpleTreeSchema,
236
- SnapshotFileSystem,
237
- SnapshotSchemaCompatibilityOptions,
239
+ TextAsTree,
238
240
  TransactionCallbackStatus,
239
241
  TransactionConstraintAlpha,
242
+ TransactionLabels,
240
243
  TransactionResult,
241
244
  TransactionResultExt,
242
245
  TransactionResultFailed,
@@ -246,6 +249,7 @@ export {
246
249
  TreeBranchEvents,
247
250
  TreeBranchFork,
248
251
  TreeCompressionStrategy,
252
+ TreeContextAlpha,
249
253
  TreeIdentifierUtils,
250
254
  TreeIndex,
251
255
  TreeIndexKey,
@@ -261,6 +265,7 @@ export {
261
265
  VerboseTreeNode,
262
266
  ViewContent,
263
267
  VoidTransactionCallbackStatus,
268
+ WithValue,
264
269
  allowUnused,
265
270
  asAlpha,
266
271
  asTreeViewAlpha,
@@ -272,7 +277,7 @@ export {
272
277
  createArrayInsertionAnchor,
273
278
  createIdentifierIndex,
274
279
  createIndependentTreeAlpha,
275
- createSimpleTreeIndex,
280
+ createTreeIndex,
276
281
  decodeSchemaCompatibilitySnapshot,
277
282
  encodeSchemaCompatibilitySnapshot,
278
283
  eraseSchemaDetails,
@@ -294,7 +299,6 @@ export {
294
299
  replaceConciseTreeHandles,
295
300
  replaceHandles,
296
301
  replaceVerboseTreeHandles,
297
- snapshotSchemaCompatibility,
298
302
  trackDirtyNodes
299
303
  // #endregion
300
304
  } from "./index.js";
package/dist/beta.d.ts CHANGED
@@ -126,6 +126,8 @@ export {
126
126
  SchemaStaticsBeta,
127
127
  SchemaUpgrade,
128
128
  SharedTreeOptionsBeta,
129
+ SnapshotFileSystem,
130
+ SnapshotSchemaCompatibilityOptions,
129
131
  System_TableSchema,
130
132
  TableSchema,
131
133
  TreeBeta,
@@ -144,6 +146,7 @@ export {
144
146
  configuredSharedTreeBeta,
145
147
  createIndependentTreeBeta,
146
148
  enumFromStrings,
147
- singletonSchema
149
+ singletonSchema,
150
+ snapshotSchemaCompatibility
148
151
  // #endregion
149
152
  } from "./index.js";
@@ -253,6 +253,8 @@ export declare const unitCodec: IJsonCodec<0, JsonCompatibleReadOnly, JsonCompat
253
253
  /**
254
254
  * Wraps a codec with JSON schema validation for its encoded type.
255
255
  * @returns An {@link IJsonCodec} which validates the data it encodes and decodes matches the provided schema.
256
+ * @remarks
257
+ * Eventually all codecs should use the same pattern implemented by ClientVersionDispatchingCodecBuilder, resulting in that having the only use of this API.
256
258
  */
257
259
  export declare function withSchemaValidation<TInMemoryFormat, EncodedSchema extends TSchema, TEncodedFormat, TValidate, TContext>(schema: EncodedSchema, codec: IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext>, validator?: JsonValidator | FormatValidator): IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext>;
258
260
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/codec/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAE5F,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;IACrD;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACnD;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;IACrD;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACnD;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB,CAAC,MAAM,SAAS,OAAO;IAC/D;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,eAAgB,SAAQ,UAAU,CAAC,iBAAiB,CAAC;CAAG;AAWzE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,iBAAmC,CAAC;AAEpE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,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AE,CAAC;CACzC;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,sBAAsB,CAMzE"}
@@ -97,6 +97,8 @@ exports.unitCodec = {
97
97
  /**
98
98
  * Wraps a codec with JSON schema validation for its encoded type.
99
99
  * @returns An {@link IJsonCodec} which validates the data it encodes and decodes matches the provided schema.
100
+ * @remarks
101
+ * Eventually all codecs should use the same pattern implemented by ClientVersionDispatchingCodecBuilder, resulting in that having the only use of this API.
100
102
  */
101
103
  function withSchemaValidation(schema, codec, validator) {
102
104
  if (!validator) {
@@ -107,15 +109,14 @@ function withSchemaValidation(schema, codec, validator) {
107
109
  encode: (obj, context) => {
108
110
  const encoded = codec.encode(obj, context);
109
111
  if (!compiledFormat.check(encoded)) {
110
- (0, internal_1.fail)(0xac0 /* Encoded schema should validate */);
112
+ (0, internal_1.fail)(0xac0 /* Encoded data should validate */);
111
113
  }
112
114
  return encoded;
113
115
  },
114
116
  decode: (encoded, context) => {
115
117
  if (!compiledFormat.check(encoded)) {
116
- (0, internal_1.fail)(0xac1 /* Encoded schema should validate */);
118
+ (0, internal_1.fail)(0xac1 /* Data being decoded should validate */);
117
119
  }
118
- // TODO: would be nice to provide a more specific validate type to the inner codec than the outer one gets.
119
120
  return codec.decode(encoded, context);
120
121
  },
121
122
  };