@fluidframework/tree 2.72.0 → 2.73.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 (609) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/api-report/tree.alpha.api.md +17 -30
  3. package/dist/alpha.d.ts +3 -1
  4. package/dist/api.d.ts +6 -2
  5. package/dist/api.d.ts.map +1 -1
  6. package/dist/api.js +2 -11
  7. package/dist/api.js.map +1 -1
  8. package/dist/codec/codec.d.ts +9 -2
  9. package/dist/codec/codec.d.ts.map +1 -1
  10. package/dist/codec/codec.js +9 -2
  11. package/dist/codec/codec.js.map +1 -1
  12. package/dist/codec/index.d.ts +1 -1
  13. package/dist/codec/index.d.ts.map +1 -1
  14. package/dist/codec/index.js +2 -1
  15. package/dist/codec/index.js.map +1 -1
  16. package/dist/codec/versioned/codec.d.ts +7 -2
  17. package/dist/codec/versioned/codec.d.ts.map +1 -1
  18. package/dist/codec/versioned/codec.js +24 -1
  19. package/dist/codec/versioned/codec.js.map +1 -1
  20. package/dist/codec/versioned/index.d.ts +1 -1
  21. package/dist/codec/versioned/index.d.ts.map +1 -1
  22. package/dist/codec/versioned/index.js +2 -1
  23. package/dist/codec/versioned/index.js.map +1 -1
  24. package/dist/core/schema-stored/schema.d.ts +12 -1
  25. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  26. package/dist/core/schema-stored/schema.js.map +1 -1
  27. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  28. package/dist/core/tree/detachedFieldIndexCodecs.js +5 -3
  29. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  30. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
  31. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  32. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  33. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  34. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +1 -0
  35. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  36. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
  37. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  38. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  39. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  40. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  41. package/dist/feature-libraries/chunked-forest/codec/codecs.js +31 -17
  42. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  43. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
  44. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  45. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
  46. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +156 -4
  48. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  49. package/dist/feature-libraries/chunked-forest/codec/format.js +7 -3
  50. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  51. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
  52. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  53. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
  54. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  55. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  56. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
  58. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
  60. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +23 -6
  62. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
  64. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +20 -4
  66. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  67. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  68. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  69. package/dist/feature-libraries/chunked-forest/index.js +2 -1
  70. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  71. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -17
  72. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  73. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +53 -55
  74. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  75. package/dist/feature-libraries/default-schema/index.d.ts +1 -3
  76. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  77. package/dist/feature-libraries/default-schema/index.js +2 -8
  78. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  79. package/dist/feature-libraries/forest-summary/format.d.ts +2 -2
  80. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  81. package/dist/feature-libraries/forest-summary/format.js +4 -2
  82. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  83. package/dist/feature-libraries/index.d.ts +4 -3
  84. package/dist/feature-libraries/index.d.ts.map +1 -1
  85. package/dist/feature-libraries/index.js +8 -7
  86. package/dist/feature-libraries/index.js.map +1 -1
  87. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  88. package/dist/feature-libraries/modular-schema/comparison.js +1 -2
  89. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  90. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
  91. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  92. package/dist/feature-libraries/modular-schema/fieldKind.js +29 -11
  93. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  94. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  95. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  96. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  97. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
  98. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  99. package/dist/feature-libraries/modular-schema/genericFieldKind.js +3 -2
  100. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  101. package/dist/feature-libraries/modular-schema/index.d.ts +0 -1
  102. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  103. package/dist/feature-libraries/modular-schema/index.js +1 -3
  104. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  105. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
  106. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  107. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  108. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
  109. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  110. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
  111. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  112. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
  113. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  114. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  115. package/dist/feature-libraries/object-forest/objectForest.js +3 -2
  116. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  117. package/dist/feature-libraries/optional-field/index.d.ts +1 -1
  118. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  119. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  120. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  121. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  122. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  123. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  124. package/dist/feature-libraries/schema-index/codec.js +5 -3
  125. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  126. package/dist/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
  127. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -0
  128. package/dist/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
  129. package/dist/feature-libraries/schemaChecker.js.map +1 -0
  130. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  131. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
  132. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  133. package/dist/index.d.ts +2 -2
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +5 -3
  136. package/dist/index.js.map +1 -1
  137. package/dist/packageVersion.d.ts +1 -1
  138. package/dist/packageVersion.js +1 -1
  139. package/dist/packageVersion.js.map +1 -1
  140. package/dist/shared-tree/index.d.ts +1 -1
  141. package/dist/shared-tree/index.d.ts.map +1 -1
  142. package/dist/shared-tree/index.js +1 -2
  143. package/dist/shared-tree/index.js.map +1 -1
  144. package/dist/shared-tree/sharedTree.d.ts +0 -44
  145. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  146. package/dist/shared-tree/sharedTree.js +1 -52
  147. package/dist/shared-tree/sharedTree.js.map +1 -1
  148. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  149. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  150. package/dist/shared-tree/sharedTreeChangeCodecs.js +0 -2
  151. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  152. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  153. package/dist/shared-tree-core/editManagerCodecs.js +12 -6
  154. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  155. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +3 -4
  156. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  157. package/dist/shared-tree-core/editManagerFormatCommons.js +5 -8
  158. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  159. package/dist/shared-tree-core/index.d.ts +2 -2
  160. package/dist/shared-tree-core/index.d.ts.map +1 -1
  161. package/dist/shared-tree-core/index.js +3 -2
  162. package/dist/shared-tree-core/index.js.map +1 -1
  163. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  164. package/dist/shared-tree-core/messageCodecs.js +20 -9
  165. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  166. package/dist/shared-tree-core/messageFormat.d.ts +4 -6
  167. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  168. package/dist/shared-tree-core/messageFormat.js +9 -7
  169. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  170. package/dist/simple-tree/api/configuration.d.ts +2 -0
  171. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  172. package/dist/simple-tree/api/configuration.js +10 -0
  173. package/dist/simple-tree/api/configuration.js.map +1 -1
  174. package/dist/simple-tree/api/index.d.ts +1 -0
  175. package/dist/simple-tree/api/index.d.ts.map +1 -1
  176. package/dist/simple-tree/api/index.js +5 -1
  177. package/dist/simple-tree/api/index.js.map +1 -1
  178. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  179. package/dist/simple-tree/api/schemaFromSimple.js +7 -1
  180. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  181. package/dist/simple-tree/api/simpleSchemaCodec.js +4 -6
  182. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  183. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
  184. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
  185. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +128 -0
  186. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
  187. package/dist/simple-tree/api/tree.d.ts +1 -1
  188. package/dist/simple-tree/api/tree.js +1 -1
  189. package/dist/simple-tree/api/tree.js.map +1 -1
  190. package/dist/simple-tree/core/allowedTypes.js +1 -1
  191. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  192. package/dist/simple-tree/core/index.d.ts +3 -3
  193. package/dist/simple-tree/core/index.d.ts.map +1 -1
  194. package/dist/simple-tree/core/index.js +3 -1
  195. package/dist/simple-tree/core/index.js.map +1 -1
  196. package/dist/simple-tree/core/toStored.d.ts +12 -5
  197. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  198. package/dist/simple-tree/core/toStored.js +26 -10
  199. package/dist/simple-tree/core/toStored.js.map +1 -1
  200. package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -6
  201. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  202. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  203. package/dist/simple-tree/core/treeNodeValid.d.ts +1 -1
  204. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  205. package/dist/simple-tree/core/treeNodeValid.js +1 -2
  206. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  207. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  208. package/dist/simple-tree/fieldSchema.js +1 -8
  209. package/dist/simple-tree/fieldSchema.js.map +1 -1
  210. package/dist/simple-tree/index.d.ts +2 -2
  211. package/dist/simple-tree/index.d.ts.map +1 -1
  212. package/dist/simple-tree/index.js +9 -3
  213. package/dist/simple-tree/index.js.map +1 -1
  214. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  215. package/dist/simple-tree/leafNodeSchema.js +0 -1
  216. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  217. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  218. package/dist/simple-tree/node-kinds/array/arrayNode.js +13 -49
  219. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  220. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  221. package/dist/simple-tree/node-kinds/map/mapNode.js +1 -5
  222. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  223. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  224. package/dist/simple-tree/node-kinds/object/objectNode.js +2 -10
  225. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  226. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  227. package/dist/simple-tree/node-kinds/record/recordNode.js +1 -5
  228. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  229. package/dist/simple-tree/simpleSchema.d.ts +15 -3
  230. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  231. package/dist/simple-tree/simpleSchema.js.map +1 -1
  232. package/dist/simple-tree/toStoredSchema.d.ts +20 -8
  233. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  234. package/dist/simple-tree/toStoredSchema.js +27 -22
  235. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  236. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  237. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +18 -15
  238. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  239. package/dist/tableSchema.d.ts +22 -52
  240. package/dist/tableSchema.d.ts.map +1 -1
  241. package/dist/tableSchema.js +141 -277
  242. package/dist/tableSchema.js.map +1 -1
  243. package/dist/util/arrayUtilities.d.ts +45 -0
  244. package/dist/util/arrayUtilities.d.ts.map +1 -0
  245. package/dist/util/arrayUtilities.js +76 -0
  246. package/dist/util/arrayUtilities.js.map +1 -0
  247. package/dist/util/index.d.ts +1 -0
  248. package/dist/util/index.d.ts.map +1 -1
  249. package/dist/util/index.js +7 -2
  250. package/dist/util/index.js.map +1 -1
  251. package/lib/alpha.d.ts +3 -1
  252. package/lib/api.d.ts +6 -2
  253. package/lib/api.d.ts.map +1 -1
  254. package/lib/api.js +2 -13
  255. package/lib/api.js.map +1 -1
  256. package/lib/codec/codec.d.ts +9 -2
  257. package/lib/codec/codec.d.ts.map +1 -1
  258. package/lib/codec/codec.js +9 -2
  259. package/lib/codec/codec.js.map +1 -1
  260. package/lib/codec/index.d.ts +1 -1
  261. package/lib/codec/index.d.ts.map +1 -1
  262. package/lib/codec/index.js +1 -1
  263. package/lib/codec/index.js.map +1 -1
  264. package/lib/codec/versioned/codec.d.ts +7 -2
  265. package/lib/codec/versioned/codec.d.ts.map +1 -1
  266. package/lib/codec/versioned/codec.js +22 -0
  267. package/lib/codec/versioned/codec.js.map +1 -1
  268. package/lib/codec/versioned/index.d.ts +1 -1
  269. package/lib/codec/versioned/index.d.ts.map +1 -1
  270. package/lib/codec/versioned/index.js +1 -1
  271. package/lib/codec/versioned/index.js.map +1 -1
  272. package/lib/core/schema-stored/schema.d.ts +12 -1
  273. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  274. package/lib/core/schema-stored/schema.js.map +1 -1
  275. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  276. package/lib/core/tree/detachedFieldIndexCodecs.js +5 -3
  277. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  278. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
  279. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  280. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  281. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  282. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +2 -1
  283. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  284. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
  285. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  286. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  287. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  288. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  289. package/lib/feature-libraries/chunked-forest/codec/codecs.js +34 -20
  290. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  291. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
  292. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  293. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
  294. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  295. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +156 -4
  296. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  297. package/lib/feature-libraries/chunked-forest/codec/format.js +6 -2
  298. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  299. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
  300. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  301. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
  302. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  303. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  304. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  305. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  306. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  307. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
  308. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  309. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -6
  310. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  311. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
  312. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  313. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +17 -2
  314. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  315. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  316. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  317. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  318. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  319. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -17
  320. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  321. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +55 -57
  322. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  323. package/lib/feature-libraries/default-schema/index.d.ts +1 -3
  324. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  325. package/lib/feature-libraries/default-schema/index.js +1 -3
  326. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  327. package/lib/feature-libraries/forest-summary/format.d.ts +2 -2
  328. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  329. package/lib/feature-libraries/forest-summary/format.js +4 -2
  330. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  331. package/lib/feature-libraries/index.d.ts +4 -3
  332. package/lib/feature-libraries/index.d.ts.map +1 -1
  333. package/lib/feature-libraries/index.js +4 -3
  334. package/lib/feature-libraries/index.js.map +1 -1
  335. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  336. package/lib/feature-libraries/modular-schema/comparison.js +1 -2
  337. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  338. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
  339. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  340. package/lib/feature-libraries/modular-schema/fieldKind.js +29 -11
  341. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  342. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  343. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  344. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  345. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
  346. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  347. package/lib/feature-libraries/modular-schema/genericFieldKind.js +3 -2
  348. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  349. package/lib/feature-libraries/modular-schema/index.d.ts +0 -1
  350. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  351. package/lib/feature-libraries/modular-schema/index.js +0 -1
  352. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  353. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
  354. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  355. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  356. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
  357. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  358. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
  359. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  360. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
  361. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  362. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  363. package/lib/feature-libraries/object-forest/objectForest.js +2 -1
  364. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  365. package/lib/feature-libraries/optional-field/index.d.ts +1 -1
  366. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  367. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  368. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  369. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  370. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  371. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  372. package/lib/feature-libraries/schema-index/codec.js +5 -3
  373. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  374. package/lib/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
  375. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -0
  376. package/lib/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
  377. package/lib/feature-libraries/schemaChecker.js.map +1 -0
  378. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  379. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
  380. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  381. package/lib/index.d.ts +2 -2
  382. package/lib/index.d.ts.map +1 -1
  383. package/lib/index.js +2 -2
  384. package/lib/index.js.map +1 -1
  385. package/lib/packageVersion.d.ts +1 -1
  386. package/lib/packageVersion.js +1 -1
  387. package/lib/packageVersion.js.map +1 -1
  388. package/lib/shared-tree/index.d.ts +1 -1
  389. package/lib/shared-tree/index.d.ts.map +1 -1
  390. package/lib/shared-tree/index.js +1 -1
  391. package/lib/shared-tree/index.js.map +1 -1
  392. package/lib/shared-tree/sharedTree.d.ts +0 -44
  393. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  394. package/lib/shared-tree/sharedTree.js +0 -51
  395. package/lib/shared-tree/sharedTree.js.map +1 -1
  396. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  397. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  398. package/lib/shared-tree/sharedTreeChangeCodecs.js +0 -2
  399. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  400. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  401. package/lib/shared-tree-core/editManagerCodecs.js +13 -7
  402. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  403. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +3 -4
  404. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  405. package/lib/shared-tree-core/editManagerFormatCommons.js +4 -7
  406. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  407. package/lib/shared-tree-core/index.d.ts +2 -2
  408. package/lib/shared-tree-core/index.d.ts.map +1 -1
  409. package/lib/shared-tree-core/index.js +2 -2
  410. package/lib/shared-tree-core/index.js.map +1 -1
  411. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  412. package/lib/shared-tree-core/messageCodecs.js +21 -10
  413. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  414. package/lib/shared-tree-core/messageFormat.d.ts +4 -6
  415. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  416. package/lib/shared-tree-core/messageFormat.js +8 -6
  417. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  418. package/lib/simple-tree/api/configuration.d.ts +2 -0
  419. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  420. package/lib/simple-tree/api/configuration.js +10 -0
  421. package/lib/simple-tree/api/configuration.js.map +1 -1
  422. package/lib/simple-tree/api/index.d.ts +1 -0
  423. package/lib/simple-tree/api/index.d.ts.map +1 -1
  424. package/lib/simple-tree/api/index.js +1 -0
  425. package/lib/simple-tree/api/index.js.map +1 -1
  426. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  427. package/lib/simple-tree/api/schemaFromSimple.js +8 -2
  428. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  429. package/lib/simple-tree/api/simpleSchemaCodec.js +5 -7
  430. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  431. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
  432. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
  433. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +122 -0
  434. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
  435. package/lib/simple-tree/api/tree.d.ts +1 -1
  436. package/lib/simple-tree/api/tree.js +1 -1
  437. package/lib/simple-tree/api/tree.js.map +1 -1
  438. package/lib/simple-tree/core/allowedTypes.js +1 -1
  439. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  440. package/lib/simple-tree/core/index.d.ts +3 -3
  441. package/lib/simple-tree/core/index.d.ts.map +1 -1
  442. package/lib/simple-tree/core/index.js +2 -2
  443. package/lib/simple-tree/core/index.js.map +1 -1
  444. package/lib/simple-tree/core/toStored.d.ts +12 -5
  445. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  446. package/lib/simple-tree/core/toStored.js +25 -9
  447. package/lib/simple-tree/core/toStored.js.map +1 -1
  448. package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -6
  449. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  450. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  451. package/lib/simple-tree/core/treeNodeValid.d.ts +1 -1
  452. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  453. package/lib/simple-tree/core/treeNodeValid.js +1 -2
  454. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  455. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  456. package/lib/simple-tree/fieldSchema.js +2 -9
  457. package/lib/simple-tree/fieldSchema.js.map +1 -1
  458. package/lib/simple-tree/index.d.ts +2 -2
  459. package/lib/simple-tree/index.d.ts.map +1 -1
  460. package/lib/simple-tree/index.js +2 -2
  461. package/lib/simple-tree/index.js.map +1 -1
  462. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  463. package/lib/simple-tree/leafNodeSchema.js +1 -2
  464. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  465. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  466. package/lib/simple-tree/node-kinds/array/arrayNode.js +15 -51
  467. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  468. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  469. package/lib/simple-tree/node-kinds/map/mapNode.js +3 -7
  470. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  471. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  472. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -11
  473. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  474. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  475. package/lib/simple-tree/node-kinds/record/recordNode.js +3 -7
  476. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  477. package/lib/simple-tree/simpleSchema.d.ts +15 -3
  478. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  479. package/lib/simple-tree/simpleSchema.js.map +1 -1
  480. package/lib/simple-tree/toStoredSchema.d.ts +20 -8
  481. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  482. package/lib/simple-tree/toStoredSchema.js +28 -24
  483. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  484. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  485. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +20 -17
  486. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  487. package/lib/tableSchema.d.ts +22 -52
  488. package/lib/tableSchema.d.ts.map +1 -1
  489. package/lib/tableSchema.js +143 -279
  490. package/lib/tableSchema.js.map +1 -1
  491. package/lib/util/arrayUtilities.d.ts +45 -0
  492. package/lib/util/arrayUtilities.d.ts.map +1 -0
  493. package/lib/util/arrayUtilities.js +69 -0
  494. package/lib/util/arrayUtilities.js.map +1 -0
  495. package/lib/util/index.d.ts +1 -0
  496. package/lib/util/index.d.ts.map +1 -1
  497. package/lib/util/index.js +1 -0
  498. package/lib/util/index.js.map +1 -1
  499. package/package.json +21 -21
  500. package/src/api.ts +22 -11
  501. package/src/codec/codec.ts +10 -2
  502. package/src/codec/index.ts +1 -0
  503. package/src/codec/versioned/codec.ts +40 -2
  504. package/src/codec/versioned/index.ts +1 -0
  505. package/src/core/schema-stored/schema.ts +12 -1
  506. package/src/core/tree/detachedFieldIndexCodecs.ts +10 -3
  507. package/src/feature-libraries/README.md +1 -1
  508. package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -3
  509. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +5 -0
  510. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -1
  511. package/src/feature-libraries/chunked-forest/codec/codecs.ts +52 -19
  512. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +8 -3
  513. package/src/feature-libraries/chunked-forest/codec/format.ts +14 -4
  514. package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +7 -2
  515. package/src/feature-libraries/chunked-forest/codec/index.ts +1 -4
  516. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +62 -9
  517. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +24 -2
  518. package/src/feature-libraries/chunked-forest/index.ts +1 -1
  519. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +86 -74
  520. package/src/feature-libraries/default-schema/index.ts +1 -9
  521. package/src/feature-libraries/forest-summary/format.ts +15 -9
  522. package/src/feature-libraries/index.ts +7 -5
  523. package/src/feature-libraries/modular-schema/comparison.ts +2 -3
  524. package/src/feature-libraries/modular-schema/fieldKind.ts +90 -13
  525. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +2 -3
  526. package/src/feature-libraries/modular-schema/genericFieldKind.ts +6 -6
  527. package/src/feature-libraries/modular-schema/index.ts +0 -1
  528. package/src/feature-libraries/modular-schema/isNeverTree.ts +7 -8
  529. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +13 -13
  530. package/src/feature-libraries/object-forest/objectForest.ts +2 -6
  531. package/src/feature-libraries/optional-field/index.ts +1 -0
  532. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
  533. package/src/feature-libraries/schema-index/codec.ts +10 -3
  534. package/src/feature-libraries/{default-schema/schemaChecker.ts → schemaChecker.ts} +4 -4
  535. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +0 -2
  536. package/src/index.ts +3 -1
  537. package/src/packageVersion.ts +1 -1
  538. package/src/shared-tree/index.ts +0 -1
  539. package/src/shared-tree/sharedTree.ts +0 -70
  540. package/src/shared-tree/sharedTreeChangeCodecs.ts +1 -6
  541. package/src/shared-tree-core/editManagerCodecs.ts +19 -7
  542. package/src/shared-tree-core/editManagerFormatCommons.ts +11 -12
  543. package/src/shared-tree-core/index.ts +6 -2
  544. package/src/shared-tree-core/messageCodecs.ts +32 -17
  545. package/src/shared-tree-core/messageFormat.ts +8 -6
  546. package/src/simple-tree/api/configuration.ts +17 -4
  547. package/src/simple-tree/api/index.ts +5 -0
  548. package/src/simple-tree/api/schemaFromSimple.ts +14 -6
  549. package/src/simple-tree/api/simpleSchemaCodec.ts +10 -9
  550. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +135 -0
  551. package/src/simple-tree/api/tree.ts +1 -1
  552. package/src/simple-tree/core/allowedTypes.ts +1 -1
  553. package/src/simple-tree/core/index.ts +3 -1
  554. package/src/simple-tree/core/toStored.ts +42 -18
  555. package/src/simple-tree/core/treeNodeSchema.ts +1 -7
  556. package/src/simple-tree/core/treeNodeValid.ts +0 -2
  557. package/src/simple-tree/fieldSchema.ts +2 -11
  558. package/src/simple-tree/index.ts +6 -1
  559. package/src/simple-tree/leafNodeSchema.ts +1 -2
  560. package/src/simple-tree/node-kinds/array/arrayNode.ts +26 -75
  561. package/src/simple-tree/node-kinds/map/mapNode.ts +1 -15
  562. package/src/simple-tree/node-kinds/object/objectNode.ts +2 -17
  563. package/src/simple-tree/node-kinds/record/recordNode.ts +1 -15
  564. package/src/simple-tree/simpleSchema.ts +16 -3
  565. package/src/simple-tree/toStoredSchema.ts +54 -38
  566. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +22 -17
  567. package/src/tableSchema.ts +110 -334
  568. package/src/util/arrayUtilities.ts +88 -0
  569. package/src/util/index.ts +6 -0
  570. package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
  571. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
  572. package/dist/feature-libraries/default-schema/defaultSchema.js +0 -15
  573. package/dist/feature-libraries/default-schema/defaultSchema.js.map +0 -1
  574. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
  575. package/dist/feature-libraries/default-schema/schemaChecker.js.map +0 -1
  576. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
  577. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
  578. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -76
  579. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
  580. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
  581. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
  582. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -158
  583. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
  584. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
  585. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
  586. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -245
  587. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
  588. package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
  589. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
  590. package/lib/feature-libraries/default-schema/defaultSchema.js +0 -12
  591. package/lib/feature-libraries/default-schema/defaultSchema.js.map +0 -1
  592. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
  593. package/lib/feature-libraries/default-schema/schemaChecker.js.map +0 -1
  594. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
  595. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
  596. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -71
  597. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
  598. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
  599. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
  600. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -154
  601. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
  602. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
  603. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
  604. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -241
  605. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
  606. package/src/feature-libraries/default-schema/defaultSchema.ts +0 -15
  607. package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +0 -108
  608. package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +0 -208
  609. package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +0 -344
@@ -1 +1 @@
1
- {"version":3,"file":"tableSchema.js","sourceRoot":"","sources":["../src/tableSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM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AY,GAAG,MAAM,CAAC;QAC7B,aAAa;QACb,IAAI,EAAE,UAAU;KAChB,CAAC,EACF,GAAG,EAAE,SAAS,GAAG,GAAG,CAAC;QACpB,aAAa;QACb,IAAI,EAAE,UAAU;KAChB,CAAC,GAIF;QACA,OAAO,kBAAkB,CAAC,iBAAiB,CAC1C,aAAa,EACb,UAAU,EACV,YAAY,EACZ,SAAS,CACT,CAAC;IACH,CAAC;IArBe,iBAAK,QAqBpB,CAAA;IAED,aAAa;AACd,CAAC,EA/iBgB,WAAW,KAAX,WAAW,QA+iB3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { Tree, TreeAlpha } from \"./shared-tree/index.js\";\nimport {\n\ttype FieldHasDefault,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeKind,\n\ttype SchemaFactoryBeta,\n\ttype ScopedSchemaName,\n\tTreeArrayNode,\n\ttype TreeNode,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaClass,\n\ttype WithType,\n\ttype TreeFieldFromImplicitField,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InternalTreeNode,\n\tSchemaFactory,\n\ttype ImplicitFieldSchema,\n\tisArrayNodeSchema,\n\ttype InsertableField,\n\twithBufferedTreeEvents,\n} from \"./simple-tree/index.js\";\n\n// Future improvement TODOs:\n// - Omit `cells` property from Row insertion type.\n// - Record-like type parameters / input parameters?\n// - Omit `props` properties from Row and Column schemas when not provided?\n\n// Longer-term work:\n// - Add constraint APIs to make it possible to avoid situations that could yield \"orphaned\" cells.\n\n/**\n * The sub-scope applied to user-provided {@link SchemaFactory}s by table schema factories.\n */\nconst tableSchemaFactorySubScope = \"table\";\n\n/**\n * Gets the table containing the provided row/column node, if the node is part of a table.\n * @remarks Assumes that the table is the grandparent of the row/column node.\n */\nfunction getParentTable(\n\trowOrColumnNode: TreeNode,\n):\n\t| (TreeNode &\n\t\t\tTableSchema.Table<\n\t\t\t\tstring | undefined,\n\t\t\t\tImplicitAllowedTypes,\n\t\t\t\tSystem_TableSchema.ColumnSchemaBase,\n\t\t\t\tSystem_TableSchema.RowSchemaBase\n\t\t\t>)\n\t| undefined {\n\tconst rowListNode = Tree.parent(rowOrColumnNode);\n\tif (rowListNode === undefined || !isArrayNodeSchema(Tree.schema(rowListNode))) {\n\t\treturn undefined;\n\t}\n\tconst tableNode = Tree.parent(rowListNode);\n\tif (tableNode === undefined || !isTableNode(tableNode)) {\n\t\treturn undefined;\n\t}\n\n\treturn tableNode;\n}\n\n/**\n * A private symbol put on table schema to help identify them.\n */\nconst tableSchemaSymbol: unique symbol = Symbol(\"tableNode\");\n\n/**\n * Type-guard to determine if a node is a table node.\n * @remarks Uses {@link tableSchemaSymbol} to identify table nodes.\n */\nfunction isTableNode(\n\tnode: TreeNode,\n): node is TreeNode &\n\tTableSchema.Table<\n\t\tstring | undefined,\n\t\tImplicitAllowedTypes,\n\t\tSystem_TableSchema.ColumnSchemaBase,\n\t\tSystem_TableSchema.RowSchemaBase\n\t> {\n\treturn tableSchemaSymbol in Tree.schema(node);\n}\n\n/**\n * Not intended for use outside of this package.\n *\n * @privateRemarks\n * This namespace is a collection of internal system types relate to {@link TableSchema}.\n * This namespace should be strictly type-exported by the package.\n * All members should be tagged with `@system`.\n *\n * @system @alpha\n */\nexport namespace System_TableSchema {\n\t/**\n\t * Default type used for column and row \"props\" fields.\n\t * @privateRemarks\n\t * Longer term, it would be better to simply omit \"props\" altogether by default.\n\t * For now, this ensures that the user doesn't have to specify a \"props\" entry when initializing column/row nodes\n\t * and ensures that they cannot set anything that might conflict with future evolutions of the schema.\n\t * @system @alpha\n\t */\n\texport type DefaultPropsType = ReturnType<typeof SchemaFactory.optional<[]>>;\n\n\t/**\n\t * A base interface for factory input options which include an schema factory.\n\t * @remarks This interface should not be referenced directly.\n\t * @privateRemarks This interface primarily exists to provide a single home for property documentation.\n\t * @system @alpha\n\t */\n\texport interface OptionsWithSchemaFactory<TSchemaFactory extends SchemaFactoryBeta> {\n\t\t/**\n\t\t * Schema factory with which the Column schema will be associated.\n\t\t * @remarks Can be used to associate the resulting schema with an existing {@link SchemaFactory.scope|scope}.\n\t\t */\n\t\treadonly schemaFactory: TSchemaFactory;\n\t}\n\n\t/**\n\t * A base interface for factory input options which include the table cell schema.\n\t * @remarks This interface should not be referenced directly.\n\t * @privateRemarks This interface primarily exists to provide a single home for property documentation.\n\t * @system @alpha\n\t */\n\texport interface OptionsWithCellSchema<TCellSchema extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * Schema for the table's cells.\n\t\t */\n\t\treadonly cell: TCellSchema;\n\t}\n\n\t// #region Column\n\n\t/**\n\t * Base options for creating table cow schema.\n\t * @remarks Includes parameters common to all column factory overloads.\n\t * @system @alpha\n\t */\n\texport type CreateColumnOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryBeta = SchemaFactoryBeta,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating column schema.\n\t * @system @alpha\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createColumnSchema<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TPropsSchema extends ImplicitFieldSchema,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryBeta<TInputScope>,\n\t\tcellSchema: TCellSchema,\n\t\tpropsSchema: TPropsSchema,\n\t) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\ttype CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\n\t\t// Note: `columnFields` is broken into two parts to work around a TypeScript bug\n\t\t// that results in broken `.d.ts` output.\n\t\t// See definition of `ColumnInsertableType` below.\n\t\tconst columnFieldsBuiltInParts = {\n\t\t\tid: schemaFactory.identifier,\n\t\t} as const;\n\t\tconst columnFieldsPropsPart = {\n\t\t\tprops: propsSchema,\n\t\t} as const;\n\n\t\t/**\n\t\t * {@link Column} fields.\n\t\t *\n\t\t * @remarks\n\t\t * Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t *\n\t\t * Note: ideally we would add a satisfies clause here to ensure that this satisfies\n\t\t * `Record<string, ImplicitFieldSchema>`, but doing so causes TypeScript to prematurely and incorrectly evaluate the type of `propsSchema`.\n\t\t * Likely related to the following issue: https://github.com/microsoft/TypeScript/issues/52394\n\t\t */\n\t\tconst columnFields = {\n\t\t\t...columnFieldsBuiltInParts,\n\t\t\t...columnFieldsPropsPart,\n\t\t} as const; // satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * A column in a table.\n\t\t */\n\t\tclass Column\n\t\t\textends schemaFactory.object(\"Column\", columnFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements TableSchema.Column<TCellSchema, TPropsSchema>\n\t\t{\n\t\t\tpublic getCells(): {\n\t\t\t\trowId: string;\n\t\t\t\tcell: CellValueType;\n\t\t\t}[] {\n\t\t\t\tconst tableNode = getParentTable(this);\n\t\t\t\tif (tableNode === undefined) {\n\t\t\t\t\tthrow new UsageError(`Column with ID \"${this.id}\" is not contained in a table.`);\n\t\t\t\t}\n\n\t\t\t\tconst result: {\n\t\t\t\t\trowId: string;\n\t\t\t\t\tcell: CellValueType;\n\t\t\t\t}[] = [];\n\t\t\t\tfor (const row of tableNode.rows) {\n\t\t\t\t\tconst cell = row.getCell(this.id);\n\t\t\t\t\tif (cell !== undefined) {\n\t\t\t\t\t\tif (!Tree.is(cell, cellSchema)) {\n\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\"Parent table contains a cell with incompatible with this column.\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresult.push({ rowId: row.id, cell });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\ttype ColumnValueType = TreeNode &\n\t\t\tTableSchema.Column<TCellSchema, TPropsSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Column\">>;\n\n\t\t// Note: ideally this type would just leverage `InsertableObjectFromSchemaRecord<typeof columnFields>`,\n\t\t// but that results in broken `.d.ts` output due to a TypeScript bug.\n\t\t// See: https://github.com/microsoft/TypeScript/issues/58688.\n\t\t// Instead we extract and inline the typing of the \"props\" field here, which seems to sufficiently work around the issue.\n\t\t// type ColumnInsertableType = InsertableObjectFromSchemaRecord<typeof columnFields>;\n\t\ttype ColumnInsertableType = InsertableObjectFromSchemaRecord<\n\t\t\ttypeof columnFieldsBuiltInParts\n\t\t> &\n\t\t\t(FieldHasDefault<TPropsSchema> extends true\n\t\t\t\t? // Note: The docs on the below properties are copied from `IColumn.props`' docs to ensure that the\n\t\t\t\t\t// documentation appears in the data insertion scenario.\n\t\t\t\t\t// The contents are duplicated instead of using `@inheritdoc`, as intellisense does not correctly\n\t\t\t\t\t// support `@inheritDoc`.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/31267\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The column's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops?: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The column's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t});\n\n\t\t// Modified version of `Column` that ensures the constructor (and `createFromInsertable`) are\n\t\t// typed correctly in terms of our insertable type.\n\t\t// This lets us be selective in our type-cast for the value returned from this function,\n\t\t// preserving as much type-safety as we reasonably can.\n\t\ttype ColumnSchemaModifiedType = Omit<\n\t\t\t// Use mapped type to omit the constructor\n\t\t\t{\n\t\t\t\t[Property in keyof typeof Column]: (typeof Column)[Property];\n\t\t\t},\n\t\t\t\"createFromInsertable\"\n\t\t> &\n\t\t\t(new (\n\t\t\t\tparameters: InternalTreeNode | ColumnInsertableType,\n\t\t\t) => Column) & {\n\t\t\t\tcreateFromInsertable(parameters: ColumnInsertableType): Column;\n\t\t\t};\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst ColumnSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Column\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ ColumnValueType,\n\t\t\t/* TInsertable */ object & ColumnInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof columnFields\n\t\t> = Column as ColumnSchemaModifiedType;\n\n\t\treturn ColumnSchemaType;\n\t}\n\n\t/**\n\t * Base column schema type.\n\t * @sealed @system @alpha\n\t */\n\texport type ColumnSchemaBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> = ReturnType<typeof createColumnSchema<TScope, TCellSchema, TPropsSchema>>;\n\n\t// #endregion\n\n\t// #region Row\n\n\t/**\n\t * Base options for creating table row schema.\n\t * @remarks Includes parameters common to all row factory overloads.\n\t * @system @alpha\n\t */\n\texport type CreateRowOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryBeta = SchemaFactoryBeta,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating row schema.\n\t * @sealed @alpha\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createRowSchema<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TPropsSchema extends ImplicitFieldSchema,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryBeta<TInputScope>,\n\t\tcellSchema: TCellSchema,\n\t\tpropsSchema: TPropsSchema,\n\t) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\ttype CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\t\ttype CellInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\n\t\t// Note: `rowFields` is broken into two parts to work around a TypeScript bug\n\t\t// that results in broken `.d.ts` output.\n\t\t// See definition of `RowInsertableType` below.\n\t\tconst rowFieldsBuiltInParts = {\n\t\t\tid: schemaFactory.identifier,\n\t\t\t/**\n\t\t\t * The cells of the table row, keyed by column ID.\n\t\t\t * @remarks\n\t\t\t * The table row models its cells as a record, where each key is the ID of the column it belongs to. The choice of record (as opposed to a map) is intended to make interop with common table rendering libraries in TypeScript/JavaScript easier.\n\t\t\t */\n\t\t\tcells: schemaFactory.required(schemaFactory.record(\"Row.cells\", cellSchema), {\n\t\t\t\tmetadata: {\n\t\t\t\t\tdescription: \"The cells of the table row, keyed by column ID.\",\n\t\t\t\t},\n\t\t\t}),\n\t\t} as const;\n\t\tconst rowFieldsPropsPart = {\n\t\t\tprops: propsSchema,\n\t\t} as const;\n\n\t\t/**\n\t\t * {@link Row} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t * Note: ideally we would add a satisfies clause here to ensure that this satisfies\n\t\t * `Record<string, ImplicitFieldSchema>`, but doing so causes TypeScript to prematurely and incorrectly evaluate the type of `propsSchema`.\n\t\t * Likely related to the following issue: https://github.com/microsoft/TypeScript/issues/52394\n\t\t */\n\t\tconst rowFields = {\n\t\t\t...rowFieldsBuiltInParts,\n\t\t\t...rowFieldsPropsPart,\n\t\t} as const; // satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * The Row schema - this is a map of Cells where the key is the column id\n\t\t */\n\t\tclass Row\n\t\t\textends schemaFactory.object(\"Row\", rowFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements TableSchema.Row<TCellSchema, TPropsSchema>\n\t\t{\n\t\t\tpublic getCell(\n\t\t\t\tcolumnOrId: TableSchema.Column<TCellSchema> | string,\n\t\t\t): CellValueType | undefined {\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t\t// Unlike most objects, RecordNodes don't have the default inherited object properties, so this is safe\n\t\t\t\treturn this.cells[columnId];\n\t\t\t}\n\n\t\t\tpublic setCell(\n\t\t\t\tcolumnOrId: TableSchema.Column<TCellSchema> | string,\n\t\t\t\tvalue: CellInsertableType | undefined,\n\t\t\t): void {\n\t\t\t\t// TODO: throw if column does not exist in the owning table.\n\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tthis.removeCell(columnOrId);\n\t\t\t\t} else {\n\t\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\tthis.cells[columnId] = TreeAlpha.create(\n\t\t\t\t\t\tcellSchema,\n\t\t\t\t\t\tvalue as InsertableField<TCellSchema>,\n\t\t\t\t\t) as CellValueType;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic removeCell(\n\t\t\t\tcolumnOrId: TableSchema.Column<TCellSchema> | string,\n\t\t\t): CellValueType | undefined {\n\t\t\t\t// TODO: throw if column does not exist in the owning table.\n\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\n\t\t\t\tconst cell: CellValueType | undefined = this.getCell(columnId);\n\t\t\t\tif (cell === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- The record's values are non-optional, so setting `undefined` as a means to remove the cell is not supported.\n\t\t\t\tdelete this.cells[columnId];\n\n\t\t\t\treturn cell;\n\t\t\t}\n\n\t\t\tpublic getCells(): {\n\t\t\t\tcolumnId: string;\n\t\t\t\tcell: CellValueType;\n\t\t\t}[] {\n\t\t\t\tconst result = [];\n\t\t\t\tfor (const [columnId, cell] of Object.entries(this.cells)) {\n\t\t\t\t\tif (cell !== undefined) {\n\t\t\t\t\t\tresult.push({\n\t\t\t\t\t\t\tcolumnId,\n\t\t\t\t\t\t\tcell,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\ttype RowValueType = TreeNode &\n\t\t\tTableSchema.Row<TCellSchema, TPropsSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Row\">>;\n\n\t\t// Note: ideally this type would just leverage `InsertableObjectFromSchemaRecord<typeof rowFields>`,\n\t\t// but that results in broken `.d.ts` output due to a TypeScript bug.\n\t\t// See: https://github.com/microsoft/TypeScript/issues/58688.\n\t\t// Instead we extract and inline the typing of the \"props\" field here, which seems to sufficiently work around\n\t\t// the issue.\n\t\t// type RowInsertableType = InsertableObjectFromSchemaRecord<typeof rowFields>;\n\t\ttype RowInsertableType = InsertableObjectFromSchemaRecord<typeof rowFieldsBuiltInParts> &\n\t\t\t(FieldHasDefault<TPropsSchema> extends true\n\t\t\t\t? // Note: The docs on the below properties are copied from `IRow.props`' docs to ensure that the\n\t\t\t\t\t// documentation appears in the data insertion scenario.\n\t\t\t\t\t// The contents are duplicated instead of using `@inheritdoc`, as intellisense does not correctly\n\t\t\t\t\t// support `@inheritDoc`.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/31267\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The row's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information\n\t\t\t\t\t\t * about the row.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops?: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The row's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information\n\t\t\t\t\t\t * about the row.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t});\n\n\t\t// Modified version of `Row` that ensures the constructor (and `createFromInsertable`) are\n\t\t// typed correctly in terms of our insertable type.\n\t\t// This lets us be selective in our type-cast for the value returned from this function,\n\t\t// preserving as much type-safety as we reasonably can.\n\t\ttype RowSchemaModifiedType = Omit<\n\t\t\t// Use mapped type to omit the constructor\n\t\t\t{\n\t\t\t\t[Property in keyof typeof Row]: (typeof Row)[Property];\n\t\t\t},\n\t\t\t\"createFromInsertable\"\n\t\t> &\n\t\t\t(new (\n\t\t\t\tparameters: InternalTreeNode | RowInsertableType,\n\t\t\t) => Row) & {\n\t\t\t\tcreateFromInsertable(parameters: RowInsertableType): Row;\n\t\t\t};\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst RowSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Row\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ RowValueType,\n\t\t\t/* TInsertable */ object & RowInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof rowFields\n\t\t> = Row as RowSchemaModifiedType;\n\n\t\treturn RowSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @alpha\n\t */\n\texport type RowSchemaBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> = ReturnType<typeof createRowSchema<TScope, TCellSchema, TPropsSchema>>;\n\n\t// #endregion\n\n\t// #region Table\n\n\t/**\n\t * Base options for creating table schema.\n\t * @remarks Includes parameters common to all table factory overloads.\n\t * @system @alpha\n\t */\n\texport type TableFactoryOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryBeta = SchemaFactoryBeta,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating table schema.\n\t * @system @alpha\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createTableSchema<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TColumnSchema extends ColumnSchemaBase<TInputScope, TCellSchema>,\n\t\tconst TRowSchema extends RowSchemaBase<TInputScope, TCellSchema>,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryBeta<TInputScope>,\n\t\t_cellSchema: TCellSchema,\n\t\tcolumnSchema: TColumnSchema,\n\t\trowSchema: TRowSchema,\n\t) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\ttype CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\t\ttype ColumnValueType = TreeNodeFromImplicitAllowedTypes<TColumnSchema>;\n\t\ttype RowValueType = TreeNodeFromImplicitAllowedTypes<TRowSchema>;\n\n\t\t/**\n\t\t * {@link Table} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t */\n\t\tconst tableFields = {\n\t\t\trows: schemaFactory.array(\"Table.rows\", rowSchema),\n\t\t\tcolumns: schemaFactory.array(\"Table.columns\", columnSchema),\n\t\t} as const satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * The Table schema\n\t\t */\n\t\tclass Table\n\t\t\textends schemaFactory.object(\"Table\", tableFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements TableSchema.Table<TInputScope, TCellSchema, TColumnSchema, TRowSchema>\n\t\t{\n\t\t\tpublic static empty<TThis extends TableConstructorType>(\n\t\t\t\tthis: TThis,\n\t\t\t): InstanceType<TThis> {\n\t\t\t\treturn new this({ columns: [], rows: [] }) as InstanceType<TThis>;\n\t\t\t}\n\n\t\t\tpublic getColumn(indexOrId: number | string): ColumnValueType | undefined {\n\t\t\t\treturn this._tryGetColumn(indexOrId);\n\t\t\t}\n\n\t\t\tpublic getRow(indexOrId: number | string): RowValueType | undefined {\n\t\t\t\treturn this._tryGetRow(indexOrId);\n\t\t\t}\n\n\t\t\tpublic getCell(\n\t\t\t\tkey: TableSchema.CellKey<TColumnSchema, TRowSchema>,\n\t\t\t): CellValueType | undefined {\n\t\t\t\tconst { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;\n\t\t\t\tconst row = this._tryGetRow(rowOrIdOrIndex);\n\t\t\t\tif (row === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst column = this._tryGetColumn(columnOrIdOrIndex);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn row.getCell(column);\n\t\t\t}\n\n\t\t\tpublic insertColumns({\n\t\t\t\tcolumns,\n\t\t\t\tindex,\n\t\t\t}: TableSchema.InsertColumnsParameters<TColumnSchema>): ColumnValueType[] {\n\t\t\t\t// Ensure index is valid\n\t\t\t\tif (index !== undefined) {\n\t\t\t\t\tTable.validateInsertionIndex(index, this.columns);\n\t\t\t\t}\n\n\t\t\t\t// TypeScript is unable to narrow the column type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);\n\t\t\t\t} else {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.columns.insertAt(index, TreeArrayNode.spread(columns) as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input nodes into the tree hydrates them, making them usable as nodes.\n\t\t\t\treturn columns as unknown as ColumnValueType[];\n\t\t\t}\n\n\t\t\tpublic insertRows({\n\t\t\t\tindex,\n\t\t\t\trows,\n\t\t\t}: TableSchema.InsertRowsParameters<TRowSchema>): RowValueType[] {\n\t\t\t\t// #region Input validation\n\n\t\t\t\t// Ensure index is valid\n\t\t\t\tif (index !== undefined) {\n\t\t\t\t\tTable.validateInsertionIndex(index, this.rows);\n\t\t\t\t}\n\n\t\t\t\t// Note: TypeScript is unable to narrow the type of the row type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tfor (const newRow of rows) {\n\t\t\t\t\t// If the row contains cells, verify that the table contains the columns for those cells.\n\t\t\t\t\t// Note: we intentionally hide `cells` on `IRow` to avoid leaking the internal data representation as much as possible, so we have to cast here.\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tif ((newRow as any).cells !== undefined) {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\tconst keys: string[] = Object.keys((newRow as any).cells);\n\t\t\t\t\t\tfor (const key of keys) {\n\t\t\t\t\t\t\tif (!this._containsColumnWithId(key)) {\n\t\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\t`Attempted to insert row a cell under column ID \"${key}\", but the table does not contain a column with that ID.`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// #endregion\n\n\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.rows.insertAtEnd(TreeArrayNode.spread(rows) as any);\n\t\t\t\t} else {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.rows.insertAt(index, TreeArrayNode.spread(rows) as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input nodes into the tree hydrates them, making them usable as nodes.\n\t\t\t\treturn rows as unknown as RowValueType[];\n\t\t\t}\n\n\t\t\tpublic setCell({\n\t\t\t\tkey,\n\t\t\t\tcell,\n\t\t\t}: TableSchema.SetCellParameters<TCellSchema, TColumnSchema, TRowSchema>): void {\n\t\t\t\tconst { column: columnOrId, row: rowOrId } = key;\n\n\t\t\t\tconst row = this._getRow(rowOrId);\n\t\t\t\tconst column = this._getColumn(columnOrId);\n\n\t\t\t\trow.setCell(column, cell);\n\t\t\t}\n\n\t\t\tpublic removeColumns(\n\t\t\t\tindexOrColumns: number | undefined | readonly string[] | readonly ColumnValueType[],\n\t\t\t\tcount: number | undefined = undefined,\n\t\t\t): ColumnValueType[] {\n\t\t\t\tif (typeof indexOrColumns === \"number\" || indexOrColumns === undefined) {\n\t\t\t\t\tlet removedColumns: ColumnValueType[] | undefined;\n\t\t\t\t\tconst startIndex = indexOrColumns ?? 0;\n\t\t\t\t\tconst _count = count ?? this.columns.length - startIndex;\n\n\t\t\t\t\t// If there are no columns to remove, do nothing\n\t\t\t\t\tif (_count === 0) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\tTable._assertValidRange({ index: startIndex, count: _count }, this.columns);\n\n\t\t\t\t\tthis._applyEditsInBatch(() => {\n\t\t\t\t\t\tconst columnsToRemove = this.columns.slice(\n\t\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\t\tstartIndex + _count,\n\t\t\t\t\t\t) as ColumnValueType[];\n\n\t\t\t\t\t\t// First, remove all cells that correspond to each column from each row:\n\t\t\t\t\t\tfor (const column of columnsToRemove) {\n\t\t\t\t\t\t\tthis._removeCells(column);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Second, remove the column nodes:\n\t\t\t\t\t\tTable._removeRange(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tindex: startIndex,\n\t\t\t\t\t\t\t\tcount: _count,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tthis.columns,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tremovedColumns = columnsToRemove;\n\t\t\t\t\t});\n\t\t\t\t\treturn removedColumns ?? fail(0xc1f /* Transaction did not complete. */);\n\t\t\t\t} else {\n\t\t\t\t\t// If there are no columns to remove, do nothing\n\t\t\t\t\tif (indexOrColumns.length === 0) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Resolve any IDs to actual nodes.\n\t\t\t\t\t// This validates that all of the rows exist before starting transaction.\n\t\t\t\t\t// This improves user-facing error experience.\n\t\t\t\t\tconst columnsToRemove: ColumnValueType[] = [];\n\t\t\t\t\tfor (const columnOrIdToRemove of indexOrColumns) {\n\t\t\t\t\t\tcolumnsToRemove.push(this._getColumn(columnOrIdToRemove));\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._applyEditsInBatch(() => {\n\t\t\t\t\t\t// Note, throwing an error within a transaction will abort the entire transaction.\n\t\t\t\t\t\t// So if we throw an error here for any column, no columns will be removed.\n\t\t\t\t\t\tfor (const columnToRemove of columnsToRemove) {\n\t\t\t\t\t\t\t// Remove the corresponding cell from all rows.\n\t\t\t\t\t\t\tfor (const row of this.rows) {\n\t\t\t\t\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the cast.\n\t\t\t\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\t\t\t\t(row as RowValueType).removeCell(columnToRemove);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// We have already validated that all of the columns exist above, so this is safe.\n\t\t\t\t\t\t\tthis.columns.removeAt(this.columns.indexOf(columnToRemove));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn columnsToRemove;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic removeRows(\n\t\t\t\tindexOrRows: number | undefined | readonly string[] | readonly RowValueType[],\n\t\t\t\tcount?: number | undefined,\n\t\t\t): RowValueType[] {\n\t\t\t\tif (typeof indexOrRows === \"number\" || indexOrRows === undefined) {\n\t\t\t\t\tconst startIndex = indexOrRows ?? 0;\n\t\t\t\t\tconst _count = count ?? this.columns.length - startIndex;\n\n\t\t\t\t\t// If there are no rows to remove, do nothing\n\t\t\t\t\tif (_count === 0) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Table._removeRange(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tindex: startIndex,\n\t\t\t\t\t\t\tcount: _count,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tthis.rows,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// If there are no rows to remove, do nothing\n\t\t\t\tif (indexOrRows.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\t// Resolve any IDs to actual nodes.\n\t\t\t\t// This validates that all of the rows exist before starting transaction.\n\t\t\t\t// This improves user-facing error experience.\n\t\t\t\tconst rowsToRemove: RowValueType[] = [];\n\t\t\t\tfor (const rowToRemove of indexOrRows) {\n\t\t\t\t\trowsToRemove.push(this._getRow(rowToRemove));\n\t\t\t\t}\n\n\t\t\t\tthis._applyEditsInBatch(() => {\n\t\t\t\t\t// Note, throwing an error within a transaction will abort the entire transaction.\n\t\t\t\t\t// So if we throw an error here for any row, no rows will be removed.\n\t\t\t\t\tfor (const rowToRemove of rowsToRemove) {\n\t\t\t\t\t\t// We have already validated that all of the rows exist above, so this is safe.\n\t\t\t\t\t\tconst index = this.rows.indexOf(rowToRemove);\n\t\t\t\t\t\tthis.rows.removeAt(index);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn rowsToRemove;\n\t\t\t}\n\n\t\t\tpublic removeCell(\n\t\t\t\tkey: TableSchema.CellKey<TColumnSchema, TRowSchema>,\n\t\t\t): CellValueType | undefined {\n\t\t\t\tconst { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;\n\t\t\t\tconst row = this._getRow(rowOrIdOrIndex);\n\t\t\t\tconst column = this._getColumn(columnOrIdOrIndex);\n\n\t\t\t\tconst cell: CellValueType | undefined = row.getCell(column.id);\n\t\t\t\tif (cell === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\trow.removeCell(column.id);\n\t\t\t\treturn cell;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Removes the cell corresponding with the specified column from each row in the table.\n\t\t\t */\n\t\t\tprivate _removeCells(column: ColumnValueType): void {\n\t\t\t\tfor (const row of this.rows) {\n\t\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\t(row as RowValueType).removeCell(column);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprivate static _assertValidRange<T>(\n\t\t\t\trange: { index: number; count: number },\n\t\t\t\tarray: readonly T[],\n\t\t\t): void {\n\t\t\t\tconst { index, count } = range;\n\t\t\t\tif (index < 0 || index >= array.length) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Start index out of bounds. Expected index to be on [0, ${array.length - 1}], but got ${index}.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (count < 0) {\n\t\t\t\t\tthrow new UsageError(`Expected non-negative count. Got ${count}.`);\n\t\t\t\t}\n\n\t\t\t\tconst end = index + count; // exclusive\n\t\t\t\tif (end > array.length) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`End index out of bounds. Expected end to be on [${index}, ${array.length}], but got ${end}.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Applies the provided edits in a \"batch\".\n\t\t\t *\n\t\t\t * @remarks\n\t\t\t * For hydrated trees, this will be done in a transaction to ensure atomicity.\n\t\t\t *\n\t\t\t * Transactions are not supported for unhydrated trees, so we cannot run a transaction in that case.\n\t\t\t * But since there are no collaborators, this is not an issue.\n\t\t\t */\n\t\t\tprivate _applyEditsInBatch(applyEdits: () => void): void {\n\t\t\t\tconst branch = TreeAlpha.branch(this);\n\n\t\t\t\t// Ensure events are paused until all of the edits are applied.\n\t\t\t\t// This ensures that the user sees the corresponding table-level edit as atomic,\n\t\t\t\t// and ensures they are not spammed with intermediate events.\n\t\t\t\twithBufferedTreeEvents(() => {\n\t\t\t\t\tif (branch === undefined) {\n\t\t\t\t\t\t// If this node does not have a corresponding branch, then it is unhydrated.\n\t\t\t\t\t\t// I.e., it is not part of a collaborative session yet.\n\t\t\t\t\t\t// Therefore, we don't need to run the edits as a transaction.\n\t\t\t\t\t\tapplyEdits();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbranch.runTransaction(() => {\n\t\t\t\t\t\t\tapplyEdits();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Column node or ID to a Column node in the table.\n\t\t\t * Returns `undefined` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\tprivate _tryGetColumn(\n\t\t\t\tcolumnOrIdOrIndex: ColumnValueType | string | number,\n\t\t\t): ColumnValueType | undefined {\n\t\t\t\tif (typeof columnOrIdOrIndex === \"number\") {\n\t\t\t\t\tif (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.columns.length) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.columns[columnOrIdOrIndex] as ColumnValueType;\n\t\t\t\t}\n\n\t\t\t\tif (typeof columnOrIdOrIndex === \"string\") {\n\t\t\t\t\tconst columnId = columnOrIdOrIndex;\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.columns.find((col) => (col as ColumnValueType).id === columnId) as\n\t\t\t\t\t\t| ColumnValueType\n\t\t\t\t\t\t| undefined;\n\t\t\t\t}\n\n\t\t\t\t// If the user provided a node, ensure it actually exists in this table.\n\t\t\t\tif (!this.columns.includes(columnOrIdOrIndex)) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn columnOrIdOrIndex;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Column node or ID to a Column node in the table.\n\t\t\t * @throws Throws a `UsageError` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\tprivate _getColumn(\n\t\t\t\tcolumnOrIdOrIndex: ColumnValueType | string | number,\n\t\t\t): ColumnValueType {\n\t\t\t\tconst column = this._tryGetColumn(columnOrIdOrIndex);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\tTable._throwMissingColumnError(columnOrIdOrIndex);\n\t\t\t\t}\n\t\t\t\treturn column;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Checks if a Column with the specified ID exists in the table.\n\t\t\t */\n\t\t\tprivate _containsColumnWithId(columnId: string): boolean {\n\t\t\t\treturn this._tryGetColumn(columnId) !== undefined;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Throw a `UsageError` for a missing Column by its ID or index.\n\t\t\t */\n\t\t\tprivate static _throwMissingColumnError(\n\t\t\t\tcolumnOrIdOrIndex: ColumnValueType | string | number,\n\t\t\t): never {\n\t\t\t\tif (typeof columnOrIdOrIndex === \"number\") {\n\t\t\t\t\tthrow new UsageError(`No column exists at index ${columnOrIdOrIndex}.`);\n\t\t\t\t}\n\n\t\t\t\tif (typeof columnOrIdOrIndex === \"string\") {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`No column with ID \"${columnOrIdOrIndex}\" exists in the table.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`The specified column node with ID \"${columnOrIdOrIndex.id}\" does not exist in the table.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Row node or ID to a Row node in the table.\n\t\t\t * Returns `undefined` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\tprivate _tryGetRow(\n\t\t\t\trowOrIdOrIndex: RowValueType | string | number,\n\t\t\t): RowValueType | undefined {\n\t\t\t\tif (typeof rowOrIdOrIndex === \"number\") {\n\t\t\t\t\tif (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.rows.length) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.rows[rowOrIdOrIndex] as RowValueType;\n\t\t\t\t}\n\n\t\t\t\tif (typeof rowOrIdOrIndex === \"string\") {\n\t\t\t\t\tconst rowId = rowOrIdOrIndex;\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.rows.find((row) => (row as RowValueType).id === rowId) as\n\t\t\t\t\t\t| RowValueType\n\t\t\t\t\t\t| undefined;\n\t\t\t\t}\n\n\t\t\t\t// If the user provided a node, ensure it actually exists in this table.\n\t\t\t\tif (!this.rows.includes(rowOrIdOrIndex)) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn rowOrIdOrIndex;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Row node, ID, or index to a Row node in the table.\n\t\t\t * @throws Throws a `UsageError` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\tprivate _getRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType {\n\t\t\t\tconst row = this._tryGetRow(rowOrIdOrIndex);\n\t\t\t\tif (row === undefined) {\n\t\t\t\t\tTable._throwMissingRowError(rowOrIdOrIndex);\n\t\t\t\t}\n\t\t\t\treturn row;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Throw a `UsageError` for a missing Row by its ID or index.\n\t\t\t */\n\t\t\tprivate static _throwMissingRowError(\n\t\t\t\trowOrIdOrIndex: RowValueType | string | number,\n\t\t\t): never {\n\t\t\t\tif (typeof rowOrIdOrIndex === \"number\") {\n\t\t\t\t\tthrow new UsageError(`No row exists at index ${rowOrIdOrIndex}.`);\n\t\t\t\t}\n\n\t\t\t\tif (typeof rowOrIdOrIndex === \"string\") {\n\t\t\t\t\tthrow new UsageError(`No row with ID \"${rowOrIdOrIndex}\" exists in the table.`);\n\t\t\t\t}\n\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`The specified row node with ID \"${rowOrIdOrIndex.id}\" does not exist in the table.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tprivate static _removeRange<TNodeSchema extends ImplicitAllowedTypes>(\n\t\t\t\trange: { index: number; count: number },\n\t\t\t\tarray: TreeArrayNode<TNodeSchema>,\n\t\t\t): TreeNodeFromImplicitAllowedTypes<TNodeSchema>[] {\n\t\t\t\tTable._assertValidRange(range, array);\n\n\t\t\t\tconst { index, count } = range;\n\t\t\t\tconst end = index + count; // exclusive\n\n\t\t\t\t// TypeScript is unable to narrow the array element type correctly here, hence the cast.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tconst removedRows = array.slice(\n\t\t\t\t\tindex,\n\t\t\t\t\tend,\n\t\t\t\t) as TreeNodeFromImplicitAllowedTypes<TNodeSchema>[];\n\t\t\t\tarray.removeRange(index, end);\n\n\t\t\t\treturn removedRows;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Ensure that the specified index is a valid location for item insertion in the destination list.\n\t\t\t * @throws Throws a usage error if the destination is invalid.\n\t\t\t */\n\t\t\tprivate static validateInsertionIndex(\n\t\t\t\tindex: number,\n\t\t\t\tdestinationList: readonly unknown[],\n\t\t\t): void {\n\t\t\t\tif (index < 0) {\n\t\t\t\t\tthrow new UsageError(\"The index must be greater than or equal to 0.\");\n\t\t\t\t}\n\n\t\t\t\tif (index > destinationList.length) {\n\t\t\t\t\tthrow new UsageError(\"The index specified for insertion is out of bounds.\");\n\t\t\t\t}\n\n\t\t\t\tif (!Number.isInteger(index)) {\n\t\t\t\t\tthrow new UsageError(\"The index must be an integer.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Set a private symbol on the schema class that marks it as having been generated by this factory.\n\t\t// Column / Row functionality use this to validate that they are being used in a table.\n\t\t// This is effectively a work-around that allows columns and rows to invoke table methods\n\t\t// without having to pass the table as a parameter to their construction, which isn't possible.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t(Table as any)[tableSchemaSymbol] = true;\n\n\t\ttype TableValueType = TreeNode &\n\t\t\tTableSchema.Table<TInputScope, TCellSchema, TColumnSchema, TRowSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Table\">>;\n\t\ttype TableInsertableType = InsertableObjectFromSchemaRecord<typeof tableFields>;\n\t\ttype TableConstructorType = new (data: TableInsertableType) => TableValueType;\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst TableSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Table\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ TableValueType,\n\t\t\t/* TInsertable */ object & TableInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof tableFields\n\t\t> & {\n\t\t\t/**\n\t\t\t * Create an empty table.\n\t\t\t */\n\t\t\tempty<TThis extends TableConstructorType>(this: TThis): InstanceType<TThis>;\n\t\t} = Table;\n\n\t\t// Return the table schema\n\t\treturn TableSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @alpha\n\t */\n\texport type TableSchemaBase<\n\t\tTScope extends string | undefined,\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ColumnSchemaBase<TScope, TCell>,\n\t\tTRow extends RowSchemaBase<TScope, TCell>,\n\t> = ReturnType<typeof createTableSchema<TScope, TCell, TColumn, TRow>>;\n\n\t// #endregion\n}\n\n/**\n * Contains types and factories for creating schema to represent dynamic tabular data.\n *\n * @remarks\n *\n * WARNING: These APIs are in preview and are subject to change.\n * Until these APIs have stabilized, it is not recommended to use them in production code.\n * There may be breaking changes to these APIs and their underlying data format.\n * Using these APIs in production code may result in data loss or corruption.\n *\n * The primary APIs for create tabular data schema are:\n *\n * - {@link TableSchema.(table:1)}\n *\n * - {@link TableSchema.(column:1)}\n *\n * - {@link TableSchema.(row:1)}\n *\n * Tables created using these APIs are...\n *\n * - sparse, meaning that cells may be omitted, and new rows are empty by default.\n *\n * - dynamic, meaning that their structure can be modified at runtime.\n * Columns and rows can be inserted, removed, modified, and reordered.\n * Cells can be inserted, removed, and modified.\n *\n * - row-major, meaning that operating on rows (including inserts, removal, moves, and traversal) is more efficient than operating on columns.\n *\n * Column and Row schema created using these APIs are extensible via the `props` field.\n * This allows association of additional properties with column and row nodes.\n *\n * Cells in the table may become \"orphaned.\"\n * That is, it is possible to enter a state where one or more rows contain cells with no corresponding column.\n * To reduce the likelihood of this, you can manually remove corresponding cells when removing columns.\n * Either way, it is possible to enter such a state via the merging of edits.\n * For example: one client might add a row while another concurrently removes a column, orphaning the cell where the column and row intersected.\n *\n * @example Defining a Table schema\n *\n * ```typescript\n * class MyTable extends TableSchema.table({\n * \tschemaFactory,\n * \tcell: schemaFactory.string,\n * }) {}\n *\n * const table = new MyTable({\n * \tcolumns: [{ id: \"column-0\" }],\n * \trows: [{ id: \"row-0\", cells: { \"column-0\": \"Hello world!\" } }],\n * });\n * ```\n *\n * @example Customizing Column and Row schema\n *\n * ```typescript\n * const Cell = schemaFactory.string;\n *\n * class MyColumn extends TableSchema.column({\n * \tschemaFactory,\n * \tcell: Cell,\n * \tprops: schemaFactory.object(\"TableColumnProps\", {\n * \t\tlabel: schemaFactory.string,\n * \t}),\n * }) {}\n *\n * class MyRow extends TableSchema.row({\n * \tschemaFactory,\n * \tcell: Cell,\n * }) {}\n *\n * class MyTable extends TableSchema.table({\n * \tschemaFactory,\n * \tcell: Cell,\n * \tcolumn: MyColumn,\n * \trow: MyRow,\n * }) {}\n *\n * const table = new MyTable({\n * \tcolumns: [\n * \t\tnew MyColumn({ props: { label: \"Entry\" } }),\n * \t\tnew MyColumn({ props: { label: \"Date\" } }),\n * \t\tnew MyColumn({ props: { label: \"Amount\" } }),\n * \t],\n * \trows: [],\n * });\n * ```\n *\n * @example Listening for changes in the table\n *\n * ```typescript\n * // Listen for any changes to the table and its children.\n * // The \"treeChanged\" event will fire when the associated node or any of its descendants change.\n * Tree.on(table, \"treeChanged\", () => {\n * \t// Respond to the change.\n * });\n * ```\n *\n * @example Listening for changes to the rows list only\n *\n * ```typescript\n * // Listen for any changes to the list of rows.\n * // The \"nodeChanged\" event will fire only when the specified node itself changes (i.e., its own properties change).\n * // In this case, the event will fire when a row is added or removed, or the order of the list is changed.\n * // But it won't fire when a row's properties change, or when the row's cells change, etc.\n * Tree.on(table.rows, \"nodeChanged\", () => {\n * \t// Respond to the change.\n * });\n * ```\n *\n * @privateRemarks\n * The above examples are backed by tests in `tableSchema.spec.ts`.\n * Those tests and these examples should be kept in-sync to ensure that the examples are correct.\n *\n * @alpha\n */\nexport namespace TableSchema {\n\t// #region Column\n\n\t/**\n\t * A column in a table.\n\t * @remarks Implemented by the schema class returned from {@link TableSchema.(column:2)}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the column.\n\t * @sealed @alpha\n\t */\n\texport interface Column<\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTProps extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> {\n\t\t/**\n\t\t * The unique identifier of the column.\n\t\t * @remarks Uniquely identifies the node within the entire tree, not just the table.\n\t\t */\n\t\treadonly id: string;\n\n\t\t/**\n\t\t * The column's properties.\n\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t * @privateRemarks\n\t\t * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createColumnSchema}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<TProps>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<TProps>);\n\n\t\t/**\n\t\t * Gets all of the populated cells in the column, keyed by their associated row IDs.\n\t\t * @throws Throws an error if the column is not in a table.\n\t\t */\n\t\tgetCells(): readonly {\n\t\t\trowId: string;\n\t\t\tcell: TreeNodeFromImplicitAllowedTypes<TCell>;\n\t\t}[];\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @alpha\n\t */\n\texport function column<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tparams: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryBeta<TScope>, TCell>,\n\t): System_TableSchema.ColumnSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>;\n\t/**\n\t * Factory for creating new table column schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the column.\n\t * @alpha\n\t */\n\texport function column<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TProps extends ImplicitFieldSchema,\n\t>(\n\t\tparams: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\t/**\n\t\t\t * Optional column properties.\n\t\t\t */\n\t\t\treadonly props: TProps;\n\t\t},\n\t): System_TableSchema.ColumnSchemaBase<TScope, TCell, TProps>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function column({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops = SchemaFactory.optional(SchemaFactory.null),\n\t}: System_TableSchema.CreateColumnOptionsBase & {\n\t\treadonly props?: ImplicitFieldSchema;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createColumnSchema(schemaFactory, cell, props);\n\t}\n\n\t// #endregion\n\n\t// #region Row\n\n\t/**\n\t * A row in a table.\n\t * @remarks Implemented by the schema class returned from {@link TableSchema.(row:2)}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the row.\n\t * @sealed @alpha\n\t */\n\texport interface Row<\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTProps extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> {\n\t\t/**\n\t\t * The unique identifier of the row.\n\t\t * @remarks Uniquely identifies the node within the entire tree, not just the table.\n\t\t */\n\t\treadonly id: string;\n\n\t\t/**\n\t\t * Gets the cell in the specified column.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t * @privateRemarks TODO: throw if the column does not belong to the same table as the row.\n\t\t */\n\t\tgetCell(column: Column<TCell>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\t\t/**\n\t\t * Gets the cell in the specified column, denoted by column ID.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t */\n\t\tgetCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * Gets all of the populated cells in the row, keyed by their associated column IDs.\n\t\t */\n\t\tgetCells(): readonly {\n\t\t\tcolumnId: string;\n\t\t\tcell: TreeNodeFromImplicitAllowedTypes<TCell>;\n\t\t}[];\n\n\t\t/**\n\t\t * Sets the cell in the specified column.\n\t\t * @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:1)} instead.\n\t\t * @privateRemarks TODO: Throw an error if the column does not exist in the table.\n\t\t */\n\t\tsetCell(\n\t\t\tcolumn: Column<TCell>,\n\t\t\tvalue: InsertableTreeNodeFromImplicitAllowedTypes<TCell>,\n\t\t): void;\n\t\t/**\n\t\t * Sets the cell in the specified column, denoted by column ID.\n\t\t * @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:2)} instead.\n\t\t */\n\t\tsetCell(columnId: string, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;\n\n\t\t/**\n\t\t * Removes the cell in the specified column.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t * @privateRemarks TODO: Throw if the column does not belong to the same table as the row.\n\t\t */\n\t\tremoveCell(column: Column<TCell>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\t\t/**\n\t\t * Removes the cell in the specified column, denoted by column ID.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t */\n\t\tremoveCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * The row's properties.\n\t\t * @remarks This is a user-defined schema that can be used to store additional information about the row.\n\t\t * @privateRemarks\n\t\t * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createRowSchema}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<TProps>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<TProps>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @alpha\n\t */\n\texport function row<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tparams: System_TableSchema.CreateRowOptionsBase<SchemaFactoryBeta<TScope>, TCell>,\n\t): System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>;\n\t/**\n\t * Factory for creating new table row schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the row.\n\t * @alpha\n\t */\n\texport function row<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TProps extends ImplicitFieldSchema,\n\t>(\n\t\tparams: System_TableSchema.CreateRowOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\t/**\n\t\t\t * Optional row properties.\n\t\t\t */\n\t\t\treadonly props: TProps;\n\t\t},\n\t): System_TableSchema.RowSchemaBase<TScope, TCell, TProps>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function row({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops = SchemaFactory.optional(SchemaFactory.null),\n\t}: System_TableSchema.CreateRowOptionsBase & {\n\t\treadonly props?: ImplicitFieldSchema;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createRowSchema(schemaFactory, cell, props);\n\t}\n\n\t// #endregion\n\n\t// #region Table\n\n\t/**\n\t * A key to uniquely identify a cell within a table.\n\t * @alpha\n\t */\n\texport interface CellKey<\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * {@link TableSchema.Column}, {@link TableSchema.Column.id}, or column index at which the cell is located.\n\t\t */\n\t\treadonly column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>;\n\n\t\t/**\n\t\t * {@link TableSchema.Row}, {@link TableSchema.Row.id}, or row index at which the cell is located.\n\t\t */\n\t\treadonly row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>;\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertColumns} parameters.\n\t * @alpha\n\t */\n\texport interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new columns.\n\t\t * @remarks If not provided, the columns will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The columns to insert.\n\t\t */\n\t\treadonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertRows} parameters.\n\t * @alpha\n\t */\n\texport interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new rows.\n\t\t * @remarks If not provided, the rows will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The rows to insert.\n\t\t */\n\t\treadonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.setCell} parameters.\n\t * @alpha\n\t */\n\texport interface SetCellParameters<\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * The key to uniquely identify a cell in a table.\n\t\t */\n\t\treadonly key: CellKey<TColumn, TRow>;\n\n\t\t/**\n\t\t * The cell to set.\n\t\t */\n\t\treadonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;\n\t}\n\n\t/**\n\t * A table.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TColumn - The type of the columns in the table.\n\t * @typeParam TRow - The type of the rows in the table.\n\t * @sealed @alpha\n\t */\n\texport interface Table<\n\t\tTScope extends string | undefined,\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>,\n\t\tTRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,\n\t> {\n\t\t/**\n\t\t * The table's columns.\n\t\t */\n\t\treadonly columns: TreeArrayNode<TColumn>;\n\n\t\t/**\n\t\t * The table's rows.\n\t\t */\n\t\treadonly rows: TreeArrayNode<TRow>;\n\n\t\t/**\n\t\t * Gets a table column by its {@link TableSchema.Column.id}.\n\t\t * @returns The column, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;\n\t\t/**\n\t\t * Gets a table column by its index in the table.\n\t\t * @returns The column, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetColumn(index: number): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;\n\n\t\t/**\n\t\t * Gets a table row by its {@link TableSchema.Row.id}.\n\t\t * @returns The row, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;\n\t\t/**\n\t\t * Gets a table row by its index in the table.\n\t\t * @returns The row, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;\n\n\t\t/**\n\t\t * Gets a cell in the table by corresponding column and row.\n\t\t * @param key - A key that uniquely distinguishes a cell in the table, represented as a combination of the column ID and row ID.\n\t\t * @returns The cell, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * Inserts 0 or more columns into the table.\n\t\t *\n\t\t * @throws Throws an error if the specified index is out of range.\n\t\t *\n\t\t * No columns are inserted in this case.\n\t\t */\n\t\tinsertColumns(\n\t\t\tparams: InsertColumnsParameters<TColumn>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\n\t\t/**\n\t\t * Inserts 0 or more rows into the table.\n\t\t *\n\t\t * @throws\n\t\t * Throws an error in the following cases:\n\t\t *\n\t\t * - The row contains cells, but the table does not contain matching columns for one or more of those cells.\n\t\t *\n\t\t * - The specified index is out of range.\n\t\t *\n\t\t * No rows are inserted in these cases.\n\t\t */\n\t\tinsertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\n\t\t/**\n\t\t * Sets the cell at the specified location in the table.\n\t\t * @remarks To remove a cell, call {@link TableSchema.Table.removeCell} instead.\n\t\t */\n\t\tsetCell(params: SetCellParameters<TCell, TColumn, TRow>): void;\n\n\t\t/**\n\t\t * Removes a range of columns from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Also removes any corresponding cells from the table's rows.\n\t\t *\n\t\t * Note: this operation can be slow for tables with many rows.\n\t\t * We are actively working on improving the performance of this operation, but for now it may have a negative\n\t\t * impact on performance.\n\t\t * @param index - The starting index of the range to remove. Default: `0`.\n\t\t * @param count - The number of columns to remove. Default: all remaining columns starting from `index`.\n\t\t * @throws Throws an error if the specified range is invalid. In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(\n\t\t\tindex?: number | undefined,\n\t\t\tcount?: number | undefined,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t\t/**\n\t\t * Removes 0 or more columns from the table.\n\t\t * @remarks\n\t\t * Also removes any corresponding cells from the table's rows.\n\t\t *\n\t\t * Note: this operation can be slow for tables with many rows.\n\t\t * We are actively working on improving the performance of this operation, but for now it may have a negative\n\t\t * impact on performance.\n\t\t *\n\t\t * @param columns - The columns to remove.\n\t\t * @throws Throws an error if any of the columns are not in the table.\n\t\t * In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(\n\t\t\tcolumns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[],\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t\t/**\n\t\t * Removes 0 or more columns from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Also removes any corresponding cells from the table's rows.\n\t\t *\n\t\t * Note: this operation can be slow for tables with many rows.\n\t\t * We are actively working on improving the performance of this operation, but for now it may have a negative\n\t\t * impact on performance.\n\t\t *\n\t\t * @param columns - The columns to remove, specified by their {@link TableSchema.Column.id}.\n\t\t * @throws Throws an error if any of the columns are not in the table.\n\t\t * In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(columns: readonly string[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\n\t\t/**\n\t\t * Removes a range of rows from the table.\n\t\t * @param index - The starting index of the range to remove. Default: `0`.\n\t\t * @param count - The number of rows to remove. Default: all remaining rows starting from `index`.\n\t\t * @throws Throws an error if the specified range is invalid. In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(\n\t\t\tindex?: number | undefined,\n\t\t\tcount?: number | undefined,\n\t\t): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\t\t/**\n\t\t * Removes 0 or more rows from the table.\n\t\t * @param rows - The rows to remove.\n\t\t * @throws Throws an error if any of the rows are not in the table.\n\t\t * In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(\n\t\t\trows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[],\n\t\t): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\t\t/**\n\t\t * Removes 0 or more rows from the table.\n\t\t * @param rows - The rows to remove, specified by their {@link TableSchema.Row.id}.\n\t\t * @throws Throws an error if any of the rows are not in the table.\n\t\t * In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\n\t\t/**\n\t\t * Removes the cell at the specified location in the table.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t * @throws Throws an error if the location does not exist in the table.\n\t\t */\n\t\tremoveCell(\n\t\t\tkey: CellKey<TColumn, TRow>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\t}\n\n\t/**\n\t * Factory for creating new table schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell>,\n\t): System_TableSchema.TableSchemaBase<\n\t\tTScope,\n\t\tTCell,\n\t\tSystem_TableSchema.ColumnSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>,\n\t\tSystem_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>\n\t>;\n\t/**\n\t * Factory for creating new table schema with custom column schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TColumn - The type of the columns in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\treadonly column: TColumn;\n\t\t},\n\t): System_TableSchema.TableSchemaBase<\n\t\tTScope,\n\t\tTCell,\n\t\tTColumn,\n\t\tSystem_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>\n\t>;\n\t/**\n\t * Factory for creating new table schema with custom row schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TRow - The type of the rows in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\treadonly row: TRow;\n\t\t},\n\t): System_TableSchema.TableSchemaBase<\n\t\tTScope,\n\t\tTCell,\n\t\tSystem_TableSchema.ColumnSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>,\n\t\tTRow\n\t>;\n\t/**\n\t * Factory for creating new table schema with custom column and row schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TColumn - The type of the columns in the table.\n\t * @typeParam TRow - The type of the rows in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>,\n\t\tconst TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\treadonly column: TColumn;\n\t\t\treadonly row: TRow;\n\t\t},\n\t): System_TableSchema.TableSchemaBase<TScope, TCell, TColumn, TRow>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function table({\n\t\tschemaFactory,\n\t\tcell: cellSchema,\n\t\tcolumn: columnSchema = column({\n\t\t\tschemaFactory,\n\t\t\tcell: cellSchema,\n\t\t}),\n\t\trow: rowSchema = row({\n\t\t\tschemaFactory,\n\t\t\tcell: cellSchema,\n\t\t}),\n\t}: System_TableSchema.TableFactoryOptionsBase & {\n\t\treadonly column?: System_TableSchema.ColumnSchemaBase;\n\t\treadonly row?: System_TableSchema.RowSchemaBase;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createTableSchema(\n\t\t\tschemaFactory,\n\t\t\tcellSchema,\n\t\t\tcolumnSchema,\n\t\t\trowSchema,\n\t\t);\n\t}\n\n\t// #endregion\n}\n"]}
1
+ {"version":3,"file":"tableSchema.js","sourceRoot":"","sources":["../src/tableSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAQN,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,kBAAkB,CAAC,iBAAiB,CAC1C,aAAa,EACb,UAAU,EACV,YAAY,EACZ,SAAS,CACT,CAAC;IACH,CAAC;IArBe,iBAAK,QAqBpB,CAAA;IAED,aAAa;AACd,CAAC,EAzfgB,WAAW,KAAX,WAAW,QAyf3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { TreeAlpha } from \"./shared-tree/index.js\";\nimport {\n\ttype FieldHasDefault,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeKind,\n\ttype SchemaFactoryBeta,\n\ttype ScopedSchemaName,\n\tTreeArrayNode,\n\ttype TreeNode,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaClass,\n\ttype WithType,\n\ttype TreeFieldFromImplicitField,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InternalTreeNode,\n\tSchemaFactory,\n\ttype ImplicitFieldSchema,\n\twithBufferedTreeEvents,\n\ttype TreeRecordNode,\n} from \"./simple-tree/index.js\";\nimport { validateIndex, validateIndexRange } from \"./util/index.js\";\n\n// Future improvement TODOs:\n// - Omit `cells` property from Row insertion type.\n// - Record-like type parameters / input parameters?\n// - Omit `props` properties from Row and Column schemas when not provided?\n\n// Longer-term work:\n// - Add constraint APIs to make it possible to avoid situations that could yield \"orphaned\" cells.\n\n/**\n * The sub-scope applied to user-provided {@link SchemaFactory}s by table schema factories.\n */\nconst tableSchemaFactorySubScope = \"table\";\n\n/**\n * A private symbol put on table schema to help identify them.\n */\nconst tableSchemaSymbol: unique symbol = Symbol(\"tableNode\");\n\n/**\n * A row in a table.\n * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n * @typeParam TProps - Additional properties to associate with the row.\n * @privateRemarks Private counterpart to the {@link TableSchema.Row}.\n * Exposes internal properties needed for table operations (publicly exposed via {@link TableSchema.Table}).\n * @sealed\n */\nexport interface RowPrivate<\n\tTCell extends ImplicitAllowedTypes,\n\tTProps extends ImplicitFieldSchema = ImplicitFieldSchema,\n> extends TableSchema.Row<TCell, TProps> {\n\t/**\n\t * The row's cells.\n\t * @remarks This is a user-defined schema that can be used to store additional information about the row.\n\t * @privateRemarks\n\t * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createRowSchema}.\n\t * If you update the docs here, please also update the inline type definitions.\n\t */\n\treadonly cells: TreeRecordNode<TCell>;\n}\n\n/**\n * Not intended for use outside of this package.\n *\n * @privateRemarks\n * This namespace is a collection of internal system types relate to {@link TableSchema}.\n * This namespace should be strictly type-exported by the package.\n * All members should be tagged with `@system`.\n *\n * @system @alpha\n */\nexport namespace System_TableSchema {\n\t/**\n\t * Default type used for column and row \"props\" fields.\n\t * @privateRemarks\n\t * Longer term, it would be better to simply omit \"props\" altogether by default.\n\t * For now, this ensures that the user doesn't have to specify a \"props\" entry when initializing column/row nodes\n\t * and ensures that they cannot set anything that might conflict with future evolutions of the schema.\n\t * @system @alpha\n\t */\n\texport type DefaultPropsType = ReturnType<typeof SchemaFactory.optional<[]>>;\n\n\t/**\n\t * A base interface for factory input options which include an schema factory.\n\t * @remarks This interface should not be referenced directly.\n\t * @privateRemarks This interface primarily exists to provide a single home for property documentation.\n\t * @system @alpha\n\t */\n\texport interface OptionsWithSchemaFactory<TSchemaFactory extends SchemaFactoryBeta> {\n\t\t/**\n\t\t * Schema factory with which the Column schema will be associated.\n\t\t * @remarks Can be used to associate the resulting schema with an existing {@link SchemaFactory.scope|scope}.\n\t\t */\n\t\treadonly schemaFactory: TSchemaFactory;\n\t}\n\n\t/**\n\t * A base interface for factory input options which include the table cell schema.\n\t * @remarks This interface should not be referenced directly.\n\t * @privateRemarks This interface primarily exists to provide a single home for property documentation.\n\t * @system @alpha\n\t */\n\texport interface OptionsWithCellSchema<TCellSchema extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * Schema for the table's cells.\n\t\t */\n\t\treadonly cell: TCellSchema;\n\t}\n\n\t// #region Column\n\n\t/**\n\t * Base options for creating table cow schema.\n\t * @remarks Includes parameters common to all column factory overloads.\n\t * @system @alpha\n\t */\n\texport type CreateColumnOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryBeta = SchemaFactoryBeta,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating column schema.\n\t * @system @alpha\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createColumnSchema<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TPropsSchema extends ImplicitFieldSchema,\n\t>(inputSchemaFactory: SchemaFactoryBeta<TInputScope>, propsSchema: TPropsSchema) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\t// Note: `columnFields` is broken into two parts to work around a TypeScript bug\n\t\t// that results in broken `.d.ts` output.\n\t\t// See definition of `ColumnInsertableType` below.\n\t\tconst columnFieldsBuiltInParts = {\n\t\t\tid: schemaFactory.identifier,\n\t\t} as const;\n\t\tconst columnFieldsPropsPart = {\n\t\t\tprops: propsSchema,\n\t\t} as const;\n\n\t\t/**\n\t\t * {@link Column} fields.\n\t\t *\n\t\t * @remarks\n\t\t * Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t *\n\t\t * Note: ideally we would add a satisfies clause here to ensure that this satisfies\n\t\t * `Record<string, ImplicitFieldSchema>`, but doing so causes TypeScript to prematurely and incorrectly evaluate the type of `propsSchema`.\n\t\t * Likely related to the following issue: https://github.com/microsoft/TypeScript/issues/52394\n\t\t */\n\t\tconst columnFields = {\n\t\t\t...columnFieldsBuiltInParts,\n\t\t\t...columnFieldsPropsPart,\n\t\t} as const; // satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * A column in a table.\n\t\t */\n\t\tclass Column\n\t\t\textends schemaFactory.object(\"Column\", columnFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements TableSchema.Column<TCellSchema, TPropsSchema> {}\n\n\t\ttype ColumnValueType = TreeNode &\n\t\t\tTableSchema.Column<TCellSchema, TPropsSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Column\">>;\n\n\t\t// Note: ideally this type would just leverage `InsertableObjectFromSchemaRecord<typeof columnFields>`,\n\t\t// but that results in broken `.d.ts` output due to a TypeScript bug.\n\t\t// See: https://github.com/microsoft/TypeScript/issues/58688.\n\t\t// Instead we extract and inline the typing of the \"props\" field here, which seems to sufficiently work around the issue.\n\t\t// type ColumnInsertableType = InsertableObjectFromSchemaRecord<typeof columnFields>;\n\t\ttype ColumnInsertableType = InsertableObjectFromSchemaRecord<\n\t\t\ttypeof columnFieldsBuiltInParts\n\t\t> &\n\t\t\t(FieldHasDefault<TPropsSchema> extends true\n\t\t\t\t? // Note: The docs on the below properties are copied from `IColumn.props`' docs to ensure that the\n\t\t\t\t\t// documentation appears in the data insertion scenario.\n\t\t\t\t\t// The contents are duplicated instead of using `@inheritdoc`, as intellisense does not correctly\n\t\t\t\t\t// support `@inheritDoc`.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/31267\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The column's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops?: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The column's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t});\n\n\t\t// Modified version of `Column` that ensures the constructor (and `createFromInsertable`) are\n\t\t// typed correctly in terms of our insertable type.\n\t\t// This lets us be selective in our type-cast for the value returned from this function,\n\t\t// preserving as much type-safety as we reasonably can.\n\t\ttype ColumnSchemaModifiedType = Omit<\n\t\t\t// Use mapped type to omit the constructor\n\t\t\t{\n\t\t\t\t[Property in keyof typeof Column]: (typeof Column)[Property];\n\t\t\t},\n\t\t\t\"createFromInsertable\"\n\t\t> &\n\t\t\t(new (\n\t\t\t\tparameters: InternalTreeNode | ColumnInsertableType,\n\t\t\t) => Column) & {\n\t\t\t\tcreateFromInsertable(parameters: ColumnInsertableType): Column;\n\t\t\t};\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst ColumnSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Column\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ ColumnValueType,\n\t\t\t/* TInsertable */ object & ColumnInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof columnFields\n\t\t> = Column as ColumnSchemaModifiedType;\n\n\t\treturn ColumnSchemaType;\n\t}\n\n\t/**\n\t * Base column schema type.\n\t * @sealed @system @alpha\n\t */\n\texport type ColumnSchemaBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> = ReturnType<typeof createColumnSchema<TScope, TCellSchema, TPropsSchema>>;\n\n\t// #endregion\n\n\t// #region Row\n\n\t/**\n\t * Base options for creating table row schema.\n\t * @remarks Includes parameters common to all row factory overloads.\n\t * @system @alpha\n\t */\n\texport type CreateRowOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryBeta = SchemaFactoryBeta,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating row schema.\n\t * @sealed @alpha\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createRowSchema<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TPropsSchema extends ImplicitFieldSchema,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryBeta<TInputScope>,\n\t\tcellSchema: TCellSchema,\n\t\tpropsSchema: TPropsSchema,\n\t) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\t// Note: `rowFields` is broken into two parts to work around a TypeScript bug\n\t\t// that results in broken `.d.ts` output.\n\t\t// See definition of `RowInsertableType` below.\n\t\tconst rowFieldsBuiltInParts = {\n\t\t\tid: schemaFactory.identifier,\n\t\t\t/**\n\t\t\t * The cells of the table row, keyed by column ID.\n\t\t\t * @remarks\n\t\t\t * The table row models its cells as a record, where each key is the ID of the column it belongs to. The choice of record (as opposed to a map) is intended to make interop with common table rendering libraries in TypeScript/JavaScript easier.\n\t\t\t */\n\t\t\tcells: schemaFactory.required(schemaFactory.record(\"Row.cells\", cellSchema), {\n\t\t\t\tmetadata: {\n\t\t\t\t\tdescription: \"The cells of the table row, keyed by column ID.\",\n\t\t\t\t},\n\t\t\t}),\n\t\t} as const;\n\t\tconst rowFieldsPropsPart = {\n\t\t\tprops: propsSchema,\n\t\t} as const;\n\n\t\t/**\n\t\t * {@link RowSchema} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t * Note: ideally we would add a satisfies clause here to ensure that this satisfies\n\t\t * `Record<string, ImplicitFieldSchema>`, but doing so causes TypeScript to prematurely and incorrectly evaluate the type of `propsSchema`.\n\t\t * Likely related to the following issue: https://github.com/microsoft/TypeScript/issues/52394\n\t\t */\n\t\tconst rowFields = {\n\t\t\t...rowFieldsBuiltInParts,\n\t\t\t...rowFieldsPropsPart,\n\t\t} as const; // satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * The Row schema - this is a map of Cells where the key is the column id\n\t\t */\n\t\tclass RowSchema\n\t\t\textends schemaFactory.object(\"Row\", rowFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements RowPrivate<TCellSchema, TPropsSchema> {}\n\n\t\ttype RowValueType = TreeNode &\n\t\t\tTableSchema.Row<TCellSchema, TPropsSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Row\">>;\n\n\t\t// Note: ideally this type would just leverage `InsertableObjectFromSchemaRecord<typeof rowFields>`,\n\t\t// but that results in broken `.d.ts` output due to a TypeScript bug.\n\t\t// See: https://github.com/microsoft/TypeScript/issues/58688.\n\t\t// Instead we extract and inline the typing of the \"props\" field here, which seems to sufficiently work around\n\t\t// the issue.\n\t\t// type RowInsertableType = InsertableObjectFromSchemaRecord<typeof rowFields>;\n\t\ttype RowInsertableType = InsertableObjectFromSchemaRecord<typeof rowFieldsBuiltInParts> &\n\t\t\t(FieldHasDefault<TPropsSchema> extends true\n\t\t\t\t? // Note: The docs on the below properties are copied from `IRow.props`' docs to ensure that the\n\t\t\t\t\t// documentation appears in the data insertion scenario.\n\t\t\t\t\t// The contents are duplicated instead of using `@inheritdoc`, as intellisense does not correctly\n\t\t\t\t\t// support `@inheritDoc`.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/31267\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The row's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information\n\t\t\t\t\t\t * about the row.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops?: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The row's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information\n\t\t\t\t\t\t * about the row.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops: InsertableTreeFieldFromImplicitField<TPropsSchema>;\n\t\t\t\t\t});\n\n\t\t// Modified version of `Row` that ensures the constructor (and `createFromInsertable`) are\n\t\t// typed correctly in terms of our insertable type.\n\t\t// This lets us be selective in our type-cast for the value returned from this function,\n\t\t// preserving as much type-safety as we reasonably can.\n\t\ttype RowSchemaModifiedType = Omit<\n\t\t\t// Use mapped type to omit the constructor\n\t\t\t{\n\t\t\t\t[Property in keyof typeof RowSchema]: (typeof RowSchema)[Property];\n\t\t\t},\n\t\t\t\"createFromInsertable\"\n\t\t> &\n\t\t\t(new (\n\t\t\t\tparameters: InternalTreeNode | RowInsertableType,\n\t\t\t) => RowSchema) & {\n\t\t\t\tcreateFromInsertable(parameters: RowInsertableType): RowSchema;\n\t\t\t};\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst RowSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Row\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ RowValueType,\n\t\t\t/* TInsertable */ object & RowInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof rowFields\n\t\t> = RowSchema as RowSchemaModifiedType;\n\n\t\treturn RowSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @alpha\n\t */\n\texport type RowSchemaBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> = ReturnType<typeof createRowSchema<TScope, TCellSchema, TPropsSchema>>;\n\n\t// #endregion\n\n\t// #region Table\n\n\t/**\n\t * Base options for creating table schema.\n\t * @remarks Includes parameters common to all table factory overloads.\n\t * @system @alpha\n\t */\n\texport type TableFactoryOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryBeta = SchemaFactoryBeta,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating table schema.\n\t * @system @alpha\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createTableSchema<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TColumnSchema extends ColumnSchemaBase<TInputScope, TCellSchema>,\n\t\tconst TRowSchema extends RowSchemaBase<TInputScope, TCellSchema>,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryBeta<TInputScope>,\n\t\t_cellSchema: TCellSchema,\n\t\tcolumnSchema: TColumnSchema,\n\t\trowSchema: TRowSchema,\n\t) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\ttype CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\t\ttype ColumnValueType = TreeNodeFromImplicitAllowedTypes<TColumnSchema>;\n\t\ttype RowValueType = TreeNodeFromImplicitAllowedTypes<TRowSchema>;\n\n\t\t// Internal version of RowValueType that exposes the `cells` property for use within Table methods.\n\t\ttype RowValueInternalType = RowValueType & RowPrivate<TCellSchema>;\n\n\t\t/**\n\t\t * {@link Table} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t */\n\t\tconst tableFields = {\n\t\t\trows: schemaFactory.array(\"Table.rows\", rowSchema),\n\t\t\tcolumns: schemaFactory.array(\"Table.columns\", columnSchema),\n\t\t} as const satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * The Table schema\n\t\t */\n\t\tclass Table\n\t\t\textends schemaFactory.object(\"Table\", tableFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements TableSchema.Table<TInputScope, TCellSchema, TColumnSchema, TRowSchema>\n\t\t{\n\t\t\tpublic static empty<TThis extends TableConstructorType>(\n\t\t\t\tthis: TThis,\n\t\t\t): InstanceType<TThis> {\n\t\t\t\treturn new this({ columns: [], rows: [] }) as InstanceType<TThis>;\n\t\t\t}\n\n\t\t\tpublic getColumn(indexOrId: number | string): ColumnValueType | undefined {\n\t\t\t\treturn this.#tryGetColumn(indexOrId);\n\t\t\t}\n\n\t\t\tpublic getRow(indexOrId: number | string): RowValueType | undefined {\n\t\t\t\treturn this.#tryGetRow(indexOrId);\n\t\t\t}\n\n\t\t\tpublic getCell(\n\t\t\t\tkey: TableSchema.CellKey<TColumnSchema, TRowSchema>,\n\t\t\t): CellValueType | undefined {\n\t\t\t\tconst { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;\n\t\t\t\tconst row = this.#tryGetRow(rowOrIdOrIndex);\n\t\t\t\tif (row === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst column = this.#tryGetColumn(columnOrIdOrIndex);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn (row as RowValueInternalType).cells[column.id];\n\t\t\t}\n\n\t\t\tpublic insertColumns({\n\t\t\t\tcolumns,\n\t\t\t\tindex,\n\t\t\t}: TableSchema.InsertColumnsParameters<TColumnSchema>): ColumnValueType[] {\n\t\t\t\t// TypeScript is unable to narrow the column type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);\n\t\t\t\t} else {\n\t\t\t\t\t// Ensure specified index is valid\n\t\t\t\t\tvalidateIndex(index, this.columns, \"Table.insertColumns\", true);\n\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.columns.insertAt(index, TreeArrayNode.spread(columns) as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input nodes into the tree hydrates them, making them usable as nodes.\n\t\t\t\treturn columns as unknown as ColumnValueType[];\n\t\t\t}\n\n\t\t\tpublic insertRows({\n\t\t\t\tindex,\n\t\t\t\trows,\n\t\t\t}: TableSchema.InsertRowsParameters<TRowSchema>): RowValueType[] {\n\t\t\t\t// #region Input validation\n\n\t\t\t\t// Ensure specified index is valid\n\t\t\t\tif (index !== undefined) {\n\t\t\t\t\tvalidateIndex(index, this.rows, \"Table.insertRows\", true);\n\t\t\t\t}\n\n\t\t\t\t// Note: TypeScript is unable to narrow the type of the row type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tfor (const newRow of rows) {\n\t\t\t\t\t// If the row contains cells, verify that the table contains the columns for those cells.\n\t\t\t\t\t// Note: we intentionally hide `cells` on `IRow` to avoid leaking the internal data representation as much as possible, so we have to cast here.\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tif ((newRow as any).cells !== undefined) {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\tconst keys: string[] = Object.keys((newRow as any).cells);\n\t\t\t\t\t\tfor (const key of keys) {\n\t\t\t\t\t\t\tif (!this.#containsColumnWithId(key)) {\n\t\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\t`Attempted to insert row a cell under column ID \"${key}\", but the table does not contain a column with that ID.`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// #endregion\n\n\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.rows.insertAtEnd(TreeArrayNode.spread(rows) as any);\n\t\t\t\t} else {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.rows.insertAt(index, TreeArrayNode.spread(rows) as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input nodes into the tree hydrates them, making them usable as nodes.\n\t\t\t\treturn rows as unknown as RowValueType[];\n\t\t\t}\n\n\t\t\tpublic setCell({\n\t\t\t\tkey,\n\t\t\t\tcell,\n\t\t\t}: TableSchema.SetCellParameters<TCellSchema, TColumnSchema, TRowSchema>): void {\n\t\t\t\tconst { column: columnOrId, row: rowOrId } = key;\n\n\t\t\t\tconst row = this.#getRow(rowOrId);\n\t\t\t\tconst column = this.#getColumn(columnOrId);\n\n\t\t\t\t(row as RowValueInternalType).cells[column.id] = cell as CellValueType;\n\t\t\t}\n\n\t\t\tpublic removeColumns(\n\t\t\t\tindexOrColumns: number | undefined | readonly string[] | readonly ColumnValueType[],\n\t\t\t\tcount: number | undefined = undefined,\n\t\t\t): ColumnValueType[] {\n\t\t\t\tif (typeof indexOrColumns === \"number\" || indexOrColumns === undefined) {\n\t\t\t\t\tlet removedColumns: ColumnValueType[] | undefined;\n\t\t\t\t\tconst startIndex = indexOrColumns ?? 0;\n\t\t\t\t\tconst endIndex = count === undefined ? this.columns.length : startIndex + count;\n\n\t\t\t\t\t// If there are no columns to remove, do nothing\n\t\t\t\t\tif (startIndex === endIndex) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\tvalidateIndexRange(startIndex, endIndex, this.columns, \"Table.removeColumns\");\n\n\t\t\t\t\tthis.#applyEditsInBatch(() => {\n\t\t\t\t\t\tconst columnsToRemove = this.columns.slice(\n\t\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\t\tendIndex,\n\t\t\t\t\t\t) as ColumnValueType[];\n\n\t\t\t\t\t\t// First, remove all cells that correspond to each column from each row:\n\t\t\t\t\t\tfor (const column of columnsToRemove) {\n\t\t\t\t\t\t\tthis.#removeCells(column);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Second, remove the column nodes:\n\t\t\t\t\t\tremoveRangeFromArray(startIndex, endIndex, this.columns, \"Table.removeColumns\");\n\t\t\t\t\t\tremovedColumns = columnsToRemove;\n\t\t\t\t\t});\n\t\t\t\t\treturn removedColumns ?? fail(0xc1f /* Transaction did not complete. */);\n\t\t\t\t} else {\n\t\t\t\t\t// If there are no columns to remove, do nothing\n\t\t\t\t\tif (indexOrColumns.length === 0) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Resolve any IDs to actual nodes.\n\t\t\t\t\t// This validates that all of the rows exist before starting transaction.\n\t\t\t\t\t// This improves user-facing error experience.\n\t\t\t\t\tconst columnsToRemove: ColumnValueType[] = [];\n\t\t\t\t\tfor (const columnOrIdToRemove of indexOrColumns) {\n\t\t\t\t\t\tcolumnsToRemove.push(this.#getColumn(columnOrIdToRemove));\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.#applyEditsInBatch(() => {\n\t\t\t\t\t\t// Note, throwing an error within a transaction will abort the entire transaction.\n\t\t\t\t\t\t// So if we throw an error here for any column, no columns will be removed.\n\t\t\t\t\t\tfor (const columnToRemove of columnsToRemove) {\n\t\t\t\t\t\t\t// Remove the corresponding cell from all rows.\n\t\t\t\t\t\t\tfor (const row of this.rows) {\n\t\t\t\t\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the cast.\n\t\t\t\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\t\t\t\tthis.removeCell({\n\t\t\t\t\t\t\t\t\tcolumn: columnToRemove,\n\t\t\t\t\t\t\t\t\trow: row as RowValueType,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// We have already validated that all of the columns exist above, so this is safe.\n\t\t\t\t\t\t\tthis.columns.removeAt(this.columns.indexOf(columnToRemove));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn columnsToRemove;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic removeRows(\n\t\t\t\tindexOrRows: number | undefined | readonly string[] | readonly RowValueType[],\n\t\t\t\tcount?: number | undefined,\n\t\t\t): RowValueType[] {\n\t\t\t\tif (typeof indexOrRows === \"number\" || indexOrRows === undefined) {\n\t\t\t\t\tconst startIndex = indexOrRows ?? 0;\n\t\t\t\t\tconst endIndex = count === undefined ? this.columns.length : startIndex + count;\n\n\t\t\t\t\t// If there are no rows to remove, do nothing\n\t\t\t\t\tif (startIndex === endIndex) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn removeRangeFromArray(startIndex, endIndex, this.rows, \"Table.removeRows\");\n\t\t\t\t}\n\n\t\t\t\t// If there are no rows to remove, do nothing\n\t\t\t\tif (indexOrRows.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\t// Resolve any IDs to actual nodes.\n\t\t\t\t// This validates that all of the rows exist before starting transaction.\n\t\t\t\t// This improves user-facing error experience.\n\t\t\t\tconst rowsToRemove: RowValueType[] = [];\n\t\t\t\tfor (const rowToRemove of indexOrRows) {\n\t\t\t\t\trowsToRemove.push(this.#getRow(rowToRemove));\n\t\t\t\t}\n\n\t\t\t\tthis.#applyEditsInBatch(() => {\n\t\t\t\t\t// Note, throwing an error within a transaction will abort the entire transaction.\n\t\t\t\t\t// So if we throw an error here for any row, no rows will be removed.\n\t\t\t\t\tfor (const rowToRemove of rowsToRemove) {\n\t\t\t\t\t\t// We have already validated that all of the rows exist above, so this is safe.\n\t\t\t\t\t\tconst index = this.rows.indexOf(rowToRemove);\n\t\t\t\t\t\tthis.rows.removeAt(index);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn rowsToRemove;\n\t\t\t}\n\n\t\t\tpublic removeCell(\n\t\t\t\tkey: TableSchema.CellKey<TColumnSchema, TRowSchema>,\n\t\t\t): CellValueType | undefined {\n\t\t\t\tconst { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;\n\t\t\t\tconst row = this.#getRow(rowOrIdOrIndex) as RowValueInternalType;\n\t\t\t\tconst column = this.#getColumn(columnOrIdOrIndex);\n\n\t\t\t\tconst cell: CellValueType | undefined = row.cells[column.id];\n\t\t\t\tif (cell === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\t\t\tdelete row.cells[column.id];\n\t\t\t\treturn cell;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Removes the cell corresponding with the specified column from each row in the table.\n\t\t\t */\n\t\t\t#removeCells(column: ColumnValueType): void {\n\t\t\t\tfor (const row of this.rows) {\n\t\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\tthis.removeCell({\n\t\t\t\t\t\tcolumn,\n\t\t\t\t\t\trow: row as RowValueType,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Applies the provided edits in a \"batch\".\n\t\t\t *\n\t\t\t * @remarks\n\t\t\t * For hydrated trees, this will be done in a transaction to ensure atomicity.\n\t\t\t *\n\t\t\t * Transactions are not supported for unhydrated trees, so we cannot run a transaction in that case.\n\t\t\t * But since there are no collaborators, this is not an issue.\n\t\t\t */\n\t\t\t#applyEditsInBatch(applyEdits: () => void): void {\n\t\t\t\tconst branch = TreeAlpha.branch(this);\n\n\t\t\t\t// Ensure events are paused until all of the edits are applied.\n\t\t\t\t// This ensures that the user sees the corresponding table-level edit as atomic,\n\t\t\t\t// and ensures they are not spammed with intermediate events.\n\t\t\t\twithBufferedTreeEvents(() => {\n\t\t\t\t\tif (branch === undefined) {\n\t\t\t\t\t\t// If this node does not have a corresponding branch, then it is unhydrated.\n\t\t\t\t\t\t// I.e., it is not part of a collaborative session yet.\n\t\t\t\t\t\t// Therefore, we don't need to run the edits as a transaction.\n\t\t\t\t\t\tapplyEdits();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbranch.runTransaction(() => {\n\t\t\t\t\t\t\tapplyEdits();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Column node or ID to a Column node in the table.\n\t\t\t * Returns `undefined` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\t#tryGetColumn(\n\t\t\t\tcolumnOrIdOrIndex: ColumnValueType | string | number,\n\t\t\t): ColumnValueType | undefined {\n\t\t\t\tif (typeof columnOrIdOrIndex === \"number\") {\n\t\t\t\t\tif (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.columns.length) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.columns[columnOrIdOrIndex] as ColumnValueType;\n\t\t\t\t}\n\n\t\t\t\tif (typeof columnOrIdOrIndex === \"string\") {\n\t\t\t\t\tconst columnId = columnOrIdOrIndex;\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.columns.find((col) => (col as ColumnValueType).id === columnId) as\n\t\t\t\t\t\t| ColumnValueType\n\t\t\t\t\t\t| undefined;\n\t\t\t\t}\n\n\t\t\t\t// If the user provided a node, ensure it actually exists in this table.\n\t\t\t\tif (!this.columns.includes(columnOrIdOrIndex)) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn columnOrIdOrIndex;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Column node or ID to a Column node in the table.\n\t\t\t * @throws Throws a `UsageError` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\t#getColumn(columnOrIdOrIndex: ColumnValueType | string | number): ColumnValueType {\n\t\t\t\tconst column = this.#tryGetColumn(columnOrIdOrIndex);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\tTable._throwMissingColumnError(columnOrIdOrIndex);\n\t\t\t\t}\n\t\t\t\treturn column;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Checks if a Column with the specified ID exists in the table.\n\t\t\t */\n\t\t\t#containsColumnWithId(columnId: string): boolean {\n\t\t\t\treturn this.#tryGetColumn(columnId) !== undefined;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Throw a `UsageError` for a missing Column by its ID or index.\n\t\t\t */\n\t\t\tprivate static _throwMissingColumnError(\n\t\t\t\tcolumnOrIdOrIndex: ColumnValueType | string | number,\n\t\t\t): never {\n\t\t\t\tif (typeof columnOrIdOrIndex === \"number\") {\n\t\t\t\t\tthrow new UsageError(`No column exists at index ${columnOrIdOrIndex}.`);\n\t\t\t\t}\n\n\t\t\t\tif (typeof columnOrIdOrIndex === \"string\") {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`No column with ID \"${columnOrIdOrIndex}\" exists in the table.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`The specified column node with ID \"${columnOrIdOrIndex.id}\" does not exist in the table.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Row node or ID to a Row node in the table.\n\t\t\t * Returns `undefined` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\t#tryGetRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType | undefined {\n\t\t\t\tif (typeof rowOrIdOrIndex === \"number\") {\n\t\t\t\t\tif (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.rows.length) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.rows[rowOrIdOrIndex] as RowValueType;\n\t\t\t\t}\n\n\t\t\t\tif (typeof rowOrIdOrIndex === \"string\") {\n\t\t\t\t\tconst rowId = rowOrIdOrIndex;\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\treturn this.rows.find((row) => (row as RowValueType).id === rowId) as\n\t\t\t\t\t\t| RowValueType\n\t\t\t\t\t\t| undefined;\n\t\t\t\t}\n\n\t\t\t\t// If the user provided a node, ensure it actually exists in this table.\n\t\t\t\tif (!this.rows.includes(rowOrIdOrIndex)) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn rowOrIdOrIndex;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Attempts to resolve the provided Row node, ID, or index to a Row node in the table.\n\t\t\t * @throws Throws a `UsageError` if there is no match.\n\t\t\t * @remarks Searches for a match based strictly on the ID and returns that result.\n\t\t\t */\n\t\t\t#getRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType {\n\t\t\t\tconst row = this.#tryGetRow(rowOrIdOrIndex);\n\t\t\t\tif (row === undefined) {\n\t\t\t\t\tTable._throwMissingRowError(rowOrIdOrIndex);\n\t\t\t\t}\n\t\t\t\treturn row;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Throw a `UsageError` for a missing Row by its ID or index.\n\t\t\t */\n\t\t\tprivate static _throwMissingRowError(\n\t\t\t\trowOrIdOrIndex: RowValueType | string | number,\n\t\t\t): never {\n\t\t\t\tif (typeof rowOrIdOrIndex === \"number\") {\n\t\t\t\t\tthrow new UsageError(`No row exists at index ${rowOrIdOrIndex}.`);\n\t\t\t\t}\n\n\t\t\t\tif (typeof rowOrIdOrIndex === \"string\") {\n\t\t\t\t\tthrow new UsageError(`No row with ID \"${rowOrIdOrIndex}\" exists in the table.`);\n\t\t\t\t}\n\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`The specified row node with ID \"${rowOrIdOrIndex.id}\" does not exist in the table.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Set a private symbol on the schema class that marks it as having been generated by this factory.\n\t\t// Column / Row functionality use this to validate that they are being used in a table.\n\t\t// This is effectively a work-around that allows columns and rows to invoke table methods\n\t\t// without having to pass the table as a parameter to their construction, which isn't possible.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t(Table as any)[tableSchemaSymbol] = true;\n\n\t\ttype TableValueType = TreeNode &\n\t\t\tTableSchema.Table<TInputScope, TCellSchema, TColumnSchema, TRowSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Table\">>;\n\t\ttype TableInsertableType = InsertableObjectFromSchemaRecord<typeof tableFields>;\n\t\ttype TableConstructorType = new (data: TableInsertableType) => TableValueType;\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst TableSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Table\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ TableValueType,\n\t\t\t/* TInsertable */ object & TableInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof tableFields\n\t\t> & {\n\t\t\t/**\n\t\t\t * Create an empty table.\n\t\t\t */\n\t\t\tempty<TThis extends TableConstructorType>(this: TThis): InstanceType<TThis>;\n\t\t} = Table;\n\n\t\t// Return the table schema\n\t\treturn TableSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @alpha\n\t */\n\texport type TableSchemaBase<\n\t\tTScope extends string | undefined,\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ColumnSchemaBase<TScope, TCell>,\n\t\tTRow extends RowSchemaBase<TScope, TCell>,\n\t> = ReturnType<typeof createTableSchema<TScope, TCell, TColumn, TRow>>;\n\n\t// #endregion\n}\n\n/**\n * Removes the specified range of elements from the array.\n * @returns The removed elements.\n */\nfunction removeRangeFromArray<TNodeSchema extends ImplicitAllowedTypes>(\n\tstartIndex: number,\n\tendIndex: number,\n\tarray: TreeArrayNode<TNodeSchema>,\n\tmethodName: string,\n): TreeNodeFromImplicitAllowedTypes<TNodeSchema>[] {\n\tvalidateIndexRange(startIndex, endIndex, array, methodName);\n\n\t// TypeScript is unable to narrow the array element type correctly here, hence the cast.\n\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\tconst removedRows = array.slice(\n\t\tstartIndex,\n\t\tendIndex,\n\t) as TreeNodeFromImplicitAllowedTypes<TNodeSchema>[];\n\tarray.removeRange(startIndex, endIndex);\n\n\treturn removedRows;\n}\n\n/**\n * Contains types and factories for creating schema to represent dynamic tabular data.\n *\n * @remarks\n *\n * WARNING: These APIs are in preview and are subject to change.\n * Until these APIs have stabilized, it is not recommended to use them in production code.\n * There may be breaking changes to these APIs and their underlying data format.\n * Using these APIs in production code may result in data loss or corruption.\n *\n * The primary APIs for create tabular data schema are:\n *\n * - {@link TableSchema.(table:1)}\n *\n * - {@link TableSchema.(column:1)}\n *\n * - {@link TableSchema.(row:1)}\n *\n * Tables created using these APIs are...\n *\n * - sparse, meaning that cells may be omitted, and new rows are empty by default.\n *\n * - dynamic, meaning that their structure can be modified at runtime.\n * Columns and rows can be inserted, removed, modified, and reordered.\n * Cells can be inserted, removed, and modified.\n *\n * - row-major, meaning that operating on rows (including inserts, removal, moves, and traversal) is more efficient than operating on columns.\n *\n * Column and Row schema created using these APIs are extensible via the `props` field.\n * This allows association of additional properties with column and row nodes.\n *\n * Cells in the table may become \"orphaned.\"\n * That is, it is possible to enter a state where one or more rows contain cells with no corresponding column.\n * To reduce the likelihood of this, you can manually remove corresponding cells when removing columns.\n * Either way, it is possible to enter such a state via the merging of edits.\n * For example: one client might add a row while another concurrently removes a column, orphaning the cell where the column and row intersected.\n *\n * @example Defining a Table schema\n *\n * ```typescript\n * class MyTable extends TableSchema.table({\n * \tschemaFactory,\n * \tcell: schemaFactory.string,\n * }) {}\n *\n * const table = new MyTable({\n * \tcolumns: [{ id: \"column-0\" }],\n * \trows: [{ id: \"row-0\", cells: { \"column-0\": \"Hello world!\" } }],\n * });\n * ```\n *\n * @example Customizing Column and Row schema\n *\n * ```typescript\n * const Cell = schemaFactory.string;\n *\n * class MyColumn extends TableSchema.column({\n * \tschemaFactory,\n * \tcell: Cell,\n * \tprops: schemaFactory.object(\"TableColumnProps\", {\n * \t\tlabel: schemaFactory.string,\n * \t}),\n * }) {}\n *\n * class MyRow extends TableSchema.row({\n * \tschemaFactory,\n * \tcell: Cell,\n * }) {}\n *\n * class MyTable extends TableSchema.table({\n * \tschemaFactory,\n * \tcell: Cell,\n * \tcolumn: MyColumn,\n * \trow: MyRow,\n * }) {}\n *\n * const table = new MyTable({\n * \tcolumns: [\n * \t\tnew MyColumn({ props: { label: \"Entry\" } }),\n * \t\tnew MyColumn({ props: { label: \"Date\" } }),\n * \t\tnew MyColumn({ props: { label: \"Amount\" } }),\n * \t],\n * \trows: [],\n * });\n * ```\n *\n * @example Listening for changes in the table\n *\n * ```typescript\n * // Listen for any changes to the table and its children.\n * // The \"treeChanged\" event will fire when the associated node or any of its descendants change.\n * Tree.on(table, \"treeChanged\", () => {\n * \t// Respond to the change.\n * });\n * ```\n *\n * @example Listening for changes to the rows list only\n *\n * ```typescript\n * // Listen for any changes to the list of rows.\n * // The \"nodeChanged\" event will fire only when the specified node itself changes (i.e., its own properties change).\n * // In this case, the event will fire when a row is added or removed, or the order of the list is changed.\n * // But it won't fire when a row's properties change, or when the row's cells change, etc.\n * Tree.on(table.rows, \"nodeChanged\", () => {\n * \t// Respond to the change.\n * });\n * ```\n *\n * @privateRemarks\n * The above examples are backed by tests in `tableSchema.spec.ts`.\n * Those tests and these examples should be kept in-sync to ensure that the examples are correct.\n *\n * @alpha\n */\nexport namespace TableSchema {\n\t// #region Column\n\n\t/**\n\t * A column in a table.\n\t * @remarks Implemented by the schema class returned from {@link TableSchema.(column:2)}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the column.\n\t * @sealed @alpha\n\t */\n\texport interface Column<\n\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Reserving this for future use.\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTProps extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> {\n\t\t/**\n\t\t * The unique identifier of the column.\n\t\t * @remarks Uniquely identifies the node within the entire tree, not just the table.\n\t\t */\n\t\treadonly id: string;\n\n\t\t/**\n\t\t * The column's properties.\n\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t * @privateRemarks\n\t\t * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createColumnSchema}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<TProps>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<TProps>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @alpha\n\t */\n\texport function column<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tparams: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryBeta<TScope>, TCell>,\n\t): System_TableSchema.ColumnSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>;\n\t/**\n\t * Factory for creating new table column schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the column.\n\t * @alpha\n\t */\n\texport function column<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TProps extends ImplicitFieldSchema,\n\t>(\n\t\tparams: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\t/**\n\t\t\t * Optional column properties.\n\t\t\t */\n\t\t\treadonly props: TProps;\n\t\t},\n\t): System_TableSchema.ColumnSchemaBase<TScope, TCell, TProps>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function column({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops = SchemaFactory.optional(SchemaFactory.null),\n\t}: System_TableSchema.CreateColumnOptionsBase & {\n\t\treadonly props?: ImplicitFieldSchema;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createColumnSchema(schemaFactory, props);\n\t}\n\n\t// #endregion\n\n\t// #region Row\n\n\t/**\n\t * A row in a table.\n\t * @remarks Implemented by the schema class returned from {@link TableSchema.(row:2)}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the row.\n\t * @sealed @alpha\n\t */\n\texport interface Row<\n\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Reserving this for future use.\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTProps extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t> {\n\t\t/**\n\t\t * The unique identifier of the row.\n\t\t * @remarks Uniquely identifies the node within the entire tree, not just the table.\n\t\t */\n\t\treadonly id: string;\n\n\t\t/**\n\t\t * The row's properties.\n\t\t * @remarks This is a user-defined schema that can be used to store additional information about the row.\n\t\t * @privateRemarks\n\t\t * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createRowSchema}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<TProps>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<TProps>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @alpha\n\t */\n\texport function row<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tparams: System_TableSchema.CreateRowOptionsBase<SchemaFactoryBeta<TScope>, TCell>,\n\t): System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>;\n\t/**\n\t * Factory for creating new table row schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.\n\t * @typeParam TProps - Additional properties to associate with the row.\n\t * @alpha\n\t */\n\texport function row<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TProps extends ImplicitFieldSchema,\n\t>(\n\t\tparams: System_TableSchema.CreateRowOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\t/**\n\t\t\t * Optional row properties.\n\t\t\t */\n\t\t\treadonly props: TProps;\n\t\t},\n\t): System_TableSchema.RowSchemaBase<TScope, TCell, TProps>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function row({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops = SchemaFactory.optional(SchemaFactory.null),\n\t}: System_TableSchema.CreateRowOptionsBase & {\n\t\treadonly props?: ImplicitFieldSchema;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createRowSchema(schemaFactory, cell, props);\n\t}\n\n\t// #endregion\n\n\t// #region Table\n\n\t/**\n\t * A key to uniquely identify a cell within a table.\n\t * @alpha\n\t */\n\texport interface CellKey<\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * {@link TableSchema.Column}, {@link TableSchema.Column.id}, or column index at which the cell is located.\n\t\t */\n\t\treadonly column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>;\n\n\t\t/**\n\t\t * {@link TableSchema.Row}, {@link TableSchema.Row.id}, or row index at which the cell is located.\n\t\t */\n\t\treadonly row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>;\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertColumns} parameters.\n\t * @alpha\n\t */\n\texport interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new columns.\n\t\t * @remarks If not provided, the columns will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The columns to insert.\n\t\t */\n\t\treadonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertRows} parameters.\n\t * @alpha\n\t */\n\texport interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new rows.\n\t\t * @remarks If not provided, the rows will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The rows to insert.\n\t\t */\n\t\treadonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.setCell} parameters.\n\t * @alpha\n\t */\n\texport interface SetCellParameters<\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * The key to uniquely identify a cell in a table.\n\t\t */\n\t\treadonly key: CellKey<TColumn, TRow>;\n\n\t\t/**\n\t\t * The cell to set.\n\t\t */\n\t\treadonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;\n\t}\n\n\t/**\n\t * A table.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TColumn - The type of the columns in the table.\n\t * @typeParam TRow - The type of the rows in the table.\n\t * @sealed @alpha\n\t */\n\texport interface Table<\n\t\tTScope extends string | undefined,\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>,\n\t\tTRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,\n\t> {\n\t\t/**\n\t\t * The table's columns.\n\t\t */\n\t\treadonly columns: TreeArrayNode<TColumn>;\n\n\t\t/**\n\t\t * The table's rows.\n\t\t */\n\t\treadonly rows: TreeArrayNode<TRow>;\n\n\t\t/**\n\t\t * Gets a table column by its {@link TableSchema.Column.id}.\n\t\t * @returns The column, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;\n\t\t/**\n\t\t * Gets a table column by its index in the table.\n\t\t * @returns The column, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetColumn(index: number): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;\n\n\t\t/**\n\t\t * Gets a table row by its {@link TableSchema.Row.id}.\n\t\t * @returns The row, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;\n\t\t/**\n\t\t * Gets a table row by its index in the table.\n\t\t * @returns The row, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;\n\n\t\t/**\n\t\t * Gets a cell in the table by corresponding column and row.\n\t\t * @param key - A key that uniquely distinguishes a cell in the table, represented as a combination of the column ID and row ID.\n\t\t * @returns The cell, if it exists. Otherwise, `undefined`.\n\t\t */\n\t\tgetCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * Inserts 0 or more columns into the table.\n\t\t *\n\t\t * @throws Throws an error if the specified index is out of range.\n\t\t *\n\t\t * No columns are inserted in this case.\n\t\t */\n\t\tinsertColumns(\n\t\t\tparams: InsertColumnsParameters<TColumn>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\n\t\t/**\n\t\t * Inserts 0 or more rows into the table.\n\t\t *\n\t\t * @throws\n\t\t * Throws an error in the following cases:\n\t\t *\n\t\t * - The row contains cells, but the table does not contain matching columns for one or more of those cells.\n\t\t *\n\t\t * - The specified index is out of range.\n\t\t *\n\t\t * No rows are inserted in these cases.\n\t\t */\n\t\tinsertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\n\t\t/**\n\t\t * Sets the cell at the specified location in the table.\n\t\t * @remarks To remove a cell, call {@link TableSchema.Table.removeCell} instead.\n\t\t */\n\t\tsetCell(params: SetCellParameters<TCell, TColumn, TRow>): void;\n\n\t\t/**\n\t\t * Removes a range of columns from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Also removes any corresponding cells from the table's rows.\n\t\t *\n\t\t * Note: this operation can be slow for tables with many rows.\n\t\t * We are actively working on improving the performance of this operation, but for now it may have a negative\n\t\t * impact on performance.\n\t\t * @param index - The starting index of the range to remove. Default: `0`.\n\t\t * @param count - The number of columns to remove. Default: all remaining columns starting from `index`.\n\t\t * @throws Throws an error if the specified range is invalid. In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(\n\t\t\tindex?: number | undefined,\n\t\t\tcount?: number | undefined,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t\t/**\n\t\t * Removes 0 or more columns from the table.\n\t\t * @remarks\n\t\t * Also removes any corresponding cells from the table's rows.\n\t\t *\n\t\t * Note: this operation can be slow for tables with many rows.\n\t\t * We are actively working on improving the performance of this operation, but for now it may have a negative\n\t\t * impact on performance.\n\t\t *\n\t\t * @param columns - The columns to remove.\n\t\t * @throws Throws an error if any of the columns are not in the table.\n\t\t * In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(\n\t\t\tcolumns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[],\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t\t/**\n\t\t * Removes 0 or more columns from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Also removes any corresponding cells from the table's rows.\n\t\t *\n\t\t * Note: this operation can be slow for tables with many rows.\n\t\t * We are actively working on improving the performance of this operation, but for now it may have a negative\n\t\t * impact on performance.\n\t\t *\n\t\t * @param columns - The columns to remove, specified by their {@link TableSchema.Column.id}.\n\t\t * @throws Throws an error if any of the columns are not in the table.\n\t\t * In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(columns: readonly string[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\n\t\t/**\n\t\t * Removes a range of rows from the table.\n\t\t * @param index - The starting index of the range to remove. Default: `0`.\n\t\t * @param count - The number of rows to remove. Default: all remaining rows starting from `index`.\n\t\t * @throws Throws an error if the specified range is invalid. In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(\n\t\t\tindex?: number | undefined,\n\t\t\tcount?: number | undefined,\n\t\t): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\t\t/**\n\t\t * Removes 0 or more rows from the table.\n\t\t * @param rows - The rows to remove.\n\t\t * @throws Throws an error if any of the rows are not in the table.\n\t\t * In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(\n\t\t\trows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[],\n\t\t): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\t\t/**\n\t\t * Removes 0 or more rows from the table.\n\t\t * @param rows - The rows to remove, specified by their {@link TableSchema.Row.id}.\n\t\t * @throws Throws an error if any of the rows are not in the table.\n\t\t * In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\n\t\t/**\n\t\t * Removes the cell at the specified location in the table.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t * @throws Throws an error if the location does not exist in the table.\n\t\t */\n\t\tremoveCell(\n\t\t\tkey: CellKey<TColumn, TRow>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\t}\n\n\t/**\n\t * Factory for creating new table schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell>,\n\t): System_TableSchema.TableSchemaBase<\n\t\tTScope,\n\t\tTCell,\n\t\tSystem_TableSchema.ColumnSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>,\n\t\tSystem_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>\n\t>;\n\t/**\n\t * Factory for creating new table schema with custom column schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TColumn - The type of the columns in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\treadonly column: TColumn;\n\t\t},\n\t): System_TableSchema.TableSchemaBase<\n\t\tTScope,\n\t\tTCell,\n\t\tTColumn,\n\t\tSystem_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>\n\t>;\n\t/**\n\t * Factory for creating new table schema with custom row schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TRow - The type of the rows in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\treadonly row: TRow;\n\t\t},\n\t): System_TableSchema.TableSchemaBase<\n\t\tTScope,\n\t\tTCell,\n\t\tSystem_TableSchema.ColumnSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>,\n\t\tTRow\n\t>;\n\t/**\n\t * Factory for creating new table schema with custom column and row schema.\n\t * @typeParam TScope - The {@link SchemaFactory.scope | schema factory scope}.\n\t * @typeParam TCell - The type of the cells in the table.\n\t * @typeParam TColumn - The type of the columns in the table.\n\t * @typeParam TRow - The type of the rows in the table.\n\t * @alpha\n\t */\n\texport function table<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>,\n\t\tconst TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,\n\t>(\n\t\tparams: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryBeta<TScope>, TCell> & {\n\t\t\treadonly column: TColumn;\n\t\t\treadonly row: TRow;\n\t\t},\n\t): System_TableSchema.TableSchemaBase<TScope, TCell, TColumn, TRow>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function table({\n\t\tschemaFactory,\n\t\tcell: cellSchema,\n\t\tcolumn: columnSchema = column({\n\t\t\tschemaFactory,\n\t\t\tcell: cellSchema,\n\t\t}),\n\t\trow: rowSchema = row({\n\t\t\tschemaFactory,\n\t\t\tcell: cellSchema,\n\t\t}),\n\t}: System_TableSchema.TableFactoryOptionsBase & {\n\t\treadonly column?: System_TableSchema.ColumnSchemaBase;\n\t\treadonly row?: System_TableSchema.RowSchemaBase;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createTableSchema(\n\t\t\tschemaFactory,\n\t\t\tcellSchema,\n\t\t\tcolumnSchema,\n\t\t\trowSchema,\n\t\t);\n\t}\n\n\t// #endregion\n}\n"]}
@@ -0,0 +1,45 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Validates that the provided index is a safe integer.
7
+ * @throws If the index is invalid.
8
+ * @param index - The index to validate.
9
+ * @param apiName - The name of the API performing the validation.
10
+ * @throws If the index is invalid.
11
+ */
12
+ export declare function validateSafeInteger(index: number, apiName: string): void;
13
+ /**
14
+ * Validates that the provided index is a 0 or greater safe integer.
15
+ * @param index - The index to validate.
16
+ * @param apiName - The name of the API performing the validation.
17
+ * @throws If the index is invalid.
18
+ */
19
+ export declare function validatePositiveIndex(index: number, apiName: string): void;
20
+ /**
21
+ * Validates that the provided index is a non-negative safe integer within the bounds of the provided array (or, optionally, 1 past its end).
22
+ * @throws If the index is invalid.
23
+ * @param index - The index to validate.
24
+ * @param array - The array to validate against.
25
+ * @param apiName - The name of the API performing the validation.
26
+ * @param allowOnePastEnd - Whether to allow the index to be one past the end of the array.
27
+ */
28
+ export declare function validateIndex(index: number, array: {
29
+ readonly length: number;
30
+ }, apiName: string, allowOnePastEnd?: boolean): void;
31
+ /**
32
+ * Validates that the provided range `[startIndex, endIndex)` is valid and within the bounds of the provided array.
33
+ * @remarks
34
+ * This is intended for ranges which are inclusive for the lower bound, and exclusive for the upper bound,
35
+ * and permits 0 length ranges, even `[array.length, array.length)`.
36
+ * @throws If the index is invalid.
37
+ * @param startIndex - The index that starts the range (inclusive).
38
+ * @param endIndex - The index that ends the range (exclusive).
39
+ * @param array - The array to validate against.
40
+ * @param apiName - The name of the API performing the validation.
41
+ */
42
+ export declare function validateIndexRange(startIndex: number, endIndex: number, array: {
43
+ readonly length: number;
44
+ }, apiName: string): void;
45
+ //# sourceMappingURL=arrayUtilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrayUtilities.d.ts","sourceRoot":"","sources":["../../src/util/arrayUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAIxE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAK1E;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC5B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAClC,OAAO,EAAE,MAAM,EACf,eAAe,GAAE,OAAe,GAC9B,IAAI,CAeN;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CACjC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAClC,OAAO,EAAE,MAAM,GACb,IAAI,CAQN"}
@@ -0,0 +1,69 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { UsageError } from "@fluidframework/telemetry-utils/internal";
6
+ /**
7
+ * Validates that the provided index is a safe integer.
8
+ * @throws If the index is invalid.
9
+ * @param index - The index to validate.
10
+ * @param apiName - The name of the API performing the validation.
11
+ * @throws If the index is invalid.
12
+ */
13
+ export function validateSafeInteger(index, apiName) {
14
+ if (!Number.isSafeInteger(index)) {
15
+ throw new UsageError(`Expected a safe integer passed to ${apiName}, got ${index}.`);
16
+ }
17
+ }
18
+ /**
19
+ * Validates that the provided index is a 0 or greater safe integer.
20
+ * @param index - The index to validate.
21
+ * @param apiName - The name of the API performing the validation.
22
+ * @throws If the index is invalid.
23
+ */
24
+ export function validatePositiveIndex(index, apiName) {
25
+ validateSafeInteger(index, apiName);
26
+ if (index < 0) {
27
+ throw new UsageError(`Expected non-negative index passed to ${apiName}, got ${index}.`);
28
+ }
29
+ }
30
+ /**
31
+ * Validates that the provided index is a non-negative safe integer within the bounds of the provided array (or, optionally, 1 past its end).
32
+ * @throws If the index is invalid.
33
+ * @param index - The index to validate.
34
+ * @param array - The array to validate against.
35
+ * @param apiName - The name of the API performing the validation.
36
+ * @param allowOnePastEnd - Whether to allow the index to be one past the end of the array.
37
+ */
38
+ export function validateIndex(index, array, apiName, allowOnePastEnd = false) {
39
+ validatePositiveIndex(index, apiName);
40
+ if (allowOnePastEnd) {
41
+ if (index > array.length) {
42
+ throw new UsageError(`Index value passed to ${apiName} is out of bounds. Expected at most ${array.length}, got ${index}.`);
43
+ }
44
+ }
45
+ else {
46
+ if (index >= array.length) {
47
+ throw new UsageError(`Index value passed to ${apiName} is out of bounds. Expected at most ${array.length - 1}, got ${index}.`);
48
+ }
49
+ }
50
+ }
51
+ /**
52
+ * Validates that the provided range `[startIndex, endIndex)` is valid and within the bounds of the provided array.
53
+ * @remarks
54
+ * This is intended for ranges which are inclusive for the lower bound, and exclusive for the upper bound,
55
+ * and permits 0 length ranges, even `[array.length, array.length)`.
56
+ * @throws If the index is invalid.
57
+ * @param startIndex - The index that starts the range (inclusive).
58
+ * @param endIndex - The index that ends the range (exclusive).
59
+ * @param array - The array to validate against.
60
+ * @param apiName - The name of the API performing the validation.
61
+ */
62
+ export function validateIndexRange(startIndex, endIndex, array, apiName) {
63
+ if (startIndex > endIndex) {
64
+ throw new UsageError(`Malformed range passed to ${apiName}. Start index ${startIndex} is greater than end index ${endIndex}.`);
65
+ }
66
+ validateIndex(startIndex, array, apiName, true);
67
+ validateIndex(endIndex, array, apiName, true);
68
+ }
69
+ //# sourceMappingURL=arrayUtilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrayUtilities.js","sourceRoot":"","sources":["../../src/util/arrayUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa,EAAE,OAAe;IACjE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,UAAU,CAAC,qCAAqC,OAAO,SAAS,KAAK,GAAG,CAAC,CAAC;IACrF,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa,EAAE,OAAe;IACnE,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACpC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACf,MAAM,IAAI,UAAU,CAAC,yCAAyC,OAAO,SAAS,KAAK,GAAG,CAAC,CAAC;IACzF,CAAC;AACF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC5B,KAAa,EACb,KAAkC,EAClC,OAAe,EACf,kBAA2B,KAAK;IAEhC,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACtC,IAAI,eAAe,EAAE,CAAC;QACrB,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC1B,MAAM,IAAI,UAAU,CACnB,yBAAyB,OAAO,uCAAuC,KAAK,CAAC,MAAM,SAAS,KAAK,GAAG,CACpG,CAAC;QACH,CAAC;IACF,CAAC;SAAM,CAAC;QACP,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YAC3B,MAAM,IAAI,UAAU,CACnB,yBAAyB,OAAO,uCAAuC,KAAK,CAAC,MAAM,GAAG,CAAC,SAAS,KAAK,GAAG,CACxG,CAAC;QACH,CAAC;IACF,CAAC;AACF,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CACjC,UAAkB,EAClB,QAAgB,EAChB,KAAkC,EAClC,OAAe;IAEf,IAAI,UAAU,GAAG,QAAQ,EAAE,CAAC;QAC3B,MAAM,IAAI,UAAU,CACnB,6BAA6B,OAAO,iBAAiB,UAAU,8BAA8B,QAAQ,GAAG,CACxG,CAAC;IACH,CAAC;IACD,aAAa,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAChD,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Validates that the provided index is a safe integer.\n * @throws If the index is invalid.\n * @param index - The index to validate.\n * @param apiName - The name of the API performing the validation.\n * @throws If the index is invalid.\n */\nexport function validateSafeInteger(index: number, apiName: string): void {\n\tif (!Number.isSafeInteger(index)) {\n\t\tthrow new UsageError(`Expected a safe integer passed to ${apiName}, got ${index}.`);\n\t}\n}\n\n/**\n * Validates that the provided index is a 0 or greater safe integer.\n * @param index - The index to validate.\n * @param apiName - The name of the API performing the validation.\n * @throws If the index is invalid.\n */\nexport function validatePositiveIndex(index: number, apiName: string): void {\n\tvalidateSafeInteger(index, apiName);\n\tif (index < 0) {\n\t\tthrow new UsageError(`Expected non-negative index passed to ${apiName}, got ${index}.`);\n\t}\n}\n\n/**\n * Validates that the provided index is a non-negative safe integer within the bounds of the provided array (or, optionally, 1 past its end).\n * @throws If the index is invalid.\n * @param index - The index to validate.\n * @param array - The array to validate against.\n * @param apiName - The name of the API performing the validation.\n * @param allowOnePastEnd - Whether to allow the index to be one past the end of the array.\n */\nexport function validateIndex(\n\tindex: number,\n\tarray: { readonly length: number },\n\tapiName: string,\n\tallowOnePastEnd: boolean = false,\n): void {\n\tvalidatePositiveIndex(index, apiName);\n\tif (allowOnePastEnd) {\n\t\tif (index > array.length) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Index value passed to ${apiName} is out of bounds. Expected at most ${array.length}, got ${index}.`,\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (index >= array.length) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Index value passed to ${apiName} is out of bounds. Expected at most ${array.length - 1}, got ${index}.`,\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * Validates that the provided range `[startIndex, endIndex)` is valid and within the bounds of the provided array.\n * @remarks\n * This is intended for ranges which are inclusive for the lower bound, and exclusive for the upper bound,\n * and permits 0 length ranges, even `[array.length, array.length)`.\n * @throws If the index is invalid.\n * @param startIndex - The index that starts the range (inclusive).\n * @param endIndex - The index that ends the range (exclusive).\n * @param array - The array to validate against.\n * @param apiName - The name of the API performing the validation.\n */\nexport function validateIndexRange(\n\tstartIndex: number,\n\tendIndex: number,\n\tarray: { readonly length: number },\n\tapiName: string,\n): void {\n\tif (startIndex > endIndex) {\n\t\tthrow new UsageError(\n\t\t\t`Malformed range passed to ${apiName}. Start index ${startIndex} is greater than end index ${endIndex}.`,\n\t\t);\n\t}\n\tvalidateIndex(startIndex, array, apiName, true);\n\tvalidateIndex(endIndex, array, apiName, true);\n}\n"]}
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ export { validateIndex, validateIndexRange, validatePositiveIndex, validateSafeInteger, } from "./arrayUtilities.js";
5
6
  export { brand, type Brand, BrandedType, type NameFromBranded, type ValueFromBranded, brandConst, } from "./brand.js";
6
7
  export { brandedNumberType, brandedStringType } from "./typeboxBrand.js";
7
8
  export { brandOpaque, extractFromOpaque, type ExtractFromOpaque, type Opaque, } from "./opaque.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,EACL,KAAK,KAAK,EACV,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,UAAU,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,MAAM,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAA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AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EACN,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,WAAW,GACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,QAAQ,EACR,KAAK,gBAAgB,EACrB,kBAAkB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,KAAK,WAAW,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,eAAe,GACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,SAAS,EACT,KAAK,aAAa,EAClB,cAAc,EACd,aAAa,EACb,aAAa,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,KAAK,EACL,KAAK,KAAK,EACV,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,UAAU,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,MAAM,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,iBAAiB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uBAAuB,EACvB,YAAY,EACZ,WAAW,EACX,OAAO,EACP,mBAAmB,EACnB,YAAY,EACZ,QAAQ,GACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EACN,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,WAAW,GACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,QAAQ,EACR,KAAK,gBAAgB,EACrB,kBAAkB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,KAAK,WAAW,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,eAAe,GACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,SAAS,EACT,KAAK,aAAa,EAClB,cAAc,EACd,aAAa,EACb,aAAa,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
package/lib/util/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ export { validateIndex, validateIndexRange, validatePositiveIndex, validateSafeInteger, } from "./arrayUtilities.js";
5
6
  export { brand, BrandedType, brandConst, } from "./brand.js";
6
7
  export { brandedNumberType, brandedStringType } from "./typeboxBrand.js";
7
8
  export { brandOpaque, extractFromOpaque, } from "./opaque.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,EAEL,WAAW,EAGX,UAAU,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM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E1B,OAAO,EACN,SAAS,EAET,cAAc,EACd,aAAa,EACb,aAAa,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAmB,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tbrand,\n\ttype Brand,\n\tBrandedType,\n\ttype NameFromBranded,\n\ttype ValueFromBranded,\n\tbrandConst,\n} from \"./brand.js\";\nexport { brandedNumberType, brandedStringType } from \"./typeboxBrand.js\";\nexport {\n\tbrandOpaque,\n\textractFromOpaque,\n\ttype ExtractFromOpaque,\n\ttype Opaque,\n} from \"./opaque.js\";\nexport {\n\tdeleteFromNestedMap,\n\tgetOrAddInNestedMap,\n\tgetOrDefaultInNestedMap,\n\tforEachInNestedMap,\n\ttype NestedMap,\n\ttype ReadonlyNestedMap,\n\tSizedNestedMap,\n\tpopulateNestedMap,\n\tsetInNestedMap,\n\ttryAddToNestedMap,\n\ttryGetFromNestedMap,\n\tmapNestedMap,\n\tnestedMapToFlatList,\n\tnestedMapFromFlatList,\n\tgetOrCreateInNestedMap,\n} from \"./nestedMap.js\";\nexport { addToNestedSet, type NestedSet, nestedSetContains } from \"./nestedSet.js\";\nexport { type OffsetList, OffsetListFactory } from \"./offsetList.js\";\nexport type {\n\tareSafelyAssignable,\n\tContravariant,\n\tCovariant,\n\teitherIsAny,\n\tEnforceTypeCheckTests,\n\tInvariant,\n\tisAny,\n\tisAssignableTo,\n\tisStrictSubset,\n\tMakeNominal,\n\trequireFalse,\n\trequireTrue,\n\trequireAssignableTo,\n\tareOnlyKeys,\n} from \"./typeCheck.js\";\nexport { StackyIterator } from \"./stackyIterator.js\";\nexport {\n\tasMutable,\n\tbalancedReduce,\n\tclone,\n\tcompareSets,\n\tgetOrAddEmptyToMap,\n\tgetOrCreate,\n\tisJsonObject,\n\tisReadonlyArray,\n\ttype JsonCompatible,\n\ttype JsonCompatibleObject,\n\ttype JsonCompatibleReadOnly,\n\ttype JsonCompatibleReadOnlyObject,\n\tJsonCompatibleReadOnlySchema,\n\tmakeArray,\n\tmapIterable,\n\tfilterIterable,\n\ttype Mutable,\n\ttype Populated,\n\ttype RecursiveReadonly,\n\tassertValidIndex,\n\tassertValidRange,\n\tassertNonNegativeSafeInteger,\n\tobjectToMap,\n\tinvertMap,\n\toneFromIterable,\n\ttype Named,\n\tcompareNamed,\n\tdisposeSymbol,\n\ttype IDisposable,\n\tcapitalize,\n\tassertValidRangeIndices,\n\ttransformObjectMap,\n\tcompareStrings,\n\tfind,\n\tcount,\n\tgetLast,\n\thasSome,\n\thasSingle,\n\tdefineLazyCachedProperty,\n\tcopyPropertyIfDefined as copyProperty,\n\tgetOrAddInMap,\n\titerableHasSome,\n} from \"./utils.js\";\nexport { ReferenceCountedBase, type ReferenceCounted } from \"./referenceCounting.js\";\n\nexport type {\n\t_RecursiveTrick,\n\tRestrictiveReadonlyRecord,\n\tRestrictiveStringRecord,\n\t_InlineTrick,\n\tFlattenKeys,\n\tIsUnion,\n\tUnionToIntersection,\n\tUnionToTuple,\n\tPopUnion,\n} from \"./typeUtils.js\";\n\nexport { unsafeArrayToTuple } from \"./typeUtils.js\";\n\nexport {\n\ttype BrandedKey,\n\ttype BrandedKeyContent,\n\ttype BrandedMapSubset,\n\tgetOrCreateSlotContent,\n\tbrandedSlot,\n} from \"./brandedMap.js\";\n\nexport {\n\tRangeMap,\n\ttype RangeQueryResult,\n\tnewIntegerRangeMap,\n} from \"./rangeMap.js\";\n\nexport {\n\ttype IdAllocator,\n\tidAllocatorFromMaxId,\n\tidAllocatorFromState,\n\ttype IdAllocationState,\n\tfakeIdAllocator,\n} from \"./idAllocator.js\";\n\nexport {\n\tBreakable,\n\ttype WithBreakable,\n\tbreakingMethod,\n\tthrowIfBroken,\n\tbreakingClass,\n} from \"./breakable.js\";\n\nexport { type TupleBTree, newTupleBTree, mergeTupleBTrees } from \"./bTreeUtils.js\";\n\nexport { cloneWithReplacements } from \"./cloneWithReplacements.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,KAAK,EAEL,WAAW,EAGX,UAAU,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACN,WAAW,EACX,iBAAiB,GAGjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAGlB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAkB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAmB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAiBrE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACN,SAAS,EACT,cAAc,EACd,KAAK,EACL,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,eAAe,EAKf,4BAA4B,EAC5B,SAAS,EACT,WAAW,EACX,cAAc,EAId,gBAAgB,EAChB,gBAAgB,EAChB,4BAA4B,EAC5B,WAAW,EACX,SAAS,EACT,eAAe,EAEf,YAAY,EACZ,aAAa,EAEb,UAAU,EACV,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,IAAI,EACJ,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,EACT,wBAAwB,EACxB,qBAAqB,IAAI,YAAY,EACrC,aAAa,EACb,eAAe,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAyB,MAAM,wBAAwB,CAAC;AAcrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAIN,sBAAsB,EACtB,WAAW,GACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,QAAQ,EAER,kBAAkB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAEN,oBAAoB,EACpB,oBAAoB,EAEpB,eAAe,GACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,SAAS,EAET,cAAc,EACd,aAAa,EACb,aAAa,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAmB,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tvalidateIndex,\n\tvalidateIndexRange,\n\tvalidatePositiveIndex,\n\tvalidateSafeInteger,\n} from \"./arrayUtilities.js\";\nexport {\n\tbrand,\n\ttype Brand,\n\tBrandedType,\n\ttype NameFromBranded,\n\ttype ValueFromBranded,\n\tbrandConst,\n} from \"./brand.js\";\nexport { brandedNumberType, brandedStringType } from \"./typeboxBrand.js\";\nexport {\n\tbrandOpaque,\n\textractFromOpaque,\n\ttype ExtractFromOpaque,\n\ttype Opaque,\n} from \"./opaque.js\";\nexport {\n\tdeleteFromNestedMap,\n\tgetOrAddInNestedMap,\n\tgetOrDefaultInNestedMap,\n\tforEachInNestedMap,\n\ttype NestedMap,\n\ttype ReadonlyNestedMap,\n\tSizedNestedMap,\n\tpopulateNestedMap,\n\tsetInNestedMap,\n\ttryAddToNestedMap,\n\ttryGetFromNestedMap,\n\tmapNestedMap,\n\tnestedMapToFlatList,\n\tnestedMapFromFlatList,\n\tgetOrCreateInNestedMap,\n} from \"./nestedMap.js\";\nexport { addToNestedSet, type NestedSet, nestedSetContains } from \"./nestedSet.js\";\nexport { type OffsetList, OffsetListFactory } from \"./offsetList.js\";\nexport type {\n\tareSafelyAssignable,\n\tContravariant,\n\tCovariant,\n\teitherIsAny,\n\tEnforceTypeCheckTests,\n\tInvariant,\n\tisAny,\n\tisAssignableTo,\n\tisStrictSubset,\n\tMakeNominal,\n\trequireFalse,\n\trequireTrue,\n\trequireAssignableTo,\n\tareOnlyKeys,\n} from \"./typeCheck.js\";\nexport { StackyIterator } from \"./stackyIterator.js\";\nexport {\n\tasMutable,\n\tbalancedReduce,\n\tclone,\n\tcompareSets,\n\tgetOrAddEmptyToMap,\n\tgetOrCreate,\n\tisJsonObject,\n\tisReadonlyArray,\n\ttype JsonCompatible,\n\ttype JsonCompatibleObject,\n\ttype JsonCompatibleReadOnly,\n\ttype JsonCompatibleReadOnlyObject,\n\tJsonCompatibleReadOnlySchema,\n\tmakeArray,\n\tmapIterable,\n\tfilterIterable,\n\ttype Mutable,\n\ttype Populated,\n\ttype RecursiveReadonly,\n\tassertValidIndex,\n\tassertValidRange,\n\tassertNonNegativeSafeInteger,\n\tobjectToMap,\n\tinvertMap,\n\toneFromIterable,\n\ttype Named,\n\tcompareNamed,\n\tdisposeSymbol,\n\ttype IDisposable,\n\tcapitalize,\n\tassertValidRangeIndices,\n\ttransformObjectMap,\n\tcompareStrings,\n\tfind,\n\tcount,\n\tgetLast,\n\thasSome,\n\thasSingle,\n\tdefineLazyCachedProperty,\n\tcopyPropertyIfDefined as copyProperty,\n\tgetOrAddInMap,\n\titerableHasSome,\n} from \"./utils.js\";\nexport { ReferenceCountedBase, type ReferenceCounted } from \"./referenceCounting.js\";\n\nexport type {\n\t_RecursiveTrick,\n\tRestrictiveReadonlyRecord,\n\tRestrictiveStringRecord,\n\t_InlineTrick,\n\tFlattenKeys,\n\tIsUnion,\n\tUnionToIntersection,\n\tUnionToTuple,\n\tPopUnion,\n} from \"./typeUtils.js\";\n\nexport { unsafeArrayToTuple } from \"./typeUtils.js\";\n\nexport {\n\ttype BrandedKey,\n\ttype BrandedKeyContent,\n\ttype BrandedMapSubset,\n\tgetOrCreateSlotContent,\n\tbrandedSlot,\n} from \"./brandedMap.js\";\n\nexport {\n\tRangeMap,\n\ttype RangeQueryResult,\n\tnewIntegerRangeMap,\n} from \"./rangeMap.js\";\n\nexport {\n\ttype IdAllocator,\n\tidAllocatorFromMaxId,\n\tidAllocatorFromState,\n\ttype IdAllocationState,\n\tfakeIdAllocator,\n} from \"./idAllocator.js\";\n\nexport {\n\tBreakable,\n\ttype WithBreakable,\n\tbreakingMethod,\n\tthrowIfBroken,\n\tbreakingClass,\n} from \"./breakable.js\";\n\nexport { type TupleBTree, newTupleBTree, mergeTupleBTrees } from \"./bTreeUtils.js\";\n\nexport { cloneWithReplacements } from \"./cloneWithReplacements.js\";\n"]}