@fluidframework/tree 2.33.1 → 2.40.0-336023

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 (315) hide show
  1. package/.vscode/settings.json +2 -0
  2. package/api-report/tree.alpha.api.md +120 -50
  3. package/api-report/tree.beta.api.md +31 -27
  4. package/api-report/tree.legacy.alpha.api.md +24 -23
  5. package/api-report/tree.legacy.public.api.md +24 -23
  6. package/api-report/tree.public.api.md +24 -23
  7. package/dist/alpha.d.ts +16 -1
  8. package/dist/beta.d.ts +2 -0
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/internalTypes.d.ts +0 -1
  13. package/dist/internalTypes.d.ts.map +1 -1
  14. package/dist/internalTypes.js.map +1 -1
  15. package/dist/jsonDomainSchema.d.ts +2 -2
  16. package/dist/jsonDomainSchema.js +2 -2
  17. package/dist/jsonDomainSchema.js.map +1 -1
  18. package/dist/legacy.d.ts +2 -0
  19. package/dist/packageVersion.d.ts +1 -1
  20. package/dist/packageVersion.d.ts.map +1 -1
  21. package/dist/packageVersion.js +1 -1
  22. package/dist/packageVersion.js.map +1 -1
  23. package/dist/public.d.ts +2 -0
  24. package/dist/serializableDomainSchema.d.ts +3 -3
  25. package/dist/serializableDomainSchema.js +2 -2
  26. package/dist/serializableDomainSchema.js.map +1 -1
  27. package/dist/shared-tree/independentView.d.ts +1 -1
  28. package/dist/shared-tree/independentView.js.map +1 -1
  29. package/dist/shared-tree/index.d.ts +3 -2
  30. package/dist/shared-tree/index.d.ts.map +1 -1
  31. package/dist/shared-tree/index.js +4 -4
  32. package/dist/shared-tree/index.js.map +1 -1
  33. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  34. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  35. package/dist/shared-tree/schematizeTree.js +2 -3
  36. package/dist/shared-tree/schematizeTree.js.map +1 -1
  37. package/dist/shared-tree/schematizingTreeView.d.ts +3 -3
  38. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  39. package/dist/shared-tree/schematizingTreeView.js +4 -4
  40. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  41. package/dist/shared-tree/{treeApi.d.ts → tree.d.ts} +34 -34
  42. package/dist/shared-tree/tree.d.ts.map +1 -0
  43. package/dist/shared-tree/{treeApi.js → tree.js} +6 -6
  44. package/dist/shared-tree/tree.js.map +1 -0
  45. package/dist/shared-tree/{treeApiAlpha.d.ts → treeAlpha.d.ts} +22 -14
  46. package/dist/shared-tree/treeAlpha.d.ts.map +1 -0
  47. package/dist/shared-tree/{treeApiAlpha.js → treeAlpha.js} +4 -3
  48. package/dist/shared-tree/treeAlpha.js.map +1 -0
  49. package/dist/simple-tree/api/conciseTree.d.ts +1 -1
  50. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  51. package/dist/simple-tree/api/configuration.d.ts +177 -0
  52. package/dist/simple-tree/api/configuration.d.ts.map +1 -0
  53. package/dist/simple-tree/api/configuration.js +163 -0
  54. package/dist/simple-tree/api/configuration.js.map +1 -0
  55. package/dist/simple-tree/api/getJsonSchema.js +2 -2
  56. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  57. package/dist/simple-tree/api/index.d.ts +7 -4
  58. package/dist/simple-tree/api/index.d.ts.map +1 -1
  59. package/dist/simple-tree/api/index.js +8 -7
  60. package/dist/simple-tree/api/index.js.map +1 -1
  61. package/dist/simple-tree/api/{view.d.ts → schemaCompatibilityTester.d.ts} +8 -10
  62. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -0
  63. package/dist/simple-tree/api/{view.js → schemaCompatibilityTester.js} +9 -9
  64. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -0
  65. package/dist/simple-tree/api/schemaFactory.d.ts +16 -10
  66. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  67. package/dist/simple-tree/api/schemaFactory.js +20 -12
  68. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  69. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +12 -6
  70. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  71. package/dist/simple-tree/api/schemaFactoryAlpha.js +2 -2
  72. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  73. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +67 -4
  74. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  75. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  76. package/dist/simple-tree/api/schemaFromSimple.d.ts +1 -1
  77. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  78. package/dist/simple-tree/api/schemaFromSimple.js +1 -1
  79. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  80. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  81. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  82. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  83. package/dist/simple-tree/api/storedSchema.d.ts +3 -3
  84. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  85. package/dist/simple-tree/api/storedSchema.js +3 -2
  86. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  87. package/dist/simple-tree/api/tree.d.ts +5 -174
  88. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  89. package/dist/simple-tree/api/tree.js +1 -156
  90. package/dist/simple-tree/api/tree.js.map +1 -1
  91. package/{lib/simple-tree/api/treeApiBeta.d.ts → dist/simple-tree/api/treeBeta.d.ts} +13 -5
  92. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -0
  93. package/dist/simple-tree/api/{treeApiBeta.js → treeBeta.js} +5 -4
  94. package/dist/simple-tree/api/treeBeta.js.map +1 -0
  95. package/dist/simple-tree/api/typesUnsafe.d.ts +4 -9
  96. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  97. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  98. package/dist/simple-tree/arrayNode.d.ts +2 -2
  99. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  100. package/dist/simple-tree/arrayNode.js +3 -2
  101. package/dist/simple-tree/arrayNode.js.map +1 -1
  102. package/dist/simple-tree/arrayNodeTypes.d.ts +3 -3
  103. package/dist/simple-tree/arrayNodeTypes.d.ts.map +1 -1
  104. package/dist/simple-tree/arrayNodeTypes.js.map +1 -1
  105. package/dist/simple-tree/index.d.ts +3 -3
  106. package/dist/simple-tree/index.d.ts.map +1 -1
  107. package/dist/simple-tree/index.js +2 -2
  108. package/dist/simple-tree/index.js.map +1 -1
  109. package/dist/simple-tree/mapNode.d.ts +2 -2
  110. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  111. package/dist/simple-tree/mapNode.js +1 -1
  112. package/dist/simple-tree/mapNode.js.map +1 -1
  113. package/dist/simple-tree/mapNodeTypes.d.ts +3 -3
  114. package/dist/simple-tree/mapNodeTypes.d.ts.map +1 -1
  115. package/dist/simple-tree/mapNodeTypes.js.map +1 -1
  116. package/dist/simple-tree/objectNode.d.ts +18 -5
  117. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  118. package/dist/simple-tree/objectNode.js +4 -3
  119. package/dist/simple-tree/objectNode.js.map +1 -1
  120. package/dist/simple-tree/objectNodeTypes.d.ts +4 -4
  121. package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
  122. package/dist/simple-tree/objectNodeTypes.js.map +1 -1
  123. package/dist/simple-tree/schemaTypes.d.ts +163 -13
  124. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  125. package/dist/simple-tree/schemaTypes.js +107 -8
  126. package/dist/simple-tree/schemaTypes.js.map +1 -1
  127. package/dist/simple-tree/treeNodeValid.js +2 -2
  128. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  129. package/dist/tableSchema.d.ts +197 -86
  130. package/dist/tableSchema.d.ts.map +1 -1
  131. package/dist/tableSchema.js +100 -45
  132. package/dist/tableSchema.js.map +1 -1
  133. package/dist/util/typeUtils.d.ts +1 -1
  134. package/dist/util/typeUtils.js.map +1 -1
  135. package/lib/alpha.d.ts +16 -1
  136. package/lib/beta.d.ts +2 -0
  137. package/lib/index.d.ts +2 -2
  138. package/lib/index.d.ts.map +1 -1
  139. package/lib/index.js.map +1 -1
  140. package/lib/internalTypes.d.ts +0 -1
  141. package/lib/internalTypes.d.ts.map +1 -1
  142. package/lib/internalTypes.js.map +1 -1
  143. package/lib/jsonDomainSchema.d.ts +2 -2
  144. package/lib/jsonDomainSchema.js +2 -2
  145. package/lib/jsonDomainSchema.js.map +1 -1
  146. package/lib/legacy.d.ts +2 -0
  147. package/lib/packageVersion.d.ts +1 -1
  148. package/lib/packageVersion.d.ts.map +1 -1
  149. package/lib/packageVersion.js +1 -1
  150. package/lib/packageVersion.js.map +1 -1
  151. package/lib/public.d.ts +2 -0
  152. package/lib/serializableDomainSchema.d.ts +3 -3
  153. package/lib/serializableDomainSchema.js +2 -2
  154. package/lib/serializableDomainSchema.js.map +1 -1
  155. package/lib/shared-tree/independentView.d.ts +1 -1
  156. package/lib/shared-tree/independentView.js.map +1 -1
  157. package/lib/shared-tree/index.d.ts +3 -2
  158. package/lib/shared-tree/index.d.ts.map +1 -1
  159. package/lib/shared-tree/index.js +2 -2
  160. package/lib/shared-tree/index.js.map +1 -1
  161. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  162. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  163. package/lib/shared-tree/schematizeTree.js +2 -3
  164. package/lib/shared-tree/schematizeTree.js.map +1 -1
  165. package/lib/shared-tree/schematizingTreeView.d.ts +3 -3
  166. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  167. package/lib/shared-tree/schematizingTreeView.js +5 -5
  168. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  169. package/lib/shared-tree/{treeApi.d.ts → tree.d.ts} +34 -34
  170. package/lib/shared-tree/tree.d.ts.map +1 -0
  171. package/lib/shared-tree/{treeApi.js → tree.js} +5 -5
  172. package/lib/shared-tree/tree.js.map +1 -0
  173. package/lib/shared-tree/{treeApiAlpha.d.ts → treeAlpha.d.ts} +22 -14
  174. package/lib/shared-tree/treeAlpha.d.ts.map +1 -0
  175. package/lib/shared-tree/{treeApiAlpha.js → treeAlpha.js} +4 -3
  176. package/lib/shared-tree/treeAlpha.js.map +1 -0
  177. package/lib/simple-tree/api/conciseTree.d.ts +1 -1
  178. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  179. package/lib/simple-tree/api/configuration.d.ts +177 -0
  180. package/lib/simple-tree/api/configuration.d.ts.map +1 -0
  181. package/lib/simple-tree/api/configuration.js +157 -0
  182. package/lib/simple-tree/api/configuration.js.map +1 -0
  183. package/lib/simple-tree/api/getJsonSchema.js +1 -1
  184. package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
  185. package/lib/simple-tree/api/index.d.ts +7 -4
  186. package/lib/simple-tree/api/index.d.ts.map +1 -1
  187. package/lib/simple-tree/api/index.js +4 -3
  188. package/lib/simple-tree/api/index.js.map +1 -1
  189. package/lib/simple-tree/api/{view.d.ts → schemaCompatibilityTester.d.ts} +8 -10
  190. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -0
  191. package/lib/simple-tree/api/{view.js → schemaCompatibilityTester.js} +7 -7
  192. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -0
  193. package/lib/simple-tree/api/schemaFactory.d.ts +16 -10
  194. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  195. package/lib/simple-tree/api/schemaFactory.js +20 -12
  196. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  197. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +12 -6
  198. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  199. package/lib/simple-tree/api/schemaFactoryAlpha.js +2 -2
  200. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  201. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +67 -4
  202. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  203. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  204. package/lib/simple-tree/api/schemaFromSimple.d.ts +1 -1
  205. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  206. package/lib/simple-tree/api/schemaFromSimple.js +1 -1
  207. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  208. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  209. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  210. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  211. package/lib/simple-tree/api/storedSchema.d.ts +3 -3
  212. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  213. package/lib/simple-tree/api/storedSchema.js +3 -2
  214. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  215. package/lib/simple-tree/api/tree.d.ts +5 -174
  216. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  217. package/lib/simple-tree/api/tree.js +0 -152
  218. package/lib/simple-tree/api/tree.js.map +1 -1
  219. package/{dist/simple-tree/api/treeApiBeta.d.ts → lib/simple-tree/api/treeBeta.d.ts} +13 -5
  220. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -0
  221. package/lib/simple-tree/api/{treeApiBeta.js → treeBeta.js} +5 -4
  222. package/lib/simple-tree/api/treeBeta.js.map +1 -0
  223. package/lib/simple-tree/api/typesUnsafe.d.ts +4 -9
  224. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  225. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  226. package/lib/simple-tree/arrayNode.d.ts +2 -2
  227. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  228. package/lib/simple-tree/arrayNode.js +4 -3
  229. package/lib/simple-tree/arrayNode.js.map +1 -1
  230. package/lib/simple-tree/arrayNodeTypes.d.ts +3 -3
  231. package/lib/simple-tree/arrayNodeTypes.d.ts.map +1 -1
  232. package/lib/simple-tree/arrayNodeTypes.js.map +1 -1
  233. package/lib/simple-tree/index.d.ts +3 -3
  234. package/lib/simple-tree/index.d.ts.map +1 -1
  235. package/lib/simple-tree/index.js +1 -1
  236. package/lib/simple-tree/index.js.map +1 -1
  237. package/lib/simple-tree/mapNode.d.ts +2 -2
  238. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  239. package/lib/simple-tree/mapNode.js +2 -2
  240. package/lib/simple-tree/mapNode.js.map +1 -1
  241. package/lib/simple-tree/mapNodeTypes.d.ts +3 -3
  242. package/lib/simple-tree/mapNodeTypes.d.ts.map +1 -1
  243. package/lib/simple-tree/mapNodeTypes.js.map +1 -1
  244. package/lib/simple-tree/objectNode.d.ts +18 -5
  245. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  246. package/lib/simple-tree/objectNode.js +5 -4
  247. package/lib/simple-tree/objectNode.js.map +1 -1
  248. package/lib/simple-tree/objectNodeTypes.d.ts +4 -4
  249. package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
  250. package/lib/simple-tree/objectNodeTypes.js.map +1 -1
  251. package/lib/simple-tree/schemaTypes.d.ts +163 -13
  252. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  253. package/lib/simple-tree/schemaTypes.js +96 -8
  254. package/lib/simple-tree/schemaTypes.js.map +1 -1
  255. package/lib/simple-tree/treeNodeValid.js +2 -2
  256. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  257. package/lib/tableSchema.d.ts +197 -86
  258. package/lib/tableSchema.d.ts.map +1 -1
  259. package/lib/tableSchema.js +100 -45
  260. package/lib/tableSchema.js.map +1 -1
  261. package/lib/util/typeUtils.d.ts +1 -1
  262. package/lib/util/typeUtils.js.map +1 -1
  263. package/package.json +20 -20
  264. package/src/index.ts +17 -1
  265. package/src/internalTypes.ts +0 -2
  266. package/src/jsonDomainSchema.ts +2 -2
  267. package/src/packageVersion.ts +1 -1
  268. package/src/serializableDomainSchema.ts +3 -3
  269. package/src/shared-tree/independentView.ts +1 -1
  270. package/src/shared-tree/index.ts +3 -6
  271. package/src/shared-tree/schematizeTree.ts +5 -5
  272. package/src/shared-tree/schematizingTreeView.ts +11 -8
  273. package/src/shared-tree/{treeApi.ts → tree.ts} +51 -51
  274. package/src/shared-tree/{treeApiAlpha.ts → treeAlpha.ts} +22 -13
  275. package/src/simple-tree/api/conciseTree.ts +1 -1
  276. package/src/simple-tree/api/configuration.ts +353 -0
  277. package/src/simple-tree/api/getJsonSchema.ts +1 -1
  278. package/src/simple-tree/api/index.ts +21 -15
  279. package/src/simple-tree/api/{view.ts → schemaCompatibilityTester.ts} +8 -15
  280. package/src/simple-tree/api/schemaFactory.ts +130 -19
  281. package/src/simple-tree/api/schemaFactoryAlpha.ts +7 -5
  282. package/src/simple-tree/api/schemaFactoryRecursive.ts +102 -38
  283. package/src/simple-tree/api/schemaFromSimple.ts +2 -2
  284. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  285. package/src/simple-tree/api/storedSchema.ts +8 -4
  286. package/src/simple-tree/api/tree.ts +13 -354
  287. package/src/simple-tree/api/{treeApiBeta.ts → treeBeta.ts} +17 -5
  288. package/src/simple-tree/api/typesUnsafe.ts +15 -11
  289. package/src/simple-tree/arrayNode.ts +10 -5
  290. package/src/simple-tree/arrayNodeTypes.ts +8 -7
  291. package/src/simple-tree/index.ts +17 -1
  292. package/src/simple-tree/mapNode.ts +11 -3
  293. package/src/simple-tree/mapNodeTypes.ts +10 -7
  294. package/src/simple-tree/objectNode.ts +39 -15
  295. package/src/simple-tree/objectNodeTypes.ts +9 -5
  296. package/src/simple-tree/schemaTypes.ts +353 -25
  297. package/src/simple-tree/treeNodeValid.ts +2 -2
  298. package/src/tableSchema.ts +749 -445
  299. package/src/util/typeUtils.ts +1 -1
  300. package/dist/shared-tree/treeApi.d.ts.map +0 -1
  301. package/dist/shared-tree/treeApi.js.map +0 -1
  302. package/dist/shared-tree/treeApiAlpha.d.ts.map +0 -1
  303. package/dist/shared-tree/treeApiAlpha.js.map +0 -1
  304. package/dist/simple-tree/api/treeApiBeta.d.ts.map +0 -1
  305. package/dist/simple-tree/api/treeApiBeta.js.map +0 -1
  306. package/dist/simple-tree/api/view.d.ts.map +0 -1
  307. package/dist/simple-tree/api/view.js.map +0 -1
  308. package/lib/shared-tree/treeApi.d.ts.map +0 -1
  309. package/lib/shared-tree/treeApi.js.map +0 -1
  310. package/lib/shared-tree/treeApiAlpha.d.ts.map +0 -1
  311. package/lib/shared-tree/treeApiAlpha.js.map +0 -1
  312. package/lib/simple-tree/api/treeApiBeta.d.ts.map +0 -1
  313. package/lib/simple-tree/api/treeApiBeta.js.map +0 -1
  314. package/lib/simple-tree/api/view.d.ts.map +0 -1
  315. package/lib/simple-tree/api/view.js.map +0 -1
@@ -21,14 +21,14 @@ const sf = new SchemaFactory("com.fluidframework.serializable");
21
21
  * @remarks
22
22
  * Schema which replicate the Fluid Serializable data model with {@link TreeNode}s.
23
23
  *
24
- * Fluid Serializable data can be imported from the {@link FluidSerializableAsTree.Data|Fluid Serializable format} into this format using {@link TreeAlpha.importConcise} with the {@link FluidSerializableAsTree.(Tree:variable)} schema.
24
+ * Fluid Serializable data can be imported from the {@link FluidSerializableAsTree.Data|Fluid Serializable format} into this format using {@link (TreeAlpha:interface).importConcise} with the {@link FluidSerializableAsTree.(Tree:variable)} schema.
25
25
  * @internal
26
26
  */
27
27
  export namespace FluidSerializableAsTree {
28
28
  /**
29
29
  * Data which can be serialized by Fluid.
30
30
  * @remarks
31
- * Can be encoded as a {@link FluidSerializableAsTree.(Tree:type)} using {@link TreeAlpha.importConcise}.
31
+ * Can be encoded as a {@link FluidSerializableAsTree.(Tree:type)} using {@link (TreeAlpha:interface).importConcise}.
32
32
  * @internal
33
33
  */
34
34
  export type Data = JsonCompatible<IFluidHandle>;
@@ -100,7 +100,7 @@ export namespace FluidSerializableAsTree {
100
100
  /**
101
101
  * Arbitrary Fluid Serializable array as a {@link TreeNode}.
102
102
  * @remarks
103
- * This can be imported using {@link TreeAlpha.importConcise}.
103
+ * This can be imported using {@link (TreeAlpha:interface).importConcise}.
104
104
  * @example
105
105
  * ```typescript
106
106
  * // Due to TypeScript restrictions on recursive types, the constructor can be somewhat limiting.
@@ -134,7 +134,7 @@ export function independentInitializedView<const TSchema extends ImplicitFieldSc
134
134
  */
135
135
  export interface ViewContent {
136
136
  /**
137
- * Compressed tree from {@link TreeAlpha.exportCompressed}.
137
+ * Compressed tree from {@link (TreeAlpha:interface).exportCompressed}.
138
138
  * @remarks
139
139
  * This is an owning reference:
140
140
  * consumers of this content might modify this data in place (for example when applying edits) to avoid copying.
@@ -45,13 +45,10 @@ export type {
45
45
  SharedTreeEditBuilder,
46
46
  } from "./sharedTreeEditBuilder.js";
47
47
 
48
- export {
49
- treeApi as Tree,
50
- type TreeApi,
51
- type RunTransaction,
52
- } from "./treeApi.js";
48
+ export { Tree } from "./tree.js";
49
+ export type { RunTransaction } from "./tree.js";
53
50
 
54
- export { TreeAlpha } from "./treeApiAlpha.js";
51
+ export { TreeAlpha } from "./treeAlpha.js";
55
52
 
56
53
  export {
57
54
  independentInitializedView,
@@ -23,7 +23,7 @@ import {
23
23
  import { isReadonlyArray } from "../util/index.js";
24
24
 
25
25
  import type { ITreeCheckout } from "./treeCheckout.js";
26
- import { toStoredSchema, type ViewSchema } from "../simple-tree/index.js";
26
+ import type { SchemaCompatibilityTester } from "../simple-tree/index.js";
27
27
 
28
28
  /**
29
29
  * Modify `storedSchema` and invoke `setInitialTree` when it's time to set the tree content.
@@ -113,7 +113,7 @@ export enum UpdateType {
113
113
  }
114
114
 
115
115
  export function evaluateUpdate(
116
- viewSchema: ViewSchema,
116
+ viewSchema: SchemaCompatibilityTester,
117
117
  allowedSchemaModifications: AllowedUpdateType,
118
118
  checkout: ITreeCheckout,
119
119
  ): UpdateType {
@@ -209,7 +209,7 @@ export function initialize(checkout: ITreeCheckout, treeContent: TreeStoredConte
209
209
  }
210
210
 
211
211
  /**
212
- * Ensure a {@link ITreeCheckout} can be used with a given {@link ViewSchema}.
212
+ * Ensure a {@link ITreeCheckout} can be used with a given {@link SchemaCompatibilityTester}.
213
213
  *
214
214
  * @remarks
215
215
  * It is up to the caller to ensure that compatibility is reevaluated if the checkout's stored schema is edited in the future.
@@ -221,7 +221,7 @@ export function initialize(checkout: ITreeCheckout, treeContent: TreeStoredConte
221
221
  * @returns true iff checkout now is compatible with `viewSchema`.
222
222
  */
223
223
  export function ensureSchema(
224
- viewSchema: ViewSchema,
224
+ viewSchema: SchemaCompatibilityTester,
225
225
  allowedSchemaModifications: AllowedUpdateType,
226
226
  checkout: ITreeCheckout,
227
227
  treeContent: TreeStoredContent | undefined,
@@ -241,7 +241,7 @@ export function ensureSchema(
241
241
  return false;
242
242
  }
243
243
  case UpdateType.SchemaCompatible: {
244
- checkout.updateSchema(toStoredSchema(viewSchema.schema));
244
+ checkout.updateSchema(viewSchema.viewSchemaAsStored);
245
245
  return true;
246
246
  }
247
247
  case UpdateType.Initialize: {
@@ -30,13 +30,12 @@ import {
30
30
  getTreeNodeForField,
31
31
  setField,
32
32
  normalizeFieldSchema,
33
- ViewSchema,
33
+ SchemaCompatibilityTester,
34
34
  type InsertableContent,
35
35
  type TreeViewConfiguration,
36
36
  mapTreeFromNodeData,
37
37
  prepareContentForHydration,
38
38
  comparePersistedSchemaInternal,
39
- toStoredSchema,
40
39
  type TreeViewAlpha,
41
40
  type InsertableField,
42
41
  type ReadableField,
@@ -98,7 +97,7 @@ export class SchematizingSimpleTreeView<
98
97
  IEmitter<TreeViewEvents & TreeBranchEvents> &
99
98
  HasListeners<TreeViewEvents & TreeBranchEvents> = createEmitter();
100
99
 
101
- private readonly viewSchema: ViewSchema;
100
+ private readonly viewSchema: SchemaCompatibilityTester;
102
101
 
103
102
  private readonly unregisterCallbacks = new Set<() => void>();
104
103
 
@@ -133,7 +132,11 @@ export class SchematizingSimpleTreeView<
133
132
  allowUnknownOptionalFields: createUnknownOptionalFieldPolicy(this.rootFieldSchema),
134
133
  };
135
134
 
136
- this.viewSchema = new ViewSchema(this.schemaPolicy, {}, this.rootFieldSchema);
135
+ this.viewSchema = new SchemaCompatibilityTester(
136
+ this.schemaPolicy,
137
+ {},
138
+ this.rootFieldSchema,
139
+ );
137
140
  // This must be initialized before `update` can be called.
138
141
  this.currentCompatibility = {
139
142
  canView: false,
@@ -182,7 +185,7 @@ export class SchematizingSimpleTreeView<
182
185
 
183
186
  prepareContentForHydration(mapTree, this.checkout.forest);
184
187
  initialize(this.checkout, {
185
- schema: toStoredSchema(this.viewSchema.schema),
188
+ schema: this.viewSchema.viewSchemaAsStored,
186
189
  initialTree: mapTree === undefined ? undefined : cursorForMapTreeNode(mapTree),
187
190
  });
188
191
  });
@@ -209,7 +212,7 @@ export class SchematizingSimpleTreeView<
209
212
  AllowedUpdateType.SchemaCompatible,
210
213
  this.checkout,
211
214
  {
212
- schema: toStoredSchema(this.viewSchema.schema),
215
+ schema: this.viewSchema.viewSchemaAsStored,
213
216
  initialTree: undefined,
214
217
  },
215
218
  );
@@ -502,12 +505,12 @@ export function getCheckout(context: TreeBranch): TreeCheckout {
502
505
  }
503
506
 
504
507
  /**
505
- * Creates a view that self-disposes whenenever the stored schema changes.
508
+ * Creates a view that self-disposes whenever the stored schema changes.
506
509
  * This may only be called when the schema is already known to be compatible (typically via ensureSchema).
507
510
  */
508
511
  export function requireSchema(
509
512
  checkout: ITreeCheckout,
510
- viewSchema: ViewSchema,
513
+ viewSchema: SchemaCompatibilityTester,
511
514
  onDispose: () => void,
512
515
  nodeKeyManager: NodeIdentifierManager,
513
516
  schemaPolicy: FullSchemaPolicy,
@@ -22,6 +22,56 @@ import { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
22
22
  import type { ITreeCheckout } from "./treeCheckout.js";
23
23
  import { getCheckoutFlexTreeView } from "./checkoutFlexTreeView.js";
24
24
 
25
+ /**
26
+ * Provides various functions for interacting with {@link TreeNode}s.
27
+ * @remarks
28
+ * This type should only be used via the {@link (Tree:variable)} export.
29
+ * @system @sealed @public
30
+ */
31
+ export interface Tree extends TreeNodeApi {
32
+ /**
33
+ * Run a {@link RunTransaction | transaction}.
34
+ */
35
+ readonly runTransaction: RunTransaction;
36
+ /**
37
+ * Check if the subtree defined by `node` contains `other`.
38
+ *
39
+ * @returns true if `other` is an inclusive descendant of `node`, and false otherwise.
40
+ * @remarks
41
+ * This includes direct and indirect children:
42
+ * as long as `node` is an ancestor of `other` (occurs in its parentage chain), this returns true, regardless of the number of levels of the tree between.
43
+ *
44
+ * `node` is considered to contain itself, so the case where `node === other` returns true.
45
+ *
46
+ * This is handy when checking if moving `node` into `other` would create a cycle and would thus be invalid.
47
+ *
48
+ * This check walks the parents of `other` looking for `node`,
49
+ * and thus runs in time proportional to the depth of child in the tree.
50
+ */
51
+ contains(node: TreeNode, other: TreeNode): boolean;
52
+ }
53
+
54
+ /**
55
+ * The {@link (Tree:interface)} singleton which holds various functions for interacting with {@link TreeNode}s.
56
+ * @public
57
+ */
58
+ export const Tree: Tree = {
59
+ ...treeNodeApi,
60
+
61
+ runTransaction: createRunTransaction(),
62
+
63
+ contains(parent: TreeNode, child: TreeNode): boolean {
64
+ let toCheck: TreeNode | undefined = child;
65
+ while (toCheck !== undefined) {
66
+ if (toCheck === parent) {
67
+ return true;
68
+ }
69
+ toCheck = Tree.parent(toCheck);
70
+ }
71
+ return false;
72
+ },
73
+ };
74
+
25
75
  /**
26
76
  * A function which runs a transaction in a SharedTree.
27
77
  * @privateRemarks
@@ -326,56 +376,6 @@ export interface RunTransaction {
326
376
  ): void;
327
377
  }
328
378
 
329
- /**
330
- * Provides various functions for interacting with {@link TreeNode}s.
331
- * @remarks
332
- * This type should only be used via the public `Tree` export.
333
- * @system @sealed @public
334
- */
335
- export interface TreeApi extends TreeNodeApi {
336
- /**
337
- * Run a {@link RunTransaction | transaction}.
338
- */
339
- readonly runTransaction: RunTransaction;
340
- /**
341
- * Check if the subtree defined by `node` contains `other`.
342
- *
343
- * @returns true if `other` is an inclusive descendant of `node`, and false otherwise.
344
- * @remarks
345
- * This includes direct and indirect children:
346
- * as long as `node` is an ancestor of `other` (occurs in its parentage chain), this returns true, regardless of the number of levels of the tree between.
347
- *
348
- * `node` is considered to contain itself, so the case where `node === other` returns true.
349
- *
350
- * This is handy when checking if moving `node` into `other` would create a cycle and thus is invalid.
351
- *
352
- * This check walks the parents of `other` looking for `node`,
353
- * and thus runs in time proportional to the depth of child in the tree.
354
- */
355
- contains(node: TreeNode, other: TreeNode): boolean;
356
- }
357
-
358
- /**
359
- * The `Tree` object holds various functions for interacting with {@link TreeNode}s.
360
- * @public
361
- */
362
- export const treeApi: TreeApi = {
363
- ...treeNodeApi,
364
-
365
- runTransaction: createRunTransaction(),
366
-
367
- contains(parent: TreeNode, child: TreeNode): boolean {
368
- let toCheck: TreeNode | undefined = child;
369
- while (toCheck !== undefined) {
370
- if (toCheck === parent) {
371
- return true;
372
- }
373
- toCheck = treeApi.parent(toCheck);
374
- }
375
- return false;
376
- },
377
- };
378
-
379
379
  // TODO: Add more constraint types here
380
380
 
381
381
  /** Creates a copy of `runTransaction` with the `rollback` property added so as to satisfy the `RunTransaction` interface. */
@@ -443,7 +443,7 @@ function runTransactionInCheckout<TResult>(
443
443
  switch (constraint.type) {
444
444
  case "nodeInDocument": {
445
445
  const node = getOrCreateInnerNode(constraint.node);
446
- const nodeStatus = treeApi.status(constraint.node);
446
+ const nodeStatus = Tree.status(constraint.node);
447
447
  if (nodeStatus !== TreeStatus.InDocument) {
448
448
  throw new UsageError(
449
449
  `Attempted to add a "nodeInDocument" constraint, but the node is not currently in the document. Node status: ${nodeStatus}`,
@@ -54,10 +54,12 @@ import { independentInitializedView, type ViewContent } from "./independentView.
54
54
  import { SchematizingSimpleTreeView, ViewSlot } from "./schematizingTreeView.js";
55
55
 
56
56
  /**
57
- * Extensions to {@link Tree} and {@link TreeBeta} which are not yet stable.
58
- * @sealed @alpha
57
+ * Extensions to {@link (Tree:interface)} and {@link (TreeBeta:interface)} which are not yet stable.
58
+ * @remarks
59
+ * Use via the {@link (TreeAlpha:variable)} singleton.
60
+ * @system @sealed @alpha
59
61
  */
60
- export const TreeAlpha: {
62
+ export interface TreeAlpha {
61
63
  /**
62
64
  * Retrieve the {@link TreeBranch | branch}, if any, for the given node.
63
65
  * @param node - The node to query
@@ -79,7 +81,7 @@ export const TreeAlpha: {
79
81
  * such as when `undefined` might be allowed (for an optional field), or when the type should be inferred from the data when more than one type is possible.
80
82
  *
81
83
  * Like with {@link TreeNodeSchemaClass}'s constructor, it's an error to provide an existing node to this API.
82
- * For that case, use {@link TreeBeta.clone}.
84
+ * For that case, use {@link (TreeBeta:interface).clone}.
83
85
  * @privateRemarks
84
86
  * There should be a way to provide a source for defaulted identifiers, wither via this API or some way to add them to its output later.
85
87
  */
@@ -95,7 +97,7 @@ export const TreeAlpha: {
95
97
  >;
96
98
 
97
99
  /**
98
- * Less type safe version of {@link TreeAlpha.create}, suitable for importing data.
100
+ * Less type safe version of {@link (TreeAlpha:interface).create}, suitable for importing data.
99
101
  * @remarks
100
102
  * Due to {@link ConciseTree} relying on type inference from the data, its use is somewhat limited.
101
103
  * This does not support {@link ConciseTree|ConciseTrees} with customized handle encodings or using persisted keys.
@@ -103,8 +105,8 @@ export const TreeAlpha: {
103
105
  *
104
106
  * When using this function,
105
107
  * it is recommend to ensure your schema is unambiguous with {@link ITreeConfigurationOptions.preventAmbiguity}.
106
- * If the schema is ambiguous, consider using {@link TreeAlpha.create} and {@link Unhydrated} nodes where needed,
107
- * or using {@link TreeAlpha.(importVerbose:1)} and specify all types.
108
+ * If the schema is ambiguous, consider using {@link (TreeAlpha:interface).create} and {@link Unhydrated} nodes where needed,
109
+ * or using {@link (TreeAlpha:interface).(importVerbose:1)} and specify all types.
108
110
  *
109
111
  * Documented (and thus recoverable) error handling/reporting for this is not yet implemented,
110
112
  * but for now most invalid inputs will throw a recoverable error.
@@ -123,7 +125,7 @@ export const TreeAlpha: {
123
125
  /**
124
126
  * Construct tree content compatible with a field defined by the provided `schema`.
125
127
  * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.
126
- * @param data - The data used to construct the field content. See {@link TreeAlpha.(exportVerbose:1)}.
128
+ * @param data - The data used to construct the field content. See {@link (TreeAlpha:interface).(exportVerbose:1)}.
127
129
  */
128
130
  importVerbose<const TSchema extends ImplicitFieldSchema>(
129
131
  schema: TSchema,
@@ -149,7 +151,7 @@ export const TreeAlpha: {
149
151
  * Uses the {@link VerboseTree} format, with an explicit type on every node.
150
152
  *
151
153
  * @remarks
152
- * There are several cases this may be preferred to {@link TreeAlpha.(exportConcise:1)}:
154
+ * There are several cases this may be preferred to {@link (TreeAlpha:interface).(exportConcise:1)}:
153
155
  *
154
156
  * 1. When not using {@link ITreeConfigurationOptions.preventAmbiguity} (or when using `useStableFieldKeys`), `exportConcise` can produce ambiguous data (the type may be unclear on some nodes).
155
157
  * `exportVerbose` will always be unambiguous and thus lossless.
@@ -182,11 +184,11 @@ export const TreeAlpha: {
182
184
  ): JsonCompatible<IFluidHandle>;
183
185
 
184
186
  /**
185
- * Import data encoded by {@link TreeAlpha.exportCompressed}.
187
+ * Import data encoded by {@link (TreeAlpha:interface).exportCompressed}.
186
188
  *
187
189
  * @param schema - Schema with which the data must be compatible. This compatibility is not verified and must be ensured by the caller.
188
- * @param compressedData - Data compressed by {@link TreeAlpha.exportCompressed}.
189
- * @param options - If {@link TreeAlpha.exportCompressed} was given an `idCompressor`, it must be provided here.
190
+ * @param compressedData - Data compressed by {@link (TreeAlpha:interface).exportCompressed}.
191
+ * @param options - If {@link (TreeAlpha:interface).exportCompressed} was given an `idCompressor`, it must be provided here.
190
192
  *
191
193
  * @remarks
192
194
  * If the data could have been encoded with a different schema, consider encoding the schema along side it using {@link extractPersistedSchema} and loading the data using {@link independentView}.
@@ -203,7 +205,14 @@ export const TreeAlpha: {
203
205
  compressedData: JsonCompatible<IFluidHandle>,
204
206
  options: { idCompressor?: IIdCompressor } & ICodecOptions,
205
207
  ): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
206
- } = {
208
+ }
209
+
210
+ /**
211
+ * Extensions to {@link (Tree:variable)} and {@link (TreeBeta:variable)} which are not yet stable.
212
+ * @see {@link (TreeAlpha:interface)}.
213
+ * @alpha
214
+ */
215
+ export const TreeAlpha: TreeAlpha = {
207
216
  branch(node: TreeNode): TreeBranch | undefined {
208
217
  const kernel = getKernel(node);
209
218
  if (!kernel.isHydrated()) {
@@ -21,7 +21,7 @@ import { getUnhydratedContext } from "../createContext.js";
21
21
  * @remarks
22
22
  * This is "concise" meaning that explicit type information is omitted.
23
23
  * If the schema is compatible with {@link ITreeConfigurationOptions.preventAmbiguity},
24
- * types will be lossless and compatible with {@link TreeAlpha.create} (unless the options are used to customize it).
24
+ * types will be lossless and compatible with {@link (TreeAlpha:interface).create} (unless the options are used to customize it).
25
25
  *
26
26
  * Every {@link TreeNode} is an array or object.
27
27
  * Any IFluidHandle values have been replaced by `THandle`.