@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
@@ -6,7 +6,7 @@
6
6
  import { fail } from "@fluidframework/core-utils/internal";
7
7
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
8
8
 
9
- import { Tree, TreeAlpha } from "./shared-tree/index.js";
9
+ import { TreeAlpha } from "./shared-tree/index.js";
10
10
  import {
11
11
  type FieldHasDefault,
12
12
  type ImplicitAllowedTypes,
@@ -26,10 +26,10 @@ import {
26
26
  type InternalTreeNode,
27
27
  SchemaFactory,
28
28
  type ImplicitFieldSchema,
29
- isArrayNodeSchema,
30
- type InsertableField,
31
29
  withBufferedTreeEvents,
30
+ type TreeRecordNode,
32
31
  } from "./simple-tree/index.js";
32
+ import { validateIndex, validateIndexRange } from "./util/index.js";
33
33
 
34
34
  // Future improvement TODOs:
35
35
  // - Omit `cells` property from Row insertion type.
@@ -44,52 +44,31 @@ import {
44
44
  */
45
45
  const tableSchemaFactorySubScope = "table";
46
46
 
47
- /**
48
- * Gets the table containing the provided row/column node, if the node is part of a table.
49
- * @remarks Assumes that the table is the grandparent of the row/column node.
50
- */
51
- function getParentTable(
52
- rowOrColumnNode: TreeNode,
53
- ):
54
- | (TreeNode &
55
- TableSchema.Table<
56
- string | undefined,
57
- ImplicitAllowedTypes,
58
- System_TableSchema.ColumnSchemaBase,
59
- System_TableSchema.RowSchemaBase
60
- >)
61
- | undefined {
62
- const rowListNode = Tree.parent(rowOrColumnNode);
63
- if (rowListNode === undefined || !isArrayNodeSchema(Tree.schema(rowListNode))) {
64
- return undefined;
65
- }
66
- const tableNode = Tree.parent(rowListNode);
67
- if (tableNode === undefined || !isTableNode(tableNode)) {
68
- return undefined;
69
- }
70
-
71
- return tableNode;
72
- }
73
-
74
47
  /**
75
48
  * A private symbol put on table schema to help identify them.
76
49
  */
77
50
  const tableSchemaSymbol: unique symbol = Symbol("tableNode");
78
51
 
79
52
  /**
80
- * Type-guard to determine if a node is a table node.
81
- * @remarks Uses {@link tableSchemaSymbol} to identify table nodes.
53
+ * A row in a table.
54
+ * @typeParam TCell - The type of the cells in the {@link TableSchema.Table}.
55
+ * @typeParam TProps - Additional properties to associate with the row.
56
+ * @privateRemarks Private counterpart to the {@link TableSchema.Row}.
57
+ * Exposes internal properties needed for table operations (publicly exposed via {@link TableSchema.Table}).
58
+ * @sealed
82
59
  */
83
- function isTableNode(
84
- node: TreeNode,
85
- ): node is TreeNode &
86
- TableSchema.Table<
87
- string | undefined,
88
- ImplicitAllowedTypes,
89
- System_TableSchema.ColumnSchemaBase,
90
- System_TableSchema.RowSchemaBase
91
- > {
92
- return tableSchemaSymbol in Tree.schema(node);
60
+ export interface RowPrivate<
61
+ TCell extends ImplicitAllowedTypes,
62
+ TProps extends ImplicitFieldSchema = ImplicitFieldSchema,
63
+ > extends TableSchema.Row<TCell, TProps> {
64
+ /**
65
+ * The row's cells.
66
+ * @remarks This is a user-defined schema that can be used to store additional information about the row.
67
+ * @privateRemarks
68
+ * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createRowSchema}.
69
+ * If you update the docs here, please also update the inline type definitions.
70
+ */
71
+ readonly cells: TreeRecordNode<TCell>;
93
72
  }
94
73
 
95
74
  /**
@@ -161,16 +140,10 @@ export namespace System_TableSchema {
161
140
  const TInputScope extends string | undefined,
162
141
  const TCellSchema extends ImplicitAllowedTypes,
163
142
  const TPropsSchema extends ImplicitFieldSchema,
164
- >(
165
- inputSchemaFactory: SchemaFactoryBeta<TInputScope>,
166
- cellSchema: TCellSchema,
167
- propsSchema: TPropsSchema,
168
- ) {
143
+ >(inputSchemaFactory: SchemaFactoryBeta<TInputScope>, propsSchema: TPropsSchema) {
169
144
  const schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);
170
145
  type Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;
171
146
 
172
- type CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;
173
-
174
147
  // Note: `columnFields` is broken into two parts to work around a TypeScript bug
175
148
  // that results in broken `.d.ts` output.
176
149
  // See definition of `ColumnInsertableType` below.
@@ -205,36 +178,7 @@ export namespace System_TableSchema {
205
178
  // Will make it easier to evolve this schema in the future.
206
179
  allowUnknownOptionalFields: true,
207
180
  })
208
- implements TableSchema.Column<TCellSchema, TPropsSchema>
209
- {
210
- public getCells(): {
211
- rowId: string;
212
- cell: CellValueType;
213
- }[] {
214
- const tableNode = getParentTable(this);
215
- if (tableNode === undefined) {
216
- throw new UsageError(`Column with ID "${this.id}" is not contained in a table.`);
217
- }
218
-
219
- const result: {
220
- rowId: string;
221
- cell: CellValueType;
222
- }[] = [];
223
- for (const row of tableNode.rows) {
224
- const cell = row.getCell(this.id);
225
- if (cell !== undefined) {
226
- if (!Tree.is(cell, cellSchema)) {
227
- throw new UsageError(
228
- "Parent table contains a cell with incompatible with this column.",
229
- );
230
- }
231
-
232
- result.push({ rowId: row.id, cell });
233
- }
234
- }
235
- return result;
236
- }
237
- }
181
+ implements TableSchema.Column<TCellSchema, TPropsSchema> {}
238
182
 
239
183
  type ColumnValueType = TreeNode &
240
184
  TableSchema.Column<TCellSchema, TPropsSchema> &
@@ -344,9 +288,6 @@ export namespace System_TableSchema {
344
288
  const schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);
345
289
  type Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;
346
290
 
347
- type CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;
348
- type CellInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TCellSchema>;
349
-
350
291
  // Note: `rowFields` is broken into two parts to work around a TypeScript bug
351
292
  // that results in broken `.d.ts` output.
352
293
  // See definition of `RowInsertableType` below.
@@ -368,7 +309,7 @@ export namespace System_TableSchema {
368
309
  } as const;
369
310
 
370
311
  /**
371
- * {@link Row} fields.
312
+ * {@link RowSchema} fields.
372
313
  * @remarks Extracted for re-use in returned type signature defined later in this function.
373
314
  * The implicit typing is intentional.
374
315
  * Note: ideally we would add a satisfies clause here to ensure that this satisfies
@@ -383,75 +324,12 @@ export namespace System_TableSchema {
383
324
  /**
384
325
  * The Row schema - this is a map of Cells where the key is the column id
385
326
  */
386
- class Row
327
+ class RowSchema
387
328
  extends schemaFactory.object("Row", rowFields, {
388
329
  // Will make it easier to evolve this schema in the future.
389
330
  allowUnknownOptionalFields: true,
390
331
  })
391
- implements TableSchema.Row<TCellSchema, TPropsSchema>
392
- {
393
- public getCell(
394
- columnOrId: TableSchema.Column<TCellSchema> | string,
395
- ): CellValueType | undefined {
396
- const columnId = typeof columnOrId === "string" ? columnOrId : columnOrId.id;
397
- // Unlike most objects, RecordNodes don't have the default inherited object properties, so this is safe
398
- return this.cells[columnId];
399
- }
400
-
401
- public setCell(
402
- columnOrId: TableSchema.Column<TCellSchema> | string,
403
- value: CellInsertableType | undefined,
404
- ): void {
405
- // TODO: throw if column does not exist in the owning table.
406
-
407
- if (value === undefined) {
408
- this.removeCell(columnOrId);
409
- } else {
410
- const columnId = typeof columnOrId === "string" ? columnOrId : columnOrId.id;
411
-
412
- // TypeScript is unable to narrow the types correctly here, hence the casts.
413
- // See: https://github.com/microsoft/TypeScript/issues/52144
414
- this.cells[columnId] = TreeAlpha.create(
415
- cellSchema,
416
- value as InsertableField<TCellSchema>,
417
- ) as CellValueType;
418
- }
419
- }
420
-
421
- public removeCell(
422
- columnOrId: TableSchema.Column<TCellSchema> | string,
423
- ): CellValueType | undefined {
424
- // TODO: throw if column does not exist in the owning table.
425
-
426
- const columnId = typeof columnOrId === "string" ? columnOrId : columnOrId.id;
427
-
428
- const cell: CellValueType | undefined = this.getCell(columnId);
429
- if (cell === undefined) {
430
- return undefined;
431
- }
432
-
433
- // 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.
434
- delete this.cells[columnId];
435
-
436
- return cell;
437
- }
438
-
439
- public getCells(): {
440
- columnId: string;
441
- cell: CellValueType;
442
- }[] {
443
- const result = [];
444
- for (const [columnId, cell] of Object.entries(this.cells)) {
445
- if (cell !== undefined) {
446
- result.push({
447
- columnId,
448
- cell,
449
- });
450
- }
451
- }
452
- return result;
453
- }
454
- }
332
+ implements RowPrivate<TCellSchema, TPropsSchema> {}
455
333
 
456
334
  type RowValueType = TreeNode &
457
335
  TableSchema.Row<TCellSchema, TPropsSchema> &
@@ -494,14 +372,14 @@ export namespace System_TableSchema {
494
372
  type RowSchemaModifiedType = Omit<
495
373
  // Use mapped type to omit the constructor
496
374
  {
497
- [Property in keyof typeof Row]: (typeof Row)[Property];
375
+ [Property in keyof typeof RowSchema]: (typeof RowSchema)[Property];
498
376
  },
499
377
  "createFromInsertable"
500
378
  > &
501
379
  (new (
502
380
  parameters: InternalTreeNode | RowInsertableType,
503
- ) => Row) & {
504
- createFromInsertable(parameters: RowInsertableType): Row;
381
+ ) => RowSchema) & {
382
+ createFromInsertable(parameters: RowInsertableType): RowSchema;
505
383
  };
506
384
 
507
385
  // Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly "__#124291@#brand": unknown;`
@@ -516,7 +394,7 @@ export namespace System_TableSchema {
516
394
  /* TInsertable */ object & RowInsertableType,
517
395
  /* ImplicitlyConstructable */ true,
518
396
  /* Info */ typeof rowFields
519
- > = Row as RowSchemaModifiedType;
397
+ > = RowSchema as RowSchemaModifiedType;
520
398
 
521
399
  return RowSchemaType;
522
400
  }
@@ -568,6 +446,9 @@ export namespace System_TableSchema {
568
446
  type ColumnValueType = TreeNodeFromImplicitAllowedTypes<TColumnSchema>;
569
447
  type RowValueType = TreeNodeFromImplicitAllowedTypes<TRowSchema>;
570
448
 
449
+ // Internal version of RowValueType that exposes the `cells` property for use within Table methods.
450
+ type RowValueInternalType = RowValueType & RowPrivate<TCellSchema>;
451
+
571
452
  /**
572
453
  * {@link Table} fields.
573
454
  * @remarks Extracted for re-use in returned type signature defined later in this function.
@@ -595,45 +476,43 @@ export namespace System_TableSchema {
595
476
  }
596
477
 
597
478
  public getColumn(indexOrId: number | string): ColumnValueType | undefined {
598
- return this._tryGetColumn(indexOrId);
479
+ return this.#tryGetColumn(indexOrId);
599
480
  }
600
481
 
601
482
  public getRow(indexOrId: number | string): RowValueType | undefined {
602
- return this._tryGetRow(indexOrId);
483
+ return this.#tryGetRow(indexOrId);
603
484
  }
604
485
 
605
486
  public getCell(
606
487
  key: TableSchema.CellKey<TColumnSchema, TRowSchema>,
607
488
  ): CellValueType | undefined {
608
489
  const { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;
609
- const row = this._tryGetRow(rowOrIdOrIndex);
490
+ const row = this.#tryGetRow(rowOrIdOrIndex);
610
491
  if (row === undefined) {
611
492
  return undefined;
612
493
  }
613
494
 
614
- const column = this._tryGetColumn(columnOrIdOrIndex);
495
+ const column = this.#tryGetColumn(columnOrIdOrIndex);
615
496
  if (column === undefined) {
616
497
  return undefined;
617
498
  }
618
499
 
619
- return row.getCell(column);
500
+ return (row as RowValueInternalType).cells[column.id];
620
501
  }
621
502
 
622
503
  public insertColumns({
623
504
  columns,
624
505
  index,
625
506
  }: TableSchema.InsertColumnsParameters<TColumnSchema>): ColumnValueType[] {
626
- // Ensure index is valid
627
- if (index !== undefined) {
628
- Table.validateInsertionIndex(index, this.columns);
629
- }
630
-
631
507
  // TypeScript is unable to narrow the column type correctly here, hence the casts below.
632
508
  // See: https://github.com/microsoft/TypeScript/issues/52144
633
509
  if (index === undefined) {
634
510
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
635
511
  this.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);
636
512
  } else {
513
+ // Ensure specified index is valid
514
+ validateIndex(index, this.columns, "Table.insertColumns", true);
515
+
637
516
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
638
517
  this.columns.insertAt(index, TreeArrayNode.spread(columns) as any);
639
518
  }
@@ -648,9 +527,9 @@ export namespace System_TableSchema {
648
527
  }: TableSchema.InsertRowsParameters<TRowSchema>): RowValueType[] {
649
528
  // #region Input validation
650
529
 
651
- // Ensure index is valid
530
+ // Ensure specified index is valid
652
531
  if (index !== undefined) {
653
- Table.validateInsertionIndex(index, this.rows);
532
+ validateIndex(index, this.rows, "Table.insertRows", true);
654
533
  }
655
534
 
656
535
  // Note: TypeScript is unable to narrow the type of the row type correctly here, hence the casts below.
@@ -663,7 +542,7 @@ export namespace System_TableSchema {
663
542
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
664
543
  const keys: string[] = Object.keys((newRow as any).cells);
665
544
  for (const key of keys) {
666
- if (!this._containsColumnWithId(key)) {
545
+ if (!this.#containsColumnWithId(key)) {
667
546
  throw new UsageError(
668
547
  `Attempted to insert row a cell under column ID "${key}", but the table does not contain a column with that ID.`,
669
548
  );
@@ -694,10 +573,10 @@ export namespace System_TableSchema {
694
573
  }: TableSchema.SetCellParameters<TCellSchema, TColumnSchema, TRowSchema>): void {
695
574
  const { column: columnOrId, row: rowOrId } = key;
696
575
 
697
- const row = this._getRow(rowOrId);
698
- const column = this._getColumn(columnOrId);
576
+ const row = this.#getRow(rowOrId);
577
+ const column = this.#getColumn(columnOrId);
699
578
 
700
- row.setCell(column, cell);
579
+ (row as RowValueInternalType).cells[column.id] = cell as CellValueType;
701
580
  }
702
581
 
703
582
  public removeColumns(
@@ -707,34 +586,28 @@ export namespace System_TableSchema {
707
586
  if (typeof indexOrColumns === "number" || indexOrColumns === undefined) {
708
587
  let removedColumns: ColumnValueType[] | undefined;
709
588
  const startIndex = indexOrColumns ?? 0;
710
- const _count = count ?? this.columns.length - startIndex;
589
+ const endIndex = count === undefined ? this.columns.length : startIndex + count;
711
590
 
712
591
  // If there are no columns to remove, do nothing
713
- if (_count === 0) {
592
+ if (startIndex === endIndex) {
714
593
  return [];
715
594
  }
716
595
 
717
- Table._assertValidRange({ index: startIndex, count: _count }, this.columns);
596
+ validateIndexRange(startIndex, endIndex, this.columns, "Table.removeColumns");
718
597
 
719
- this._applyEditsInBatch(() => {
598
+ this.#applyEditsInBatch(() => {
720
599
  const columnsToRemove = this.columns.slice(
721
600
  startIndex,
722
- startIndex + _count,
601
+ endIndex,
723
602
  ) as ColumnValueType[];
724
603
 
725
604
  // First, remove all cells that correspond to each column from each row:
726
605
  for (const column of columnsToRemove) {
727
- this._removeCells(column);
606
+ this.#removeCells(column);
728
607
  }
729
608
 
730
609
  // Second, remove the column nodes:
731
- Table._removeRange(
732
- {
733
- index: startIndex,
734
- count: _count,
735
- },
736
- this.columns,
737
- );
610
+ removeRangeFromArray(startIndex, endIndex, this.columns, "Table.removeColumns");
738
611
  removedColumns = columnsToRemove;
739
612
  });
740
613
  return removedColumns ?? fail(0xc1f /* Transaction did not complete. */);
@@ -749,10 +622,10 @@ export namespace System_TableSchema {
749
622
  // This improves user-facing error experience.
750
623
  const columnsToRemove: ColumnValueType[] = [];
751
624
  for (const columnOrIdToRemove of indexOrColumns) {
752
- columnsToRemove.push(this._getColumn(columnOrIdToRemove));
625
+ columnsToRemove.push(this.#getColumn(columnOrIdToRemove));
753
626
  }
754
627
 
755
- this._applyEditsInBatch(() => {
628
+ this.#applyEditsInBatch(() => {
756
629
  // Note, throwing an error within a transaction will abort the entire transaction.
757
630
  // So if we throw an error here for any column, no columns will be removed.
758
631
  for (const columnToRemove of columnsToRemove) {
@@ -760,7 +633,10 @@ export namespace System_TableSchema {
760
633
  for (const row of this.rows) {
761
634
  // TypeScript is unable to narrow the row type correctly here, hence the cast.
762
635
  // See: https://github.com/microsoft/TypeScript/issues/52144
763
- (row as RowValueType).removeCell(columnToRemove);
636
+ this.removeCell({
637
+ column: columnToRemove,
638
+ row: row as RowValueType,
639
+ });
764
640
  }
765
641
 
766
642
  // We have already validated that all of the columns exist above, so this is safe.
@@ -777,20 +653,14 @@ export namespace System_TableSchema {
777
653
  ): RowValueType[] {
778
654
  if (typeof indexOrRows === "number" || indexOrRows === undefined) {
779
655
  const startIndex = indexOrRows ?? 0;
780
- const _count = count ?? this.columns.length - startIndex;
656
+ const endIndex = count === undefined ? this.columns.length : startIndex + count;
781
657
 
782
658
  // If there are no rows to remove, do nothing
783
- if (_count === 0) {
659
+ if (startIndex === endIndex) {
784
660
  return [];
785
661
  }
786
662
 
787
- return Table._removeRange(
788
- {
789
- index: startIndex,
790
- count: _count,
791
- },
792
- this.rows,
793
- );
663
+ return removeRangeFromArray(startIndex, endIndex, this.rows, "Table.removeRows");
794
664
  }
795
665
 
796
666
  // If there are no rows to remove, do nothing
@@ -803,10 +673,10 @@ export namespace System_TableSchema {
803
673
  // This improves user-facing error experience.
804
674
  const rowsToRemove: RowValueType[] = [];
805
675
  for (const rowToRemove of indexOrRows) {
806
- rowsToRemove.push(this._getRow(rowToRemove));
676
+ rowsToRemove.push(this.#getRow(rowToRemove));
807
677
  }
808
678
 
809
- this._applyEditsInBatch(() => {
679
+ this.#applyEditsInBatch(() => {
810
680
  // Note, throwing an error within a transaction will abort the entire transaction.
811
681
  // So if we throw an error here for any row, no rows will be removed.
812
682
  for (const rowToRemove of rowsToRemove) {
@@ -822,48 +692,30 @@ export namespace System_TableSchema {
822
692
  key: TableSchema.CellKey<TColumnSchema, TRowSchema>,
823
693
  ): CellValueType | undefined {
824
694
  const { column: columnOrIdOrIndex, row: rowOrIdOrIndex } = key;
825
- const row = this._getRow(rowOrIdOrIndex);
826
- const column = this._getColumn(columnOrIdOrIndex);
695
+ const row = this.#getRow(rowOrIdOrIndex) as RowValueInternalType;
696
+ const column = this.#getColumn(columnOrIdOrIndex);
827
697
 
828
- const cell: CellValueType | undefined = row.getCell(column.id);
698
+ const cell: CellValueType | undefined = row.cells[column.id];
829
699
  if (cell === undefined) {
830
700
  return undefined;
831
701
  }
832
702
 
833
- row.removeCell(column.id);
703
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
704
+ delete row.cells[column.id];
834
705
  return cell;
835
706
  }
836
707
 
837
708
  /**
838
709
  * Removes the cell corresponding with the specified column from each row in the table.
839
710
  */
840
- private _removeCells(column: ColumnValueType): void {
711
+ #removeCells(column: ColumnValueType): void {
841
712
  for (const row of this.rows) {
842
713
  // TypeScript is unable to narrow the row type correctly here, hence the cast.
843
714
  // See: https://github.com/microsoft/TypeScript/issues/52144
844
- (row as RowValueType).removeCell(column);
845
- }
846
- }
847
-
848
- private static _assertValidRange<T>(
849
- range: { index: number; count: number },
850
- array: readonly T[],
851
- ): void {
852
- const { index, count } = range;
853
- if (index < 0 || index >= array.length) {
854
- throw new UsageError(
855
- `Start index out of bounds. Expected index to be on [0, ${array.length - 1}], but got ${index}.`,
856
- );
857
- }
858
- if (count < 0) {
859
- throw new UsageError(`Expected non-negative count. Got ${count}.`);
860
- }
861
-
862
- const end = index + count; // exclusive
863
- if (end > array.length) {
864
- throw new UsageError(
865
- `End index out of bounds. Expected end to be on [${index}, ${array.length}], but got ${end}.`,
866
- );
715
+ this.removeCell({
716
+ column,
717
+ row: row as RowValueType,
718
+ });
867
719
  }
868
720
  }
869
721
 
@@ -876,7 +728,7 @@ export namespace System_TableSchema {
876
728
  * Transactions are not supported for unhydrated trees, so we cannot run a transaction in that case.
877
729
  * But since there are no collaborators, this is not an issue.
878
730
  */
879
- private _applyEditsInBatch(applyEdits: () => void): void {
731
+ #applyEditsInBatch(applyEdits: () => void): void {
880
732
  const branch = TreeAlpha.branch(this);
881
733
 
882
734
  // Ensure events are paused until all of the edits are applied.
@@ -901,7 +753,7 @@ export namespace System_TableSchema {
901
753
  * Returns `undefined` if there is no match.
902
754
  * @remarks Searches for a match based strictly on the ID and returns that result.
903
755
  */
904
- private _tryGetColumn(
756
+ #tryGetColumn(
905
757
  columnOrIdOrIndex: ColumnValueType | string | number,
906
758
  ): ColumnValueType | undefined {
907
759
  if (typeof columnOrIdOrIndex === "number") {
@@ -935,10 +787,8 @@ export namespace System_TableSchema {
935
787
  * @throws Throws a `UsageError` if there is no match.
936
788
  * @remarks Searches for a match based strictly on the ID and returns that result.
937
789
  */
938
- private _getColumn(
939
- columnOrIdOrIndex: ColumnValueType | string | number,
940
- ): ColumnValueType {
941
- const column = this._tryGetColumn(columnOrIdOrIndex);
790
+ #getColumn(columnOrIdOrIndex: ColumnValueType | string | number): ColumnValueType {
791
+ const column = this.#tryGetColumn(columnOrIdOrIndex);
942
792
  if (column === undefined) {
943
793
  Table._throwMissingColumnError(columnOrIdOrIndex);
944
794
  }
@@ -948,8 +798,8 @@ export namespace System_TableSchema {
948
798
  /**
949
799
  * Checks if a Column with the specified ID exists in the table.
950
800
  */
951
- private _containsColumnWithId(columnId: string): boolean {
952
- return this._tryGetColumn(columnId) !== undefined;
801
+ #containsColumnWithId(columnId: string): boolean {
802
+ return this.#tryGetColumn(columnId) !== undefined;
953
803
  }
954
804
 
955
805
  /**
@@ -978,9 +828,7 @@ export namespace System_TableSchema {
978
828
  * Returns `undefined` if there is no match.
979
829
  * @remarks Searches for a match based strictly on the ID and returns that result.
980
830
  */
981
- private _tryGetRow(
982
- rowOrIdOrIndex: RowValueType | string | number,
983
- ): RowValueType | undefined {
831
+ #tryGetRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType | undefined {
984
832
  if (typeof rowOrIdOrIndex === "number") {
985
833
  if (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.rows.length) {
986
834
  return undefined;
@@ -1012,8 +860,8 @@ export namespace System_TableSchema {
1012
860
  * @throws Throws a `UsageError` if there is no match.
1013
861
  * @remarks Searches for a match based strictly on the ID and returns that result.
1014
862
  */
1015
- private _getRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType {
1016
- const row = this._tryGetRow(rowOrIdOrIndex);
863
+ #getRow(rowOrIdOrIndex: RowValueType | string | number): RowValueType {
864
+ const row = this.#tryGetRow(rowOrIdOrIndex);
1017
865
  if (row === undefined) {
1018
866
  Table._throwMissingRowError(rowOrIdOrIndex);
1019
867
  }
@@ -1038,47 +886,6 @@ export namespace System_TableSchema {
1038
886
  `The specified row node with ID "${rowOrIdOrIndex.id}" does not exist in the table.`,
1039
887
  );
1040
888
  }
1041
-
1042
- private static _removeRange<TNodeSchema extends ImplicitAllowedTypes>(
1043
- range: { index: number; count: number },
1044
- array: TreeArrayNode<TNodeSchema>,
1045
- ): TreeNodeFromImplicitAllowedTypes<TNodeSchema>[] {
1046
- Table._assertValidRange(range, array);
1047
-
1048
- const { index, count } = range;
1049
- const end = index + count; // exclusive
1050
-
1051
- // TypeScript is unable to narrow the array element type correctly here, hence the cast.
1052
- // See: https://github.com/microsoft/TypeScript/issues/52144
1053
- const removedRows = array.slice(
1054
- index,
1055
- end,
1056
- ) as TreeNodeFromImplicitAllowedTypes<TNodeSchema>[];
1057
- array.removeRange(index, end);
1058
-
1059
- return removedRows;
1060
- }
1061
-
1062
- /**
1063
- * Ensure that the specified index is a valid location for item insertion in the destination list.
1064
- * @throws Throws a usage error if the destination is invalid.
1065
- */
1066
- private static validateInsertionIndex(
1067
- index: number,
1068
- destinationList: readonly unknown[],
1069
- ): void {
1070
- if (index < 0) {
1071
- throw new UsageError("The index must be greater than or equal to 0.");
1072
- }
1073
-
1074
- if (index > destinationList.length) {
1075
- throw new UsageError("The index specified for insertion is out of bounds.");
1076
- }
1077
-
1078
- if (!Number.isInteger(index)) {
1079
- throw new UsageError("The index must be an integer.");
1080
- }
1081
- }
1082
889
  }
1083
890
 
1084
891
  // Set a private symbol on the schema class that marks it as having been generated by this factory.
@@ -1131,6 +938,29 @@ export namespace System_TableSchema {
1131
938
  // #endregion
1132
939
  }
1133
940
 
941
+ /**
942
+ * Removes the specified range of elements from the array.
943
+ * @returns The removed elements.
944
+ */
945
+ function removeRangeFromArray<TNodeSchema extends ImplicitAllowedTypes>(
946
+ startIndex: number,
947
+ endIndex: number,
948
+ array: TreeArrayNode<TNodeSchema>,
949
+ methodName: string,
950
+ ): TreeNodeFromImplicitAllowedTypes<TNodeSchema>[] {
951
+ validateIndexRange(startIndex, endIndex, array, methodName);
952
+
953
+ // TypeScript is unable to narrow the array element type correctly here, hence the cast.
954
+ // See: https://github.com/microsoft/TypeScript/issues/52144
955
+ const removedRows = array.slice(
956
+ startIndex,
957
+ endIndex,
958
+ ) as TreeNodeFromImplicitAllowedTypes<TNodeSchema>[];
959
+ array.removeRange(startIndex, endIndex);
960
+
961
+ return removedRows;
962
+ }
963
+
1134
964
  /**
1135
965
  * Contains types and factories for creating schema to represent dynamic tabular data.
1136
966
  *
@@ -1256,6 +1086,7 @@ export namespace TableSchema {
1256
1086
  * @sealed @alpha
1257
1087
  */
1258
1088
  export interface Column<
1089
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Reserving this for future use.
1259
1090
  TCell extends ImplicitAllowedTypes,
1260
1091
  TProps extends ImplicitFieldSchema = ImplicitFieldSchema,
1261
1092
  > {
@@ -1274,15 +1105,6 @@ export namespace TableSchema {
1274
1105
  */
1275
1106
  get props(): TreeFieldFromImplicitField<TProps>;
1276
1107
  set props(value: InsertableTreeFieldFromImplicitField<TProps>);
1277
-
1278
- /**
1279
- * Gets all of the populated cells in the column, keyed by their associated row IDs.
1280
- * @throws Throws an error if the column is not in a table.
1281
- */
1282
- getCells(): readonly {
1283
- rowId: string;
1284
- cell: TreeNodeFromImplicitAllowedTypes<TCell>;
1285
- }[];
1286
1108
  }
1287
1109
 
1288
1110
  /**
@@ -1326,7 +1148,7 @@ export namespace TableSchema {
1326
1148
  }: System_TableSchema.CreateColumnOptionsBase & {
1327
1149
  readonly props?: ImplicitFieldSchema;
1328
1150
  }): TreeNodeSchema {
1329
- return System_TableSchema.createColumnSchema(schemaFactory, cell, props);
1151
+ return System_TableSchema.createColumnSchema(schemaFactory, props);
1330
1152
  }
1331
1153
 
1332
1154
  // #endregion
@@ -1341,6 +1163,7 @@ export namespace TableSchema {
1341
1163
  * @sealed @alpha
1342
1164
  */
1343
1165
  export interface Row<
1166
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Reserving this for future use.
1344
1167
  TCell extends ImplicitAllowedTypes,
1345
1168
  TProps extends ImplicitFieldSchema = ImplicitFieldSchema,
1346
1169
  > {
@@ -1350,53 +1173,6 @@ export namespace TableSchema {
1350
1173
  */
1351
1174
  readonly id: string;
1352
1175
 
1353
- /**
1354
- * Gets the cell in the specified column.
1355
- * @returns The cell if it exists, otherwise undefined.
1356
- * @privateRemarks TODO: throw if the column does not belong to the same table as the row.
1357
- */
1358
- getCell(column: Column<TCell>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1359
- /**
1360
- * Gets the cell in the specified column, denoted by column ID.
1361
- * @returns The cell if it exists, otherwise undefined.
1362
- */
1363
- getCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1364
-
1365
- /**
1366
- * Gets all of the populated cells in the row, keyed by their associated column IDs.
1367
- */
1368
- getCells(): readonly {
1369
- columnId: string;
1370
- cell: TreeNodeFromImplicitAllowedTypes<TCell>;
1371
- }[];
1372
-
1373
- /**
1374
- * Sets the cell in the specified column.
1375
- * @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:1)} instead.
1376
- * @privateRemarks TODO: Throw an error if the column does not exist in the table.
1377
- */
1378
- setCell(
1379
- column: Column<TCell>,
1380
- value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>,
1381
- ): void;
1382
- /**
1383
- * Sets the cell in the specified column, denoted by column ID.
1384
- * @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:2)} instead.
1385
- */
1386
- setCell(columnId: string, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
1387
-
1388
- /**
1389
- * Removes the cell in the specified column.
1390
- * @returns The cell if it exists, otherwise undefined.
1391
- * @privateRemarks TODO: Throw if the column does not belong to the same table as the row.
1392
- */
1393
- removeCell(column: Column<TCell>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1394
- /**
1395
- * Removes the cell in the specified column, denoted by column ID.
1396
- * @returns The cell if it exists, otherwise undefined.
1397
- */
1398
- removeCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1399
-
1400
1176
  /**
1401
1177
  * The row's properties.
1402
1178
  * @remarks This is a user-defined schema that can be used to store additional information about the row.