@fluidframework/tree 2.74.0-365691 → 2.74.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 (856) hide show
  1. package/.vscode/settings.json +4 -2
  2. package/CHANGELOG.md +11 -0
  3. package/api-report/tree.alpha.api.md +125 -87
  4. package/api-report/tree.beta.api.md +0 -1
  5. package/api-report/tree.legacy.beta.api.md +0 -1
  6. package/api-report/tree.legacy.public.api.md +0 -1
  7. package/api-report/tree.public.api.md +0 -1
  8. package/assertTagging.config.mjs +1 -1
  9. package/dist/alpha.d.ts +6 -2
  10. package/dist/codec/codec.d.ts +41 -13
  11. package/dist/codec/codec.d.ts.map +1 -1
  12. package/dist/codec/codec.js +46 -19
  13. package/dist/codec/codec.js.map +1 -1
  14. package/dist/codec/versioned/codec.d.ts +1 -1
  15. package/dist/codec/versioned/codec.d.ts.map +1 -1
  16. package/dist/codec/versioned/codec.js.map +1 -1
  17. package/dist/codec/versioned/format.d.ts +4 -1
  18. package/dist/codec/versioned/format.d.ts.map +1 -1
  19. package/dist/codec/versioned/format.js +4 -1
  20. package/dist/codec/versioned/format.js.map +1 -1
  21. package/dist/core/index.d.ts +2 -2
  22. package/dist/core/index.d.ts.map +1 -1
  23. package/dist/core/index.js +4 -3
  24. package/dist/core/index.js.map +1 -1
  25. package/dist/core/rebase/index.d.ts +1 -1
  26. package/dist/core/rebase/index.d.ts.map +1 -1
  27. package/dist/core/rebase/index.js.map +1 -1
  28. package/dist/core/rebase/types.d.ts +20 -1
  29. package/dist/core/rebase/types.d.ts.map +1 -1
  30. package/dist/core/rebase/types.js.map +1 -1
  31. package/dist/core/schema-stored/schema.d.ts +4 -7
  32. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  33. package/dist/core/schema-stored/schema.js +2 -2
  34. package/dist/core/schema-stored/schema.js.map +1 -1
  35. package/dist/core/tree/detachedFieldIndex.d.ts +34 -13
  36. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  37. package/dist/core/tree/detachedFieldIndex.js +12 -12
  38. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  39. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
  40. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  41. package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -2
  42. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  43. package/dist/core/tree/index.d.ts +3 -2
  44. package/dist/core/tree/index.d.ts.map +1 -1
  45. package/dist/core/tree/index.js +3 -0
  46. package/dist/core/tree/index.js.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  48. package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -2
  49. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  50. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
  51. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  52. package/dist/feature-libraries/chunked-forest/codec/format.js +4 -4
  53. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  54. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  55. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  56. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  58. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  59. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
  60. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  61. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +22 -26
  62. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  63. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  64. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  65. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
  66. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  67. package/dist/feature-libraries/forest-summary/codec.d.ts +7 -1
  68. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  69. package/dist/feature-libraries/forest-summary/codec.js +13 -11
  70. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  71. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -13
  72. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  73. package/dist/feature-libraries/forest-summary/forestSummarizer.js +35 -31
  74. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  75. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
  76. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
  77. package/dist/feature-libraries/forest-summary/formatCommon.js +27 -0
  78. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -0
  79. package/dist/feature-libraries/forest-summary/formatV1.d.ts +51 -0
  80. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
  81. package/dist/feature-libraries/forest-summary/formatV1.js +11 -0
  82. package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -0
  83. package/dist/feature-libraries/forest-summary/formatV2.d.ts +51 -0
  84. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
  85. package/dist/feature-libraries/forest-summary/formatV2.js +11 -0
  86. package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -0
  87. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +18 -24
  88. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  89. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +21 -43
  90. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  91. package/dist/feature-libraries/forest-summary/index.d.ts +2 -2
  92. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  93. package/dist/feature-libraries/forest-summary/index.js +3 -4
  94. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  95. package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
  96. package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
  97. package/dist/feature-libraries/forest-summary/summaryFormatCommon.js +43 -0
  98. package/dist/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
  99. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
  100. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
  101. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js +14 -0
  102. package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
  103. package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
  104. package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
  105. package/dist/feature-libraries/forest-summary/summaryFormatV3.js +21 -0
  106. package/dist/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
  107. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +17 -0
  108. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  109. package/dist/feature-libraries/forest-summary/summaryTypes.js +35 -0
  110. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  111. package/dist/feature-libraries/index.d.ts +1 -1
  112. package/dist/feature-libraries/index.d.ts.map +1 -1
  113. package/dist/feature-libraries/index.js +3 -2
  114. package/dist/feature-libraries/index.js.map +1 -1
  115. package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
  116. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  117. package/dist/feature-libraries/modular-schema/comparison.js +54 -3
  118. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  119. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  120. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  121. package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
  122. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  123. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  124. package/dist/feature-libraries/modular-schema/genericFieldKind.js +4 -1
  125. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  126. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  127. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  128. package/dist/feature-libraries/modular-schema/index.js +2 -1
  129. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  130. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  131. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
  132. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  133. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  134. package/dist/feature-libraries/schema-index/codec.js +4 -4
  135. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  136. package/dist/feature-libraries/schema-index/formatV1.d.ts +1 -1
  137. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
  138. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  139. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  140. package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
  141. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  142. package/dist/index.d.ts +2 -2
  143. package/dist/index.d.ts.map +1 -1
  144. package/dist/index.js +5 -3
  145. package/dist/index.js.map +1 -1
  146. package/dist/packageVersion.d.ts +1 -1
  147. package/dist/packageVersion.d.ts.map +1 -1
  148. package/dist/packageVersion.js +1 -1
  149. package/dist/packageVersion.js.map +1 -1
  150. package/dist/shared-tree/independentView.d.ts +1 -1
  151. package/dist/shared-tree/independentView.d.ts.map +1 -1
  152. package/dist/shared-tree/independentView.js +1 -1
  153. package/dist/shared-tree/independentView.js.map +1 -1
  154. package/dist/shared-tree/schematizingTreeView.d.ts +2 -1
  155. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  156. package/dist/shared-tree/schematizingTreeView.js +3 -0
  157. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  158. package/dist/shared-tree/sharedTree.d.ts +2 -2
  159. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  160. package/dist/shared-tree/sharedTree.js +4 -4
  161. package/dist/shared-tree/sharedTree.js.map +1 -1
  162. package/dist/shared-tree/sharedTreeChangeCodecs.js +2 -2
  163. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  164. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  165. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  166. package/dist/shared-tree/sharedTreeChangeEnricher.js +25 -11
  167. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  168. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  169. package/dist/shared-tree/treeAlpha.js +1 -1
  170. package/dist/shared-tree/treeAlpha.js.map +1 -1
  171. package/dist/shared-tree/treeCheckout.d.ts +10 -5
  172. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  173. package/dist/shared-tree/treeCheckout.js +72 -17
  174. package/dist/shared-tree/treeCheckout.js.map +1 -1
  175. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  176. package/dist/shared-tree-core/editManagerCodecs.js +10 -8
  177. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  178. package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  179. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  180. package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
  181. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  182. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +8 -30
  183. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  184. package/dist/shared-tree-core/editManagerFormatCommons.js +18 -9
  185. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  186. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +1 -1
  187. package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  188. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  189. package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  190. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  191. package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  192. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  193. package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
  194. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  195. package/dist/shared-tree-core/index.d.ts +5 -2
  196. package/dist/shared-tree-core/index.d.ts.map +1 -1
  197. package/dist/shared-tree-core/index.js +7 -1
  198. package/dist/shared-tree-core/index.js.map +1 -1
  199. package/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  200. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  201. package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
  202. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  203. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  204. package/dist/shared-tree-core/messageCodecs.js +12 -10
  205. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  206. package/dist/shared-tree-core/messageFormat.d.ts +9 -36
  207. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  208. package/dist/shared-tree-core/messageFormat.js +19 -9
  209. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  210. package/{lib/shared-tree-core/messageFormatV5.d.ts → dist/shared-tree-core/messageFormatVSharedBranches.d.ts} +5 -7
  211. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  212. package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  213. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  214. package/dist/shared-tree-core/sharedTreeCore.d.ts +13 -47
  215. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  216. package/dist/shared-tree-core/sharedTreeCore.js +29 -17
  217. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  218. package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
  219. package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
  220. package/dist/shared-tree-core/summaryTypes.js +47 -0
  221. package/dist/shared-tree-core/summaryTypes.js.map +1 -0
  222. package/dist/shared-tree-core/versionedSummarizer.d.ts +72 -0
  223. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  224. package/dist/shared-tree-core/versionedSummarizer.js +64 -0
  225. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
  226. package/dist/simple-tree/api/configuration.d.ts +3 -26
  227. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  228. package/dist/simple-tree/api/configuration.js +10 -21
  229. package/dist/simple-tree/api/configuration.js.map +1 -1
  230. package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
  231. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  232. package/dist/simple-tree/api/dirtyIndex.js +7 -0
  233. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  234. package/dist/simple-tree/api/discrepancies.d.ts +1 -1
  235. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  236. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  237. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
  238. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
  239. package/dist/simple-tree/api/eraseSchemaDetails.js +97 -0
  240. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -0
  241. package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
  242. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  243. package/dist/simple-tree/api/getSimpleSchema.js +9 -3
  244. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  245. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  246. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  247. package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
  248. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  249. package/dist/simple-tree/api/index.d.ts +4 -4
  250. package/dist/simple-tree/api/index.d.ts.map +1 -1
  251. package/dist/simple-tree/api/index.js +8 -5
  252. package/dist/simple-tree/api/index.js.map +1 -1
  253. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  254. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  255. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  256. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  257. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  258. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  259. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  260. package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
  261. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  262. package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
  263. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  264. package/dist/simple-tree/api/schemaFromSimple.js +5 -0
  265. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  266. package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
  267. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  268. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  269. package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
  270. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  271. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  272. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  273. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  274. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  275. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  276. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
  277. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  278. package/dist/simple-tree/api/storedSchema.d.ts +1 -1
  279. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  280. package/dist/simple-tree/api/storedSchema.js +1 -2
  281. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  282. package/dist/simple-tree/api/tree.d.ts +15 -2
  283. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  284. package/dist/simple-tree/api/tree.js.map +1 -1
  285. package/dist/simple-tree/api/typesUnsafe.d.ts +3 -3
  286. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  287. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  288. package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
  289. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  290. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  291. package/dist/simple-tree/core/index.d.ts +1 -1
  292. package/dist/simple-tree/core/index.d.ts.map +1 -1
  293. package/dist/simple-tree/core/index.js +2 -3
  294. package/dist/simple-tree/core/index.js.map +1 -1
  295. package/dist/simple-tree/core/toStored.d.ts +17 -15
  296. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  297. package/dist/simple-tree/core/toStored.js +5 -40
  298. package/dist/simple-tree/core/toStored.js.map +1 -1
  299. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  300. package/dist/simple-tree/core/treeNode.js +1 -0
  301. package/dist/simple-tree/core/treeNode.js.map +1 -1
  302. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  303. package/dist/simple-tree/core/walkSchema.js +4 -0
  304. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  305. package/dist/simple-tree/createContext.d.ts.map +1 -1
  306. package/dist/simple-tree/createContext.js +20 -5
  307. package/dist/simple-tree/createContext.js.map +1 -1
  308. package/dist/simple-tree/fieldSchema.d.ts +3 -3
  309. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  310. package/dist/simple-tree/fieldSchema.js.map +1 -1
  311. package/dist/simple-tree/index.d.ts +6 -5
  312. package/dist/simple-tree/index.d.ts.map +1 -1
  313. package/dist/simple-tree/index.js +16 -11
  314. package/dist/simple-tree/index.js.map +1 -1
  315. package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
  316. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  317. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  318. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  319. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  320. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  321. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  322. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  323. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  324. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  325. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  326. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  327. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  328. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  329. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  330. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  331. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  332. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  333. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  334. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  335. package/dist/simple-tree/simpleSchema.d.ts +55 -23
  336. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  337. package/dist/simple-tree/simpleSchema.js +17 -0
  338. package/dist/simple-tree/simpleSchema.js.map +1 -1
  339. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  340. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  341. package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
  342. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  343. package/dist/simple-tree/toStoredSchema.d.ts +58 -11
  344. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  345. package/dist/simple-tree/toStoredSchema.js +205 -30
  346. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  347. package/dist/simple-tree/treeSchema.d.ts +23 -0
  348. package/dist/simple-tree/treeSchema.d.ts.map +1 -0
  349. package/dist/simple-tree/treeSchema.js +25 -0
  350. package/dist/simple-tree/treeSchema.js.map +1 -0
  351. package/dist/tableSchema.d.ts +107 -64
  352. package/dist/tableSchema.d.ts.map +1 -1
  353. package/dist/tableSchema.js +161 -60
  354. package/dist/tableSchema.js.map +1 -1
  355. package/dist/util/brand.d.ts +49 -0
  356. package/dist/util/brand.d.ts.map +1 -1
  357. package/dist/util/brand.js +47 -1
  358. package/dist/util/brand.js.map +1 -1
  359. package/dist/util/index.d.ts +2 -1
  360. package/dist/util/index.d.ts.map +1 -1
  361. package/dist/util/index.js +6 -2
  362. package/dist/util/index.js.map +1 -1
  363. package/dist/util/readSnapshotBlob.d.ts +13 -0
  364. package/dist/util/readSnapshotBlob.d.ts.map +1 -0
  365. package/dist/util/readSnapshotBlob.js +18 -0
  366. package/dist/util/readSnapshotBlob.js.map +1 -0
  367. package/eslint.config.mts +98 -0
  368. package/lib/alpha.d.ts +6 -2
  369. package/lib/codec/codec.d.ts +41 -13
  370. package/lib/codec/codec.d.ts.map +1 -1
  371. package/lib/codec/codec.js +40 -13
  372. package/lib/codec/codec.js.map +1 -1
  373. package/lib/codec/versioned/codec.d.ts +1 -1
  374. package/lib/codec/versioned/codec.d.ts.map +1 -1
  375. package/lib/codec/versioned/codec.js.map +1 -1
  376. package/lib/codec/versioned/format.d.ts +4 -1
  377. package/lib/codec/versioned/format.d.ts.map +1 -1
  378. package/lib/codec/versioned/format.js +4 -1
  379. package/lib/codec/versioned/format.js.map +1 -1
  380. package/lib/core/index.d.ts +2 -2
  381. package/lib/core/index.d.ts.map +1 -1
  382. package/lib/core/index.js +1 -1
  383. package/lib/core/index.js.map +1 -1
  384. package/lib/core/rebase/index.d.ts +1 -1
  385. package/lib/core/rebase/index.d.ts.map +1 -1
  386. package/lib/core/rebase/index.js.map +1 -1
  387. package/lib/core/rebase/types.d.ts +20 -1
  388. package/lib/core/rebase/types.d.ts.map +1 -1
  389. package/lib/core/rebase/types.js.map +1 -1
  390. package/lib/core/schema-stored/schema.d.ts +4 -7
  391. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  392. package/lib/core/schema-stored/schema.js +3 -3
  393. package/lib/core/schema-stored/schema.js.map +1 -1
  394. package/lib/core/tree/detachedFieldIndex.d.ts +34 -13
  395. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  396. package/lib/core/tree/detachedFieldIndex.js +12 -12
  397. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  398. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
  399. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  400. package/lib/core/tree/detachedFieldIndexFormatCommon.js +3 -3
  401. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  402. package/lib/core/tree/index.d.ts +3 -2
  403. package/lib/core/tree/index.d.ts.map +1 -1
  404. package/lib/core/tree/index.js +2 -1
  405. package/lib/core/tree/index.js.map +1 -1
  406. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  407. package/lib/feature-libraries/chunked-forest/codec/codecs.js +3 -3
  408. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  409. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
  410. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  411. package/lib/feature-libraries/chunked-forest/codec/format.js +5 -5
  412. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  413. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
  414. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  415. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  416. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
  417. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  418. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
  419. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  420. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +23 -27
  421. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  422. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
  423. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  424. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
  425. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  426. package/lib/feature-libraries/forest-summary/codec.d.ts +7 -1
  427. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  428. package/lib/feature-libraries/forest-summary/codec.js +12 -11
  429. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  430. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -13
  431. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  432. package/lib/feature-libraries/forest-summary/forestSummarizer.js +33 -29
  433. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  434. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
  435. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
  436. package/lib/feature-libraries/forest-summary/formatCommon.js +23 -0
  437. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -0
  438. package/lib/feature-libraries/forest-summary/formatV1.d.ts +51 -0
  439. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
  440. package/lib/feature-libraries/forest-summary/formatV1.js +8 -0
  441. package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -0
  442. package/lib/feature-libraries/forest-summary/formatV2.d.ts +51 -0
  443. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
  444. package/lib/feature-libraries/forest-summary/formatV2.js +8 -0
  445. package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -0
  446. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +18 -24
  447. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  448. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +20 -42
  449. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  450. package/lib/feature-libraries/forest-summary/index.d.ts +2 -2
  451. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  452. package/lib/feature-libraries/forest-summary/index.js +2 -2
  453. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  454. package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
  455. package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
  456. package/lib/feature-libraries/forest-summary/summaryFormatCommon.js +40 -0
  457. package/lib/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
  458. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
  459. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
  460. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js +11 -0
  461. package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
  462. package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
  463. package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
  464. package/lib/feature-libraries/forest-summary/summaryFormatV3.js +18 -0
  465. package/lib/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
  466. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +17 -0
  467. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
  468. package/lib/feature-libraries/forest-summary/summaryTypes.js +30 -0
  469. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
  470. package/lib/feature-libraries/index.d.ts +1 -1
  471. package/lib/feature-libraries/index.d.ts.map +1 -1
  472. package/lib/feature-libraries/index.js +1 -1
  473. package/lib/feature-libraries/index.js.map +1 -1
  474. package/lib/feature-libraries/modular-schema/comparison.d.ts +18 -2
  475. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  476. package/lib/feature-libraries/modular-schema/comparison.js +55 -5
  477. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  478. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
  479. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  480. package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
  481. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  482. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  483. package/lib/feature-libraries/modular-schema/genericFieldKind.js +4 -1
  484. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  485. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  486. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  487. package/lib/feature-libraries/modular-schema/index.js +1 -1
  488. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  489. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  490. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
  491. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  492. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  493. package/lib/feature-libraries/schema-index/codec.js +5 -5
  494. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  495. package/lib/feature-libraries/schema-index/formatV1.d.ts +1 -1
  496. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
  497. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
  498. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  499. package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
  500. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  501. package/lib/index.d.ts +2 -2
  502. package/lib/index.d.ts.map +1 -1
  503. package/lib/index.js +1 -1
  504. package/lib/index.js.map +1 -1
  505. package/lib/packageVersion.d.ts +1 -1
  506. package/lib/packageVersion.d.ts.map +1 -1
  507. package/lib/packageVersion.js +1 -1
  508. package/lib/packageVersion.js.map +1 -1
  509. package/lib/shared-tree/independentView.d.ts +1 -1
  510. package/lib/shared-tree/independentView.d.ts.map +1 -1
  511. package/lib/shared-tree/independentView.js +2 -2
  512. package/lib/shared-tree/independentView.js.map +1 -1
  513. package/lib/shared-tree/schematizingTreeView.d.ts +2 -1
  514. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  515. package/lib/shared-tree/schematizingTreeView.js +3 -0
  516. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  517. package/lib/shared-tree/sharedTree.d.ts +2 -2
  518. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  519. package/lib/shared-tree/sharedTree.js +4 -4
  520. package/lib/shared-tree/sharedTree.js.map +1 -1
  521. package/lib/shared-tree/sharedTreeChangeCodecs.js +2 -2
  522. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  523. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
  524. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  525. package/lib/shared-tree/sharedTreeChangeEnricher.js +25 -11
  526. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  527. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  528. package/lib/shared-tree/treeAlpha.js +2 -2
  529. package/lib/shared-tree/treeAlpha.js.map +1 -1
  530. package/lib/shared-tree/treeCheckout.d.ts +10 -5
  531. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  532. package/lib/shared-tree/treeCheckout.js +73 -18
  533. package/lib/shared-tree/treeCheckout.js.map +1 -1
  534. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  535. package/lib/shared-tree-core/editManagerCodecs.js +11 -9
  536. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  537. package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
  538. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
  539. package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
  540. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
  541. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +8 -30
  542. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  543. package/lib/shared-tree-core/editManagerFormatCommons.js +19 -10
  544. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  545. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +1 -1
  546. package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
  547. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
  548. package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
  549. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
  550. package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
  551. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  552. package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
  553. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  554. package/lib/shared-tree-core/index.d.ts +5 -2
  555. package/lib/shared-tree-core/index.d.ts.map +1 -1
  556. package/lib/shared-tree-core/index.js +3 -1
  557. package/lib/shared-tree-core/index.js.map +1 -1
  558. package/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
  559. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
  560. package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
  561. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
  562. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  563. package/lib/shared-tree-core/messageCodecs.js +13 -11
  564. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  565. package/lib/shared-tree-core/messageFormat.d.ts +9 -36
  566. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  567. package/lib/shared-tree-core/messageFormat.js +19 -9
  568. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  569. package/{dist/shared-tree-core/messageFormatV5.d.ts → lib/shared-tree-core/messageFormatVSharedBranches.d.ts} +5 -7
  570. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
  571. package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
  572. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
  573. package/lib/shared-tree-core/sharedTreeCore.d.ts +13 -47
  574. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  575. package/lib/shared-tree-core/sharedTreeCore.js +27 -15
  576. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  577. package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
  578. package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
  579. package/lib/shared-tree-core/summaryTypes.js +43 -0
  580. package/lib/shared-tree-core/summaryTypes.js.map +1 -0
  581. package/lib/shared-tree-core/versionedSummarizer.d.ts +72 -0
  582. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
  583. package/lib/shared-tree-core/versionedSummarizer.js +60 -0
  584. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
  585. package/lib/simple-tree/api/configuration.d.ts +3 -26
  586. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  587. package/lib/simple-tree/api/configuration.js +14 -25
  588. package/lib/simple-tree/api/configuration.js.map +1 -1
  589. package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
  590. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  591. package/lib/simple-tree/api/dirtyIndex.js +7 -0
  592. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  593. package/lib/simple-tree/api/discrepancies.d.ts +1 -1
  594. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  595. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  596. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
  597. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
  598. package/lib/simple-tree/api/eraseSchemaDetails.js +92 -0
  599. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -0
  600. package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
  601. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
  602. package/lib/simple-tree/api/getSimpleSchema.js +9 -3
  603. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  604. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  605. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  606. package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
  607. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  608. package/lib/simple-tree/api/index.d.ts +4 -4
  609. package/lib/simple-tree/api/index.d.ts.map +1 -1
  610. package/lib/simple-tree/api/index.js +3 -3
  611. package/lib/simple-tree/api/index.js.map +1 -1
  612. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  613. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  614. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  615. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
  616. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  617. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  618. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  619. package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
  620. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  621. package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
  622. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  623. package/lib/simple-tree/api/schemaFromSimple.js +5 -0
  624. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  625. package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
  626. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
  627. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  628. package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
  629. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  630. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  631. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  632. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  633. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
  634. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  635. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
  636. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  637. package/lib/simple-tree/api/storedSchema.d.ts +1 -1
  638. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  639. package/lib/simple-tree/api/storedSchema.js +1 -2
  640. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  641. package/lib/simple-tree/api/tree.d.ts +15 -2
  642. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  643. package/lib/simple-tree/api/tree.js.map +1 -1
  644. package/lib/simple-tree/api/typesUnsafe.d.ts +3 -3
  645. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  646. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  647. package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
  648. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  649. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  650. package/lib/simple-tree/core/index.d.ts +1 -1
  651. package/lib/simple-tree/core/index.d.ts.map +1 -1
  652. package/lib/simple-tree/core/index.js +1 -1
  653. package/lib/simple-tree/core/index.js.map +1 -1
  654. package/lib/simple-tree/core/toStored.d.ts +17 -15
  655. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  656. package/lib/simple-tree/core/toStored.js +4 -37
  657. package/lib/simple-tree/core/toStored.js.map +1 -1
  658. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  659. package/lib/simple-tree/core/treeNode.js +1 -0
  660. package/lib/simple-tree/core/treeNode.js.map +1 -1
  661. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  662. package/lib/simple-tree/core/walkSchema.js +5 -1
  663. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  664. package/lib/simple-tree/createContext.d.ts.map +1 -1
  665. package/lib/simple-tree/createContext.js +20 -5
  666. package/lib/simple-tree/createContext.js.map +1 -1
  667. package/lib/simple-tree/fieldSchema.d.ts +3 -3
  668. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  669. package/lib/simple-tree/fieldSchema.js.map +1 -1
  670. package/lib/simple-tree/index.d.ts +6 -5
  671. package/lib/simple-tree/index.d.ts.map +1 -1
  672. package/lib/simple-tree/index.js +5 -4
  673. package/lib/simple-tree/index.js.map +1 -1
  674. package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
  675. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  676. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  677. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  678. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  679. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  680. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  681. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  682. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  683. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  684. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  685. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  686. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
  687. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  688. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  689. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  690. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  691. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
  692. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  693. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  694. package/lib/simple-tree/simpleSchema.d.ts +55 -23
  695. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  696. package/lib/simple-tree/simpleSchema.js +16 -1
  697. package/lib/simple-tree/simpleSchema.js.map +1 -1
  698. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
  699. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
  700. package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
  701. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
  702. package/lib/simple-tree/toStoredSchema.d.ts +58 -11
  703. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  704. package/lib/simple-tree/toStoredSchema.js +204 -31
  705. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  706. package/lib/simple-tree/treeSchema.d.ts +23 -0
  707. package/lib/simple-tree/treeSchema.d.ts.map +1 -0
  708. package/lib/simple-tree/treeSchema.js +21 -0
  709. package/lib/simple-tree/treeSchema.js.map +1 -0
  710. package/lib/tableSchema.d.ts +107 -64
  711. package/lib/tableSchema.d.ts.map +1 -1
  712. package/lib/tableSchema.js +162 -61
  713. package/lib/tableSchema.js.map +1 -1
  714. package/lib/util/brand.d.ts +49 -0
  715. package/lib/util/brand.d.ts.map +1 -1
  716. package/lib/util/brand.js +44 -0
  717. package/lib/util/brand.js.map +1 -1
  718. package/lib/util/index.d.ts +2 -1
  719. package/lib/util/index.d.ts.map +1 -1
  720. package/lib/util/index.js +2 -1
  721. package/lib/util/index.js.map +1 -1
  722. package/lib/util/readSnapshotBlob.d.ts +13 -0
  723. package/lib/util/readSnapshotBlob.d.ts.map +1 -0
  724. package/lib/util/readSnapshotBlob.js +14 -0
  725. package/lib/util/readSnapshotBlob.js.map +1 -0
  726. package/package.json +24 -23
  727. package/src/codec/codec.ts +44 -14
  728. package/src/codec/versioned/codec.ts +1 -1
  729. package/src/codec/versioned/format.ts +4 -1
  730. package/src/core/index.ts +4 -1
  731. package/src/core/rebase/index.ts +1 -0
  732. package/src/core/rebase/types.ts +25 -0
  733. package/src/core/schema-stored/schema.ts +5 -7
  734. package/src/core/tree/detachedFieldIndex.ts +54 -13
  735. package/src/core/tree/detachedFieldIndexFormatCommon.ts +4 -7
  736. package/src/core/tree/index.ts +7 -2
  737. package/src/feature-libraries/chunked-forest/codec/codecs.ts +3 -2
  738. package/src/feature-libraries/chunked-forest/codec/format.ts +6 -9
  739. package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
  740. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
  741. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +22 -33
  742. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
  743. package/src/feature-libraries/forest-summary/codec.ts +22 -10
  744. package/src/feature-libraries/forest-summary/forestSummarizer.ts +77 -44
  745. package/src/feature-libraries/forest-summary/{format.ts → formatCommon.ts} +12 -13
  746. package/src/feature-libraries/forest-summary/formatV1.ts +12 -0
  747. package/src/feature-libraries/forest-summary/formatV2.ts +12 -0
  748. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +37 -56
  749. package/src/feature-libraries/forest-summary/index.ts +2 -2
  750. package/src/feature-libraries/forest-summary/summaryFormatCommon.ts +41 -0
  751. package/src/feature-libraries/forest-summary/summaryFormatV1ToV2.ts +11 -0
  752. package/src/feature-libraries/forest-summary/summaryFormatV3.ts +18 -0
  753. package/src/feature-libraries/forest-summary/summaryTypes.ts +41 -0
  754. package/src/feature-libraries/index.ts +1 -1
  755. package/src/feature-libraries/modular-schema/comparison.ts +64 -5
  756. package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
  757. package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -1
  758. package/src/feature-libraries/modular-schema/index.ts +1 -0
  759. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +2 -3
  760. package/src/feature-libraries/schema-index/codec.ts +7 -9
  761. package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
  762. package/src/index.ts +6 -2
  763. package/src/packageVersion.ts +1 -1
  764. package/src/shared-tree/independentView.ts +2 -3
  765. package/src/shared-tree/schematizingTreeView.ts +5 -0
  766. package/src/shared-tree/sharedTree.ts +20 -9
  767. package/src/shared-tree/sharedTreeChangeCodecs.ts +2 -2
  768. package/src/shared-tree/sharedTreeChangeEnricher.ts +31 -11
  769. package/src/shared-tree/treeAlpha.ts +2 -3
  770. package/src/shared-tree/treeCheckout.ts +103 -20
  771. package/src/shared-tree-core/editManagerCodecs.ts +11 -9
  772. package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
  773. package/src/shared-tree-core/editManagerFormatCommons.ts +22 -16
  774. package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
  775. package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
  776. package/src/shared-tree-core/index.ts +12 -3
  777. package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
  778. package/src/shared-tree-core/messageCodecs.ts +13 -11
  779. package/src/shared-tree-core/messageFormat.ts +23 -16
  780. package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
  781. package/src/shared-tree-core/sharedTreeCore.ts +63 -75
  782. package/src/shared-tree-core/summaryTypes.ts +122 -0
  783. package/src/shared-tree-core/versionedSummarizer.ts +114 -0
  784. package/src/simple-tree/api/configuration.ts +21 -68
  785. package/src/simple-tree/api/dirtyIndex.ts +11 -0
  786. package/src/simple-tree/api/discrepancies.ts +1 -1
  787. package/src/simple-tree/api/eraseSchemaDetails.ts +123 -0
  788. package/src/simple-tree/api/getSimpleSchema.ts +13 -6
  789. package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
  790. package/src/simple-tree/api/index.ts +7 -4
  791. package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
  792. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
  793. package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
  794. package/src/simple-tree/api/schemaFromSimple.ts +11 -5
  795. package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
  796. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  797. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
  798. package/src/simple-tree/api/storedSchema.ts +2 -2
  799. package/src/simple-tree/api/tree.ts +16 -1
  800. package/src/simple-tree/api/typesUnsafe.ts +7 -3
  801. package/src/simple-tree/core/allowedTypes.ts +3 -3
  802. package/src/simple-tree/core/index.ts +2 -2
  803. package/src/simple-tree/core/toStored.ts +22 -55
  804. package/src/simple-tree/core/treeNode.ts +1 -0
  805. package/src/simple-tree/core/walkSchema.ts +6 -0
  806. package/src/simple-tree/createContext.ts +29 -11
  807. package/src/simple-tree/fieldSchema.ts +10 -3
  808. package/src/simple-tree/index.ts +12 -10
  809. package/src/simple-tree/node-kinds/array/arrayNode.ts +5 -2
  810. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
  811. package/src/simple-tree/node-kinds/map/mapNode.ts +5 -2
  812. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
  813. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
  814. package/src/simple-tree/node-kinds/record/recordNode.ts +5 -2
  815. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
  816. package/src/simple-tree/simpleSchema.ts +79 -32
  817. package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
  818. package/src/simple-tree/toStoredSchema.ts +319 -61
  819. package/src/simple-tree/treeSchema.ts +54 -0
  820. package/src/tableSchema.ts +487 -173
  821. package/src/util/brand.ts +61 -0
  822. package/src/util/index.ts +5 -0
  823. package/src/util/readSnapshotBlob.ts +23 -0
  824. package/dist/feature-libraries/forest-summary/format.d.ts +0 -23
  825. package/dist/feature-libraries/forest-summary/format.d.ts.map +0 -1
  826. package/dist/feature-libraries/forest-summary/format.js +0 -24
  827. package/dist/feature-libraries/forest-summary/format.js.map +0 -1
  828. package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  829. package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  830. package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  831. package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
  832. package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  833. package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
  834. package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  835. package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
  836. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  837. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  838. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
  839. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  840. package/lib/feature-libraries/forest-summary/format.d.ts +0 -23
  841. package/lib/feature-libraries/forest-summary/format.d.ts.map +0 -1
  842. package/lib/feature-libraries/forest-summary/format.js +0 -21
  843. package/lib/feature-libraries/forest-summary/format.js.map +0 -1
  844. package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
  845. package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
  846. package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
  847. package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
  848. package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
  849. package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
  850. package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
  851. package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
  852. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
  853. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
  854. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
  855. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
  856. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
@@ -13,7 +13,7 @@ import {
13
13
  type InsertableObjectFromSchemaRecord,
14
14
  type InsertableTreeNodeFromImplicitAllowedTypes,
15
15
  type NodeKind,
16
- type SchemaFactoryBeta,
16
+ SchemaFactoryBeta,
17
17
  type ScopedSchemaName,
18
18
  TreeArrayNode,
19
19
  type TreeNode,
@@ -25,11 +25,17 @@ import {
25
25
  type InsertableTreeFieldFromImplicitField,
26
26
  type InternalTreeNode,
27
27
  SchemaFactory,
28
+ scoped,
28
29
  type ImplicitFieldSchema,
29
30
  withBufferedTreeEvents,
30
31
  type TreeRecordNode,
32
+ objectSchema,
33
+ eraseSchemaDetailsSubclassable,
34
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports -- This makes the API report slightly cleaner.
35
+ TreeNodeSchemaCore,
31
36
  } from "./simple-tree/index.js";
32
37
  import { validateIndex, validateIndexRange } from "./util/index.js";
38
+ import { EmptyKey } from "./core/index.js";
33
39
 
34
40
  // Future improvement TODOs:
35
41
  // - Omit `cells` property from Row insertion type.
@@ -40,9 +46,10 @@ import { validateIndex, validateIndexRange } from "./util/index.js";
40
46
  // - Add constraint APIs to make it possible to avoid situations that could yield "orphaned" cells.
41
47
 
42
48
  /**
43
- * The sub-scope applied to user-provided {@link SchemaFactory}s by table schema factories.
49
+ * Scope for table schema built-in types.
50
+ * @remarks User-provided factory scoping will be applied as `com.fluidframework.table<user-scope>`.
44
51
  */
45
- const tableSchemaFactorySubScope = "table";
52
+ const baseSchemaScope = "com.fluidframework.table";
46
53
 
47
54
  /**
48
55
  * A private symbol put on table schema to help identify them.
@@ -51,16 +58,16 @@ const tableSchemaSymbol: unique symbol = Symbol("tableNode");
51
58
 
52
59
  /**
53
60
  * A row in a table.
54
- * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
55
- * @typeParam TProps - Additional properties to associate with the row.
61
+ * @typeParam TCellSchema - The type of the cells in the {@link TableSchema.Table}.
62
+ * @typeParam TPropsSchema - Additional properties to associate with the row.
56
63
  * @privateRemarks Private counterpart to the {@link TableSchema.Row}.
57
64
  * Exposes internal properties needed for table operations (publicly exposed via {@link TableSchema.Table}).
58
65
  * @sealed
59
66
  */
60
67
  export interface RowPrivate<
61
- TCell extends ImplicitAllowedTypes,
62
- TProps extends ImplicitFieldSchema = ImplicitFieldSchema,
63
- > extends TableSchema.Row<TCell, TProps> {
68
+ TCellSchema extends ImplicitAllowedTypes,
69
+ TPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,
70
+ > extends TableSchema.Row<TCellSchema, TPropsSchema> {
64
71
  /**
65
72
  * The row's cells.
66
73
  * @remarks This is a user-defined schema that can be used to store additional information about the row.
@@ -68,7 +75,7 @@ export interface RowPrivate<
68
75
  * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createRowSchema}.
69
76
  * If you update the docs here, please also update the inline type definitions.
70
77
  */
71
- readonly cells: TreeRecordNode<TCell>;
78
+ readonly cells: TreeRecordNode<TCellSchema>;
72
79
  }
73
80
 
74
81
  /**
@@ -82,6 +89,36 @@ export interface RowPrivate<
82
89
  * @system @alpha
83
90
  */
84
91
  export namespace System_TableSchema {
92
+ /**
93
+ * A list of items in a table whose elements may be rearranged, but not inserted or removed.
94
+ *
95
+ * @privateRemarks Used by {@link TableSchema.Table} for its `rows` and `columns` properties to allow basic rearrangement operations on the underlying sequences without permitting mutation operations that might violate table invariants.
96
+ *
97
+ * Note: this can't reasonably be implemented via `Pick<ArrayNode<...>>` because we only want to include the
98
+ * subset of its method overloads which do not support moving items between lists.
99
+ *
100
+ * @alpha @system
101
+ */
102
+ export type RearrangeableList<TItemSchema extends ImplicitAllowedTypes> = TreeNode &
103
+ readonly TreeNodeFromImplicitAllowedTypes<TItemSchema>[] & {
104
+ // #region Capture the subset of item rearrangement methods from `TreeArrayNode` that do not allow moving between lists.
105
+
106
+ /** {@inheritDoc (TreeArrayNode:interface).(moveToEnd:1)} */
107
+ moveToEnd(sourceIndex: number): void;
108
+ /** {@inheritDoc (TreeArrayNode:interface).(moveToStart:1)} */
109
+ moveToStart(sourceIndex: number): void;
110
+ /** {@inheritDoc (TreeArrayNode:interface).(moveToIndex:1)} */
111
+ moveToIndex(sourceIndex: number, destinationIndex: number): void;
112
+ /** {@inheritDoc (TreeArrayNode:interface).(moveRangeToEnd:1)} */
113
+ moveRangeToEnd(startIndex: number, endIndex: number): void;
114
+ /** {@inheritDoc (TreeArrayNode:interface).(moveRangeToStart:1)} */
115
+ moveRangeToStart(startIndex: number, endIndex: number): void;
116
+ /** {@inheritDoc (TreeArrayNode:interface).(moveRangeToIndex:1)} */
117
+ moveRangeToIndex(startIndex: number, endIndex: number, destinationIndex: number): void;
118
+
119
+ // #endregion
120
+ };
121
+
85
122
  /**
86
123
  * Default type used for column and row "props" fields.
87
124
  * @privateRemarks
@@ -102,6 +139,7 @@ export namespace System_TableSchema {
102
139
  /**
103
140
  * Schema factory with which the Column schema will be associated.
104
141
  * @remarks Can be used to associate the resulting schema with an existing {@link SchemaFactory.scope|scope}.
142
+ * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.<Column|Row|Table>`.
105
143
  */
106
144
  readonly schemaFactory: TSchemaFactory;
107
145
  }
@@ -122,14 +160,15 @@ export namespace System_TableSchema {
122
160
  // #region Column
123
161
 
124
162
  /**
125
- * Base options for creating table cow schema.
163
+ * Base options for creating table column schema.
126
164
  * @remarks Includes parameters common to all column factory overloads.
127
165
  * @system @alpha
128
166
  */
129
167
  export type CreateColumnOptionsBase<
130
- TSchemaFactory extends SchemaFactoryBeta = SchemaFactoryBeta,
131
- TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,
132
- > = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;
168
+ TUserScope extends string = string,
169
+ TSchemaFactory extends SchemaFactoryBeta<TUserScope> = SchemaFactoryBeta<TUserScope>,
170
+ TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,
171
+ > = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCellSchema>;
133
172
 
134
173
  /**
135
174
  * Factory for creating column schema.
@@ -137,12 +176,12 @@ export namespace System_TableSchema {
137
176
  */
138
177
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
139
178
  export function createColumnSchema<
140
- const TInputScope extends string | undefined,
179
+ const TUserScope extends string,
141
180
  const TCellSchema extends ImplicitAllowedTypes,
142
181
  const TPropsSchema extends ImplicitFieldSchema,
143
- >(inputSchemaFactory: SchemaFactoryBeta<TInputScope>, propsSchema: TPropsSchema) {
144
- const schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);
145
- type Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;
182
+ >(inputSchemaFactory: SchemaFactoryBeta<TUserScope>, propsSchema: TPropsSchema) {
183
+ const schemaFactory = createTableScopedFactory(inputSchemaFactory);
184
+ type Scope = typeof schemaFactory.scope;
146
185
 
147
186
  // Note: `columnFields` is broken into two parts to work around a TypeScript bug
148
187
  // that results in broken `.d.ts` output.
@@ -252,10 +291,10 @@ export namespace System_TableSchema {
252
291
  * @sealed @system @alpha
253
292
  */
254
293
  export type ColumnSchemaBase<
255
- TScope extends string | undefined = string | undefined,
294
+ TUserScope extends string = string,
256
295
  TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,
257
296
  TPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,
258
- > = ReturnType<typeof createColumnSchema<TScope, TCellSchema, TPropsSchema>>;
297
+ > = ReturnType<typeof createColumnSchema<TUserScope, TCellSchema, TPropsSchema>>;
259
298
 
260
299
  // #endregion
261
300
 
@@ -267,9 +306,10 @@ export namespace System_TableSchema {
267
306
  * @system @alpha
268
307
  */
269
308
  export type CreateRowOptionsBase<
270
- TSchemaFactory extends SchemaFactoryBeta = SchemaFactoryBeta,
271
- TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,
272
- > = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;
309
+ TUserScope extends string = string,
310
+ TSchemaFactory extends SchemaFactoryBeta<TUserScope> = SchemaFactoryBeta<TUserScope>,
311
+ TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,
312
+ > = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCellSchema>;
273
313
 
274
314
  /**
275
315
  * Factory for creating row schema.
@@ -277,16 +317,16 @@ export namespace System_TableSchema {
277
317
  */
278
318
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
279
319
  export function createRowSchema<
280
- const TInputScope extends string | undefined,
320
+ const TUserScope extends string,
281
321
  const TCellSchema extends ImplicitAllowedTypes,
282
322
  const TPropsSchema extends ImplicitFieldSchema,
283
323
  >(
284
- inputSchemaFactory: SchemaFactoryBeta<TInputScope>,
324
+ inputSchemaFactory: SchemaFactoryBeta<TUserScope>,
285
325
  cellSchema: TCellSchema,
286
326
  propsSchema: TPropsSchema,
287
327
  ) {
288
- const schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);
289
- type Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;
328
+ const schemaFactory = createTableScopedFactory(inputSchemaFactory);
329
+ type Scope = typeof schemaFactory.scope;
290
330
 
291
331
  // Note: `rowFields` is broken into two parts to work around a TypeScript bug
292
332
  // that results in broken `.d.ts` output.
@@ -404,10 +444,10 @@ export namespace System_TableSchema {
404
444
  * @sealed @system @alpha
405
445
  */
406
446
  export type RowSchemaBase<
407
- TScope extends string | undefined = string | undefined,
447
+ TUserScope extends string = string,
408
448
  TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,
409
449
  TPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,
410
- > = ReturnType<typeof createRowSchema<TScope, TCellSchema, TPropsSchema>>;
450
+ > = ReturnType<typeof createRowSchema<TUserScope, TCellSchema, TPropsSchema>>;
411
451
 
412
452
  // #endregion
413
453
 
@@ -419,9 +459,10 @@ export namespace System_TableSchema {
419
459
  * @system @alpha
420
460
  */
421
461
  export type TableFactoryOptionsBase<
422
- TSchemaFactory extends SchemaFactoryBeta = SchemaFactoryBeta,
423
- TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,
424
- > = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;
462
+ TUserScope extends string = string,
463
+ TSchemaFactory extends SchemaFactoryBeta<TUserScope> = SchemaFactoryBeta<TUserScope>,
464
+ TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,
465
+ > = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCellSchema>;
425
466
 
426
467
  /**
427
468
  * Factory for creating table schema.
@@ -429,50 +470,134 @@ export namespace System_TableSchema {
429
470
  */
430
471
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
431
472
  export function createTableSchema<
432
- const TInputScope extends string | undefined,
473
+ const TUserScope extends string,
433
474
  const TCellSchema extends ImplicitAllowedTypes,
434
- const TColumnSchema extends ColumnSchemaBase<TInputScope, TCellSchema>,
435
- const TRowSchema extends RowSchemaBase<TInputScope, TCellSchema>,
475
+ const TColumnSchema extends ColumnSchemaBase<TUserScope, TCellSchema>,
476
+ const TRowSchema extends RowSchemaBase<TUserScope, TCellSchema>,
436
477
  >(
437
- inputSchemaFactory: SchemaFactoryBeta<TInputScope>,
478
+ inputSchemaFactory: SchemaFactoryBeta<TUserScope>,
438
479
  _cellSchema: TCellSchema,
439
480
  columnSchema: TColumnSchema,
440
481
  rowSchema: TRowSchema,
441
482
  ) {
442
- const schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);
443
- type Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;
483
+ const schemaFactory = createTableScopedFactory(inputSchemaFactory);
484
+ type Scope = typeof schemaFactory.scope;
444
485
 
445
486
  type CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;
446
487
  type ColumnValueType = TreeNodeFromImplicitAllowedTypes<TColumnSchema>;
488
+ type ColumnInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>;
447
489
  type RowValueType = TreeNodeFromImplicitAllowedTypes<TRowSchema>;
490
+ type RowInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>;
448
491
 
449
492
  // Internal version of RowValueType that exposes the `cells` property for use within Table methods.
450
493
  type RowValueInternalType = RowValueType & RowPrivate<TCellSchema>;
451
494
 
495
+ /**
496
+ * {@link Table} inner fields.
497
+ * @remarks Extracted for re-use as construction parameters.
498
+ * @see {@link Table.create}.
499
+ */
500
+ const tableInnerFields = {
501
+ rows: schemaFactory.array("Table.rows", rowSchema),
502
+ columns: schemaFactory.array("Table.columns", columnSchema),
503
+ } as const satisfies Record<string, ImplicitFieldSchema>;
504
+
452
505
  /**
453
506
  * {@link Table} fields.
454
507
  * @remarks Extracted for re-use in returned type signature defined later in this function.
455
508
  * The implicit typing is intentional.
456
509
  */
457
510
  const tableFields = {
458
- rows: schemaFactory.array("Table.rows", rowSchema),
459
- columns: schemaFactory.array("Table.columns", columnSchema),
511
+ table: schemaFactory.required(schemaFactory.object("Table", tableInnerFields), {
512
+ // Use an empty key in the stored schema format to help prevent schema-unaware edits from being
513
+ // made to the table, which may violate intended invariants.
514
+ key: EmptyKey,
515
+ }),
460
516
  } as const satisfies Record<string, ImplicitFieldSchema>;
461
517
 
518
+ type TableValueType = TreeNode &
519
+ TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema> &
520
+ WithType<ScopedSchemaName<Scope, "TableRoot">>;
521
+ type TableConstructorType = new (data?: InternalTreeNode | undefined) => TableValueType;
522
+
462
523
  /**
463
524
  * The Table schema
464
525
  */
465
526
  class Table
466
- extends schemaFactory.object("Table", tableFields, {
467
- // Will make it easier to evolve this schema in the future.
468
- allowUnknownOptionalFields: true,
469
- })
470
- implements TableSchema.Table<TInputScope, TCellSchema, TColumnSchema, TRowSchema>
527
+ // Calling the objectSchema factory directly rather than using the schemaFactory so we can specify
528
+ // `implicitlyConstructable: false`, which the SchemaFactory APIs do not yet support.
529
+ // TODO: when support for configuring `implicitlyConstructable` is added to SchemaFactory, switch to
530
+ // using that instead.
531
+ extends objectSchema(
532
+ /* identifier: */ scoped(schemaFactory as SchemaFactory<Scope>, "TableRoot"),
533
+ /* info: */ tableFields,
534
+ /* implicitlyConstructable: */ false,
535
+ /* nodeOptions: */ {
536
+ // Will make it easier to evolve this schema in the future.
537
+ allowUnknownOptionalFields: true,
538
+ },
539
+ )
540
+ implements TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema>
471
541
  {
472
- public static empty<TThis extends TableConstructorType>(
542
+ public constructor(node?: InternalTreeNode | undefined) {
543
+ super(node ?? { table: { columns: [], rows: [] } });
544
+ }
545
+
546
+ public static create<TThis extends TableConstructorType>(
473
547
  this: TThis,
548
+ initialContents?:
549
+ | TableSchema.TableFactoryMethodParameters<
550
+ TUserScope,
551
+ TCellSchema,
552
+ TColumnSchema,
553
+ TRowSchema
554
+ >
555
+ | undefined,
474
556
  ): InstanceType<TThis> {
475
- return new this({ columns: [], rows: [] }) as InstanceType<TThis>;
557
+ // #region Input validation
558
+
559
+ const columns =
560
+ (initialContents?.columns as Iterable<ColumnInsertableType> | undefined) ?? [];
561
+
562
+ const columnIds = new Set<string>();
563
+ for (const column of columns) {
564
+ columnIds.add((column as ColumnValueType).id);
565
+ }
566
+
567
+ const rows = (initialContents?.rows as Iterable<RowInsertableType> | undefined) ?? [];
568
+
569
+ Table._validateNewColumns(
570
+ columns,
571
+ // New table, so no existing columns to validate against
572
+ new Set(),
573
+ );
574
+
575
+ Table._validateNewRows(
576
+ rows,
577
+ // New table, so no existing rows to validate against
578
+ new Set(),
579
+ // No existing columns to validate cells against, but we do need to validate the new rows against the new columns
580
+ columnIds,
581
+ );
582
+
583
+ // #endregion
584
+ return new this(
585
+ initialContents === undefined
586
+ ? undefined
587
+ : ({
588
+ table: initialContents,
589
+ // We have typed our constructor to prevent users from calling it directly with insertable contents.
590
+ // But the base constructor still allows it. Cast to work around this.
591
+ } as unknown as InternalTreeNode),
592
+ ) as InstanceType<TThis>;
593
+ }
594
+
595
+ public get columns(): RearrangeableList<TColumnSchema> {
596
+ return this.table.columns as RearrangeableList<TColumnSchema>;
597
+ }
598
+
599
+ public get rows(): RearrangeableList<TRowSchema> {
600
+ return this.table.rows as RearrangeableList<TRowSchema>;
476
601
  }
477
602
 
478
603
  public getColumn(indexOrId: number | string): ColumnValueType | undefined {
@@ -504,17 +629,26 @@ export namespace System_TableSchema {
504
629
  columns,
505
630
  index,
506
631
  }: TableSchema.InsertColumnsParameters<TColumnSchema>): ColumnValueType[] {
632
+ // #region Input validation
633
+
634
+ // Ensure specified index is valid
635
+ if (index !== undefined) {
636
+ validateIndex(index, this.table.columns, "Table.insertColumns", true);
637
+ }
638
+
639
+ // Ensure the new columns being inserted are valid
640
+ this.#validateNewColumns(columns);
641
+
642
+ // #endregion
643
+
507
644
  // TypeScript is unable to narrow the column type correctly here, hence the casts below.
508
645
  // See: https://github.com/microsoft/TypeScript/issues/52144
509
646
  if (index === undefined) {
510
647
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
511
- this.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);
648
+ this.table.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);
512
649
  } else {
513
- // Ensure specified index is valid
514
- validateIndex(index, this.columns, "Table.insertColumns", true);
515
-
516
650
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
517
- this.columns.insertAt(index, TreeArrayNode.spread(columns) as any);
651
+ this.table.columns.insertAt(index, TreeArrayNode.spread(columns) as any);
518
652
  }
519
653
 
520
654
  // Inserting the input nodes into the tree hydrates them, making them usable as nodes.
@@ -529,27 +663,11 @@ export namespace System_TableSchema {
529
663
 
530
664
  // Ensure specified index is valid
531
665
  if (index !== undefined) {
532
- validateIndex(index, this.rows, "Table.insertRows", true);
666
+ validateIndex(index, this.table.rows, "Table.insertRows", true);
533
667
  }
534
668
 
535
- // Note: TypeScript is unable to narrow the type of the row type correctly here, hence the casts below.
536
- // See: https://github.com/microsoft/TypeScript/issues/52144
537
- for (const newRow of rows) {
538
- // If the row contains cells, verify that the table contains the columns for those cells.
539
- // Note: we intentionally hide `cells` on `IRow` to avoid leaking the internal data representation as much as possible, so we have to cast here.
540
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
541
- if ((newRow as any).cells !== undefined) {
542
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
543
- const keys: string[] = Object.keys((newRow as any).cells);
544
- for (const key of keys) {
545
- if (!this.#containsColumnWithId(key)) {
546
- throw new UsageError(
547
- `Attempted to insert row a cell under column ID "${key}", but the table does not contain a column with that ID.`,
548
- );
549
- }
550
- }
551
- }
552
- }
669
+ // Ensure the new rows being inserted are valid
670
+ this.#validateNewRows(rows);
553
671
 
554
672
  // #endregion
555
673
 
@@ -557,10 +675,10 @@ export namespace System_TableSchema {
557
675
  // See: https://github.com/microsoft/TypeScript/issues/52144
558
676
  if (index === undefined) {
559
677
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
560
- this.rows.insertAtEnd(TreeArrayNode.spread(rows) as any);
678
+ this.table.rows.insertAtEnd(TreeArrayNode.spread(rows) as any);
561
679
  } else {
562
680
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
563
- this.rows.insertAt(index, TreeArrayNode.spread(rows) as any);
681
+ this.table.rows.insertAt(index, TreeArrayNode.spread(rows) as any);
564
682
  }
565
683
 
566
684
  // Inserting the input nodes into the tree hydrates them, making them usable as nodes.
@@ -586,17 +704,18 @@ export namespace System_TableSchema {
586
704
  if (typeof indexOrColumns === "number" || indexOrColumns === undefined) {
587
705
  let removedColumns: ColumnValueType[] | undefined;
588
706
  const startIndex = indexOrColumns ?? 0;
589
- const endIndex = count === undefined ? this.columns.length : startIndex + count;
707
+ const endIndex =
708
+ count === undefined ? this.table.columns.length : startIndex + count;
590
709
 
591
710
  // If there are no columns to remove, do nothing
592
711
  if (startIndex === endIndex) {
593
712
  return [];
594
713
  }
595
714
 
596
- validateIndexRange(startIndex, endIndex, this.columns, "Table.removeColumns");
715
+ validateIndexRange(startIndex, endIndex, this.table.columns, "Table.removeColumns");
597
716
 
598
717
  this.#applyEditsInBatch(() => {
599
- const columnsToRemove = this.columns.slice(
718
+ const columnsToRemove = this.table.columns.slice(
600
719
  startIndex,
601
720
  endIndex,
602
721
  ) as ColumnValueType[];
@@ -607,7 +726,12 @@ export namespace System_TableSchema {
607
726
  }
608
727
 
609
728
  // Second, remove the column nodes:
610
- removeRangeFromArray(startIndex, endIndex, this.columns, "Table.removeColumns");
729
+ removeRangeFromArray(
730
+ startIndex,
731
+ endIndex,
732
+ this.table.columns,
733
+ "Table.removeColumns",
734
+ );
611
735
  removedColumns = columnsToRemove;
612
736
  });
613
737
  return removedColumns ?? fail(0xc1f /* Transaction did not complete. */);
@@ -630,7 +754,7 @@ export namespace System_TableSchema {
630
754
  // So if we throw an error here for any column, no columns will be removed.
631
755
  for (const columnToRemove of columnsToRemove) {
632
756
  // Remove the corresponding cell from all rows.
633
- for (const row of this.rows) {
757
+ for (const row of this.table.rows) {
634
758
  // TypeScript is unable to narrow the row type correctly here, hence the cast.
635
759
  // See: https://github.com/microsoft/TypeScript/issues/52144
636
760
  this.removeCell({
@@ -640,7 +764,7 @@ export namespace System_TableSchema {
640
764
  }
641
765
 
642
766
  // We have already validated that all of the columns exist above, so this is safe.
643
- this.columns.removeAt(this.columns.indexOf(columnToRemove));
767
+ this.table.columns.removeAt(this.table.columns.indexOf(columnToRemove));
644
768
  }
645
769
  });
646
770
  return columnsToRemove;
@@ -653,14 +777,19 @@ export namespace System_TableSchema {
653
777
  ): RowValueType[] {
654
778
  if (typeof indexOrRows === "number" || indexOrRows === undefined) {
655
779
  const startIndex = indexOrRows ?? 0;
656
- const endIndex = count === undefined ? this.columns.length : startIndex + count;
780
+ const endIndex = count === undefined ? this.table.rows.length : startIndex + count;
657
781
 
658
782
  // If there are no rows to remove, do nothing
659
783
  if (startIndex === endIndex) {
660
784
  return [];
661
785
  }
662
786
 
663
- return removeRangeFromArray(startIndex, endIndex, this.rows, "Table.removeRows");
787
+ return removeRangeFromArray(
788
+ startIndex,
789
+ endIndex,
790
+ this.table.rows,
791
+ "Table.removeRows",
792
+ );
664
793
  }
665
794
 
666
795
  // If there are no rows to remove, do nothing
@@ -681,8 +810,8 @@ export namespace System_TableSchema {
681
810
  // So if we throw an error here for any row, no rows will be removed.
682
811
  for (const rowToRemove of rowsToRemove) {
683
812
  // We have already validated that all of the rows exist above, so this is safe.
684
- const index = this.rows.indexOf(rowToRemove);
685
- this.rows.removeAt(index);
813
+ const index = this.table.rows.indexOf(rowToRemove);
814
+ this.table.rows.removeAt(index);
686
815
  }
687
816
  });
688
817
  return rowsToRemove;
@@ -709,7 +838,7 @@ export namespace System_TableSchema {
709
838
  * Removes the cell corresponding with the specified column from each row in the table.
710
839
  */
711
840
  #removeCells(column: ColumnValueType): void {
712
- for (const row of this.rows) {
841
+ for (const row of this.table.rows) {
713
842
  // TypeScript is unable to narrow the row type correctly here, hence the cast.
714
843
  // See: https://github.com/microsoft/TypeScript/issues/52144
715
844
  this.removeCell({
@@ -757,25 +886,25 @@ export namespace System_TableSchema {
757
886
  columnOrIdOrIndex: ColumnValueType | string | number,
758
887
  ): ColumnValueType | undefined {
759
888
  if (typeof columnOrIdOrIndex === "number") {
760
- if (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.columns.length) {
889
+ if (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.table.columns.length) {
761
890
  return undefined;
762
891
  }
763
892
  // TypeScript is unable to narrow the types correctly here, hence the cast.
764
893
  // See: https://github.com/microsoft/TypeScript/issues/52144
765
- return this.columns[columnOrIdOrIndex] as ColumnValueType;
894
+ return this.table.columns[columnOrIdOrIndex] as ColumnValueType;
766
895
  }
767
896
 
768
897
  if (typeof columnOrIdOrIndex === "string") {
769
898
  const columnId = columnOrIdOrIndex;
770
899
  // TypeScript is unable to narrow the types correctly here, hence the casts.
771
900
  // See: https://github.com/microsoft/TypeScript/issues/52144
772
- return this.columns.find((col) => (col as ColumnValueType).id === columnId) as
901
+ return this.table.columns.find((col) => (col as ColumnValueType).id === columnId) as
773
902
  | ColumnValueType
774
903
  | undefined;
775
904
  }
776
905
 
777
906
  // If the user provided a node, ensure it actually exists in this table.
778
- if (!this.columns.includes(columnOrIdOrIndex)) {
907
+ if (!this.table.columns.includes(columnOrIdOrIndex)) {
779
908
  return undefined;
780
909
  }
781
910
 
@@ -795,13 +924,6 @@ export namespace System_TableSchema {
795
924
  return column;
796
925
  }
797
926
 
798
- /**
799
- * Checks if a Column with the specified ID exists in the table.
800
- */
801
- #containsColumnWithId(columnId: string): boolean {
802
- return this.#tryGetColumn(columnId) !== undefined;
803
- }
804
-
805
927
  /**
806
928
  * Throw a `UsageError` for a missing Column by its ID or index.
807
929
  */
@@ -830,25 +952,25 @@ export namespace System_TableSchema {
830
952
  */
831
953
  #tryGetRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType | undefined {
832
954
  if (typeof rowOrIdOrIndex === "number") {
833
- if (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.rows.length) {
955
+ if (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.table.rows.length) {
834
956
  return undefined;
835
957
  }
836
958
  // TypeScript is unable to narrow the types correctly here, hence the cast.
837
959
  // See: https://github.com/microsoft/TypeScript/issues/52144
838
- return this.rows[rowOrIdOrIndex] as RowValueType;
960
+ return this.table.rows[rowOrIdOrIndex] as RowValueType;
839
961
  }
840
962
 
841
963
  if (typeof rowOrIdOrIndex === "string") {
842
964
  const rowId = rowOrIdOrIndex;
843
965
  // TypeScript is unable to narrow the types correctly here, hence the casts.
844
966
  // See: https://github.com/microsoft/TypeScript/issues/52144
845
- return this.rows.find((row) => (row as RowValueType).id === rowId) as
967
+ return this.table.rows.find((row) => (row as RowValueType).id === rowId) as
846
968
  | RowValueType
847
969
  | undefined;
848
970
  }
849
971
 
850
972
  // If the user provided a node, ensure it actually exists in this table.
851
- if (!this.rows.includes(rowOrIdOrIndex)) {
973
+ if (!this.table.rows.includes(rowOrIdOrIndex)) {
852
974
  return undefined;
853
975
  }
854
976
 
@@ -868,6 +990,109 @@ export namespace System_TableSchema {
868
990
  return row;
869
991
  }
870
992
 
993
+ /**
994
+ * Validates the provided list of new columns being inserted into the table.
995
+ * @throws Throws a `UsageError` if any of the following conditions are met:
996
+ * - A column with a duplicate ID is being inserted.
997
+ */
998
+ #validateNewColumns(newColumns: readonly ColumnInsertableType[]): void {
999
+ return Table._validateNewColumns(
1000
+ newColumns,
1001
+ new Set(this.table.columns.map((column) => (column as ColumnValueType).id)),
1002
+ );
1003
+ }
1004
+
1005
+ /**
1006
+ * Validates the provided list of new rows being inserted into the table.
1007
+ * @throws Throws a `UsageError` if any of the following conditions are met:
1008
+ * - A row with a duplicate ID is being inserted.
1009
+ * - A row is being inserted that contains cells for columns that do not exist in the table.
1010
+ */
1011
+ #validateNewRows(newRows: readonly RowInsertableType[]): void {
1012
+ return Table._validateNewRows(
1013
+ newRows,
1014
+ new Set(this.table.rows.map((row) => (row as RowValueType).id)),
1015
+ new Set(this.table.columns.map((column) => (column as ColumnValueType).id)),
1016
+ );
1017
+ }
1018
+
1019
+ /**
1020
+ * Validates the provided list of new columns being inserted into the table.
1021
+ * @throws Throws a `UsageError` if any of the following conditions are met:
1022
+ * - A column with a duplicate ID is being inserted.
1023
+ */
1024
+ private static _validateNewColumns(
1025
+ newColumns: Iterable<ColumnInsertableType>,
1026
+ existingColumnIds: Set<string>,
1027
+ ): void {
1028
+ const newColumnIds = new Set<string>();
1029
+ for (const newColumn of newColumns) {
1030
+ // #region Ensure each column ID is unique
1031
+ const newColumnId = (newColumn as ColumnValueType).id;
1032
+ if (existingColumnIds.has(newColumnId)) {
1033
+ throw new UsageError(
1034
+ `Attempted to insert a column with ID "${newColumnId}", but a column with that ID already exists in the table.`,
1035
+ );
1036
+ }
1037
+ if (newColumnIds.has(newColumnId)) {
1038
+ throw new UsageError(
1039
+ `Attempted to insert multiple columns with ID "${newColumnId}". Column IDs must be unique.`,
1040
+ );
1041
+ }
1042
+ newColumnIds.add(newColumnId);
1043
+ }
1044
+ }
1045
+
1046
+ /**
1047
+ * Validates the provided list of new rows being inserted into the table.
1048
+ * @throws Throws a `UsageError` if any of the following conditions are met:
1049
+ * - A row with a duplicate ID is being inserted.
1050
+ * - A row is being inserted that contains cells for columns that do not exist in the table.
1051
+ */
1052
+ private static _validateNewRows(
1053
+ newRows: Iterable<RowInsertableType>,
1054
+ existingRowIds: Set<string>,
1055
+ columnIds: Set<string>,
1056
+ ): void {
1057
+ const newRowIds = new Set<string>();
1058
+ for (const newRow of newRows) {
1059
+ // #region Ensure each row ID is unique
1060
+
1061
+ const newRowId = (newRow as RowValueType).id;
1062
+ if (existingRowIds.has(newRowId)) {
1063
+ throw new UsageError(
1064
+ `Attempted to insert a row with ID "${newRowId}", but a row with that ID already exists in the table.`,
1065
+ );
1066
+ }
1067
+ if (newRowIds.has(newRowId)) {
1068
+ throw new UsageError(
1069
+ `Attempted to insert multiple rows with ID "${newRowId}". Row IDs must be unique.`,
1070
+ );
1071
+ }
1072
+ newRowIds.add(newRowId);
1073
+
1074
+ // #endregion
1075
+
1076
+ // #region If the row contains cells, verify that the table contains the columns for those cells
1077
+
1078
+ // Note: we intentionally hide `cells` on `IRow` to avoid leaking the internal data representation as much as possible, so we have to cast here.
1079
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1080
+ if ((newRow as any).cells !== undefined) {
1081
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1082
+ const keys: string[] = Object.keys((newRow as any).cells);
1083
+ for (const key of keys) {
1084
+ if (!columnIds.has(key)) {
1085
+ throw new UsageError(
1086
+ `Attempted to insert a row containing a cell under column ID "${key}", but the table does not contain a column with that ID.`,
1087
+ );
1088
+ }
1089
+ }
1090
+ }
1091
+
1092
+ // #endregion
1093
+ }
1094
+ }
1095
+
871
1096
  /**
872
1097
  * Throw a `UsageError` for a missing Row by its ID or index.
873
1098
  */
@@ -895,30 +1120,35 @@ export namespace System_TableSchema {
895
1120
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
896
1121
  (Table as any)[tableSchemaSymbol] = true;
897
1122
 
898
- type TableValueType = TreeNode &
899
- TableSchema.Table<TInputScope, TCellSchema, TColumnSchema, TRowSchema> &
900
- WithType<ScopedSchemaName<Scope, "Table">>;
901
- type TableInsertableType = InsertableObjectFromSchemaRecord<typeof tableFields>;
902
- type TableConstructorType = new (data: TableInsertableType) => TableValueType;
1123
+ // Named interfaces here do not compile.
1124
+ type Statics = {
1125
+ /**
1126
+ * Create a table with initial contents.
1127
+ * @param initialContents - The initial contents of the table.
1128
+ * If not provided, an empty table will be constructed.
1129
+ * @remarks Performs the following input validation:
1130
+ * - Ensures that any cells specified in the initial rows correspond to existing columns in the initial columns.
1131
+ * - Ensures that all column and row IDs are unique.
1132
+ */
1133
+ create<TThis extends TableConstructorType>(
1134
+ this: TThis,
1135
+ initialContents?:
1136
+ | TableSchema.TableFactoryMethodParameters<
1137
+ TUserScope,
1138
+ TCellSchema,
1139
+ TColumnSchema,
1140
+ TRowSchema
1141
+ >
1142
+ | undefined,
1143
+ ): InstanceType<TThis>;
1144
+ } & TableConstructorType;
903
1145
 
904
1146
  // Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly "__#124291@#brand": unknown;`
905
1147
  // for the private brand field of TreeNode.
906
1148
  // This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.
907
1149
  // This is avoided by doing this type conversion.
908
- // The conversion is done via assignment instead of `as` to get stronger type safety.
909
- const TableSchemaType: TreeNodeSchemaClass<
910
- /* Name */ ScopedSchemaName<Scope, "Table">,
911
- /* Kind */ NodeKind.Object,
912
- /* TNode */ TableValueType,
913
- /* TInsertable */ object & TableInsertableType,
914
- /* ImplicitlyConstructable */ true,
915
- /* Info */ typeof tableFields
916
- > & {
917
- /**
918
- * Create an empty table.
919
- */
920
- empty<TThis extends TableConstructorType>(this: TThis): InstanceType<TThis>;
921
- } = Table;
1150
+ // The conversion is done via eraseSubclassableSchemaDetails to erase internal details.
1151
+ const TableSchemaType = eraseSchemaDetailsSubclassable<TableValueType, Statics>()(Table);
922
1152
 
923
1153
  // Return the table schema
924
1154
  return TableSchemaType;
@@ -929,15 +1159,21 @@ export namespace System_TableSchema {
929
1159
  * @sealed @system @alpha
930
1160
  */
931
1161
  export type TableSchemaBase<
932
- TScope extends string | undefined,
933
- TCell extends ImplicitAllowedTypes,
934
- TColumn extends ColumnSchemaBase<TScope, TCell>,
935
- TRow extends RowSchemaBase<TScope, TCell>,
936
- > = ReturnType<typeof createTableSchema<TScope, TCell, TColumn, TRow>>;
1162
+ TUserScope extends string,
1163
+ TCellSchema extends ImplicitAllowedTypes,
1164
+ TColumnSchema extends ColumnSchemaBase<TUserScope, TCellSchema>,
1165
+ TRowSchema extends RowSchemaBase<TUserScope, TCellSchema>,
1166
+ > = ReturnType<typeof createTableSchema<TUserScope, TCellSchema, TColumnSchema, TRowSchema>>;
937
1167
 
938
1168
  // #endregion
939
1169
  }
940
1170
 
1171
+ function createTableScopedFactory<TUserScope extends string>(
1172
+ inputSchemaFactory: SchemaFactoryBeta<TUserScope>,
1173
+ ): SchemaFactoryBeta<`${typeof baseSchemaScope}<${TUserScope}>`> {
1174
+ return new SchemaFactoryBeta(`${baseSchemaScope}<${inputSchemaFactory.scope}>`);
1175
+ }
1176
+
941
1177
  /**
942
1178
  * Removes the specified range of elements from the array.
943
1179
  * @returns The removed elements.
@@ -1006,7 +1242,7 @@ function removeRangeFromArray<TNodeSchema extends ImplicitAllowedTypes>(
1006
1242
  * cell: schemaFactory.string,
1007
1243
  * }) {}
1008
1244
  *
1009
- * const table = new MyTable({
1245
+ * const table = MyTable.create({
1010
1246
  * columns: [{ id: "column-0" }],
1011
1247
  * rows: [{ id: "row-0", cells: { "column-0": "Hello world!" } }],
1012
1248
  * });
@@ -1109,35 +1345,47 @@ export namespace TableSchema {
1109
1345
 
1110
1346
  /**
1111
1347
  * Factory for creating new table column schema.
1112
- * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.
1348
+ * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1113
1349
  * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
1114
1350
  * @alpha
1115
1351
  */
1116
1352
  export function column<
1117
- const TScope extends string | undefined,
1353
+ const TUserScope extends string,
1118
1354
  const TCell extends ImplicitAllowedTypes,
1119
1355
  >(
1120
- params: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryBeta<TScope>, TCell>,
1121
- ): System_TableSchema.ColumnSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>;
1356
+ params: System_TableSchema.CreateColumnOptionsBase<
1357
+ TUserScope,
1358
+ SchemaFactoryBeta<TUserScope>,
1359
+ TCell
1360
+ >,
1361
+ ): System_TableSchema.ColumnSchemaBase<
1362
+ TUserScope,
1363
+ TCell,
1364
+ System_TableSchema.DefaultPropsType
1365
+ >;
1122
1366
  /**
1123
1367
  * Factory for creating new table column schema.
1124
- * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.
1368
+ * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1125
1369
  * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
1126
1370
  * @typeParam TProps - Additional properties to associate with the column.
1127
1371
  * @alpha
1128
1372
  */
1129
1373
  export function column<
1130
- const TScope extends string | undefined,
1374
+ const TUserScope extends string,
1131
1375
  const TCell extends ImplicitAllowedTypes,
1132
1376
  const TProps extends ImplicitFieldSchema,
1133
1377
  >(
1134
- params: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {
1378
+ params: System_TableSchema.CreateColumnOptionsBase<
1379
+ TUserScope,
1380
+ SchemaFactoryBeta<TUserScope>,
1381
+ TCell
1382
+ > & {
1135
1383
  /**
1136
1384
  * Optional column properties.
1137
1385
  */
1138
1386
  readonly props: TProps;
1139
1387
  },
1140
- ): System_TableSchema.ColumnSchemaBase<TScope, TCell, TProps>;
1388
+ ): System_TableSchema.ColumnSchemaBase<TUserScope, TCell, TProps>;
1141
1389
  /**
1142
1390
  * Overload implementation
1143
1391
  */
@@ -1186,35 +1434,43 @@ export namespace TableSchema {
1186
1434
 
1187
1435
  /**
1188
1436
  * Factory for creating new table column schema.
1189
- * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.
1437
+ * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1190
1438
  * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
1191
1439
  * @alpha
1192
1440
  */
1193
1441
  export function row<
1194
- const TScope extends string | undefined,
1442
+ const TUserScope extends string,
1195
1443
  const TCell extends ImplicitAllowedTypes,
1196
1444
  >(
1197
- params: System_TableSchema.CreateRowOptionsBase<SchemaFactoryBeta<TScope>, TCell>,
1198
- ): System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>;
1445
+ params: System_TableSchema.CreateRowOptionsBase<
1446
+ TUserScope,
1447
+ SchemaFactoryBeta<TUserScope>,
1448
+ TCell
1449
+ >,
1450
+ ): System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>;
1199
1451
  /**
1200
1452
  * Factory for creating new table row schema.
1201
- * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.
1453
+ * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1202
1454
  * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
1203
1455
  * @typeParam TProps - Additional properties to associate with the row.
1204
1456
  * @alpha
1205
1457
  */
1206
1458
  export function row<
1207
- const TScope extends string | undefined,
1459
+ const TUserScope extends string,
1208
1460
  const TCell extends ImplicitAllowedTypes,
1209
1461
  const TProps extends ImplicitFieldSchema,
1210
1462
  >(
1211
- params: System_TableSchema.CreateRowOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {
1463
+ params: System_TableSchema.CreateRowOptionsBase<
1464
+ TUserScope,
1465
+ SchemaFactoryBeta<TUserScope>,
1466
+ TCell
1467
+ > & {
1212
1468
  /**
1213
1469
  * Optional row properties.
1214
1470
  */
1215
1471
  readonly props: TProps;
1216
1472
  },
1217
- ): System_TableSchema.RowSchemaBase<TScope, TCell, TProps>;
1473
+ ): System_TableSchema.RowSchemaBase<TUserScope, TCell, TProps>;
1218
1474
  /**
1219
1475
  * Overload implementation
1220
1476
  */
@@ -1234,7 +1490,7 @@ export namespace TableSchema {
1234
1490
 
1235
1491
  /**
1236
1492
  * A key to uniquely identify a cell within a table.
1237
- * @alpha
1493
+ * @input @alpha
1238
1494
  */
1239
1495
  export interface CellKey<
1240
1496
  TColumn extends ImplicitAllowedTypes,
@@ -1253,7 +1509,7 @@ export namespace TableSchema {
1253
1509
 
1254
1510
  /**
1255
1511
  * {@link TableSchema.Table.insertColumns} parameters.
1256
- * @alpha
1512
+ * @input @alpha
1257
1513
  */
1258
1514
  export interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
1259
1515
  /**
@@ -1270,7 +1526,7 @@ export namespace TableSchema {
1270
1526
 
1271
1527
  /**
1272
1528
  * {@link TableSchema.Table.insertRows} parameters.
1273
- * @alpha
1529
+ * @input @alpha
1274
1530
  */
1275
1531
  export interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
1276
1532
  /**
@@ -1287,7 +1543,7 @@ export namespace TableSchema {
1287
1543
 
1288
1544
  /**
1289
1545
  * {@link TableSchema.Table.setCell} parameters.
1290
- * @alpha
1546
+ * @input @alpha
1291
1547
  */
1292
1548
  export interface SetCellParameters<
1293
1549
  TCell extends ImplicitAllowedTypes,
@@ -1307,27 +1563,33 @@ export namespace TableSchema {
1307
1563
 
1308
1564
  /**
1309
1565
  * A table.
1310
- * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.
1566
+ *
1567
+ * @remarks Table schema is created via the {@link TableSchema.(table:1)} factory.
1568
+ * Node instances of the schema type should be constructed via the static `create` method on the schema class.
1569
+ * E.g. `const table = MyTableSchema.create({ columns, rows});`
1570
+ *
1571
+ * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1311
1572
  * @typeParam TCell - The type of the cells in the table.
1312
1573
  * @typeParam TColumn - The type of the columns in the table.
1313
1574
  * @typeParam TRow - The type of the rows in the table.
1575
+ *
1314
1576
  * @sealed @alpha
1315
1577
  */
1316
1578
  export interface Table<
1317
- TScope extends string | undefined,
1579
+ TUserScope extends string,
1318
1580
  TCell extends ImplicitAllowedTypes,
1319
- TColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>,
1320
- TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,
1581
+ TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>,
1582
+ TRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>,
1321
1583
  > {
1322
1584
  /**
1323
1585
  * The table's columns.
1324
1586
  */
1325
- readonly columns: TreeArrayNode<TColumn>;
1587
+ readonly columns: System_TableSchema.RearrangeableList<TColumn>;
1326
1588
 
1327
1589
  /**
1328
1590
  * The table's rows.
1329
1591
  */
1330
- readonly rows: TreeArrayNode<TRow>;
1592
+ readonly rows: System_TableSchema.RearrangeableList<TRow>;
1331
1593
 
1332
1594
  /**
1333
1595
  * Gets a table column by its {@link TableSchema.Column.id}.
@@ -1475,84 +1737,136 @@ export namespace TableSchema {
1475
1737
  ): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1476
1738
  }
1477
1739
 
1740
+ /**
1741
+ * Input parameters for {@link TableSchema.Table}'s `create` factory method.
1742
+ * @input @alpha
1743
+ */
1744
+ export interface TableFactoryMethodParameters<
1745
+ TUserScope extends string,
1746
+ TCell extends ImplicitAllowedTypes,
1747
+ TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>,
1748
+ TRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>,
1749
+ > {
1750
+ /**
1751
+ * Initial columns for the table.
1752
+ */
1753
+ readonly columns?:
1754
+ | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumn>>
1755
+ | undefined;
1756
+
1757
+ /**
1758
+ * Initial rows for the table.
1759
+ * @remarks If any cells are specified, they will be validated against the IDs of the provided columns.
1760
+ */
1761
+ readonly rows?: Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRow>> | undefined;
1762
+ }
1763
+
1478
1764
  /**
1479
1765
  * Factory for creating new table schema.
1480
- * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.
1766
+ * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1767
+ * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.
1481
1768
  * @typeParam TCell - The type of the cells in the table.
1482
1769
  * @alpha
1483
1770
  */
1484
1771
  export function table<
1485
- const TScope extends string | undefined,
1772
+ const TUserScope extends string,
1486
1773
  const TCell extends ImplicitAllowedTypes,
1487
1774
  >(
1488
- params: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell>,
1775
+ params: System_TableSchema.TableFactoryOptionsBase<
1776
+ TUserScope,
1777
+ SchemaFactoryBeta<TUserScope>,
1778
+ TCell
1779
+ >,
1489
1780
  ): System_TableSchema.TableSchemaBase<
1490
- TScope,
1781
+ TUserScope,
1491
1782
  TCell,
1492
- System_TableSchema.ColumnSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>,
1493
- System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>
1783
+ System_TableSchema.ColumnSchemaBase<
1784
+ TUserScope,
1785
+ TCell,
1786
+ System_TableSchema.DefaultPropsType
1787
+ >,
1788
+ System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>
1494
1789
  >;
1495
1790
  /**
1496
1791
  * Factory for creating new table schema with custom column schema.
1497
- * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.
1792
+ * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1793
+ * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.
1498
1794
  * @typeParam TCell - The type of the cells in the table.
1499
1795
  * @typeParam TColumn - The type of the columns in the table.
1500
1796
  * @alpha
1501
1797
  */
1502
1798
  export function table<
1503
- const TScope extends string | undefined,
1799
+ const TUserScope extends string,
1504
1800
  const TCell extends ImplicitAllowedTypes,
1505
- const TColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>,
1801
+ const TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>,
1506
1802
  >(
1507
- params: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {
1803
+ params: System_TableSchema.TableFactoryOptionsBase<
1804
+ TUserScope,
1805
+ SchemaFactoryBeta<TUserScope>,
1806
+ TCell
1807
+ > & {
1508
1808
  readonly column: TColumn;
1509
1809
  },
1510
1810
  ): System_TableSchema.TableSchemaBase<
1511
- TScope,
1811
+ TUserScope,
1512
1812
  TCell,
1513
1813
  TColumn,
1514
- System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>
1814
+ System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>
1515
1815
  >;
1516
1816
  /**
1517
1817
  * Factory for creating new table schema with custom row schema.
1518
- * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.
1818
+ * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1819
+ * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.
1519
1820
  * @typeParam TCell - The type of the cells in the table.
1520
1821
  * @typeParam TRow - The type of the rows in the table.
1521
1822
  * @alpha
1522
1823
  */
1523
1824
  export function table<
1524
- const TScope extends string | undefined,
1825
+ const TUserScope extends string,
1525
1826
  const TCell extends ImplicitAllowedTypes,
1526
- const TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,
1827
+ const TRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>,
1527
1828
  >(
1528
- params: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {
1829
+ params: System_TableSchema.TableFactoryOptionsBase<
1830
+ TUserScope,
1831
+ SchemaFactoryBeta<TUserScope>,
1832
+ TCell
1833
+ > & {
1529
1834
  readonly row: TRow;
1530
1835
  },
1531
1836
  ): System_TableSchema.TableSchemaBase<
1532
- TScope,
1837
+ TUserScope,
1533
1838
  TCell,
1534
- System_TableSchema.ColumnSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>,
1839
+ System_TableSchema.ColumnSchemaBase<
1840
+ TUserScope,
1841
+ TCell,
1842
+ System_TableSchema.DefaultPropsType
1843
+ >,
1535
1844
  TRow
1536
1845
  >;
1537
1846
  /**
1538
1847
  * Factory for creating new table schema with custom column and row schema.
1539
- * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.
1848
+ * @typeParam TUserScope - The {@link SchemaFactory.scope | schema factory scope}.
1849
+ * The resulting schema will have an identifier of the form: `com.fluidframework.table<${TUserScope}>.Table`.
1540
1850
  * @typeParam TCell - The type of the cells in the table.
1541
1851
  * @typeParam TColumn - The type of the columns in the table.
1542
1852
  * @typeParam TRow - The type of the rows in the table.
1543
1853
  * @alpha
1544
1854
  */
1545
1855
  export function table<
1546
- const TScope extends string | undefined,
1856
+ const TUserScope extends string,
1547
1857
  const TCell extends ImplicitAllowedTypes,
1548
- const TColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>,
1549
- const TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,
1858
+ const TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>,
1859
+ const TRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>,
1550
1860
  >(
1551
- params: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {
1861
+ params: System_TableSchema.TableFactoryOptionsBase<
1862
+ TUserScope,
1863
+ SchemaFactoryBeta<TUserScope>,
1864
+ TCell
1865
+ > & {
1552
1866
  readonly column: TColumn;
1553
1867
  readonly row: TRow;
1554
1868
  },
1555
- ): System_TableSchema.TableSchemaBase<TScope, TCell, TColumn, TRow>;
1869
+ ): System_TableSchema.TableSchemaBase<TUserScope, TCell, TColumn, TRow>;
1556
1870
  /**
1557
1871
  * Overload implementation
1558
1872
  */