@fluidframework/tree 2.50.0 → 2.51.0-347100

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 (597) hide show
  1. package/.vscode/Tree.code-workspace +14 -1
  2. package/.vscode/settings.json +16 -0
  3. package/CHANGELOG.md +2 -2
  4. package/api-report/tree.alpha.api.md +7 -7
  5. package/dist/core/schema-stored/schema.d.ts +14 -1
  6. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  7. package/dist/core/schema-stored/schema.js.map +1 -1
  8. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  9. package/dist/feature-libraries/default-schema/schemaChecker.js +3 -0
  10. package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  11. package/dist/feature-libraries/flex-tree/context.d.ts +7 -2
  12. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  13. package/dist/feature-libraries/flex-tree/context.js +4 -4
  14. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  15. package/dist/feature-libraries/flex-tree/index.d.ts +1 -0
  16. package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
  17. package/dist/feature-libraries/flex-tree/index.js +3 -1
  18. package/dist/feature-libraries/flex-tree/index.js.map +1 -1
  19. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  20. package/dist/feature-libraries/flex-tree/lazyField.js +5 -5
  21. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  22. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +3 -1
  23. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  24. package/dist/feature-libraries/flex-tree/lazyNode.js +5 -3
  25. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  26. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  27. package/dist/feature-libraries/forest-summary/forestSummarizer.js +3 -4
  28. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  29. package/dist/feature-libraries/index.d.ts +1 -1
  30. package/dist/feature-libraries/index.d.ts.map +1 -1
  31. package/dist/feature-libraries/index.js +2 -1
  32. package/dist/feature-libraries/index.js.map +1 -1
  33. package/dist/packageVersion.d.ts +1 -1
  34. package/dist/packageVersion.d.ts.map +1 -1
  35. package/dist/packageVersion.js +1 -1
  36. package/dist/packageVersion.js.map +1 -1
  37. package/dist/shared-tree/index.d.ts +0 -1
  38. package/dist/shared-tree/index.d.ts.map +1 -1
  39. package/dist/shared-tree/index.js +1 -3
  40. package/dist/shared-tree/index.js.map +1 -1
  41. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  42. package/dist/shared-tree/schematizeTree.js +2 -6
  43. package/dist/shared-tree/schematizeTree.js.map +1 -1
  44. package/dist/shared-tree/schematizingTreeView.d.ts +11 -13
  45. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  46. package/dist/shared-tree/schematizingTreeView.js +58 -81
  47. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  48. package/dist/shared-tree/sharedTreeChangeTypes.d.ts +1 -1
  49. package/dist/shared-tree/sharedTreeChangeTypes.js.map +1 -1
  50. package/dist/shared-tree/tree.d.ts.map +1 -1
  51. package/dist/shared-tree/tree.js +4 -3
  52. package/dist/shared-tree/tree.js.map +1 -1
  53. package/dist/shared-tree/treeAlpha.d.ts +7 -1
  54. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  55. package/dist/shared-tree/treeAlpha.js.map +1 -1
  56. package/dist/shared-tree/treeCheckout.d.ts +7 -2
  57. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  58. package/dist/shared-tree/treeCheckout.js +4 -1
  59. package/dist/shared-tree/treeCheckout.js.map +1 -1
  60. package/dist/simple-tree/api/conciseTree.d.ts +1 -1
  61. package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
  62. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  63. package/dist/simple-tree/api/configuration.d.ts +1 -1
  64. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  65. package/dist/simple-tree/api/configuration.js +5 -5
  66. package/dist/simple-tree/api/configuration.js.map +1 -1
  67. package/dist/simple-tree/api/create.d.ts +3 -1
  68. package/dist/simple-tree/api/create.d.ts.map +1 -1
  69. package/dist/simple-tree/api/create.js +2 -0
  70. package/dist/simple-tree/api/create.js.map +1 -1
  71. package/dist/simple-tree/api/customTree.d.ts +1 -2
  72. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  73. package/dist/simple-tree/api/customTree.js.map +1 -1
  74. package/dist/simple-tree/api/getJsonSchema.d.ts +1 -1
  75. package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  76. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  77. package/dist/simple-tree/api/getSimpleSchema.d.ts +1 -1
  78. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
  79. package/dist/simple-tree/api/identifierIndex.d.ts +1 -1
  80. package/dist/simple-tree/api/identifierIndex.js +2 -2
  81. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  82. package/dist/simple-tree/api/index.d.ts +1 -1
  83. package/dist/simple-tree/api/index.d.ts.map +1 -1
  84. package/dist/simple-tree/api/index.js.map +1 -1
  85. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  86. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  87. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +14 -2
  88. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  89. package/dist/simple-tree/api/schemaCreationUtilities.js +41 -4
  90. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  91. package/dist/simple-tree/api/schemaFactory.d.ts +36 -3
  92. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  93. package/dist/simple-tree/api/schemaFactory.js +18 -18
  94. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  95. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +16 -16
  96. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  97. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  98. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +2 -2
  99. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  100. package/dist/simple-tree/api/schemaFactoryRecursive.js +2 -2
  101. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  102. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  103. package/dist/simple-tree/api/schemaFromSimple.js +4 -4
  104. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  105. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +2 -2
  106. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  107. package/dist/simple-tree/api/simpleTreeIndex.d.ts +2 -2
  108. package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  109. package/dist/simple-tree/api/simpleTreeIndex.js +1 -1
  110. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  111. package/dist/simple-tree/api/storedSchema.d.ts +1 -1
  112. package/dist/simple-tree/api/storedSchema.js +2 -2
  113. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  114. package/dist/simple-tree/api/tree.d.ts +2 -1
  115. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  116. package/dist/simple-tree/api/tree.js.map +1 -1
  117. package/dist/simple-tree/api/treeBeta.d.ts +4 -1
  118. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  119. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  120. package/dist/simple-tree/api/treeNodeApi.d.ts +1 -2
  121. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  122. package/dist/simple-tree/api/treeNodeApi.js +3 -3
  123. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  124. package/dist/simple-tree/api/typesUnsafe.d.ts +2 -3
  125. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  126. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  127. package/dist/simple-tree/api/verboseTree.d.ts +2 -1
  128. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  129. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  130. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +1 -1
  131. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +2 -2
  132. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  133. package/dist/simple-tree/core/allowedTypes.d.ts +316 -0
  134. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -0
  135. package/dist/simple-tree/core/allowedTypes.js +173 -0
  136. package/dist/simple-tree/core/allowedTypes.js.map +1 -0
  137. package/dist/simple-tree/core/context.d.ts +3 -9
  138. package/dist/simple-tree/core/context.d.ts.map +1 -1
  139. package/dist/simple-tree/core/context.js +3 -11
  140. package/dist/simple-tree/core/context.js.map +1 -1
  141. package/dist/simple-tree/core/flexList.d.ts.map +1 -0
  142. package/dist/simple-tree/core/flexList.js.map +1 -0
  143. package/dist/simple-tree/core/getOrCreateNode.d.ts +1 -1
  144. package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  145. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
  146. package/dist/simple-tree/core/index.d.ts +9 -3
  147. package/dist/simple-tree/core/index.d.ts.map +1 -1
  148. package/dist/simple-tree/core/index.js +19 -3
  149. package/dist/simple-tree/core/index.js.map +1 -1
  150. package/dist/simple-tree/core/treeNodeKernel.d.ts +8 -1
  151. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  152. package/dist/simple-tree/core/treeNodeKernel.js +24 -20
  153. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  154. package/dist/simple-tree/core/treeNodeSchema.d.ts +182 -39
  155. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  156. package/dist/simple-tree/core/treeNodeSchema.js +47 -17
  157. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  158. package/dist/simple-tree/{treeNodeValid.d.ts → core/treeNodeValid.d.ts} +18 -4
  159. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -0
  160. package/dist/simple-tree/{treeNodeValid.js → core/treeNodeValid.js} +41 -11
  161. package/dist/simple-tree/core/treeNodeValid.js.map +1 -0
  162. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
  163. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  164. package/dist/simple-tree/core/walkSchema.d.ts +2 -1
  165. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  166. package/dist/simple-tree/core/walkSchema.js +6 -2
  167. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  168. package/dist/simple-tree/createContext.d.ts +6 -2
  169. package/dist/simple-tree/createContext.d.ts.map +1 -1
  170. package/dist/simple-tree/createContext.js +15 -3
  171. package/dist/simple-tree/createContext.js.map +1 -1
  172. package/dist/simple-tree/fieldSchema.d.ts +423 -0
  173. package/dist/simple-tree/fieldSchema.d.ts.map +1 -0
  174. package/dist/simple-tree/{schemaTypes.js → fieldSchema.js} +5 -195
  175. package/dist/simple-tree/fieldSchema.js.map +1 -0
  176. package/dist/simple-tree/index.d.ts +5 -5
  177. package/dist/simple-tree/index.d.ts.map +1 -1
  178. package/dist/simple-tree/index.js +11 -11
  179. package/dist/simple-tree/index.js.map +1 -1
  180. package/dist/simple-tree/leafNodeSchema.d.ts +14 -5
  181. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  182. package/dist/simple-tree/leafNodeSchema.js +117 -2
  183. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  184. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +3 -4
  185. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  186. package/dist/simple-tree/node-kinds/array/arrayNode.js +97 -26
  187. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  188. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +2 -2
  189. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  190. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  191. package/dist/simple-tree/node-kinds/common.d.ts +16 -0
  192. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -0
  193. package/dist/simple-tree/node-kinds/common.js +42 -0
  194. package/dist/simple-tree/node-kinds/common.js.map +1 -0
  195. package/dist/simple-tree/node-kinds/index.d.ts +1 -1
  196. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  197. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  198. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +2 -3
  199. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  200. package/dist/simple-tree/node-kinds/map/mapNode.js +64 -26
  201. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  202. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +2 -2
  203. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  204. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  205. package/dist/simple-tree/node-kinds/object/index.d.ts +1 -1
  206. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  207. package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
  208. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +19 -5
  209. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  210. package/dist/simple-tree/node-kinds/object/objectNode.js +131 -27
  211. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  212. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +11 -4
  213. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  214. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  215. package/dist/simple-tree/node-kinds/record/recordNode.d.ts +2 -2
  216. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  217. package/dist/simple-tree/node-kinds/record/recordNode.js +41 -13
  218. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  219. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +2 -2
  220. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  221. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  222. package/dist/simple-tree/prepareForInsertion.d.ts +2 -2
  223. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  224. package/dist/simple-tree/prepareForInsertion.js +3 -3
  225. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  226. package/dist/simple-tree/simpleSchema.d.ts +2 -2
  227. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  228. package/dist/simple-tree/simpleSchema.js.map +1 -1
  229. package/dist/simple-tree/toStoredSchema.d.ts +1 -1
  230. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  231. package/dist/simple-tree/toStoredSchema.js +6 -7
  232. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  233. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +5 -11
  234. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  235. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +25 -395
  236. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  237. package/dist/simple-tree/unsafeUnknownSchema.d.ts +52 -0
  238. package/dist/simple-tree/unsafeUnknownSchema.d.ts.map +1 -0
  239. package/dist/simple-tree/unsafeUnknownSchema.js +13 -0
  240. package/dist/simple-tree/unsafeUnknownSchema.js.map +1 -0
  241. package/dist/simple-tree/walkFieldSchema.d.ts +1 -1
  242. package/dist/simple-tree/walkFieldSchema.js +2 -2
  243. package/dist/simple-tree/walkFieldSchema.js.map +1 -1
  244. package/dist/tableSchema.d.ts +12 -12
  245. package/dist/treeFactory.d.ts +0 -1
  246. package/dist/treeFactory.d.ts.map +1 -1
  247. package/dist/treeFactory.js +0 -1
  248. package/dist/treeFactory.js.map +1 -1
  249. package/lib/core/schema-stored/schema.d.ts +14 -1
  250. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  251. package/lib/core/schema-stored/schema.js.map +1 -1
  252. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  253. package/lib/feature-libraries/default-schema/schemaChecker.js +3 -0
  254. package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  255. package/lib/feature-libraries/flex-tree/context.d.ts +7 -2
  256. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  257. package/lib/feature-libraries/flex-tree/context.js +4 -4
  258. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  259. package/lib/feature-libraries/flex-tree/index.d.ts +1 -0
  260. package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
  261. package/lib/feature-libraries/flex-tree/index.js +1 -0
  262. package/lib/feature-libraries/flex-tree/index.js.map +1 -1
  263. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  264. package/lib/feature-libraries/flex-tree/lazyField.js +6 -6
  265. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  266. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +3 -1
  267. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  268. package/lib/feature-libraries/flex-tree/lazyNode.js +3 -1
  269. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  270. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  271. package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -2
  272. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  273. package/lib/feature-libraries/index.d.ts +1 -1
  274. package/lib/feature-libraries/index.d.ts.map +1 -1
  275. package/lib/feature-libraries/index.js +1 -1
  276. package/lib/feature-libraries/index.js.map +1 -1
  277. package/lib/packageVersion.d.ts +1 -1
  278. package/lib/packageVersion.d.ts.map +1 -1
  279. package/lib/packageVersion.js +1 -1
  280. package/lib/packageVersion.js.map +1 -1
  281. package/lib/shared-tree/index.d.ts +0 -1
  282. package/lib/shared-tree/index.d.ts.map +1 -1
  283. package/lib/shared-tree/index.js +0 -1
  284. package/lib/shared-tree/index.js.map +1 -1
  285. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  286. package/lib/shared-tree/schematizeTree.js +2 -6
  287. package/lib/shared-tree/schematizeTree.js.map +1 -1
  288. package/lib/shared-tree/schematizingTreeView.d.ts +11 -13
  289. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  290. package/lib/shared-tree/schematizingTreeView.js +59 -81
  291. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  292. package/lib/shared-tree/sharedTreeChangeTypes.d.ts +1 -1
  293. package/lib/shared-tree/sharedTreeChangeTypes.js.map +1 -1
  294. package/lib/shared-tree/tree.d.ts.map +1 -1
  295. package/lib/shared-tree/tree.js +4 -3
  296. package/lib/shared-tree/tree.js.map +1 -1
  297. package/lib/shared-tree/treeAlpha.d.ts +7 -1
  298. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  299. package/lib/shared-tree/treeAlpha.js.map +1 -1
  300. package/lib/shared-tree/treeCheckout.d.ts +7 -2
  301. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  302. package/lib/shared-tree/treeCheckout.js +5 -2
  303. package/lib/shared-tree/treeCheckout.js.map +1 -1
  304. package/lib/simple-tree/api/conciseTree.d.ts +1 -1
  305. package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
  306. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  307. package/lib/simple-tree/api/configuration.d.ts +1 -1
  308. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  309. package/lib/simple-tree/api/configuration.js +2 -2
  310. package/lib/simple-tree/api/configuration.js.map +1 -1
  311. package/lib/simple-tree/api/create.d.ts +3 -1
  312. package/lib/simple-tree/api/create.d.ts.map +1 -1
  313. package/lib/simple-tree/api/create.js +2 -0
  314. package/lib/simple-tree/api/create.js.map +1 -1
  315. package/lib/simple-tree/api/customTree.d.ts +1 -2
  316. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  317. package/lib/simple-tree/api/customTree.js.map +1 -1
  318. package/lib/simple-tree/api/getJsonSchema.d.ts +1 -1
  319. package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  320. package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
  321. package/lib/simple-tree/api/getSimpleSchema.d.ts +1 -1
  322. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
  323. package/lib/simple-tree/api/identifierIndex.d.ts +1 -1
  324. package/lib/simple-tree/api/identifierIndex.js +1 -1
  325. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  326. package/lib/simple-tree/api/index.d.ts +1 -1
  327. package/lib/simple-tree/api/index.d.ts.map +1 -1
  328. package/lib/simple-tree/api/index.js.map +1 -1
  329. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  330. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  331. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +14 -2
  332. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  333. package/lib/simple-tree/api/schemaCreationUtilities.js +40 -4
  334. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  335. package/lib/simple-tree/api/schemaFactory.d.ts +36 -3
  336. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  337. package/lib/simple-tree/api/schemaFactory.js +2 -2
  338. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  339. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +16 -16
  340. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  341. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  342. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +2 -2
  343. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  344. package/lib/simple-tree/api/schemaFactoryRecursive.js +1 -1
  345. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  346. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  347. package/lib/simple-tree/api/schemaFromSimple.js +1 -1
  348. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  349. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +1 -1
  350. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  351. package/lib/simple-tree/api/simpleTreeIndex.d.ts +2 -2
  352. package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  353. package/lib/simple-tree/api/simpleTreeIndex.js +2 -2
  354. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  355. package/lib/simple-tree/api/storedSchema.d.ts +1 -1
  356. package/lib/simple-tree/api/storedSchema.js +1 -1
  357. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  358. package/lib/simple-tree/api/tree.d.ts +2 -1
  359. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  360. package/lib/simple-tree/api/tree.js.map +1 -1
  361. package/lib/simple-tree/api/treeBeta.d.ts +4 -1
  362. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  363. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  364. package/lib/simple-tree/api/treeNodeApi.d.ts +1 -2
  365. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  366. package/lib/simple-tree/api/treeNodeApi.js +2 -2
  367. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  368. package/lib/simple-tree/api/typesUnsafe.d.ts +2 -3
  369. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  370. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  371. package/lib/simple-tree/api/verboseTree.d.ts +2 -1
  372. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  373. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  374. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +1 -1
  375. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +1 -1
  376. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  377. package/lib/simple-tree/core/allowedTypes.d.ts +316 -0
  378. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -0
  379. package/lib/simple-tree/core/allowedTypes.js +162 -0
  380. package/lib/simple-tree/core/allowedTypes.js.map +1 -0
  381. package/lib/simple-tree/core/context.d.ts +3 -9
  382. package/lib/simple-tree/core/context.d.ts.map +1 -1
  383. package/lib/simple-tree/core/context.js +0 -8
  384. package/lib/simple-tree/core/context.js.map +1 -1
  385. package/lib/simple-tree/core/flexList.d.ts.map +1 -0
  386. package/lib/simple-tree/core/flexList.js.map +1 -0
  387. package/lib/simple-tree/core/getOrCreateNode.d.ts +1 -1
  388. package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  389. package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
  390. package/lib/simple-tree/core/index.d.ts +9 -3
  391. package/lib/simple-tree/core/index.d.ts.map +1 -1
  392. package/lib/simple-tree/core/index.js +6 -3
  393. package/lib/simple-tree/core/index.js.map +1 -1
  394. package/lib/simple-tree/core/treeNodeKernel.d.ts +8 -1
  395. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  396. package/lib/simple-tree/core/treeNodeKernel.js +10 -6
  397. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  398. package/lib/simple-tree/core/treeNodeSchema.d.ts +182 -39
  399. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  400. package/lib/simple-tree/core/treeNodeSchema.js +44 -14
  401. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  402. package/lib/simple-tree/{treeNodeValid.d.ts → core/treeNodeValid.d.ts} +18 -4
  403. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -0
  404. package/lib/simple-tree/{treeNodeValid.js → core/treeNodeValid.js} +31 -3
  405. package/lib/simple-tree/core/treeNodeValid.js.map +1 -0
  406. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
  407. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  408. package/lib/simple-tree/core/walkSchema.d.ts +2 -1
  409. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  410. package/lib/simple-tree/core/walkSchema.js +7 -3
  411. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  412. package/lib/simple-tree/createContext.d.ts +6 -2
  413. package/lib/simple-tree/createContext.d.ts.map +1 -1
  414. package/lib/simple-tree/createContext.js +13 -2
  415. package/lib/simple-tree/createContext.js.map +1 -1
  416. package/lib/simple-tree/fieldSchema.d.ts +423 -0
  417. package/lib/simple-tree/fieldSchema.d.ts.map +1 -0
  418. package/lib/simple-tree/{schemaTypes.js → fieldSchema.js} +3 -183
  419. package/lib/simple-tree/fieldSchema.js.map +1 -0
  420. package/lib/simple-tree/index.d.ts +5 -5
  421. package/lib/simple-tree/index.d.ts.map +1 -1
  422. package/lib/simple-tree/index.js +2 -2
  423. package/lib/simple-tree/index.js.map +1 -1
  424. package/lib/simple-tree/leafNodeSchema.d.ts +14 -5
  425. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  426. package/lib/simple-tree/leafNodeSchema.js +117 -3
  427. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  428. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +3 -4
  429. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  430. package/lib/simple-tree/node-kinds/array/arrayNode.js +86 -15
  431. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  432. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +2 -2
  433. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  434. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js +1 -1
  435. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  436. package/lib/simple-tree/node-kinds/common.d.ts +16 -0
  437. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -0
  438. package/lib/simple-tree/node-kinds/common.js +38 -0
  439. package/lib/simple-tree/node-kinds/common.js.map +1 -0
  440. package/lib/simple-tree/node-kinds/index.d.ts +1 -1
  441. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  442. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  443. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +2 -3
  444. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  445. package/lib/simple-tree/node-kinds/map/mapNode.js +51 -13
  446. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  447. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +2 -2
  448. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  449. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js +1 -1
  450. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  451. package/lib/simple-tree/node-kinds/object/index.d.ts +1 -1
  452. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  453. package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
  454. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +19 -5
  455. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  456. package/lib/simple-tree/node-kinds/object/objectNode.js +116 -14
  457. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  458. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +11 -4
  459. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  460. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js +1 -1
  461. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  462. package/lib/simple-tree/node-kinds/record/recordNode.d.ts +2 -2
  463. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  464. package/lib/simple-tree/node-kinds/record/recordNode.js +40 -12
  465. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  466. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +2 -2
  467. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  468. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js +1 -1
  469. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  470. package/lib/simple-tree/prepareForInsertion.d.ts +2 -2
  471. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  472. package/lib/simple-tree/prepareForInsertion.js +2 -2
  473. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  474. package/lib/simple-tree/simpleSchema.d.ts +2 -2
  475. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  476. package/lib/simple-tree/simpleSchema.js.map +1 -1
  477. package/lib/simple-tree/toStoredSchema.d.ts +1 -1
  478. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  479. package/lib/simple-tree/toStoredSchema.js +2 -3
  480. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  481. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +5 -11
  482. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  483. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +10 -381
  484. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  485. package/lib/simple-tree/unsafeUnknownSchema.d.ts +52 -0
  486. package/lib/simple-tree/unsafeUnknownSchema.d.ts.map +1 -0
  487. package/lib/simple-tree/unsafeUnknownSchema.js +10 -0
  488. package/lib/simple-tree/unsafeUnknownSchema.js.map +1 -0
  489. package/lib/simple-tree/walkFieldSchema.d.ts +1 -1
  490. package/lib/simple-tree/walkFieldSchema.js +1 -1
  491. package/lib/simple-tree/walkFieldSchema.js.map +1 -1
  492. package/lib/tableSchema.d.ts +12 -12
  493. package/lib/treeFactory.d.ts +0 -1
  494. package/lib/treeFactory.d.ts.map +1 -1
  495. package/lib/treeFactory.js +0 -1
  496. package/lib/treeFactory.js.map +1 -1
  497. package/package.json +22 -23
  498. package/src/core/schema-stored/schema.ts +14 -1
  499. package/src/feature-libraries/default-schema/schemaChecker.ts +3 -0
  500. package/src/feature-libraries/flex-tree/context.ts +10 -5
  501. package/src/feature-libraries/flex-tree/index.ts +2 -0
  502. package/src/feature-libraries/flex-tree/lazyField.ts +10 -6
  503. package/src/feature-libraries/flex-tree/lazyNode.ts +6 -1
  504. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -2
  505. package/src/feature-libraries/index.ts +1 -0
  506. package/src/packageVersion.ts +1 -1
  507. package/src/shared-tree/index.ts +0 -2
  508. package/src/shared-tree/schematizeTree.ts +2 -6
  509. package/src/shared-tree/schematizingTreeView.ts +72 -107
  510. package/src/shared-tree/sharedTreeChangeTypes.ts +1 -1
  511. package/src/shared-tree/tree.ts +4 -3
  512. package/src/shared-tree/treeAlpha.ts +7 -1
  513. package/src/shared-tree/treeCheckout.ts +15 -2
  514. package/src/simple-tree/api/conciseTree.ts +1 -2
  515. package/src/simple-tree/api/configuration.ts +7 -4
  516. package/src/simple-tree/api/create.ts +3 -1
  517. package/src/simple-tree/api/customTree.ts +1 -2
  518. package/src/simple-tree/api/getJsonSchema.ts +1 -1
  519. package/src/simple-tree/api/getSimpleSchema.ts +1 -1
  520. package/src/simple-tree/api/identifierIndex.ts +1 -1
  521. package/src/simple-tree/api/index.ts +2 -0
  522. package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
  523. package/src/simple-tree/api/schemaCreationUtilities.ts +47 -5
  524. package/src/simple-tree/api/schemaFactory.ts +45 -10
  525. package/src/simple-tree/api/schemaFactoryAlpha.ts +4 -7
  526. package/src/simple-tree/api/schemaFactoryRecursive.ts +9 -4
  527. package/src/simple-tree/api/schemaFromSimple.ts +2 -3
  528. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  529. package/src/simple-tree/api/simpleTreeIndex.ts +8 -3
  530. package/src/simple-tree/api/storedSchema.ts +1 -1
  531. package/src/simple-tree/api/tree.ts +2 -2
  532. package/src/simple-tree/api/treeBeta.ts +4 -1
  533. package/src/simple-tree/api/treeNodeApi.ts +5 -8
  534. package/src/simple-tree/api/typesUnsafe.ts +5 -4
  535. package/src/simple-tree/api/verboseTree.ts +3 -6
  536. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +1 -1
  537. package/src/simple-tree/core/README.md +1 -1
  538. package/src/simple-tree/core/allowedTypes.ts +496 -0
  539. package/src/simple-tree/core/context.ts +3 -10
  540. package/src/simple-tree/core/getOrCreateNode.ts +1 -1
  541. package/src/simple-tree/core/index.ts +62 -9
  542. package/src/simple-tree/core/treeNodeKernel.ts +12 -6
  543. package/src/simple-tree/core/treeNodeSchema.ts +247 -63
  544. package/src/simple-tree/{treeNodeValid.ts → core/treeNodeValid.ts} +59 -15
  545. package/src/simple-tree/core/unhydratedFlexTree.ts +1 -1
  546. package/src/simple-tree/core/walkSchema.ts +9 -5
  547. package/src/simple-tree/createContext.ts +26 -2
  548. package/src/simple-tree/fieldSchema.ts +734 -0
  549. package/src/simple-tree/index.ts +32 -30
  550. package/src/simple-tree/leafNodeSchema.ts +137 -5
  551. package/src/simple-tree/node-kinds/array/arrayNode.ts +141 -30
  552. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +5 -7
  553. package/src/simple-tree/node-kinds/common.ts +60 -0
  554. package/src/simple-tree/node-kinds/index.ts +1 -0
  555. package/src/simple-tree/node-kinds/map/mapNode.ts +91 -33
  556. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +5 -7
  557. package/src/simple-tree/node-kinds/object/index.ts +1 -0
  558. package/src/simple-tree/node-kinds/object/objectNode.ts +205 -25
  559. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +22 -5
  560. package/src/simple-tree/node-kinds/record/recordNode.ts +68 -26
  561. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +6 -8
  562. package/src/simple-tree/prepareForInsertion.ts +7 -6
  563. package/src/simple-tree/simpleSchema.ts +2 -2
  564. package/src/simple-tree/toStoredSchema.ts +2 -3
  565. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +12 -494
  566. package/src/simple-tree/unsafeUnknownSchema.ts +70 -0
  567. package/src/simple-tree/walkFieldSchema.ts +1 -1
  568. package/src/treeFactory.ts +0 -1
  569. package/dist/shared-tree/checkoutFlexTreeView.d.ts +0 -58
  570. package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +0 -1
  571. package/dist/shared-tree/checkoutFlexTreeView.js +0 -77
  572. package/dist/shared-tree/checkoutFlexTreeView.js.map +0 -1
  573. package/dist/simple-tree/flexList.d.ts.map +0 -1
  574. package/dist/simple-tree/flexList.js.map +0 -1
  575. package/dist/simple-tree/schemaTypes.d.ts +0 -856
  576. package/dist/simple-tree/schemaTypes.d.ts.map +0 -1
  577. package/dist/simple-tree/schemaTypes.js.map +0 -1
  578. package/dist/simple-tree/treeNodeValid.d.ts.map +0 -1
  579. package/dist/simple-tree/treeNodeValid.js.map +0 -1
  580. package/lib/shared-tree/checkoutFlexTreeView.d.ts +0 -58
  581. package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +0 -1
  582. package/lib/shared-tree/checkoutFlexTreeView.js +0 -72
  583. package/lib/shared-tree/checkoutFlexTreeView.js.map +0 -1
  584. package/lib/simple-tree/flexList.d.ts.map +0 -1
  585. package/lib/simple-tree/flexList.js.map +0 -1
  586. package/lib/simple-tree/schemaTypes.d.ts +0 -856
  587. package/lib/simple-tree/schemaTypes.d.ts.map +0 -1
  588. package/lib/simple-tree/schemaTypes.js.map +0 -1
  589. package/lib/simple-tree/treeNodeValid.d.ts.map +0 -1
  590. package/lib/simple-tree/treeNodeValid.js.map +0 -1
  591. package/src/shared-tree/checkoutFlexTreeView.ts +0 -100
  592. package/src/simple-tree/schemaTypes.ts +0 -1420
  593. /package/dist/simple-tree/{flexList.d.ts → core/flexList.d.ts} +0 -0
  594. /package/dist/simple-tree/{flexList.js → core/flexList.js} +0 -0
  595. /package/lib/simple-tree/{flexList.d.ts → core/flexList.d.ts} +0 -0
  596. /package/lib/simple-tree/{flexList.js → core/flexList.js} +0 -0
  597. /package/src/simple-tree/{flexList.ts → core/flexList.ts} +0 -0
@@ -4,29 +4,11 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.UnsafeUnknownSchema = exports.markSchemaMostDerived = exports.evaluateLazySchema = exports.areFieldSchemaEqual = exports.areImplicitFieldSchemaEqual = exports.unannotateSchemaRecord = exports.unannotateImplicitAllowedTypes = exports.normalizeAnnotatedAllowedTypes = exports.normalizeToAnnotatedAllowedType = exports.normalizeAllowedTypes = exports.normalizeFieldSchema = exports.ObjectFieldSchema = exports.FieldSchemaAlpha = exports.FieldSchema = exports.createFieldSchema = exports.getDefaultProvider = exports.extractFieldProvider = exports.isConstant = exports.getExplicitStoredKey = exports.getStoredKey = exports.FieldKind = exports.isAnnotatedAllowedType = exports.isTreeNodeSchemaClass = void 0;
7
+ exports.areFieldSchemaEqual = exports.areImplicitFieldSchemaEqual = exports.normalizeFieldSchema = exports.FieldSchemaAlpha = exports.FieldSchema = exports.createFieldSchema = exports.getDefaultProvider = exports.extractFieldProvider = exports.isConstant = exports.getExplicitStoredKey = exports.getStoredKey = exports.FieldKind = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
10
  const index_js_1 = require("../util/index.js");
11
11
  const index_js_2 = require("./core/index.js");
12
- const flexList_js_1 = require("./flexList.js");
13
- const leafNodeSchema_js_1 = require("./leafNodeSchema.js");
14
- const treeNodeValid_js_1 = require("./treeNodeValid.js");
15
- /**
16
- * Returns true if the given schema is a {@link TreeNodeSchemaClass}, or otherwise false if it is a {@link TreeNodeSchemaNonClass}.
17
- * @internal
18
- */
19
- function isTreeNodeSchemaClass(schema) {
20
- return schema.constructor !== undefined;
21
- }
22
- exports.isTreeNodeSchemaClass = isTreeNodeSchemaClass;
23
- /**
24
- * Checks if the given allowed type is annotated with {@link AllowedTypeMetadata}.
25
- */
26
- function isAnnotatedAllowedType(allowedType) {
27
- return "metadata" in allowedType && "type" in allowedType;
28
- }
29
- exports.isAnnotatedAllowedType = isAnnotatedAllowedType;
30
12
  /**
31
13
  * Kind of a field on an {@link TreeObjectNode}.
32
14
  * @remarks
@@ -156,7 +138,7 @@ class FieldSchema {
156
138
  if (!(this instanceof FieldSchemaAlpha)) {
157
139
  throw new internal_2.UsageError("FieldSchema is @sealed: sub-classing is not allowed.");
158
140
  }
159
- this.lazyTypes = new internal_1.Lazy(() => normalizeAllowedTypes(this.allowedTypes));
141
+ this.lazyTypes = new internal_1.Lazy(() => (0, index_js_2.normalizeAllowedTypes)(this.allowedTypes));
160
142
  // TODO: optional fields should (by default) get a default provider that returns undefined, removing the need to special case them here:
161
143
  this.requiresValue =
162
144
  this.props?.defaultProvider === undefined && this.kind !== FieldKind.Optional;
@@ -182,7 +164,7 @@ class FieldSchemaAlpha extends FieldSchema {
182
164
  this.allowedTypesMetadata = (0, index_js_2.isAnnotatedAllowedTypes)(annotatedAllowedTypes)
183
165
  ? annotatedAllowedTypes.metadata
184
166
  : {};
185
- this.lazyAnnotatedTypes = new internal_1.Lazy(() => normalizeAnnotatedAllowedTypes(annotatedAllowedTypes));
167
+ this.lazyAnnotatedTypes = new internal_1.Lazy(() => (0, index_js_2.normalizeAnnotatedAllowedTypes)(annotatedAllowedTypes));
186
168
  this.lazyIdentifiers = new internal_1.Lazy(() => new Set([...this.allowedTypeSet].map((t) => t.identifier)));
187
169
  this.propsAlpha = props;
188
170
  }
@@ -199,18 +181,8 @@ class FieldSchemaAlpha extends FieldSchema {
199
181
  }
200
182
  exports.FieldSchemaAlpha = FieldSchemaAlpha;
201
183
  (() => {
202
- createFieldSchemaPrivate = (kind, annotatedAllowedTypes, props) => new FieldSchemaAlpha(kind, unannotateImplicitAllowedTypes(annotatedAllowedTypes), annotatedAllowedTypes, props);
184
+ createFieldSchemaPrivate = (kind, annotatedAllowedTypes, props) => new FieldSchemaAlpha(kind, (0, index_js_2.unannotateImplicitAllowedTypes)(annotatedAllowedTypes), annotatedAllowedTypes, props);
203
185
  })();
204
- /**
205
- * {@link FieldSchemaAlpha} including {@link SimpleObjectFieldSchema}.
206
- */
207
- class ObjectFieldSchema extends FieldSchemaAlpha {
208
- constructor(kind, allowedTypes, annotatedTypes, props) {
209
- super(kind, allowedTypes, annotatedTypes, props);
210
- this.storedKey = props.key;
211
- }
212
- }
213
- exports.ObjectFieldSchema = ObjectFieldSchema;
214
186
  /**
215
187
  * Normalizes a {@link ImplicitFieldSchema} or {@link ImplicitAnnotatedFieldSchema} to a {@link FieldSchema}.
216
188
  */
@@ -220,108 +192,6 @@ function normalizeFieldSchema(schema) {
220
192
  : createFieldSchema(FieldKind.Required, schema);
221
193
  }
222
194
  exports.normalizeFieldSchema = normalizeFieldSchema;
223
- /**
224
- * Normalizes a {@link ImplicitAllowedTypes} to a set of {@link TreeNodeSchema}s, by eagerly evaluating any
225
- * lazy schema declarations.
226
- *
227
- * @remarks Note: this must only be called after all required schemas have been declared, otherwise evaluation of
228
- * recursive schemas may fail.
229
- *
230
- * @internal
231
- */
232
- function normalizeAllowedTypes(types) {
233
- const normalized = new Set();
234
- if ((0, index_js_1.isReadonlyArray)(types)) {
235
- // Types array must not be modified after it is normalized since that would result in the user of the normalized data having wrong (out of date) content.
236
- Object.freeze(types);
237
- for (const lazyType of types) {
238
- normalized.add(evaluateLazySchema(lazyType));
239
- }
240
- }
241
- else {
242
- normalized.add(evaluateLazySchema(types));
243
- }
244
- return normalized;
245
- }
246
- exports.normalizeAllowedTypes = normalizeAllowedTypes;
247
- /**
248
- * Normalizes an allowed type to an {@link AnnotatedAllowedType}, by adding empty annotations if they don't already exist.
249
- */
250
- function normalizeToAnnotatedAllowedType(type) {
251
- return isAnnotatedAllowedType(type)
252
- ? type
253
- : {
254
- metadata: {},
255
- type,
256
- };
257
- }
258
- exports.normalizeToAnnotatedAllowedType = normalizeToAnnotatedAllowedType;
259
- /**
260
- * Normalizes a {@link ImplicitAnnotatedAllowedTypes} to a set of {@link AnnotatedAllowedSchema}s, by eagerly evaluating any
261
- * lazy schema declarations and adding empty metadata if it doesn't already exist.
262
- *
263
- * @remarks Note: this must only be called after all required schemas have been declared, otherwise evaluation of
264
- * recursive schemas may fail.
265
- */
266
- function normalizeAnnotatedAllowedTypes(types) {
267
- const typesWithoutAnnotation = (0, index_js_2.isAnnotatedAllowedTypes)(types) ? types.types : types;
268
- const annotatedTypes = [];
269
- if ((0, index_js_1.isReadonlyArray)(typesWithoutAnnotation)) {
270
- for (const annotatedType of typesWithoutAnnotation) {
271
- if (isAnnotatedAllowedType(annotatedType)) {
272
- annotatedTypes.push({
273
- type: evaluateLazySchema(annotatedType.type),
274
- metadata: annotatedType.metadata,
275
- });
276
- }
277
- else {
278
- annotatedTypes.push({ type: evaluateLazySchema(annotatedType), metadata: {} });
279
- }
280
- }
281
- }
282
- else {
283
- if (isAnnotatedAllowedType(typesWithoutAnnotation)) {
284
- annotatedTypes.push({
285
- type: evaluateLazySchema(typesWithoutAnnotation.type),
286
- metadata: typesWithoutAnnotation.metadata,
287
- });
288
- }
289
- else {
290
- annotatedTypes.push({ type: evaluateLazySchema(typesWithoutAnnotation), metadata: {} });
291
- }
292
- }
293
- return {
294
- metadata: (0, index_js_2.isAnnotatedAllowedTypes)(types) ? types.metadata : {},
295
- types: annotatedTypes,
296
- };
297
- }
298
- exports.normalizeAnnotatedAllowedTypes = normalizeAnnotatedAllowedTypes;
299
- /**
300
- * Converts an {@link ImplicitAnnotatedAllowedTypes} to an {@link ImplicitAllowedTypes}s, by removing
301
- * any annotations.
302
- * @remarks
303
- * This does not evaluate any lazy schemas.
304
- */
305
- function unannotateImplicitAllowedTypes(types) {
306
- return ((0, index_js_2.isAnnotatedAllowedTypes)(types)
307
- ? types.types.map((allowedType) => isAnnotatedAllowedType(allowedType) ? allowedType.type : allowedType)
308
- : (0, index_js_1.isReadonlyArray)(types)
309
- ? types.map((allowedType) => isAnnotatedAllowedType(allowedType) ? allowedType.type : allowedType)
310
- : isAnnotatedAllowedType(types)
311
- ? types.type
312
- : types);
313
- }
314
- exports.unannotateImplicitAllowedTypes = unannotateImplicitAllowedTypes;
315
- /**
316
- * Removes annotations from a schema record.
317
- */
318
- function unannotateSchemaRecord(schemaRecord) {
319
- return Object.fromEntries(Object.entries(schemaRecord).map(([key, schema]) => [
320
- key,
321
- schema instanceof FieldSchema ? schema : unannotateImplicitAllowedTypes(schema),
322
- ]));
323
- }
324
- exports.unannotateSchemaRecord = unannotateSchemaRecord;
325
195
  /**
326
196
  * Returns true if the given {@link ImplicitFieldSchema} are equivalent, otherwise false.
327
197
  * @remarks Two ImplicitFieldSchema are considered equivalent if all of the following are true:
@@ -402,64 +272,4 @@ function arePersistedMetadataEqual(a, b) {
402
272
  const bStringified = JSON.stringify(b);
403
273
  return aStringified === bStringified;
404
274
  }
405
- const cachedLazyItem = new WeakMap();
406
- /**
407
- * Returns the schema referenced by the {@link LazyItem}.
408
- * @remarks
409
- * Caches results to handle {@link LazyItem}s which compute their resulting schema.
410
- * @alpha
411
- */
412
- function evaluateLazySchema(value) {
413
- const evaluatedSchema = (0, flexList_js_1.isLazy)(value)
414
- ? (0, index_js_1.getOrCreate)(cachedLazyItem, value, value)
415
- : value;
416
- if (evaluatedSchema === undefined) {
417
- throw new internal_2.UsageError(`Encountered an undefined schema. This could indicate that some referenced schema has not yet been instantiated.`);
418
- }
419
- markSchemaMostDerived(evaluatedSchema);
420
- return evaluatedSchema;
421
- }
422
- exports.evaluateLazySchema = evaluateLazySchema;
423
- /**
424
- * Indicates that the provided schema is the "most derived" version in its class hierarchy.
425
- *
426
- * @param oneTimeInitialize - If true this runs {@link TreeNodeValid.oneTimeInitialize} which does even more initialization and validation.
427
- * `oneTimeInitialize` can't safely be run until all transitively referenced schema are defined, so which cases can safely use it are more limited.
428
- * When legal for the caller to set this to true, it is preferred, but it is often not safe due to possible forward references.
429
- * @remarks
430
- * See {@link MostDerivedData} and {@link SchemaFactory} for details on what a "most derived" schema is and why it matters.
431
- *
432
- * This is a helper for invoking {@link TreeNodeValid.markMostDerived} for {@link TreeNodeSchema}.
433
- *
434
- * Calling this helps with error messages about invalid schema usage (See {@link SchemaFactory} for the rules, some of which this helps validate).
435
- * Typically this should be called for each schema as early as practical to improve error reporting for invalid usages of schema
436
- * (using two different schema derived from the same {@link SchemaFactory} produced base class).
437
- *
438
- * Note that construction of actual {@link TreeNode} instances or use of a schema transitively in a {@link TreeViewConfiguration} already do this,
439
- * so any calls to this that is unconditionally after that point for the given schema is not needed.
440
- * Instead most usages of this should be from those cases, and from miscellaneous cases where a schema is passed into an public API where theoretically someone could accidentally
441
- * pass in a base class of a schema instead of the most derived one.
442
- */
443
- function markSchemaMostDerived(schema, oneTimeInitialize = false) {
444
- if (schema instanceof leafNodeSchema_js_1.LeafNodeSchema) {
445
- return;
446
- }
447
- if (!(0, index_js_2.inPrototypeChain)(schema, treeNodeValid_js_1.TreeNodeValid)) {
448
- // Use JSON.stringify to quote and escape identifier string.
449
- throw new internal_2.UsageError(`Schema for ${JSON.stringify(schema.identifier)} does not extend a SchemaFactory generated class. This is invalid.`);
450
- }
451
- const schemaValid = schema;
452
- if (oneTimeInitialize) {
453
- schemaValid.oneTimeInitialize();
454
- }
455
- else {
456
- schemaValid.markMostDerived();
457
- }
458
- }
459
- exports.markSchemaMostDerived = markSchemaMostDerived;
460
- /**
461
- * {@inheritdoc (UnsafeUnknownSchema:type)}
462
- * @alpha
463
- */
464
- exports.UnsafeUnknownSchema = Symbol("UnsafeUnknownSchema");
465
- //# sourceMappingURL=schemaTypes.js.map
275
+ //# sourceMappingURL=fieldSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fieldSchema.js","sourceRoot":"","sources":["../../src/simple-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iB,CAAC,CACrE,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,yBAAyB,CACjC,CAA2C,EAC3C,CAA2C;IAE3C,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACd,CAAC;IAED,+GAA+G;IAC/G,iCAAiC;IACjC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACvC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEvC,OAAO,YAAY,KAAK,YAAY,CAAC;AACtC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"@fluidframework/core-interfaces\";\nimport { Lazy } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { FieldKey } from \"../core/index.js\";\nimport type { FlexTreeHydratedContextMinimal } from \"../feature-libraries/index.js\";\nimport {\n\ttype MakeNominal,\n\tbrand,\n\ttype UnionToIntersection,\n\tcompareSets,\n\ttype requireTrue,\n\ttype areOnlyKeys,\n\ttype JsonCompatibleReadOnlyObject,\n} from \"../util/index.js\";\n\nimport type {\n\tTreeNodeSchema,\n\tTreeNode,\n\tUnhydratedFlexTreeNode,\n\tNormalizedAnnotatedAllowedTypes,\n\tImplicitAllowedTypes,\n\tImplicitAnnotatedAllowedTypes,\n\tUnannotateImplicitAllowedTypes,\n\tAllowedTypesMetadata,\n\tTreeNodeFromImplicitAllowedTypes,\n\tTreeLeafValue,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n} from \"./core/index.js\";\nimport {\n\tisAnnotatedAllowedTypes,\n\tnormalizeAllowedTypes,\n\tnormalizeAnnotatedAllowedTypes,\n\tunannotateImplicitAllowedTypes,\n} from \"./core/index.js\";\n\nimport type { SimpleFieldSchema } from \"./simpleSchema.js\";\nimport type { UnsafeUnknownSchema } from \"./unsafeUnknownSchema.js\";\nimport type { InsertableContent } from \"./unhydratedFlexTreeFromInsertable.js\";\n\n/**\n * Kind of a field on an {@link TreeObjectNode}.\n * @remarks\n * More kinds may be added over time, so do not assume this is an exhaustive set.\n * See {@link FieldSchema} for where these are used, and {@link SchemaFactory} for how to create schema which use them.\n * @public\n */\nexport enum FieldKind {\n\t/**\n\t * A field which can be empty or filled.\n\t * @remarks\n\t * Allows 0 or one child.\n\t */\n\tOptional,\n\t/**\n\t * A field which must always be filled.\n\t * @remarks\n\t * Only allows exactly one child.\n\t */\n\tRequired,\n\t/**\n\t * A special readonly field used for node identifier strings.\n\t * @remarks\n\t * Only allows exactly one child.\n\t *\n\t * See {@link SchemaFactory.identifier} for more details.\n\t */\n\tIdentifier,\n}\n\n/**\n * Maps from a property key to its corresponding {@link FieldProps.key | stored key} for the provided\n * {@link ImplicitFieldSchema | field schema}.\n *\n * @remarks\n * If an explicit stored key was specified in the schema, it will be used.\n * Otherwise, the stored key is the same as the property key.\n */\nexport function getStoredKey(\n\tpropertyKey: string,\n\tfieldSchema: ImplicitAnnotatedFieldSchema,\n): FieldKey {\n\treturn brand(getExplicitStoredKey(fieldSchema) ?? propertyKey);\n}\n\n/**\n * Gets the {@link FieldProps.key | stored key} specified by the schema, if one was explicitly specified.\n * Otherwise, returns undefined.\n */\nexport function getExplicitStoredKey(\n\tfieldSchema: ImplicitAnnotatedFieldSchema,\n): string | undefined {\n\treturn fieldSchema instanceof FieldSchema ? fieldSchema.props?.key : undefined;\n}\n\n/**\n * Additional information to provide to a {@link FieldSchema}.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the field.\n * See {@link FieldSchemaMetadata.custom}.\n *\n * @public\n */\nexport interface FieldProps<TCustomMetadata = unknown> {\n\t/**\n\t * The unique identifier of a field, used in the persisted form of the tree.\n\t *\n\t * @remarks\n\t * If not explicitly set via the schema, this is the same as the schema's property key.\n\t *\n\t * Specifying a stored key that differs from the property key is particularly useful in refactoring scenarios.\n\t * To update the developer-facing API, while maintaining backwards compatibility with existing SharedTree data,\n\t * you can change the property key and specify the previous property key as the stored key.\n\t *\n\t * Notes:\n\t *\n\t * - Stored keys have no impact on standard JavaScript behavior, on tree nodes. For example, `Object.keys`\n\t * will always return the property keys specified in the schema, ignoring any stored keys that differ from\n\t * the property keys.\n\t *\n\t * - When specifying stored keys in an object schema, you must ensure that the final set of stored keys\n\t * (accounting for those implicitly derived from property keys) contains no duplicates.\n\t * This is validated at runtime.\n\t *\n\t * @example Refactoring code without breaking compatibility with existing data\n\t *\n\t * Consider some existing object schema:\n\t *\n\t * ```TypeScript\n\t * class Point extends schemaFactory.object(\"Point\", {\n\t * \txPosition: schemaFactory.number,\n\t * \tyPosition: schemaFactory.number,\n\t * \tzPosition: schemaFactory.optional(schemaFactory.number),\n\t * });\n\t * ```\n\t *\n\t * Developers using nodes of this type would access the the `xPosition` property as `point.xPosition`.\n\t *\n\t * We would like to refactor the schema to omit \"Position\" from the property keys, but application data has\n\t * already been persisted using the original property keys. To maintain compatibility with existing data,\n\t * we can refactor the schema as follows:\n\t *\n\t * ```TypeScript\n\t * class Point extends schemaFactory.object(\"Point\", {\n\t * \tx: schemaFactory.required(schemaFactory.number, { key: \"xPosition\" }),\n\t * \ty: schemaFactory.required(schemaFactory.number, { key: \"yPosition\" }),\n\t * \tz: schemaFactory.optional(schemaFactory.number, { key: \"zPosition\" }),\n\t * });\n\t * ```\n\t *\n\t * Now, developers can access the `x` property as `point.x`, while existing data can still be collaborated on.\n\t *\n\t * @defaultValue If not specified, the key that is persisted is the property key that was specified in the schema.\n\t */\n\treadonly key?: string;\n\n\t/**\n\t * A default provider used for fields which were not provided any values.\n\t * @privateRemarks\n\t * We are using an erased type here, as we want to expose this API but `InsertableContent` and `NodeKeyManager` are not public.\n\t */\n\treadonly defaultProvider?: DefaultProvider;\n\n\t/**\n\t * Optional metadata to associate with the field.\n\t *\n\t * @remarks\n\t * Note: this metadata is not persisted nor made part of the collaborative state; it is strictly client-local.\n\t * Different clients in the same collaborative session may see different metadata for the same field.\n\t */\n\treadonly metadata?: FieldSchemaMetadata<TCustomMetadata>;\n}\n\n/**\n * {@link FieldProps} extended with additional `alpha` options.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the field.\n * See {@link FieldSchemaMetadata.custom}.\n *\n * @alpha @input\n */\nexport interface FieldPropsAlpha<TCustomMetadata = unknown>\n\textends FieldProps<TCustomMetadata> {\n\t/**\n\t * The persisted metadata for this schema element.\n\t */\n\treadonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;\n}\n\n/**\n * A {@link FieldProvider} which requires additional context in order to produce its content\n */\nexport type ContextualFieldProvider = (\n\tcontext: FlexTreeHydratedContextMinimal | \"UseGlobalContext\",\n) => UnhydratedFlexTreeNode[];\n/**\n * A {@link FieldProvider} which can produce its content in a vacuum.\n */\nexport type ConstantFieldProvider = () => UnhydratedFlexTreeNode[];\n/**\n * A function which produces content for a field every time that it is called.\n */\nexport type FieldProvider = ContextualFieldProvider | ConstantFieldProvider;\n/**\n * Returns true if the given {@link FieldProvider} is a {@link ConstantFieldProvider}\n */\nexport function isConstant(\n\tfieldProvider: FieldProvider,\n): fieldProvider is ConstantFieldProvider {\n\treturn fieldProvider.length === 0;\n}\n\n/**\n * Provides a default value for a field.\n * @remarks\n * If present in a `FieldSchema`, when constructing new tree content that field can be omitted, and a default will be provided.\n * @system @sealed @public\n */\nexport interface DefaultProvider extends ErasedType<\"@fluidframework/tree.FieldProvider\"> {}\n\nexport function extractFieldProvider(input: DefaultProvider): FieldProvider {\n\treturn input as unknown as FieldProvider;\n}\n\nexport function getDefaultProvider(input: FieldProvider): DefaultProvider {\n\treturn input as unknown as DefaultProvider;\n}\n\n/**\n * Metadata associated with a {@link FieldSchema}.\n *\n * @remarks Specified via {@link FieldProps.metadata}.\n *\n * @sealed\n * @public\n */\nexport interface FieldSchemaMetadata<TCustomMetadata = unknown> {\n\t/**\n\t * User-defined metadata.\n\t */\n\treadonly custom?: TCustomMetadata;\n\n\t/**\n\t * The description of the field.\n\t *\n\t * @remarks\n\t *\n\t * If provided, will be used by the system in scenarios where a description of the field is useful.\n\t * E.g., when converting a field schema to {@link https://json-schema.org/ | JSON Schema}, this description will be\n\t * used as the `description` field.\n\t */\n\treadonly description?: string | undefined;\n}\n\n/**\n * Metadata associated with a {@link FieldSchema}. Includes fields used by alpha features.\n *\n * @remarks Specified via {@link FieldProps.metadata}.\n *\n * @sealed\n * @alpha\n */\nexport interface FieldSchemaMetadataAlpha<TCustomMetadata = unknown>\n\textends FieldSchemaMetadata<TCustomMetadata> {\n\t/**\n\t * The persisted metadata for this schema element.\n\t */\n\treadonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;\n}\n\n/**\n * Package internal construction API.\n */\nexport function createFieldSchema<\n\tKind extends FieldKind,\n\tTypes extends ImplicitAllowedTypes,\n\tTCustomMetadata = unknown,\n>(\n\tkind: Kind,\n\tannotatedTypes: Types,\n\tprops?: FieldProps<TCustomMetadata>,\n): FieldSchemaAlpha<Kind, Types, TCustomMetadata>;\n\n/**\n * Package internal construction API that supports annotations for allowed types.\n */\nexport function createFieldSchema<\n\tKind extends FieldKind,\n\tTypes extends ImplicitAnnotatedAllowedTypes,\n\tTCustomMetadata = unknown,\n>(\n\tkind: Kind,\n\tannotatedTypes: Types,\n\tprops?: FieldProps<TCustomMetadata>,\n): FieldSchemaAlpha<Kind, UnannotateImplicitAllowedTypes<Types>, TCustomMetadata>;\n\nexport function createFieldSchema<\n\tKind extends FieldKind,\n\tTypes extends ImplicitAnnotatedAllowedTypes,\n\tTCustomMetadata = unknown,\n>(\n\tkind: Kind,\n\tannotatedTypes: Types,\n\tprops?: FieldProps<TCustomMetadata>,\n): FieldSchemaAlpha<Kind, UnannotateImplicitAllowedTypes<Types>, TCustomMetadata> {\n\treturn createFieldSchemaPrivate(kind, annotatedTypes, props);\n}\n\n/**\n * Implementation for {@link createFieldSchema}\n */\nlet createFieldSchemaPrivate: <\n\tKind extends FieldKind,\n\tTypes extends ImplicitAnnotatedAllowedTypes,\n\tTCustomMetadata,\n>(\n\tkind: Kind,\n\tannotatedTypes: Types,\n\tprops?: FieldProps<TCustomMetadata>,\n) => FieldSchemaAlpha<Kind, UnannotateImplicitAllowedTypes<Types>, TCustomMetadata>;\n\n/**\n * All policy for a specific field,\n * including functionality that does not have to be kept consistent across versions or deterministic.\n *\n * This can include policy for how to use this schema for \"view\" purposes, and well as how to expose editing APIs.\n * Use {@link SchemaFactory} to create the FieldSchema instances, for example {@link SchemaStatics.optional}.\n * @privateRemarks\n * Public access to the constructor is removed to prevent creating expressible but unsupported (or not stable) configurations.\n * {@link createFieldSchema} can be used internally to create instances.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the field.\n * See {@link FieldSchemaMetadata.custom}.\n *\n * @remarks\n * All implementations of this are actually {@link FieldSchemaAlpha} which exposes some additional alpha APIs.\n *\n * @sealed @public\n */\nexport class FieldSchema<\n\tout Kind extends FieldKind = FieldKind,\n\tout Types extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\tout TCustomMetadata = unknown,\n> {\n\t/**\n\t * This class is used with instanceof, and therefore should have nominal typing.\n\t * This field enforces that.\n\t */\n\tprotected _typeCheck!: MakeNominal;\n\n\tprivate readonly lazyTypes: Lazy<ReadonlySet<TreeNodeSchema>>;\n\n\t/**\n\t * What types of tree nodes are allowed in this field.\n\t * @remarks Counterpart to {@link FieldSchema.allowedTypes}, with any lazy definitions evaluated.\n\t */\n\tpublic get allowedTypeSet(): ReadonlySet<TreeNodeSchema> {\n\t\treturn this.lazyTypes.value;\n\t}\n\n\t/**\n\t * True if and only if, when constructing a node with this field, a value must be provided for it.\n\t */\n\tpublic readonly requiresValue: boolean;\n\n\t/**\n\t * {@inheritDoc FieldProps.metadata}\n\t */\n\tpublic get metadata(): FieldSchemaMetadata<TCustomMetadata> {\n\t\treturn this.props?.metadata ?? {};\n\t}\n\n\t/**\n\t * This class is `@sealed`: protected members like this constructor are for internal use only.\n\t * Use {@link SchemaFactory} to create the FieldSchema instances.\n\t */\n\tprotected constructor(\n\t\t/**\n\t\t * The {@link https://en.wikipedia.org/wiki/Kind_(type_theory) | kind } of this field.\n\t\t * Determines the multiplicity, viewing and editing APIs as well as the merge resolution policy.\n\t\t */\n\t\tpublic readonly kind: Kind,\n\t\t/**\n\t\t * What types of tree nodes are allowed in this field.\n\t\t */\n\t\tpublic readonly allowedTypes: Types,\n\t\t/**\n\t\t * Optional properties associated with the field.\n\t\t */\n\t\tpublic readonly props?: FieldProps<TCustomMetadata>,\n\t) {\n\t\tif (!(this instanceof FieldSchemaAlpha)) {\n\t\t\tthrow new UsageError(\"FieldSchema is @sealed: sub-classing is not allowed.\");\n\t\t}\n\n\t\tthis.lazyTypes = new Lazy(() => normalizeAllowedTypes(this.allowedTypes));\n\t\t// TODO: optional fields should (by default) get a default provider that returns undefined, removing the need to special case them here:\n\t\tthis.requiresValue =\n\t\t\tthis.props?.defaultProvider === undefined && this.kind !== FieldKind.Optional;\n\t}\n}\n\n/**\n * {@link FieldSchema} including alpha APIs (currently {@link SimpleFieldSchema}).\n * @remarks\n * This class will go away once the alpha APIs are stable and implemented by {@link FieldSchema}.\n * @sealed @alpha\n */\nexport class FieldSchemaAlpha<\n\t\tKind extends FieldKind = FieldKind,\n\t\tTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTCustomMetadata = unknown,\n\t>\n\textends FieldSchema<Kind, Types, TCustomMetadata>\n\timplements SimpleFieldSchema\n{\n\tprivate readonly lazyIdentifiers: Lazy<ReadonlySet<string>>;\n\tprivate readonly lazyAnnotatedTypes: Lazy<NormalizedAnnotatedAllowedTypes>;\n\tprivate readonly propsAlpha: FieldPropsAlpha<TCustomMetadata> | undefined;\n\n\t/**\n\t * Metadata on the types of tree nodes allowed on this field.\n\t */\n\tpublic readonly allowedTypesMetadata: AllowedTypesMetadata;\n\n\t/**\n\t * Persisted metadata for this field schema.\n\t */\n\tpublic get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined {\n\t\treturn this.propsAlpha?.persistedMetadata;\n\t}\n\n\tstatic {\n\t\tcreateFieldSchemaPrivate = <\n\t\t\tKind2 extends FieldKind,\n\t\t\tTypes2 extends ImplicitAnnotatedAllowedTypes,\n\t\t\tTCustomMetadata2,\n\t\t>(\n\t\t\tkind: Kind2,\n\t\t\tannotatedAllowedTypes: Types2,\n\t\t\tprops?: FieldPropsAlpha<TCustomMetadata2>,\n\t\t) =>\n\t\t\tnew FieldSchemaAlpha(\n\t\t\t\tkind,\n\t\t\t\tunannotateImplicitAllowedTypes(annotatedAllowedTypes),\n\t\t\t\tannotatedAllowedTypes,\n\t\t\t\tprops,\n\t\t\t);\n\t}\n\n\tprotected constructor(\n\t\tkind: Kind,\n\t\ttypes: Types,\n\t\tpublic readonly annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes,\n\t\tprops?: FieldPropsAlpha<TCustomMetadata>,\n\t) {\n\t\tsuper(kind, types, props);\n\n\t\tthis.allowedTypesMetadata = isAnnotatedAllowedTypes(annotatedAllowedTypes)\n\t\t\t? annotatedAllowedTypes.metadata\n\t\t\t: {};\n\t\tthis.lazyAnnotatedTypes = new Lazy(() =>\n\t\t\tnormalizeAnnotatedAllowedTypes(annotatedAllowedTypes),\n\t\t);\n\t\tthis.lazyIdentifiers = new Lazy(\n\t\t\t() => new Set([...this.allowedTypeSet].map((t) => t.identifier)),\n\t\t);\n\t\tthis.propsAlpha = props;\n\t}\n\n\tpublic get allowedTypesIdentifiers(): ReadonlySet<string> {\n\t\treturn this.lazyIdentifiers.value;\n\t}\n\n\t/**\n\t * What types of tree nodes are allowed in this field and their annotations.\n\t * @remarks Counterpart to {@link FieldSchemaAlpha.annotatedAllowedTypes}, with any lazy definitions evaluated.\n\t */\n\tpublic get annotatedAllowedTypesNormalized(): NormalizedAnnotatedAllowedTypes {\n\t\treturn this.lazyAnnotatedTypes.value;\n\t}\n}\n\n/**\n * Normalizes a {@link ImplicitFieldSchema} or {@link ImplicitAnnotatedFieldSchema} to a {@link FieldSchema}.\n */\nexport function normalizeFieldSchema(\n\tschema: ImplicitFieldSchema | ImplicitAnnotatedFieldSchema,\n): FieldSchemaAlpha {\n\treturn schema instanceof FieldSchema\n\t\t? (schema as FieldSchemaAlpha)\n\t\t: createFieldSchema(FieldKind.Required, schema);\n}\n\n/**\n * Returns true if the given {@link ImplicitFieldSchema} are equivalent, otherwise false.\n * @remarks Two ImplicitFieldSchema are considered equivalent if all of the following are true:\n * 1. They have the same {@link FieldKind | kinds}.\n * 2. They have {@link areFieldPropsEqual | equivalent FieldProps}.\n * 3. They have the same exact set of allowed types. The allowed types must be (respectively) reference equal.\n *\n * For example, comparing an ImplicitFieldSchema that is a {@link TreeNodeSchema} to an ImplicitFieldSchema that is a {@link FieldSchema}\n * will return true if they are the same kind, the FieldSchema has exactly one allowed type (the TreeNodeSchema), and they have equivalent FieldProps.\n */\nexport function areImplicitFieldSchemaEqual(\n\ta: ImplicitFieldSchema,\n\tb: ImplicitFieldSchema,\n): boolean {\n\treturn areFieldSchemaEqual(normalizeFieldSchema(a), normalizeFieldSchema(b));\n}\n\n/**\n * Returns true if the given {@link FieldSchema} are equivalent, otherwise false.\n * @remarks Two FieldSchema are considered equivalent if all of the following are true:\n * 1. They have the same {@link FieldKind | kinds}.\n * 2. They have {@link areFieldPropsEqual | equivalent FieldProps}.\n * 3. They have the same exact set of allowed types. The allowed types must be reference equal.\n */\nexport function areFieldSchemaEqual(a: FieldSchema, b: FieldSchema): boolean {\n\tif (a === b) {\n\t\treturn true;\n\t}\n\n\tif (a.kind !== b.kind) {\n\t\treturn false;\n\t}\n\n\tif (!areFieldPropsEqual(a.props, b.props)) {\n\t\treturn false;\n\t}\n\n\treturn compareSets({ a: a.allowedTypeSet, b: b.allowedTypeSet });\n}\n\n/**\n * Returns true if the given {@link FieldProps} are equivalent, otherwise false.\n * @remarks FieldProps are considered equivalent if their keys and default providers are reference equal, and their metadata are {@link areMetadataEqual | equivalent}.\n */\nfunction areFieldPropsEqual(a: FieldProps | undefined, b: FieldProps | undefined): boolean {\n\t// If any new fields are added to FieldProps, this check will stop compiling as a reminder that this function needs to be updated.\n\ttype _keys = requireTrue<areOnlyKeys<FieldProps, \"key\" | \"defaultProvider\" | \"metadata\">>;\n\n\tif (a === b) {\n\t\treturn true;\n\t}\n\n\tif (a?.key !== b?.key || a?.defaultProvider !== b?.defaultProvider) {\n\t\treturn false;\n\t}\n\n\tif (!areMetadataEqual(a?.metadata, b?.metadata)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns true if the given {@link FieldSchemaMetadata} are equivalent, otherwise false.\n * @remarks FieldSchemaMetadata are considered equivalent if their custom data and descriptions are (respectively) reference equal.\n */\nfunction areMetadataEqual(\n\ta: FieldSchemaMetadataAlpha | undefined,\n\tb: FieldSchemaMetadataAlpha | undefined,\n): boolean {\n\t// If any new fields are added to FieldSchemaMetadata, this check will stop compiling as a reminder that this function needs to be updated.\n\ttype _keys = requireTrue<\n\t\tareOnlyKeys<FieldSchemaMetadataAlpha, \"custom\" | \"description\" | \"persistedMetadata\">\n\t>;\n\n\tif (a === b) {\n\t\treturn true;\n\t}\n\n\treturn (\n\t\tObject.is(a?.custom, b?.custom) &&\n\t\ta?.description === b?.description &&\n\t\tarePersistedMetadataEqual(a?.persistedMetadata, b?.persistedMetadata)\n\t);\n}\n\n/**\n * Returns true if the given persisted metadata fields are equivalent, otherwise false.\n * @remarks\n * Currently only handles shallow equality in the case where the keys are in the same order. This is acceptable for current use cases.\n */\nfunction arePersistedMetadataEqual(\n\ta: JsonCompatibleReadOnlyObject | undefined,\n\tb: JsonCompatibleReadOnlyObject | undefined,\n): boolean {\n\tif (Object.is(a, b)) {\n\t\treturn true;\n\t}\n\n\tif (a === undefined || b === undefined) {\n\t\treturn false;\n\t}\n\n\t// Note that the key order matters. If `a` and `b` have the same content but the keys are in a different order,\n\t// this method will return false.\n\tconst aStringified = JSON.stringify(a);\n\tconst bStringified = JSON.stringify(b);\n\n\treturn aStringified === bStringified;\n}\n\n/**\n * Schema for a field of a tree node.\n * @remarks\n * Implicitly treats {@link ImplicitAllowedTypes} as a Required field of that type.\n * @public\n */\nexport type ImplicitFieldSchema = FieldSchema | ImplicitAllowedTypes;\n\n/**\n * Annotated schema for a field of a tree node.\n * @alpha\n */\nexport type ImplicitAnnotatedFieldSchema = FieldSchema | ImplicitAnnotatedAllowedTypes;\n\n/**\n * Removes annotations from an annotated field schema.\n * @system @alpha\n */\nexport type UnannotateImplicitFieldSchema<T extends ImplicitAnnotatedFieldSchema> =\n\tT extends ImplicitAnnotatedAllowedTypes ? UnannotateImplicitAllowedTypes<T> : T;\n\n/**\n * Converts an `ImplicitFieldSchema` to a property type suitable for reading a field with this that schema.\n *\n * @typeparam TSchema - When non-exact schema are provided this errors on the side of returning too general of a type (a conservative union of all possibilities).\n * This is ideal for \"output APIs\" - i.e. it converts the schema type to the runtime type that a user will _read_ from the tree.\n * Examples of such \"non-exact\" schema include `ImplicitFieldSchema`, `ImplicitAllowedTypes`, and TypeScript unions of schema types.\n * @public\n */\nexport type TreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = FieldSchema> =\n\tTSchema extends FieldSchema<infer Kind, infer Types>\n\t\t? ApplyKind<TreeNodeFromImplicitAllowedTypes<Types>, Kind>\n\t\t: TSchema extends ImplicitAllowedTypes\n\t\t\t? TreeNodeFromImplicitAllowedTypes<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined;\n\n/**\n * Type of content that can be inserted into the tree for a field of the given schema.\n *\n * @see {@link Input}\n *\n * @typeparam TSchemaInput - Schema to process.\n * @typeparam TSchema - Do not specify: default value used as implementation detail.\n * @public\n */\nexport type InsertableTreeFieldFromImplicitField<\n\tTSchemaInput extends ImplicitFieldSchema,\n\tTSchema = UnionToIntersection<TSchemaInput>,\n> = [TSchema] extends [FieldSchema<infer Kind, infer Types>]\n\t? ApplyKindInput<InsertableTreeNodeFromImplicitAllowedTypes<Types>, Kind, true>\n\t: [TSchema] extends [ImplicitAllowedTypes]\n\t\t? InsertableTreeNodeFromImplicitAllowedTypes<TSchema>\n\t\t: never;\n\n/**\n * Content which could be inserted into a field within a tree.\n *\n * @see {@link Input}\n * @remarks\n * Extended version of {@link InsertableTreeFieldFromImplicitField} that also allows {@link (UnsafeUnknownSchema:type)}.\n * @alpha\n */\nexport type InsertableField<TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> = [\n\tTSchema,\n] extends [ImplicitFieldSchema]\n\t? InsertableTreeFieldFromImplicitField<TSchema>\n\t: [TSchema] extends [UnsafeUnknownSchema]\n\t\t? InsertableContent | undefined\n\t\t: never;\n\n/**\n * Content which could be read from a field within a tree.\n *\n * @remarks\n * Extended version of {@link TreeFieldFromImplicitField} that also allows {@link (UnsafeUnknownSchema:type)}.\n * Since reading from fields with non-exact schema is still safe, this is only useful (compared to {@link TreeFieldFromImplicitField}) when the schema is also used as input and thus allows {@link (UnsafeUnknownSchema:type)}\n * for use\n * @system @alpha\n */\nexport type ReadableField<TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> =\n\tTreeFieldFromImplicitField<ReadSchema<TSchema>>;\n\n/**\n * Adapter to remove {@link (UnsafeUnknownSchema:type)} from a schema type so it can be used with types for generating APIs for reading data.\n *\n * @remarks\n * Since reading with non-exact schema is still safe, this is mainly useful when the schema is also used as input and thus allows {@link (UnsafeUnknownSchema:type)}.\n * @system @alpha\n */\nexport type ReadSchema<TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> = [\n\tTSchema,\n] extends [ImplicitFieldSchema]\n\t? TSchema\n\t: ImplicitFieldSchema;\n\n/**\n * Suitable for output.\n * For input must error on side of excluding undefined instead.\n * @system @public\n */\nexport type ApplyKind<T, Kind extends FieldKind> = {\n\t[FieldKind.Required]: T;\n\t[FieldKind.Optional]: T | undefined;\n\t[FieldKind.Identifier]: T;\n}[Kind];\n\n/**\n * Suitable for input.\n *\n * @see {@link Input}\n * @system @public\n */\nexport type ApplyKindInput<T, Kind extends FieldKind, DefaultsAreOptional extends boolean> = [\n\tKind,\n] extends [FieldKind.Required]\n\t? T\n\t: [Kind] extends [FieldKind.Optional]\n\t\t? T | undefined\n\t\t: [Kind] extends [FieldKind.Identifier]\n\t\t\t? DefaultsAreOptional extends true\n\t\t\t\t? T | undefined\n\t\t\t\t: T\n\t\t\t: never;\n"]}
@@ -2,16 +2,16 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { typeNameSymbol, typeSchemaSymbol, type WithType, type TreeNodeSchema, type AnnotatedAllowedType, type NormalizedAnnotatedAllowedTypes, NodeKind, type TreeNodeSchemaClass, type TreeNodeSchemaNonClass, type TreeNodeSchemaCore, type TreeNode, type Unhydrated, type InternalTreeNode, isTreeNode, tryDisposeTreeNode, HydratedContext, SimpleContextSlot, getOrCreateInnerNode, getOrCreateNodeFromInnerNode, getOrCreateNodeFromInnerUnboxedNode, getKernel, } from "./core/index.js";
6
- export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, TreeViewConfigurationAlpha, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, SchemaFactoryAlpha, type SchemaFactoryObjectOptions, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, treeNodeApi, type TreeNodeApi, type NodeChangedData, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, type TreeSchemaEncodingOptions, getJsonSchema, getSimpleSchema, type VerboseTreeNode, type TreeEncodingOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, SchemaCompatibilityTester, type Unenforced, type System_Unsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type TreeViewAlpha, type TreeBranch, type TreeBranchEvents, getPropertyKeyFromStoredKey, getStoredKey, tryGetSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, conciseFromCursor, createFromCursor, asTreeViewAlpha, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type FieldSchemaAlphaUnsafe, getIdentifierFromNode, type TreeSchema, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, schemaStatics, type TreeChangeEvents, } from "./api/index.js";
5
+ export { typeNameSymbol, typeSchemaSymbol, type WithType, type TreeNodeSchema, type AnnotatedAllowedType, type NormalizedAnnotatedAllowedTypes, NodeKind, type TreeNodeSchemaClass, type TreeNodeSchemaNonClass, type TreeNodeSchemaCore, type TreeNode, type Unhydrated, type InternalTreeNode, isTreeNode, tryDisposeTreeNode, HydratedContext, SimpleContextSlot, getOrCreateInnerNode, getOrCreateNodeFromInnerNode, getOrCreateNodeFromInnerUnboxedNode, getKernel, type NodeFromSchema, isTreeNodeSchemaClass, type TreeNodeFromImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, type AllowedTypes, type InsertableTreeNodeFromAllowedTypes, type InsertableTypedNode, type NodeBuilderData, type Input, normalizeAllowedTypes, type NodeSchemaMetadata, type ImplicitAllowedTypes, type ImplicitAnnotatedAllowedTypes, type UnannotateImplicitAllowedTypes, type AllowedTypesMetadata, evaluateLazySchema, type UnannotateAllowedTypes, type UnannotateAllowedType, type UnannotateAllowedTypesList, type UnannotateAllowedTypeOrLazyItem, type AllowedTypeMetadata, type AnnotatedAllowedTypes, type LazyItem, type FlexList, type FlexListToUnion, type ExtractItemType, } from "./core/index.js";
6
+ export type { UnsafeUnknownSchema, Insertable } from "./unsafeUnknownSchema.js";
7
+ export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, TreeViewConfigurationAlpha, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, SchemaFactoryAlpha, type SchemaFactoryObjectOptions, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, treeNodeApi, type TreeNodeApi, type NodeChangedData, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, type TreeSchemaEncodingOptions, getJsonSchema, getSimpleSchema, type VerboseTreeNode, type TreeEncodingOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, SchemaCompatibilityTester, type Unenforced, type System_Unsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type TreeViewAlpha, type TreeBranch, type TreeBranchEvents, getPropertyKeyFromStoredKey, getStoredKey, tryGetSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, conciseFromCursor, createFromCursor, asTreeViewAlpha, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type FieldSchemaAlphaUnsafe, getIdentifierFromNode, type TreeSchema, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, schemaStatics, type TreeChangeEvents, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, } from "./api/index.js";
7
8
  export type { SimpleTreeSchema, SimpleNodeSchema, SimpleFieldSchema, SimpleLeafNodeSchema, SimpleMapNodeSchema, SimpleArrayNodeSchema, SimpleObjectNodeSchema, SimpleNodeSchemaBase, SimpleNodeSchemaBaseAlpha, SimpleObjectFieldSchema, SimpleRecordNodeSchema, } from "./simpleSchema.js";
8
- export { type NodeFromSchema, isTreeNodeSchemaClass, type ImplicitFieldSchema, type ImplicitAnnotatedFieldSchema, type TreeFieldFromImplicitField, type ImplicitAllowedTypes, type ImplicitAnnotatedAllowedTypes, type UnannotateImplicitAllowedTypes, type UnannotateAllowedTypes, type UnannotateAllowedType, type UnannotateAllowedTypesList, type UnannotateAllowedTypeOrLazyItem, type UnannotateImplicitFieldSchema, type UnannotateSchemaRecord, type TreeNodeFromImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, type AllowedTypes, type AllowedTypeMetadata, type AllowedTypesMetadata, type AnnotatedAllowedTypes, FieldKind, FieldSchema, type FieldSchemaAlpha, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, type NodeBuilderData, type DefaultProvider, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, areFieldSchemaEqual, areImplicitFieldSchemaEqual, type ApplyKind, type FieldSchemaMetadata, type InsertableField, type Insertable, type UnsafeUnknownSchema, normalizeAllowedTypes, type ApplyKindInput, type InsertableTreeNodeFromAllowedTypes, type Input, type ReadableField, type ReadSchema, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, type NodeSchemaMetadata, evaluateLazySchema, } from "./schemaTypes.js";
9
+ export { type ImplicitFieldSchema, type ImplicitAnnotatedFieldSchema, type TreeFieldFromImplicitField, type UnannotateImplicitFieldSchema, FieldKind, FieldSchema, type FieldSchemaAlpha, type InsertableTreeFieldFromImplicitField, type DefaultProvider, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, areFieldSchemaEqual, areImplicitFieldSchemaEqual, type ApplyKind, type FieldSchemaMetadata, type InsertableField, type ApplyKindInput, type ReadableField, type ReadSchema, } from "./fieldSchema.js";
9
10
  export { tryGetTreeNodeForField } from "./getTreeNodeForField.js";
10
- export { type ArrayNodeCustomizableSchema, type ArrayNodePojoEmulationSchema, ArrayNodeSchema, asIndex, isArrayNodeSchema, IterableTreeArrayContent, type ReadonlyArrayNode, TreeArrayNode, type MapNodeCustomizableSchema, type MapNodePojoEmulationSchema, MapNodeSchema, isMapNodeSchema, type TreeMapNode, type MapNodeInsertableData, type FieldHasDefault, type InsertableObjectFromSchemaRecord, type ObjectFromSchemaRecord, ObjectNodeSchema, type ObjectNodeSchemaPrivate, isObjectNodeSchema, type InsertableObjectFromAnnotatedSchemaRecord, type TreeObjectNode, setField, createUnknownOptionalFieldPolicy, isRecordNodeSchema, type RecordNodeCustomizableSchema, type RecordNodeInsertableData, type RecordNodePojoEmulationSchema, RecordNodeSchema, type TreeRecordNode, } from "./node-kinds/index.js";
11
+ export { type ArrayNodeCustomizableSchema, type ArrayNodePojoEmulationSchema, ArrayNodeSchema, asIndex, isArrayNodeSchema, IterableTreeArrayContent, type ReadonlyArrayNode, TreeArrayNode, type MapNodeCustomizableSchema, type MapNodePojoEmulationSchema, MapNodeSchema, isMapNodeSchema, type TreeMapNode, type MapNodeInsertableData, type FieldHasDefault, type InsertableObjectFromSchemaRecord, type ObjectFromSchemaRecord, ObjectNodeSchema, type ObjectNodeSchemaPrivate, isObjectNodeSchema, type InsertableObjectFromAnnotatedSchemaRecord, type TreeObjectNode, setField, createUnknownOptionalFieldPolicy, isRecordNodeSchema, type RecordNodeCustomizableSchema, type RecordNodeInsertableData, type RecordNodePojoEmulationSchema, RecordNodeSchema, type TreeRecordNode, type UnannotateSchemaRecord, } from "./node-kinds/index.js";
11
12
  export { unhydratedFlexTreeFromInsertable, type InsertableContent, type FactoryContent, type FactoryContentObject, } from "./unhydratedFlexTreeFromInsertable.js";
12
13
  export { prepareForInsertion, prepareForInsertionContextless, } from "./prepareForInsertion.js";
13
14
  export { toStoredSchema, getStoredSchema } from "./toStoredSchema.js";
14
15
  export { numberSchema, stringSchema, booleanSchema, handleSchema, nullSchema, } from "./leafNodeSchema.js";
15
16
  export type { LeafSchema } from "./leafNodeSchema.js";
16
- export type { LazyItem, FlexList, FlexListToUnion, ExtractItemType } from "./flexList.js";
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,+BAA+B,EACpC,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EAGvB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,4BAA4B,EAC5B,mCAAmC,EACnC,SAAS,GACT,MAAM,iBAAiB,CAAC;AACzB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B,CAAC;AAClE,OAAO,EACN,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,wBAAwB,EACxB,KAAK,iBAAiB,EACtB,aAAa,EACb,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,aAAa,EACb,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,kBAAkB,EAClB,KAAK,yCAAyC,EAC9C,KAAK,cAAc,EACnB,QAAQ,EACR,gCAAgC,EAChC,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,gCAAgC,EAChC,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,mBAAmB,EACnB,8BAA8B,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,GACV,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
@@ -4,8 +4,8 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.normalizeFieldSchema = exports.FieldSchema = exports.FieldKind = exports.isTreeNodeSchemaClass = exports.schemaStatics = exports.getIdentifierFromNode = exports.allowUnused = exports.replaceVerboseTreeHandles = exports.replaceHandles = exports.replaceConciseTreeHandles = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.asTreeViewAlpha = exports.createFromCursor = exports.conciseFromCursor = exports.verboseFromCursor = exports.cursorFromVerbose = exports.applySchemaToParserOptions = exports.tryGetSchema = exports.getStoredKey = exports.getPropertyKeyFromStoredKey = exports.SchemaCompatibilityTester = exports.comparePersistedSchema = exports.extractPersistedSchema = exports.getSimpleSchema = exports.getJsonSchema = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.TreeBeta = exports.treeNodeApi = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.TreeViewConfigurationAlpha = exports.TreeViewConfiguration = exports.getKernel = exports.getOrCreateNodeFromInnerUnboxedNode = exports.getOrCreateNodeFromInnerNode = exports.getOrCreateInnerNode = exports.SimpleContextSlot = exports.HydratedContext = exports.tryDisposeTreeNode = exports.isTreeNode = exports.NodeKind = exports.typeSchemaSymbol = exports.typeNameSymbol = void 0;
8
- exports.nullSchema = exports.handleSchema = exports.booleanSchema = exports.stringSchema = exports.numberSchema = exports.getStoredSchema = exports.toStoredSchema = exports.prepareForInsertionContextless = exports.prepareForInsertion = exports.unhydratedFlexTreeFromInsertable = exports.RecordNodeSchema = exports.isRecordNodeSchema = exports.createUnknownOptionalFieldPolicy = exports.setField = exports.isObjectNodeSchema = exports.ObjectNodeSchema = exports.isMapNodeSchema = exports.MapNodeSchema = exports.TreeArrayNode = exports.IterableTreeArrayContent = exports.isArrayNodeSchema = exports.asIndex = exports.ArrayNodeSchema = exports.tryGetTreeNodeForField = exports.evaluateLazySchema = exports.normalizeAllowedTypes = exports.areImplicitFieldSchemaEqual = exports.areFieldSchemaEqual = void 0;
7
+ exports.FieldKind = exports.schemaStatics = exports.getIdentifierFromNode = exports.allowUnused = exports.replaceVerboseTreeHandles = exports.replaceHandles = exports.replaceConciseTreeHandles = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.asTreeViewAlpha = exports.createFromCursor = exports.conciseFromCursor = exports.verboseFromCursor = exports.cursorFromVerbose = exports.applySchemaToParserOptions = exports.tryGetSchema = exports.getStoredKey = exports.getPropertyKeyFromStoredKey = exports.SchemaCompatibilityTester = exports.comparePersistedSchema = exports.extractPersistedSchema = exports.getSimpleSchema = exports.getJsonSchema = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.TreeBeta = exports.treeNodeApi = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.TreeViewConfigurationAlpha = exports.TreeViewConfiguration = exports.evaluateLazySchema = exports.normalizeAllowedTypes = exports.isTreeNodeSchemaClass = exports.getKernel = exports.getOrCreateNodeFromInnerUnboxedNode = exports.getOrCreateNodeFromInnerNode = exports.getOrCreateInnerNode = exports.SimpleContextSlot = exports.HydratedContext = exports.tryDisposeTreeNode = exports.isTreeNode = exports.NodeKind = exports.typeSchemaSymbol = exports.typeNameSymbol = void 0;
8
+ exports.nullSchema = exports.handleSchema = exports.booleanSchema = exports.stringSchema = exports.numberSchema = exports.getStoredSchema = exports.toStoredSchema = exports.prepareForInsertionContextless = exports.prepareForInsertion = exports.unhydratedFlexTreeFromInsertable = exports.RecordNodeSchema = exports.isRecordNodeSchema = exports.createUnknownOptionalFieldPolicy = exports.setField = exports.isObjectNodeSchema = exports.ObjectNodeSchema = exports.isMapNodeSchema = exports.MapNodeSchema = exports.TreeArrayNode = exports.IterableTreeArrayContent = exports.isArrayNodeSchema = exports.asIndex = exports.ArrayNodeSchema = exports.tryGetTreeNodeForField = exports.areImplicitFieldSchemaEqual = exports.areFieldSchemaEqual = exports.normalizeFieldSchema = exports.FieldSchema = void 0;
9
9
  var index_js_1 = require("./core/index.js");
10
10
  Object.defineProperty(exports, "typeNameSymbol", { enumerable: true, get: function () { return index_js_1.typeNameSymbol; } });
11
11
  Object.defineProperty(exports, "typeSchemaSymbol", { enumerable: true, get: function () { return index_js_1.typeSchemaSymbol; } });
@@ -18,6 +18,9 @@ Object.defineProperty(exports, "getOrCreateInnerNode", { enumerable: true, get:
18
18
  Object.defineProperty(exports, "getOrCreateNodeFromInnerNode", { enumerable: true, get: function () { return index_js_1.getOrCreateNodeFromInnerNode; } });
19
19
  Object.defineProperty(exports, "getOrCreateNodeFromInnerUnboxedNode", { enumerable: true, get: function () { return index_js_1.getOrCreateNodeFromInnerUnboxedNode; } });
20
20
  Object.defineProperty(exports, "getKernel", { enumerable: true, get: function () { return index_js_1.getKernel; } });
21
+ Object.defineProperty(exports, "isTreeNodeSchemaClass", { enumerable: true, get: function () { return index_js_1.isTreeNodeSchemaClass; } });
22
+ Object.defineProperty(exports, "normalizeAllowedTypes", { enumerable: true, get: function () { return index_js_1.normalizeAllowedTypes; } });
23
+ Object.defineProperty(exports, "evaluateLazySchema", { enumerable: true, get: function () { return index_js_1.evaluateLazySchema; } });
21
24
  var index_js_2 = require("./api/index.js");
22
25
  Object.defineProperty(exports, "TreeViewConfiguration", { enumerable: true, get: function () { return index_js_2.TreeViewConfiguration; } });
23
26
  Object.defineProperty(exports, "TreeViewConfigurationAlpha", { enumerable: true, get: function () { return index_js_2.TreeViewConfigurationAlpha; } });
@@ -54,15 +57,12 @@ Object.defineProperty(exports, "replaceVerboseTreeHandles", { enumerable: true,
54
57
  Object.defineProperty(exports, "allowUnused", { enumerable: true, get: function () { return index_js_2.allowUnused; } });
55
58
  Object.defineProperty(exports, "getIdentifierFromNode", { enumerable: true, get: function () { return index_js_2.getIdentifierFromNode; } });
56
59
  Object.defineProperty(exports, "schemaStatics", { enumerable: true, get: function () { return index_js_2.schemaStatics; } });
57
- var schemaTypes_js_1 = require("./schemaTypes.js");
58
- Object.defineProperty(exports, "isTreeNodeSchemaClass", { enumerable: true, get: function () { return schemaTypes_js_1.isTreeNodeSchemaClass; } });
59
- Object.defineProperty(exports, "FieldKind", { enumerable: true, get: function () { return schemaTypes_js_1.FieldKind; } });
60
- Object.defineProperty(exports, "FieldSchema", { enumerable: true, get: function () { return schemaTypes_js_1.FieldSchema; } });
61
- Object.defineProperty(exports, "normalizeFieldSchema", { enumerable: true, get: function () { return schemaTypes_js_1.normalizeFieldSchema; } });
62
- Object.defineProperty(exports, "areFieldSchemaEqual", { enumerable: true, get: function () { return schemaTypes_js_1.areFieldSchemaEqual; } });
63
- Object.defineProperty(exports, "areImplicitFieldSchemaEqual", { enumerable: true, get: function () { return schemaTypes_js_1.areImplicitFieldSchemaEqual; } });
64
- Object.defineProperty(exports, "normalizeAllowedTypes", { enumerable: true, get: function () { return schemaTypes_js_1.normalizeAllowedTypes; } });
65
- Object.defineProperty(exports, "evaluateLazySchema", { enumerable: true, get: function () { return schemaTypes_js_1.evaluateLazySchema; } });
60
+ var fieldSchema_js_1 = require("./fieldSchema.js");
61
+ Object.defineProperty(exports, "FieldKind", { enumerable: true, get: function () { return fieldSchema_js_1.FieldKind; } });
62
+ Object.defineProperty(exports, "FieldSchema", { enumerable: true, get: function () { return fieldSchema_js_1.FieldSchema; } });
63
+ Object.defineProperty(exports, "normalizeFieldSchema", { enumerable: true, get: function () { return fieldSchema_js_1.normalizeFieldSchema; } });
64
+ Object.defineProperty(exports, "areFieldSchemaEqual", { enumerable: true, get: function () { return fieldSchema_js_1.areFieldSchemaEqual; } });
65
+ Object.defineProperty(exports, "areImplicitFieldSchemaEqual", { enumerable: true, get: function () { return fieldSchema_js_1.areImplicitFieldSchemaEqual; } });
66
66
  var getTreeNodeForField_js_1 = require("./getTreeNodeForField.js");
67
67
  Object.defineProperty(exports, "tryGetTreeNodeForField", { enumerable: true, get: function () { return getTreeNodeForField_js_1.tryGetTreeNodeForField; } });
68
68
  var index_js_3 = require("./node-kinds/index.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,4CAwByB;AAvBxB,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;A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AqB,OAAA;AAoBrB,2GAAA,SAAS,OAAA;AACT,6GAAA,WAAW,OAAA;AAQX,sHAAA,oBAAoB,OAAA;AACpB,qHAAA,mBAAmB,OAAA;AACnB,6HAAA,2BAA2B,OAAA;AAM3B,uHAAA,qBAAqB,OAAA;AASrB,oHAAA,kBAAkB,OAAA;AAEnB,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,kDA+B+B;AA5B9B,2GAAA,eAAe,OAAA;AACf,mGAAA,OAAO,OAAA;AACP,6GAAA,iBAAiB,OAAA;AACjB,oHAAA,wBAAwB,OAAA;AAExB,yGAAA,aAAa,OAAA;AAGb,yGAAA,aAAa,OAAA;AACb,2GAAA,eAAe,OAAA;AAMf,4GAAA,gBAAgB,OAAA;AAEhB,8GAAA,kBAAkB,OAAA;AAGlB,oGAAA,QAAQ,OAAA;AACR,4HAAA,gCAAgC,OAAA;AAChC,8GAAA,kBAAkB,OAAA;AAIlB,4GAAA,gBAAgB,OAAA;AAGjB,6FAK+C;AAJ9C,uJAAA,gCAAgC,OAAA;AAKjC,mEAGkC;AAFjC,6HAAA,mBAAmB,OAAA;AACnB,wIAAA,8BAA8B,OAAA;AAE/B,yDAAsE;AAA7D,mHAAA,cAAc,OAAA;AAAE,oHAAA,eAAe,OAAA;AACxC,yDAM6B;AAL5B,iHAAA,YAAY,OAAA;AACZ,iHAAA,YAAY,OAAA;AACZ,kHAAA,aAAa,OAAA;AACb,iHAAA,YAAY,OAAA;AACZ,+GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype WithType,\n\ttype TreeNodeSchema,\n\ttype AnnotatedAllowedType,\n\ttype NormalizedAnnotatedAllowedTypes,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n\t// TreeNode is only type exported, which prevents use of the class object for unsupported use-cases like direct sub-classing and instanceof.\n\t// See docs on TreeNode for more details.\n\ttype TreeNode,\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n\tisTreeNode,\n\ttryDisposeTreeNode,\n\tHydratedContext,\n\tSimpleContextSlot,\n\tgetOrCreateInnerNode,\n\tgetOrCreateNodeFromInnerNode,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n\tgetKernel,\n} from \"./core/index.js\";\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\ttype SchemaFactoryObjectOptions,\n\ttype ScopedSchemaName,\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\ttype NodeChangedData,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\ttype TreeSchemaEncodingOptions,\n\tgetJsonSchema,\n\tgetSimpleSchema,\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\tSchemaCompatibilityTester,\n\ttype Unenforced,\n\ttype System_Unsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\ttype TreeViewAlpha,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\tgetPropertyKeyFromStoredKey,\n\tgetStoredKey,\n\ttryGetSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\tconciseFromCursor,\n\tcreateFromCursor,\n\tasTreeViewAlpha,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype FieldSchemaAlphaUnsafe,\n\tgetIdentifierFromNode,\n\ttype TreeSchema,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tschemaStatics,\n\ttype TreeChangeEvents,\n} from \"./api/index.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBase,\n\tSimpleNodeSchemaBaseAlpha,\n\tSimpleObjectFieldSchema,\n\tSimpleRecordNodeSchema,\n} from \"./simpleSchema.js\";\nexport {\n\ttype NodeFromSchema,\n\tisTreeNodeSchemaClass,\n\ttype ImplicitFieldSchema,\n\ttype ImplicitAnnotatedFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype ImplicitAllowedTypes,\n\ttype ImplicitAnnotatedAllowedTypes,\n\ttype UnannotateImplicitAllowedTypes,\n\ttype UnannotateAllowedTypes,\n\ttype UnannotateAllowedType,\n\ttype UnannotateAllowedTypesList,\n\ttype UnannotateAllowedTypeOrLazyItem,\n\ttype UnannotateImplicitFieldSchema,\n\ttype UnannotateSchemaRecord,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype AllowedTypes,\n\ttype AllowedTypeMetadata,\n\ttype AllowedTypesMetadata,\n\ttype AnnotatedAllowedTypes,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\ttype NodeBuilderData,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\tareFieldSchemaEqual,\n\tareImplicitFieldSchemaEqual,\n\ttype ApplyKind,\n\ttype FieldSchemaMetadata,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype UnsafeUnknownSchema,\n\tnormalizeAllowedTypes,\n\ttype ApplyKindInput,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype NodeSchemaMetadata,\n\tevaluateLazySchema,\n} from \"./schemaTypes.js\";\nexport { tryGetTreeNodeForField } from \"./getTreeNodeForField.js\";\nexport {\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\tasIndex,\n\tisArrayNodeSchema,\n\tIterableTreeArrayContent,\n\ttype ReadonlyArrayNode,\n\tTreeArrayNode,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\tisMapNodeSchema,\n\ttype TreeMapNode,\n\ttype MapNodeInsertableData,\n\ttype FieldHasDefault,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype ObjectFromSchemaRecord,\n\tObjectNodeSchema,\n\ttype ObjectNodeSchemaPrivate,\n\tisObjectNodeSchema,\n\ttype InsertableObjectFromAnnotatedSchemaRecord,\n\ttype TreeObjectNode,\n\tsetField,\n\tcreateUnknownOptionalFieldPolicy,\n\tisRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\tRecordNodeSchema,\n\ttype TreeRecordNode,\n} from \"./node-kinds/index.js\";\nexport {\n\tunhydratedFlexTreeFromInsertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n} from \"./unhydratedFlexTreeFromInsertable.js\";\nexport {\n\tprepareForInsertion,\n\tprepareForInsertionContextless,\n} from \"./prepareForInsertion.js\";\nexport { toStoredSchema, getStoredSchema } from \"./toStoredSchema.js\";\nexport {\n\tnumberSchema,\n\tstringSchema,\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n} from \"./leafNodeSchema.js\";\nexport type { LeafSchema } from \"./leafNodeSchema.js\";\nexport type { LazyItem, FlexList, FlexListToUnion, ExtractItemType } from \"./flexList.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,4CAmDyB;AAlDxB,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAKhB,oGAAA,QAAQ,OAAA;AASR,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,6GAAA,iBAAiB,OAAA;AACjB,gHAAA,oBAAoB,OAAA;AACp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AmB,OAAA;AACnB,6HAAA,2BAA2B,OAAA;AAQ5B,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,kDAgC+B;AA7B9B,2GAAA,eAAe,OAAA;AACf,mGAAA,OAAO,OAAA;AACP,6GAAA,iBAAiB,OAAA;AACjB,oHAAA,wBAAwB,OAAA;AAExB,yGAAA,aAAa,OAAA;AAGb,yGAAA,aAAa,OAAA;AACb,2GAAA,eAAe,OAAA;AAMf,4GAAA,gBAAgB,OAAA;AAEhB,8GAAA,kBAAkB,OAAA;AAGlB,oGAAA,QAAQ,OAAA;AACR,4HAAA,gCAAgC,OAAA;AAChC,8GAAA,kBAAkB,OAAA;AAIlB,4GAAA,gBAAgB,OAAA;AAIjB,6FAK+C;AAJ9C,uJAAA,gCAAgC,OAAA;AAKjC,mEAGkC;AAFjC,6HAAA,mBAAmB,OAAA;AACnB,wIAAA,8BAA8B,OAAA;AAE/B,yDAAsE;AAA7D,mHAAA,cAAc,OAAA;AAAE,oHAAA,eAAe,OAAA;AACxC,yDAM6B;AAL5B,iHAAA,YAAY,OAAA;AACZ,iHAAA,YAAY,OAAA;AACZ,kHAAA,aAAa,OAAA;AACb,iHAAA,YAAY,OAAA;AACZ,+GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype WithType,\n\ttype TreeNodeSchema,\n\ttype AnnotatedAllowedType,\n\ttype NormalizedAnnotatedAllowedTypes,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n\t// TreeNode is only type exported, which prevents use of the class object for unsupported use-cases like direct sub-classing and instanceof.\n\t// See docs on TreeNode for more details.\n\ttype TreeNode,\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n\tisTreeNode,\n\ttryDisposeTreeNode,\n\tHydratedContext,\n\tSimpleContextSlot,\n\tgetOrCreateInnerNode,\n\tgetOrCreateNodeFromInnerNode,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n\tgetKernel,\n\ttype NodeFromSchema,\n\tisTreeNodeSchemaClass,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype AllowedTypes,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype InsertableTypedNode,\n\ttype NodeBuilderData,\n\ttype Input,\n\tnormalizeAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype ImplicitAnnotatedAllowedTypes,\n\ttype UnannotateImplicitAllowedTypes,\n\ttype AllowedTypesMetadata,\n\tevaluateLazySchema,\n\ttype UnannotateAllowedTypes,\n\ttype UnannotateAllowedType,\n\ttype UnannotateAllowedTypesList,\n\ttype UnannotateAllowedTypeOrLazyItem,\n\ttype AllowedTypeMetadata,\n\ttype AnnotatedAllowedTypes,\n\ttype LazyItem,\n\ttype FlexList,\n\ttype FlexListToUnion,\n\ttype ExtractItemType,\n} from \"./core/index.js\";\nexport type { UnsafeUnknownSchema, Insertable } from \"./unsafeUnknownSchema.js\";\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\ttype SchemaFactoryObjectOptions,\n\ttype ScopedSchemaName,\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\ttype NodeChangedData,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\ttype TreeSchemaEncodingOptions,\n\tgetJsonSchema,\n\tgetSimpleSchema,\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\tSchemaCompatibilityTester,\n\ttype Unenforced,\n\ttype System_Unsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\ttype TreeViewAlpha,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\tgetPropertyKeyFromStoredKey,\n\tgetStoredKey,\n\ttryGetSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\tconciseFromCursor,\n\tcreateFromCursor,\n\tasTreeViewAlpha,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype FieldSchemaAlphaUnsafe,\n\tgetIdentifierFromNode,\n\ttype TreeSchema,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tschemaStatics,\n\ttype TreeChangeEvents,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n} from \"./api/index.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBase,\n\tSimpleNodeSchemaBaseAlpha,\n\tSimpleObjectFieldSchema,\n\tSimpleRecordNodeSchema,\n} from \"./simpleSchema.js\";\nexport {\n\ttype ImplicitFieldSchema,\n\ttype ImplicitAnnotatedFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype UnannotateImplicitFieldSchema,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\tareFieldSchemaEqual,\n\tareImplicitFieldSchemaEqual,\n\ttype ApplyKind,\n\ttype FieldSchemaMetadata,\n\ttype InsertableField,\n\ttype ApplyKindInput,\n\ttype ReadableField,\n\ttype ReadSchema,\n} from \"./fieldSchema.js\";\nexport { tryGetTreeNodeForField } from \"./getTreeNodeForField.js\";\nexport {\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\tasIndex,\n\tisArrayNodeSchema,\n\tIterableTreeArrayContent,\n\ttype ReadonlyArrayNode,\n\tTreeArrayNode,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\tisMapNodeSchema,\n\ttype TreeMapNode,\n\ttype MapNodeInsertableData,\n\ttype FieldHasDefault,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype ObjectFromSchemaRecord,\n\tObjectNodeSchema,\n\ttype ObjectNodeSchemaPrivate,\n\tisObjectNodeSchema,\n\ttype InsertableObjectFromAnnotatedSchemaRecord,\n\ttype TreeObjectNode,\n\tsetField,\n\tcreateUnknownOptionalFieldPolicy,\n\tisRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\tRecordNodeSchema,\n\ttype TreeRecordNode,\n\ttype UnannotateSchemaRecord,\n} from \"./node-kinds/index.js\";\nexport {\n\tunhydratedFlexTreeFromInsertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n} from \"./unhydratedFlexTreeFromInsertable.js\";\nexport {\n\tprepareForInsertion,\n\tprepareForInsertionContextless,\n} from \"./prepareForInsertion.js\";\nexport { toStoredSchema, getStoredSchema } from \"./toStoredSchema.js\";\nexport {\n\tnumberSchema,\n\tstringSchema,\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n} from \"./leafNodeSchema.js\";\nexport type { LeafSchema } from \"./leafNodeSchema.js\";\n"]}
@@ -4,10 +4,10 @@
4
4
  */
5
5
  import { type TreeValue, ValueSchema } from "../core/index.js";
6
6
  import { type FlexTreeNode } from "../feature-libraries/index.js";
7
- import { NodeKind, type NormalizedAnnotatedAllowedTypes, type TreeNodeSchema, type TreeNodeSchemaNonClass } from "./core/index.js";
8
- import type { NodeSchemaMetadata, TreeLeafValue } from "./schemaTypes.js";
7
+ import { NodeKind, type TreeNodeSchema, type TreeNodeSchemaNonClass, type NodeSchemaMetadata, type TreeLeafValue, type TreeNodeSchemaCorePrivate, type TreeNodeSchemaPrivateData, privateDataSymbol, type FlexContent } from "./core/index.js";
9
8
  import type { SimpleLeafNodeSchema } from "./simpleSchema.js";
10
- import type { JsonCompatibleReadOnlyObject } from "../util/index.js";
9
+ import { type JsonCompatibleReadOnlyObject } from "../util/index.js";
10
+ import type { FactoryContent } from "./unhydratedFlexTreeFromInsertable.js";
11
11
  /**
12
12
  * Instances of this class are schema for leaf nodes.
13
13
  * @remarks
@@ -17,13 +17,14 @@ import type { JsonCompatibleReadOnlyObject } from "../util/index.js";
17
17
  * @privateRemarks
18
18
  * This class refers to the underlying flex tree schema in its constructor, so this class can't be included in the package API.
19
19
  */
20
- export declare class LeafNodeSchema<Name extends string, const T extends ValueSchema> implements TreeNodeSchemaNonClass<Name, NodeKind.Leaf, TreeValue<T>, TreeValue<T>> {
20
+ export declare class LeafNodeSchema<Name extends string, const T extends ValueSchema> implements TreeNodeSchemaNonClass<Name, NodeKind.Leaf, TreeValue<T>, TreeValue<T>>, SimpleLeafNodeSchema, TreeNodeSchemaCorePrivate {
21
+ #private;
21
22
  readonly identifier: Name;
22
23
  readonly kind = NodeKind.Leaf;
23
24
  readonly info: T;
24
25
  readonly implicitlyConstructable: true;
25
26
  readonly childTypes: ReadonlySet<TreeNodeSchema>;
26
- readonly childAnnotatedAllowedTypes: readonly NormalizedAnnotatedAllowedTypes[];
27
+ readonly [privateDataSymbol]: TreeNodeSchemaPrivateData;
27
28
  create(data: TreeValue<T> | FlexTreeNode): TreeValue<T>;
28
29
  createFromInsertable(data: TreeValue<T>): TreeValue<T>;
29
30
  readonly leafKind: ValueSchema;
@@ -49,4 +50,12 @@ export declare const numberSchema: LeafSchema<"number", number> & SimpleLeafNode
49
50
  export declare const booleanSchema: LeafSchema<"boolean", boolean> & SimpleLeafNodeSchema;
50
51
  export declare const nullSchema: LeafSchema<"null", null> & SimpleLeafNodeSchema;
51
52
  export declare const handleSchema: LeafSchema<"handle", import("@fluidframework/core-interfaces").IFluidHandle<unknown>> & SimpleLeafNodeSchema;
53
+ /**
54
+ * Transforms data under a Leaf schema.
55
+ * @param data - The tree data to be transformed. Must be a {@link TreeValue}.
56
+ * @param schema - The schema associated with the value.
57
+ * @param allowedTypes - The allowed types specified by the parent.
58
+ * Used to determine which fallback values may be appropriate.
59
+ */
60
+ export declare function leafToFlexContent(data: FactoryContent, schema: TreeNodeSchema, allowedTypes: ReadonlySet<TreeNodeSchema>): FlexContent;
52
61
  //# sourceMappingURL=leafNodeSchema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"leafNodeSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACN,KAAK,YAAY,EAGjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACN,QAAQ,EACR,KAAK,+BAA+B,EACpC,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAErE;;;;;;;;GAQG;AACH,qBAAa,cAAc,CAAC,IAAI,SAAS,MAAM,EAAE,KAAK,CAAC,CAAC,SAAS,WAAW,CAC3E,YAAW,sBAAsB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAElF,SAAgB,UAAU,EAAE,IAAI,CAAC;IACjC,SAAgB,IAAI,iBAAiB;IACrC,SAAgB,IAAI,EAAE,CAAC,CAAC;IACxB,SAAgB,uBAAuB,OAAiB;IACxD,SAAgB,UAAU,EAAE,WAAW,CAAC,cAAc,CAAC,CAAa;IACpE,SAAgB,0BAA0B,EAAE,SAAS,+BAA+B,EAAE,CAAM;IAErF,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,C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