@fluidframework/tree 2.33.2 → 2.40.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 (621) hide show
  1. package/.vscode/settings.json +2 -0
  2. package/CHANGELOG.md +64 -0
  3. package/api-report/tree.alpha.api.md +124 -51
  4. package/api-report/tree.beta.api.md +31 -27
  5. package/api-report/tree.legacy.alpha.api.md +24 -23
  6. package/api-report/tree.legacy.public.api.md +24 -23
  7. package/api-report/tree.public.api.md +24 -23
  8. package/dist/alpha.d.ts +17 -1
  9. package/dist/beta.d.ts +2 -0
  10. package/dist/codec/codec.d.ts +5 -1
  11. package/dist/codec/codec.d.ts.map +1 -1
  12. package/dist/codec/codec.js +6 -2
  13. package/dist/codec/codec.js.map +1 -1
  14. package/dist/codec/index.d.ts +1 -1
  15. package/dist/codec/index.d.ts.map +1 -1
  16. package/dist/codec/index.js +2 -1
  17. package/dist/codec/index.js.map +1 -1
  18. package/dist/core/index.d.ts +2 -2
  19. package/dist/core/index.d.ts.map +1 -1
  20. package/dist/core/index.js +2 -3
  21. package/dist/core/index.js.map +1 -1
  22. package/dist/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
  23. package/dist/core/schema-stored/formatV1.d.ts.map +1 -0
  24. package/dist/core/schema-stored/{format.js → formatV1.js} +1 -1
  25. package/dist/core/schema-stored/formatV1.js.map +1 -0
  26. package/dist/core/schema-stored/index.d.ts +3 -3
  27. package/dist/core/schema-stored/index.d.ts.map +1 -1
  28. package/dist/core/schema-stored/index.js +3 -3
  29. package/dist/core/schema-stored/index.js.map +1 -1
  30. package/dist/core/schema-stored/schema.d.ts +3 -1
  31. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  32. package/dist/core/schema-stored/schema.js +8 -6
  33. package/dist/core/schema-stored/schema.js.map +1 -1
  34. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  35. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  36. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  37. package/dist/core/schema-view/index.d.ts +1 -1
  38. package/dist/core/schema-view/index.d.ts.map +1 -1
  39. package/dist/core/schema-view/index.js +1 -2
  40. package/dist/core/schema-view/index.js.map +1 -1
  41. package/dist/core/schema-view/view.d.ts +0 -27
  42. package/dist/core/schema-view/view.d.ts.map +1 -1
  43. package/dist/core/schema-view/view.js +1 -35
  44. package/dist/core/schema-view/view.js.map +1 -1
  45. package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
  46. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  47. package/dist/core/tree/persistedTreeTextFormat.js +1 -1
  48. package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
  49. package/dist/feature-libraries/forest-summary/format.d.ts +2 -2
  50. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  51. package/dist/feature-libraries/forest-summary/format.js +1 -1
  52. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  53. package/dist/feature-libraries/index.d.ts +1 -1
  54. package/dist/feature-libraries/index.d.ts.map +1 -1
  55. package/dist/feature-libraries/index.js +4 -2
  56. package/dist/feature-libraries/index.js.map +1 -1
  57. package/dist/feature-libraries/mapTreeCursor.d.ts +3 -3
  58. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  59. package/dist/feature-libraries/mapTreeCursor.js +2 -2
  60. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  61. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
  62. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  63. package/dist/feature-libraries/modular-schema/modularChangeFormat.js +2 -2
  64. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  65. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
  66. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  67. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -5
  68. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  69. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  70. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  71. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  72. package/dist/feature-libraries/schema-index/codec.d.ts +34 -5
  73. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  74. package/dist/feature-libraries/schema-index/codec.js +63 -9
  75. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  76. package/{lib/feature-libraries/schema-index/format.d.ts → dist/feature-libraries/schema-index/formatV1.d.ts} +9 -9
  77. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
  78. package/dist/feature-libraries/schema-index/{format.js → formatV1.js} +4 -4
  79. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -0
  80. package/dist/feature-libraries/schema-index/index.d.ts +2 -2
  81. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  82. package/dist/feature-libraries/schema-index/index.js +6 -3
  83. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  84. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
  85. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  86. package/dist/feature-libraries/schema-index/schemaSummarizer.js +4 -4
  87. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  88. package/dist/index.d.ts +3 -2
  89. package/dist/index.d.ts.map +1 -1
  90. package/dist/index.js +10 -8
  91. package/dist/index.js.map +1 -1
  92. package/dist/internalTypes.d.ts +0 -1
  93. package/dist/internalTypes.d.ts.map +1 -1
  94. package/dist/internalTypes.js.map +1 -1
  95. package/dist/jsonDomainSchema.d.ts +2 -2
  96. package/dist/jsonDomainSchema.js +2 -2
  97. package/dist/jsonDomainSchema.js.map +1 -1
  98. package/dist/legacy.d.ts +2 -0
  99. package/dist/packageVersion.d.ts +1 -1
  100. package/dist/packageVersion.js +1 -1
  101. package/dist/packageVersion.js.map +1 -1
  102. package/dist/public.d.ts +2 -0
  103. package/dist/serializableDomainSchema.d.ts +3 -3
  104. package/dist/serializableDomainSchema.js +2 -2
  105. package/dist/serializableDomainSchema.js.map +1 -1
  106. package/dist/shared-tree/independentView.d.ts +1 -1
  107. package/dist/shared-tree/independentView.d.ts.map +1 -1
  108. package/dist/shared-tree/independentView.js +1 -1
  109. package/dist/shared-tree/independentView.js.map +1 -1
  110. package/dist/shared-tree/index.d.ts +4 -3
  111. package/dist/shared-tree/index.d.ts.map +1 -1
  112. package/dist/shared-tree/index.js +6 -5
  113. package/dist/shared-tree/index.js.map +1 -1
  114. package/dist/shared-tree/schematizeTree.d.ts +10 -11
  115. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  116. package/dist/shared-tree/schematizeTree.js +11 -36
  117. package/dist/shared-tree/schematizeTree.js.map +1 -1
  118. package/dist/shared-tree/schematizingTreeView.d.ts +3 -3
  119. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  120. package/dist/shared-tree/schematizingTreeView.js +4 -7
  121. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  122. package/dist/shared-tree/sharedTree.d.ts +28 -3
  123. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  124. package/dist/shared-tree/sharedTree.js +29 -3
  125. package/dist/shared-tree/sharedTree.js.map +1 -1
  126. package/dist/shared-tree/{treeApi.d.ts → tree.d.ts} +58 -34
  127. package/dist/shared-tree/tree.d.ts.map +1 -0
  128. package/dist/shared-tree/{treeApi.js → tree.js} +6 -6
  129. package/dist/shared-tree/tree.js.map +1 -0
  130. package/{lib/shared-tree/treeApiAlpha.d.ts → dist/shared-tree/treeAlpha.d.ts} +24 -14
  131. package/dist/shared-tree/treeAlpha.d.ts.map +1 -0
  132. package/dist/shared-tree/{treeApiAlpha.js → treeAlpha.js} +7 -5
  133. package/dist/shared-tree/treeAlpha.js.map +1 -0
  134. package/dist/shared-tree-core/branchCommitEnricher.d.ts +0 -1
  135. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  136. package/dist/shared-tree-core/branchCommitEnricher.js +0 -1
  137. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  138. package/dist/shared-tree-core/transactionEnricher.d.ts +1 -1
  139. package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  140. package/dist/shared-tree-core/transactionEnricher.js +4 -1
  141. package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
  142. package/dist/simple-tree/api/conciseTree.d.ts +1 -1
  143. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  144. package/dist/simple-tree/api/configuration.d.ts +177 -0
  145. package/dist/simple-tree/api/configuration.d.ts.map +1 -0
  146. package/dist/simple-tree/api/configuration.js +163 -0
  147. package/dist/simple-tree/api/configuration.js.map +1 -0
  148. package/dist/simple-tree/api/getJsonSchema.js +2 -2
  149. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  150. package/dist/simple-tree/api/index.d.ts +9 -5
  151. package/dist/simple-tree/api/index.d.ts.map +1 -1
  152. package/dist/simple-tree/api/index.js +9 -7
  153. package/dist/simple-tree/api/index.js.map +1 -1
  154. package/dist/simple-tree/api/{view.d.ts → schemaCompatibilityTester.d.ts} +8 -10
  155. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -0
  156. package/dist/simple-tree/api/{view.js → schemaCompatibilityTester.js} +9 -9
  157. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -0
  158. package/dist/simple-tree/api/schemaFactory.d.ts +25 -10
  159. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  160. package/dist/simple-tree/api/schemaFactory.js +27 -12
  161. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  162. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +12 -6
  163. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  164. package/dist/simple-tree/api/schemaFactoryAlpha.js +2 -2
  165. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  166. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +67 -4
  167. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  168. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  169. package/dist/simple-tree/api/schemaFromSimple.d.ts +1 -1
  170. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  171. package/dist/simple-tree/api/schemaFromSimple.js +1 -1
  172. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  173. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  174. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  175. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  176. package/dist/simple-tree/api/storedSchema.d.ts +11 -10
  177. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  178. package/dist/simple-tree/api/storedSchema.js +16 -11
  179. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  180. package/dist/simple-tree/api/tree.d.ts +30 -174
  181. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  182. package/dist/simple-tree/api/tree.js +1 -156
  183. package/dist/simple-tree/api/tree.js.map +1 -1
  184. package/{lib/simple-tree/api/treeApiBeta.d.ts → dist/simple-tree/api/treeBeta.d.ts} +17 -6
  185. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -0
  186. package/dist/simple-tree/api/{treeApiBeta.js → treeBeta.js} +5 -4
  187. package/dist/simple-tree/api/treeBeta.js.map +1 -0
  188. package/dist/simple-tree/api/treeChangeEvents.d.ts +83 -0
  189. package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
  190. package/dist/simple-tree/api/treeChangeEvents.js +7 -0
  191. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -0
  192. package/dist/simple-tree/api/treeNodeApi.d.ts +2 -1
  193. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  194. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  195. package/dist/simple-tree/api/typesUnsafe.d.ts +4 -9
  196. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  197. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  198. package/dist/simple-tree/arrayNode.d.ts +30 -2
  199. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  200. package/dist/simple-tree/arrayNode.js +3 -2
  201. package/dist/simple-tree/arrayNode.js.map +1 -1
  202. package/dist/simple-tree/arrayNodeTypes.d.ts +3 -3
  203. package/dist/simple-tree/arrayNodeTypes.d.ts.map +1 -1
  204. package/dist/simple-tree/arrayNodeTypes.js.map +1 -1
  205. package/dist/simple-tree/core/getOrCreateNode.d.ts +1 -1
  206. package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  207. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
  208. package/dist/simple-tree/core/index.d.ts +2 -1
  209. package/dist/simple-tree/core/index.d.ts.map +1 -1
  210. package/dist/simple-tree/core/index.js +5 -5
  211. package/dist/simple-tree/core/index.js.map +1 -1
  212. package/dist/simple-tree/core/treeNode.d.ts +94 -0
  213. package/dist/simple-tree/core/treeNode.d.ts.map +1 -0
  214. package/dist/simple-tree/core/treeNode.js +123 -0
  215. package/dist/simple-tree/core/treeNode.js.map +1 -0
  216. package/dist/simple-tree/core/treeNodeKernel.d.ts +2 -1
  217. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  218. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  219. package/dist/simple-tree/core/treeNodeSchema.d.ts +3 -1
  220. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  221. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  222. package/dist/simple-tree/core/types.d.ts +0 -165
  223. package/dist/simple-tree/core/types.d.ts.map +1 -1
  224. package/dist/simple-tree/core/types.js +1 -113
  225. package/dist/simple-tree/core/types.js.map +1 -1
  226. package/dist/simple-tree/core/withType.d.ts +1 -1
  227. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  228. package/dist/simple-tree/core/withType.js.map +1 -1
  229. package/dist/simple-tree/index.d.ts +4 -4
  230. package/dist/simple-tree/index.d.ts.map +1 -1
  231. package/dist/simple-tree/index.js +4 -3
  232. package/dist/simple-tree/index.js.map +1 -1
  233. package/dist/simple-tree/mapNode.d.ts +2 -2
  234. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  235. package/dist/simple-tree/mapNode.js +1 -1
  236. package/dist/simple-tree/mapNode.js.map +1 -1
  237. package/dist/simple-tree/mapNodeTypes.d.ts +3 -3
  238. package/dist/simple-tree/mapNodeTypes.d.ts.map +1 -1
  239. package/dist/simple-tree/mapNodeTypes.js.map +1 -1
  240. package/dist/simple-tree/objectNode.d.ts +18 -5
  241. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  242. package/dist/simple-tree/objectNode.js +4 -3
  243. package/dist/simple-tree/objectNode.js.map +1 -1
  244. package/dist/simple-tree/objectNodeTypes.d.ts +4 -4
  245. package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
  246. package/dist/simple-tree/objectNodeTypes.js.map +1 -1
  247. package/dist/simple-tree/schemaTypes.d.ts +164 -13
  248. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  249. package/dist/simple-tree/schemaTypes.js +107 -8
  250. package/dist/simple-tree/schemaTypes.js.map +1 -1
  251. package/dist/simple-tree/toStoredSchema.d.ts +8 -8
  252. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  253. package/dist/simple-tree/toStoredSchema.js +27 -32
  254. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  255. package/dist/simple-tree/treeNodeValid.js +2 -2
  256. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  257. package/dist/tableSchema.d.ts +455 -125
  258. package/dist/tableSchema.d.ts.map +1 -1
  259. package/dist/tableSchema.js +398 -101
  260. package/dist/tableSchema.js.map +1 -1
  261. package/dist/treeFactory.d.ts +1 -1
  262. package/dist/treeFactory.d.ts.map +1 -1
  263. package/dist/treeFactory.js +30 -75
  264. package/dist/treeFactory.js.map +1 -1
  265. package/dist/util/typeUtils.d.ts +1 -1
  266. package/dist/util/typeUtils.js.map +1 -1
  267. package/lib/alpha.d.ts +17 -1
  268. package/lib/beta.d.ts +2 -0
  269. package/lib/codec/codec.d.ts +5 -1
  270. package/lib/codec/codec.d.ts.map +1 -1
  271. package/lib/codec/codec.js +5 -1
  272. package/lib/codec/codec.js.map +1 -1
  273. package/lib/codec/index.d.ts +1 -1
  274. package/lib/codec/index.d.ts.map +1 -1
  275. package/lib/codec/index.js +1 -1
  276. package/lib/codec/index.js.map +1 -1
  277. package/lib/core/index.d.ts +2 -2
  278. package/lib/core/index.d.ts.map +1 -1
  279. package/lib/core/index.js +2 -2
  280. package/lib/core/index.js.map +1 -1
  281. package/lib/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
  282. package/lib/core/schema-stored/formatV1.d.ts.map +1 -0
  283. package/lib/core/schema-stored/{format.js → formatV1.js} +1 -1
  284. package/lib/core/schema-stored/formatV1.js.map +1 -0
  285. package/lib/core/schema-stored/index.d.ts +3 -3
  286. package/lib/core/schema-stored/index.d.ts.map +1 -1
  287. package/lib/core/schema-stored/index.js +2 -2
  288. package/lib/core/schema-stored/index.js.map +1 -1
  289. package/lib/core/schema-stored/schema.d.ts +3 -1
  290. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  291. package/lib/core/schema-stored/schema.js +3 -1
  292. package/lib/core/schema-stored/schema.js.map +1 -1
  293. package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  294. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  295. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  296. package/lib/core/schema-view/index.d.ts +1 -1
  297. package/lib/core/schema-view/index.d.ts.map +1 -1
  298. package/lib/core/schema-view/index.js +1 -1
  299. package/lib/core/schema-view/index.js.map +1 -1
  300. package/lib/core/schema-view/view.d.ts +0 -27
  301. package/lib/core/schema-view/view.d.ts.map +1 -1
  302. package/lib/core/schema-view/view.js +0 -34
  303. package/lib/core/schema-view/view.js.map +1 -1
  304. package/lib/core/tree/persistedTreeTextFormat.d.ts +4 -4
  305. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  306. package/lib/core/tree/persistedTreeTextFormat.js +2 -2
  307. package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
  308. package/lib/feature-libraries/forest-summary/format.d.ts +2 -2
  309. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  310. package/lib/feature-libraries/forest-summary/format.js +2 -2
  311. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  312. package/lib/feature-libraries/index.d.ts +1 -1
  313. package/lib/feature-libraries/index.d.ts.map +1 -1
  314. package/lib/feature-libraries/index.js +1 -1
  315. package/lib/feature-libraries/index.js.map +1 -1
  316. package/lib/feature-libraries/mapTreeCursor.d.ts +3 -3
  317. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  318. package/lib/feature-libraries/mapTreeCursor.js +2 -2
  319. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  320. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
  321. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  322. package/lib/feature-libraries/modular-schema/modularChangeFormat.js +3 -3
  323. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  324. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
  325. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  326. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -6
  327. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  328. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  329. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  330. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
  331. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  332. package/lib/feature-libraries/schema-index/codec.d.ts +34 -5
  333. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  334. package/lib/feature-libraries/schema-index/codec.js +61 -9
  335. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  336. package/{dist/feature-libraries/schema-index/format.d.ts → lib/feature-libraries/schema-index/formatV1.d.ts} +9 -9
  337. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
  338. package/lib/feature-libraries/schema-index/{format.js → formatV1.js} +5 -5
  339. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -0
  340. package/lib/feature-libraries/schema-index/index.d.ts +2 -2
  341. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  342. package/lib/feature-libraries/schema-index/index.js +2 -2
  343. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  344. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
  345. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  346. package/lib/feature-libraries/schema-index/schemaSummarizer.js +5 -5
  347. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  348. package/lib/index.d.ts +3 -2
  349. package/lib/index.d.ts.map +1 -1
  350. package/lib/index.js +1 -0
  351. package/lib/index.js.map +1 -1
  352. package/lib/internalTypes.d.ts +0 -1
  353. package/lib/internalTypes.d.ts.map +1 -1
  354. package/lib/internalTypes.js.map +1 -1
  355. package/lib/jsonDomainSchema.d.ts +2 -2
  356. package/lib/jsonDomainSchema.js +2 -2
  357. package/lib/jsonDomainSchema.js.map +1 -1
  358. package/lib/legacy.d.ts +2 -0
  359. package/lib/packageVersion.d.ts +1 -1
  360. package/lib/packageVersion.js +1 -1
  361. package/lib/packageVersion.js.map +1 -1
  362. package/lib/public.d.ts +2 -0
  363. package/lib/serializableDomainSchema.d.ts +3 -3
  364. package/lib/serializableDomainSchema.js +2 -2
  365. package/lib/serializableDomainSchema.js.map +1 -1
  366. package/lib/shared-tree/independentView.d.ts +1 -1
  367. package/lib/shared-tree/independentView.d.ts.map +1 -1
  368. package/lib/shared-tree/independentView.js +2 -2
  369. package/lib/shared-tree/independentView.js.map +1 -1
  370. package/lib/shared-tree/index.d.ts +4 -3
  371. package/lib/shared-tree/index.d.ts.map +1 -1
  372. package/lib/shared-tree/index.js +3 -3
  373. package/lib/shared-tree/index.js.map +1 -1
  374. package/lib/shared-tree/schematizeTree.d.ts +10 -11
  375. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  376. package/lib/shared-tree/schematizeTree.js +12 -37
  377. package/lib/shared-tree/schematizeTree.js.map +1 -1
  378. package/lib/shared-tree/schematizingTreeView.d.ts +3 -3
  379. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  380. package/lib/shared-tree/schematizingTreeView.js +6 -9
  381. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  382. package/lib/shared-tree/sharedTree.d.ts +28 -3
  383. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  384. package/lib/shared-tree/sharedTree.js +29 -4
  385. package/lib/shared-tree/sharedTree.js.map +1 -1
  386. package/lib/shared-tree/{treeApi.d.ts → tree.d.ts} +58 -34
  387. package/lib/shared-tree/tree.d.ts.map +1 -0
  388. package/lib/shared-tree/{treeApi.js → tree.js} +5 -5
  389. package/lib/shared-tree/tree.js.map +1 -0
  390. package/{dist/shared-tree/treeApiAlpha.d.ts → lib/shared-tree/treeAlpha.d.ts} +24 -14
  391. package/lib/shared-tree/treeAlpha.d.ts.map +1 -0
  392. package/lib/shared-tree/{treeApiAlpha.js → treeAlpha.js} +8 -6
  393. package/lib/shared-tree/treeAlpha.js.map +1 -0
  394. package/lib/shared-tree-core/branchCommitEnricher.d.ts +0 -1
  395. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  396. package/lib/shared-tree-core/branchCommitEnricher.js +0 -1
  397. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  398. package/lib/shared-tree-core/transactionEnricher.d.ts +1 -1
  399. package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  400. package/lib/shared-tree-core/transactionEnricher.js +4 -1
  401. package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
  402. package/lib/simple-tree/api/conciseTree.d.ts +1 -1
  403. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  404. package/lib/simple-tree/api/configuration.d.ts +177 -0
  405. package/lib/simple-tree/api/configuration.d.ts.map +1 -0
  406. package/lib/simple-tree/api/configuration.js +157 -0
  407. package/lib/simple-tree/api/configuration.js.map +1 -0
  408. package/lib/simple-tree/api/getJsonSchema.js +1 -1
  409. package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
  410. package/lib/simple-tree/api/index.d.ts +9 -5
  411. package/lib/simple-tree/api/index.d.ts.map +1 -1
  412. package/lib/simple-tree/api/index.js +5 -4
  413. package/lib/simple-tree/api/index.js.map +1 -1
  414. package/lib/simple-tree/api/{view.d.ts → schemaCompatibilityTester.d.ts} +8 -10
  415. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -0
  416. package/lib/simple-tree/api/{view.js → schemaCompatibilityTester.js} +7 -7
  417. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -0
  418. package/lib/simple-tree/api/schemaFactory.d.ts +25 -10
  419. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  420. package/lib/simple-tree/api/schemaFactory.js +27 -12
  421. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  422. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +12 -6
  423. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  424. package/lib/simple-tree/api/schemaFactoryAlpha.js +2 -2
  425. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  426. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +67 -4
  427. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  428. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  429. package/lib/simple-tree/api/schemaFromSimple.d.ts +1 -1
  430. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  431. package/lib/simple-tree/api/schemaFromSimple.js +1 -1
  432. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  433. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  434. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  435. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  436. package/lib/simple-tree/api/storedSchema.d.ts +11 -10
  437. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  438. package/lib/simple-tree/api/storedSchema.js +20 -13
  439. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  440. package/lib/simple-tree/api/tree.d.ts +30 -174
  441. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  442. package/lib/simple-tree/api/tree.js +0 -152
  443. package/lib/simple-tree/api/tree.js.map +1 -1
  444. package/{dist/simple-tree/api/treeApiBeta.d.ts → lib/simple-tree/api/treeBeta.d.ts} +17 -6
  445. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -0
  446. package/lib/simple-tree/api/{treeApiBeta.js → treeBeta.js} +5 -4
  447. package/lib/simple-tree/api/treeBeta.js.map +1 -0
  448. package/lib/simple-tree/api/treeChangeEvents.d.ts +83 -0
  449. package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
  450. package/lib/simple-tree/api/treeChangeEvents.js +6 -0
  451. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -0
  452. package/lib/simple-tree/api/treeNodeApi.d.ts +2 -1
  453. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  454. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  455. package/lib/simple-tree/api/typesUnsafe.d.ts +4 -9
  456. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  457. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  458. package/lib/simple-tree/arrayNode.d.ts +30 -2
  459. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  460. package/lib/simple-tree/arrayNode.js +4 -3
  461. package/lib/simple-tree/arrayNode.js.map +1 -1
  462. package/lib/simple-tree/arrayNodeTypes.d.ts +3 -3
  463. package/lib/simple-tree/arrayNodeTypes.d.ts.map +1 -1
  464. package/lib/simple-tree/arrayNodeTypes.js.map +1 -1
  465. package/lib/simple-tree/core/getOrCreateNode.d.ts +1 -1
  466. package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  467. package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
  468. package/lib/simple-tree/core/index.d.ts +2 -1
  469. package/lib/simple-tree/core/index.d.ts.map +1 -1
  470. package/lib/simple-tree/core/index.js +1 -1
  471. package/lib/simple-tree/core/index.js.map +1 -1
  472. package/lib/simple-tree/core/treeNode.d.ts +94 -0
  473. package/lib/simple-tree/core/treeNode.d.ts.map +1 -0
  474. package/lib/simple-tree/core/treeNode.js +118 -0
  475. package/lib/simple-tree/core/treeNode.js.map +1 -0
  476. package/lib/simple-tree/core/treeNodeKernel.d.ts +2 -1
  477. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  478. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  479. package/lib/simple-tree/core/treeNodeSchema.d.ts +3 -1
  480. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  481. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  482. package/lib/simple-tree/core/types.d.ts +0 -165
  483. package/lib/simple-tree/core/types.d.ts.map +1 -1
  484. package/lib/simple-tree/core/types.js +0 -110
  485. package/lib/simple-tree/core/types.js.map +1 -1
  486. package/lib/simple-tree/core/withType.d.ts +1 -1
  487. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  488. package/lib/simple-tree/core/withType.js.map +1 -1
  489. package/lib/simple-tree/index.d.ts +4 -4
  490. package/lib/simple-tree/index.d.ts.map +1 -1
  491. package/lib/simple-tree/index.js +1 -1
  492. package/lib/simple-tree/index.js.map +1 -1
  493. package/lib/simple-tree/mapNode.d.ts +2 -2
  494. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  495. package/lib/simple-tree/mapNode.js +2 -2
  496. package/lib/simple-tree/mapNode.js.map +1 -1
  497. package/lib/simple-tree/mapNodeTypes.d.ts +3 -3
  498. package/lib/simple-tree/mapNodeTypes.d.ts.map +1 -1
  499. package/lib/simple-tree/mapNodeTypes.js.map +1 -1
  500. package/lib/simple-tree/objectNode.d.ts +18 -5
  501. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  502. package/lib/simple-tree/objectNode.js +5 -4
  503. package/lib/simple-tree/objectNode.js.map +1 -1
  504. package/lib/simple-tree/objectNodeTypes.d.ts +4 -4
  505. package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
  506. package/lib/simple-tree/objectNodeTypes.js.map +1 -1
  507. package/lib/simple-tree/schemaTypes.d.ts +164 -13
  508. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  509. package/lib/simple-tree/schemaTypes.js +96 -8
  510. package/lib/simple-tree/schemaTypes.js.map +1 -1
  511. package/lib/simple-tree/toStoredSchema.d.ts +8 -8
  512. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  513. package/lib/simple-tree/toStoredSchema.js +26 -31
  514. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  515. package/lib/simple-tree/treeNodeValid.js +2 -2
  516. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  517. package/lib/tableSchema.d.ts +455 -125
  518. package/lib/tableSchema.d.ts.map +1 -1
  519. package/lib/tableSchema.js +398 -101
  520. package/lib/tableSchema.js.map +1 -1
  521. package/lib/treeFactory.d.ts +1 -1
  522. package/lib/treeFactory.d.ts.map +1 -1
  523. package/lib/treeFactory.js +30 -75
  524. package/lib/treeFactory.js.map +1 -1
  525. package/lib/util/typeUtils.d.ts +1 -1
  526. package/lib/util/typeUtils.js.map +1 -1
  527. package/package.json +21 -21
  528. package/src/codec/codec.ts +6 -1
  529. package/src/codec/index.ts +1 -0
  530. package/src/core/index.ts +1 -2
  531. package/src/core/schema-stored/index.ts +3 -3
  532. package/src/core/schema-stored/schema.ts +3 -1
  533. package/src/core/schema-stored/storedSchemaRepository.ts +1 -1
  534. package/src/core/schema-view/index.ts +0 -1
  535. package/src/core/schema-view/view.ts +0 -31
  536. package/src/core/tree/persistedTreeTextFormat.ts +2 -2
  537. package/src/feature-libraries/forest-summary/format.ts +2 -2
  538. package/src/feature-libraries/index.ts +7 -1
  539. package/src/feature-libraries/mapTreeCursor.ts +3 -3
  540. package/src/feature-libraries/modular-schema/modularChangeFormat.ts +3 -3
  541. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +38 -9
  542. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +3 -4
  543. package/src/feature-libraries/schema-index/codec.ts +80 -12
  544. package/src/feature-libraries/schema-index/{format.ts → formatV1.ts} +4 -4
  545. package/src/feature-libraries/schema-index/index.ts +7 -2
  546. package/src/feature-libraries/schema-index/schemaSummarizer.ts +9 -9
  547. package/src/index.ts +18 -1
  548. package/src/internalTypes.ts +0 -2
  549. package/src/jsonDomainSchema.ts +2 -2
  550. package/src/packageVersion.ts +1 -1
  551. package/src/serializableDomainSchema.ts +3 -3
  552. package/src/shared-tree/independentView.ts +4 -3
  553. package/src/shared-tree/index.ts +5 -6
  554. package/src/shared-tree/schematizeTree.ts +10 -40
  555. package/src/shared-tree/schematizingTreeView.ts +12 -17
  556. package/src/shared-tree/sharedTree.ts +67 -6
  557. package/src/shared-tree/{treeApi.ts → tree.ts} +75 -51
  558. package/src/shared-tree/{treeApiAlpha.ts → treeAlpha.ts} +28 -16
  559. package/src/shared-tree-core/branchCommitEnricher.ts +0 -1
  560. package/src/shared-tree-core/transactionEnricher.ts +4 -1
  561. package/src/simple-tree/api/conciseTree.ts +1 -1
  562. package/src/simple-tree/api/configuration.ts +353 -0
  563. package/src/simple-tree/api/getJsonSchema.ts +1 -1
  564. package/src/simple-tree/api/index.ts +23 -15
  565. package/src/simple-tree/api/{view.ts → schemaCompatibilityTester.ts} +8 -15
  566. package/src/simple-tree/api/schemaFactory.ts +139 -19
  567. package/src/simple-tree/api/schemaFactoryAlpha.ts +7 -5
  568. package/src/simple-tree/api/schemaFactoryRecursive.ts +102 -38
  569. package/src/simple-tree/api/schemaFromSimple.ts +2 -2
  570. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  571. package/src/simple-tree/api/storedSchema.ts +32 -17
  572. package/src/simple-tree/api/tree.ts +38 -354
  573. package/src/simple-tree/api/{treeApiBeta.ts → treeBeta.ts} +20 -6
  574. package/src/simple-tree/api/treeChangeEvents.ts +84 -0
  575. package/src/simple-tree/api/treeNodeApi.ts +1 -1
  576. package/src/simple-tree/api/typesUnsafe.ts +15 -11
  577. package/src/simple-tree/arrayNode.ts +38 -5
  578. package/src/simple-tree/arrayNodeTypes.ts +8 -7
  579. package/src/simple-tree/core/getOrCreateNode.ts +1 -1
  580. package/src/simple-tree/core/index.ts +5 -4
  581. package/src/simple-tree/core/treeNode.ts +163 -0
  582. package/src/simple-tree/core/treeNodeKernel.ts +2 -1
  583. package/src/simple-tree/core/treeNodeSchema.ts +3 -1
  584. package/src/simple-tree/core/types.ts +0 -234
  585. package/src/simple-tree/core/withType.ts +1 -1
  586. package/src/simple-tree/index.ts +19 -2
  587. package/src/simple-tree/mapNode.ts +11 -3
  588. package/src/simple-tree/mapNodeTypes.ts +10 -7
  589. package/src/simple-tree/objectNode.ts +39 -15
  590. package/src/simple-tree/objectNodeTypes.ts +9 -5
  591. package/src/simple-tree/schemaTypes.ts +354 -25
  592. package/src/simple-tree/toStoredSchema.ts +42 -41
  593. package/src/simple-tree/treeNodeValid.ts +2 -2
  594. package/src/tableSchema.ts +1206 -434
  595. package/src/treeFactory.ts +56 -173
  596. package/src/util/typeUtils.ts +1 -1
  597. package/dist/core/schema-stored/format.d.ts.map +0 -1
  598. package/dist/core/schema-stored/format.js.map +0 -1
  599. package/dist/feature-libraries/schema-index/format.d.ts.map +0 -1
  600. package/dist/feature-libraries/schema-index/format.js.map +0 -1
  601. package/dist/shared-tree/treeApi.d.ts.map +0 -1
  602. package/dist/shared-tree/treeApi.js.map +0 -1
  603. package/dist/shared-tree/treeApiAlpha.d.ts.map +0 -1
  604. package/dist/shared-tree/treeApiAlpha.js.map +0 -1
  605. package/dist/simple-tree/api/treeApiBeta.d.ts.map +0 -1
  606. package/dist/simple-tree/api/treeApiBeta.js.map +0 -1
  607. package/dist/simple-tree/api/view.d.ts.map +0 -1
  608. package/dist/simple-tree/api/view.js.map +0 -1
  609. package/lib/core/schema-stored/format.d.ts.map +0 -1
  610. package/lib/core/schema-stored/format.js.map +0 -1
  611. package/lib/feature-libraries/schema-index/format.d.ts.map +0 -1
  612. package/lib/feature-libraries/schema-index/format.js.map +0 -1
  613. package/lib/shared-tree/treeApi.d.ts.map +0 -1
  614. package/lib/shared-tree/treeApi.js.map +0 -1
  615. package/lib/shared-tree/treeApiAlpha.d.ts.map +0 -1
  616. package/lib/shared-tree/treeApiAlpha.js.map +0 -1
  617. package/lib/simple-tree/api/treeApiBeta.d.ts.map +0 -1
  618. package/lib/simple-tree/api/treeApiBeta.js.map +0 -1
  619. package/lib/simple-tree/api/view.d.ts.map +0 -1
  620. package/lib/simple-tree/api/view.js.map +0 -1
  621. /package/src/core/schema-stored/{format.ts → formatV1.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"tableSchema.js","sourceRoot":"","sources":["../src/tableSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAE1D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAQN,aAAa,GAMb,MAAM,wBAAwB,CAAC;AAEhC,y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CAAC,CAAC;oBAC3B,CAAC;gBACF,CAAC,CAAC,CAAC;YACJ,CAAC;YAEM,aAAa;gBACnB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACzB,CAAC;YAEM,UAAU,CAAC,GAAY;gBAC7B,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC;gBAChC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC/B,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;oBACvB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;oBACxC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;wBAC1B,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBAC3B,CAAC;gBACF,CAAC;YACF,CAAC;SACD;QAOD,8IAA8I;QAC9I,2CAA2C;QAC3C,yHAAyH;QACzH,iDAAiD;QACjD,qFAAqF;QACrF,MAAM,eAAe,GAOjB,KAAK,CAAC;QAEV,0BAA0B;QAC1B,OAAO,eAAe,CAAC;IACxB,CAAC;IAlMe,+BAAmB,sBAkMlC,CAAA;IAoBD,aAAa;AACd,CAAC,EA5rBgB,WAAW,KAAX,WAAW,QA4rB3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { oob } from \"@fluidframework/core-utils/internal\";\n\nimport { Tree } from \"./shared-tree/index.js\";\nimport {\n\ttype ImplicitAllowedTypes,\n\ttype ImplicitFieldSchema,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeKind,\n\ttype SchemaFactoryAlpha,\n\ttype ScopedSchemaName,\n\tTreeArrayNode,\n\ttype TreeNode,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaClass,\n\ttype WithType,\n} from \"./simple-tree/index.js\";\n\n// Future improvement TODOs (ideally to be done before promoting these APIs to `@alpha`):\n// - Custom fields on Table/Row/Column (props pattern from Nick's demo)\n// - Overloads to make Column/Row schema optional when constructing Tables\n// - Record-like type parameters / input parameters?\n// - Move `@system` types into separate / sub scope?\n\n/**\n * Contains types and factories for creating schema to represent dynamic tabular data.\n * @privateRemarks TODO: document in more detail and add `@example`s.\n * @internal\n */\nexport namespace TableSchema {\n\tconst tableSchemaFactorySubScope = \"table\";\n\n\t// #region Column\n\n\t/**\n\t * A column in a table.\n\t * @remarks Implemented by the schema class returned from {@link TableSchema.createColumn}.\n\t * @sealed @internal\n\t */\n\texport interface IColumn<TPropsSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The unique identifier of the column.\n\t\t * @remarks Uniquely identifies the node within the entire tree, not just the table.\n\t\t */\n\t\treadonly id: string;\n\n\t\t/**\n\t\t * User-provided column properties.\n\t\t */\n\t\tget props(): TreeNodeFromImplicitAllowedTypes<TPropsSchema>;\n\t\tset props(value: InsertableTreeNodeFromImplicitAllowedTypes<TPropsSchema>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @privateRemarks\n\t * TODO:\n\t * - Add overloads to make propsSchema optional.\n\t * - Take field schema rather than node schema for `propsSchema`, in particular to allow making\n\t * the additional properties optional.\n\t * @internal\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createColumn<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TPropsSchema extends ImplicitAllowedTypes,\n\t>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, propsSchema: TPropsSchema) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\t/**\n\t\t * {@link Column} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t * Note: ideally we would add a satisfies clause here to ensure that this satisfies\n\t\t * `Record<string, ImplicitFieldSchema>`, but doing so causes TypeScript to prematurely and incorrectly evaluate the type of `propsSchema`.\n\t\t * Likely related to the following issue: https://github.com/microsoft/TypeScript/issues/52394\n\t\t */\n\t\tconst columnFields = {\n\t\t\tid: schemaFactory.identifier,\n\t\t\tprops: schemaFactory.required(propsSchema),\n\t\t} as const;\n\n\t\t/**\n\t\t * A column in a table.\n\t\t */\n\t\tclass Column extends schemaFactory.object(\"Column\", columnFields) {}\n\n\t\ttype ColumnValueType = TreeNode &\n\t\t\tIColumn<TPropsSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Column\">>;\n\n\t\ttype ColumnInsertableType = InsertableObjectFromSchemaRecord<typeof columnFields>;\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst ColumnSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Column\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ ColumnValueType,\n\t\t\t/* TInsertable */ object & ColumnInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof columnFields\n\t\t> = Column;\n\n\t\treturn ColumnSchemaType;\n\t}\n\n\t/**\n\t * Base column schema type.\n\t * @sealed @system @internal\n\t */\n\texport type ColumnSchemaBase<\n\t\tTScope extends string | undefined,\n\t\tTPropsSchema extends ImplicitAllowedTypes,\n\t> = ReturnType<typeof createColumn<TScope, TPropsSchema>>;\n\n\t// #endregion\n\n\t// #region Row\n\n\t/**\n\t * A row in a table.\n\t * @remarks Implemented by the schema class returned from {@link TableSchema.createRow}.\n\t * @sealed @internal\n\t */\n\texport interface IRow<\n\t\tTCellSchema extends ImplicitAllowedTypes,\n\t\tTPropsSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * The unique identifier of the row.\n\t\t * @remarks Uniquely identifies the node within the entire tree, not just the table.\n\t\t */\n\t\treadonly id: string;\n\n\t\t/**\n\t\t * Gets the cell in the specified column.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t */\n\t\tgetCell(column: IColumn): TreeNodeFromImplicitAllowedTypes<TCellSchema> | undefined;\n\t\t/**\n\t\t * Gets the cell in the specified column, denoted by column ID.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t */\n\t\tgetCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCellSchema> | undefined;\n\n\t\t/**\n\t\t * Sets the cell in the specified column.\n\t\t * @remarks To remove a cell, call {@link TableSchema.IRow.(removeCell:1)} instead.\n\t\t */\n\t\tsetCell(\n\t\t\tcolumn: IColumn,\n\t\t\tvalue: InsertableTreeNodeFromImplicitAllowedTypes<TCellSchema>,\n\t\t): void;\n\t\t/**\n\t\t * Sets the cell in the specified column, denoted by column ID.\n\t\t * @remarks To remove a cell, call {@link TableSchema.IRow.(removeCell:2)} instead.\n\t\t */\n\t\tsetCell(\n\t\t\tcolumnId: string,\n\t\t\tvalue: InsertableTreeNodeFromImplicitAllowedTypes<TCellSchema>,\n\t\t): void;\n\n\t\t/**\n\t\t * Removes the cell in the specified column.\n\t\t * @privateRemarks TODO: return removed cell\n\t\t */\n\t\tremoveCell(column: IColumn): void;\n\t\t/**\n\t\t * Removes the cell in the specified column, denoted by column ID.\n\t\t * @privateRemarks TODO: return removed cell\n\t\t */\n\t\tremoveCell(columnId: string): void;\n\n\t\t/**\n\t\t * User-provided row properties.\n\t\t */\n\t\tget props(): TreeNodeFromImplicitAllowedTypes<TPropsSchema>;\n\t\tset props(value: InsertableTreeNodeFromImplicitAllowedTypes<TPropsSchema>);\n\t}\n\n\t/**\n\t * Factory for creating new table row schema.\n\t *\n\t * @privateRemarks\n\t * TODO:\n\t * - Add overloads to make propsSchema optional.\n\t * - Take field schema rather than node schema for `propsSchema`, in particular to allow making\n\t * the additional properties optional.\n\t *\n\t * @sealed @internal\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createRow<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TPropsSchema extends ImplicitAllowedTypes,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryAlpha<TInputScope>,\n\t\tcellSchema: TCellSchema,\n\t\tpropsSchema: TPropsSchema,\n\t) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\ttype CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\t\ttype CellInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\n\t\t/**\n\t\t * {@link Row} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t * Note: ideally we would add a satisfies clause here to ensure that this satisfies\n\t\t * `Record<string, ImplicitFieldSchema>`, but doing so causes TypeScript to prematurely and incorrectly evaluate the type of `propsSchema`.\n\t\t * Likely related to the following issue: https://github.com/microsoft/TypeScript/issues/52394\n\t\t */\n\t\tconst rowFields = {\n\t\t\tid: schemaFactory.identifier,\n\t\t\tcells: schemaFactory.map(\"Row.cells\", cellSchema),\n\t\t\tprops: schemaFactory.required(propsSchema),\n\t\t} as const;\n\n\t\t/**\n\t\t * The Row schema - this is a map of Cells where the key is the column id\n\t\t */\n\t\tclass Row\n\t\t\textends schemaFactory.object(\"Row\", rowFields)\n\t\t\timplements IRow<TCellSchema, TPropsSchema>\n\t\t{\n\t\t\tpublic getCell(columnOrId: IColumn | string): CellValueType | undefined {\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t\treturn this.cells.get(columnId) as CellValueType | undefined;\n\t\t\t}\n\n\t\t\tpublic setCell(\n\t\t\t\tcolumnOrId: IColumn | string,\n\t\t\t\tvalue: CellInsertableType | undefined,\n\t\t\t): void {\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t\tthis.cells.set(columnId, value);\n\t\t\t}\n\n\t\t\tpublic removeCell(columnOrId: IColumn | string): void {\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t\tif (!this.cells.has(columnId)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.cells.delete(columnId);\n\t\t\t}\n\t\t}\n\n\t\ttype RowValueType = TreeNode &\n\t\t\tIRow<TCellSchema, TPropsSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Row\">>;\n\t\ttype RowInsertableType = InsertableObjectFromSchemaRecord<typeof rowFields>;\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst RowSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Row\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ RowValueType,\n\t\t\t/* TInsertable */ object & RowInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof rowFields\n\t\t> = Row;\n\n\t\treturn RowSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @internal\n\t */\n\texport type RowSchemaBase<\n\t\tTScope extends string | undefined,\n\t\tTCellSchema extends ImplicitAllowedTypes,\n\t\tTPropsSchema extends ImplicitAllowedTypes,\n\t> = ReturnType<typeof createRow<TScope, TCellSchema, TPropsSchema>>;\n\n\t// #endregion\n\n\t// #region Table\n\n\t/**\n\t * A key to uniquely identify a cell in a table.\n\t * @sealed @internal\n\t */\n\texport interface CellKey {\n\t\t/**\n\t\t * {@link TableSchema.IColumn.id} of the containing {@link TableSchema.IColumn}.\n\t\t */\n\t\treadonly columnId: string;\n\n\t\t/**\n\t\t * {@link TableSchema.IRow.id} of the containing {@link TableSchema.IRow}.\n\t\t */\n\t\treadonly rowId: string;\n\t}\n\n\t/**\n\t * {@link TableSchema.ITable.insertColumn} parameters.\n\t * @sealed @internal\n\t */\n\texport interface InsertColumnParameters<TInsertableColumn> {\n\t\t/**\n\t\t * The index at which to insert the new column.\n\t\t * @remarks If not provided, the column will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The column to insert.\n\t\t */\n\t\treadonly column: TInsertableColumn;\n\t}\n\n\t/**\n\t * {@link TableSchema.ITable.insertRows} parameters.\n\t * @sealed @internal\n\t */\n\texport interface InsertRowsParameters<TInsertableRow> {\n\t\t/**\n\t\t * The index at which to insert the new rows.\n\t\t * @remarks If not provided, the rows will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The rows to insert.\n\t\t */\n\t\treadonly rows: TInsertableRow[];\n\t}\n\n\t/**\n\t * {@link TableSchema.ITable.setCell} parameters.\n\t * @sealed @internal\n\t */\n\texport interface SetCellParameters<TInsertableCell> {\n\t\t/**\n\t\t * The key to uniquely identify a cell in a table.\n\t\t */\n\t\treadonly key: CellKey;\n\n\t\t/**\n\t\t * The cell to set.\n\t\t */\n\t\treadonly cell: TInsertableCell;\n\t}\n\n\t/**\n\t * A table.\n\t * @sealed @internal\n\t */\n\texport interface ITable<\n\t\tTCellSchema extends ImplicitAllowedTypes,\n\t\tTColumnSchema extends ImplicitAllowedTypes,\n\t\tTRowSchema extends ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * The table's columns.\n\t\t */\n\t\treadonly columns: TreeArrayNode<TColumnSchema>;\n\n\t\t/**\n\t\t * The table's rows.\n\t\t */\n\t\treadonly rows: TreeArrayNode<TRowSchema>;\n\n\t\t/**\n\t\t * Gets a table column by its {@link TableSchema.IRow.id}.\n\t\t */\n\t\tgetColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumnSchema> | undefined;\n\n\t\t/**\n\t\t * Gets a table row by its {@link TableSchema.IRow.id}.\n\t\t */\n\t\tgetRow(id: string): TreeNodeFromImplicitAllowedTypes<TRowSchema> | undefined;\n\n\t\t/**\n\t\t * Gets a cell in the table by column and row IDs.\n\t\t * @param key - A key that uniquely distinguishes a cell in the table, represented as a combination of the column ID and row ID.\n\t\t * @privateRemarks TODO: add overload that takes row and column nodes.\n\t\t */\n\t\tgetCell(key: CellKey): TreeNodeFromImplicitAllowedTypes<TCellSchema> | undefined;\n\n\t\t/**\n\t\t * Inserts a column into the table.\n\t\t * @throws Throws an error if the column is already in the tree, or if the specified index is out of range.\n\t\t */\n\t\tinsertColumn(\n\t\t\tparams: InsertColumnParameters<\n\t\t\t\tInsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>\n\t\t\t>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumnSchema>;\n\n\t\t/**\n\t\t * Inserts 0 or more rows into the table.\n\t\t * @throws Throws an error if any of the rows are already in the tree, or if the specified index is out of range.\n\t\t */\n\t\tinsertRows(\n\t\t\tparams: InsertRowsParameters<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TRowSchema>[];\n\n\t\t/**\n\t\t * Sets the cell at the specified location in the table.\n\t\t * @remarks To remove a cell, call {@link TableSchema.ITable.removeCell} instead.\n\t\t * @privateRemarks TODO: add overload that takes column/row nodes?\n\t\t */\n\t\tsetCell(\n\t\t\tparams: SetCellParameters<InsertableTreeNodeFromImplicitAllowedTypes<TCellSchema>>,\n\t\t): void;\n\n\t\t/**\n\t\t * Removes the specified column from the table.\n\t\t * @remarks Note: this does not remove any cells from the table's rows.\n\t\t * @privateRemarks\n\t\t * TODO:\n\t\t * - Policy for when the column is not in the table.\n\t\t * - Actually remove corresponding cells from table rows.\n\t\t */\n\t\tremoveColumn: (column: TreeNodeFromImplicitAllowedTypes<TColumnSchema>) => void;\n\n\t\t/**\n\t\t * Removes 0 or more rows from the table.\n\t\t * @privateRemarks TODO: policy for when 1 or more rows are not in the table.\n\t\t */\n\t\tremoveRows: (rows: readonly TreeNodeFromImplicitAllowedTypes<TRowSchema>[]) => void;\n\n\t\t/**\n\t\t * Removes all rows from the table.\n\t\t */\n\t\tremoveAllRows: () => void;\n\n\t\t/**\n\t\t * Removes the cell at the specified location in the table.\n\t\t * @privateRemarks TODO: add overload that takes column/row nodes?\n\t\t */\n\t\tremoveCell: (key: CellKey) => void;\n\t}\n\n\t/**\n\t * Factory for creating new table schema without specifying row or column schema.\n\t * @internal\n\t */\n\texport function createTable<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryAlpha<TInputScope>,\n\t\t_cellSchema: TCell,\n\t): ReturnType<typeof createTableInternal<TInputScope, TCell>>;\n\t/**\n\t * Factory for creating new table schema without specifying row schema\n\t * @internal\n\t */\n\texport function createTable<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends ColumnSchemaBase<TInputScope, ImplicitAllowedTypes>,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryAlpha<TInputScope>,\n\t\t_cellSchema: TCell,\n\t\tcolumnSchema: TColumn,\n\t): ReturnType<typeof createTableInternal<TInputScope, TCell, TColumn>>;\n\t/**\n\t * Factory for creating new table schema.\n\t * @internal\n\t */\n\texport function createTable<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends ColumnSchemaBase<TInputScope, ImplicitAllowedTypes>,\n\t\tconst TRow extends RowSchemaBase<TInputScope, TCell, ImplicitAllowedTypes>,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryAlpha<TInputScope>,\n\t\t_cellSchema: TCell,\n\t\tcolumnSchema: TColumn,\n\t\trowSchema: TRow,\n\t): ReturnType<typeof createTableInternal<TInputScope, TCell, TColumn, TRow>>;\n\t/** `createTable` implementation */\n\texport function createTable<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends ColumnSchemaBase<TInputScope, ImplicitAllowedTypes>,\n\t\tconst TRow extends RowSchemaBase<TInputScope, TCell, ImplicitAllowedTypes>,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryAlpha<TInputScope>,\n\t\t_cellSchema: TCell,\n\t\tcolumnSchema?: TColumn,\n\t\trowSchema?: TRow,\n\t): TreeNodeSchema {\n\t\tconst column = columnSchema ?? createColumn(inputSchemaFactory, inputSchemaFactory.null);\n\t\treturn createTableInternal(\n\t\t\tinputSchemaFactory,\n\t\t\t_cellSchema,\n\t\t\tcolumn as TColumn,\n\t\t\trowSchema ??\n\t\t\t\t(createRow(inputSchemaFactory, _cellSchema, inputSchemaFactory.null) as TRow),\n\t\t);\n\t}\n\n\t/**\n\t * Factory for creating new table schema.\n\t * @system @internal\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createTableInternal<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends ColumnSchemaBase<\n\t\t\tTInputScope,\n\t\t\tImplicitAllowedTypes\n\t\t> = ColumnSchemaBase<TInputScope, ImplicitAllowedTypes>,\n\t\tconst TRow extends RowSchemaBase<TInputScope, TCell, ImplicitAllowedTypes> = RowSchemaBase<\n\t\t\tTInputScope,\n\t\t\tTCell,\n\t\t\tImplicitAllowedTypes\n\t\t>,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryAlpha<TInputScope>,\n\t\t_cellSchema: TCell,\n\t\tcolumnSchema: TColumn,\n\t\trowSchema: TRow,\n\t) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\ttype CellValueType = TreeNodeFromImplicitAllowedTypes<TCell>;\n\t\ttype CellInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TCell>;\n\n\t\ttype ColumnValueType = TreeNodeFromImplicitAllowedTypes<TColumn>;\n\t\ttype ColumnInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TColumn>;\n\n\t\ttype RowValueType = TreeNodeFromImplicitAllowedTypes<TRow>;\n\t\ttype RowInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TRow>;\n\n\t\t/**\n\t\t * {@link Table} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t */\n\t\tconst tableFields = {\n\t\t\trows: schemaFactory.array(\"Table.rows\", rowSchema),\n\t\t\tcolumns: schemaFactory.array(\"Table.columns\", columnSchema),\n\t\t} as const satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * The Table schema\n\t\t */\n\t\tclass Table\n\t\t\textends schemaFactory.object(\"Table\", tableFields)\n\t\t\timplements ITable<TCell, TColumn, TRow>\n\t\t{\n\t\t\tpublic getColumn(id: string): ColumnValueType | undefined {\n\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.columns.find((column) => (column as ColumnValueType).id === id) as\n\t\t\t\t\t| ColumnValueType\n\t\t\t\t\t| undefined;\n\t\t\t}\n\n\t\t\tpublic getRow(id: string): RowValueType | undefined {\n\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.rows.find((_row) => (_row as RowValueType).id === id) as\n\t\t\t\t\t| RowValueType\n\t\t\t\t\t| undefined;\n\t\t\t}\n\n\t\t\tpublic getCell(key: CellKey): CellValueType | undefined {\n\t\t\t\tconst { columnId, rowId } = key;\n\t\t\t\tconst row = this.getRow(rowId);\n\t\t\t\tif (row !== undefined) {\n\t\t\t\t\tconst column = this.getColumn(columnId);\n\t\t\t\t\tif (column !== undefined) {\n\t\t\t\t\t\treturn row.getCell(column.id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the cell does not exist return undefined\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tpublic insertColumn({\n\t\t\t\tcolumn,\n\t\t\t\tindex,\n\t\t\t}: InsertColumnParameters<ColumnInsertableType>): ColumnValueType {\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.columns.insertAtEnd(column as any);\n\t\t\t\t} else {\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.columns.insertAt(index, column as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input node into the tree hydrates it, making it usable as a node.\n\t\t\t\treturn column as ColumnValueType;\n\t\t\t}\n\n\t\t\tpublic insertRows({\n\t\t\t\tindex,\n\t\t\t\trows,\n\t\t\t}: InsertRowsParameters<RowInsertableType>): RowValueType[] {\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.rows.insertAtEnd(TreeArrayNode.spread(rows) as any);\n\t\t\t\t} else {\n\t\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.rows.insertAt(index, TreeArrayNode.spread(rows) as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input nodes into the tree hydrates them, making them usable as nodes.\n\t\t\t\treturn rows as unknown as RowValueType[];\n\t\t\t}\n\n\t\t\tpublic setCell({ key, cell }: SetCellParameters<CellInsertableType>): void {\n\t\t\t\tconst { columnId, rowId } = key;\n\t\t\t\tconst row = this.getRow(rowId);\n\t\t\t\tif (row !== undefined) {\n\t\t\t\t\tconst column = this.getColumn(columnId);\n\t\t\t\t\tif (column !== undefined) {\n\t\t\t\t\t\trow.setCell(column.id, cell);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic removeColumn(column: ColumnValueType): void {\n\t\t\t\tconst index = this.columns.indexOf(column);\n\t\t\t\t// If the column is not in the table, do nothing\n\t\t\t\tif (index === -1) return;\n\t\t\t\tthis.columns.removeAt(index);\n\t\t\t}\n\n\t\t\tpublic removeRows(rows: readonly RowValueType[]): void {\n\t\t\t\t// If there are no rows to remove, do nothing\n\t\t\t\tif (rows.length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If there is only one row to remove, remove it\n\t\t\t\tif (rows.length === 1) {\n\t\t\t\t\tconst index = this.rows.indexOf(rows[0] ?? oob());\n\t\t\t\t\tthis.rows.removeAt(index);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// If there are multiple rows to remove, remove them in a transaction\n\t\t\t\t// This is to avoid the performance issues of deleting multiple rows at once\n\t\t\t\tTree.runTransaction(this, () => {\n\t\t\t\t\t// Iterate over the rows and remove them\n\t\t\t\t\tfor (const row of rows) {\n\t\t\t\t\t\tconst index = this.rows.indexOf(row);\n\t\t\t\t\t\tthis.rows.removeAt(index);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tpublic removeAllRows(): void {\n\t\t\t\tthis.rows.removeRange();\n\t\t\t}\n\n\t\t\tpublic removeCell(key: CellKey): void {\n\t\t\t\tconst { columnId, rowId } = key;\n\t\t\t\tconst row = this.getRow(rowId);\n\t\t\t\tif (row !== undefined) {\n\t\t\t\t\tconst column = this.getColumn(columnId);\n\t\t\t\t\tif (column !== undefined) {\n\t\t\t\t\t\trow.removeCell(column.id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttype TableValueType = TreeNode &\n\t\t\tITable<TCell, TColumn, TRow> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Table\">>;\n\t\ttype TableInsertableType = InsertableObjectFromSchemaRecord<typeof tableFields>;\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst TableSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Table\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ TableValueType,\n\t\t\t/* TInsertable */ object & TableInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof tableFields\n\t\t> = Table;\n\n\t\t// Return the table schema\n\t\treturn TableSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @internal\n\t */\n\texport type TableSchemaBase<\n\t\tTScope extends string | undefined,\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ColumnSchemaBase<TScope, ImplicitAllowedTypes> = ColumnSchemaBase<\n\t\t\tTScope,\n\t\t\tImplicitAllowedTypes\n\t\t>,\n\t\tTRow extends RowSchemaBase<TScope, TCell, ImplicitAllowedTypes> = RowSchemaBase<\n\t\t\tTScope,\n\t\t\tTCell,\n\t\t\tImplicitAllowedTypes\n\t\t>,\n\t> = ReturnType<typeof createTable<TScope, TCell, TColumn, TRow>>;\n\n\t// #endregion\n}\n"]}
1
+ {"version":3,"file":"tableSchema.js","sourceRoot":"","sources":["../src/tableSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAQN,aAAa,EASb,aAAa,GAGb,MAAM,wBAAwB,CAAC;AAEhC,4BAA4B;AAC5B,mDAAmD;AACnD,oDAAoD;AACpD,2EAA2E;AAE3E,oBAAoB;AACpB,mGAAmG;AAEnG;;GAEG;AACH,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAE3C;;;;;;;;;GASG;AACH,MAAM,KAAW,kBAAkB,CA8xBlC;AA9xBD,WAAiB,kBAAkB;IAiDlC;;;OAGG;IACH,sIAAsI;IACtI,SAAgB,oBAAoB,CAGlC,kBAAmD,EAAE,WAAyB;QAC/E,MAAM,aAAa,GAAG,kBAAkB,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;QAGnF,gFAAgF;QAChF,yCAAyC;QACzC,kDAAkD;QAClD,MAAM,wBAAwB,GAAG;YAChC,EAAE,EAAE,aAAa,CAAC,UAAU;SACnB,CAAC;QACX,MAAM,qBAAqB,GAAG;YAC7B,KAAK,EAAE,WAAW;SACT,CAAC;QAEX;;;;;;;;;;WAUG;QACH,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kB,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IACjF,CAAC;IAfe,uBAAW,cAe1B,CAAA;IAED,aAAa;AACd,CAAC,EApjBgB,WAAW,KAAX,WAAW,QAojB3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { oob } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { Tree } from \"./shared-tree/index.js\";\nimport {\n\ttype FieldHasDefault,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeKind,\n\ttype SchemaFactoryAlpha,\n\ttype ScopedSchemaName,\n\tTreeArrayNode,\n\ttype TreeNode,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaClass,\n\ttype WithType,\n\ttype TreeFieldFromImplicitField,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InternalTreeNode,\n\tSchemaFactory,\n\ttype ImplicitAnnotatedFieldSchema,\n\ttype UnannotateImplicitFieldSchema,\n} from \"./simple-tree/index.js\";\n\n// Future improvement TODOs:\n// - Omit `cells` property from Row insertion type.\n// - Record-like type parameters / input parameters?\n// - Omit `props` properties from Row and Column schemas when not provided?\n\n// Longer-term work:\n// - Add constraint APIs to make it possible to avoid situations that could yield \"orphaned\" cells.\n\n/**\n * The sub-scope applied to user-provided {@link SchemaFactory}s by table schema factories.\n */\nconst tableSchemaFactorySubScope = \"table\";\n\n/**\n * Not intended for use outside of this package.\n *\n * @privateRemarks\n * This namespace is a collection of internal system types relate to {@link TableSchema}.\n * This namespace should be strictly type-exported by the package.\n * All members should be tagged with `@system`.\n *\n * @system @internal\n */\nexport namespace System_TableSchema {\n\t/**\n\t * Default type used for column and row \"props\" fields.\n\t * @privateRemarks\n\t * Longer term, it would be better to simply omit \"props\" altogether by default.\n\t * For now, this ensures that the user doesn't have to specify a \"props\" entry when initializing column/row nodes\n\t * and ensures that they cannot set anything that might conflict with future evolutions of the schema.\n\t * @system @internal\n\t */\n\texport type DefaultPropsType = ReturnType<typeof SchemaFactory.optional<[]>>;\n\n\t/**\n\t * A base interface for factory input options which include an schema factory.\n\t * @remarks This interface should not be referenced directly.\n\t * @privateRemarks This interface primarily exists to provide a single home for property documentation.\n\t * @system @internal\n\t */\n\texport interface OptionsWithSchemaFactory<TSchemaFactory extends SchemaFactoryAlpha> {\n\t\t/**\n\t\t * Schema factory with which the Column schema will be associated.\n\t\t * @remarks Can be used to associate the resulting schema with an existing {@link SchemaFactory.scope|scope}.\n\t\t */\n\t\treadonly schemaFactory: TSchemaFactory;\n\t}\n\n\t/**\n\t * A base interface for factory input options which include the table cell schema.\n\t * @remarks This interface should not be referenced directly.\n\t * @privateRemarks This interface primarily exists to provide a single home for property documentation.\n\t * @system @internal\n\t */\n\texport interface OptionsWithCellSchema<TCellSchema extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * Schema for the table's cells.\n\t\t */\n\t\treadonly cell: TCellSchema;\n\t}\n\n\t// #region Column\n\n\t/**\n\t * Base options for creating table cow schema.\n\t * @remarks Includes parameters common to all column factory overloads.\n\t * @system @internal\n\t */\n\texport type CreateColumnOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha,\n\t> = OptionsWithSchemaFactory<TSchemaFactory>;\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @system @internal\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createColumnInternal<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TPropsSchema extends ImplicitAnnotatedFieldSchema,\n\t>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, propsSchema: TPropsSchema) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\t// Note: `columnFields` is broken into two parts to work around a TypeScript bug\n\t\t// that results in broken `.d.ts` output.\n\t\t// See definition of `ColumnInsertableType` below.\n\t\tconst columnFieldsBuiltInParts = {\n\t\t\tid: schemaFactory.identifier,\n\t\t} as const;\n\t\tconst columnFieldsPropsPart = {\n\t\t\tprops: propsSchema,\n\t\t} as const;\n\n\t\t/**\n\t\t * {@link Column} fields.\n\t\t *\n\t\t * @remarks\n\t\t * Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t *\n\t\t * Note: ideally we would add a satisfies clause here to ensure that this satisfies\n\t\t * `Record<string, ImplicitFieldSchema>`, but doing so causes TypeScript to prematurely and incorrectly evaluate the type of `propsSchema`.\n\t\t * Likely related to the following issue: https://github.com/microsoft/TypeScript/issues/52394\n\t\t */\n\t\tconst columnFields = {\n\t\t\t...columnFieldsBuiltInParts,\n\t\t\t...columnFieldsPropsPart,\n\t\t} as const; // satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * A column in a table.\n\t\t */\n\t\tclass Column\n\t\t\textends schemaFactory.objectAlpha(\"Column\", columnFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements TableSchema.Column<TPropsSchema> {}\n\n\t\ttype ColumnValueType = TreeNode &\n\t\t\tTableSchema.Column<TPropsSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Column\">>;\n\n\t\t// Note: ideally this type would just leverage `InsertableObjectFromSchemaRecord<typeof columnFields>`,\n\t\t// but that results in broken `.d.ts` output due to a TypeScript bug.\n\t\t// See: https://github.com/microsoft/TypeScript/issues/58688.\n\t\t// Instead we extract and inline the typing of the \"props\" field here, which seems to sufficiently work around the issue.\n\t\t// type ColumnInsertableType = InsertableObjectFromSchemaRecord<typeof columnFields>;\n\t\ttype ColumnInsertableType = InsertableObjectFromSchemaRecord<\n\t\t\ttypeof columnFieldsBuiltInParts\n\t\t> &\n\t\t\t(FieldHasDefault<UnannotateImplicitFieldSchema<TPropsSchema>> extends true\n\t\t\t\t? // Note: The docs on the below properties are copied from `IColumn.props`' docs to ensure that the\n\t\t\t\t\t// documentation appears in the data insertion scenario.\n\t\t\t\t\t// The contents are duplicated instead of using `@inheritdoc`, as intellisense does not correctly\n\t\t\t\t\t// support `@inheritDoc`.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/31267\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The column's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops?: InsertableTreeFieldFromImplicitField<\n\t\t\t\t\t\t\tUnannotateImplicitFieldSchema<TPropsSchema>\n\t\t\t\t\t\t>;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The column's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops: InsertableTreeFieldFromImplicitField<\n\t\t\t\t\t\t\tUnannotateImplicitFieldSchema<TPropsSchema>\n\t\t\t\t\t\t>;\n\t\t\t\t\t});\n\n\t\t// Modified version of `Column` that ensures the constructor (and `createFromInsertable`) are\n\t\t// typed correctly in terms of our insertable type.\n\t\t// This lets us be selective in our type-cast for the value returned from this function,\n\t\t// preserving as much type-safety as we reasonably can.\n\t\ttype ColumnSchemaModifiedType = Omit<\n\t\t\t// Use mapped type to omit the constructor\n\t\t\t{\n\t\t\t\t[Property in keyof typeof Column]: (typeof Column)[Property];\n\t\t\t},\n\t\t\t\"createFromInsertable\"\n\t\t> &\n\t\t\t(new (\n\t\t\t\tparameters: InternalTreeNode | ColumnInsertableType,\n\t\t\t) => Column) & {\n\t\t\t\tcreateFromInsertable(parameters: ColumnInsertableType): Column;\n\t\t\t};\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst ColumnSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Column\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ ColumnValueType,\n\t\t\t/* TInsertable */ object & ColumnInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof columnFields\n\t\t> = Column as ColumnSchemaModifiedType;\n\n\t\treturn ColumnSchemaType;\n\t}\n\n\t/**\n\t * Base column schema type.\n\t * @sealed @system @internal\n\t */\n\texport type ColumnSchemaBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTPropsSchema extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema,\n\t> = ReturnType<typeof createColumnInternal<TScope, TPropsSchema>>;\n\n\t// #endregion\n\n\t// #region Row\n\n\t/**\n\t * Base options for creating table row schema.\n\t * @remarks Includes parameters common to all row factory overloads.\n\t * @system @internal\n\t */\n\texport type CreateRowOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating new table row schema.\n\t *\n\t * @sealed @internal\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createRowInternal<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TPropsSchema extends ImplicitAnnotatedFieldSchema,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryAlpha<TInputScope>,\n\t\tcellSchema: TCellSchema,\n\t\tpropsSchema: TPropsSchema,\n\t) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\ttype CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\t\ttype CellInsertableType = InsertableTreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\n\t\t// Note: `rowFields` is broken into two parts to work around a TypeScript bug\n\t\t// that results in broken `.d.ts` output.\n\t\t// See definition of `RowInsertableType` below.\n\t\tconst rowFieldsBuiltInParts = {\n\t\t\tid: schemaFactory.identifier,\n\t\t\tcells: schemaFactory.required(schemaFactory.map(\"Row.cells\", cellSchema), {\n\t\t\t\tmetadata: {\n\t\t\t\t\tdescription: \"The cells of the table row, keyed by column ID.\",\n\t\t\t\t},\n\t\t\t}),\n\t\t} as const;\n\t\tconst rowFieldsPropsPart = {\n\t\t\tprops: propsSchema,\n\t\t} as const;\n\n\t\t/**\n\t\t * {@link Row} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t * Note: ideally we would add a satisfies clause here to ensure that this satisfies\n\t\t * `Record<string, ImplicitFieldSchema>`, but doing so causes TypeScript to prematurely and incorrectly evaluate the type of `propsSchema`.\n\t\t * Likely related to the following issue: https://github.com/microsoft/TypeScript/issues/52394\n\t\t */\n\t\tconst rowFields = {\n\t\t\t...rowFieldsBuiltInParts,\n\t\t\t...rowFieldsPropsPart,\n\t\t} as const; // satisfies Record<string, ImplicitFieldSchema>;\n\n\t\t/**\n\t\t * The Row schema - this is a map of Cells where the key is the column id\n\t\t */\n\t\tclass Row\n\t\t\textends schemaFactory.objectAlpha(\"Row\", rowFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements TableSchema.Row<TCellSchema, TPropsSchema>\n\t\t{\n\t\t\tpublic getCell(columnOrId: TableSchema.Column | string): CellValueType | undefined {\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t\treturn this.cells.get(columnId) as CellValueType | undefined;\n\t\t\t}\n\n\t\t\tpublic setCell(\n\t\t\t\tcolumnOrId: TableSchema.Column | string,\n\t\t\t\tvalue: CellInsertableType | undefined,\n\t\t\t): void {\n\t\t\t\t// TODO: throw if column does not exist in the owning table.\n\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t\tthis.cells.set(columnId, value);\n\t\t\t}\n\n\t\t\tpublic removeCell(columnOrId: TableSchema.Column | string): CellValueType | undefined {\n\t\t\t\t// TODO: throw if column does not exist in the owning table.\n\n\t\t\t\tconst columnId = typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\n\t\t\t\tconst cell: CellValueType | undefined = this.cells.get(columnId);\n\t\t\t\tif (cell === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tthis.cells.delete(columnId);\n\t\t\t\treturn cell;\n\t\t\t}\n\t\t}\n\n\t\ttype RowValueType = TreeNode &\n\t\t\tTableSchema.Row<TCellSchema, TPropsSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Row\">>;\n\n\t\t// Note: ideally this type would just leverage `InsertableObjectFromSchemaRecord<typeof rowFields>`,\n\t\t// but that results in broken `.d.ts` output due to a TypeScript bug.\n\t\t// See: https://github.com/microsoft/TypeScript/issues/58688.\n\t\t// Instead we extract and inline the typing of the \"props\" field here, which seems to sufficiently work around\n\t\t// the issue.\n\t\t// type RowInsertableType = InsertableObjectFromSchemaRecord<typeof rowFields>;\n\t\ttype RowInsertableType = InsertableObjectFromSchemaRecord<typeof rowFieldsBuiltInParts> &\n\t\t\t(FieldHasDefault<UnannotateImplicitFieldSchema<TPropsSchema>> extends true\n\t\t\t\t? // Note: The docs on the below properties are copied from `IRow.props`' docs to ensure that the\n\t\t\t\t\t// documentation appears in the data insertion scenario.\n\t\t\t\t\t// The contents are duplicated instead of using `@inheritdoc`, as intellisense does not correctly\n\t\t\t\t\t// support `@inheritDoc`.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/31267\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The row's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information\n\t\t\t\t\t\t * about the row.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops?: InsertableTreeFieldFromImplicitField<\n\t\t\t\t\t\t\tUnannotateImplicitFieldSchema<TPropsSchema>\n\t\t\t\t\t\t>;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The row's properties.\n\t\t\t\t\t\t * @remarks This is a user-defined schema that can be used to store additional information\n\t\t\t\t\t\t * about the row.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tprops: InsertableTreeFieldFromImplicitField<\n\t\t\t\t\t\t\tUnannotateImplicitFieldSchema<TPropsSchema>\n\t\t\t\t\t\t>;\n\t\t\t\t\t});\n\n\t\t// Modified version of `Row` that ensures the constructor (and `createFromInsertable`) are\n\t\t// typed correctly in terms of our insertable type.\n\t\t// This lets us be selective in our type-cast for the value returned from this function,\n\t\t// preserving as much type-safety as we reasonably can.\n\t\ttype RowSchemaModifiedType = Omit<\n\t\t\t// Use mapped type to omit the constructor\n\t\t\t{\n\t\t\t\t[Property in keyof typeof Row]: (typeof Row)[Property];\n\t\t\t},\n\t\t\t\"createFromInsertable\"\n\t\t> &\n\t\t\t(new (\n\t\t\t\tparameters: InternalTreeNode | RowInsertableType,\n\t\t\t) => Row) & {\n\t\t\t\tcreateFromInsertable(parameters: RowInsertableType): Row;\n\t\t\t};\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst RowSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Row\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ RowValueType,\n\t\t\t/* TInsertable */ object & RowInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof rowFields\n\t\t> = Row as RowSchemaModifiedType;\n\n\t\treturn RowSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @internal\n\t */\n\texport type RowSchemaBase<\n\t\tTScope extends string | undefined = string | undefined,\n\t\tTCellSchema extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTPropsSchema extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema,\n\t> = ReturnType<typeof createRowInternal<TScope, TCellSchema, TPropsSchema>>;\n\n\t// #endregion\n\n\t// #region Table\n\n\t/**\n\t * Base options for creating table schema.\n\t * @remarks Includes parameters common to all table factory overloads.\n\t * @system @internal\n\t */\n\texport type TableFactoryOptionsBase<\n\t\tTSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha,\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;\n\n\t/**\n\t * Factory for creating new table schema.\n\t * @system @internal\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify\n\texport function createTableInternal<\n\t\tconst TInputScope extends string | undefined,\n\t\tconst TCellSchema extends ImplicitAllowedTypes,\n\t\tconst TColumnSchema extends ColumnSchemaBase<TInputScope>,\n\t\tconst TRowSchema extends RowSchemaBase<TInputScope, TCellSchema>,\n\t>(\n\t\tinputSchemaFactory: SchemaFactoryAlpha<TInputScope>,\n\t\t_cellSchema: TCellSchema,\n\t\tcolumnSchema: TColumnSchema,\n\t\trowSchema: TRowSchema,\n\t) {\n\t\tconst schemaFactory = inputSchemaFactory.scopedFactory(tableSchemaFactorySubScope);\n\t\ttype Scope = ScopedSchemaName<TInputScope, typeof tableSchemaFactorySubScope>;\n\n\t\ttype CellValueType = TreeNodeFromImplicitAllowedTypes<TCellSchema>;\n\t\ttype ColumnValueType = TreeNodeFromImplicitAllowedTypes<TColumnSchema>;\n\t\ttype RowValueType = TreeNodeFromImplicitAllowedTypes<TRowSchema>;\n\n\t\t/**\n\t\t * {@link Table} fields.\n\t\t * @remarks Extracted for re-use in returned type signature defined later in this function.\n\t\t * The implicit typing is intentional.\n\t\t */\n\t\tconst tableFields = {\n\t\t\trows: schemaFactory.array(\"Table.rows\", rowSchema),\n\t\t\tcolumns: schemaFactory.array(\"Table.columns\", columnSchema),\n\t\t} as const satisfies Record<string, ImplicitAnnotatedFieldSchema>;\n\n\t\t/**\n\t\t * The Table schema\n\t\t */\n\t\tclass Table\n\t\t\textends schemaFactory.objectAlpha(\"Table\", tableFields, {\n\t\t\t\t// Will make it easier to evolve this schema in the future.\n\t\t\t\tallowUnknownOptionalFields: true,\n\t\t\t})\n\t\t\timplements TableSchema.Table<TCellSchema, TColumnSchema, TRowSchema>\n\t\t{\n\t\t\tpublic getColumn(id: string): ColumnValueType | undefined {\n\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.columns.find((column) => (column as ColumnValueType).id === id) as\n\t\t\t\t\t| ColumnValueType\n\t\t\t\t\t| undefined;\n\t\t\t}\n\n\t\t\tpublic getRow(id: string): RowValueType | undefined {\n\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the casts.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.rows.find((_row) => (_row as RowValueType).id === id) as\n\t\t\t\t\t| RowValueType\n\t\t\t\t\t| undefined;\n\t\t\t}\n\n\t\t\tpublic getCell(\n\t\t\t\tkey: TableSchema.CellKey<TColumnSchema, TRowSchema>,\n\t\t\t): CellValueType | undefined {\n\t\t\t\tconst { column: columnOrId, row: rowOrId } = key;\n\t\t\t\tconst row = this._getRow(rowOrId);\n\t\t\t\tif (row === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst column = this._getColumn(columnOrId);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn row.getCell(column);\n\t\t\t}\n\n\t\t\tpublic insertColumn({\n\t\t\t\tcolumn,\n\t\t\t\tindex,\n\t\t\t}: TableSchema.InsertColumnParameters<TColumnSchema>): ColumnValueType {\n\t\t\t\tconst inserted = this.insertColumns({\n\t\t\t\t\tcolumns: [column],\n\t\t\t\t\tindex,\n\t\t\t\t});\n\t\t\t\treturn inserted[0] ?? oob();\n\t\t\t}\n\n\t\t\tpublic insertColumns({\n\t\t\t\tcolumns,\n\t\t\t\tindex,\n\t\t\t}: TableSchema.InsertColumnsParameters<TColumnSchema>): ColumnValueType[] {\n\t\t\t\t// #region Input validation\n\n\t\t\t\t// Ensure index is valid\n\t\t\t\tif (index !== undefined) {\n\t\t\t\t\tTable.validateInsertionIndex(index, this.columns);\n\t\t\t\t}\n\n\t\t\t\t// Check all of the columns being inserted an ensure the table does not already contain any with the same ID.\n\t\t\t\tfor (const column of columns) {\n\t\t\t\t\t// TypeScript is unable to narrow the type of the column type correctly here, hence the casts below.\n\t\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\t\tconst maybeId = (column as ColumnValueType).id;\n\t\t\t\t\tif (maybeId !== undefined && this.containsColumnWithId(maybeId)) {\n\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t`A column with ID \"${(column as ColumnValueType).id}\" already exists in the table.`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// #endregion\n\n\t\t\t\t// TypeScript is unable to narrow the column type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.columns.insertAtEnd(TreeArrayNode.spread(columns) as any);\n\t\t\t\t} else {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.columns.insertAt(index, TreeArrayNode.spread(columns) as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input nodes into the tree hydrates them, making them usable as nodes.\n\t\t\t\treturn columns as unknown as ColumnValueType[];\n\t\t\t}\n\n\t\t\tpublic insertRow({\n\t\t\t\trow,\n\t\t\t\tindex,\n\t\t\t}: TableSchema.InsertRowParameters<TRowSchema>): RowValueType {\n\t\t\t\tconst inserted = this.insertRows({\n\t\t\t\t\trows: [row],\n\t\t\t\t\tindex,\n\t\t\t\t});\n\t\t\t\treturn inserted[0] ?? oob();\n\t\t\t}\n\n\t\t\tpublic insertRows({\n\t\t\t\tindex,\n\t\t\t\trows,\n\t\t\t}: TableSchema.InsertRowsParameters<TRowSchema>): RowValueType[] {\n\t\t\t\t// #region Input validation\n\n\t\t\t\t// Ensure index is valid\n\t\t\t\tif (index !== undefined) {\n\t\t\t\t\tTable.validateInsertionIndex(index, this.rows);\n\t\t\t\t}\n\n\t\t\t\t// Note: TypeScript is unable to narrow the type of the row type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tfor (const newRow of rows) {\n\t\t\t\t\t// Check all of the rows being inserted an ensure the table does not already contain any with the same ID.\n\t\t\t\t\tconst maybeId = (newRow as RowValueType).id;\n\t\t\t\t\tif (maybeId !== undefined && this.containsRowWithId(maybeId)) {\n\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t`A row with ID \"${(newRow as RowValueType).id}\" already exists in the table.`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the row contains cells, verify that the table contains the columns for those cells.\n\t\t\t\t\t// Note: we intentionally hide `cells` on `IRow` to avoid leaking the internal data representation as much as possible, so we have to cast here.\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tif ((newRow as any).cells !== undefined) {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\tconst keys: string[] = Object.keys((newRow as any).cells);\n\t\t\t\t\t\tfor (const key of keys) {\n\t\t\t\t\t\t\tif (!this.containsColumnWithId(key)) {\n\t\t\t\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\t\t\t`Attempted to insert row a cell under column ID \"${key}\", but the table does not contain a column with that ID.`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// #endregion\n\n\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the casts below.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.rows.insertAtEnd(TreeArrayNode.spread(rows) as any);\n\t\t\t\t} else {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tthis.rows.insertAt(index, TreeArrayNode.spread(rows) as any);\n\t\t\t\t}\n\n\t\t\t\t// Inserting the input nodes into the tree hydrates them, making them usable as nodes.\n\t\t\t\treturn rows as unknown as RowValueType[];\n\t\t\t}\n\n\t\t\tpublic setCell({\n\t\t\t\tkey,\n\t\t\t\tcell,\n\t\t\t}: TableSchema.SetCellParameters<TCellSchema, TColumnSchema, TRowSchema>): void {\n\t\t\t\tconst { column: columnOrId, row: rowOrId } = key;\n\n\t\t\t\tconst row = this._getRow(rowOrId);\n\t\t\t\tif (row === undefined) {\n\t\t\t\t\tconst rowId = this._getRowId(rowOrId);\n\t\t\t\t\tthrow new UsageError(`No row with ID \"${rowId}\" exists in the table.`);\n\t\t\t\t}\n\n\t\t\t\tconst column = this._getColumn(columnOrId);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\tconst columnId = this._getColumnId(columnOrId);\n\t\t\t\t\tthrow new UsageError(`No column with ID \"${columnId}\" exists in the table.`);\n\t\t\t\t}\n\n\t\t\t\trow.setCell(column, cell);\n\t\t\t}\n\n\t\t\tpublic removeColumns(\n\t\t\t\tcolumns: readonly string[] | readonly ColumnValueType[],\n\t\t\t): ColumnValueType[] {\n\t\t\t\t// If there are no columns to remove, do nothing\n\t\t\t\tif (columns.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\t// If there is only one column to remove, remove it (and don't incur cost of transaction)\n\t\t\t\tif (columns.length === 1) {\n\t\t\t\t\tconst removedColumn = this.removeColumn(columns[0] ?? oob());\n\t\t\t\t\treturn [removedColumn];\n\t\t\t\t}\n\n\t\t\t\t// If there are multiple columns to remove, remove them in a transaction.\n\t\t\t\tconst removedColumns: ColumnValueType[] = [];\n\t\t\t\tTree.runTransaction(this, () => {\n\t\t\t\t\t// Note, throwing an error within a transaction will abort the entire transaction.\n\t\t\t\t\t// So if we throw an error here for any row, no columns will be removed.\n\t\t\t\t\tfor (const columnToRemove of columns) {\n\t\t\t\t\t\tconst removedRow = this.removeColumn(columnToRemove);\n\t\t\t\t\t\tremovedColumns.push(removedRow);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn removedColumns;\n\t\t\t}\n\n\t\t\tpublic removeColumn(columnOrId: string | ColumnValueType): ColumnValueType {\n\t\t\t\tconst column = this._getColumn(columnOrId);\n\t\t\t\tconst index = column === undefined ? -1 : this.columns.indexOf(column);\n\t\t\t\tif (index === -1) {\n\t\t\t\t\tconst columnId = this._getColumnId(columnOrId);\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Specified column with ID \"${columnId}\" does not exist in the table.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tthis.columns.removeAt(index);\n\t\t\t\treturn column as ColumnValueType;\n\t\t\t}\n\n\t\t\tpublic removeAllColumns(): ColumnValueType[] {\n\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the cast.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.removeColumns(this.columns as unknown as ColumnValueType[]);\n\t\t\t}\n\n\t\t\tpublic removeRows(rows: readonly string[] | readonly RowValueType[]): RowValueType[] {\n\t\t\t\t// If there are no rows to remove, do nothing\n\t\t\t\tif (rows.length === 0) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\t// If there is only one row to remove, remove it (and don't incur cost of transaction)\n\t\t\t\tif (rows.length === 1) {\n\t\t\t\t\tconst removedRow = this.removeRow(rows[0] ?? oob());\n\t\t\t\t\treturn [removedRow];\n\t\t\t\t}\n\n\t\t\t\t// If there are multiple rows to remove, remove them in a transaction.\n\t\t\t\tconst removedRows: RowValueType[] = [];\n\t\t\t\tTree.runTransaction(this, () => {\n\t\t\t\t\t// Note, throwing an error within a transaction will abort the entire transaction.\n\t\t\t\t\t// So if we throw an error here for any row, no rows will be removed.\n\t\t\t\t\tfor (const rowToRemove of rows) {\n\t\t\t\t\t\tconst removedRow = this.removeRow(rowToRemove);\n\t\t\t\t\t\tremovedRows.push(removedRow);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn removedRows;\n\t\t\t}\n\n\t\t\tpublic removeRow(rowOrId: string | RowValueType): RowValueType {\n\t\t\t\tconst rowToRemove = this._getRow(rowOrId);\n\t\t\t\tconst index = rowToRemove === undefined ? -1 : this.rows.indexOf(rowToRemove);\n\n\t\t\t\t// If the row does not exist in the table, throw an error.\n\t\t\t\tif (index === -1) {\n\t\t\t\t\tconst rowId = this._getRowId(rowOrId);\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Specified row with ID \"${rowId}\" does not exist in the table.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.rows.removeAt(index);\n\t\t\t\treturn rowToRemove as RowValueType;\n\t\t\t}\n\n\t\t\tpublic removeAllRows(): RowValueType[] {\n\t\t\t\t// TypeScript is unable to narrow the row type correctly here, hence the cast.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.removeRows(this.rows as unknown as RowValueType[]);\n\t\t\t}\n\n\t\t\tpublic removeCell(\n\t\t\t\tkey: TableSchema.CellKey<TColumnSchema, TRowSchema>,\n\t\t\t): CellValueType | undefined {\n\t\t\t\tconst { column: columnOrId, row: rowOrId } = key;\n\t\t\t\tconst row = this._getRow(rowOrId);\n\t\t\t\tif (row === undefined) {\n\t\t\t\t\tconst rowId = this._getRowId(rowOrId);\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Specified row with ID \"${rowId}\" does not exist in the table.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst column = this._getColumn(columnOrId);\n\t\t\t\tif (column === undefined) {\n\t\t\t\t\tconst columnId = this._getColumnId(columnOrId);\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Specified column with ID \"${columnId}\" does not exist in the table.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst cell: CellValueType | undefined = row.getCell(column.id);\n\t\t\t\tif (cell === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\trow.removeCell(column.id);\n\t\t\t\treturn cell;\n\t\t\t}\n\n\t\t\tprivate _getColumn(columnOrId: string | ColumnValueType): ColumnValueType | undefined {\n\t\t\t\treturn typeof columnOrId === \"string\" ? this.getColumn(columnOrId) : columnOrId;\n\t\t\t}\n\n\t\t\tprivate _getColumnId(columnOrId: string | ColumnValueType): string {\n\t\t\t\treturn typeof columnOrId === \"string\" ? columnOrId : columnOrId.id;\n\t\t\t}\n\n\t\t\tprivate _getRow(rowOrId: string | RowValueType): RowValueType | undefined {\n\t\t\t\treturn typeof rowOrId === \"string\" ? this.getRow(rowOrId) : rowOrId;\n\t\t\t}\n\n\t\t\tprivate _getRowId(rowOrId: string | RowValueType): string {\n\t\t\t\treturn typeof rowOrId === \"string\" ? rowOrId : rowOrId.id;\n\t\t\t}\n\n\t\t\tprivate containsColumnWithId(columnId: string): boolean {\n\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn (\n\t\t\t\t\tthis.columns.find((column) => (column as TableSchema.Column).id === columnId) !==\n\t\t\t\t\tundefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tprivate containsRowWithId(rowId: string): boolean {\n\t\t\t\t// TypeScript is unable to narrow the types correctly here, hence the cast.\n\t\t\t\t// See: https://github.com/microsoft/TypeScript/issues/52144\n\t\t\t\treturn this.rows.find((row) => (row as TableSchema.Row).id === rowId) !== undefined;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Ensure that the specified index is a valid location for item insertion in the destination list.\n\t\t\t * @throws Throws a usage error if the destination is invalid.\n\t\t\t */\n\t\t\tprivate static validateInsertionIndex(\n\t\t\t\tindex: number,\n\t\t\t\tdestinationList: readonly unknown[],\n\t\t\t): void {\n\t\t\t\tif (index < 0) {\n\t\t\t\t\tthrow new UsageError(\"The index must be greater than or equal to 0.\");\n\t\t\t\t}\n\n\t\t\t\tif (index > destinationList.length) {\n\t\t\t\t\tthrow new UsageError(\"The index specified for insertion is out of bounds.\");\n\t\t\t\t}\n\n\t\t\t\tif (!Number.isInteger(index)) {\n\t\t\t\t\tthrow new UsageError(\"The index must be an integer.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttype TableValueType = TreeNode &\n\t\t\tTableSchema.Table<TCellSchema, TColumnSchema, TRowSchema> &\n\t\t\tWithType<ScopedSchemaName<Scope, \"Table\">>;\n\t\ttype TableInsertableType = InsertableObjectFromSchemaRecord<typeof tableFields>;\n\n\t\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t\t// for the private brand field of TreeNode.\n\t\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t\t// This is avoided by doing this type conversion.\n\t\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\t\tconst TableSchemaType: TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<Scope, \"Table\">,\n\t\t\t/* Kind */ NodeKind.Object,\n\t\t\t/* TNode */ TableValueType,\n\t\t\t/* TInsertable */ object & TableInsertableType,\n\t\t\t/* ImplicitlyConstructable */ true,\n\t\t\t/* Info */ typeof tableFields\n\t\t> = Table;\n\n\t\t// Return the table schema\n\t\treturn TableSchemaType;\n\t}\n\n\t/**\n\t * Base row schema type.\n\t * @sealed @system @internal\n\t */\n\texport type TableSchemaBase<\n\t\tTScope extends string | undefined,\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ColumnSchemaBase<TScope>,\n\t\tTRow extends RowSchemaBase<TScope, TCell>,\n\t> = ReturnType<typeof createTableInternal<TScope, TCell, TColumn, TRow>>;\n\n\t// #endregion\n}\n\n/**\n * Contains types and factories for creating schema to represent dynamic tabular data.\n *\n * @remarks\n *\n * Tables created using these APIs are...\n *\n * - sparse, meaning that cells may be omitted, and new rows are empty by default.\n *\n * - dynamic, meaning that their structure can be modified at runtime.\n * Columns and rows can be inserted, removed, modified, and reordered.\n * Cells can be inserted, removed, and modified.\n *\n * - row-major, meaning that operating on rows (including inserts, removal, moves, and traversal) is more efficient than operating on columns.\n *\n * Column and Row schema created using these APIs are extensible via the `props` field.\n * This allows association of additional properties with column and row nodes.\n *\n * Note: for now it is possible for table cells to become \"orphaned\".\n * That is, it is possible to enter a state where one or more rows contain cells with no corresponding column.\n * To help avoid this situation, you can manually remove corresponding cells when removing columns.\n * Either way, it is possible to enter such a state via the merging of edits.\n * For example: one client might add a row while another concurrently removes a column, orphaning the cell where the column and row intersected.\n *\n * @example Using default Column and Row schema\n *\n * ```typescript\n * class Cell extends schemaFactory.object(\"TableCell\", {\n * \tvalue: schemaFactory.string,\n * }) {}\n *\n * class Table extends TableSchema.createTable({\n * \tschemaFactory,\n * \tcell: Cell,\n * }) {}\n *\n * const table = new Table({\n * \tcolumns: [{ id: \"column-0\" }],\n * \trows: [{ id: \"row-0\", cells: {} }],\n * });\n * ```\n *\n * @example Customizing Column and Row schema\n *\n * ```typescript\n * class Cell extends schemaFactory.object(\"TableCell\", {\n * \tvalue: schemaFactory.string,\n * }) {}\n *\n * class ColumnProps extends schemaFactory.object(\"TableColumnProps\", {\n * \t// Column label to display.\n * \tlabel: schemaFactory.string,\n * \t// The type of data represented by the cells. Default: string.\n * \tdataType: schemaFactory.optional(schemaFactory.string),\n * }) {}\n *\n * class Column extends TableSchema.createColumn({\n * \tschemaFactory,\n * \tprops: ColumnProps,\n * }) {}\n *\n * class Row extends TableSchema.createRow({\n * \tschemaFactory,\n * \tcell: Cell,\n * }) {}\n *\n * class Table extends TableSchema.createTable({\n * \tschemaFactory,\n * \tcell: Cell,\n * \tcolumn: Column,\n * \trow: Row,\n * }) {}\n *\n * const table = new Table({\n * \tcolumns: [\n * \t\tnew Column({ props: { label: \"Entry\", dataType: \"string\" } }),\n * \t\tnew Column({ props: { label: \"Date\", dataType: \"date\" } }),\n * \t\tnew Column({ props: { label: \"Amount\", dataType: \"number\" } }),\n * \t],\n * \trows: [],\n * });\n * ```\n *\n * @privateRemarks\n * The above examples are backed by tests in `tableSchema.spec.ts`.\n * Those tests and these examples should be kept in-sync to ensure that the examples are correct.\n *\n * @internal\n */\nexport namespace TableSchema {\n\t// #region Column\n\n\t/**\n\t * A column in a table.\n\t * @remarks Implemented by the schema class returned from {@link TableSchema.(createColumn:2)}.\n\t * @sealed @internal\n\t */\n\texport interface Column<\n\t\tTProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema,\n\t> {\n\t\t/**\n\t\t * The unique identifier of the column.\n\t\t * @remarks Uniquely identifies the node within the entire tree, not just the table.\n\t\t */\n\t\treadonly id: string;\n\n\t\t/**\n\t\t * The column's properties.\n\t\t * @remarks This is a user-defined schema that can be used to store additional information about the column.\n\t\t * @privateRemarks\n\t\t * Note: these docs are duplicated on the inline type definitions in {@link createColumn}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps>>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<\n\t\t\tUnannotateImplicitFieldSchema<TProps>\n\t\t>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @internal\n\t */\n\texport function createColumn<const TScope extends string | undefined>({\n\t\tschemaFactory,\n\t}: System_TableSchema.CreateColumnOptionsBase<\n\t\tSchemaFactoryAlpha<TScope>\n\t>): System_TableSchema.ColumnSchemaBase<TScope, System_TableSchema.DefaultPropsType>;\n\t/**\n\t * Factory for creating new table column schema.\n\t * @internal\n\t */\n\texport function createColumn<\n\t\tconst TScope extends string | undefined,\n\t\tconst TProps extends ImplicitAnnotatedFieldSchema,\n\t>({\n\t\tschemaFactory,\n\t\tprops,\n\t}: System_TableSchema.CreateColumnOptionsBase<SchemaFactoryAlpha<TScope>> & {\n\t\t/**\n\t\t * Optional column properties.\n\t\t */\n\t\treadonly props: TProps;\n\t}): System_TableSchema.ColumnSchemaBase<TScope, TProps>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function createColumn({\n\t\tschemaFactory,\n\t\tprops = SchemaFactory.optional(SchemaFactory.null),\n\t}: System_TableSchema.CreateColumnOptionsBase & {\n\t\treadonly props?: ImplicitAnnotatedFieldSchema;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createColumnInternal(schemaFactory, props);\n\t}\n\n\t// #endregion\n\n\t// #region Row\n\n\t/**\n\t * A row in a table.\n\t * @remarks Implemented by the schema class returned from {@link TableSchema.(createRow:2)}.\n\t * @sealed @internal\n\t */\n\texport interface Row<\n\t\tTCell extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema,\n\t> {\n\t\t/**\n\t\t * The unique identifier of the row.\n\t\t * @remarks Uniquely identifies the node within the entire tree, not just the table.\n\t\t */\n\t\treadonly id: string;\n\n\t\t/**\n\t\t * Gets the cell in the specified column.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t * @privateRemarks TODO: throw if the column does not belong to the same table as the row.\n\t\t */\n\t\tgetCell(column: Column): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\t\t/**\n\t\t * Gets the cell in the specified column, denoted by column ID.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t */\n\t\tgetCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * Sets the cell in the specified column.\n\t\t * @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:1)} instead.\n\t\t * @privateRemarks TODO: Throw an error if the column does not exist in the table.\n\t\t */\n\t\tsetCell(column: Column, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;\n\t\t/**\n\t\t * Sets the cell in the specified column, denoted by column ID.\n\t\t * @remarks To remove a cell, call {@link TableSchema.Row.(removeCell:2)} instead.\n\t\t */\n\t\tsetCell(columnId: string, value: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;\n\n\t\t/**\n\t\t * Removes the cell in the specified column.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t * @privateRemarks TODO: Throw if the column does not belong to the same table as the row.\n\t\t */\n\t\tremoveCell(column: Column): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\t\t/**\n\t\t * Removes the cell in the specified column, denoted by column ID.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t */\n\t\tremoveCell(columnId: string): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * The row's properties.\n\t\t * @remarks This is a user-defined schema that can be used to store additional information about the row.\n\t\t * @privateRemarks\n\t\t * Note: these docs are duplicated on the inline type definitions in {@link createColumn}.\n\t\t * If you update the docs here, please also update the inline type definitions.\n\t\t */\n\t\tget props(): TreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TProps>>;\n\t\tset props(value: InsertableTreeFieldFromImplicitField<\n\t\t\tUnannotateImplicitFieldSchema<TProps>\n\t\t>);\n\t}\n\n\t/**\n\t * Factory for creating new table column schema.\n\t * @internal\n\t */\n\texport function createRow<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t}: System_TableSchema.CreateRowOptionsBase<\n\t\tSchemaFactoryAlpha<TScope>,\n\t\tTCell\n\t>): System_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>;\n\t/**\n\t * Factory for creating new table column schema.\n\t * @internal\n\t */\n\texport function createRow<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TProps extends ImplicitAnnotatedFieldSchema,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops,\n\t}: System_TableSchema.CreateRowOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {\n\t\t/**\n\t\t * Optional row properties.\n\t\t */\n\t\treadonly props: TProps;\n\t}): System_TableSchema.RowSchemaBase<TScope, TCell, TProps>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function createRow({\n\t\tschemaFactory,\n\t\tcell,\n\t\tprops = SchemaFactory.optional(SchemaFactory.null),\n\t}: System_TableSchema.CreateRowOptionsBase & {\n\t\treadonly props?: ImplicitAnnotatedFieldSchema;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createRowInternal(schemaFactory, cell, props);\n\t}\n\n\t// #endregion\n\n\t// #region Table\n\n\t/**\n\t * A key to uniquely identify a cell within a table.\n\t * @internal\n\t */\n\texport interface CellKey<\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * {@link TableSchema.Column} or {@link TableSchema.Column.id} at which the cell is located.\n\t\t */\n\t\treadonly column: string | TreeNodeFromImplicitAllowedTypes<TColumn>;\n\n\t\t/**\n\t\t * {@link TableSchema.Row} or {@link TableSchema.Row.id} at which the cell is located.\n\t\t */\n\t\treadonly row: string | TreeNodeFromImplicitAllowedTypes<TRow>;\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertColumn} parameters.\n\t * @internal\n\t */\n\texport interface InsertColumnParameters<TColumn extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new column.\n\t\t * @remarks If not provided, the column will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The column to insert.\n\t\t */\n\t\treadonly column: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>;\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertColumns} parameters.\n\t * @internal\n\t */\n\texport interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new columns.\n\t\t * @remarks If not provided, the columns will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The columns to insert.\n\t\t */\n\t\treadonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertRow} parameters.\n\t * @internal\n\t */\n\texport interface InsertRowParameters<TRow extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new row.\n\t\t * @remarks If not provided, the row will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The row to insert.\n\t\t */\n\t\treadonly row: InsertableTreeNodeFromImplicitAllowedTypes<TRow>;\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.insertRows} parameters.\n\t * @internal\n\t */\n\texport interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {\n\t\t/**\n\t\t * The index at which to insert the new rows.\n\t\t * @remarks If not provided, the rows will be appended to the end of the table.\n\t\t */\n\t\treadonly index?: number | undefined;\n\n\t\t/**\n\t\t * The rows to insert.\n\t\t */\n\t\treadonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];\n\t}\n\n\t/**\n\t * {@link TableSchema.Table.setCell} parameters.\n\t * @internal\n\t */\n\texport interface SetCellParameters<\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * The key to uniquely identify a cell in a table.\n\t\t */\n\t\treadonly key: CellKey<TColumn, TRow>;\n\n\t\t/**\n\t\t * The cell to set.\n\t\t */\n\t\treadonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;\n\t}\n\n\t/**\n\t * A table.\n\t * @sealed @internal\n\t */\n\texport interface Table<\n\t\tTCell extends ImplicitAllowedTypes,\n\t\tTColumn extends ImplicitAllowedTypes,\n\t\tTRow extends ImplicitAllowedTypes,\n\t> {\n\t\t/**\n\t\t * The table's columns.\n\t\t */\n\t\treadonly columns: TreeArrayNode<TColumn>;\n\n\t\t/**\n\t\t * The table's rows.\n\t\t */\n\t\treadonly rows: TreeArrayNode<TRow>;\n\n\t\t/**\n\t\t * Gets a table column by its {@link TableSchema.Column.id}.\n\t\t */\n\t\tgetColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;\n\n\t\t/**\n\t\t * Gets a table row by its {@link TableSchema.Row.id}.\n\t\t */\n\t\tgetRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;\n\n\t\t/**\n\t\t * Gets a cell in the table by column and row IDs.\n\t\t * @param key - A key that uniquely distinguishes a cell in the table, represented as a combination of the column ID and row ID.\n\t\t */\n\t\tgetCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\n\t\t/**\n\t\t * Inserts a column into the table.\n\t\t *\n\t\t * @throws\n\t\t * Throws an error in the following cases:\n\t\t *\n\t\t * - The column, or a column with the same ID is already in the tree.\n\t\t *\n\t\t * - The specified index is out of range.\n\t\t *\n\t\t * No column is inserted in these cases.\n\t\t */\n\t\tinsertColumn(\n\t\t\tparams: InsertColumnParameters<TColumn>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>;\n\n\t\t/**\n\t\t * Inserts 0 or more columns into the table.\n\t\t *\n\t\t * @throws\n\t\t * Throws an error in the following cases:\n\t\t *\n\t\t * - At least one column, or a column with the same ID is already in the tree.\n\t\t *\n\t\t * - The specified index is out of range.\n\t\t *\n\t\t * No columns are inserted in these cases.\n\t\t */\n\t\tinsertColumns(\n\t\t\tparams: InsertColumnsParameters<TColumn>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\n\t\t/**\n\t\t * Inserts a row into the table.\n\t\t *\n\t\t * @throws\n\t\t * Throws an error in the following cases:\n\t\t *\n\t\t * - The row, or a row with the same ID is already in the tree.\n\t\t *\n\t\t * - The row contains cells, but the table does not contain matching columns for one or more of those cells.\n\t\t *\n\t\t * - The specified index is out of range.\n\t\t *\n\t\t * No row is inserted in these cases.\n\t\t */\n\t\tinsertRow(params: InsertRowParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>;\n\n\t\t/**\n\t\t * Inserts 0 or more rows into the table.\n\t\t *\n\t\t * @throws\n\t\t * Throws an error in the following cases:\n\t\t *\n\t\t * - At least one row, or a row with the same ID is already in the tree.\n\t\t *\n\t\t * - The row contains cells, but the table does not contain matching columns for one or more of those cells.\n\t\t *\n\t\t * - The specified index is out of range.\n\t\t *\n\t\t * No rows are inserted in these cases.\n\t\t */\n\t\tinsertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\n\t\t/**\n\t\t * Sets the cell at the specified location in the table.\n\t\t * @remarks To remove a cell, call {@link TableSchema.Table.removeCell} instead.\n\t\t */\n\t\tsetCell(params: SetCellParameters<TCell, TColumn, TRow>): void;\n\n\t\t/**\n\t\t * Removes the specified column from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Note: this does not remove any cells from the table's rows.\n\t\t * To remove the corresponding cells, use {@link TableSchema.Table.removeCell}.\n\t\t *\n\t\t * @param column - The {@link TableSchema.Column | column} or {@link TableSchema.Column.id | column ID} to remove.\n\t\t * @throws Throws an error if the column is not in the table.\n\t\t * @privateRemarks TODO (future): Actually remove corresponding cells from table rows.\n\t\t */\n\t\tremoveColumn(\n\t\t\tcolumn: string | TreeNodeFromImplicitAllowedTypes<TColumn>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>;\n\n\t\t/**\n\t\t * Removes 0 or more columns from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Note: this does not remove any cells from the table's rows.\n\t\t * To remove the corresponding cells, use {@link TableSchema.Table.removeCell}.\n\t\t *\n\t\t * @param columns - The columns to remove.\n\t\t * @throws Throws an error if any of the columns are not in the table.\n\t\t * In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(\n\t\t\tcolumns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[],\n\t\t): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\t\t/**\n\t\t * Removes 0 or more columns from the table.\n\t\t *\n\t\t * @remarks\n\t\t * Note: this does not remove any cells from the table's rows.\n\t\t * To remove the corresponding cells, use {@link TableSchema.Table.removeCell}.\n\t\t *\n\t\t * @param columns - The columns to remove, specified by their {@link TableSchema.Column.id}.\n\t\t * @throws Throws an error if any of the columns are not in the table.\n\t\t * In this case, no columns are removed.\n\t\t */\n\t\tremoveColumns(columns: readonly string[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\n\t\t/**\n\t\t * Removes all columns from the table.\n\t\t * @returns The removed columns.\n\t\t */\n\t\tremoveAllColumns(): TreeNodeFromImplicitAllowedTypes<TColumn>[];\n\n\t\t/**\n\t\t * Removes the specified row from the table.\n\t\t * @param row - The {@link TableSchema.Row | row} or {@link TableSchema.Row.id | row ID} to remove.\n\t\t * @throws Throws an error if the row is not in the table.\n\t\t */\n\t\tremoveRow(\n\t\t\trow: string | TreeNodeFromImplicitAllowedTypes<TRow>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TRow>;\n\n\t\t/**\n\t\t * Removes 0 or more rows from the table.\n\t\t * @param rows - The rows to remove.\n\t\t * @throws Throws an error if any of the rows are not in the table.\n\t\t * In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(\n\t\t\trows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[],\n\t\t): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\t\t/**\n\t\t * Removes 0 or more rows from the table.\n\t\t * @param rows - The rows to remove, specified by their {@link TableSchema.Row.id}.\n\t\t * @throws Throws an error if any of the rows are not in the table.\n\t\t * In this case, no rows are removed.\n\t\t */\n\t\tremoveRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\n\t\t/**\n\t\t * Removes all rows from the table.\n\t\t * @returns The removed rows.\n\t\t */\n\t\tremoveAllRows(): TreeNodeFromImplicitAllowedTypes<TRow>[];\n\n\t\t/**\n\t\t * Removes the cell at the specified location in the table.\n\t\t * @returns The cell if it exists, otherwise undefined.\n\t\t * @throws Throws an error if the location does not exist in the table.\n\t\t */\n\t\tremoveCell(\n\t\t\tkey: CellKey<TColumn, TRow>,\n\t\t): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;\n\t}\n\n\t/**\n\t * Factory for creating new table schema without specifying row or column schema.\n\t * @internal\n\t */\n\texport function createTable<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t}: System_TableSchema.TableFactoryOptionsBase<\n\t\tSchemaFactoryAlpha<TScope>,\n\t\tTCell\n\t>): System_TableSchema.TableSchemaBase<\n\t\tTScope,\n\t\tTCell,\n\t\tSystem_TableSchema.ColumnSchemaBase<TScope, System_TableSchema.DefaultPropsType>,\n\t\tSystem_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>\n\t>;\n\t/**\n\t * Factory for creating new table schema without specifying row schema.\n\t * @internal\n\t */\n\texport function createTable<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TScope>,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t\tcolumn,\n\t}: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {\n\t\treadonly column: TColumn;\n\t}): System_TableSchema.TableSchemaBase<\n\t\tTScope,\n\t\tTCell,\n\t\tTColumn,\n\t\tSystem_TableSchema.RowSchemaBase<TScope, TCell, System_TableSchema.DefaultPropsType>\n\t>;\n\t/**\n\t * Factory for creating new table schema.\n\t * @internal\n\t */\n\texport function createTable<\n\t\tconst TScope extends string | undefined,\n\t\tconst TCell extends ImplicitAllowedTypes,\n\t\tconst TColumn extends System_TableSchema.ColumnSchemaBase<TScope>,\n\t\tconst TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>,\n\t>({\n\t\tschemaFactory,\n\t\tcell,\n\t\tcolumn,\n\t\trow,\n\t}: System_TableSchema.TableFactoryOptionsBase<SchemaFactoryAlpha<TScope>, TCell> & {\n\t\treadonly column: TColumn;\n\t\treadonly row: TRow;\n\t}): System_TableSchema.TableSchemaBase<TScope, TCell, TColumn, TRow>;\n\t/**\n\t * Overload implementation\n\t */\n\texport function createTable({\n\t\tschemaFactory,\n\t\tcell,\n\t\tcolumn = createColumn({\n\t\t\tschemaFactory,\n\t\t}),\n\t\trow = createRow({\n\t\t\tschemaFactory,\n\t\t\tcell,\n\t\t}),\n\t}: System_TableSchema.TableFactoryOptionsBase & {\n\t\treadonly column?: System_TableSchema.ColumnSchemaBase;\n\t\treadonly row?: System_TableSchema.RowSchemaBase;\n\t}): TreeNodeSchema {\n\t\treturn System_TableSchema.createTableInternal(schemaFactory, cell, column, row);\n\t}\n\n\t// #endregion\n}\n"]}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { SharedObjectKind } from "@fluidframework/shared-object-base";
6
6
  import { type ISharedObject, type ISharedObjectKind } from "@fluidframework/shared-object-base/internal";
7
- import type { SharedTreeOptions, ITreePrivate } from "./shared-tree/index.js";
7
+ import { type ITreePrivate, type SharedTreeOptions } from "./shared-tree/index.js";
8
8
  import type { ITree } from "./simple-tree/index.js";
9
9
  /**
10
10
  * {@link ITreePrivate} extended with ISharedObject.
@@ -1 +1 @@
1
- {"version":3,"file":"treeFactory.d.ts","sourceRoot":"","sources":["../src/treeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAEN,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAGtB,MAAM,6CAA6C,CAAC;AAErD,OAAO,KAAK,EAGX,iBAAiB,EAIjB,YAAY,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAEX,KAAK,EAOL,MAAM,wBAAwB,CAAC;AAQhC;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,aAAa,EAAE,YAAY;CAAG;AA2InE;;;;;GAKG;AACH,eAAO,MAAM,UAAU,oDAA2B,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,iBAAiB,GACxB,iBAAiB,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAOpD"}
1
+ {"version":3,"file":"treeFactory.d.ts","sourceRoot":"","sources":["../src/treeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAMtB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAMpD;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,aAAa,EAAE,YAAY;CAAG;AA4CnE;;;;;GAKG;AACH,eAAO,MAAM,UAAU,oDAA2B,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,iBAAiB,GACxB,iBAAiB,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,CASpD"}
@@ -2,82 +2,36 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { SharedObject, createSharedObjectKind, } from "@fluidframework/shared-object-base/internal";
6
- import { SharedTreeFactoryType, SharedTreeAttributes } from "./sharedTreeAttributes.js";
5
+ import { makeSharedObjectKind, } from "@fluidframework/shared-object-base/internal";
6
+ import { SharedTreeKernel, } from "./shared-tree/index.js";
7
7
  import { Breakable } from "./util/index.js";
8
- import { SharedTreeKernel } from "./shared-tree/index.js";
9
8
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
10
- import { fail } from "@fluidframework/core-utils/internal";
9
+ import { SharedTreeFactoryType, SharedTreeAttributes } from "./sharedTreeAttributes.js";
11
10
  /**
12
- * Shared object wrapping {@link SharedTreeKernel}.
11
+ * Creates a factory for shared tree kernels with the given options.
12
+ * @remarks
13
+ * Exposes {@link ITreePrivate} to allow access to internals in tests without a cast.
14
+ * Code exposing this beyond this package will need to update to a more public type.
13
15
  */
14
- class SharedTreeImpl extends SharedObject {
15
- constructor(id, runtime, attributes, optionsParam, telemetryContextPrefix = "fluid_sharedTree_") {
16
- super(id, runtime, attributes, telemetryContextPrefix);
17
- this.breaker = new Breakable("Shared Tree");
18
- if (runtime.idCompressor === undefined) {
16
+ function treeKernelFactory(options) {
17
+ function treeFromKernelArgs(args) {
18
+ if (args.idCompressor === undefined) {
19
19
  throw new UsageError("IdCompressor must be enabled to use SharedTree");
20
20
  }
21
- this.kernel = new SharedTreeKernel(this.breaker, this, this.serializer, (content, localOpMetadata) => this.submitLocalMessage(content, localOpMetadata), () => this.deltaManager.lastSequenceNumber, this.logger, runtime.idCompressor, optionsParam);
22
- }
23
- summarizeCore(serializer, telemetryContext, incrementalSummaryContext) {
24
- return this.kernel.summarizeCore(serializer, telemetryContext, incrementalSummaryContext);
25
- }
26
- processCore(message, local, localOpMetadata) {
27
- fail(0xb75 /* processCore should not be called on SharedTree */);
28
- }
29
- processMessagesCore(messagesCollection) {
30
- this.kernel.processMessagesCore(messagesCollection);
31
- }
32
- onDisconnect() {
33
- this.kernel.onDisconnect();
34
- }
35
- exportVerbose() {
36
- return this.kernel.exportVerbose();
37
- }
38
- exportSimpleSchema() {
39
- return this.kernel.exportSimpleSchema();
40
- }
41
- contentSnapshot() {
42
- return this.kernel.contentSnapshot();
43
- }
44
- viewWith(config) {
45
- return this.kernel.viewWith(config);
46
- }
47
- async loadCore(services) {
48
- await this.kernel.loadCore(services);
49
- }
50
- didAttach() {
51
- this.kernel.didAttach();
52
- }
53
- applyStashedOp(...args) {
54
- this.kernel.applyStashedOp(...args);
55
- }
56
- reSubmitCore(...args) {
57
- this.kernel.reSubmitCore(...args);
58
- }
59
- }
60
- /**
61
- * A channel factory that creates an {@link ITree}.
62
- */
63
- class TreeFactory {
64
- constructor(options) {
65
- this.options = options;
66
- this.type = SharedTreeFactoryType;
67
- this.attributes = SharedTreeAttributes;
68
- }
69
- async load(runtime, id, services, channelAttributes) {
70
- const tree = new SharedTreeImpl(id, runtime, channelAttributes, this.options);
71
- await tree.load(services);
72
- return tree;
73
- }
74
- create(runtime, id) {
75
- const tree = new SharedTreeImpl(id, runtime, this.attributes, this.options);
76
- tree.initializeLocal();
77
- return tree;
78
- }
21
+ return new SharedTreeKernel(new Breakable("SharedTree"), args.sharedObject, args.serializer, args.submitLocalMessage, args.lastSequenceNumber, args.logger, args.idCompressor, options);
22
+ }
23
+ return {
24
+ create: (args) => {
25
+ const k = treeFromKernelArgs(args);
26
+ return { kernel: k, view: k.view };
27
+ },
28
+ async loadCore(args, storage) {
29
+ const k = treeFromKernelArgs(args);
30
+ await k.loadCore(storage);
31
+ return { kernel: k, view: k.view };
32
+ },
33
+ };
79
34
  }
80
- TreeFactory.Type = SharedTreeFactoryType;
81
35
  /**
82
36
  * SharedTree is a hierarchical data structure for collaboratively editing strongly typed JSON-like trees
83
37
  * of objects, arrays, and other data types.
@@ -112,11 +66,12 @@ export const SharedTree = configuredSharedTree({});
112
66
  * @internal
113
67
  */
114
68
  export function configuredSharedTree(options) {
115
- class ConfiguredFactory extends TreeFactory {
116
- constructor() {
117
- super(options);
118
- }
119
- }
120
- return createSharedObjectKind(ConfiguredFactory);
69
+ const sharedObjectOptions = {
70
+ type: SharedTreeFactoryType,
71
+ attributes: SharedTreeAttributes,
72
+ telemetryContextPrefix: "fluid_sharedTree_",
73
+ factory: treeKernelFactory(options),
74
+ };
75
+ return makeSharedObjectKind(sharedObjectOptions);
121
76
  }
122
77
  //# sourceMappingURL=treeFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"treeFactory.js","sourceRoot":"","sources":["../src/treeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH,OAAO,EAIN,YAAY,EACZ,sBAAsB,GACtB,MAAM,6CAA6C,CAAC;AAqBrD,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,E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C,QAAQ,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5E,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;;AAtBa,gBAAI,GAAW,qBAAqB,AAAhC,CAAiC;AAyBpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,oBAAoB,CACnC,OAA0B;IAE1B,MAAM,iBAAkB,SAAQ,WAAW;QAC1C;YACC,KAAK,CAAC,OAAO,CAAC,CAAC;QAChB,CAAC;KACD;IACD,OAAO,sBAAsB,CAAQ,iBAAiB,CAAC,CAAC;AACzD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tITelemetryContext,\n\tIExperimentalIncrementalSummaryContext,\n\tISummaryTreeWithStats,\n\tIRuntimeMessageCollection,\n} from \"@fluidframework/runtime-definitions/internal\";\n\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport {\n\ttype IFluidSerializer,\n\ttype ISharedObject,\n\ttype ISharedObjectKind,\n\tSharedObject,\n\tcreateSharedObjectKind,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport type {\n\tSchematizingSimpleTreeView,\n\tSharedTreeContentSnapshot,\n\tSharedTreeOptions,\n\tSharedTreeOptionsInternal,\n\tSharedTreeEditBuilder,\n\tSharedTreeChange,\n\tITreePrivate,\n} from \"./shared-tree/index.js\";\nimport type {\n\tImplicitFieldSchema,\n\tITree,\n\tReadSchema,\n\tSimpleTreeSchema,\n\tTreeView,\n\tTreeViewConfiguration,\n\tUnsafeUnknownSchema,\n\tVerboseTree,\n} from \"./simple-tree/index.js\";\nimport { SharedTreeFactoryType, SharedTreeAttributes } from \"./sharedTreeAttributes.js\";\nimport { Breakable } from \"./util/index.js\";\nimport { SharedTreeKernel } from \"./shared-tree/index.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport type { SharedTreeCore } from \"./shared-tree-core/index.js\";\n\n/**\n * {@link ITreePrivate} extended with ISharedObject.\n * @remarks\n * This is used when integration testing this package with the Fluid runtime as it exposes the APIs the runtime consumes to manipulate the tree.\n */\nexport interface ISharedTree extends ISharedObject, ITreePrivate {}\n\n/**\n * Shared object wrapping {@link SharedTreeKernel}.\n */\nclass SharedTreeImpl extends SharedObject implements ISharedTree {\n\tprivate readonly breaker: Breakable = new Breakable(\"Shared Tree\");\n\n\tpublic readonly kernel: SharedTreeKernel;\n\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\toptionsParam: SharedTreeOptionsInternal,\n\t\ttelemetryContextPrefix: string = \"fluid_sharedTree_\",\n\t) {\n\t\tsuper(id, runtime, attributes, telemetryContextPrefix);\n\t\tif (runtime.idCompressor === undefined) {\n\t\t\tthrow new UsageError(\"IdCompressor must be enabled to use SharedTree\");\n\t\t}\n\t\tthis.kernel = new SharedTreeKernel(\n\t\t\tthis.breaker,\n\t\t\tthis,\n\t\t\tthis.serializer,\n\t\t\t(content, localOpMetadata) => this.submitLocalMessage(content, localOpMetadata),\n\t\t\t() => this.deltaManager.lastSequenceNumber,\n\t\t\tthis.logger,\n\t\t\truntime.idCompressor,\n\t\t\toptionsParam,\n\t\t);\n\t}\n\n\tpublic summarizeCore(\n\t\tserializer: IFluidSerializer,\n\t\ttelemetryContext?: ITelemetryContext,\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t): ISummaryTreeWithStats {\n\t\treturn this.kernel.summarizeCore(serializer, telemetryContext, incrementalSummaryContext);\n\t}\n\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tfail(0xb75 /* processCore should not be called on SharedTree */);\n\t}\n\n\tprotected override processMessagesCore(messagesCollection: IRuntimeMessageCollection): void {\n\t\tthis.kernel.processMessagesCore(messagesCollection);\n\t}\n\n\tprotected onDisconnect(): void {\n\t\tthis.kernel.onDisconnect();\n\t}\n\n\tpublic exportVerbose(): VerboseTree | undefined {\n\t\treturn this.kernel.exportVerbose();\n\t}\n\n\tpublic exportSimpleSchema(): SimpleTreeSchema {\n\t\treturn this.kernel.exportSimpleSchema();\n\t}\n\n\tpublic contentSnapshot(): SharedTreeContentSnapshot {\n\t\treturn this.kernel.contentSnapshot();\n\t}\n\n\t// For the new TreeViewAlpha API\n\tpublic viewWith<TRoot extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tconfig: TreeViewConfiguration<ReadSchema<TRoot>>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>>;\n\n\t// For the old TreeView API\n\tpublic viewWith<TRoot extends ImplicitFieldSchema>(\n\t\tconfig: TreeViewConfiguration<TRoot>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<TRoot>;\n\n\tpublic viewWith<TRoot extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tconfig: TreeViewConfiguration<ReadSchema<TRoot>>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>> {\n\t\treturn this.kernel.viewWith(config);\n\t}\n\n\tprotected override async loadCore(services: IChannelStorageService): Promise<void> {\n\t\tawait this.kernel.loadCore(services);\n\t}\n\n\tprotected override didAttach(): void {\n\t\tthis.kernel.didAttach();\n\t}\n\n\tprotected override applyStashedOp(\n\t\t...args: Parameters<\n\t\t\tSharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>[\"applyStashedOp\"]\n\t\t>\n\t): void {\n\t\tthis.kernel.applyStashedOp(...args);\n\t}\n\n\tprotected override reSubmitCore(\n\t\t...args: Parameters<\n\t\t\tSharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>[\"reSubmitCore\"]\n\t\t>\n\t): void {\n\t\tthis.kernel.reSubmitCore(...args);\n\t}\n}\n\n/**\n * A channel factory that creates an {@link ITree}.\n */\nclass TreeFactory implements IChannelFactory<ISharedTree> {\n\tpublic static Type: string = SharedTreeFactoryType;\n\tpublic readonly type: string = SharedTreeFactoryType;\n\n\tpublic readonly attributes: IChannelAttributes = SharedTreeAttributes;\n\n\tpublic constructor(private readonly options: SharedTreeOptionsInternal) {}\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tchannelAttributes: Readonly<IChannelAttributes>,\n\t): Promise<ISharedTree> {\n\t\tconst tree = new SharedTreeImpl(id, runtime, channelAttributes, this.options);\n\t\tawait tree.load(services);\n\t\treturn tree;\n\t}\n\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): ISharedTree {\n\t\tconst tree = new SharedTreeImpl(id, runtime, this.attributes, this.options);\n\t\ttree.initializeLocal();\n\t\treturn tree;\n\t}\n}\n\n/**\n * SharedTree is a hierarchical data structure for collaboratively editing strongly typed JSON-like trees\n * of objects, arrays, and other data types.\n * @legacy\n * @alpha\n */\nexport const SharedTree = configuredSharedTree({});\n\n/**\n * {@link SharedTree} but allowing a non-default configuration.\n * @remarks\n * This is useful for debugging and testing to opt into extra validation or see if opting out of some optimizations fixes an issue.\n * @example\n * ```typescript\n * import {\n * \tForestType,\n * \tTreeCompressionStrategy,\n * \tconfiguredSharedTree,\n * \ttypeboxValidator,\n * \t// eslint-disable-next-line import/no-internal-modules\n * } from \"@fluidframework/tree/internal\";\n * const SharedTree = configuredSharedTree({\n * \tforest: ForestType.Reference,\n * \tjsonValidator: typeboxValidator,\n * \ttreeEncodeType: TreeCompressionStrategy.Uncompressed,\n * });\n * ```\n * @privateRemarks\n * This should be legacy, but has to be internal due to limitations of API tagging preventing it from being both alpha and alpha+legacy.\n * TODO:\n * Expose Ajv validator for better error message quality somehow.\n * Maybe as part of a test utils or dev-tool package?\n * @internal\n */\nexport function configuredSharedTree(\n\toptions: SharedTreeOptions,\n): ISharedObjectKind<ITree> & SharedObjectKind<ITree> {\n\tclass ConfiguredFactory extends TreeFactory {\n\t\tpublic constructor() {\n\t\t\tsuper(options);\n\t\t}\n\t}\n\treturn createSharedObjectKind<ITree>(ConfiguredFactory);\n}\n"]}
1
+ {"version":3,"file":"treeFactory.js","sourceRoot":"","sources":["../src/treeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAGN,oBAAoB,GAKpB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EACN,gBAAgB,GAKhB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AASxF;;;;;GAKG;AACH,SAAS,iBAAiB,CACzB,OAAkC;IAElC,SAAS,kBAAkB,CAAC,IAAgB;QAC3C,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACrC,MAAM,IAAI,UAAU,CAAC,gDAAgD,CAAC,CAAC;QACxE,CAAC;QACD,OAAO,IAAI,gBAAgB,CAC1B,IAAI,SAAS,CAAC,YAAY,CAAC,EAC3B,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,kBAAkB,EACvB,IAAI,CAAC,kBAAkB,EACvB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,YAAY,EACjB,OAAO,CACP,CAAC;IACH,CAAC;IAED,OAAO;QACN,MAAM,EAAE,CAAC,IAAgB,EAAoC,EAAE;YAC9D,MAAM,CAAC,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACnC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACpC,CAAC;QAED,KAAK,CAAC,QAAQ,CACb,IAAgB,EAChB,OAA+B;YAE/B,MAAM,CAAC,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACnC,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC1B,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACpC,CAAC;KACD,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,oBAAoB,CACnC,OAA0B;IAE1B,MAAM,mBAAmB,GAA+B;QACvD,IAAI,EAAE,qBAAqB;QAC3B,UAAU,EAAE,oBAAoB;QAChC,sBAAsB,EAAE,mBAAmB;QAC3C,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC;KACnC,CAAC;IAEF,OAAO,oBAAoB,CAAQ,mBAAmB,CAAC,CAAC;AACzD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\n\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport {\n\ttype ISharedObject,\n\ttype ISharedObjectKind,\n\tmakeSharedObjectKind,\n\ttype KernelArgs,\n\ttype SharedKernelFactory,\n\ttype SharedObjectOptions,\n\ttype FactoryOut,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport {\n\tSharedTreeKernel,\n\ttype ITreePrivate,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsInternal,\n\ttype SharedTreeKernelView,\n} from \"./shared-tree/index.js\";\nimport type { ITree } from \"./simple-tree/index.js\";\n\nimport { Breakable } from \"./util/index.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { SharedTreeFactoryType, SharedTreeAttributes } from \"./sharedTreeAttributes.js\";\n\n/**\n * {@link ITreePrivate} extended with ISharedObject.\n * @remarks\n * This is used when integration testing this package with the Fluid runtime as it exposes the APIs the runtime consumes to manipulate the tree.\n */\nexport interface ISharedTree extends ISharedObject, ITreePrivate {}\n\n/**\n * Creates a factory for shared tree kernels with the given options.\n * @remarks\n * Exposes {@link ITreePrivate} to allow access to internals in tests without a cast.\n * Code exposing this beyond this package will need to update to a more public type.\n */\nfunction treeKernelFactory(\n\toptions: SharedTreeOptionsInternal,\n): SharedKernelFactory<SharedTreeKernelView> {\n\tfunction treeFromKernelArgs(args: KernelArgs): SharedTreeKernel {\n\t\tif (args.idCompressor === undefined) {\n\t\t\tthrow new UsageError(\"IdCompressor must be enabled to use SharedTree\");\n\t\t}\n\t\treturn new SharedTreeKernel(\n\t\t\tnew Breakable(\"SharedTree\"),\n\t\t\targs.sharedObject,\n\t\t\targs.serializer,\n\t\t\targs.submitLocalMessage,\n\t\t\targs.lastSequenceNumber,\n\t\t\targs.logger,\n\t\t\targs.idCompressor,\n\t\t\toptions,\n\t\t);\n\t}\n\n\treturn {\n\t\tcreate: (args: KernelArgs): FactoryOut<SharedTreeKernelView> => {\n\t\t\tconst k = treeFromKernelArgs(args);\n\t\t\treturn { kernel: k, view: k.view };\n\t\t},\n\n\t\tasync loadCore(\n\t\t\targs: KernelArgs,\n\t\t\tstorage: IChannelStorageService,\n\t\t): Promise<FactoryOut<SharedTreeKernelView>> {\n\t\t\tconst k = treeFromKernelArgs(args);\n\t\t\tawait k.loadCore(storage);\n\t\t\treturn { kernel: k, view: k.view };\n\t\t},\n\t};\n}\n\n/**\n * SharedTree is a hierarchical data structure for collaboratively editing strongly typed JSON-like trees\n * of objects, arrays, and other data types.\n * @legacy\n * @alpha\n */\nexport const SharedTree = configuredSharedTree({});\n\n/**\n * {@link SharedTree} but allowing a non-default configuration.\n * @remarks\n * This is useful for debugging and testing to opt into extra validation or see if opting out of some optimizations fixes an issue.\n * @example\n * ```typescript\n * import {\n * \tForestType,\n * \tTreeCompressionStrategy,\n * \tconfiguredSharedTree,\n * \ttypeboxValidator,\n * \t// eslint-disable-next-line import/no-internal-modules\n * } from \"@fluidframework/tree/internal\";\n * const SharedTree = configuredSharedTree({\n * \tforest: ForestType.Reference,\n * \tjsonValidator: typeboxValidator,\n * \ttreeEncodeType: TreeCompressionStrategy.Uncompressed,\n * });\n * ```\n * @privateRemarks\n * This should be legacy, but has to be internal due to limitations of API tagging preventing it from being both alpha and alpha+legacy.\n * TODO:\n * Expose Ajv validator for better error message quality somehow.\n * Maybe as part of a test utils or dev-tool package?\n * @internal\n */\nexport function configuredSharedTree(\n\toptions: SharedTreeOptions,\n): ISharedObjectKind<ITree> & SharedObjectKind<ITree> {\n\tconst sharedObjectOptions: SharedObjectOptions<ITree> = {\n\t\ttype: SharedTreeFactoryType,\n\t\tattributes: SharedTreeAttributes,\n\t\ttelemetryContextPrefix: \"fluid_sharedTree_\",\n\t\tfactory: treeKernelFactory(options),\n\t};\n\n\treturn makeSharedObjectKind<ITree>(sharedObjectOptions);\n}\n"]}
@@ -109,7 +109,7 @@ export type RestrictiveStringRecord<T> = {
109
109
  * Returns `true` if T is a union and false if it is not.
110
110
  * @typeparam T - Type to test if it is a union.
111
111
  * @typeparam T2 - Do not specify: default value used as implementation detail.
112
- * @system @alpha
112
+ * @system @public
113
113
  */
114
114
  export type IsUnion<T, T2 = T> = T extends unknown ? [T2] extends [T] ? false : true : "error";
115
115
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"typeUtils.js","sourceRoot":"","sources":["../../src/util/typeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA8EH,wIAAwI;AACxI,CAAC;IAwBA,qDAAqD;AACtD,CAAC;AA8FD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,kBAAkB,CAAI,KAAU;IAC/C,OAAO,KAAwB,CAAC;AACjC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Utilities for manipulating types.\n */\n\n/**\n * Return a type thats equivalent to the input, but with different IntelliSense.\n * This tends to convert unions and intersections into objects.\n * @system @public\n */\nexport type FlattenKeys<T> = [{ [Property in keyof T]: T[Property] }][_InlineTrick];\n\n/**\n * Use for trick to \"inline\" generic types.\n *\n * @remarks\n * The TypeScript compiler can be convinced to inline a generic type\n * (so the result of evaluating the generic type show up in IntelliSense and error messages instead of just the invocation of the generic type)\n * by creating an object with a field, and returning the type of that field.\n *\n * For example:\n * ```typescript\n * type MyGeneric<T1, T2> = {x: T1 extends [] ? T1 : T2 };\n * type MyGenericExpanded<T1, T2> = [{x: T1 extends [] ? T1 : T2 }][_InlineTrick]\n *\n * // Type is MyGeneric<5, string>\n * const foo: MyGeneric<5, string> = {x: \"x\"}\n * // Type is {x: \"x\"}\n * const foo2: MyGenericExpanded<5, string> = {x: \"x\"}\n * ```\n *\n * This constant is defined to provide a way to find this documentation from types which use this pattern,\n * and to locate types which use this pattern in case they need updating for compiler changes.\n * @system @public\n */\nexport type _InlineTrick = 0;\n\n/**\n * Use for trick to prevent self reference error `ts(2456)`.\n *\n * Prefix a type expression with `K extends _RecursiveTrick ? _RecursiveTrick : ` for some K to break the cycle.\n *\n * @remarks\n * The TypeScript compiler handles some cases of recursive types, but not others.\n * Sometimes adding an otherwise needless conditional can make a type compile.\n * Use this type in such cases.\n *\n *For example:\n * ```typescript\n * // The TypeScript compiler can't handle this case\n * type Broken<T> = FlattenKeys<\n *\t{\n * \t\t[K in keyof T]: 0;\n * \t} & {\n * \t\t[K in keyof T]: Broken<T[K]>;\n * \t}\n * >;\n *\n * // Adding `K extends _RecursiveTrick ? _RecursiveTrick :` makes it compile, and has no effect on the type produced.\n * type Works<T> = FlattenKeys<\n * \t{\n * \t\t[K in keyof T]: 0;\n * \t} & {\n * \t\t// Trick added here. Since `k` never extends `never`, the second conditional option is always taken,\n * \t\t// making this equivalent to the broken version, except this one compiles.\n * \t\t[K in keyof T]: K extends _RecursiveTrick ? _RecursiveTrick : Works<T[K]>;\n * \t}\n * >;\n * ```\n *\n * This trick appears to start working in TypeScript 4.1 and is confirmed to still work in 5.0.4.\n *\n * This constant is defined to provide a way to find this documentation from types which use this pattern,\n * and to locate types which use this pattern in case they need updating for compiler changes.\n */\nexport type _RecursiveTrick = never;\n\n// This block is kept here to ensure the above example behaves as documented, and can be copied into the example to update it as needed.\n{\n\t/* eslint-disable @typescript-eslint/no-unused-vars */\n\n\t// @ts-expect-error The TypeScript compiler can't handle this case\n\ttype Broken<T> = FlattenKeys<\n\t\t{\n\t\t\t[K in keyof T]: 0;\n\t\t} & {\n\t\t\t// @ts-expect-error Same error as above.\n\t\t\t[K in keyof T]: Broken<T[K]>;\n\t\t}\n\t>;\n\n\t// Adding `K extends _RecursiveTrick ? _RecursiveTrick:` OR `T extends _RecursiveTrick ? _RecursiveTrick :` makes it compile and has no effect on the type produced.\n\ttype Works<T> = FlattenKeys<\n\t\t{\n\t\t\t[K in keyof T]: 0;\n\t\t} & {\n\t\t\t// Trick added here. Since `K` never extends `never`, the second conditional option is always taken,\n\t\t\t// making this equivalent to the broken version, except this one compiles.\n\t\t\t[K in keyof T]: T extends _RecursiveTrick ? _RecursiveTrick : Works<T[K]>;\n\t\t}\n\t>;\n\n\t/* eslint-enable @typescript-eslint/no-unused-vars */\n}\n\n/**\n * Alternative to the built in Record type which does not permit unexpected members,\n * and is readonly.\n *\n * @remarks\n * This does not work correctly when `K` is more specific than `string` or `symbol`.\n * For example `{a: 5}` is not assignable to `RestrictiveReadonlyRecord<\"a\",: number>`\n *\n * @privateRemarks\n * `number` is not allowed as a key here since doing so causes the compiler to reject recursive schema.\n * The cause for this is unclear, but empirically it was the case when this comment was written.\n *\n * @deprecated Use a more robust / specific type instead. This type never worked as intended.\n * @public\n */\nexport type RestrictiveReadonlyRecord<K extends symbol | string, T> = {\n\treadonly [P in symbol | string]: P extends K ? T : never;\n};\n\n/**\n * Alternative to the built-in `Record<string, T>` type which is readonly and does not permit symbols.\n * @remarks\n * It would be nice if `keyof RestrictiveStringRecord<T>` returned string, but it does not: use `keyof RestrictiveStringRecord<T> & string` instead.\n * @system @public\n */\nexport type RestrictiveStringRecord<T> = {\n\treadonly [P in string]: T;\n} & {\n\treadonly [P in symbol]?: never;\n};\n\n/**\n * Returns `true` if T is a union and false if it is not.\n * @typeparam T - Type to test if it is a union.\n * @typeparam T2 - Do not specify: default value used as implementation detail.\n * @system @alpha\n */\nexport type IsUnion<T, T2 = T> = T extends unknown\n\t? [T2] extends [T]\n\t\t? false\n\t\t: true\n\t: \"error\";\n\n/**\n * Convert a union of types to an intersection of those types. Useful for `TransformEvents`.\n * @privateRemarks\n * First an always true extends clause is used (T extends T) to distribute T into to a union of types contravariant over each member of the T union.\n * Then the constraint on the type parameter in this new context is inferred, giving the intersection.\n * @system @public\n */\nexport type UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) extends (\n\tk: infer U,\n) => unknown\n\t? U\n\t: never;\n\n/**\n * Gets the first item of a union type.\n *\n * @typeparam Union - The union to convert.\n * @typeparam AsOverloadedFunction - Implementation detail: do not specify.\n * @system @alpha\n */\nexport type PopUnion<\n\tUnion,\n\tAsOverloadedFunction = UnionToIntersection<\n\t\tUnion extends unknown ? (f: Union) => void : never\n\t>,\n> = AsOverloadedFunction extends (a: infer First) => void ? First : never;\n\n/**\n * Converts a union type to a tuple type.\n *\n * @typeparam T - The union to convert.\n * @typeparam A - Implementation detail: do not specify.\n * @typeparam First - Implementation detail: do not specify.\n *\n * @privateRemarks\n * `A` is a tuple to prepend members of the union to.\n *\n * https://www.hacklewayne.com/typescript-convert-union-to-tuple-array-yes-but-how and https://catchts.com/union-array both explain the general approach this uses pretty well.\n * This implementation is inspired to those, but slightly different in implementation.\n * @alpha\n */\nexport type UnionToTuple<\n\tUnion,\n\tA extends unknown[] = [],\n\tFirst = PopUnion<Union>,\n> = IsUnion<Union> extends true\n\t? UnionToTuple<Exclude<Union, First>, [First, ...A]>\n\t: [Union, ...A];\n\n/**\n * This is unsafe, meaning that the returned value might not match its type.\n *\n * For the result to match its type, T must be a union of the types of each item in `items` in the order that they occur.\n * For this to be possible, there must be no duplicate or overlapping types.\n * This is fragile and must be used with care.\n *\n * @remarks\n * The main use-case for this is recovering lost information from {@link AllowedTypes} which is necessary to preserve when using them with {@link Input} APIs.\n * Since {@link AllowedTypes} is actually order independent, it is somewhat safer when used to produce `AllowedTypes`.\n *\n * @example\n * ```typescript\n * // Gives imprecise type (typeof A | typeof B)[]\n * const schemaBad = [A, B];\n * // Fixes the type to be [typeof A, typeof B]\n * const schema = unsafeArrayToTuple(schemaBad);\n *\n * const config = new TreeViewConfiguration({ schema });\n * ```\n * @alpha\n */\nexport function unsafeArrayToTuple<T>(items: T[]): UnionToTuple<T> {\n\treturn items as UnionToTuple<T>;\n}\n"]}
1
+ {"version":3,"file":"typeUtils.js","sourceRoot":"","sources":["../../src/util/typeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA8EH,wIAAwI;AACxI,CAAC;IAwBA,qDAAqD;AACtD,CAAC;AA8FD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,kBAAkB,CAAI,KAAU;IAC/C,OAAO,KAAwB,CAAC;AACjC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Utilities for manipulating types.\n */\n\n/**\n * Return a type thats equivalent to the input, but with different IntelliSense.\n * This tends to convert unions and intersections into objects.\n * @system @public\n */\nexport type FlattenKeys<T> = [{ [Property in keyof T]: T[Property] }][_InlineTrick];\n\n/**\n * Use for trick to \"inline\" generic types.\n *\n * @remarks\n * The TypeScript compiler can be convinced to inline a generic type\n * (so the result of evaluating the generic type show up in IntelliSense and error messages instead of just the invocation of the generic type)\n * by creating an object with a field, and returning the type of that field.\n *\n * For example:\n * ```typescript\n * type MyGeneric<T1, T2> = {x: T1 extends [] ? T1 : T2 };\n * type MyGenericExpanded<T1, T2> = [{x: T1 extends [] ? T1 : T2 }][_InlineTrick]\n *\n * // Type is MyGeneric<5, string>\n * const foo: MyGeneric<5, string> = {x: \"x\"}\n * // Type is {x: \"x\"}\n * const foo2: MyGenericExpanded<5, string> = {x: \"x\"}\n * ```\n *\n * This constant is defined to provide a way to find this documentation from types which use this pattern,\n * and to locate types which use this pattern in case they need updating for compiler changes.\n * @system @public\n */\nexport type _InlineTrick = 0;\n\n/**\n * Use for trick to prevent self reference error `ts(2456)`.\n *\n * Prefix a type expression with `K extends _RecursiveTrick ? _RecursiveTrick : ` for some K to break the cycle.\n *\n * @remarks\n * The TypeScript compiler handles some cases of recursive types, but not others.\n * Sometimes adding an otherwise needless conditional can make a type compile.\n * Use this type in such cases.\n *\n *For example:\n * ```typescript\n * // The TypeScript compiler can't handle this case\n * type Broken<T> = FlattenKeys<\n *\t{\n * \t\t[K in keyof T]: 0;\n * \t} & {\n * \t\t[K in keyof T]: Broken<T[K]>;\n * \t}\n * >;\n *\n * // Adding `K extends _RecursiveTrick ? _RecursiveTrick :` makes it compile, and has no effect on the type produced.\n * type Works<T> = FlattenKeys<\n * \t{\n * \t\t[K in keyof T]: 0;\n * \t} & {\n * \t\t// Trick added here. Since `k` never extends `never`, the second conditional option is always taken,\n * \t\t// making this equivalent to the broken version, except this one compiles.\n * \t\t[K in keyof T]: K extends _RecursiveTrick ? _RecursiveTrick : Works<T[K]>;\n * \t}\n * >;\n * ```\n *\n * This trick appears to start working in TypeScript 4.1 and is confirmed to still work in 5.0.4.\n *\n * This constant is defined to provide a way to find this documentation from types which use this pattern,\n * and to locate types which use this pattern in case they need updating for compiler changes.\n */\nexport type _RecursiveTrick = never;\n\n// This block is kept here to ensure the above example behaves as documented, and can be copied into the example to update it as needed.\n{\n\t/* eslint-disable @typescript-eslint/no-unused-vars */\n\n\t// @ts-expect-error The TypeScript compiler can't handle this case\n\ttype Broken<T> = FlattenKeys<\n\t\t{\n\t\t\t[K in keyof T]: 0;\n\t\t} & {\n\t\t\t// @ts-expect-error Same error as above.\n\t\t\t[K in keyof T]: Broken<T[K]>;\n\t\t}\n\t>;\n\n\t// Adding `K extends _RecursiveTrick ? _RecursiveTrick:` OR `T extends _RecursiveTrick ? _RecursiveTrick :` makes it compile and has no effect on the type produced.\n\ttype Works<T> = FlattenKeys<\n\t\t{\n\t\t\t[K in keyof T]: 0;\n\t\t} & {\n\t\t\t// Trick added here. Since `K` never extends `never`, the second conditional option is always taken,\n\t\t\t// making this equivalent to the broken version, except this one compiles.\n\t\t\t[K in keyof T]: T extends _RecursiveTrick ? _RecursiveTrick : Works<T[K]>;\n\t\t}\n\t>;\n\n\t/* eslint-enable @typescript-eslint/no-unused-vars */\n}\n\n/**\n * Alternative to the built in Record type which does not permit unexpected members,\n * and is readonly.\n *\n * @remarks\n * This does not work correctly when `K` is more specific than `string` or `symbol`.\n * For example `{a: 5}` is not assignable to `RestrictiveReadonlyRecord<\"a\",: number>`\n *\n * @privateRemarks\n * `number` is not allowed as a key here since doing so causes the compiler to reject recursive schema.\n * The cause for this is unclear, but empirically it was the case when this comment was written.\n *\n * @deprecated Use a more robust / specific type instead. This type never worked as intended.\n * @public\n */\nexport type RestrictiveReadonlyRecord<K extends symbol | string, T> = {\n\treadonly [P in symbol | string]: P extends K ? T : never;\n};\n\n/**\n * Alternative to the built-in `Record<string, T>` type which is readonly and does not permit symbols.\n * @remarks\n * It would be nice if `keyof RestrictiveStringRecord<T>` returned string, but it does not: use `keyof RestrictiveStringRecord<T> & string` instead.\n * @system @public\n */\nexport type RestrictiveStringRecord<T> = {\n\treadonly [P in string]: T;\n} & {\n\treadonly [P in symbol]?: never;\n};\n\n/**\n * Returns `true` if T is a union and false if it is not.\n * @typeparam T - Type to test if it is a union.\n * @typeparam T2 - Do not specify: default value used as implementation detail.\n * @system @public\n */\nexport type IsUnion<T, T2 = T> = T extends unknown\n\t? [T2] extends [T]\n\t\t? false\n\t\t: true\n\t: \"error\";\n\n/**\n * Convert a union of types to an intersection of those types. Useful for `TransformEvents`.\n * @privateRemarks\n * First an always true extends clause is used (T extends T) to distribute T into to a union of types contravariant over each member of the T union.\n * Then the constraint on the type parameter in this new context is inferred, giving the intersection.\n * @system @public\n */\nexport type UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) extends (\n\tk: infer U,\n) => unknown\n\t? U\n\t: never;\n\n/**\n * Gets the first item of a union type.\n *\n * @typeparam Union - The union to convert.\n * @typeparam AsOverloadedFunction - Implementation detail: do not specify.\n * @system @alpha\n */\nexport type PopUnion<\n\tUnion,\n\tAsOverloadedFunction = UnionToIntersection<\n\t\tUnion extends unknown ? (f: Union) => void : never\n\t>,\n> = AsOverloadedFunction extends (a: infer First) => void ? First : never;\n\n/**\n * Converts a union type to a tuple type.\n *\n * @typeparam T - The union to convert.\n * @typeparam A - Implementation detail: do not specify.\n * @typeparam First - Implementation detail: do not specify.\n *\n * @privateRemarks\n * `A` is a tuple to prepend members of the union to.\n *\n * https://www.hacklewayne.com/typescript-convert-union-to-tuple-array-yes-but-how and https://catchts.com/union-array both explain the general approach this uses pretty well.\n * This implementation is inspired to those, but slightly different in implementation.\n * @alpha\n */\nexport type UnionToTuple<\n\tUnion,\n\tA extends unknown[] = [],\n\tFirst = PopUnion<Union>,\n> = IsUnion<Union> extends true\n\t? UnionToTuple<Exclude<Union, First>, [First, ...A]>\n\t: [Union, ...A];\n\n/**\n * This is unsafe, meaning that the returned value might not match its type.\n *\n * For the result to match its type, T must be a union of the types of each item in `items` in the order that they occur.\n * For this to be possible, there must be no duplicate or overlapping types.\n * This is fragile and must be used with care.\n *\n * @remarks\n * The main use-case for this is recovering lost information from {@link AllowedTypes} which is necessary to preserve when using them with {@link Input} APIs.\n * Since {@link AllowedTypes} is actually order independent, it is somewhat safer when used to produce `AllowedTypes`.\n *\n * @example\n * ```typescript\n * // Gives imprecise type (typeof A | typeof B)[]\n * const schemaBad = [A, B];\n * // Fixes the type to be [typeof A, typeof B]\n * const schema = unsafeArrayToTuple(schemaBad);\n *\n * const config = new TreeViewConfiguration({ schema });\n * ```\n * @alpha\n */\nexport function unsafeArrayToTuple<T>(items: T[]): UnionToTuple<T> {\n\treturn items as UnionToTuple<T>;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/tree",
3
- "version": "2.33.2",
3
+ "version": "2.40.0",
4
4
  "description": "Distributed tree",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -89,17 +89,17 @@
89
89
  "temp-directory": "nyc/.nyc_output"
90
90
  },
91
91
  "dependencies": {
92
- "@fluid-internal/client-utils": "~2.33.2",
93
- "@fluidframework/container-runtime": "~2.33.2",
94
- "@fluidframework/core-interfaces": "~2.33.2",
95
- "@fluidframework/core-utils": "~2.33.2",
96
- "@fluidframework/datastore-definitions": "~2.33.2",
97
- "@fluidframework/driver-definitions": "~2.33.2",
98
- "@fluidframework/id-compressor": "~2.33.2",
99
- "@fluidframework/runtime-definitions": "~2.33.2",
100
- "@fluidframework/runtime-utils": "~2.33.2",
101
- "@fluidframework/shared-object-base": "~2.33.2",
102
- "@fluidframework/telemetry-utils": "~2.33.2",
92
+ "@fluid-internal/client-utils": "~2.40.0",
93
+ "@fluidframework/container-runtime": "~2.40.0",
94
+ "@fluidframework/core-interfaces": "~2.40.0",
95
+ "@fluidframework/core-utils": "~2.40.0",
96
+ "@fluidframework/datastore-definitions": "~2.40.0",
97
+ "@fluidframework/driver-definitions": "~2.40.0",
98
+ "@fluidframework/id-compressor": "~2.40.0",
99
+ "@fluidframework/runtime-definitions": "~2.40.0",
100
+ "@fluidframework/runtime-utils": "~2.40.0",
101
+ "@fluidframework/shared-object-base": "~2.40.0",
102
+ "@fluidframework/telemetry-utils": "~2.40.0",
103
103
  "@sinclair/typebox": "^0.34.13",
104
104
  "@tylerbu/sorted-btree-es6": "^1.8.0",
105
105
  "@types/ungap__structured-clone": "^1.2.0",
@@ -109,19 +109,19 @@
109
109
  "devDependencies": {
110
110
  "@arethetypeswrong/cli": "^0.17.1",
111
111
  "@biomejs/biome": "~1.9.3",
112
- "@fluid-internal/mocha-test-setup": "~2.33.2",
113
- "@fluid-private/stochastic-test-utils": "~2.33.2",
114
- "@fluid-private/test-dds-utils": "~2.33.2",
115
- "@fluid-private/test-drivers": "~2.33.2",
116
- "@fluid-tools/benchmark": "^0.50.0",
112
+ "@fluid-internal/mocha-test-setup": "~2.40.0",
113
+ "@fluid-private/stochastic-test-utils": "~2.40.0",
114
+ "@fluid-private/test-dds-utils": "~2.40.0",
115
+ "@fluid-private/test-drivers": "~2.40.0",
116
+ "@fluid-tools/benchmark": "^0.51.0",
117
117
  "@fluid-tools/build-cli": "^0.55.0",
118
118
  "@fluidframework/build-common": "^2.0.3",
119
119
  "@fluidframework/build-tools": "^0.55.0",
120
- "@fluidframework/container-definitions": "~2.33.2",
121
- "@fluidframework/container-loader": "~2.33.2",
120
+ "@fluidframework/container-definitions": "~2.40.0",
121
+ "@fluidframework/container-loader": "~2.40.0",
122
122
  "@fluidframework/eslint-config-fluid": "^5.7.3",
123
- "@fluidframework/test-runtime-utils": "~2.33.2",
124
- "@fluidframework/test-utils": "~2.33.2",
123
+ "@fluidframework/test-runtime-utils": "~2.40.0",
124
+ "@fluidframework/test-utils": "~2.40.0",
125
125
  "@fluidframework/tree-previous": "npm:@fluidframework/tree@2.33.0",
126
126
  "@microsoft/api-extractor": "7.52.5",
127
127
  "@types/diff": "^3.5.1",
@@ -350,6 +350,11 @@ export enum FluidClientVersion {
350
350
  v2_1 = "v2_1",
351
351
  /** Fluid Framework Client 2.2 and newer. */
352
352
  v2_2 = "v2_2",
353
- /** Fluid Framework Client 2.4 and newer. */
353
+ /** Fluid Framework Client 2.3 and newer. */
354
354
  v2_3 = "v2_3",
355
355
  }
356
+
357
+ /**
358
+ * The version of this code.
359
+ */
360
+ export const currentVersion: FluidClientVersion = FluidClientVersion.v2_3;
@@ -19,6 +19,7 @@ export {
19
19
  withDefaultBinaryEncoding,
20
20
  withSchemaValidation,
21
21
  FluidClientVersion,
22
+ currentVersion,
22
23
  } from "./codec.js";
23
24
  export {
24
25
  DiscriminatedUnionDispatcher,
package/src/core/index.ts CHANGED
@@ -137,7 +137,7 @@ export {
137
137
  identifierFieldKindIdentifier,
138
138
  storedEmptyFieldSchema,
139
139
  type StoredSchemaCollection,
140
- schemaFormat,
140
+ schemaFormatV1,
141
141
  LeafNodeStoredSchema,
142
142
  ObjectNodeStoredSchema,
143
143
  MapNodeStoredSchema,
@@ -208,7 +208,6 @@ export {
208
208
  type Adapters,
209
209
  AdaptedViewSchema,
210
210
  type TreeAdapter,
211
- AllowedUpdateType,
212
211
  } from "./schema-view/index.js";
213
212
 
214
213
  export {