@fluidframework/tree 2.81.0 → 2.82.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 (579) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/api-report/tree.alpha.api.md +54 -22
  3. package/api-report/tree.beta.api.md +150 -1
  4. package/api-report/tree.legacy.beta.api.md +150 -1
  5. package/api-report/tree.legacy.public.api.md +1 -0
  6. package/api-report/tree.public.api.md +1 -0
  7. package/dist/alpha.d.ts +8 -2
  8. package/dist/beta.d.ts +3 -0
  9. package/dist/codec/codec.d.ts +17 -8
  10. package/dist/codec/codec.d.ts.map +1 -1
  11. package/dist/codec/codec.js +8 -1
  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 +1 -1
  18. package/dist/codec/versioned/codec.d.ts.map +1 -1
  19. package/dist/codec/versioned/codec.js.map +1 -1
  20. package/dist/core/index.d.ts +1 -1
  21. package/dist/core/index.d.ts.map +1 -1
  22. package/dist/core/index.js +4 -2
  23. package/dist/core/index.js.map +1 -1
  24. package/dist/core/rebase/changeRebaser.d.ts +3 -2
  25. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  26. package/dist/core/rebase/changeRebaser.js.map +1 -1
  27. package/dist/core/rebase/index.d.ts +1 -1
  28. package/dist/core/rebase/index.d.ts.map +1 -1
  29. package/dist/core/rebase/index.js +4 -2
  30. package/dist/core/rebase/index.js.map +1 -1
  31. package/dist/core/rebase/types.d.ts +23 -3
  32. package/dist/core/rebase/types.d.ts.map +1 -1
  33. package/dist/core/rebase/types.js +30 -16
  34. package/dist/core/rebase/types.js.map +1 -1
  35. package/dist/core/schema-stored/formatV1.d.ts +2 -2
  36. package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
  37. package/dist/core/schema-stored/formatV1.js +0 -5
  38. package/dist/core/schema-stored/formatV1.js.map +1 -1
  39. package/dist/core/schema-stored/formatV2.d.ts +11 -10
  40. package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
  41. package/dist/core/schema-stored/formatV2.js +1 -6
  42. package/dist/core/schema-stored/formatV2.js.map +1 -1
  43. package/dist/core/schema-stored/index.d.ts.map +1 -1
  44. package/dist/core/schema-stored/index.js.map +1 -1
  45. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  46. package/dist/core/schema-stored/schema.js.map +1 -1
  47. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  48. package/dist/core/tree/anchorSet.js.map +1 -1
  49. package/dist/core/tree/delta.d.ts +9 -7
  50. package/dist/core/tree/delta.d.ts.map +1 -1
  51. package/dist/core/tree/delta.js.map +1 -1
  52. package/dist/core/tree/deltaUtil.js +1 -1
  53. package/dist/core/tree/deltaUtil.js.map +1 -1
  54. package/dist/core/tree/visitDelta.js +2 -2
  55. package/dist/core/tree/visitDelta.js.map +1 -1
  56. package/dist/extensibleSchemaUnion.d.ts +72 -0
  57. package/dist/extensibleSchemaUnion.d.ts.map +1 -0
  58. package/dist/extensibleSchemaUnion.js +79 -0
  59. package/dist/extensibleSchemaUnion.js.map +1 -0
  60. package/dist/feature-libraries/changeAtomIdBTree.d.ts +4 -2
  61. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  62. package/dist/feature-libraries/changeAtomIdBTree.js +9 -1
  63. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  64. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -3
  65. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  66. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +20 -21
  67. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  68. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  69. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  70. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  71. package/dist/feature-libraries/forest-summary/codec.d.ts +2 -1
  72. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  73. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  74. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  75. package/dist/feature-libraries/forest-summary/forestSummarizer.js +5 -2
  76. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  77. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +1 -39
  78. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  79. package/dist/feature-libraries/forest-summary/formatCommon.js +1 -2
  80. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  81. package/dist/feature-libraries/forest-summary/formatV1.d.ts +1 -39
  82. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  83. package/dist/feature-libraries/forest-summary/formatV2.d.ts +1 -39
  84. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  85. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +1 -1
  86. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  87. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +1 -1
  88. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  89. package/dist/feature-libraries/index.d.ts +3 -3
  90. package/dist/feature-libraries/index.d.ts.map +1 -1
  91. package/dist/feature-libraries/index.js +4 -3
  92. package/dist/feature-libraries/index.js.map +1 -1
  93. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +2 -2
  94. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  95. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +42 -22
  96. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  97. package/dist/feature-libraries/modular-schema/genericFieldKind.js +1 -1
  98. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  99. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  100. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  101. package/dist/feature-libraries/modular-schema/index.js +2 -1
  102. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  103. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
  104. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  105. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +9 -5
  106. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  107. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +11 -1
  108. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  109. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +30 -7
  110. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  111. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  112. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +38 -27
  113. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  114. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +10 -127
  115. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  116. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -4
  117. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  118. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +3 -79
  119. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  120. package/dist/feature-libraries/optional-field/optionalField.js +1 -1
  121. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  122. package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  123. package/dist/feature-libraries/optional-field/requiredField.js.map +1 -1
  124. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  125. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  126. package/dist/feature-libraries/schema-index/formatV2.d.ts +4 -4
  127. package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -1
  128. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  129. package/dist/feature-libraries/sequence-field/invert.js +2 -2
  130. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  131. package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -16
  132. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  133. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -1
  134. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  135. package/dist/index.d.ts +5 -5
  136. package/dist/index.d.ts.map +1 -1
  137. package/dist/index.js +4 -1
  138. package/dist/index.js.map +1 -1
  139. package/dist/legacy.d.ts +3 -0
  140. package/dist/packageVersion.d.ts +1 -1
  141. package/dist/packageVersion.js +1 -1
  142. package/dist/packageVersion.js.map +1 -1
  143. package/dist/shared-tree/independentView.d.ts +36 -13
  144. package/dist/shared-tree/independentView.d.ts.map +1 -1
  145. package/dist/shared-tree/independentView.js +1 -0
  146. package/dist/shared-tree/independentView.js.map +1 -1
  147. package/dist/shared-tree/index.d.ts +1 -1
  148. package/dist/shared-tree/index.d.ts.map +1 -1
  149. package/dist/shared-tree/index.js.map +1 -1
  150. package/dist/shared-tree/schematizingTreeView.d.ts +10 -0
  151. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  152. package/dist/shared-tree/schematizingTreeView.js +25 -9
  153. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  154. package/dist/shared-tree/sharedTree.d.ts +3 -3
  155. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  156. package/dist/shared-tree/sharedTree.js +8 -32
  157. package/dist/shared-tree/sharedTree.js.map +1 -1
  158. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +11 -3
  159. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  160. package/dist/shared-tree/sharedTreeChangeCodecs.js +38 -4
  161. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  162. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +4 -4
  163. package/dist/shared-tree/tree.js +1 -1
  164. package/dist/shared-tree/tree.js.map +1 -1
  165. package/dist/shared-tree/treeCheckout.d.ts +20 -0
  166. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  167. package/dist/shared-tree/treeCheckout.js +39 -3
  168. package/dist/shared-tree/treeCheckout.js.map +1 -1
  169. package/dist/shared-tree-core/editManagerSummarizer.js +1 -1
  170. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  171. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  172. package/dist/shared-tree-core/messageCodecV1ToV4.js +2 -2
  173. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  174. package/dist/shared-tree-core/transaction.d.ts +14 -3
  175. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  176. package/dist/shared-tree-core/transaction.js +59 -16
  177. package/dist/shared-tree-core/transaction.js.map +1 -1
  178. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  179. package/dist/shared-tree-core/versionedSummarizer.js +1 -1
  180. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
  181. package/dist/simple-tree/api/index.d.ts +1 -1
  182. package/dist/simple-tree/api/index.d.ts.map +1 -1
  183. package/dist/simple-tree/api/index.js +3 -2
  184. package/dist/simple-tree/api/index.js.map +1 -1
  185. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +9 -0
  186. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  187. package/dist/simple-tree/api/schemaCreationUtilities.js +16 -1
  188. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  189. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  190. package/dist/simple-tree/api/transactionTypes.d.ts +10 -0
  191. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  192. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  193. package/dist/simple-tree/api/tree.d.ts +81 -6
  194. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  195. package/dist/simple-tree/api/tree.js.map +1 -1
  196. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  197. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  198. package/dist/simple-tree/index.d.ts +2 -2
  199. package/dist/simple-tree/index.d.ts.map +1 -1
  200. package/dist/simple-tree/index.js +4 -2
  201. package/dist/simple-tree/index.js.map +1 -1
  202. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  203. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  204. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +63 -0
  205. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  206. package/dist/simple-tree/node-kinds/array/arrayNode.js +43 -1
  207. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  208. package/dist/simple-tree/node-kinds/array/index.d.ts +1 -1
  209. package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  210. package/dist/simple-tree/node-kinds/array/index.js +2 -1
  211. package/dist/simple-tree/node-kinds/array/index.js.map +1 -1
  212. package/dist/simple-tree/node-kinds/index.d.ts +1 -1
  213. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  214. package/dist/simple-tree/node-kinds/index.js +2 -1
  215. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  216. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  217. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  218. package/dist/tableSchema.d.ts +71 -48
  219. package/dist/tableSchema.d.ts.map +1 -1
  220. package/dist/tableSchema.js +200 -98
  221. package/dist/tableSchema.js.map +1 -1
  222. package/dist/text/textDomainFormatted.js +1 -1
  223. package/dist/text/textDomainFormatted.js.map +1 -1
  224. package/dist/util/bTreeUtils.d.ts +30 -4
  225. package/dist/util/bTreeUtils.d.ts.map +1 -1
  226. package/dist/util/bTreeUtils.js +29 -17
  227. package/dist/util/bTreeUtils.js.map +1 -1
  228. package/dist/util/brand.d.ts.map +1 -1
  229. package/dist/util/brand.js.map +1 -1
  230. package/dist/util/brandedMap.d.ts.map +1 -1
  231. package/dist/util/brandedMap.js.map +1 -1
  232. package/dist/util/breakable.d.ts.map +1 -1
  233. package/dist/util/breakable.js +2 -1
  234. package/dist/util/breakable.js.map +1 -1
  235. package/dist/util/index.d.ts +2 -2
  236. package/dist/util/index.d.ts.map +1 -1
  237. package/dist/util/index.js +6 -3
  238. package/dist/util/index.js.map +1 -1
  239. package/dist/util/opaque.d.ts.map +1 -1
  240. package/dist/util/opaque.js.map +1 -1
  241. package/dist/util/rangeMap.d.ts +3 -2
  242. package/dist/util/rangeMap.d.ts.map +1 -1
  243. package/dist/util/rangeMap.js +7 -1
  244. package/dist/util/rangeMap.js.map +1 -1
  245. package/dist/util/readSnapshotBlob.d.ts +1 -1
  246. package/dist/util/readSnapshotBlob.d.ts.map +1 -1
  247. package/dist/util/readSnapshotBlob.js.map +1 -1
  248. package/dist/util/typeCheck.d.ts.map +1 -1
  249. package/dist/util/typeCheck.js.map +1 -1
  250. package/dist/util/utils.d.ts +20 -16
  251. package/dist/util/utils.d.ts.map +1 -1
  252. package/dist/util/utils.js +49 -17
  253. package/dist/util/utils.js.map +1 -1
  254. package/eslint.config.mts +0 -9
  255. package/lib/alpha.d.ts +8 -2
  256. package/lib/beta.d.ts +3 -0
  257. package/lib/codec/codec.d.ts +17 -8
  258. package/lib/codec/codec.d.ts.map +1 -1
  259. package/lib/codec/codec.js +6 -0
  260. package/lib/codec/codec.js.map +1 -1
  261. package/lib/codec/index.d.ts +1 -1
  262. package/lib/codec/index.d.ts.map +1 -1
  263. package/lib/codec/index.js +1 -1
  264. package/lib/codec/index.js.map +1 -1
  265. package/lib/codec/versioned/codec.d.ts +1 -1
  266. package/lib/codec/versioned/codec.d.ts.map +1 -1
  267. package/lib/codec/versioned/codec.js.map +1 -1
  268. package/lib/core/index.d.ts +1 -1
  269. package/lib/core/index.d.ts.map +1 -1
  270. package/lib/core/index.js +1 -1
  271. package/lib/core/index.js.map +1 -1
  272. package/lib/core/rebase/changeRebaser.d.ts +3 -2
  273. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  274. package/lib/core/rebase/changeRebaser.js.map +1 -1
  275. package/lib/core/rebase/index.d.ts +1 -1
  276. package/lib/core/rebase/index.d.ts.map +1 -1
  277. package/lib/core/rebase/index.js +1 -1
  278. package/lib/core/rebase/index.js.map +1 -1
  279. package/lib/core/rebase/types.d.ts +23 -3
  280. package/lib/core/rebase/types.d.ts.map +1 -1
  281. package/lib/core/rebase/types.js +27 -15
  282. package/lib/core/rebase/types.js.map +1 -1
  283. package/lib/core/schema-stored/formatV1.d.ts +2 -2
  284. package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
  285. package/lib/core/schema-stored/formatV1.js +0 -5
  286. package/lib/core/schema-stored/formatV1.js.map +1 -1
  287. package/lib/core/schema-stored/formatV2.d.ts +11 -10
  288. package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
  289. package/lib/core/schema-stored/formatV2.js +1 -6
  290. package/lib/core/schema-stored/formatV2.js.map +1 -1
  291. package/lib/core/schema-stored/index.d.ts.map +1 -1
  292. package/lib/core/schema-stored/index.js +2 -0
  293. package/lib/core/schema-stored/index.js.map +1 -1
  294. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  295. package/lib/core/schema-stored/schema.js.map +1 -1
  296. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  297. package/lib/core/tree/anchorSet.js.map +1 -1
  298. package/lib/core/tree/delta.d.ts +9 -7
  299. package/lib/core/tree/delta.d.ts.map +1 -1
  300. package/lib/core/tree/delta.js.map +1 -1
  301. package/lib/core/tree/deltaUtil.js +1 -1
  302. package/lib/core/tree/deltaUtil.js.map +1 -1
  303. package/lib/core/tree/visitDelta.js +2 -2
  304. package/lib/core/tree/visitDelta.js.map +1 -1
  305. package/lib/extensibleSchemaUnion.d.ts +72 -0
  306. package/lib/extensibleSchemaUnion.d.ts.map +1 -0
  307. package/lib/extensibleSchemaUnion.js +76 -0
  308. package/lib/extensibleSchemaUnion.js.map +1 -0
  309. package/lib/feature-libraries/changeAtomIdBTree.d.ts +4 -2
  310. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  311. package/lib/feature-libraries/changeAtomIdBTree.js +7 -0
  312. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  313. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -3
  314. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  315. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +4 -5
  316. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  317. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  318. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  319. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  320. package/lib/feature-libraries/forest-summary/codec.d.ts +2 -1
  321. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  322. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  323. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  324. package/lib/feature-libraries/forest-summary/forestSummarizer.js +6 -3
  325. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  326. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +1 -39
  327. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  328. package/lib/feature-libraries/forest-summary/formatCommon.js +2 -3
  329. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  330. package/lib/feature-libraries/forest-summary/formatV1.d.ts +1 -39
  331. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  332. package/lib/feature-libraries/forest-summary/formatV2.d.ts +1 -39
  333. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  334. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +1 -1
  335. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  336. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +1 -1
  337. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  338. package/lib/feature-libraries/index.d.ts +3 -3
  339. package/lib/feature-libraries/index.d.ts.map +1 -1
  340. package/lib/feature-libraries/index.js +3 -3
  341. package/lib/feature-libraries/index.js.map +1 -1
  342. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +2 -2
  343. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  344. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +41 -21
  345. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  346. package/lib/feature-libraries/modular-schema/genericFieldKind.js +1 -1
  347. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  348. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  349. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  350. package/lib/feature-libraries/modular-schema/index.js +1 -1
  351. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  352. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
  353. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  354. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +10 -6
  355. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  356. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +11 -1
  357. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  358. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +29 -6
  359. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  360. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  361. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +41 -30
  362. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  363. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +10 -127
  364. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  365. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -4
  366. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  367. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +3 -79
  368. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  369. package/lib/feature-libraries/optional-field/optionalField.js +1 -1
  370. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  371. package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  372. package/lib/feature-libraries/optional-field/requiredField.js.map +1 -1
  373. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  374. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  375. package/lib/feature-libraries/schema-index/formatV2.d.ts +4 -4
  376. package/lib/feature-libraries/schema-index/schemaSummarizer.js +1 -1
  377. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  378. package/lib/feature-libraries/sequence-field/invert.js +2 -2
  379. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  380. package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -16
  381. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  382. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -1
  383. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  384. package/lib/index.d.ts +5 -5
  385. package/lib/index.d.ts.map +1 -1
  386. package/lib/index.js +4 -3
  387. package/lib/index.js.map +1 -1
  388. package/lib/legacy.d.ts +3 -0
  389. package/lib/packageVersion.d.ts +1 -1
  390. package/lib/packageVersion.js +1 -1
  391. package/lib/packageVersion.js.map +1 -1
  392. package/lib/shared-tree/independentView.d.ts +36 -13
  393. package/lib/shared-tree/independentView.d.ts.map +1 -1
  394. package/lib/shared-tree/independentView.js +1 -0
  395. package/lib/shared-tree/independentView.js.map +1 -1
  396. package/lib/shared-tree/index.d.ts +1 -1
  397. package/lib/shared-tree/index.d.ts.map +1 -1
  398. package/lib/shared-tree/index.js.map +1 -1
  399. package/lib/shared-tree/schematizingTreeView.d.ts +10 -0
  400. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  401. package/lib/shared-tree/schematizingTreeView.js +25 -9
  402. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  403. package/lib/shared-tree/sharedTree.d.ts +3 -3
  404. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  405. package/lib/shared-tree/sharedTree.js +10 -34
  406. package/lib/shared-tree/sharedTree.js.map +1 -1
  407. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +11 -3
  408. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  409. package/lib/shared-tree/sharedTreeChangeCodecs.js +39 -5
  410. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  411. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +4 -4
  412. package/lib/shared-tree/tree.js +1 -1
  413. package/lib/shared-tree/tree.js.map +1 -1
  414. package/lib/shared-tree/treeCheckout.d.ts +20 -0
  415. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  416. package/lib/shared-tree/treeCheckout.js +39 -3
  417. package/lib/shared-tree/treeCheckout.js.map +1 -1
  418. package/lib/shared-tree-core/editManagerSummarizer.js +1 -1
  419. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  420. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  421. package/lib/shared-tree-core/messageCodecV1ToV4.js +2 -2
  422. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  423. package/lib/shared-tree-core/transaction.d.ts +14 -3
  424. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  425. package/lib/shared-tree-core/transaction.js +61 -18
  426. package/lib/shared-tree-core/transaction.js.map +1 -1
  427. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  428. package/lib/shared-tree-core/versionedSummarizer.js +1 -1
  429. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
  430. package/lib/simple-tree/api/index.d.ts +1 -1
  431. package/lib/simple-tree/api/index.d.ts.map +1 -1
  432. package/lib/simple-tree/api/index.js +1 -1
  433. package/lib/simple-tree/api/index.js.map +1 -1
  434. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +9 -0
  435. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  436. package/lib/simple-tree/api/schemaCreationUtilities.js +14 -0
  437. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  438. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  439. package/lib/simple-tree/api/transactionTypes.d.ts +10 -0
  440. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  441. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  442. package/lib/simple-tree/api/tree.d.ts +81 -6
  443. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  444. package/lib/simple-tree/api/tree.js.map +1 -1
  445. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  446. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  447. package/lib/simple-tree/index.d.ts +2 -2
  448. package/lib/simple-tree/index.d.ts.map +1 -1
  449. package/lib/simple-tree/index.js +2 -2
  450. package/lib/simple-tree/index.js.map +1 -1
  451. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  452. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  453. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +63 -0
  454. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  455. package/lib/simple-tree/node-kinds/array/arrayNode.js +41 -0
  456. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  457. package/lib/simple-tree/node-kinds/array/index.d.ts +1 -1
  458. package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  459. package/lib/simple-tree/node-kinds/array/index.js +1 -1
  460. package/lib/simple-tree/node-kinds/array/index.js.map +1 -1
  461. package/lib/simple-tree/node-kinds/index.d.ts +1 -1
  462. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  463. package/lib/simple-tree/node-kinds/index.js +1 -1
  464. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  465. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  466. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  467. package/lib/tableSchema.d.ts +71 -48
  468. package/lib/tableSchema.d.ts.map +1 -1
  469. package/lib/tableSchema.js +201 -99
  470. package/lib/tableSchema.js.map +1 -1
  471. package/lib/text/textDomainFormatted.js +1 -1
  472. package/lib/text/textDomainFormatted.js.map +1 -1
  473. package/lib/util/bTreeUtils.d.ts +30 -4
  474. package/lib/util/bTreeUtils.d.ts.map +1 -1
  475. package/lib/util/bTreeUtils.js +27 -16
  476. package/lib/util/bTreeUtils.js.map +1 -1
  477. package/lib/util/brand.d.ts.map +1 -1
  478. package/lib/util/brand.js.map +1 -1
  479. package/lib/util/brandedMap.d.ts.map +1 -1
  480. package/lib/util/brandedMap.js.map +1 -1
  481. package/lib/util/breakable.d.ts.map +1 -1
  482. package/lib/util/breakable.js +2 -1
  483. package/lib/util/breakable.js.map +1 -1
  484. package/lib/util/index.d.ts +2 -2
  485. package/lib/util/index.d.ts.map +1 -1
  486. package/lib/util/index.js +2 -2
  487. package/lib/util/index.js.map +1 -1
  488. package/lib/util/opaque.d.ts.map +1 -1
  489. package/lib/util/opaque.js.map +1 -1
  490. package/lib/util/rangeMap.d.ts +3 -2
  491. package/lib/util/rangeMap.d.ts.map +1 -1
  492. package/lib/util/rangeMap.js +7 -1
  493. package/lib/util/rangeMap.js.map +1 -1
  494. package/lib/util/readSnapshotBlob.d.ts +1 -1
  495. package/lib/util/readSnapshotBlob.d.ts.map +1 -1
  496. package/lib/util/readSnapshotBlob.js.map +1 -1
  497. package/lib/util/typeCheck.d.ts.map +1 -1
  498. package/lib/util/typeCheck.js.map +1 -1
  499. package/lib/util/utils.d.ts +20 -16
  500. package/lib/util/utils.d.ts.map +1 -1
  501. package/lib/util/utils.js +44 -15
  502. package/lib/util/utils.js.map +1 -1
  503. package/package.json +23 -23
  504. package/src/codec/codec.ts +30 -11
  505. package/src/codec/index.ts +2 -0
  506. package/src/codec/versioned/codec.ts +9 -13
  507. package/src/core/index.ts +3 -1
  508. package/src/core/rebase/changeRebaser.ts +3 -2
  509. package/src/core/rebase/index.ts +3 -1
  510. package/src/core/rebase/types.ts +51 -13
  511. package/src/core/schema-stored/formatV1.ts +2 -4
  512. package/src/core/schema-stored/formatV2.ts +9 -7
  513. package/src/core/schema-stored/index.ts +2 -0
  514. package/src/core/schema-stored/schema.ts +4 -1
  515. package/src/core/tree/anchorSet.ts +1 -3
  516. package/src/core/tree/delta.ts +9 -7
  517. package/src/core/tree/deltaUtil.ts +1 -1
  518. package/src/core/tree/visitDelta.ts +2 -2
  519. package/src/extensibleSchemaUnion.ts +135 -0
  520. package/src/feature-libraries/changeAtomIdBTree.ts +17 -2
  521. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +5 -6
  522. package/src/feature-libraries/default-schema/index.ts +0 -1
  523. package/src/feature-libraries/forest-summary/codec.ts +7 -2
  524. package/src/feature-libraries/forest-summary/forestSummarizer.ts +15 -3
  525. package/src/feature-libraries/forest-summary/formatCommon.ts +2 -3
  526. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +4 -5
  527. package/src/feature-libraries/index.ts +3 -2
  528. package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +57 -31
  529. package/src/feature-libraries/modular-schema/genericFieldKind.ts +1 -1
  530. package/src/feature-libraries/modular-schema/index.ts +4 -1
  531. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +7 -6
  532. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +32 -7
  533. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +54 -33
  534. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +2 -4
  535. package/src/feature-libraries/optional-field/optionalField.ts +1 -1
  536. package/src/feature-libraries/optional-field/requiredField.ts +2 -4
  537. package/src/feature-libraries/schema-index/codec.ts +1 -1
  538. package/src/feature-libraries/schema-index/schemaSummarizer.ts +1 -1
  539. package/src/feature-libraries/sequence-field/invert.ts +2 -2
  540. package/src/feature-libraries/sequence-field/replaceRevisions.ts +17 -10
  541. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +1 -1
  542. package/src/index.ts +12 -7
  543. package/src/packageVersion.ts +1 -1
  544. package/src/shared-tree/independentView.ts +42 -6
  545. package/src/shared-tree/index.ts +2 -0
  546. package/src/shared-tree/schematizingTreeView.ts +63 -18
  547. package/src/shared-tree/sharedTree.ts +19 -37
  548. package/src/shared-tree/sharedTreeChangeCodecs.ts +43 -9
  549. package/src/shared-tree/tree.ts +1 -1
  550. package/src/shared-tree/treeCheckout.ts +50 -3
  551. package/src/shared-tree-core/editManagerSummarizer.ts +1 -1
  552. package/src/shared-tree-core/messageCodecV1ToV4.ts +4 -3
  553. package/src/shared-tree-core/transaction.ts +125 -23
  554. package/src/shared-tree-core/versionedSummarizer.ts +3 -2
  555. package/src/simple-tree/api/index.ts +1 -0
  556. package/src/simple-tree/api/schemaCreationUtilities.ts +35 -5
  557. package/src/simple-tree/api/simpleTreeIndex.ts +1 -1
  558. package/src/simple-tree/api/transactionTypes.ts +10 -0
  559. package/src/simple-tree/api/tree.ts +88 -6
  560. package/src/simple-tree/core/treeNodeSchema.ts +5 -8
  561. package/src/simple-tree/index.ts +3 -0
  562. package/src/simple-tree/leafNodeSchema.ts +3 -2
  563. package/src/simple-tree/node-kinds/array/arrayNode.ts +86 -0
  564. package/src/simple-tree/node-kinds/array/index.ts +2 -0
  565. package/src/simple-tree/node-kinds/index.ts +2 -0
  566. package/src/simple-tree/node-kinds/object/objectNode.ts +19 -18
  567. package/src/tableSchema.ts +280 -140
  568. package/src/text/textDomainFormatted.ts +1 -1
  569. package/src/util/bTreeUtils.ts +45 -26
  570. package/src/util/brand.ts +4 -12
  571. package/src/util/brandedMap.ts +2 -6
  572. package/src/util/breakable.ts +3 -2
  573. package/src/util/index.ts +9 -3
  574. package/src/util/opaque.ts +2 -6
  575. package/src/util/rangeMap.ts +11 -5
  576. package/src/util/readSnapshotBlob.ts +3 -3
  577. package/src/util/typeCheck.ts +11 -9
  578. package/src/util/utils.ts +57 -28
  579. package/biome.jsonc +0 -4
@@ -3,20 +3,18 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- /* eslint-disable @typescript-eslint/no-unsafe-member-access -- This file uses intentional `as any` casts to access hidden internal properties (cells, tableSchemaSymbol) */
7
-
8
6
  import { fail } from "@fluidframework/core-utils/internal";
9
7
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
10
8
 
11
9
  import { EmptyKey } from "./core/index.js";
12
10
  import { TreeAlpha } from "./shared-tree/index.js";
11
+ import type { SchemaFactoryBeta } from "./simple-tree/index.js";
13
12
  import {
14
13
  type FieldHasDefault,
15
14
  type ImplicitAllowedTypes,
16
15
  type InsertableObjectFromSchemaRecord,
17
16
  type InsertableTreeNodeFromImplicitAllowedTypes,
18
17
  type NodeKind,
19
- SchemaFactoryBeta,
20
18
  type ScopedSchemaName,
21
19
  TreeArrayNode,
22
20
  type TreeNode,
@@ -36,6 +34,8 @@ import {
36
34
  eraseSchemaDetailsSubclassable,
37
35
  // eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports -- This makes the API report slightly cleaner.
38
36
  TreeNodeSchemaCore,
37
+ type TransactionConstraintAlpha,
38
+ createCustomizedFluidFrameworkScopedFactory,
39
39
  } from "./simple-tree/index.js";
40
40
  import { validateIndex, validateIndexRange } from "./util/index.js";
41
41
 
@@ -45,18 +45,7 @@ import { validateIndex, validateIndexRange } from "./util/index.js";
45
45
  // - Omit `props` properties from Row and Column schemas when not provided?
46
46
 
47
47
  // Longer-term work:
48
- // - Add constraint APIs to make it possible to avoid situations that could yield "orphaned" cells.
49
-
50
- /**
51
- * Scope for table schema built-in types.
52
- * @remarks User-provided factory scoping will be applied as `com.fluidframework.table<user-scope>`.
53
- */
54
- const baseSchemaScope = "com.fluidframework.table";
55
-
56
- /**
57
- * A private symbol put on table schema to help identify them.
58
- */
59
- const tableSchemaSymbol: unique symbol = Symbol("tableNode");
48
+ // - Use more focused constraint APIs to protect against leaked cells
60
49
 
61
50
  /**
62
51
  * A row in a table.
@@ -88,7 +77,14 @@ export interface RowPrivate<
88
77
  * This namespace should be strictly type-exported by the package.
89
78
  * All members should be tagged with `@system`.
90
79
  *
91
- * @system @alpha
80
+ * Orphaned Cells:
81
+ * Without safeguards, it is possible for cells to become "orphaned".
82
+ * An orphaned cell is a cell that does not correspond to a valid row and column.
83
+ * In order to preserve the invariant that all cells must have a valid row and column, table operations
84
+ * (eg, inserting/removing rows/columns, or setting/removing a cell) will automatically include constraints that
85
+ * guard transactions from producing orphaned cells.
86
+ *
87
+ * @system @beta
92
88
  */
93
89
  export namespace System_TableSchema {
94
90
  /**
@@ -99,7 +95,7 @@ export namespace System_TableSchema {
99
95
  * Note: this can't reasonably be implemented via `Pick<ArrayNode<...>>` because we only want to include the
100
96
  * subset of its method overloads which do not support moving items between lists.
101
97
  *
102
- * @alpha @system
98
+ * @beta @system
103
99
  */
104
100
  export type RearrangeableList<TItemSchema extends ImplicitAllowedTypes> = TreeNode &
105
101
  readonly TreeNodeFromImplicitAllowedTypes<TItemSchema>[] & {
@@ -127,7 +123,7 @@ export namespace System_TableSchema {
127
123
  * Longer term, it would be better to simply omit "props" altogether by default.
128
124
  * For now, this ensures that the user doesn't have to specify a "props" entry when initializing column/row nodes
129
125
  * and ensures that they cannot set anything that might conflict with future evolutions of the schema.
130
- * @system @alpha
126
+ * @system @beta
131
127
  */
132
128
  export type DefaultPropsType = ReturnType<typeof SchemaFactory.optional<[]>>;
133
129
 
@@ -135,7 +131,7 @@ export namespace System_TableSchema {
135
131
  * A base interface for factory input options which include an schema factory.
136
132
  * @remarks This interface should not be referenced directly.
137
133
  * @privateRemarks This interface primarily exists to provide a single home for property documentation.
138
- * @system @alpha
134
+ * @system @beta
139
135
  */
140
136
  export interface OptionsWithSchemaFactory<TSchemaFactory extends SchemaFactoryBeta> {
141
137
  /**
@@ -150,7 +146,7 @@ export namespace System_TableSchema {
150
146
  * A base interface for factory input options which include the table cell schema.
151
147
  * @remarks This interface should not be referenced directly.
152
148
  * @privateRemarks This interface primarily exists to provide a single home for property documentation.
153
- * @system @alpha
149
+ * @system @beta
154
150
  */
155
151
  export interface OptionsWithCellSchema<TCellSchema extends ImplicitAllowedTypes> {
156
152
  /**
@@ -164,7 +160,7 @@ export namespace System_TableSchema {
164
160
  /**
165
161
  * Base options for creating table column schema.
166
162
  * @remarks Includes parameters common to all column factory overloads.
167
- * @system @alpha
163
+ * @system @beta
168
164
  */
169
165
  export type CreateColumnOptionsBase<
170
166
  TUserScope extends string = string,
@@ -174,7 +170,7 @@ export namespace System_TableSchema {
174
170
 
175
171
  /**
176
172
  * Factory for creating column schema.
177
- * @system @alpha
173
+ * @system @beta
178
174
  */
179
175
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
180
176
  export function createColumnSchema<
@@ -290,7 +286,7 @@ export namespace System_TableSchema {
290
286
 
291
287
  /**
292
288
  * Base column schema type.
293
- * @sealed @system @alpha
289
+ * @sealed @system @beta
294
290
  */
295
291
  export type ColumnSchemaBase<
296
292
  TUserScope extends string = string,
@@ -305,7 +301,7 @@ export namespace System_TableSchema {
305
301
  /**
306
302
  * Base options for creating table row schema.
307
303
  * @remarks Includes parameters common to all row factory overloads.
308
- * @system @alpha
304
+ * @system @beta
309
305
  */
310
306
  export type CreateRowOptionsBase<
311
307
  TUserScope extends string = string,
@@ -315,7 +311,7 @@ export namespace System_TableSchema {
315
311
 
316
312
  /**
317
313
  * Factory for creating row schema.
318
- * @sealed @alpha
314
+ * @system @beta
319
315
  */
320
316
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
321
317
  export function createRowSchema<
@@ -443,7 +439,7 @@ export namespace System_TableSchema {
443
439
 
444
440
  /**
445
441
  * Base row schema type.
446
- * @sealed @system @alpha
442
+ * @sealed @system @beta
447
443
  */
448
444
  export type RowSchemaBase<
449
445
  TUserScope extends string = string,
@@ -458,7 +454,7 @@ export namespace System_TableSchema {
458
454
  /**
459
455
  * Base options for creating table schema.
460
456
  * @remarks Includes parameters common to all table factory overloads.
461
- * @system @alpha
457
+ * @system @beta
462
458
  */
463
459
  export type TableFactoryOptionsBase<
464
460
  TUserScope extends string = string,
@@ -468,7 +464,7 @@ export namespace System_TableSchema {
468
464
 
469
465
  /**
470
466
  * Factory for creating table schema.
471
- * @system @alpha
467
+ * @system @beta
472
468
  */
473
469
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
474
470
  export function createTableSchema<
@@ -643,15 +639,33 @@ export namespace System_TableSchema {
643
639
 
644
640
  // #endregion
645
641
 
646
- // TypeScript is unable to narrow the column type correctly here, hence the casts below.
647
- // See: https://github.com/microsoft/TypeScript/issues/52144
648
- if (index === undefined) {
649
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
650
- this.table.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);
651
- } else {
652
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
653
- this.table.columns.insertAt(index, TreeArrayNode.spread(columns) as any);
654
- }
642
+ this.#applyEditsInBatch({
643
+ applyEdits: () => {
644
+ // TypeScript is unable to narrow the column type correctly here, hence the casts below.
645
+ // See: https://github.com/microsoft/TypeScript/issues/52144
646
+ if (index === undefined) {
647
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
648
+ this.table.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);
649
+ } else {
650
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
651
+ this.table.columns.insertAt(index, TreeArrayNode.spread(columns) as any);
652
+ }
653
+ },
654
+ // Relevant invariant: each cell corresponds to an existing row and column
655
+ // Scenarios that this constraint is intended to prevent:
656
+ // * Client A inserts a column, then client B adds row with a cell for that column, then client A reverts the column insertion.
657
+ // * Client A inserts a column, then client B populates a cell for that column within an existing row, then client A reverts the column insertion.
658
+ // Notes:
659
+ // * In either scenario, A and B may be the same client.
660
+ // * In either scenario, B's edit and the revert may or may not be concurrent.
661
+ // Collateral scenarios that this constraint also prevents:
662
+ // * Any other scenario where client A inserts a column, then client B edits _any_ part of the tree, then client A reverts the column insertion.
663
+ // Future improvements:
664
+ // Use both...
665
+ // * A "no attach on revert" constraint on the row array
666
+ // * A "no shallow change" constraint on every cell that corresponds to the new column in every existing row
667
+ preconditionsOnRevert: [{ type: "noChange" }],
668
+ });
655
669
 
656
670
  // Inserting the input nodes into the tree hydrates them, making them usable as nodes.
657
671
  return columns as unknown as ColumnValueType[];
@@ -673,15 +687,33 @@ export namespace System_TableSchema {
673
687
 
674
688
  // #endregion
675
689
 
676
- // TypeScript is unable to narrow the row type correctly here, hence the casts below.
677
- // See: https://github.com/microsoft/TypeScript/issues/52144
678
- if (index === undefined) {
679
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
680
- this.table.rows.insertAtEnd(TreeArrayNode.spread(rows) as any);
681
- } else {
682
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
683
- this.table.rows.insertAt(index, TreeArrayNode.spread(rows) as any);
684
- }
690
+ // Relevant invariant: each cell corresponds to an existing row and column
691
+ // Prevents cell leaks from concurrently removed columns.
692
+ // Example scenario: Client A removes a column while concurrently Client B adds a row with cells for those columns (including the one A removed).
693
+ // If client B is sequenced after A, then B's row could have cells that do not correspond to existing columns.
694
+ // This constraint ensures all columns that existed when creating the row still exist when the row insertion is applied.
695
+ // TODO: Replace with "no detach" constraint on the column array when available.
696
+ const columnConstraints: TransactionConstraintAlpha[] = this.table.columns.map(
697
+ (column) => ({
698
+ type: "nodeInDocument",
699
+ node: column as ColumnValueType,
700
+ }),
701
+ );
702
+
703
+ this.#applyEditsInBatch({
704
+ applyEdits: () => {
705
+ // TypeScript is unable to narrow the row type correctly here, hence the casts below.
706
+ // See: https://github.com/microsoft/TypeScript/issues/52144
707
+ if (index === undefined) {
708
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
709
+ this.table.rows.insertAtEnd(TreeArrayNode.spread(rows) as any);
710
+ } else {
711
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
712
+ this.table.rows.insertAt(index, TreeArrayNode.spread(rows) as any);
713
+ }
714
+ },
715
+ preconditions: columnConstraints.length > 0 ? columnConstraints : undefined,
716
+ });
685
717
 
686
718
  // Inserting the input nodes into the tree hydrates them, making them usable as nodes.
687
719
  return rows as unknown as RowValueType[];
@@ -696,13 +728,48 @@ export namespace System_TableSchema {
696
728
  const row = this.#getRow(rowOrId);
697
729
  const column = this.#getColumn(columnOrId);
698
730
 
699
- (row as RowValueInternalType).cells[column.id] = cell as CellValueType;
731
+ this.#applyEditsInBatch({
732
+ applyEdits: () => {
733
+ (row as RowValueInternalType).cells[column.id] = cell as CellValueType;
734
+ },
735
+ // Relevant invariant: each cell corresponds to an existing row and column
736
+ // Prevents cell leaks from concurrently removed columns in earlier-sequenced edits.
737
+ // Example scenario: Client A removes a column, then Client B concurrently sets a cell in that column (sequenced after A's edit).
738
+ // If both edits are applied, B's cell would not correspond to an existing column.
739
+ preconditions: [
740
+ {
741
+ type: "nodeInDocument",
742
+ node: column,
743
+ },
744
+ ],
745
+ // Relevant invariant: each cell corresponds to an existing row and column
746
+ // Example scenario: Client A overwrites a populated cell, then Client B removes the column associated with the A's cell (this clears the cell).
747
+ // If Client A then reverts their edit, the overwritten value is restored in the cell despite the absence of column for that cell.
748
+ preconditionsOnRevert:
749
+ (row as RowValueInternalType).cells[column.id] === undefined
750
+ ? undefined
751
+ : [
752
+ {
753
+ type: "nodeInDocument",
754
+ node: column,
755
+ },
756
+ ],
757
+ });
700
758
  }
701
759
 
702
760
  public removeColumns(
703
761
  indexOrColumns: number | undefined | readonly string[] | readonly ColumnValueType[],
704
762
  count: number | undefined = undefined,
705
763
  ): ColumnValueType[] {
764
+ // Relevant invariant: each cell corresponds to an existing row and column
765
+ // Prevents cell leaks from concurrently added rows in earlier-sequenced edits.
766
+ // Example scenario: Client A adds a row, Client B concurrently removes a column that is populated in A's row.
767
+ // If Client A's edit is sequenced before Client B's edit, then B's removal would orphan the cell in A's row.
768
+ // We have the same problem if Client A populates a cell for one of the columns removed by B
769
+ // This constraint ensures no rows were added.
770
+ // TODO: Replace with "no attach" constraint on the row array when available.
771
+ const preconditions: TransactionConstraintAlpha[] = [{ type: "noChange" }];
772
+
706
773
  if (typeof indexOrColumns === "number" || indexOrColumns === undefined) {
707
774
  let removedColumns: ColumnValueType[] | undefined;
708
775
  const startIndex = indexOrColumns ?? 0;
@@ -716,25 +783,28 @@ export namespace System_TableSchema {
716
783
 
717
784
  validateIndexRange(startIndex, endIndex, this.table.columns, "Table.removeColumns");
718
785
 
719
- this.#applyEditsInBatch(() => {
720
- const columnsToRemove = this.table.columns.slice(
721
- startIndex,
722
- endIndex,
723
- ) as ColumnValueType[];
786
+ this.#applyEditsInBatch({
787
+ applyEdits: () => {
788
+ const columnsToRemove = this.table.columns.slice(
789
+ startIndex,
790
+ endIndex,
791
+ ) as ColumnValueType[];
724
792
 
725
- // First, remove all cells that correspond to each column from each row:
726
- for (const column of columnsToRemove) {
727
- this.#removeCells(column);
728
- }
793
+ // First, remove all cells that correspond to each column from each row:
794
+ for (const column of columnsToRemove) {
795
+ this.#removeCells(column);
796
+ }
729
797
 
730
- // Second, remove the column nodes:
731
- removeRangeFromArray(
732
- startIndex,
733
- endIndex,
734
- this.table.columns,
735
- "Table.removeColumns",
736
- );
737
- removedColumns = columnsToRemove;
798
+ // Second, remove the column nodes:
799
+ removeRangeFromArray(
800
+ startIndex,
801
+ endIndex,
802
+ this.table.columns,
803
+ "Table.removeColumns",
804
+ );
805
+ removedColumns = columnsToRemove;
806
+ },
807
+ preconditions,
738
808
  });
739
809
  return removedColumns ?? fail(0xc1f /* Transaction did not complete. */);
740
810
  } else {
@@ -751,23 +821,26 @@ export namespace System_TableSchema {
751
821
  columnsToRemove.push(this.#getColumn(columnOrIdToRemove));
752
822
  }
753
823
 
754
- this.#applyEditsInBatch(() => {
755
- // Note, throwing an error within a transaction will abort the entire transaction.
756
- // So if we throw an error here for any column, no columns will be removed.
757
- for (const columnToRemove of columnsToRemove) {
758
- // Remove the corresponding cell from all rows.
759
- for (const row of this.table.rows) {
760
- // TypeScript is unable to narrow the row type correctly here, hence the cast.
761
- // See: https://github.com/microsoft/TypeScript/issues/52144
762
- this.removeCell({
763
- column: columnToRemove,
764
- row: row as RowValueType,
765
- });
824
+ this.#applyEditsInBatch({
825
+ applyEdits: () => {
826
+ // Note, throwing an error within a transaction will abort the entire transaction.
827
+ // So if we throw an error here for any column, no columns will be removed.
828
+ for (const columnToRemove of columnsToRemove) {
829
+ // Remove the corresponding cell from all rows.
830
+ for (const row of this.table.rows) {
831
+ // TypeScript is unable to narrow the row type correctly here, hence the cast.
832
+ // See: https://github.com/microsoft/TypeScript/issues/52144
833
+ this.removeCell({
834
+ column: columnToRemove,
835
+ row: row as RowValueType,
836
+ });
837
+ }
838
+
839
+ // We have already validated that all of the columns exist above, so this is safe.
840
+ this.table.columns.removeAt(this.table.columns.indexOf(columnToRemove));
766
841
  }
767
-
768
- // We have already validated that all of the columns exist above, so this is safe.
769
- this.table.columns.removeAt(this.table.columns.indexOf(columnToRemove));
770
- }
842
+ },
843
+ preconditions,
771
844
  });
772
845
  return columnsToRemove;
773
846
  }
@@ -777,7 +850,21 @@ export namespace System_TableSchema {
777
850
  indexOrRows: number | undefined | readonly string[] | readonly RowValueType[],
778
851
  count?: number | undefined,
779
852
  ): RowValueType[] {
853
+ // Relevant invariant: each cell corresponds to an existing row and column
854
+ // Adding a constraint on columns here to prevent cells being orphaned. The relevant scenario is:
855
+ // Client A removes rows
856
+ // Client B (either concurrently or not, so long as B's edit is sequenced after A's edit) removes a column,
857
+ // Client A reverts the removal of the rows
858
+ // TODO: Replace with "no detach on revert" constraint on the column array when available.
859
+ const columnConstraints: TransactionConstraintAlpha[] = this.table.columns.map(
860
+ (column) => ({
861
+ type: "nodeInDocument",
862
+ node: column as ColumnValueType,
863
+ }),
864
+ );
865
+
780
866
  if (typeof indexOrRows === "number" || indexOrRows === undefined) {
867
+ let removedRows: RowValueType[] | undefined;
781
868
  const startIndex = indexOrRows ?? 0;
782
869
  const endIndex = count === undefined ? this.table.rows.length : startIndex + count;
783
870
 
@@ -786,12 +873,20 @@ export namespace System_TableSchema {
786
873
  return [];
787
874
  }
788
875
 
789
- return removeRangeFromArray(
790
- startIndex,
791
- endIndex,
792
- this.table.rows,
793
- "Table.removeRows",
794
- );
876
+ validateIndexRange(startIndex, endIndex, this.table.rows, "Table.removeRows");
877
+ this.#applyEditsInBatch({
878
+ applyEdits: () => {
879
+ removedRows = removeRangeFromArray(
880
+ startIndex,
881
+ endIndex,
882
+ this.table.rows,
883
+ "Table.removeRows",
884
+ );
885
+ },
886
+ preconditionsOnRevert:
887
+ columnConstraints.length > 0 ? columnConstraints : undefined,
888
+ });
889
+ return removedRows ?? fail(0xccd /* Transaction did not complete */);
795
890
  }
796
891
 
797
892
  // If there are no rows to remove, do nothing
@@ -806,15 +901,17 @@ export namespace System_TableSchema {
806
901
  for (const rowToRemove of indexOrRows) {
807
902
  rowsToRemove.push(this.#getRow(rowToRemove));
808
903
  }
809
-
810
- this.#applyEditsInBatch(() => {
811
- // Note, throwing an error within a transaction will abort the entire transaction.
812
- // So if we throw an error here for any row, no rows will be removed.
813
- for (const rowToRemove of rowsToRemove) {
814
- // We have already validated that all of the rows exist above, so this is safe.
815
- const index = this.table.rows.indexOf(rowToRemove);
816
- this.table.rows.removeAt(index);
817
- }
904
+ this.#applyEditsInBatch({
905
+ applyEdits: () => {
906
+ // Note, throwing an error within a transaction will abort the entire transaction.
907
+ // So if we throw an error here for any row, no rows will be removed.
908
+ for (const rowToRemove of rowsToRemove) {
909
+ // We have already validated that all of the rows exist above, so this is safe.
910
+ const index = this.table.rows.indexOf(rowToRemove);
911
+ this.table.rows.removeAt(index);
912
+ }
913
+ },
914
+ preconditionsOnRevert: columnConstraints.length > 0 ? columnConstraints : undefined,
818
915
  });
819
916
  return rowsToRemove;
820
917
  }
@@ -831,8 +928,24 @@ export namespace System_TableSchema {
831
928
  return undefined;
832
929
  }
833
930
 
834
- // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
835
- delete row.cells[column.id];
931
+ this.#applyEditsInBatch({
932
+ applyEdits: () => {
933
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
934
+ delete row.cells[column.id];
935
+ },
936
+ // Relevant invariant: each cell corresponds to an existing row and column
937
+ // Prevents cell leaks from concurrently removed columns in earlier-sequenced edits when this cell removal is reverted.
938
+ // Example scenario: Client A removes a cell, then Client B removes the column for that cell.
939
+ // If A's cell removal is later reverted, the cell would be restored but B's column removal means there's no column for it.
940
+ // This constraint on revert ensures the column still exists, ensuring restored cells correspond to existing columns.
941
+ preconditionsOnRevert: [
942
+ {
943
+ type: "nodeInDocument",
944
+ node: column,
945
+ },
946
+ ],
947
+ });
948
+
836
949
  return cell;
837
950
  }
838
951
 
@@ -859,7 +972,15 @@ export namespace System_TableSchema {
859
972
  * Transactions are not supported for unhydrated trees, so we cannot run a transaction in that case.
860
973
  * But since there are no collaborators, this is not an issue.
861
974
  */
862
- #applyEditsInBatch(applyEdits: () => void): void {
975
+ #applyEditsInBatch(options: {
976
+ /** The edits to apply. */
977
+ applyEdits: () => void;
978
+ /** Optional constraints that must be satisfied for the transaction to proceed. */
979
+ preconditions?: readonly TransactionConstraintAlpha[];
980
+ /** Optional constraints that must be satisfied on revert for the transaction to proceed. */
981
+ preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
982
+ }): void {
983
+ const { applyEdits, preconditions, preconditionsOnRevert } = options;
863
984
  const branch = TreeAlpha.branch(this);
864
985
 
865
986
  // Ensure events are paused until all of the edits are applied.
@@ -872,9 +993,15 @@ export namespace System_TableSchema {
872
993
  // Therefore, we don't need to run the edits as a transaction.
873
994
  applyEdits();
874
995
  } else {
875
- branch.runTransaction(() => {
876
- applyEdits();
877
- });
996
+ branch.runTransaction(
997
+ () => {
998
+ applyEdits();
999
+ if (preconditionsOnRevert !== undefined) {
1000
+ return { preconditionsOnRevert };
1001
+ }
1002
+ },
1003
+ preconditions === undefined ? undefined : { preconditions },
1004
+ );
878
1005
  }
879
1006
  });
880
1007
  }
@@ -1078,9 +1205,9 @@ export namespace System_TableSchema {
1078
1205
  // #region If the row contains cells, verify that the table contains the columns for those cells
1079
1206
 
1080
1207
  // Note: we intentionally hide `cells` on `IRow` to avoid leaking the internal data representation as much as possible, so we have to cast here.
1081
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1208
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
1082
1209
  if ((newRow as any).cells !== undefined) {
1083
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1210
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
1084
1211
  const keys: string[] = Object.keys((newRow as any).cells);
1085
1212
  for (const key of keys) {
1086
1213
  if (!columnIds.has(key)) {
@@ -1115,13 +1242,6 @@ export namespace System_TableSchema {
1115
1242
  }
1116
1243
  }
1117
1244
 
1118
- // Set a private symbol on the schema class that marks it as having been generated by this factory.
1119
- // Column / Row functionality use this to validate that they are being used in a table.
1120
- // This is effectively a work-around that allows columns and rows to invoke table methods
1121
- // without having to pass the table as a parameter to their construction, which isn't possible.
1122
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1123
- (Table as any)[tableSchemaSymbol] = true;
1124
-
1125
1245
  // Named interfaces here do not compile.
1126
1246
  type Statics = {
1127
1247
  /**
@@ -1158,7 +1278,7 @@ export namespace System_TableSchema {
1158
1278
 
1159
1279
  /**
1160
1280
  * Base row schema type.
1161
- * @sealed @system @alpha
1281
+ * @sealed @system @beta
1162
1282
  */
1163
1283
  export type TableSchemaBase<
1164
1284
  TUserScope extends string,
@@ -1170,10 +1290,15 @@ export namespace System_TableSchema {
1170
1290
  // #endregion
1171
1291
  }
1172
1292
 
1293
+ /**
1294
+ * Sets up scope for table schema built-in types.
1295
+ * @remarks User-provided factory scoping will be applied as `com.fluidframework.table<user-scope>`.
1296
+ */
1297
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
1173
1298
  function createTableScopedFactory<TUserScope extends string>(
1174
1299
  inputSchemaFactory: SchemaFactoryBeta<TUserScope>,
1175
- ): SchemaFactoryBeta<`${typeof baseSchemaScope}<${TUserScope}>`> {
1176
- return new SchemaFactoryBeta(`${baseSchemaScope}<${inputSchemaFactory.scope}>`);
1300
+ ) {
1301
+ return createCustomizedFluidFrameworkScopedFactory(inputSchemaFactory, "tableV2");
1177
1302
  }
1178
1303
 
1179
1304
  /**
@@ -1204,10 +1329,16 @@ function removeRangeFromArray<TNodeSchema extends ImplicitAllowedTypes>(
1204
1329
  *
1205
1330
  * @remarks
1206
1331
  *
1207
- * WARNING: These APIs are in preview and are subject to change.
1208
- * Until these APIs have stabilized, it is not recommended to use them in production code.
1209
- * There may be breaking changes to these APIs and their underlying data format.
1210
- * Using these APIs in production code may result in data loss or corruption.
1332
+ * Note: the APIs produced by this module ensure various tabular data invariants are maintained that the raw, underlying tree structures do not.
1333
+ * For example, they ensure that cells always correspond to existing rows and columns (and do not become "orphaned" due to row/column deletion, etc.).
1334
+ * For this reason, direct manipulation of the underlying tree structures is not supported.
1335
+ * To modify the data, only the APIs provided here may be used.
1336
+ *
1337
+ * Also note: these APIs leverage `SharedTree` functionality that was added in version `2.80.0`,
1338
+ * which is not compatible with previous versions of this library.
1339
+ * To ensure safe collaboration, you will need to configure the {@link @fluidframework/runtime-definitions#MinimumVersionForCollab}
1340
+ * for the Fluid Runtime and/or `SharedTree` to at least `2.80.0`.
1341
+ * To set this minimum version for `SharedTree`, use {@link configuredSharedTreeBeta}.
1211
1342
  *
1212
1343
  * The primary APIs for create tabular data schema are:
1213
1344
  *
@@ -1230,12 +1361,6 @@ function removeRangeFromArray<TNodeSchema extends ImplicitAllowedTypes>(
1230
1361
  * Column and Row schema created using these APIs are extensible via the `props` field.
1231
1362
  * This allows association of additional properties with column and row nodes.
1232
1363
  *
1233
- * Cells in the table may become "orphaned."
1234
- * That is, it is possible to enter a state where one or more rows contain cells with no corresponding column.
1235
- * To reduce the likelihood of this, you can manually remove corresponding cells when removing columns.
1236
- * Either way, it is possible to enter such a state via the merging of edits.
1237
- * For example: one client might add a row while another concurrently removes a column, orphaning the cell where the column and row intersected.
1238
- *
1239
1364
  * @example Defining a Table schema
1240
1365
  *
1241
1366
  * ```typescript
@@ -1311,7 +1436,7 @@ function removeRangeFromArray<TNodeSchema extends ImplicitAllowedTypes>(
1311
1436
  * The above examples are backed by tests in `tableSchema.spec.ts`.
1312
1437
  * Those tests and these examples should be kept in-sync to ensure that the examples are correct.
1313
1438
  *
1314
- * @alpha
1439
+ * @beta
1315
1440
  */
1316
1441
  export namespace TableSchema {
1317
1442
  // #region Column
@@ -1321,7 +1446,7 @@ export namespace TableSchema {
1321
1446
  * @remarks Implemented by the schema class returned from {@link TableSchema.(column:2)}.
1322
1447
  * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
1323
1448
  * @typeParam TProps - Additional properties to associate with the column.
1324
- * @sealed @alpha
1449
+ * @sealed @beta
1325
1450
  */
1326
1451
  export interface Column<
1327
1452
  // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Reserving this for future use.
@@ -1349,7 +1474,7 @@ export namespace TableSchema {
1349
1474
  * Factory for creating new table column schema.
1350
1475
  * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1351
1476
  * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
1352
- * @alpha
1477
+ * @beta
1353
1478
  */
1354
1479
  export function column<
1355
1480
  const TUserScope extends string,
@@ -1370,7 +1495,7 @@ export namespace TableSchema {
1370
1495
  * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1371
1496
  * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
1372
1497
  * @typeParam TProps - Additional properties to associate with the column.
1373
- * @alpha
1498
+ * @beta
1374
1499
  */
1375
1500
  export function column<
1376
1501
  const TUserScope extends string,
@@ -1410,7 +1535,7 @@ export namespace TableSchema {
1410
1535
  * @remarks Implemented by the schema class returned from {@link TableSchema.(row:2)}.
1411
1536
  * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
1412
1537
  * @typeParam TProps - Additional properties to associate with the row.
1413
- * @sealed @alpha
1538
+ * @sealed @beta
1414
1539
  */
1415
1540
  export interface Row<
1416
1541
  // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Reserving this for future use.
@@ -1438,7 +1563,7 @@ export namespace TableSchema {
1438
1563
  * Factory for creating new table column schema.
1439
1564
  * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1440
1565
  * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
1441
- * @alpha
1566
+ * @beta
1442
1567
  */
1443
1568
  export function row<
1444
1569
  const TUserScope extends string,
@@ -1455,7 +1580,7 @@ export namespace TableSchema {
1455
1580
  * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1456
1581
  * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
1457
1582
  * @typeParam TProps - Additional properties to associate with the row.
1458
- * @alpha
1583
+ * @beta
1459
1584
  */
1460
1585
  export function row<
1461
1586
  const TUserScope extends string,
@@ -1492,7 +1617,12 @@ export namespace TableSchema {
1492
1617
 
1493
1618
  /**
1494
1619
  * A key to uniquely identify a cell within a table.
1495
- * @input @alpha
1620
+ *
1621
+ * @remarks
1622
+ * Note that edits to the table structure (including edits by collaborators) can cause indexes to refer to different cells over time.
1623
+ * Therefore, it is recommended to use IDs or node references whenever possible to identify cells.
1624
+ *
1625
+ * @input @beta
1496
1626
  */
1497
1627
  export interface CellKey<
1498
1628
  TColumn extends ImplicitAllowedTypes,
@@ -1511,7 +1641,7 @@ export namespace TableSchema {
1511
1641
 
1512
1642
  /**
1513
1643
  * {@link TableSchema.Table.insertColumns} parameters.
1514
- * @input @alpha
1644
+ * @input @beta
1515
1645
  */
1516
1646
  export interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
1517
1647
  /**
@@ -1528,7 +1658,7 @@ export namespace TableSchema {
1528
1658
 
1529
1659
  /**
1530
1660
  * {@link TableSchema.Table.insertRows} parameters.
1531
- * @input @alpha
1661
+ * @input @beta
1532
1662
  */
1533
1663
  export interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
1534
1664
  /**
@@ -1545,7 +1675,7 @@ export namespace TableSchema {
1545
1675
 
1546
1676
  /**
1547
1677
  * {@link TableSchema.Table.setCell} parameters.
1548
- * @input @alpha
1678
+ * @input @beta
1549
1679
  */
1550
1680
  export interface SetCellParameters<
1551
1681
  TCell extends ImplicitAllowedTypes,
@@ -1575,7 +1705,7 @@ export namespace TableSchema {
1575
1705
  * @typeParam TColumn - The type of the columns in the table.
1576
1706
  * @typeParam TRow - The type of the rows in the table.
1577
1707
  *
1578
- * @sealed @alpha
1708
+ * @sealed @beta
1579
1709
  */
1580
1710
  export interface Table<
1581
1711
  TUserScope extends string,
@@ -1600,6 +1730,11 @@ export namespace TableSchema {
1600
1730
  getColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
1601
1731
  /**
1602
1732
  * Gets a table column by its index in the table.
1733
+ *
1734
+ * @remarks
1735
+ * Note that edits to the table structure (including edits by collaborators) can cause indexes to refer to different columns over time.
1736
+ * Therefore, it is recommended to use IDs whenever possible to identify columns.
1737
+ *
1603
1738
  * @returns The column, if it exists. Otherwise, `undefined`.
1604
1739
  */
1605
1740
  getColumn(index: number): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
@@ -1611,6 +1746,11 @@ export namespace TableSchema {
1611
1746
  getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
1612
1747
  /**
1613
1748
  * Gets a table row by its index in the table.
1749
+ *
1750
+ * @remarks
1751
+ * Note that edits to the table structure (including edits by collaborators) can cause indexes to refer to different rows over time.
1752
+ * Therefore, it is recommended to use IDs whenever possible to identify rows.
1753
+ *
1614
1754
  * @returns The row, if it exists. Otherwise, `undefined`.
1615
1755
  */
1616
1756
  getRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
@@ -1741,7 +1881,7 @@ export namespace TableSchema {
1741
1881
 
1742
1882
  /**
1743
1883
  * Input parameters for {@link TableSchema.Table}'s `create` factory method.
1744
- * @input @alpha
1884
+ * @input @beta
1745
1885
  */
1746
1886
  export interface TableFactoryMethodParameters<
1747
1887
  TUserScope extends string,
@@ -1768,7 +1908,7 @@ export namespace TableSchema {
1768
1908
  * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1769
1909
  * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.
1770
1910
  * @typeParam TCell - The type of the cells in the table.
1771
- * @alpha
1911
+ * @beta
1772
1912
  */
1773
1913
  export function table<
1774
1914
  const TUserScope extends string,
@@ -1795,7 +1935,7 @@ export namespace TableSchema {
1795
1935
  * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.
1796
1936
  * @typeParam TCell - The type of the cells in the table.
1797
1937
  * @typeParam TColumn - The type of the columns in the table.
1798
- * @alpha
1938
+ * @beta
1799
1939
  */
1800
1940
  export function table<
1801
1941
  const TUserScope extends string,
@@ -1821,7 +1961,7 @@ export namespace TableSchema {
1821
1961
  * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.
1822
1962
  * @typeParam TCell - The type of the cells in the table.
1823
1963
  * @typeParam TRow - The type of the rows in the table.
1824
- * @alpha
1964
+ * @beta
1825
1965
  */
1826
1966
  export function table<
1827
1967
  const TUserScope extends string,
@@ -1852,7 +1992,7 @@ export namespace TableSchema {
1852
1992
  * @typeParam TCell - The type of the cells in the table.
1853
1993
  * @typeParam TColumn - The type of the columns in the table.
1854
1994
  * @typeParam TRow - The type of the rows in the table.
1855
- * @alpha
1995
+ * @beta
1856
1996
  */
1857
1997
  export function table<
1858
1998
  const TUserScope extends string,