@fluidframework/tree 2.40.0-336023 → 2.41.0-337492

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 (457) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/api-report/tree.alpha.api.md +4 -1
  3. package/dist/alpha.d.ts +1 -0
  4. package/dist/codec/codec.d.ts +5 -1
  5. package/dist/codec/codec.d.ts.map +1 -1
  6. package/dist/codec/codec.js +6 -2
  7. package/dist/codec/codec.js.map +1 -1
  8. package/dist/codec/index.d.ts +1 -1
  9. package/dist/codec/index.d.ts.map +1 -1
  10. package/dist/codec/index.js +2 -1
  11. package/dist/codec/index.js.map +1 -1
  12. package/dist/core/index.d.ts +2 -2
  13. package/dist/core/index.d.ts.map +1 -1
  14. package/dist/core/index.js +2 -3
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
  17. package/dist/core/schema-stored/formatV1.d.ts.map +1 -0
  18. package/dist/core/schema-stored/{format.js → formatV1.js} +1 -1
  19. package/dist/core/schema-stored/formatV1.js.map +1 -0
  20. package/dist/core/schema-stored/index.d.ts +3 -3
  21. package/dist/core/schema-stored/index.d.ts.map +1 -1
  22. package/dist/core/schema-stored/index.js +3 -3
  23. package/dist/core/schema-stored/index.js.map +1 -1
  24. package/dist/core/schema-stored/schema.d.ts +3 -1
  25. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  26. package/dist/core/schema-stored/schema.js +8 -6
  27. package/dist/core/schema-stored/schema.js.map +1 -1
  28. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  29. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  30. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  31. package/dist/core/schema-view/index.d.ts +1 -1
  32. package/dist/core/schema-view/index.d.ts.map +1 -1
  33. package/dist/core/schema-view/index.js +1 -2
  34. package/dist/core/schema-view/index.js.map +1 -1
  35. package/dist/core/schema-view/view.d.ts +0 -27
  36. package/dist/core/schema-view/view.d.ts.map +1 -1
  37. package/dist/core/schema-view/view.js +1 -35
  38. package/dist/core/schema-view/view.js.map +1 -1
  39. package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
  40. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  41. package/dist/core/tree/persistedTreeTextFormat.js +1 -1
  42. package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
  43. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  44. package/dist/feature-libraries/default-schema/schemaChecker.js +0 -7
  45. package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  46. package/dist/feature-libraries/forest-summary/format.d.ts +2 -2
  47. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  48. package/dist/feature-libraries/forest-summary/format.js +1 -1
  49. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  50. package/dist/feature-libraries/index.d.ts +1 -1
  51. package/dist/feature-libraries/index.d.ts.map +1 -1
  52. package/dist/feature-libraries/index.js +4 -2
  53. package/dist/feature-libraries/index.js.map +1 -1
  54. package/dist/feature-libraries/mapTreeCursor.d.ts +3 -3
  55. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  56. package/dist/feature-libraries/mapTreeCursor.js +2 -2
  57. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  58. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
  59. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  60. package/dist/feature-libraries/modular-schema/modularChangeFormat.js +2 -2
  61. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  62. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
  63. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  64. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -5
  65. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  66. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  67. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  68. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  69. package/dist/feature-libraries/schema-index/codec.d.ts +34 -5
  70. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  71. package/dist/feature-libraries/schema-index/codec.js +63 -9
  72. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  73. package/{lib/feature-libraries/schema-index/format.d.ts → dist/feature-libraries/schema-index/formatV1.d.ts} +9 -9
  74. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
  75. package/dist/feature-libraries/schema-index/{format.js → formatV1.js} +4 -4
  76. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -0
  77. package/dist/feature-libraries/schema-index/index.d.ts +2 -2
  78. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  79. package/dist/feature-libraries/schema-index/index.js +6 -3
  80. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  81. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
  82. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  83. package/dist/feature-libraries/schema-index/schemaSummarizer.js +4 -4
  84. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  85. package/dist/index.d.ts +1 -0
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +10 -8
  88. package/dist/index.js.map +1 -1
  89. package/dist/packageVersion.d.ts +1 -1
  90. package/dist/packageVersion.js +1 -1
  91. package/dist/packageVersion.js.map +1 -1
  92. package/dist/shared-tree/independentView.d.ts.map +1 -1
  93. package/dist/shared-tree/independentView.js +1 -1
  94. package/dist/shared-tree/independentView.js.map +1 -1
  95. package/dist/shared-tree/index.d.ts +1 -1
  96. package/dist/shared-tree/index.d.ts.map +1 -1
  97. package/dist/shared-tree/index.js +2 -1
  98. package/dist/shared-tree/index.js.map +1 -1
  99. package/dist/shared-tree/schematizeTree.d.ts +9 -10
  100. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  101. package/dist/shared-tree/schematizeTree.js +10 -34
  102. package/dist/shared-tree/schematizeTree.js.map +1 -1
  103. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  104. package/dist/shared-tree/schematizingTreeView.js +4 -6
  105. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  106. package/dist/shared-tree/sharedTree.d.ts +28 -3
  107. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  108. package/dist/shared-tree/sharedTree.js +29 -3
  109. package/dist/shared-tree/sharedTree.js.map +1 -1
  110. package/dist/shared-tree/tree.d.ts +24 -0
  111. package/dist/shared-tree/tree.d.ts.map +1 -1
  112. package/dist/shared-tree/tree.js.map +1 -1
  113. package/dist/shared-tree/treeAlpha.d.ts +2 -0
  114. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  115. package/dist/shared-tree/treeAlpha.js +3 -2
  116. package/dist/shared-tree/treeAlpha.js.map +1 -1
  117. package/dist/shared-tree-core/branchCommitEnricher.d.ts +0 -1
  118. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  119. package/dist/shared-tree-core/branchCommitEnricher.js +0 -1
  120. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  121. package/dist/shared-tree-core/transactionEnricher.d.ts +1 -1
  122. package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  123. package/dist/shared-tree-core/transactionEnricher.js +4 -1
  124. package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
  125. package/dist/simple-tree/api/index.d.ts +2 -1
  126. package/dist/simple-tree/api/index.d.ts.map +1 -1
  127. package/dist/simple-tree/api/index.js +2 -1
  128. package/dist/simple-tree/api/index.js.map +1 -1
  129. package/dist/simple-tree/api/schemaFactory.d.ts +9 -0
  130. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  131. package/dist/simple-tree/api/schemaFactory.js +7 -0
  132. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  133. package/dist/simple-tree/api/storedSchema.d.ts +8 -7
  134. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  135. package/dist/simple-tree/api/storedSchema.js +13 -9
  136. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  137. package/dist/simple-tree/api/tree.d.ts +25 -0
  138. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  139. package/dist/simple-tree/api/tree.js.map +1 -1
  140. package/dist/simple-tree/api/treeBeta.d.ts +4 -1
  141. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  142. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  143. package/dist/simple-tree/api/treeChangeEvents.d.ts +83 -0
  144. package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
  145. package/dist/simple-tree/api/treeChangeEvents.js +7 -0
  146. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -0
  147. package/dist/simple-tree/api/treeNodeApi.d.ts +2 -1
  148. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  149. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  150. package/dist/simple-tree/arrayNode.d.ts +28 -0
  151. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  152. package/dist/simple-tree/arrayNode.js.map +1 -1
  153. package/dist/simple-tree/core/getOrCreateNode.d.ts +1 -1
  154. package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  155. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
  156. package/dist/simple-tree/core/index.d.ts +2 -1
  157. package/dist/simple-tree/core/index.d.ts.map +1 -1
  158. package/dist/simple-tree/core/index.js +5 -5
  159. package/dist/simple-tree/core/index.js.map +1 -1
  160. package/dist/simple-tree/core/treeNode.d.ts +94 -0
  161. package/dist/simple-tree/core/treeNode.d.ts.map +1 -0
  162. package/dist/simple-tree/core/treeNode.js +123 -0
  163. package/dist/simple-tree/core/treeNode.js.map +1 -0
  164. package/dist/simple-tree/core/treeNodeKernel.d.ts +2 -1
  165. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  166. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  167. package/dist/simple-tree/core/treeNodeSchema.d.ts +3 -1
  168. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  169. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  170. package/dist/simple-tree/core/types.d.ts +0 -165
  171. package/dist/simple-tree/core/types.d.ts.map +1 -1
  172. package/dist/simple-tree/core/types.js +1 -113
  173. package/dist/simple-tree/core/types.js.map +1 -1
  174. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  175. package/dist/simple-tree/core/unhydratedFlexTree.js +5 -1
  176. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  177. package/dist/simple-tree/core/withType.d.ts +1 -1
  178. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  179. package/dist/simple-tree/core/withType.js.map +1 -1
  180. package/dist/simple-tree/index.d.ts +2 -2
  181. package/dist/simple-tree/index.d.ts.map +1 -1
  182. package/dist/simple-tree/index.js +3 -2
  183. package/dist/simple-tree/index.js.map +1 -1
  184. package/dist/simple-tree/schemaTypes.d.ts +1 -0
  185. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  186. package/dist/simple-tree/schemaTypes.js.map +1 -1
  187. package/dist/simple-tree/toStoredSchema.d.ts +8 -8
  188. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  189. package/dist/simple-tree/toStoredSchema.js +27 -32
  190. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  191. package/dist/tableSchema.d.ts +309 -91
  192. package/dist/tableSchema.d.ts.map +1 -1
  193. package/dist/tableSchema.js +319 -78
  194. package/dist/tableSchema.js.map +1 -1
  195. package/dist/treeFactory.d.ts +1 -1
  196. package/dist/treeFactory.d.ts.map +1 -1
  197. package/dist/treeFactory.js +30 -75
  198. package/dist/treeFactory.js.map +1 -1
  199. package/lib/alpha.d.ts +1 -0
  200. package/lib/codec/codec.d.ts +5 -1
  201. package/lib/codec/codec.d.ts.map +1 -1
  202. package/lib/codec/codec.js +5 -1
  203. package/lib/codec/codec.js.map +1 -1
  204. package/lib/codec/index.d.ts +1 -1
  205. package/lib/codec/index.d.ts.map +1 -1
  206. package/lib/codec/index.js +1 -1
  207. package/lib/codec/index.js.map +1 -1
  208. package/lib/core/index.d.ts +2 -2
  209. package/lib/core/index.d.ts.map +1 -1
  210. package/lib/core/index.js +2 -2
  211. package/lib/core/index.js.map +1 -1
  212. package/lib/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
  213. package/lib/core/schema-stored/formatV1.d.ts.map +1 -0
  214. package/lib/core/schema-stored/{format.js → formatV1.js} +1 -1
  215. package/lib/core/schema-stored/formatV1.js.map +1 -0
  216. package/lib/core/schema-stored/index.d.ts +3 -3
  217. package/lib/core/schema-stored/index.d.ts.map +1 -1
  218. package/lib/core/schema-stored/index.js +2 -2
  219. package/lib/core/schema-stored/index.js.map +1 -1
  220. package/lib/core/schema-stored/schema.d.ts +3 -1
  221. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  222. package/lib/core/schema-stored/schema.js +3 -1
  223. package/lib/core/schema-stored/schema.js.map +1 -1
  224. package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  225. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  226. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  227. package/lib/core/schema-view/index.d.ts +1 -1
  228. package/lib/core/schema-view/index.d.ts.map +1 -1
  229. package/lib/core/schema-view/index.js +1 -1
  230. package/lib/core/schema-view/index.js.map +1 -1
  231. package/lib/core/schema-view/view.d.ts +0 -27
  232. package/lib/core/schema-view/view.d.ts.map +1 -1
  233. package/lib/core/schema-view/view.js +0 -34
  234. package/lib/core/schema-view/view.js.map +1 -1
  235. package/lib/core/tree/persistedTreeTextFormat.d.ts +4 -4
  236. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  237. package/lib/core/tree/persistedTreeTextFormat.js +2 -2
  238. package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
  239. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  240. package/lib/feature-libraries/default-schema/schemaChecker.js +0 -7
  241. package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  242. package/lib/feature-libraries/forest-summary/format.d.ts +2 -2
  243. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  244. package/lib/feature-libraries/forest-summary/format.js +2 -2
  245. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  246. package/lib/feature-libraries/index.d.ts +1 -1
  247. package/lib/feature-libraries/index.d.ts.map +1 -1
  248. package/lib/feature-libraries/index.js +1 -1
  249. package/lib/feature-libraries/index.js.map +1 -1
  250. package/lib/feature-libraries/mapTreeCursor.d.ts +3 -3
  251. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  252. package/lib/feature-libraries/mapTreeCursor.js +2 -2
  253. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  254. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
  255. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  256. package/lib/feature-libraries/modular-schema/modularChangeFormat.js +3 -3
  257. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  258. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
  259. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  260. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -6
  261. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  262. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  263. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  264. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
  265. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  266. package/lib/feature-libraries/schema-index/codec.d.ts +34 -5
  267. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  268. package/lib/feature-libraries/schema-index/codec.js +61 -9
  269. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  270. package/{dist/feature-libraries/schema-index/format.d.ts → lib/feature-libraries/schema-index/formatV1.d.ts} +9 -9
  271. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
  272. package/lib/feature-libraries/schema-index/{format.js → formatV1.js} +5 -5
  273. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -0
  274. package/lib/feature-libraries/schema-index/index.d.ts +2 -2
  275. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  276. package/lib/feature-libraries/schema-index/index.js +2 -2
  277. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  278. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
  279. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  280. package/lib/feature-libraries/schema-index/schemaSummarizer.js +5 -5
  281. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  282. package/lib/index.d.ts +1 -0
  283. package/lib/index.d.ts.map +1 -1
  284. package/lib/index.js +1 -0
  285. package/lib/index.js.map +1 -1
  286. package/lib/packageVersion.d.ts +1 -1
  287. package/lib/packageVersion.js +1 -1
  288. package/lib/packageVersion.js.map +1 -1
  289. package/lib/shared-tree/independentView.d.ts.map +1 -1
  290. package/lib/shared-tree/independentView.js +2 -2
  291. package/lib/shared-tree/independentView.js.map +1 -1
  292. package/lib/shared-tree/index.d.ts +1 -1
  293. package/lib/shared-tree/index.d.ts.map +1 -1
  294. package/lib/shared-tree/index.js +1 -1
  295. package/lib/shared-tree/index.js.map +1 -1
  296. package/lib/shared-tree/schematizeTree.d.ts +9 -10
  297. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  298. package/lib/shared-tree/schematizeTree.js +11 -35
  299. package/lib/shared-tree/schematizeTree.js.map +1 -1
  300. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  301. package/lib/shared-tree/schematizingTreeView.js +5 -7
  302. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  303. package/lib/shared-tree/sharedTree.d.ts +28 -3
  304. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  305. package/lib/shared-tree/sharedTree.js +29 -4
  306. package/lib/shared-tree/sharedTree.js.map +1 -1
  307. package/lib/shared-tree/tree.d.ts +24 -0
  308. package/lib/shared-tree/tree.d.ts.map +1 -1
  309. package/lib/shared-tree/tree.js.map +1 -1
  310. package/lib/shared-tree/treeAlpha.d.ts +2 -0
  311. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  312. package/lib/shared-tree/treeAlpha.js +4 -3
  313. package/lib/shared-tree/treeAlpha.js.map +1 -1
  314. package/lib/shared-tree-core/branchCommitEnricher.d.ts +0 -1
  315. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  316. package/lib/shared-tree-core/branchCommitEnricher.js +0 -1
  317. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  318. package/lib/shared-tree-core/transactionEnricher.d.ts +1 -1
  319. package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  320. package/lib/shared-tree-core/transactionEnricher.js +4 -1
  321. package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
  322. package/lib/simple-tree/api/index.d.ts +2 -1
  323. package/lib/simple-tree/api/index.d.ts.map +1 -1
  324. package/lib/simple-tree/api/index.js +1 -1
  325. package/lib/simple-tree/api/index.js.map +1 -1
  326. package/lib/simple-tree/api/schemaFactory.d.ts +9 -0
  327. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  328. package/lib/simple-tree/api/schemaFactory.js +7 -0
  329. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  330. package/lib/simple-tree/api/storedSchema.d.ts +8 -7
  331. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  332. package/lib/simple-tree/api/storedSchema.js +17 -11
  333. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  334. package/lib/simple-tree/api/tree.d.ts +25 -0
  335. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  336. package/lib/simple-tree/api/tree.js.map +1 -1
  337. package/lib/simple-tree/api/treeBeta.d.ts +4 -1
  338. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  339. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  340. package/lib/simple-tree/api/treeChangeEvents.d.ts +83 -0
  341. package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
  342. package/lib/simple-tree/api/treeChangeEvents.js +6 -0
  343. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -0
  344. package/lib/simple-tree/api/treeNodeApi.d.ts +2 -1
  345. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  346. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  347. package/lib/simple-tree/arrayNode.d.ts +28 -0
  348. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  349. package/lib/simple-tree/arrayNode.js.map +1 -1
  350. package/lib/simple-tree/core/getOrCreateNode.d.ts +1 -1
  351. package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  352. package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
  353. package/lib/simple-tree/core/index.d.ts +2 -1
  354. package/lib/simple-tree/core/index.d.ts.map +1 -1
  355. package/lib/simple-tree/core/index.js +1 -1
  356. package/lib/simple-tree/core/index.js.map +1 -1
  357. package/lib/simple-tree/core/treeNode.d.ts +94 -0
  358. package/lib/simple-tree/core/treeNode.d.ts.map +1 -0
  359. package/lib/simple-tree/core/treeNode.js +118 -0
  360. package/lib/simple-tree/core/treeNode.js.map +1 -0
  361. package/lib/simple-tree/core/treeNodeKernel.d.ts +2 -1
  362. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  363. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  364. package/lib/simple-tree/core/treeNodeSchema.d.ts +3 -1
  365. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  366. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  367. package/lib/simple-tree/core/types.d.ts +0 -165
  368. package/lib/simple-tree/core/types.d.ts.map +1 -1
  369. package/lib/simple-tree/core/types.js +0 -110
  370. package/lib/simple-tree/core/types.js.map +1 -1
  371. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  372. package/lib/simple-tree/core/unhydratedFlexTree.js +5 -1
  373. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  374. package/lib/simple-tree/core/withType.d.ts +1 -1
  375. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  376. package/lib/simple-tree/core/withType.js.map +1 -1
  377. package/lib/simple-tree/index.d.ts +2 -2
  378. package/lib/simple-tree/index.d.ts.map +1 -1
  379. package/lib/simple-tree/index.js +1 -1
  380. package/lib/simple-tree/index.js.map +1 -1
  381. package/lib/simple-tree/schemaTypes.d.ts +1 -0
  382. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  383. package/lib/simple-tree/schemaTypes.js.map +1 -1
  384. package/lib/simple-tree/toStoredSchema.d.ts +8 -8
  385. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  386. package/lib/simple-tree/toStoredSchema.js +26 -31
  387. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  388. package/lib/tableSchema.d.ts +309 -91
  389. package/lib/tableSchema.d.ts.map +1 -1
  390. package/lib/tableSchema.js +319 -78
  391. package/lib/tableSchema.js.map +1 -1
  392. package/lib/treeFactory.d.ts +1 -1
  393. package/lib/treeFactory.d.ts.map +1 -1
  394. package/lib/treeFactory.js +30 -75
  395. package/lib/treeFactory.js.map +1 -1
  396. package/package.json +21 -21
  397. package/src/codec/codec.ts +6 -1
  398. package/src/codec/index.ts +1 -0
  399. package/src/core/index.ts +1 -2
  400. package/src/core/schema-stored/index.ts +3 -3
  401. package/src/core/schema-stored/schema.ts +3 -1
  402. package/src/core/schema-stored/storedSchemaRepository.ts +1 -1
  403. package/src/core/schema-view/index.ts +0 -1
  404. package/src/core/schema-view/view.ts +0 -31
  405. package/src/core/tree/persistedTreeTextFormat.ts +2 -2
  406. package/src/feature-libraries/default-schema/schemaChecker.ts +0 -8
  407. package/src/feature-libraries/forest-summary/format.ts +2 -2
  408. package/src/feature-libraries/index.ts +7 -1
  409. package/src/feature-libraries/mapTreeCursor.ts +3 -3
  410. package/src/feature-libraries/modular-schema/modularChangeFormat.ts +3 -3
  411. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +38 -9
  412. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +3 -4
  413. package/src/feature-libraries/schema-index/codec.ts +80 -12
  414. package/src/feature-libraries/schema-index/{format.ts → formatV1.ts} +4 -4
  415. package/src/feature-libraries/schema-index/index.ts +7 -2
  416. package/src/feature-libraries/schema-index/schemaSummarizer.ts +9 -9
  417. package/src/index.ts +1 -0
  418. package/src/packageVersion.ts +1 -1
  419. package/src/shared-tree/independentView.ts +3 -2
  420. package/src/shared-tree/index.ts +2 -0
  421. package/src/shared-tree/schematizeTree.ts +6 -36
  422. package/src/shared-tree/schematizingTreeView.ts +5 -12
  423. package/src/shared-tree/sharedTree.ts +67 -6
  424. package/src/shared-tree/tree.ts +24 -0
  425. package/src/shared-tree/treeAlpha.ts +6 -3
  426. package/src/shared-tree-core/branchCommitEnricher.ts +0 -1
  427. package/src/shared-tree-core/transactionEnricher.ts +4 -1
  428. package/src/simple-tree/api/index.ts +2 -0
  429. package/src/simple-tree/api/schemaFactory.ts +9 -0
  430. package/src/simple-tree/api/storedSchema.ts +24 -13
  431. package/src/simple-tree/api/tree.ts +25 -0
  432. package/src/simple-tree/api/treeBeta.ts +3 -1
  433. package/src/simple-tree/api/treeChangeEvents.ts +84 -0
  434. package/src/simple-tree/api/treeNodeApi.ts +1 -1
  435. package/src/simple-tree/arrayNode.ts +28 -0
  436. package/src/simple-tree/core/getOrCreateNode.ts +1 -1
  437. package/src/simple-tree/core/index.ts +5 -4
  438. package/src/simple-tree/core/treeNode.ts +163 -0
  439. package/src/simple-tree/core/treeNodeKernel.ts +2 -1
  440. package/src/simple-tree/core/treeNodeSchema.ts +3 -1
  441. package/src/simple-tree/core/types.ts +0 -234
  442. package/src/simple-tree/core/unhydratedFlexTree.ts +6 -1
  443. package/src/simple-tree/core/withType.ts +1 -1
  444. package/src/simple-tree/index.ts +2 -1
  445. package/src/simple-tree/schemaTypes.ts +1 -0
  446. package/src/simple-tree/toStoredSchema.ts +42 -41
  447. package/src/tableSchema.ts +713 -259
  448. package/src/treeFactory.ts +56 -173
  449. package/dist/core/schema-stored/format.d.ts.map +0 -1
  450. package/dist/core/schema-stored/format.js.map +0 -1
  451. package/dist/feature-libraries/schema-index/format.d.ts.map +0 -1
  452. package/dist/feature-libraries/schema-index/format.js.map +0 -1
  453. package/lib/core/schema-stored/format.d.ts.map +0 -1
  454. package/lib/core/schema-stored/format.js.map +0 -1
  455. package/lib/feature-libraries/schema-index/format.d.ts.map +0 -1
  456. package/lib/feature-libraries/schema-index/format.js.map +0 -1
  457. /package/src/core/schema-stored/{format.ts → formatV1.ts} +0 -0
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type FieldHasDefault, type ImplicitAllowedTypes, type ImplicitFieldSchema, type InsertableTreeNodeFromImplicitAllowedTypes, type NodeKind, type SchemaFactoryAlpha, type ScopedSchemaName, TreeArrayNode, type TreeNode, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type WithType, type TreeFieldFromImplicitField, type InsertableTreeFieldFromImplicitField, type InternalTreeNode, type FieldSchema, type FieldKind, type ImplicitAnnotatedFieldSchema, type UnannotateImplicitFieldSchema } from "./simple-tree/index.js";
5
+ import { type FieldHasDefault, type ImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type NodeKind, type SchemaFactoryAlpha, type ScopedSchemaName, TreeArrayNode, type TreeNode, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type WithType, type TreeFieldFromImplicitField, type InsertableTreeFieldFromImplicitField, type InternalTreeNode, SchemaFactory, type ImplicitAnnotatedFieldSchema, type UnannotateImplicitFieldSchema } from "./simple-tree/index.js";
6
6
  /**
7
7
  * Not intended for use outside of this package.
8
8
  *
@@ -14,18 +14,27 @@ import { type FieldHasDefault, type ImplicitAllowedTypes, type ImplicitFieldSche
14
14
  * @system @internal
15
15
  */
16
16
  export declare namespace System_TableSchema {
17
+ /**
18
+ * Default type used for column and row "props" fields.
19
+ * @privateRemarks
20
+ * Longer term, it would be better to simply omit "props" altogether by default.
21
+ * For now, this ensures that the user doesn't have to specify a "props" entry when initializing column/row nodes
22
+ * and ensures that they cannot set anything that might conflict with future evolutions of the schema.
23
+ * @system @internal
24
+ */
25
+ type DefaultPropsType = ReturnType<typeof SchemaFactory.optional<[]>>;
17
26
  /**
18
27
  * A base interface for factory input options which include an schema factory.
19
28
  * @remarks This interface should not be referenced directly.
20
29
  * @privateRemarks This interface primarily exists to provide a single home for property documentation.
21
30
  * @system @internal
22
31
  */
23
- interface OptionsWithSchemaFactory<TScope extends string | undefined = string | undefined> {
32
+ interface OptionsWithSchemaFactory<TSchemaFactory extends SchemaFactoryAlpha> {
24
33
  /**
25
34
  * Schema factory with which the Column schema will be associated.
26
35
  * @remarks Can be used to associate the resulting schema with an existing {@link SchemaFactory.scope|scope}.
27
36
  */
28
- readonly schemaFactory: SchemaFactoryAlpha<TScope>;
37
+ readonly schemaFactory: TSchemaFactory;
29
38
  }
30
39
  /**
31
40
  * A base interface for factory input options which include the table cell schema.
@@ -33,7 +42,7 @@ export declare namespace System_TableSchema {
33
42
  * @privateRemarks This interface primarily exists to provide a single home for property documentation.
34
43
  * @system @internal
35
44
  */
36
- interface OptionsWithCellSchema<TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes> {
45
+ interface OptionsWithCellSchema<TCellSchema extends ImplicitAllowedTypes> {
37
46
  /**
38
47
  * Schema for the table's cells.
39
48
  */
@@ -44,12 +53,12 @@ export declare namespace System_TableSchema {
44
53
  * @remarks Includes parameters common to all column factory overloads.
45
54
  * @system @internal
46
55
  */
47
- type CreateColumnOptionsBase<TInputScope extends string | undefined = string | undefined> = OptionsWithSchemaFactory<TInputScope>;
56
+ type CreateColumnOptionsBase<TSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha> = OptionsWithSchemaFactory<TSchemaFactory>;
48
57
  /**
49
- * Factory for creating new table column schema.
58
+ * Factory for creating column schema.
50
59
  * @system @internal
51
60
  */
52
- function createColumnInternal<const TInputScope extends string | undefined, const TPropsSchema extends ImplicitAnnotatedFieldSchema>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Column">, NodeKind.Object, TreeNode & TableSchema.IColumn<TPropsSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Column">, NodeKind, unknown>, object & {
61
+ function createColumnSchema<const TInputScope extends string | undefined, const TPropsSchema extends ImplicitAnnotatedFieldSchema>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Column">, NodeKind.Object, TreeNode & TableSchema.Column<TPropsSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Column">, NodeKind, unknown>, object & {
53
62
  readonly id?: string | undefined;
54
63
  } & (FieldHasDefault<UnannotateImplicitFieldSchema<TPropsSchema>> extends true ? {
55
64
  /**
@@ -65,62 +74,61 @@ export declare namespace System_TableSchema {
65
74
  props: InsertableTreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TPropsSchema>>;
66
75
  }), true, {
67
76
  readonly props: TPropsSchema;
68
- readonly id: FieldSchema<FieldKind.Identifier, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, unknown>;
77
+ readonly id: import("./simple-tree/schemaTypes.js").FieldSchema<import("./simple-tree/schemaTypes.js").FieldKind.Identifier, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, unknown>;
69
78
  }>;
70
79
  /**
71
80
  * Base column schema type.
72
81
  * @sealed @system @internal
73
82
  */
74
- type ColumnSchemaBase<TScope extends string | undefined = string | undefined, TPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema> = ReturnType<typeof TableSchema.createColumn<TScope, TPropsSchema>>;
83
+ type ColumnSchemaBase<TScope extends string | undefined = string | undefined, TPropsSchema extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema> = ReturnType<typeof createColumnSchema<TScope, TPropsSchema>>;
75
84
  /**
76
85
  * Base options for creating table row schema.
77
86
  * @remarks Includes parameters common to all row factory overloads.
78
87
  * @system @internal
79
88
  */
80
- type CreateRowOptionsBase<TScope extends string | undefined = string | undefined, TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes> = OptionsWithSchemaFactory<TScope> & OptionsWithCellSchema<TCell>;
89
+ type CreateRowOptionsBase<TSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha, TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;
81
90
  /**
82
- * Factory for creating new table row schema.
83
- *
91
+ * Factory for creating row schema.
84
92
  * @sealed @internal
85
93
  */
86
- function createRowInternal<const TInputScope extends string | undefined, const TCellSchema extends ImplicitAllowedTypes, const TPropsSchema extends ImplicitFieldSchema>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, cellSchema: TCellSchema, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row">, NodeKind.Object, TreeNode & TableSchema.IRow<TCellSchema, TPropsSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row">, NodeKind, unknown>, object & {
94
+ function createRowSchema<const TInputScope extends string | undefined, const TCellSchema extends ImplicitAllowedTypes, const TPropsSchema extends ImplicitAnnotatedFieldSchema>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, cellSchema: TCellSchema, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row">, NodeKind.Object, TreeNode & TableSchema.Row<TCellSchema, TPropsSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row">, NodeKind, unknown>, object & {
87
95
  readonly id?: string | undefined;
88
96
  readonly cells: (import("./simple-tree/schemaTypes.js").InsertableTypedNode<TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, import("./simple-tree/mapNode.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, true, TCellSchema, import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema>, unknown> & (new (data?: InternalTreeNode | import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema> | undefined) => import("./simple-tree/mapNode.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>)> | undefined) & import("./simple-tree/schemaTypes.js").InsertableTypedNode<TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, import("./simple-tree/mapNode.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, true, TCellSchema, import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema>, unknown> & (new (data?: InternalTreeNode | import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema> | undefined) => import("./simple-tree/mapNode.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>)>;
89
- } & (FieldHasDefault<TPropsSchema> extends true ? {
97
+ } & (FieldHasDefault<UnannotateImplicitFieldSchema<TPropsSchema>> extends true ? {
90
98
  /**
91
99
  * The row's properties.
92
100
  * @remarks This is a user-defined schema that can be used to store additional information
93
101
  * about the row.
94
102
  */
95
- props?: InsertableTreeFieldFromImplicitField<TPropsSchema> | undefined;
103
+ props?: InsertableTreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TPropsSchema>> | undefined;
96
104
  } : {
97
105
  /**
98
106
  * The row's properties.
99
107
  * @remarks This is a user-defined schema that can be used to store additional information
100
108
  * about the row.
101
109
  */
102
- props: InsertableTreeFieldFromImplicitField<TPropsSchema>;
110
+ props: InsertableTreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TPropsSchema>>;
103
111
  }), true, {
104
112
  readonly props: TPropsSchema;
105
- readonly id: FieldSchema<FieldKind.Identifier, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, unknown>;
106
- readonly cells: FieldSchema<FieldKind.Required, TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, import("./simple-tree/mapNode.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, unknown>;
113
+ readonly id: import("./simple-tree/schemaTypes.js").FieldSchema<import("./simple-tree/schemaTypes.js").FieldKind.Identifier, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, unknown>;
114
+ readonly cells: import("./simple-tree/schemaTypes.js").FieldSchema<import("./simple-tree/schemaTypes.js").FieldKind.Required, TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, import("./simple-tree/mapNode.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, import("./simple-tree/mapNode.js").MapNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, unknown>;
107
115
  }>;
108
116
  /**
109
117
  * Base row schema type.
110
118
  * @sealed @system @internal
111
119
  */
112
- type RowSchemaBase<TScope extends string | undefined = string | undefined, TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes, TPropsSchema extends ImplicitFieldSchema = ImplicitFieldSchema> = ReturnType<typeof TableSchema.createRow<TScope, TCellSchema, TPropsSchema>>;
120
+ type RowSchemaBase<TScope extends string | undefined = string | undefined, TCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes, TPropsSchema extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema> = ReturnType<typeof createRowSchema<TScope, TCellSchema, TPropsSchema>>;
113
121
  /**
114
122
  * Base options for creating table schema.
115
123
  * @remarks Includes parameters common to all table factory overloads.
116
124
  * @system @internal
117
125
  */
118
- type TableFactoryOptionsBase<TScope extends string | undefined = string | undefined, TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes> = OptionsWithSchemaFactory<TScope> & OptionsWithCellSchema<TCell>;
126
+ type TableFactoryOptionsBase<TSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha, TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;
119
127
  /**
120
- * Factory for creating new table schema.
128
+ * Factory for creating table schema.
121
129
  * @system @internal
122
130
  */
123
- function createTableInternal<const TInputScope extends string | undefined, const TCellSchema extends ImplicitAllowedTypes, const TColumnSchema extends ColumnSchemaBase<TInputScope> = ColumnSchemaBase<TInputScope>, const TRowSchema extends RowSchemaBase<TInputScope, TCellSchema> = RowSchemaBase<TInputScope, TCellSchema>>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, _cellSchema: TCellSchema, columnSchema: TColumnSchema, rowSchema: TRowSchema): TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table">, NodeKind.Object, TreeNode & TableSchema.ITable<TCellSchema, TColumnSchema, TRowSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table">, NodeKind, unknown>, object & {
131
+ function createTableSchema<const TInputScope extends string | undefined, const TCellSchema extends ImplicitAllowedTypes, const TColumnSchema extends ColumnSchemaBase<TInputScope>, const TRowSchema extends RowSchemaBase<TInputScope, TCellSchema>>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, _cellSchema: TCellSchema, columnSchema: TColumnSchema, rowSchema: TRowSchema): TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table">, NodeKind.Object, TreeNode & TableSchema.Table<TCellSchema, TColumnSchema, TRowSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table">, NodeKind, unknown>, object & {
124
132
  readonly rows: (import("./simple-tree/schemaTypes.js").InsertableTypedNode<import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, true, TRowSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>> | undefined) => TreeArrayNode<TRowSchema, [TRowSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TRowSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TRowSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, unknown>), import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, true, TRowSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>> | undefined) => TreeArrayNode<TRowSchema, [TRowSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TRowSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TRowSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, unknown>)> | undefined) & import("./simple-tree/schemaTypes.js").InsertableTypedNode<import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, true, TRowSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>> | undefined) => TreeArrayNode<TRowSchema, [TRowSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TRowSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TRowSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, unknown>), import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, true, TRowSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>> | undefined) => TreeArrayNode<TRowSchema, [TRowSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TRowSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TRowSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.rows">, NodeKind.Array, unknown>)>;
125
133
  readonly columns: (import("./simple-tree/schemaTypes.js").InsertableTypedNode<import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, true, TColumnSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>> | undefined) => TreeArrayNode<TColumnSchema, [TColumnSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TColumnSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TColumnSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, unknown>), import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, true, TColumnSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>> | undefined) => TreeArrayNode<TColumnSchema, [TColumnSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TColumnSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TColumnSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, unknown>)> | undefined) & import("./simple-tree/schemaTypes.js").InsertableTypedNode<import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, true, TColumnSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>> | undefined) => TreeArrayNode<TColumnSchema, [TColumnSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TColumnSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TColumnSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, unknown>), import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, true, TColumnSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>> | undefined) => TreeArrayNode<TColumnSchema, [TColumnSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TColumnSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TColumnSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema> : never, import("./simple-tree/arrayNode.js").ReadonlyArrayNode<TreeNode | import("./simple-tree/schemaTypes.js").TreeLeafValue>> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table.columns">, NodeKind.Array, unknown>)>;
126
134
  }, true, {
@@ -131,20 +139,104 @@ export declare namespace System_TableSchema {
131
139
  * Base row schema type.
132
140
  * @sealed @system @internal
133
141
  */
134
- type TableSchemaBase<TScope extends string | undefined, TCell extends ImplicitAllowedTypes, TColumn extends ColumnSchemaBase<TScope> = ColumnSchemaBase<TScope>, TRow extends RowSchemaBase<TScope, TCell, ImplicitAllowedTypes> = RowSchemaBase<TScope, TCell, ImplicitAllowedTypes>> = ReturnType<typeof TableSchema.createTable<TScope, TCell, TColumn, TRow>>;
142
+ type TableSchemaBase<TScope extends string | undefined, TCell extends ImplicitAllowedTypes, TColumn extends ColumnSchemaBase<TScope>, TRow extends RowSchemaBase<TScope, TCell>> = ReturnType<typeof createTableSchema<TScope, TCell, TColumn, TRow>>;
135
143
  }
136
144
  /**
137
145
  * Contains types and factories for creating schema to represent dynamic tabular data.
138
- * @privateRemarks TODO: document in more detail and add `@example`s.
146
+ *
147
+ * @remarks
148
+ *
149
+ * Tables created using these APIs are...
150
+ *
151
+ * - sparse, meaning that cells may be omitted, and new rows are empty by default.
152
+ *
153
+ * - dynamic, meaning that their structure can be modified at runtime.
154
+ * Columns and rows can be inserted, removed, modified, and reordered.
155
+ * Cells can be inserted, removed, and modified.
156
+ *
157
+ * - row-major, meaning that operating on rows (including inserts, removal, moves, and traversal) is more efficient than operating on columns.
158
+ *
159
+ * Column and Row schema created using these APIs are extensible via the `props` field.
160
+ * This allows association of additional properties with column and row nodes.
161
+ *
162
+ * Note: for now it is possible for table cells to become "orphaned".
163
+ * That is, it is possible to enter a state where one or more rows contain cells with no corresponding column.
164
+ * To help avoid this situation, you can manually remove corresponding cells when removing columns.
165
+ * Either way, it is possible to enter such a state via the merging of edits.
166
+ * For example: one client might add a row while another concurrently removes a column, orphaning the cell where the column and row intersected.
167
+ *
168
+ * @example Using default Column and Row schema
169
+ *
170
+ * ```typescript
171
+ * class Cell extends schemaFactory.object("TableCell", {
172
+ * value: schemaFactory.string,
173
+ * }) {}
174
+ *
175
+ * class Table extends TableSchema.table({
176
+ * schemaFactory,
177
+ * cell: Cell,
178
+ * }) {}
179
+ *
180
+ * const table = new Table({
181
+ * columns: [{ id: "column-0" }],
182
+ * rows: [{ id: "row-0", cells: {} }],
183
+ * });
184
+ * ```
185
+ *
186
+ * @example Customizing Column and Row schema
187
+ *
188
+ * ```typescript
189
+ * class Cell extends schemaFactory.object("TableCell", {
190
+ * value: schemaFactory.string,
191
+ * }) {}
192
+ *
193
+ * class ColumnProps extends schemaFactory.object("TableColumnProps", {
194
+ * // Column label to display.
195
+ * label: schemaFactory.string,
196
+ * // The type of data represented by the cells. Default: string.
197
+ * dataType: schemaFactory.optional(schemaFactory.string),
198
+ * }) {}
199
+ *
200
+ * class Column extends TableSchema.column({
201
+ * schemaFactory,
202
+ * props: ColumnProps,
203
+ * }) {}
204
+ *
205
+ * class Row extends TableSchema.row({
206
+ * schemaFactory,
207
+ * cell: Cell,
208
+ * }) {}
209
+ *
210
+ * class Table extends TableSchema.table({
211
+ * schemaFactory,
212
+ * cell: Cell,
213
+ * column: Column,
214
+ * row: Row,
215
+ * }) {}
216
+ *
217
+ * const table = new Table({
218
+ * columns: [
219
+ * new Column({ props: { label: "Entry", dataType: "string" } }),
220
+ * new Column({ props: { label: "Date", dataType: "date" } }),
221
+ * new Column({ props: { label: "Amount", dataType: "number" } }),
222
+ * ],
223
+ * rows: [],
224
+ * });
225
+ * ```
226
+ *
227
+ * @privateRemarks
228
+ * The above examples are backed by tests in `tableSchema.spec.ts`.
229
+ * Those tests and these examples should be kept in-sync to ensure that the examples are correct.
230
+ *
139
231
  * @internal
140
232
  */
141
233
  export declare namespace TableSchema {
142
234
  /**
143
235
  * A column in a table.
144
- * @remarks Implemented by the schema class returned from {@link TableSchema.(createColumn:2)}.
236
+ * @remarks Implemented by the schema class returned from {@link TableSchema.(column:2)}.
145
237
  * @sealed @internal
146
238
  */
147
- interface IColumn<TProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema> {
239
+ interface Column<TProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema> {
148
240
  /**
149
241
  * The unique identifier of the column.
150
242
  * @remarks Uniquely identifies the node within the entire tree, not just the table.
@@ -154,33 +246,33 @@ export declare namespace TableSchema {
154
246
  * The column's properties.
155
247
  * @remarks This is a user-defined schema that can be used to store additional information about the column.
156
248
  * @privateRemarks
157
- * Note: these docs are duplicated on the inline type definitions in {@link createColumn}.
249
+ * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createColumnSchema}.
158
250
  * If you update the docs here, please also update the inline type definitions.
159
251
  */
160
- get props(): TreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps>> | undefined;
252
+ get props(): TreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps>>;
161
253
  set props(value: InsertableTreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps>>);
162
254
  }
163
255
  /**
164
256
  * Factory for creating new table column schema.
165
257
  * @internal
166
258
  */
167
- function createColumn<const TScope extends string | undefined>({ schemaFactory, }: System_TableSchema.CreateColumnOptionsBase<TScope>): ReturnType<typeof System_TableSchema.createColumnInternal<TScope, FieldSchema<FieldKind.Optional, typeof SchemaFactoryAlpha.null>>>;
259
+ function column<const TScope extends string | undefined>(params: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryAlpha<TScope>>): System_TableSchema.ColumnSchemaBase<TScope, System_TableSchema.DefaultPropsType>;
168
260
  /**
169
261
  * Factory for creating new table column schema.
170
262
  * @internal
171
263
  */
172
- function createColumn<const TScope extends string | undefined, const TProps extends ImplicitFieldSchema>({ schemaFactory, props, }: System_TableSchema.CreateColumnOptionsBase<TScope> & {
264
+ function column<const TScope extends string | undefined, const TProps extends ImplicitAnnotatedFieldSchema>(params: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryAlpha<TScope>> & {
173
265
  /**
174
266
  * Optional column properties.
175
267
  */
176
268
  readonly props: TProps;
177
- }): ReturnType<typeof System_TableSchema.createColumnInternal<TScope, TProps>>;
269
+ }): System_TableSchema.ColumnSchemaBase<TScope, TProps>;
178
270
  /**
179
271
  * A row in a table.
180
272
  * @remarks Implemented by the schema class returned from {@link TableSchema.(createRow:2)}.
181
273
  * @sealed @internal
182
274
  */
183
- interface IRow<TCell extends ImplicitAllowedTypes, TProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema> {
275
+ interface Row<TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes, TProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema> {
184
276
  /**
185
277
  * The unique identifier of the row.
186
278
  * @remarks Uniquely identifies the node within the entire tree, not just the table.
@@ -189,8 +281,9 @@ export declare namespace TableSchema {
189
281
  /**
190
282
  * Gets the cell in the specified column.
191
283
  * @returns The cell if it exists, otherwise undefined.
284
+ * @privateRemarks TODO: throw if the column does not belong to the same table as the row.
192
285
  */
193
- getCell(column: IColumn): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
286
+ getCell(column: Column): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
194
287
  /**
195
288
  * Gets the cell in the specified column, denoted by column ID.
196
289
  * @returns The cell if it exists, otherwise undefined.
@@ -198,29 +291,31 @@ export declare namespace TableSchema {
198
291
  getCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
199
292
  /**
200
293
  * Sets the cell in the specified column.
201
- * @remarks To remove a cell, call {@link TableSchema.IRow.(removeCell:1)} instead.
294
+ * @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:1)} instead.
295
+ * @privateRemarks TODO: Throw an error if the column does not exist in the table.
202
296
  */
203
- setCell(column: IColumn, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
297
+ setCell(column: Column, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
204
298
  /**
205
299
  * Sets the cell in the specified column, denoted by column ID.
206
- * @remarks To remove a cell, call {@link TableSchema.IRow.(removeCell:2)} instead.
300
+ * @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:2)} instead.
207
301
  */
208
302
  setCell(columnId: string, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
209
303
  /**
210
304
  * Removes the cell in the specified column.
211
- * @privateRemarks TODO: return removed cell
305
+ * @returns The cell if it exists, otherwise undefined.
306
+ * @privateRemarks TODO: Throw if the column does not belong to the same table as the row.
212
307
  */
213
- removeCell(column: IColumn): void;
308
+ removeCell(column: Column): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
214
309
  /**
215
310
  * Removes the cell in the specified column, denoted by column ID.
216
- * @privateRemarks TODO: return removed cell
311
+ * @returns The cell if it exists, otherwise undefined.
217
312
  */
218
- removeCell(columnId: string): void;
313
+ removeCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
219
314
  /**
220
315
  * The row's properties.
221
316
  * @remarks This is a user-defined schema that can be used to store additional information about the row.
222
317
  * @privateRemarks
223
- * Note: these docs are duplicated on the inline type definitions in {@link createColumn}.
318
+ * Note: these docs are duplicated on the inline type definitions in {@link System_TableSchema.createRowSchema}.
224
319
  * If you update the docs here, please also update the inline type definitions.
225
320
  */
226
321
  get props(): TreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps>>;
@@ -230,36 +325,36 @@ export declare namespace TableSchema {
230
325
  * Factory for creating new table column schema.
231
326
  * @internal
232
327
  */
233
- function createRow<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes>({ schemaFactory, cell, }: System_TableSchema.CreateRowOptionsBase<TScope, TCell>): ReturnType<typeof System_TableSchema.createRowInternal<TScope, TCell, FieldSchema<FieldKind.Optional, typeof SchemaFactoryAlpha.null>>>;
328
+ function row<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes>(params: System_TableSchema.CreateRowOptionsBase<SchemaFactoryAlpha<TScope>, TCell>): System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>;
234
329
  /**
235
- * Factory for creating new table column schema.
330
+ * Factory for creating new table row schema.
236
331
  * @internal
237
332
  */
238
- function createRow<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>({ schemaFactory, cell, props, }: System_TableSchema.CreateRowOptionsBase<TScope, TCell> & {
333
+ function row<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitAnnotatedFieldSchema>(params: System_TableSchema.CreateRowOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {
239
334
  /**
240
335
  * Optional row properties.
241
336
  */
242
337
  readonly props: TProps;
243
- }): ReturnType<typeof System_TableSchema.createRowInternal<TScope, TCell, TProps>>;
338
+ }): System_TableSchema.RowSchemaBase<TScope, TCell, TProps>;
244
339
  /**
245
- * A key to uniquely identify a cell in a table.
340
+ * A key to uniquely identify a cell within a table.
246
341
  * @internal
247
342
  */
248
- interface CellKey {
343
+ interface CellKey<TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
249
344
  /**
250
- * {@link TableSchema.IColumn.id} of the containing {@link TableSchema.IColumn}.
345
+ * {@link TableSchema.Column} or {@link TableSchema.Column.id} at which the cell is located.
251
346
  */
252
- readonly columnId: string;
347
+ readonly column: string | TreeNodeFromImplicitAllowedTypes<TColumn>;
253
348
  /**
254
- * {@link TableSchema.IRow.id} of the containing {@link TableSchema.IRow}.
349
+ * {@link TableSchema.Row} or {@link TableSchema.Row.id} at which the cell is located.
255
350
  */
256
- readonly rowId: string;
351
+ readonly row: string | TreeNodeFromImplicitAllowedTypes<TRow>;
257
352
  }
258
353
  /**
259
- * {@link TableSchema.ITable.insertColumn} parameters.
354
+ * {@link TableSchema.Table.insertColumn} parameters.
260
355
  * @internal
261
356
  */
262
- interface InsertColumnParameters<TInsertableColumn> {
357
+ interface InsertColumnParameters<TColumn extends ImplicitAllowedTypes> {
263
358
  /**
264
359
  * The index at which to insert the new column.
265
360
  * @remarks If not provided, the column will be appended to the end of the table.
@@ -268,13 +363,43 @@ export declare namespace TableSchema {
268
363
  /**
269
364
  * The column to insert.
270
365
  */
271
- readonly column: TInsertableColumn;
366
+ readonly column: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>;
272
367
  }
273
368
  /**
274
- * {@link TableSchema.ITable.insertRows} parameters.
369
+ * {@link TableSchema.Table.insertColumns} parameters.
275
370
  * @internal
276
371
  */
277
- interface InsertRowsParameters<TInsertableRow> {
372
+ interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
373
+ /**
374
+ * The index at which to insert the new columns.
375
+ * @remarks If not provided, the columns will be appended to the end of the table.
376
+ */
377
+ readonly index?: number | undefined;
378
+ /**
379
+ * The columns to insert.
380
+ */
381
+ readonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];
382
+ }
383
+ /**
384
+ * {@link TableSchema.Table.insertRow} parameters.
385
+ * @internal
386
+ */
387
+ interface InsertRowParameters<TRow extends ImplicitAllowedTypes> {
388
+ /**
389
+ * The index at which to insert the new row.
390
+ * @remarks If not provided, the row will be appended to the end of the table.
391
+ */
392
+ readonly index?: number | undefined;
393
+ /**
394
+ * The row to insert.
395
+ */
396
+ readonly row: InsertableTreeNodeFromImplicitAllowedTypes<TRow>;
397
+ }
398
+ /**
399
+ * {@link TableSchema.Table.insertRows} parameters.
400
+ * @internal
401
+ */
402
+ interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
278
403
  /**
279
404
  * The index at which to insert the new rows.
280
405
  * @remarks If not provided, the rows will be appended to the end of the table.
@@ -283,27 +408,27 @@ export declare namespace TableSchema {
283
408
  /**
284
409
  * The rows to insert.
285
410
  */
286
- readonly rows: TInsertableRow[];
411
+ readonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];
287
412
  }
288
413
  /**
289
- * {@link TableSchema.ITable.setCell} parameters.
414
+ * {@link TableSchema.Table.setCell} parameters.
290
415
  * @internal
291
416
  */
292
- interface SetCellParameters<TInsertableCell> {
417
+ interface SetCellParameters<TCell extends ImplicitAllowedTypes, TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
293
418
  /**
294
419
  * The key to uniquely identify a cell in a table.
295
420
  */
296
- readonly key: CellKey;
421
+ readonly key: CellKey<TColumn, TRow>;
297
422
  /**
298
423
  * The cell to set.
299
424
  */
300
- readonly cell: TInsertableCell;
425
+ readonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;
301
426
  }
302
427
  /**
303
428
  * A table.
304
429
  * @sealed @internal
305
430
  */
306
- interface ITable<TCell extends ImplicitAllowedTypes, TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
431
+ interface Table<TCell extends ImplicitAllowedTypes, TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
307
432
  /**
308
433
  * The table's columns.
309
434
  */
@@ -313,78 +438,171 @@ export declare namespace TableSchema {
313
438
  */
314
439
  readonly rows: TreeArrayNode<TRow>;
315
440
  /**
316
- * Gets a table column by its {@link TableSchema.IRow.id}.
441
+ * Gets a table column by its {@link TableSchema.Column.id}.
317
442
  */
318
443
  getColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
319
444
  /**
320
- * Gets a table row by its {@link TableSchema.IRow.id}.
445
+ * Gets a table row by its {@link TableSchema.Row.id}.
321
446
  */
322
447
  getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
323
448
  /**
324
449
  * Gets a cell in the table by column and row IDs.
325
450
  * @param key - A key that uniquely distinguishes a cell in the table, represented as a combination of the column ID and row ID.
326
- * @privateRemarks TODO: add overload that takes row and column nodes.
327
451
  */
328
- getCell(key: CellKey): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
452
+ getCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
329
453
  /**
330
454
  * Inserts a column into the table.
331
- * @throws Throws an error if the column is already in the tree, or if the specified index is out of range.
332
- */
333
- insertColumn(params: InsertColumnParameters<InsertableTreeNodeFromImplicitAllowedTypes<TColumn>>): TreeNodeFromImplicitAllowedTypes<TColumn>;
455
+ *
456
+ * @throws
457
+ * Throws an error in the following cases:
458
+ *
459
+ * - The column, or a column with the same ID is already in the tree.
460
+ *
461
+ * - The specified index is out of range.
462
+ *
463
+ * No column is inserted in these cases.
464
+ */
465
+ insertColumn(params: InsertColumnParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>;
466
+ /**
467
+ * Inserts 0 or more columns into the table.
468
+ *
469
+ * @throws
470
+ * Throws an error in the following cases:
471
+ *
472
+ * - At least one column, or a column with the same ID is already in the tree.
473
+ *
474
+ * - The specified index is out of range.
475
+ *
476
+ * No columns are inserted in these cases.
477
+ */
478
+ insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];
479
+ /**
480
+ * Inserts a row into the table.
481
+ *
482
+ * @throws
483
+ * Throws an error in the following cases:
484
+ *
485
+ * - The row, or a row with the same ID is already in the tree.
486
+ *
487
+ * - The row contains cells, but the table does not contain matching columns for one or more of those cells.
488
+ *
489
+ * - The specified index is out of range.
490
+ *
491
+ * No row is inserted in these cases.
492
+ */
493
+ insertRow(params: InsertRowParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>;
334
494
  /**
335
495
  * Inserts 0 or more rows into the table.
336
- * @throws Throws an error if any of the rows are already in the tree, or if the specified index is out of range.
337
- */
338
- insertRows(params: InsertRowsParameters<InsertableTreeNodeFromImplicitAllowedTypes<TRow>>): TreeNodeFromImplicitAllowedTypes<TRow>[];
496
+ *
497
+ * @throws
498
+ * Throws an error in the following cases:
499
+ *
500
+ * - At least one row, or a row with the same ID is already in the tree.
501
+ *
502
+ * - The row contains cells, but the table does not contain matching columns for one or more of those cells.
503
+ *
504
+ * - The specified index is out of range.
505
+ *
506
+ * No rows are inserted in these cases.
507
+ */
508
+ insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];
339
509
  /**
340
510
  * Sets the cell at the specified location in the table.
341
- * @remarks To remove a cell, call {@link TableSchema.ITable.removeCell} instead.
342
- * @privateRemarks TODO: add overload that takes column/row nodes?
511
+ * @remarks To remove a cell, call {@link TableSchema.Table.removeCell} instead.
343
512
  */
344
- setCell(params: SetCellParameters<InsertableTreeNodeFromImplicitAllowedTypes<TCell>>): void;
513
+ setCell(params: SetCellParameters<TCell, TColumn, TRow>): void;
345
514
  /**
346
515
  * Removes the specified column from the table.
347
- * @remarks Note: this does not remove any cells from the table's rows.
348
- * @privateRemarks
349
- * TODO:
350
- * - Policy for when the column is not in the table.
351
- * - Actually remove corresponding cells from table rows.
516
+ *
517
+ * @remarks
518
+ * Note: this does not remove any cells from the table's rows.
519
+ * To remove the corresponding cells, use {@link TableSchema.Table.removeCell}.
520
+ *
521
+ * @param column - The {@link TableSchema.Column | column} or {@link TableSchema.Column.id | column ID} to remove.
522
+ * @throws Throws an error if the column is not in the table.
523
+ * @privateRemarks TODO (future): Actually remove corresponding cells from table rows.
524
+ */
525
+ removeColumn(column: string | TreeNodeFromImplicitAllowedTypes<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>;
526
+ /**
527
+ * Removes 0 or more columns from the table.
528
+ *
529
+ * @remarks
530
+ * Note: this does not remove any cells from the table's rows.
531
+ * To remove the corresponding cells, use {@link TableSchema.Table.removeCell}.
532
+ *
533
+ * @param columns - The columns to remove.
534
+ * @throws Throws an error if any of the columns are not in the table.
535
+ * In this case, no columns are removed.
536
+ */
537
+ removeColumns(columns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
538
+ /**
539
+ * Removes 0 or more columns from the table.
540
+ *
541
+ * @remarks
542
+ * Note: this does not remove any cells from the table's rows.
543
+ * To remove the corresponding cells, use {@link TableSchema.Table.removeCell}.
544
+ *
545
+ * @param columns - The columns to remove, specified by their {@link TableSchema.Column.id}.
546
+ * @throws Throws an error if any of the columns are not in the table.
547
+ * In this case, no columns are removed.
548
+ */
549
+ removeColumns(columns: readonly string[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
550
+ /**
551
+ * Removes all columns from the table.
552
+ * @returns The removed columns.
553
+ */
554
+ removeAllColumns(): TreeNodeFromImplicitAllowedTypes<TColumn>[];
555
+ /**
556
+ * Removes the specified row from the table.
557
+ * @param row - The {@link TableSchema.Row | row} or {@link TableSchema.Row.id | row ID} to remove.
558
+ * @throws Throws an error if the row is not in the table.
559
+ */
560
+ removeRow(row: string | TreeNodeFromImplicitAllowedTypes<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>;
561
+ /**
562
+ * Removes 0 or more rows from the table.
563
+ * @param rows - The rows to remove.
564
+ * @throws Throws an error if any of the rows are not in the table.
565
+ * In this case, no rows are removed.
352
566
  */
353
- removeColumn: (column: TreeNodeFromImplicitAllowedTypes<TColumn>) => void;
567
+ removeRows(rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
354
568
  /**
355
569
  * Removes 0 or more rows from the table.
356
- * @privateRemarks TODO: policy for when 1 or more rows are not in the table.
570
+ * @param rows - The rows to remove, specified by their {@link TableSchema.Row.id}.
571
+ * @throws Throws an error if any of the rows are not in the table.
572
+ * In this case, no rows are removed.
357
573
  */
358
- removeRows: (rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]) => void;
574
+ removeRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
359
575
  /**
360
576
  * Removes all rows from the table.
577
+ * @returns The removed rows.
361
578
  */
362
- removeAllRows: () => void;
579
+ removeAllRows(): TreeNodeFromImplicitAllowedTypes<TRow>[];
363
580
  /**
364
581
  * Removes the cell at the specified location in the table.
365
- * @privateRemarks TODO: add overload that takes column/row nodes?
582
+ * @returns The cell if it exists, otherwise undefined.
583
+ * @throws Throws an error if the location does not exist in the table.
366
584
  */
367
- removeCell: (key: CellKey) => void;
585
+ removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
368
586
  }
369
587
  /**
370
588
  * Factory for creating new table schema without specifying row or column schema.
371
589
  * @internal
372
590
  */
373
- function createTable<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes>({ schemaFactory, cell, }: System_TableSchema.TableFactoryOptionsBase<TScope, TCell>): ReturnType<typeof System_TableSchema.createTableInternal<TScope, TCell>>;
591
+ function table<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes>(params: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryAlpha<TScope>, TCell>): System_TableSchema.TableSchemaBase<TScope, TCell, System_TableSchema.ColumnSchemaBase<TScope, System_TableSchema.DefaultPropsType>, System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>>;
374
592
  /**
375
593
  * Factory for creating new table schema without specifying row schema.
376
594
  * @internal
377
595
  */
378
- function createTable<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TColumn extends System_TableSchema.ColumnSchemaBase<TScope>>({ schemaFactory, cell, column, }: System_TableSchema.TableFactoryOptionsBase<TScope, TCell> & {
596
+ function table<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TColumn extends System_TableSchema.ColumnSchemaBase<TScope>>(params: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {
379
597
  readonly column: TColumn;
380
- }): ReturnType<typeof System_TableSchema.createTableInternal<TScope, TCell, TColumn>>;
598
+ }): System_TableSchema.TableSchemaBase<TScope, TCell, TColumn, System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>>;
381
599
  /**
382
600
  * Factory for creating new table schema.
383
601
  * @internal
384
602
  */
385
- function createTable<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TColumn extends System_TableSchema.ColumnSchemaBase<TScope>, const TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>>({ schemaFactory, cell, column, row, }: System_TableSchema.TableFactoryOptionsBase<TScope, TCell> & {
603
+ function table<const TScope extends string | undefined, const TCell extends ImplicitAllowedTypes, const TColumn extends System_TableSchema.ColumnSchemaBase<TScope>, const TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>>(params: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {
386
604
  readonly column: TColumn;
387
605
  readonly row: TRow;
388
- }): ReturnType<typeof System_TableSchema.createTableInternal<TScope, TCell, TColumn, TRow>>;
606
+ }): System_TableSchema.TableSchemaBase<TScope, TCell, TColumn, TRow>;
389
607
  }
390
608
  //# sourceMappingURL=tableSchema.d.ts.map