@fluidframework/tree 2.3.0-288113 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (869) hide show
  1. package/.dependency-cruiser-known-violations.json +28 -40
  2. package/.vscode/Tree.code-workspace +0 -2
  3. package/CHANGELOG.md +92 -0
  4. package/README.md +6 -0
  5. package/alpha.d.ts +11 -0
  6. package/api-extractor/api-extractor-lint-alpha.cjs.json +5 -0
  7. package/api-extractor/api-extractor-lint-alpha.esm.json +5 -0
  8. package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
  9. package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
  10. package/api-extractor/api-extractor.current.json +8 -0
  11. package/api-extractor/api-extractor.legacy.json +4 -0
  12. package/api-extractor.json +1 -1
  13. package/api-report/tree.alpha.api.md +21 -42
  14. package/api-report/tree.beta.api.md +21 -11
  15. package/api-report/tree.legacy.alpha.api.md +562 -0
  16. package/api-report/tree.legacy.public.api.md +559 -0
  17. package/api-report/tree.public.api.md +8 -13
  18. package/dist/alpha.d.ts +102 -0
  19. package/dist/beta.d.ts +6 -2
  20. package/dist/core/index.d.ts +1 -1
  21. package/dist/core/index.d.ts.map +1 -1
  22. package/dist/core/index.js +2 -2
  23. package/dist/core/index.js.map +1 -1
  24. package/dist/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
  25. package/dist/core/revertible.d.ts.map +1 -0
  26. package/dist/core/revertible.js.map +1 -0
  27. package/dist/core/schema-stored/format.d.ts +3 -3
  28. package/dist/core/schema-stored/format.js +1 -1
  29. package/dist/core/schema-stored/format.js.map +1 -1
  30. package/dist/core/schema-stored/schema.d.ts +2 -7
  31. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  32. package/dist/core/schema-stored/schema.js +4 -6
  33. package/dist/core/schema-stored/schema.js.map +1 -1
  34. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  35. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  36. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  37. package/dist/core/tree/anchorSet.js +6 -2
  38. package/dist/core/tree/anchorSet.js.map +1 -1
  39. package/dist/core/tree/detachedFieldIndex.d.ts +0 -1
  40. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  41. package/dist/core/tree/detachedFieldIndex.js +1 -0
  42. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  43. package/dist/core/tree/visitDelta.d.ts +7 -2
  44. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  45. package/dist/core/tree/visitDelta.js.map +1 -1
  46. package/dist/events/emitter.d.ts +127 -0
  47. package/dist/events/emitter.d.ts.map +1 -0
  48. package/dist/events/{events.js → emitter.js} +48 -30
  49. package/dist/events/emitter.js.map +1 -0
  50. package/dist/events/index.d.ts +2 -1
  51. package/dist/events/index.d.ts.map +1 -1
  52. package/dist/events/index.js +4 -5
  53. package/dist/events/index.js.map +1 -1
  54. package/dist/events/interop.d.ts +36 -0
  55. package/dist/events/interop.d.ts.map +1 -0
  56. package/dist/{core/revertible/index.d.ts → events/interop.js} +3 -2
  57. package/dist/events/interop.js.map +1 -0
  58. package/dist/events/listeners.d.ts +65 -0
  59. package/dist/events/listeners.d.ts.map +1 -0
  60. package/{lib/core/revertible/index.d.ts → dist/events/listeners.js} +3 -2
  61. package/dist/events/listeners.js.map +1 -0
  62. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
  63. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/chunkTree.js +36 -15
  65. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
  67. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/chunkedForest.js +12 -5
  69. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
  71. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/uniformChunk.js +28 -2
  73. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  74. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
  75. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  76. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
  77. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  78. package/dist/feature-libraries/flex-map-tree/index.d.ts +1 -1
  79. package/dist/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
  80. package/dist/feature-libraries/flex-map-tree/index.js +2 -1
  81. package/dist/feature-libraries/flex-map-tree/index.js.map +1 -1
  82. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -33
  83. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  84. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +82 -103
  85. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  86. package/dist/feature-libraries/flex-tree/context.d.ts +30 -14
  87. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  88. package/dist/feature-libraries/flex-tree/context.js +10 -7
  89. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  90. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -190
  91. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  92. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +15 -3
  93. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  94. package/dist/feature-libraries/flex-tree/index.d.ts +2 -3
  95. package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
  96. package/dist/feature-libraries/flex-tree/index.js.map +1 -1
  97. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
  98. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  99. package/dist/feature-libraries/flex-tree/lazyEntity.js +2 -10
  100. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  101. package/dist/feature-libraries/flex-tree/lazyField.d.ts +26 -28
  102. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  103. package/dist/feature-libraries/flex-tree/lazyField.js +11 -14
  104. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  105. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +5 -26
  106. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  107. package/dist/feature-libraries/flex-tree/lazyNode.js +23 -74
  108. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  109. package/dist/feature-libraries/flex-tree/unboxed.d.ts +4 -16
  110. package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  111. package/dist/feature-libraries/flex-tree/unboxed.js +7 -41
  112. package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
  113. package/dist/feature-libraries/flex-tree/utilities.d.ts +2 -2
  114. package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  115. package/dist/feature-libraries/flex-tree/utilities.js +3 -6
  116. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  118. package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -1
  119. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  120. package/dist/feature-libraries/index.d.ts +3 -5
  121. package/dist/feature-libraries/index.d.ts.map +1 -1
  122. package/dist/feature-libraries/index.js +5 -11
  123. package/dist/feature-libraries/index.js.map +1 -1
  124. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  125. package/dist/feature-libraries/modular-schema/comparison.js +3 -6
  126. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  127. package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  128. package/dist/feature-libraries/modular-schema/discrepancies.js +3 -13
  129. package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  130. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
  131. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  132. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
  133. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  134. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
  135. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  136. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
  137. package/dist/feature-libraries/schema-index/format.d.ts +3 -3
  138. package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  139. package/dist/feature-libraries/storedToViewSchema.js +2 -4
  140. package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
  141. package/dist/feature-libraries/typed-schema/flexList.d.ts +3 -3
  142. package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
  143. package/dist/feature-libraries/typed-schema/index.d.ts +2 -2
  144. package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
  145. package/dist/feature-libraries/typed-schema/index.js +2 -2
  146. package/dist/feature-libraries/typed-schema/index.js.map +1 -1
  147. package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  148. package/dist/feature-libraries/typed-schema/schemaCollection.js +8 -10
  149. package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  150. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
  151. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  152. package/dist/feature-libraries/typed-schema/typedTreeSchema.js +5 -37
  153. package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  154. package/dist/feature-libraries/typed-schema/view.d.ts +4 -6
  155. package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
  156. package/dist/feature-libraries/typed-schema/view.js +5 -4
  157. package/dist/feature-libraries/typed-schema/view.js.map +1 -1
  158. package/dist/index.d.ts +4 -4
  159. package/dist/index.d.ts.map +1 -1
  160. package/dist/index.js +33 -36
  161. package/dist/index.js.map +1 -1
  162. package/dist/legacy.d.ts +83 -0
  163. package/dist/packageVersion.d.ts +1 -1
  164. package/dist/packageVersion.d.ts.map +1 -1
  165. package/dist/packageVersion.js +1 -1
  166. package/dist/packageVersion.js.map +1 -1
  167. package/dist/public.d.ts +0 -1
  168. package/dist/shared-tree/checkoutFlexTreeView.d.ts +53 -0
  169. package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
  170. package/dist/shared-tree/{treeView.js → checkoutFlexTreeView.js} +28 -6
  171. package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -0
  172. package/dist/shared-tree/index.d.ts +3 -3
  173. package/dist/shared-tree/index.d.ts.map +1 -1
  174. package/dist/shared-tree/index.js +2 -2
  175. package/dist/shared-tree/index.js.map +1 -1
  176. package/dist/shared-tree/schematizeTree.d.ts +15 -4
  177. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  178. package/dist/shared-tree/schematizeTree.js +7 -8
  179. package/dist/shared-tree/schematizeTree.js.map +1 -1
  180. package/dist/shared-tree/schematizingTreeView.d.ts +9 -4
  181. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  182. package/dist/shared-tree/schematizingTreeView.js +25 -12
  183. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  184. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  185. package/dist/shared-tree/sharedTree.js +2 -2
  186. package/dist/shared-tree/sharedTree.js.map +1 -1
  187. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
  188. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  189. package/dist/shared-tree/sharedTreeChangeEnricher.js +6 -2
  190. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  191. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
  192. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  193. package/dist/shared-tree/sharedTreeChangeFamily.js +3 -2
  194. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  195. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
  196. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  197. package/dist/shared-tree/sharedTreeEditBuilder.js +2 -2
  198. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  199. package/dist/shared-tree/treeApi.d.ts +1 -3
  200. package/dist/shared-tree/treeApi.d.ts.map +1 -1
  201. package/dist/shared-tree/treeApi.js +6 -4
  202. package/dist/shared-tree/treeApi.js.map +1 -1
  203. package/dist/shared-tree/treeCheckout.d.ts +2 -13
  204. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  205. package/dist/shared-tree/treeCheckout.js +17 -1
  206. package/dist/shared-tree/treeCheckout.js.map +1 -1
  207. package/dist/shared-tree-core/branch.js +1 -1
  208. package/dist/shared-tree-core/branch.js.map +1 -1
  209. package/dist/simple-tree/api/create.d.ts.map +1 -1
  210. package/dist/simple-tree/api/create.js +1 -1
  211. package/dist/simple-tree/api/create.js.map +1 -1
  212. package/{lib/simple-tree → dist/simple-tree/api}/getJsonSchema.d.ts +1 -1
  213. package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -0
  214. package/dist/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
  215. package/dist/simple-tree/api/getJsonSchema.js.map +1 -0
  216. package/{lib/simple-tree → dist/simple-tree/api}/getSimpleSchema.d.ts +1 -1
  217. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
  218. package/dist/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
  219. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -0
  220. package/dist/simple-tree/api/index.d.ts +5 -0
  221. package/dist/simple-tree/api/index.d.ts.map +1 -1
  222. package/dist/simple-tree/api/index.js +7 -1
  223. package/dist/simple-tree/api/index.js.map +1 -1
  224. package/{lib/simple-tree → dist/simple-tree/api}/jsonSchema.d.ts +1 -1
  225. package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -0
  226. package/dist/simple-tree/api/jsonSchema.js.map +1 -0
  227. package/dist/simple-tree/api/schemaFactory.d.ts +45 -14
  228. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  229. package/dist/simple-tree/api/schemaFactory.js +43 -12
  230. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  231. package/dist/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
  232. package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -0
  233. package/dist/simple-tree/api/simpleSchema.js.map +1 -0
  234. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
  235. package/dist/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
  236. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
  237. package/dist/simple-tree/api/tree.d.ts +1 -21
  238. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  239. package/dist/simple-tree/api/tree.js +3 -38
  240. package/dist/simple-tree/api/tree.js.map +1 -1
  241. package/dist/simple-tree/api/treeApiBeta.d.ts +79 -0
  242. package/dist/simple-tree/api/treeApiBeta.d.ts.map +1 -0
  243. package/dist/simple-tree/api/treeApiBeta.js +26 -0
  244. package/dist/simple-tree/api/treeApiBeta.js.map +1 -0
  245. package/dist/simple-tree/api/treeNodeApi.d.ts +1 -1
  246. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  247. package/dist/simple-tree/api/treeNodeApi.js +21 -19
  248. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  249. package/dist/simple-tree/api/verboseTree.js +2 -2
  250. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  251. package/dist/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
  252. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
  253. package/dist/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
  254. package/{lib/simple-tree → dist/simple-tree/api}/viewSchemaToSimpleSchema.js.map +1 -1
  255. package/dist/simple-tree/arrayNode.d.ts +2 -2
  256. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  257. package/dist/simple-tree/arrayNode.js +30 -21
  258. package/dist/simple-tree/arrayNode.js.map +1 -1
  259. package/dist/simple-tree/core/index.d.ts +3 -3
  260. package/dist/simple-tree/core/index.d.ts.map +1 -1
  261. package/dist/simple-tree/core/index.js +4 -1
  262. package/dist/simple-tree/core/index.js.map +1 -1
  263. package/dist/simple-tree/core/schemaCaching.d.ts +5 -0
  264. package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -1
  265. package/dist/simple-tree/core/schemaCaching.js +10 -1
  266. package/dist/simple-tree/core/schemaCaching.js.map +1 -1
  267. package/dist/simple-tree/core/treeNodeKernel.d.ts +61 -3
  268. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  269. package/dist/simple-tree/core/treeNodeKernel.js +166 -13
  270. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  271. package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -1
  272. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  273. package/dist/simple-tree/core/types.d.ts +17 -20
  274. package/dist/simple-tree/core/types.d.ts.map +1 -1
  275. package/dist/simple-tree/core/types.js.map +1 -1
  276. package/dist/simple-tree/core/withType.d.ts +3 -2
  277. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  278. package/dist/simple-tree/core/withType.js.map +1 -1
  279. package/dist/simple-tree/index.d.ts +7 -9
  280. package/dist/simple-tree/index.d.ts.map +1 -1
  281. package/dist/simple-tree/index.js +15 -6
  282. package/dist/simple-tree/index.js.map +1 -1
  283. package/dist/simple-tree/leafNodeSchema.d.ts +7 -9
  284. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  285. package/dist/simple-tree/leafNodeSchema.js +13 -11
  286. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  287. package/dist/simple-tree/mapNode.d.ts +1 -1
  288. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  289. package/dist/simple-tree/mapNode.js +38 -29
  290. package/dist/simple-tree/mapNode.js.map +1 -1
  291. package/dist/simple-tree/objectNode.d.ts +9 -7
  292. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  293. package/dist/simple-tree/objectNode.js +37 -31
  294. package/dist/simple-tree/objectNode.js.map +1 -1
  295. package/dist/simple-tree/proxies.d.ts +1 -14
  296. package/dist/simple-tree/proxies.d.ts.map +1 -1
  297. package/dist/simple-tree/proxies.js +12 -15
  298. package/dist/simple-tree/proxies.js.map +1 -1
  299. package/dist/simple-tree/proxyBinding.d.ts +2 -62
  300. package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
  301. package/dist/simple-tree/proxyBinding.js +8 -181
  302. package/dist/simple-tree/proxyBinding.js.map +1 -1
  303. package/dist/simple-tree/schemaTypes.d.ts +7 -7
  304. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  305. package/dist/simple-tree/schemaTypes.js +4 -4
  306. package/dist/simple-tree/schemaTypes.js.map +1 -1
  307. package/dist/simple-tree/toFlexSchema.d.ts +11 -1
  308. package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
  309. package/dist/simple-tree/toFlexSchema.js +54 -31
  310. package/dist/simple-tree/toFlexSchema.js.map +1 -1
  311. package/dist/simple-tree/toMapTree.d.ts +25 -37
  312. package/dist/simple-tree/toMapTree.d.ts.map +1 -1
  313. package/dist/simple-tree/toMapTree.js +53 -16
  314. package/dist/simple-tree/toMapTree.js.map +1 -1
  315. package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
  316. package/dist/simple-tree/treeNodeValid.js +7 -10
  317. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  318. package/dist/simple-tree/typesUnsafe.d.ts +13 -13
  319. package/dist/simple-tree/typesUnsafe.js.map +1 -1
  320. package/dist/simple-tree/walkSchema.d.ts +26 -0
  321. package/dist/simple-tree/walkSchema.d.ts.map +1 -0
  322. package/dist/simple-tree/walkSchema.js +49 -0
  323. package/dist/simple-tree/walkSchema.js.map +1 -0
  324. package/dist/treeFactory.d.ts +2 -1
  325. package/dist/treeFactory.d.ts.map +1 -1
  326. package/dist/treeFactory.js +2 -1
  327. package/dist/treeFactory.js.map +1 -1
  328. package/dist/util/typeUtils.d.ts +2 -2
  329. package/dist/util/typeUtils.js.map +1 -1
  330. package/legacy.d.ts +11 -0
  331. package/lib/alpha.d.ts +102 -0
  332. package/lib/beta.d.ts +6 -2
  333. package/lib/core/index.d.ts +1 -1
  334. package/lib/core/index.d.ts.map +1 -1
  335. package/lib/core/index.js +1 -1
  336. package/lib/core/index.js.map +1 -1
  337. package/lib/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
  338. package/lib/core/revertible.d.ts.map +1 -0
  339. package/lib/core/revertible.js.map +1 -0
  340. package/lib/core/schema-stored/format.d.ts +3 -3
  341. package/lib/core/schema-stored/format.js +1 -1
  342. package/lib/core/schema-stored/format.js.map +1 -1
  343. package/lib/core/schema-stored/schema.d.ts +2 -7
  344. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  345. package/lib/core/schema-stored/schema.js +4 -6
  346. package/lib/core/schema-stored/schema.js.map +1 -1
  347. package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  348. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  349. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  350. package/lib/core/tree/anchorSet.js +6 -2
  351. package/lib/core/tree/anchorSet.js.map +1 -1
  352. package/lib/core/tree/detachedFieldIndex.d.ts +0 -1
  353. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  354. package/lib/core/tree/detachedFieldIndex.js +1 -0
  355. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  356. package/lib/core/tree/visitDelta.d.ts +7 -2
  357. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  358. package/lib/core/tree/visitDelta.js.map +1 -1
  359. package/lib/events/emitter.d.ts +127 -0
  360. package/lib/events/emitter.d.ts.map +1 -0
  361. package/lib/events/{events.js → emitter.js} +48 -29
  362. package/lib/events/emitter.js.map +1 -0
  363. package/lib/events/index.d.ts +2 -1
  364. package/lib/events/index.d.ts.map +1 -1
  365. package/lib/events/index.js +1 -1
  366. package/lib/events/index.js.map +1 -1
  367. package/lib/events/interop.d.ts +36 -0
  368. package/lib/events/interop.d.ts.map +1 -0
  369. package/{src/core/revertible/index.ts → lib/events/interop.js} +2 -2
  370. package/lib/events/interop.js.map +1 -0
  371. package/lib/events/listeners.d.ts +65 -0
  372. package/lib/events/listeners.d.ts.map +1 -0
  373. package/lib/{core/revertible/index.js → events/listeners.js} +2 -2
  374. package/lib/events/listeners.js.map +1 -0
  375. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
  376. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  377. package/lib/feature-libraries/chunked-forest/chunkTree.js +37 -16
  378. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  379. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
  380. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  381. package/lib/feature-libraries/chunked-forest/chunkedForest.js +12 -5
  382. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  383. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
  384. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  385. package/lib/feature-libraries/chunked-forest/uniformChunk.js +28 -2
  386. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  387. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
  388. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  389. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
  390. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  391. package/lib/feature-libraries/flex-map-tree/index.d.ts +1 -1
  392. package/lib/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
  393. package/lib/feature-libraries/flex-map-tree/index.js +1 -1
  394. package/lib/feature-libraries/flex-map-tree/index.js.map +1 -1
  395. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -33
  396. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  397. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +83 -104
  398. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  399. package/lib/feature-libraries/flex-tree/context.d.ts +30 -14
  400. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  401. package/lib/feature-libraries/flex-tree/context.js +10 -7
  402. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  403. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -190
  404. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  405. package/lib/feature-libraries/flex-tree/flexTreeTypes.js +15 -2
  406. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  407. package/lib/feature-libraries/flex-tree/index.d.ts +2 -3
  408. package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
  409. package/lib/feature-libraries/flex-tree/index.js +1 -1
  410. package/lib/feature-libraries/flex-tree/index.js.map +1 -1
  411. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
  412. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  413. package/lib/feature-libraries/flex-tree/lazyEntity.js +2 -10
  414. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  415. package/lib/feature-libraries/flex-tree/lazyField.d.ts +26 -28
  416. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  417. package/lib/feature-libraries/flex-tree/lazyField.js +11 -13
  418. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  419. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +5 -26
  420. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  421. package/lib/feature-libraries/flex-tree/lazyNode.js +23 -72
  422. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  423. package/lib/feature-libraries/flex-tree/unboxed.d.ts +4 -16
  424. package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  425. package/lib/feature-libraries/flex-tree/unboxed.js +5 -37
  426. package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
  427. package/lib/feature-libraries/flex-tree/utilities.d.ts +2 -2
  428. package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  429. package/lib/feature-libraries/flex-tree/utilities.js +3 -6
  430. package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
  431. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  432. package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -1
  433. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  434. package/lib/feature-libraries/index.d.ts +3 -5
  435. package/lib/feature-libraries/index.d.ts.map +1 -1
  436. package/lib/feature-libraries/index.js +5 -5
  437. package/lib/feature-libraries/index.js.map +1 -1
  438. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  439. package/lib/feature-libraries/modular-schema/comparison.js +3 -6
  440. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  441. package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  442. package/lib/feature-libraries/modular-schema/discrepancies.js +3 -13
  443. package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  444. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
  445. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  446. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
  447. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  448. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
  449. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  450. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
  451. package/lib/feature-libraries/schema-index/format.d.ts +3 -3
  452. package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  453. package/lib/feature-libraries/storedToViewSchema.js +3 -5
  454. package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
  455. package/lib/feature-libraries/typed-schema/flexList.d.ts +3 -3
  456. package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
  457. package/lib/feature-libraries/typed-schema/index.d.ts +2 -2
  458. package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
  459. package/lib/feature-libraries/typed-schema/index.js +2 -2
  460. package/lib/feature-libraries/typed-schema/index.js.map +1 -1
  461. package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  462. package/lib/feature-libraries/typed-schema/schemaCollection.js +9 -11
  463. package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  464. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
  465. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  466. package/lib/feature-libraries/typed-schema/typedTreeSchema.js +5 -36
  467. package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  468. package/lib/feature-libraries/typed-schema/view.d.ts +4 -6
  469. package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
  470. package/lib/feature-libraries/typed-schema/view.js +5 -4
  471. package/lib/feature-libraries/typed-schema/view.js.map +1 -1
  472. package/lib/index.d.ts +4 -4
  473. package/lib/index.d.ts.map +1 -1
  474. package/lib/index.js +3 -5
  475. package/lib/index.js.map +1 -1
  476. package/lib/legacy.d.ts +83 -0
  477. package/lib/packageVersion.d.ts +1 -1
  478. package/lib/packageVersion.d.ts.map +1 -1
  479. package/lib/packageVersion.js +1 -1
  480. package/lib/packageVersion.js.map +1 -1
  481. package/lib/public.d.ts +0 -1
  482. package/lib/shared-tree/checkoutFlexTreeView.d.ts +53 -0
  483. package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
  484. package/lib/shared-tree/{treeView.js → checkoutFlexTreeView.js} +26 -5
  485. package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -0
  486. package/lib/shared-tree/index.d.ts +3 -3
  487. package/lib/shared-tree/index.d.ts.map +1 -1
  488. package/lib/shared-tree/index.js +1 -1
  489. package/lib/shared-tree/index.js.map +1 -1
  490. package/lib/shared-tree/schematizeTree.d.ts +15 -4
  491. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  492. package/lib/shared-tree/schematizeTree.js +8 -9
  493. package/lib/shared-tree/schematizeTree.js.map +1 -1
  494. package/lib/shared-tree/schematizingTreeView.d.ts +9 -4
  495. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  496. package/lib/shared-tree/schematizingTreeView.js +26 -13
  497. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  498. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  499. package/lib/shared-tree/sharedTree.js +2 -2
  500. package/lib/shared-tree/sharedTree.js.map +1 -1
  501. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
  502. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  503. package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -2
  504. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  505. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
  506. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  507. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -2
  508. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  509. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
  510. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  511. package/lib/shared-tree/sharedTreeEditBuilder.js +2 -2
  512. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  513. package/lib/shared-tree/treeApi.d.ts +1 -3
  514. package/lib/shared-tree/treeApi.d.ts.map +1 -1
  515. package/lib/shared-tree/treeApi.js +7 -5
  516. package/lib/shared-tree/treeApi.js.map +1 -1
  517. package/lib/shared-tree/treeCheckout.d.ts +2 -13
  518. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  519. package/lib/shared-tree/treeCheckout.js +18 -2
  520. package/lib/shared-tree/treeCheckout.js.map +1 -1
  521. package/lib/shared-tree-core/branch.js +1 -1
  522. package/lib/shared-tree-core/branch.js.map +1 -1
  523. package/lib/simple-tree/api/create.d.ts.map +1 -1
  524. package/lib/simple-tree/api/create.js +2 -2
  525. package/lib/simple-tree/api/create.js.map +1 -1
  526. package/{dist/simple-tree → lib/simple-tree/api}/getJsonSchema.d.ts +1 -1
  527. package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -0
  528. package/lib/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
  529. package/lib/simple-tree/api/getJsonSchema.js.map +1 -0
  530. package/{dist/simple-tree → lib/simple-tree/api}/getSimpleSchema.d.ts +1 -1
  531. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
  532. package/lib/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
  533. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -0
  534. package/lib/simple-tree/api/index.d.ts +5 -0
  535. package/lib/simple-tree/api/index.d.ts.map +1 -1
  536. package/lib/simple-tree/api/index.js +3 -0
  537. package/lib/simple-tree/api/index.js.map +1 -1
  538. package/{dist/simple-tree → lib/simple-tree/api}/jsonSchema.d.ts +1 -1
  539. package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -0
  540. package/lib/simple-tree/api/jsonSchema.js.map +1 -0
  541. package/lib/simple-tree/api/schemaFactory.d.ts +45 -14
  542. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  543. package/lib/simple-tree/api/schemaFactory.js +43 -12
  544. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  545. package/lib/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
  546. package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -0
  547. package/lib/simple-tree/api/simpleSchema.js.map +1 -0
  548. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
  549. package/lib/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
  550. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
  551. package/lib/simple-tree/api/tree.d.ts +1 -21
  552. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  553. package/lib/simple-tree/api/tree.js +2 -34
  554. package/lib/simple-tree/api/tree.js.map +1 -1
  555. package/lib/simple-tree/api/treeApiBeta.d.ts +79 -0
  556. package/lib/simple-tree/api/treeApiBeta.d.ts.map +1 -0
  557. package/lib/simple-tree/api/treeApiBeta.js +23 -0
  558. package/lib/simple-tree/api/treeApiBeta.js.map +1 -0
  559. package/lib/simple-tree/api/treeNodeApi.d.ts +1 -1
  560. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  561. package/lib/simple-tree/api/treeNodeApi.js +23 -21
  562. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  563. package/lib/simple-tree/api/verboseTree.js +1 -1
  564. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  565. package/lib/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
  566. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
  567. package/lib/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
  568. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -0
  569. package/lib/simple-tree/arrayNode.d.ts +2 -2
  570. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  571. package/lib/simple-tree/arrayNode.js +33 -24
  572. package/lib/simple-tree/arrayNode.js.map +1 -1
  573. package/lib/simple-tree/core/index.d.ts +3 -3
  574. package/lib/simple-tree/core/index.d.ts.map +1 -1
  575. package/lib/simple-tree/core/index.js +2 -2
  576. package/lib/simple-tree/core/index.js.map +1 -1
  577. package/lib/simple-tree/core/schemaCaching.d.ts +5 -0
  578. package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -1
  579. package/lib/simple-tree/core/schemaCaching.js +8 -0
  580. package/lib/simple-tree/core/schemaCaching.js.map +1 -1
  581. package/lib/simple-tree/core/treeNodeKernel.d.ts +61 -3
  582. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  583. package/lib/simple-tree/core/treeNodeKernel.js +156 -5
  584. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  585. package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -1
  586. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  587. package/lib/simple-tree/core/types.d.ts +17 -20
  588. package/lib/simple-tree/core/types.d.ts.map +1 -1
  589. package/lib/simple-tree/core/types.js.map +1 -1
  590. package/lib/simple-tree/core/withType.d.ts +3 -2
  591. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  592. package/lib/simple-tree/core/withType.js.map +1 -1
  593. package/lib/simple-tree/index.d.ts +7 -9
  594. package/lib/simple-tree/index.d.ts.map +1 -1
  595. package/lib/simple-tree/index.js +5 -5
  596. package/lib/simple-tree/index.js.map +1 -1
  597. package/lib/simple-tree/leafNodeSchema.d.ts +7 -9
  598. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  599. package/lib/simple-tree/leafNodeSchema.js +14 -12
  600. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  601. package/lib/simple-tree/mapNode.d.ts +1 -1
  602. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  603. package/lib/simple-tree/mapNode.js +38 -29
  604. package/lib/simple-tree/mapNode.js.map +1 -1
  605. package/lib/simple-tree/objectNode.d.ts +9 -7
  606. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  607. package/lib/simple-tree/objectNode.js +40 -34
  608. package/lib/simple-tree/objectNode.js.map +1 -1
  609. package/lib/simple-tree/proxies.d.ts +1 -14
  610. package/lib/simple-tree/proxies.d.ts.map +1 -1
  611. package/lib/simple-tree/proxies.js +11 -14
  612. package/lib/simple-tree/proxies.js.map +1 -1
  613. package/lib/simple-tree/proxyBinding.d.ts +2 -62
  614. package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
  615. package/lib/simple-tree/proxyBinding.js +6 -174
  616. package/lib/simple-tree/proxyBinding.js.map +1 -1
  617. package/lib/simple-tree/schemaTypes.d.ts +7 -7
  618. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  619. package/lib/simple-tree/schemaTypes.js +4 -4
  620. package/lib/simple-tree/schemaTypes.js.map +1 -1
  621. package/lib/simple-tree/toFlexSchema.d.ts +11 -1
  622. package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
  623. package/lib/simple-tree/toFlexSchema.js +29 -8
  624. package/lib/simple-tree/toFlexSchema.js.map +1 -1
  625. package/lib/simple-tree/toMapTree.d.ts +25 -37
  626. package/lib/simple-tree/toMapTree.d.ts.map +1 -1
  627. package/lib/simple-tree/toMapTree.js +54 -17
  628. package/lib/simple-tree/toMapTree.js.map +1 -1
  629. package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
  630. package/lib/simple-tree/treeNodeValid.js +8 -11
  631. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  632. package/lib/simple-tree/typesUnsafe.d.ts +13 -13
  633. package/lib/simple-tree/typesUnsafe.js.map +1 -1
  634. package/lib/simple-tree/walkSchema.d.ts +26 -0
  635. package/lib/simple-tree/walkSchema.d.ts.map +1 -0
  636. package/lib/simple-tree/walkSchema.js +43 -0
  637. package/lib/simple-tree/walkSchema.js.map +1 -0
  638. package/lib/treeFactory.d.ts +2 -1
  639. package/lib/treeFactory.d.ts.map +1 -1
  640. package/lib/treeFactory.js +2 -1
  641. package/lib/treeFactory.js.map +1 -1
  642. package/lib/tsdoc-metadata.json +1 -1
  643. package/lib/util/typeUtils.d.ts +2 -2
  644. package/lib/util/typeUtils.js.map +1 -1
  645. package/package.json +57 -25
  646. package/src/core/index.ts +1 -1
  647. package/src/core/{revertible/revertible.ts → revertible.ts} +15 -0
  648. package/src/core/schema-stored/format.ts +1 -1
  649. package/src/core/schema-stored/schema.ts +6 -13
  650. package/src/core/tree/anchorSet.ts +18 -3
  651. package/src/core/tree/detachedFieldIndex.ts +6 -5
  652. package/src/core/tree/visitDelta.ts +7 -2
  653. package/src/events/{events.ts → emitter.ts} +52 -139
  654. package/src/events/index.ts +7 -7
  655. package/src/events/interop.ts +49 -0
  656. package/src/events/listeners.ts +68 -0
  657. package/src/feature-libraries/chunked-forest/chunkTree.ts +63 -18
  658. package/src/feature-libraries/chunked-forest/chunkedForest.ts +18 -4
  659. package/src/feature-libraries/chunked-forest/uniformChunk.ts +33 -0
  660. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -3
  661. package/src/feature-libraries/flex-map-tree/index.ts +1 -0
  662. package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +135 -210
  663. package/src/feature-libraries/flex-tree/README.md +4 -75
  664. package/src/feature-libraries/flex-tree/context.ts +37 -16
  665. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +69 -291
  666. package/src/feature-libraries/flex-tree/index.ts +7 -13
  667. package/src/feature-libraries/flex-tree/lazyEntity.ts +2 -11
  668. package/src/feature-libraries/flex-tree/lazyField.ts +49 -73
  669. package/src/feature-libraries/flex-tree/lazyNode.ts +25 -154
  670. package/src/feature-libraries/flex-tree/unboxed.ts +9 -68
  671. package/src/feature-libraries/flex-tree/utilities.ts +4 -8
  672. package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -1
  673. package/src/feature-libraries/index.ts +2 -27
  674. package/src/feature-libraries/modular-schema/comparison.ts +4 -6
  675. package/src/feature-libraries/modular-schema/discrepancies.ts +7 -16
  676. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -1
  677. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -4
  678. package/src/feature-libraries/storedToViewSchema.ts +5 -6
  679. package/src/feature-libraries/typed-schema/flexList.ts +3 -3
  680. package/src/feature-libraries/typed-schema/index.ts +1 -3
  681. package/src/feature-libraries/typed-schema/schemaCollection.ts +15 -17
  682. package/src/feature-libraries/typed-schema/typedTreeSchema.ts +35 -127
  683. package/src/feature-libraries/typed-schema/view.ts +4 -13
  684. package/src/index.ts +4 -8
  685. package/src/packageVersion.ts +1 -1
  686. package/src/shared-tree/checkoutFlexTreeView.ts +89 -0
  687. package/src/shared-tree/index.ts +2 -7
  688. package/src/shared-tree/schematizeTree.ts +23 -12
  689. package/src/shared-tree/schematizingTreeView.ts +34 -24
  690. package/src/shared-tree/sharedTree.ts +6 -1
  691. package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -1
  692. package/src/shared-tree/sharedTreeChangeFamily.ts +7 -1
  693. package/src/shared-tree/sharedTreeEditBuilder.ts +9 -4
  694. package/src/shared-tree/treeApi.ts +10 -10
  695. package/src/shared-tree/treeCheckout.ts +26 -15
  696. package/src/shared-tree-core/branch.ts +1 -1
  697. package/src/simple-tree/ProxyBinding.md +23 -23
  698. package/src/simple-tree/api/create.ts +8 -3
  699. package/src/simple-tree/{getJsonSchema.ts → api/getJsonSchema.ts} +3 -3
  700. package/src/simple-tree/{getSimpleSchema.ts → api/getSimpleSchema.ts} +3 -3
  701. package/src/simple-tree/api/index.ts +20 -0
  702. package/src/simple-tree/{jsonSchema.ts → api/jsonSchema.ts} +1 -1
  703. package/src/simple-tree/api/schemaFactory.ts +44 -13
  704. package/src/simple-tree/{simpleSchema.ts → api/simpleSchema.ts} +4 -4
  705. package/src/simple-tree/{simpleSchemaToJsonSchema.ts → api/simpleSchemaToJsonSchema.ts} +4 -4
  706. package/src/simple-tree/api/tree.ts +2 -71
  707. package/src/simple-tree/api/treeApiBeta.ts +101 -0
  708. package/src/simple-tree/api/treeNodeApi.ts +32 -23
  709. package/src/simple-tree/api/verboseTree.ts +1 -1
  710. package/src/simple-tree/{viewSchemaToSimpleSchema.ts → api/viewSchemaToSimpleSchema.ts} +5 -5
  711. package/src/simple-tree/arrayNode.ts +37 -31
  712. package/src/simple-tree/core/index.ts +4 -1
  713. package/src/simple-tree/core/schemaCaching.ts +10 -0
  714. package/src/simple-tree/core/treeNodeKernel.ts +198 -5
  715. package/src/simple-tree/core/treeNodeSchema.ts +1 -1
  716. package/src/simple-tree/core/types.ts +16 -27
  717. package/src/simple-tree/core/withType.ts +3 -1
  718. package/src/simple-tree/index.ts +29 -21
  719. package/src/simple-tree/leafNodeSchema.ts +24 -28
  720. package/src/simple-tree/mapNode.ts +47 -29
  721. package/src/simple-tree/objectNode.ts +51 -46
  722. package/src/simple-tree/proxies.ts +22 -51
  723. package/src/simple-tree/proxyBinding.ts +3 -254
  724. package/src/simple-tree/schemaTypes.ts +8 -8
  725. package/src/simple-tree/toFlexSchema.ts +40 -7
  726. package/src/simple-tree/toMapTree.ts +113 -79
  727. package/src/simple-tree/treeNodeValid.ts +10 -13
  728. package/src/simple-tree/typesUnsafe.ts +13 -13
  729. package/src/simple-tree/walkSchema.ts +81 -0
  730. package/src/treeFactory.ts +2 -1
  731. package/src/util/typeUtils.ts +2 -2
  732. package/dist/core/revertible/index.d.ts.map +0 -1
  733. package/dist/core/revertible/index.js +0 -10
  734. package/dist/core/revertible/index.js.map +0 -1
  735. package/dist/core/revertible/revertible.d.ts.map +0 -1
  736. package/dist/core/revertible/revertible.js.map +0 -1
  737. package/dist/domains/index.d.ts +0 -8
  738. package/dist/domains/index.d.ts.map +0 -1
  739. package/dist/domains/index.js +0 -20
  740. package/dist/domains/index.js.map +0 -1
  741. package/dist/domains/json/index.d.ts +0 -7
  742. package/dist/domains/json/index.d.ts.map +0 -1
  743. package/dist/domains/json/index.js +0 -17
  744. package/dist/domains/json/index.js.map +0 -1
  745. package/dist/domains/json/jsonCursor.d.ts +0 -52
  746. package/dist/domains/json/jsonCursor.d.ts.map +0 -1
  747. package/dist/domains/json/jsonCursor.js +0 -197
  748. package/dist/domains/json/jsonCursor.js.map +0 -1
  749. package/dist/domains/json/jsonDomainSchema.d.ts +0 -24
  750. package/dist/domains/json/jsonDomainSchema.d.ts.map +0 -1
  751. package/dist/domains/json/jsonDomainSchema.js +0 -32
  752. package/dist/domains/json/jsonDomainSchema.js.map +0 -1
  753. package/dist/domains/leafDomain.d.ts +0 -72
  754. package/dist/domains/leafDomain.d.ts.map +0 -1
  755. package/dist/domains/leafDomain.js +0 -88
  756. package/dist/domains/leafDomain.js.map +0 -1
  757. package/dist/domains/schemaBuilder.d.ts +0 -103
  758. package/dist/domains/schemaBuilder.d.ts.map +0 -1
  759. package/dist/domains/schemaBuilder.js +0 -121
  760. package/dist/domains/schemaBuilder.js.map +0 -1
  761. package/dist/domains/testRecursiveDomain.d.ts +0 -17
  762. package/dist/domains/testRecursiveDomain.d.ts.map +0 -1
  763. package/dist/domains/testRecursiveDomain.js +0 -35
  764. package/dist/domains/testRecursiveDomain.js.map +0 -1
  765. package/dist/events/events.d.ts +0 -207
  766. package/dist/events/events.d.ts.map +0 -1
  767. package/dist/events/events.js.map +0 -1
  768. package/dist/feature-libraries/schemaBuilder.d.ts +0 -31
  769. package/dist/feature-libraries/schemaBuilder.d.ts.map +0 -1
  770. package/dist/feature-libraries/schemaBuilder.js +0 -40
  771. package/dist/feature-libraries/schemaBuilder.js.map +0 -1
  772. package/dist/feature-libraries/schemaBuilderBase.d.ts +0 -191
  773. package/dist/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
  774. package/dist/feature-libraries/schemaBuilderBase.js +0 -201
  775. package/dist/feature-libraries/schemaBuilderBase.js.map +0 -1
  776. package/dist/shared-tree/treeView.d.ts +0 -73
  777. package/dist/shared-tree/treeView.d.ts.map +0 -1
  778. package/dist/shared-tree/treeView.js.map +0 -1
  779. package/dist/simple-tree/getJsonSchema.d.ts.map +0 -1
  780. package/dist/simple-tree/getJsonSchema.js.map +0 -1
  781. package/dist/simple-tree/getSimpleSchema.d.ts.map +0 -1
  782. package/dist/simple-tree/getSimpleSchema.js.map +0 -1
  783. package/dist/simple-tree/jsonSchema.d.ts.map +0 -1
  784. package/dist/simple-tree/jsonSchema.js.map +0 -1
  785. package/dist/simple-tree/simpleSchema.d.ts.map +0 -1
  786. package/dist/simple-tree/simpleSchema.js.map +0 -1
  787. package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
  788. package/dist/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
  789. package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
  790. package/dist/simple-tree/viewSchemaToSimpleSchema.js.map +0 -1
  791. package/lib/core/revertible/index.d.ts.map +0 -1
  792. package/lib/core/revertible/index.js.map +0 -1
  793. package/lib/core/revertible/revertible.d.ts.map +0 -1
  794. package/lib/core/revertible/revertible.js.map +0 -1
  795. package/lib/domains/index.d.ts +0 -8
  796. package/lib/domains/index.d.ts.map +0 -1
  797. package/lib/domains/index.js +0 -8
  798. package/lib/domains/index.js.map +0 -1
  799. package/lib/domains/json/index.d.ts +0 -7
  800. package/lib/domains/json/index.d.ts.map +0 -1
  801. package/lib/domains/json/index.js +0 -7
  802. package/lib/domains/json/index.js.map +0 -1
  803. package/lib/domains/json/jsonCursor.d.ts +0 -52
  804. package/lib/domains/json/jsonCursor.d.ts.map +0 -1
  805. package/lib/domains/json/jsonCursor.js +0 -192
  806. package/lib/domains/json/jsonCursor.js.map +0 -1
  807. package/lib/domains/json/jsonDomainSchema.d.ts +0 -24
  808. package/lib/domains/json/jsonDomainSchema.d.ts.map +0 -1
  809. package/lib/domains/json/jsonDomainSchema.js +0 -29
  810. package/lib/domains/json/jsonDomainSchema.js.map +0 -1
  811. package/lib/domains/leafDomain.d.ts +0 -72
  812. package/lib/domains/leafDomain.d.ts.map +0 -1
  813. package/lib/domains/leafDomain.js +0 -85
  814. package/lib/domains/leafDomain.js.map +0 -1
  815. package/lib/domains/schemaBuilder.d.ts +0 -103
  816. package/lib/domains/schemaBuilder.d.ts.map +0 -1
  817. package/lib/domains/schemaBuilder.js +0 -117
  818. package/lib/domains/schemaBuilder.js.map +0 -1
  819. package/lib/domains/testRecursiveDomain.d.ts +0 -17
  820. package/lib/domains/testRecursiveDomain.d.ts.map +0 -1
  821. package/lib/domains/testRecursiveDomain.js +0 -32
  822. package/lib/domains/testRecursiveDomain.js.map +0 -1
  823. package/lib/events/events.d.ts +0 -207
  824. package/lib/events/events.d.ts.map +0 -1
  825. package/lib/events/events.js.map +0 -1
  826. package/lib/feature-libraries/schemaBuilder.d.ts +0 -31
  827. package/lib/feature-libraries/schemaBuilder.d.ts.map +0 -1
  828. package/lib/feature-libraries/schemaBuilder.js +0 -36
  829. package/lib/feature-libraries/schemaBuilder.js.map +0 -1
  830. package/lib/feature-libraries/schemaBuilderBase.d.ts +0 -191
  831. package/lib/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
  832. package/lib/feature-libraries/schemaBuilderBase.js +0 -195
  833. package/lib/feature-libraries/schemaBuilderBase.js.map +0 -1
  834. package/lib/shared-tree/treeView.d.ts +0 -73
  835. package/lib/shared-tree/treeView.d.ts.map +0 -1
  836. package/lib/shared-tree/treeView.js.map +0 -1
  837. package/lib/simple-tree/getJsonSchema.d.ts.map +0 -1
  838. package/lib/simple-tree/getJsonSchema.js.map +0 -1
  839. package/lib/simple-tree/getSimpleSchema.d.ts.map +0 -1
  840. package/lib/simple-tree/getSimpleSchema.js.map +0 -1
  841. package/lib/simple-tree/jsonSchema.d.ts.map +0 -1
  842. package/lib/simple-tree/jsonSchema.js.map +0 -1
  843. package/lib/simple-tree/simpleSchema.d.ts.map +0 -1
  844. package/lib/simple-tree/simpleSchema.js.map +0 -1
  845. package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
  846. package/lib/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
  847. package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
  848. package/src/domains/README.md +0 -6
  849. package/src/domains/fence.json +0 -5
  850. package/src/domains/index.ts +0 -19
  851. package/src/domains/json/fence.json +0 -5
  852. package/src/domains/json/index.ts +0 -13
  853. package/src/domains/json/jsonCursor.ts +0 -247
  854. package/src/domains/json/jsonDomainSchema.ts +0 -47
  855. package/src/domains/leafDomain.ts +0 -97
  856. package/src/domains/schemaBuilder.ts +0 -153
  857. package/src/domains/testRecursiveDomain.ts +0 -38
  858. package/src/events/fence.json +0 -5
  859. package/src/feature-libraries/schemaBuilder.ts +0 -45
  860. package/src/feature-libraries/schemaBuilderBase.ts +0 -393
  861. package/src/shared-tree/treeView.ts +0 -113
  862. /package/dist/core/{revertible/revertible.js → revertible.js} +0 -0
  863. /package/dist/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
  864. /package/dist/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
  865. /package/dist/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
  866. /package/lib/core/{revertible/revertible.js → revertible.js} +0 -0
  867. /package/lib/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
  868. /package/lib/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
  869. /package/lib/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
@@ -9,17 +9,17 @@ export declare const EncodedSchemaChange: import("@sinclair/typebox").TObject<{
9
9
  nodes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
10
10
  object: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
11
11
  kind: import("@sinclair/typebox").TUnsafe<import("../../index.js").FieldKindIdentifier>;
12
- types: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../index.js").TreeNodeSchemaIdentifier<string>>>>;
12
+ types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../index.js").TreeNodeSchemaIdentifier<string>>>;
13
13
  }>>>;
14
14
  map: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
15
15
  kind: import("@sinclair/typebox").TUnsafe<import("../../index.js").FieldKindIdentifier>;
16
- types: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../index.js").TreeNodeSchemaIdentifier<string>>>>;
16
+ types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../index.js").TreeNodeSchemaIdentifier<string>>>;
17
17
  }>>;
18
18
  leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof import("../../core/schema-stored/format.js").PersistedValueSchema>>;
19
19
  }>>;
20
20
  root: import("@sinclair/typebox").TObject<{
21
21
  kind: import("@sinclair/typebox").TUnsafe<import("../../index.js").FieldKindIdentifier>;
22
- types: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../index.js").TreeNodeSchemaIdentifier<string>>>>;
22
+ types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../index.js").TreeNodeSchemaIdentifier<string>>>;
23
23
  }>;
24
24
  }>;
25
25
  old: import("@sinclair/typebox").TObject<{
@@ -27,17 +27,17 @@ export declare const EncodedSchemaChange: import("@sinclair/typebox").TObject<{
27
27
  nodes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
28
28
  object: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
29
29
  kind: import("@sinclair/typebox").TUnsafe<import("../../index.js").FieldKindIdentifier>;
30
- types: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../index.js").TreeNodeSchemaIdentifier<string>>>>;
30
+ types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../index.js").TreeNodeSchemaIdentifier<string>>>;
31
31
  }>>>;
32
32
  map: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
33
33
  kind: import("@sinclair/typebox").TUnsafe<import("../../index.js").FieldKindIdentifier>;
34
- types: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../index.js").TreeNodeSchemaIdentifier<string>>>>;
34
+ types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../index.js").TreeNodeSchemaIdentifier<string>>>;
35
35
  }>>;
36
36
  leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof import("../../core/schema-stored/format.js").PersistedValueSchema>>;
37
37
  }>>;
38
38
  root: import("@sinclair/typebox").TObject<{
39
39
  kind: import("@sinclair/typebox").TUnsafe<import("../../index.js").FieldKindIdentifier>;
40
- types: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../index.js").TreeNodeSchemaIdentifier<string>>>>;
40
+ types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../index.js").TreeNodeSchemaIdentifier<string>>>;
41
41
  }>;
42
42
  }>;
43
43
  }>;
@@ -19,17 +19,17 @@ export declare const Format: import("@sinclair/typebox").TObject<{
19
19
  nodes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
20
20
  object: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
21
21
  kind: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKindIdentifier>;
22
- types: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormat.TreeNodeSchemaIdentifier<string>>>>;
22
+ types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormat.TreeNodeSchemaIdentifier<string>>>;
23
23
  }>>>;
24
24
  map: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
25
25
  kind: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKindIdentifier>;
26
- types: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormat.TreeNodeSchemaIdentifier<string>>>>;
26
+ types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormat.TreeNodeSchemaIdentifier<string>>>;
27
27
  }>>;
28
28
  leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof schemaFormat.PersistedValueSchema>>;
29
29
  }>>;
30
30
  root: import("@sinclair/typebox").TObject<{
31
31
  kind: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKindIdentifier>;
32
- types: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormat.TreeNodeSchemaIdentifier<string>>>>;
32
+ types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormat.TreeNodeSchemaIdentifier<string>>>;
33
33
  }>;
34
34
  }>;
35
35
  export type Format = Static<typeof Format>;
@@ -1 +1 @@
1
- {"version":3,"file":"storedToViewSchema.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/storedToViewSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAGN,eAAe,EAIf,KAAK,kBAAkB,EACvB,KAAK,cAAc,EAEnB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,gBAAgB,GAAG,cAAc,CAoCnF;AAgBD,wBAAgB,2BAA2B,CAC1C,MAAM,EAAE,qBAAqB,EAC7B,GAAG,EAAE,WAAW,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,GAC5D,eAAe,CAOjB"}
1
+ {"version":3,"file":"storedToViewSchema.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/storedToViewSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAEN,eAAe,EAIf,KAAK,kBAAkB,EACvB,KAAK,cAAc,EAEnB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,gBAAgB,GAAG,cAAc,CAoCnF;AAgBD,wBAAgB,2BAA2B,CAC1C,MAAM,EAAE,qBAAqB,EAC7B,GAAG,EAAE,WAAW,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,GAC5D,eAAe,CAOjB"}
@@ -6,7 +6,7 @@ import { assert } from "@fluidframework/core-utils/internal";
6
6
  import { LeafNodeStoredSchema, MapNodeStoredSchema, ObjectNodeStoredSchema, } from "../core/index.js";
7
7
  import { fail } from "../util/index.js";
8
8
  import { defaultSchemaPolicy } from "./default-schema/index.js";
9
- import { Any, FlexFieldSchema, FlexMapNodeSchema, FlexObjectNodeSchema, LeafNodeSchema, } from "./typed-schema/index.js";
9
+ import { FlexFieldSchema, FlexMapNodeSchema, FlexObjectNodeSchema, LeafNodeSchema, } from "./typed-schema/index.js";
10
10
  /**
11
11
  * Creates a new view schema using the stored schema.
12
12
  * @remarks
@@ -19,7 +19,7 @@ export function treeSchemaFromStoredSchema(schema) {
19
19
  const map = new Map();
20
20
  for (const [identifier, innerSchema] of schema.nodeSchema) {
21
21
  if (innerSchema instanceof LeafNodeStoredSchema) {
22
- map.set(identifier, LeafNodeSchema.create({ name: "intoTypedSchema" }, identifier, innerSchema.leafValue));
22
+ map.set(identifier, new LeafNodeSchema({ name: "intoTypedSchema" }, identifier, innerSchema.leafValue));
23
23
  }
24
24
  else if (innerSchema instanceof MapNodeStoredSchema) {
25
25
  map.set(identifier, FlexMapNodeSchema.create({ name: "intoTypedSchema" }, identifier, fieldSchemaFromStoredSchema(innerSchema.mapFields, map)));
@@ -56,9 +56,7 @@ function mapToObject(map) {
56
56
  }
57
57
  export function fieldSchemaFromStoredSchema(schema, map) {
58
58
  const kind = defaultSchemaPolicy.fieldKinds.get(schema.kind) ?? fail("missing field kind");
59
- const types = schema.types === undefined
60
- ? [Any]
61
- : Array.from(schema.types, (v) => () => map.get(v) ?? fail("missing schema"));
59
+ const types = Array.from(schema.types, (v) => () => map.get(v) ?? fail("missing schema"));
62
60
  return FlexFieldSchema.create(kind, types);
63
61
  }
64
62
  //# sourceMappingURL=storedToViewSchema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"storedToViewSchema.js","sourceRoot":"","sources":["../../src/feature-libraries/storedToViewSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EACN,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,GAItB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACN,GAAG,EAEH,eAAe,EAEf,iBAAiB,EACjB,oBAAoB,EAGpB,cAAc,GACd,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA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B,CAAC,MAAM,CAAC,eAAe,EAAE,GAAG,CAAC;QACzE,UAAU,EAAE,GAAG;KACf,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAW,GAA0B;IACxD,MAAM,SAAS,GAA6B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1C,yFAAyF;QACzF,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE;YACrC,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;YACf,KAAK;SACL,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,2BAA2B,CAC1C,MAA6B,EAC7B,GAA8D;IAE9D,MAAM,IAAI,GAAG,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAC3F,MAAM,KAAK,GACV,MAAM,CAAC,KAAK,KAAK,SAAS;QACzB,CAAC,CAAC,CAAC,GAAG,CAAC;QACP,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAChF,OAAO,eAAe,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeStoredSchema,\n} from \"../core/index.js\";\nimport { fail } from \"../util/index.js\";\n\nimport { defaultSchemaPolicy } from \"./default-schema/index.js\";\nimport {\n\tAny,\n\ttype FlexAllowedTypes,\n\tFlexFieldSchema,\n\ttype FlexMapFieldSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype FlexTreeNodeSchema,\n\ttype FlexTreeSchema,\n\tLeafNodeSchema,\n} from \"./typed-schema/index.js\";\n\n/**\n * Creates a new view schema using the stored schema.\n * @remarks\n * This is really only suitable for use with code that happens to need access to things which require a view schema, but isn't actually schema aware.\n * If the input schema came from a view schema, it will not return the same view schema, and will not be compatible:\n * the returned TreeSchema is simply one which schematize will not object to.\n * Assumes the schema uses the default field kinds.\n */\nexport function treeSchemaFromStoredSchema(schema: TreeStoredSchema): FlexTreeSchema {\n\tconst map: Map<TreeNodeSchemaIdentifier, FlexTreeNodeSchema> = new Map();\n\tfor (const [identifier, innerSchema] of schema.nodeSchema) {\n\t\tif (innerSchema instanceof LeafNodeStoredSchema) {\n\t\t\tmap.set(\n\t\t\t\tidentifier,\n\t\t\t\tLeafNodeSchema.create({ name: \"intoTypedSchema\" }, identifier, innerSchema.leafValue),\n\t\t\t);\n\t\t} else if (innerSchema instanceof MapNodeStoredSchema) {\n\t\t\tmap.set(\n\t\t\t\tidentifier,\n\t\t\t\tFlexMapNodeSchema.create(\n\t\t\t\t\t{ name: \"intoTypedSchema\" },\n\t\t\t\t\tidentifier,\n\t\t\t\t\tfieldSchemaFromStoredSchema(innerSchema.mapFields, map) as FlexMapFieldSchema,\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\tassert(innerSchema instanceof ObjectNodeStoredSchema, 0x882 /* unsupported node kind */);\n\t\t\tconst fields = new Map<string, FlexFieldSchema>();\n\t\t\tfor (const [key, field] of innerSchema.objectNodeFields) {\n\t\t\t\tfields.set(key, fieldSchemaFromStoredSchema(field, map));\n\t\t\t}\n\t\t\tconst fieldsObject = mapToObject(fields);\n\t\t\tmap.set(\n\t\t\t\tidentifier,\n\t\t\t\tFlexObjectNodeSchema.create({ name: \"intoTypedSchema\" }, identifier, fieldsObject),\n\t\t\t);\n\t\t}\n\t}\n\treturn {\n\t\tadapters: {},\n\t\tpolicy: defaultSchemaPolicy,\n\t\trootFieldSchema: fieldSchemaFromStoredSchema(schema.rootFieldSchema, map),\n\t\tnodeSchema: map,\n\t};\n}\n\nfunction mapToObject<MapValue>(map: Map<string, MapValue>): Record<string, MapValue> {\n\tconst objectMap: Record<string, MapValue> = Object.create(null);\n\tfor (const [key, value] of map.entries()) {\n\t\t// This code has to be careful to avoid assigned to __proto__ or similar built in fields.\n\t\tObject.defineProperty(objectMap, key, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\twritable: false,\n\t\t\tvalue,\n\t\t});\n\t}\n\treturn objectMap;\n}\n\nexport function fieldSchemaFromStoredSchema(\n\tschema: TreeFieldStoredSchema,\n\tmap: ReadonlyMap<TreeNodeSchemaIdentifier, FlexTreeNodeSchema>,\n): FlexFieldSchema {\n\tconst kind = defaultSchemaPolicy.fieldKinds.get(schema.kind) ?? fail(\"missing field kind\");\n\tconst types: FlexAllowedTypes =\n\t\tschema.types === undefined\n\t\t\t? [Any]\n\t\t\t: Array.from(schema.types, (v) => () => map.get(v) ?? fail(\"missing schema\"));\n\treturn FlexFieldSchema.create(kind, types);\n}\n"]}
1
+ {"version":3,"file":"storedToViewSchema.js","sourceRoot":"","sources":["../../src/feature-libraries/storedToViewSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EACN,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,GAItB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAA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UAAU,EAAE,YAAY,CAAC,CAClF,CAAC;QACH,CAAC;IACF,CAAC;IACD,OAAO;QACN,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,mBAAmB;QAC3B,eAAe,EAAE,2BAA2B,CAAC,MAAM,CAAC,eAAe,EAAE,GAAG,CAAC;QACzE,UAAU,EAAE,GAAG;KACf,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAW,GAA0B;IACxD,MAAM,SAAS,GAA6B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1C,yFAAyF;QACzF,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE;YACrC,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;YACf,KAAK;SACL,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,2BAA2B,CAC1C,MAA6B,EAC7B,GAA8D;IAE9D,MAAM,IAAI,GAAG,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAC3F,MAAM,KAAK,GAAqB,KAAK,CAAC,IAAI,CACzC,MAAM,CAAC,KAAK,EACZ,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,CACjD,CAAC;IACF,OAAO,eAAe,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeStoredSchema,\n} from \"../core/index.js\";\nimport { fail } from \"../util/index.js\";\n\nimport { defaultSchemaPolicy } from \"./default-schema/index.js\";\nimport {\n\ttype FlexAllowedTypes,\n\tFlexFieldSchema,\n\ttype FlexMapFieldSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype FlexTreeNodeSchema,\n\ttype FlexTreeSchema,\n\tLeafNodeSchema,\n} from \"./typed-schema/index.js\";\n\n/**\n * Creates a new view schema using the stored schema.\n * @remarks\n * This is really only suitable for use with code that happens to need access to things which require a view schema, but isn't actually schema aware.\n * If the input schema came from a view schema, it will not return the same view schema, and will not be compatible:\n * the returned TreeSchema is simply one which schematize will not object to.\n * Assumes the schema uses the default field kinds.\n */\nexport function treeSchemaFromStoredSchema(schema: TreeStoredSchema): FlexTreeSchema {\n\tconst map: Map<TreeNodeSchemaIdentifier, FlexTreeNodeSchema> = new Map();\n\tfor (const [identifier, innerSchema] of schema.nodeSchema) {\n\t\tif (innerSchema instanceof LeafNodeStoredSchema) {\n\t\t\tmap.set(\n\t\t\t\tidentifier,\n\t\t\t\tnew LeafNodeSchema({ name: \"intoTypedSchema\" }, identifier, innerSchema.leafValue),\n\t\t\t);\n\t\t} else if (innerSchema instanceof MapNodeStoredSchema) {\n\t\t\tmap.set(\n\t\t\t\tidentifier,\n\t\t\t\tFlexMapNodeSchema.create(\n\t\t\t\t\t{ name: \"intoTypedSchema\" },\n\t\t\t\t\tidentifier,\n\t\t\t\t\tfieldSchemaFromStoredSchema(innerSchema.mapFields, map) as FlexMapFieldSchema,\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\tassert(innerSchema instanceof ObjectNodeStoredSchema, 0x882 /* unsupported node kind */);\n\t\t\tconst fields = new Map<string, FlexFieldSchema>();\n\t\t\tfor (const [key, field] of innerSchema.objectNodeFields) {\n\t\t\t\tfields.set(key, fieldSchemaFromStoredSchema(field, map));\n\t\t\t}\n\t\t\tconst fieldsObject = mapToObject(fields);\n\t\t\tmap.set(\n\t\t\t\tidentifier,\n\t\t\t\tFlexObjectNodeSchema.create({ name: \"intoTypedSchema\" }, identifier, fieldsObject),\n\t\t\t);\n\t\t}\n\t}\n\treturn {\n\t\tadapters: {},\n\t\tpolicy: defaultSchemaPolicy,\n\t\trootFieldSchema: fieldSchemaFromStoredSchema(schema.rootFieldSchema, map),\n\t\tnodeSchema: map,\n\t};\n}\n\nfunction mapToObject<MapValue>(map: Map<string, MapValue>): Record<string, MapValue> {\n\tconst objectMap: Record<string, MapValue> = Object.create(null);\n\tfor (const [key, value] of map.entries()) {\n\t\t// This code has to be careful to avoid assigned to __proto__ or similar built in fields.\n\t\tObject.defineProperty(objectMap, key, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\twritable: false,\n\t\t\tvalue,\n\t\t});\n\t}\n\treturn objectMap;\n}\n\nexport function fieldSchemaFromStoredSchema(\n\tschema: TreeFieldStoredSchema,\n\tmap: ReadonlyMap<TreeNodeSchemaIdentifier, FlexTreeNodeSchema>,\n): FlexFieldSchema {\n\tconst kind = defaultSchemaPolicy.fieldKinds.get(schema.kind) ?? fail(\"missing field kind\");\n\tconst types: FlexAllowedTypes = Array.from(\n\t\tschema.types,\n\t\t(v) => () => map.get(v) ?? fail(\"missing schema\"),\n\t);\n\treturn FlexFieldSchema.create(kind, types);\n}\n"]}
@@ -20,7 +20,7 @@ export declare function markEager<T>(t: T): T;
20
20
  * To force a `"function"` item to be treated as an eager item, call `markEager` before putting it in the list.
21
21
  * This is necessary e.g. when the eager list items are function types and the lazy items are functions that _return_ function types.
22
22
  * `FlexList`s are processed by `normalizeFlexList` and `normalizeFlexListEager`.
23
- * @public
23
+ * @system @public
24
24
  */
25
25
  export type FlexList<Item = unknown> = readonly LazyItem<Item>[];
26
26
  /**
@@ -44,7 +44,7 @@ export type NormalizedFlexList<Item> = readonly Item[];
44
44
  export type NormalizedLazyFlexList<Item> = (() => Item)[];
45
45
  /**
46
46
  * Get the `Item` type from a `LazyItem<Item>`.
47
- * @public
47
+ * @system @public
48
48
  */
49
49
  export type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result ? Result : Item;
50
50
  /**
@@ -57,7 +57,7 @@ export type NormalizeLazyItem<List extends LazyItem> = List extends () => unknow
57
57
  export type FlexListToNonLazyArray<List extends FlexList> = ArrayHasFixedLength<List> extends true ? ConstantFlexListToNonLazyArray<List> : NormalizedFlexList<ExtractListItemType<List>>;
58
58
  /**
59
59
  * Normalize FlexList type to a union.
60
- * @public
60
+ * @system @public
61
61
  */
62
62
  export type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
63
63
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"flexList.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/flexList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iDAAiD;AACjD,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAU/C,gFAAgF;AAChF,MAAM,UAAU,MAAM,CAAO,IAAoB;IAChD,OAAO,OAAO,IAAI,KAAK,UAAU,IAAK,IAA6B,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;AAC7F,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAI,CAAI;IAChC,OAAO,MAAM,CAAC,CAAC,CAAC;QACf,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE;YACxC,KAAK,EAAE,IAAI;YACX,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;SACf,CAAC;QACH,CAAC,CAAC,CAAC,CAAC;AACN,CAAC;AAcD;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACpC,CAAO;IAEP,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAe,EAAE,EAAE;QAChC,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACnB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC;IACpB,CAAC,CAA8B,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACrC,CAAO;IAEP,MAAM,IAAI,GAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,KAAe,EAAE,EAAE;QAC1D,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACnB,OAAO,KAAK,EAAE,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;IACH,OAAO,IAAoC,CAAC;AAC7C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/** A symbol used to identify a `MarkedEager`. */\nconst flexListEager = Symbol(\"FlexList Eager\");\n\n/**\n * An object that has been marked as eager (as opposed to lazy) when used as an item in a `FlexList`.\n * It will be considered to be an eager item in a `FlexList` even if it is a function.\n */\ninterface MarkedEager {\n\t[flexListEager]: true;\n}\n\n/** Returns true iff the given item is a function and is not a `MarkedEager`. */\nexport function isLazy<Item>(item: LazyItem<Item>): item is () => Item {\n\treturn typeof item === \"function\" && (item as Partial<MarkedEager>)[flexListEager] !== true;\n}\n\n/**\n * Mark the given object as an eager item in a `FlexList`.\n * @remarks\n * This only has an effect on function objects that would otherwise be considered to be lazy items in a `FlexList`.\n * @param t - The object to mark as eager.\n * @returns `t`, marked as eager if applicable.\n */\nexport function markEager<T>(t: T): T {\n\treturn isLazy(t)\n\t\t? Object.defineProperty(t, flexListEager, {\n\t\t\t\tvalue: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\twritable: false,\n\t\t\t})\n\t\t: t;\n}\n\n/**\n * A flexible way to list values.\n * Each item in the list can either be an \"eager\" **value** or a \"lazy\" **function that returns a value** (the latter allows cyclic references to work).\n * @privateRemarks\n * By default, items that are of type `\"function\"` will be considered lazy and all other items will be considered eager.\n * To force a `\"function\"` item to be treated as an eager item, call `markEager` before putting it in the list.\n * This is necessary e.g. when the eager list items are function types and the lazy items are functions that _return_ function types.\n * `FlexList`s are processed by `normalizeFlexList` and `normalizeFlexListEager`.\n * @public\n */\nexport type FlexList<Item = unknown> = readonly LazyItem<Item>[];\n\n/**\n * Given a `FlexList` of eager and lazy items, return an equivalent list where all items are lazy.\n */\nexport function normalizeFlexListLazy<List extends FlexList>(\n\tt: List,\n): FlexListToLazyArray<List> {\n\treturn t.map((value: LazyItem) => {\n\t\tif (isLazy(value)) {\n\t\t\treturn value;\n\t\t}\n\t\treturn () => value;\n\t}) as FlexListToLazyArray<List>;\n}\n\n/**\n * Given a `FlexList` of eager and lazy items, return an equivalent list where all items are eager.\n */\nexport function normalizeFlexListEager<List extends FlexList>(\n\tt: List,\n): FlexListToNonLazyArray<List> {\n\tconst data: readonly unknown[] = t.map((value: LazyItem) => {\n\t\tif (isLazy(value)) {\n\t\t\treturn value();\n\t\t}\n\t\treturn value;\n\t});\n\treturn data as FlexListToNonLazyArray<List>;\n}\n\n/**\n * An \"eager\" or \"lazy\" Item in a `FlexList`.\n * Lazy items are wrapped in a function to allow referring to themselves before they are declared.\n * This makes recursive and co-recursive items possible.\n * @public\n */\nexport type LazyItem<Item = unknown> = Item | (() => Item);\n\n/**\n */\nexport type NormalizedFlexList<Item> = readonly Item[];\n\nexport type NormalizedLazyFlexList<Item> = (() => Item)[];\n\n/**\n * Get the `Item` type from a `LazyItem<Item>`.\n * @public\n */\nexport type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result\n\t? Result\n\t: Item;\n\n/**\n */\nexport type ExtractListItemType<List extends FlexList> = List extends FlexList<infer Item>\n\t? Item\n\t: unknown;\n\nexport type NormalizeLazyItem<List extends LazyItem> = List extends () => unknown\n\t? List\n\t: () => List;\n\n/**\n * Normalize FlexList type to a non-lazy array.\n */\nexport type FlexListToNonLazyArray<List extends FlexList> =\n\tArrayHasFixedLength<List> extends true\n\t\t? ConstantFlexListToNonLazyArray<List>\n\t\t: NormalizedFlexList<ExtractListItemType<List>>;\n\n/**\n * Normalize FlexList type to a union.\n * @public\n */\nexport type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;\n\n/**\n * Normalize FlexList type to a non-lazy array.\n */\nexport type ConstantFlexListToNonLazyArray<List extends FlexList> = List extends readonly [\n\tinfer Head,\n\t...infer Tail,\n]\n\t? [ExtractItemType<Head>, ...ConstantFlexListToNonLazyArray<Tail>]\n\t: [];\n\n/**\n * Detect if an array is a Tuple (fixed length) or unknown length.\n *\n * Types which many have one of multiple fixed lengths (like `[] | [0]`) count as having a fixed length.\n *\n * @remarks\n * Type operations designed to work on tuples can often behave very badly on regular arrays.\n * For example recursive patterns for processing them often just return the base case,\n * losing all the type information.\n */\n// This works by determining if the length is `number` (and not a specific number).\nexport type ArrayHasFixedLength<List extends readonly unknown[]> =\n\tnumber extends List[\"length\"] ? false : true;\n\n/**\n * Normalize FlexList type to a lazy array.\n */\nexport type FlexListToLazyArray<List extends FlexList> = ArrayHasFixedLength<List> extends true\n\t? ConstantFlexListToLazyArray<List>\n\t: NormalizedLazyFlexList<ExtractListItemType<List>>;\n\n/**\n * Normalize FlexList type to a lazy array.\n */\nexport type ConstantFlexListToLazyArray<List extends FlexList> = List extends readonly [\n\tinfer Head,\n\t...infer Tail,\n]\n\t? [NormalizeLazyItem<Head>, ...ConstantFlexListToLazyArray<Tail>]\n\t: [];\n"]}
1
+ {"version":3,"file":"flexList.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/flexList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iDAAiD;AACjD,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAU/C,gFAAgF;AAChF,MAAM,UAAU,MAAM,CAAO,IAAoB;IAChD,OAAO,OAAO,IAAI,KAAK,UAAU,IAAK,IAA6B,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;AAC7F,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAI,CAAI;IAChC,OAAO,MAAM,CAAC,CAAC,CAAC;QACf,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE;YACxC,KAAK,EAAE,IAAI;YACX,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;SACf,CAAC;QACH,CAAC,CAAC,CAAC,CAAC;AACN,CAAC;AAcD;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACpC,CAAO;IAEP,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAe,EAAE,EAAE;QAChC,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACnB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC;IACpB,CAAC,CAA8B,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACrC,CAAO;IAEP,MAAM,IAAI,GAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,KAAe,EAAE,EAAE;QAC1D,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACnB,OAAO,KAAK,EAAE,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;IACH,OAAO,IAAoC,CAAC;AAC7C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/** A symbol used to identify a `MarkedEager`. */\nconst flexListEager = Symbol(\"FlexList Eager\");\n\n/**\n * An object that has been marked as eager (as opposed to lazy) when used as an item in a `FlexList`.\n * It will be considered to be an eager item in a `FlexList` even if it is a function.\n */\ninterface MarkedEager {\n\t[flexListEager]: true;\n}\n\n/** Returns true iff the given item is a function and is not a `MarkedEager`. */\nexport function isLazy<Item>(item: LazyItem<Item>): item is () => Item {\n\treturn typeof item === \"function\" && (item as Partial<MarkedEager>)[flexListEager] !== true;\n}\n\n/**\n * Mark the given object as an eager item in a `FlexList`.\n * @remarks\n * This only has an effect on function objects that would otherwise be considered to be lazy items in a `FlexList`.\n * @param t - The object to mark as eager.\n * @returns `t`, marked as eager if applicable.\n */\nexport function markEager<T>(t: T): T {\n\treturn isLazy(t)\n\t\t? Object.defineProperty(t, flexListEager, {\n\t\t\t\tvalue: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\twritable: false,\n\t\t\t})\n\t\t: t;\n}\n\n/**\n * A flexible way to list values.\n * Each item in the list can either be an \"eager\" **value** or a \"lazy\" **function that returns a value** (the latter allows cyclic references to work).\n * @privateRemarks\n * By default, items that are of type `\"function\"` will be considered lazy and all other items will be considered eager.\n * To force a `\"function\"` item to be treated as an eager item, call `markEager` before putting it in the list.\n * This is necessary e.g. when the eager list items are function types and the lazy items are functions that _return_ function types.\n * `FlexList`s are processed by `normalizeFlexList` and `normalizeFlexListEager`.\n * @system @public\n */\nexport type FlexList<Item = unknown> = readonly LazyItem<Item>[];\n\n/**\n * Given a `FlexList` of eager and lazy items, return an equivalent list where all items are lazy.\n */\nexport function normalizeFlexListLazy<List extends FlexList>(\n\tt: List,\n): FlexListToLazyArray<List> {\n\treturn t.map((value: LazyItem) => {\n\t\tif (isLazy(value)) {\n\t\t\treturn value;\n\t\t}\n\t\treturn () => value;\n\t}) as FlexListToLazyArray<List>;\n}\n\n/**\n * Given a `FlexList` of eager and lazy items, return an equivalent list where all items are eager.\n */\nexport function normalizeFlexListEager<List extends FlexList>(\n\tt: List,\n): FlexListToNonLazyArray<List> {\n\tconst data: readonly unknown[] = t.map((value: LazyItem) => {\n\t\tif (isLazy(value)) {\n\t\t\treturn value();\n\t\t}\n\t\treturn value;\n\t});\n\treturn data as FlexListToNonLazyArray<List>;\n}\n\n/**\n * An \"eager\" or \"lazy\" Item in a `FlexList`.\n * Lazy items are wrapped in a function to allow referring to themselves before they are declared.\n * This makes recursive and co-recursive items possible.\n * @public\n */\nexport type LazyItem<Item = unknown> = Item | (() => Item);\n\n/**\n */\nexport type NormalizedFlexList<Item> = readonly Item[];\n\nexport type NormalizedLazyFlexList<Item> = (() => Item)[];\n\n/**\n * Get the `Item` type from a `LazyItem<Item>`.\n * @system @public\n */\nexport type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result\n\t? Result\n\t: Item;\n\n/**\n */\nexport type ExtractListItemType<List extends FlexList> = List extends FlexList<infer Item>\n\t? Item\n\t: unknown;\n\nexport type NormalizeLazyItem<List extends LazyItem> = List extends () => unknown\n\t? List\n\t: () => List;\n\n/**\n * Normalize FlexList type to a non-lazy array.\n */\nexport type FlexListToNonLazyArray<List extends FlexList> =\n\tArrayHasFixedLength<List> extends true\n\t\t? ConstantFlexListToNonLazyArray<List>\n\t\t: NormalizedFlexList<ExtractListItemType<List>>;\n\n/**\n * Normalize FlexList type to a union.\n * @system @public\n */\nexport type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;\n\n/**\n * Normalize FlexList type to a non-lazy array.\n */\nexport type ConstantFlexListToNonLazyArray<List extends FlexList> = List extends readonly [\n\tinfer Head,\n\t...infer Tail,\n]\n\t? [ExtractItemType<Head>, ...ConstantFlexListToNonLazyArray<Tail>]\n\t: [];\n\n/**\n * Detect if an array is a Tuple (fixed length) or unknown length.\n *\n * Types which many have one of multiple fixed lengths (like `[] | [0]`) count as having a fixed length.\n *\n * @remarks\n * Type operations designed to work on tuples can often behave very badly on regular arrays.\n * For example recursive patterns for processing them often just return the base case,\n * losing all the type information.\n */\n// This works by determining if the length is `number` (and not a specific number).\nexport type ArrayHasFixedLength<List extends readonly unknown[]> =\n\tnumber extends List[\"length\"] ? false : true;\n\n/**\n * Normalize FlexList type to a lazy array.\n */\nexport type FlexListToLazyArray<List extends FlexList> = ArrayHasFixedLength<List> extends true\n\t? ConstantFlexListToLazyArray<List>\n\t: NormalizedLazyFlexList<ExtractListItemType<List>>;\n\n/**\n * Normalize FlexList type to a lazy array.\n */\nexport type ConstantFlexListToLazyArray<List extends FlexList> = List extends readonly [\n\tinfer Head,\n\t...infer Tail,\n]\n\t? [NormalizeLazyItem<Head>, ...ConstantFlexListToLazyArray<Tail>]\n\t: [];\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { type FlexTreeNodeSchema, FlexFieldSchema, Any, allowedTypesToTypeSet, type FlexAllowedTypes, type LazyTreeNodeSchema, LeafNodeSchema, FlexMapNodeSchema, FlexObjectNodeSchema, type FlexTreeSchema, type Unenforced, type AllowedTypeSet, type FlexMapFieldSchema, type SchemaCollection, TreeNodeSchemaBase, type FlexObjectNodeFields, schemaIsLeaf, schemaIsMap, schemaIsObjectNode, type NormalizeObjectNodeFields, type NormalizeField, intoStoredSchema, allowedTypesSchemaSet, intoStoredSchemaCollection, } from "./typedTreeSchema.js";
5
+ export { type FlexTreeNodeSchema, FlexFieldSchema, allowedTypesToTypeSet, type FlexAllowedTypes, type LazyTreeNodeSchema, LeafNodeSchema, FlexMapNodeSchema, FlexObjectNodeSchema, type FlexTreeSchema, type Unenforced, type AllowedTypeSet, type FlexMapFieldSchema, type SchemaCollection, TreeNodeSchemaBase, type FlexObjectNodeFields, schemaIsLeaf, schemaIsMap, schemaIsObjectNode, intoStoredSchema, allowedTypesSchemaSet, intoStoredSchemaCollection, } from "./typedTreeSchema.js";
6
6
  export { ViewSchema } from "./view.js";
7
7
  export { type SchemaLibraryData, type SchemaLintConfiguration, aggregateSchemaLibraries, schemaLintDefault, } from "./schemaCollection.js";
8
- export { type FlexList, markEager, type LazyItem, isLazy, type NormalizeLazyItem, type FlexListToUnion, type ExtractItemType, } from "./flexList.js";
8
+ export { type FlexList, markEager, type LazyItem, isLazy, type NormalizeLazyItem, type FlexListToUnion, type ExtractItemType, normalizeFlexListEager, } from "./flexList.js";
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,kBAAkB,EACvB,eAAe,EACf,GAAG,EACH,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,wBAAwB,EACxB,iBAAiB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,KAAK,QAAQ,EACb,SAAS,EACT,KAAK,QAAQ,EACb,MAAM,EACN,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,GACpB,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,kBAAkB,EACvB,eAAe,EACf,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,wBAAwB,EACxB,iBAAiB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,KAAK,QAAQ,EACb,SAAS,EACT,KAAK,QAAQ,EACb,MAAM,EACN,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,sBAAsB,GACtB,MAAM,eAAe,CAAC"}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { FlexFieldSchema, Any, allowedTypesToTypeSet, LeafNodeSchema, FlexMapNodeSchema, FlexObjectNodeSchema, TreeNodeSchemaBase, schemaIsLeaf, schemaIsMap, schemaIsObjectNode, intoStoredSchema, allowedTypesSchemaSet, intoStoredSchemaCollection, } from "./typedTreeSchema.js";
5
+ export { FlexFieldSchema, allowedTypesToTypeSet, LeafNodeSchema, FlexMapNodeSchema, FlexObjectNodeSchema, TreeNodeSchemaBase, schemaIsLeaf, schemaIsMap, schemaIsObjectNode, intoStoredSchema, allowedTypesSchemaSet, intoStoredSchemaCollection, } from "./typedTreeSchema.js";
6
6
  export { ViewSchema } from "./view.js";
7
7
  export { aggregateSchemaLibraries, schemaLintDefault, } from "./schemaCollection.js";
8
- export { markEager, isLazy, } from "./flexList.js";
8
+ export { markEager, isLazy, normalizeFlexListEager, } from "./flexList.js";
9
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,eAAe,EACf,GAAG,EACH,qBAAqB,EAGrB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EAMpB,kBAAkB,EAElB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAGlB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAGN,wBAAwB,EACxB,iBAAiB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAEN,SAAS,EAET,MAAM,GAIN,MAAM,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype FlexTreeNodeSchema,\n\tFlexFieldSchema,\n\tAny,\n\tallowedTypesToTypeSet,\n\ttype FlexAllowedTypes,\n\ttype LazyTreeNodeSchema,\n\tLeafNodeSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype FlexTreeSchema,\n\ttype Unenforced,\n\ttype AllowedTypeSet,\n\ttype FlexMapFieldSchema,\n\ttype SchemaCollection,\n\tTreeNodeSchemaBase,\n\ttype FlexObjectNodeFields,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n\ttype NormalizeObjectNodeFields,\n\ttype NormalizeField,\n\tintoStoredSchema,\n\tallowedTypesSchemaSet,\n\tintoStoredSchemaCollection,\n} from \"./typedTreeSchema.js\";\n\nexport { ViewSchema } from \"./view.js\";\n\nexport {\n\ttype SchemaLibraryData,\n\ttype SchemaLintConfiguration,\n\taggregateSchemaLibraries,\n\tschemaLintDefault,\n} from \"./schemaCollection.js\";\n\nexport {\n\ttype FlexList,\n\tmarkEager,\n\ttype LazyItem,\n\tisLazy,\n\ttype NormalizeLazyItem,\n\ttype FlexListToUnion,\n\ttype ExtractItemType,\n} from \"./flexList.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,eAAe,EACf,qBAAqB,EAGrB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EAMpB,kBAAkB,EAElB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAGN,wBAAwB,EACxB,iBAAiB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAEN,SAAS,EAET,MAAM,EAIN,sBAAsB,GACtB,MAAM,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype FlexTreeNodeSchema,\n\tFlexFieldSchema,\n\tallowedTypesToTypeSet,\n\ttype FlexAllowedTypes,\n\ttype LazyTreeNodeSchema,\n\tLeafNodeSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype FlexTreeSchema,\n\ttype Unenforced,\n\ttype AllowedTypeSet,\n\ttype FlexMapFieldSchema,\n\ttype SchemaCollection,\n\tTreeNodeSchemaBase,\n\ttype FlexObjectNodeFields,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n\tintoStoredSchema,\n\tallowedTypesSchemaSet,\n\tintoStoredSchemaCollection,\n} from \"./typedTreeSchema.js\";\n\nexport { ViewSchema } from \"./view.js\";\n\nexport {\n\ttype SchemaLibraryData,\n\ttype SchemaLintConfiguration,\n\taggregateSchemaLibraries,\n\tschemaLintDefault,\n} from \"./schemaCollection.js\";\n\nexport {\n\ttype FlexList,\n\tmarkEager,\n\ttype LazyItem,\n\tisLazy,\n\ttype NormalizeLazyItem,\n\ttype FlexListToUnion,\n\ttype ExtractItemType,\n\tnormalizeFlexListEager,\n} from \"./flexList.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GAKG;AACH,wBAAgB,wBAAwB,CACvC,iBAAiB,EAAE,uBAAuB,EAC1C,UAAU,EAAE,gBAAgB,EAC5B,eAAe,CAAC,EAAE,eAAe,GAC/B,MAAM,EAAE,CA0CV;AAED,wBAAgB,iBAAiB,CAChC,iBAAiB,EAAE,uBAAuB,EAC1C,UAAU,EAAE,gBAAgB,EAC5B,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,MAAM,EAAE,GACd,IAAI,CAGN;AAED,wBAAgB,aAAa,CAC5B,iBAAiB,EAAE,uBAAuB,EAC1C,UAAU,EAAE,gBAAgB,EAC5B,KAAK,EAAE,eAAe,EACtB,aAAa,EAAE,MAAM,MAAM,EAC3B,MAAM,EAAE,MAAM,EAAE,GACd,IAAI,CAyCN"}
@@ -7,7 +7,7 @@ import { Multiplicity, } from "../../core/index.js";
7
7
  import { fail } from "../../util/index.js";
8
8
  import { FieldKinds, defaultSchemaPolicy } from "../default-schema/index.js";
9
9
  import { normalizeFlexListEager } from "./flexList.js";
10
- import { FlexMapNodeSchema, FlexObjectNodeSchema, LeafNodeSchema, allowedTypesIsAny, } from "./typedTreeSchema.js";
10
+ import { FlexMapNodeSchema, FlexObjectNodeSchema, LeafNodeSchema, } from "./typedTreeSchema.js";
11
11
  {
12
12
  }
13
13
  export const schemaLintDefault = {
@@ -122,18 +122,16 @@ export function validateRootField(lintConfiguration, collection, field, errors)
122
122
  }
123
123
  export function validateField(lintConfiguration, collection, field, describeField, errors) {
124
124
  const types = field.allowedTypes;
125
- if (!allowedTypesIsAny(types)) {
126
- const normalizedTypes = normalizeFlexListEager(types);
127
- for (const type of normalizedTypes) {
128
- const referenced = collection.nodeSchema.get(type.name);
129
- if (referenced === undefined) {
130
- errors.push(`${describeField()} references type "${type.name}" from library "${type.builder.name}" which is not defined. Perhaps another type was intended, or that library needs to be added.`);
131
- }
132
- }
133
- if (types.length === 0 && lintConfiguration.rejectEmpty) {
134
- errors.push(`${describeField()} requires children to have a type from a set of zero types. This means the field must always be empty.`);
125
+ const normalizedTypes = normalizeFlexListEager(types);
126
+ for (const type of normalizedTypes) {
127
+ const referenced = collection.nodeSchema.get(type.name);
128
+ if (referenced === undefined) {
129
+ errors.push(`${describeField()} references type "${type.name}" from library "${type.builder.name}" which is not defined. Perhaps another type was intended, or that library needs to be added.`);
135
130
  }
136
131
  }
132
+ if (types.length === 0 && lintConfiguration.rejectEmpty) {
133
+ errors.push(`${describeField()} requires children to have a type from a set of zero types. This means the field must always be empty.`);
134
+ }
137
135
  const kind = field.kind;
138
136
  const kindFromPolicy = defaultSchemaPolicy.fieldKinds.get(kind.identifier);
139
137
  if (kindFromPolicy === undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"schemaCollection.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/schemaCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAIN,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAA4B,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAE7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAEN,iBAAiB,EACjB,oBAAoB,EAEpB,cAAc,EAEd,iBAAiB,GACjB,MAAM,sBAAsB,CAAC;AAsB9B,CAAC;AAED,CAAC;AAWD,MAAM,CAAC,MAAM,iBAAiB,GAA4B;IACzD,eAAe,EAAE,IAAI;IACrB,WAAW,EAAE,IAAI;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,wBAAwB,CACvC,IAAY,EACZ,iBAA0C,EAC1C,SAAsC,EACtC,eAAiC;IAEjC,MAAM,UAAU,GAAsD,IAAI,GAAG,EAAE,CAAC;IAChF,MAAM,QAAQ,GAAoB,EAAE,IAAI,EAAE,EAAE,EAAE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A8D,CAChF,CAAC;QACH,CAAC;IACF,CAAC,CAAC,+BAA+B;IACjC,gBAAgB;IAChB,6EAA6E;IAC7E,MAAM;IACN,IAAI;AACL,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype Adapters,\n\ttype TreeAdapter,\n\ttype TreeNodeSchemaIdentifier,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport { fail, type requireAssignableTo } from \"../../util/index.js\";\nimport { FieldKinds, defaultSchemaPolicy } from \"../default-schema/index.js\";\n\nimport { normalizeFlexListEager } from \"./flexList.js\";\nimport {\n\ttype FlexFieldSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype FlexTreeNodeSchema,\n\tLeafNodeSchema,\n\ttype SchemaCollection,\n\tallowedTypesIsAny,\n} from \"./typedTreeSchema.js\";\nimport type { Sourced } from \"./view.js\";\n\n// TODO: tests for this file\n\n/**\n * Schema data collected by a single SchemaBuilder (does not include referenced libraries).\n * @internal\n */\nexport interface SchemaLibraryData extends SchemaCollection {\n\treadonly name: string;\n\treadonly adapters: Adapters;\n}\n\n/**\n * Mutable adapter collection which records the associated factory.\n * See {@link Adapters}.\n */\nexport interface SourcedAdapters {\n\treadonly tree: (Sourced & TreeAdapter)[];\n}\n\n{\n\ttype _check = requireAssignableTo<SourcedAdapters, Adapters>;\n}\n\n/**\n * Allows opting into and out of errors for some unusual schema patterns which are usually bugs.\n * @internal\n */\nexport interface SchemaLintConfiguration {\n\treadonly rejectForbidden: boolean;\n\treadonly rejectEmpty: boolean;\n}\n\nexport const schemaLintDefault: SchemaLintConfiguration = {\n\trejectForbidden: true,\n\trejectEmpty: true,\n};\n\n/**\n * Build and validate a SchemaCollection.\n *\n * As much as possible tries to detect anything that might be a mistake made by the schema author.\n * This will error on some valid but probably never intended to be used patterns\n * (like libraries with the same name, nodes which are impossible to create etc).\n *\n * @param name - Name of the resulting library.\n * @param lintConfiguration - configuration for what errors to generate.\n * @param libraries - Data to aggregate into the SchemaCollection.\n * @param rootFieldSchema - Only validated: not included in the result.\n *\n * @privateRemarks\n * This checks that input works with defaultSchemaPolicy.\n * If support fo other policies is added, this will need to take in the policy.\n */\nexport function aggregateSchemaLibraries(\n\tname: string,\n\tlintConfiguration: SchemaLintConfiguration,\n\tlibraries: Iterable<SchemaLibraryData>,\n\trootFieldSchema?: FlexFieldSchema,\n): SchemaLibraryData {\n\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, FlexTreeNodeSchema> = new Map();\n\tconst adapters: SourcedAdapters = { tree: [] };\n\n\tconst errors: string[] = [];\n\tconst librarySet: Set<SchemaLibraryData> = new Set();\n\tconst libraryNames: Set<string> = new Set();\n\n\tfor (const library of libraries) {\n\t\tif (librarySet.has(library)) {\n\t\t\t// SchemaBuilder should ensure this doesn't happen, but include it here for completeness.\n\t\t\terrors.push(`Duplicate library named \"${library.name}\"`);\n\t\t\tcontinue;\n\t\t}\n\t\tlibrarySet.add(library);\n\t\tif (libraryNames.has(library.name)) {\n\t\t\t// This wouldn't break anything, but could make error messages confusing, so its better to avoid duplicates.\n\t\t\terrors.push(`Found another library with name \"${library.name}\"`);\n\t\t}\n\n\t\tfor (const [key, tree] of library.nodeSchema) {\n\t\t\t// This check is an assert since if it fails, the other error messages would be incorrect.\n\t\t\tassert(\n\t\t\t\ttree.builder.name === library.name,\n\t\t\t\t0x6a9 /* tree must be part by the library its in */,\n\t\t\t);\n\t\t\tconst existing = nodeSchema.get(key);\n\t\t\tif (existing !== undefined) {\n\t\t\t\terrors.push(\n\t\t\t\t\t`Multiple tree schema for identifier \"${key}\". One from library \"${existing.builder.name}\" and one from \"${tree.builder.name}\"`,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tnodeSchema.set(key, tree);\n\t\t\t}\n\t\t}\n\t\tfor (const _adapter of library.adapters.tree ?? []) {\n\t\t\tfail(\"Adapters not yet supported\");\n\t\t}\n\t}\n\n\tif (errors.length !== 0) {\n\t\tfail(errors.join(\"\\n\"));\n\t}\n\n\tconst result = { rootFieldSchema, nodeSchema, adapters, policy: defaultSchemaPolicy };\n\tconst errors2 = validateSchemaCollection(lintConfiguration, result, rootFieldSchema);\n\tif (errors2.length !== 0) {\n\t\tfail(errors2.join(\"\\n\"));\n\t}\n\n\treturn {\n\t\tname,\n\t\tnodeSchema,\n\t\tadapters,\n\t};\n}\n\n/**\n * Returns an array of descriptions of errors in the collection.\n *\n * As much as possible tries to detect anything that might be a mistake made by the schema author.\n * This will error on some valid but probably never intended to be used patterns (like never nodes).\n */\nexport function validateSchemaCollection(\n\tlintConfiguration: SchemaLintConfiguration,\n\tcollection: SchemaCollection,\n\trootFieldSchema?: FlexFieldSchema,\n): string[] {\n\tconst errors: string[] = [];\n\n\t// TODO: make this check specific to document schema. Replace check here for no tre or field schema (empty library).\n\tif (collection.nodeSchema.size === 0 && lintConfiguration.rejectEmpty) {\n\t\terrors.push(\"No tree schema are included, meaning no data can possibly be stored.\");\n\t}\n\n\t// Validate that all schema referenced are included, and none are \"never\".\n\tif (rootFieldSchema !== undefined) {\n\t\tvalidateRootField(lintConfiguration, collection, rootFieldSchema, errors);\n\t}\n\tfor (const [identifier, tree] of collection.nodeSchema) {\n\t\tif (tree instanceof FlexMapNodeSchema) {\n\t\t\tvalidateField(\n\t\t\t\tlintConfiguration,\n\t\t\t\tcollection,\n\t\t\t\ttree.info,\n\t\t\t\t() => `Map fields of \"${identifier}\" schema from library \"${tree.builder.name}\"`,\n\t\t\t\terrors,\n\t\t\t);\n\t\t\tif ((tree.info.kind.multiplicity as Multiplicity) === Multiplicity.Single) {\n\t\t\t\terrors.push(\n\t\t\t\t\t`Map fields of \"${identifier}\" schema from library \"${tree.builder.name}\" has kind with multiplicity \"Single\". This is invalid since it requires all possible field keys to have a value under them.`,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (tree instanceof LeafNodeSchema) {\n\t\t\t// No validation for now.\n\t\t} else if (tree instanceof FlexObjectNodeSchema) {\n\t\t\tfor (const [key, field] of tree.objectNodeFields) {\n\t\t\t\tconst description = (): string =>\n\t\t\t\t\t`Object node field \"${key}\" of \"${identifier}\" schema from library \"${tree.builder.name}\"`;\n\t\t\t\tvalidateField(lintConfiguration, collection, field, description, errors);\n\t\t\t}\n\t\t} else {\n\t\t\t// TODO: there should be a common fallback that works for cases without a specialized implementation.\n\t\t\tfail(\"unrecognized node kind\");\n\t\t}\n\t}\n\n\t// TODO: validate adapters\n\treturn errors;\n}\n\nexport function validateRootField(\n\tlintConfiguration: SchemaLintConfiguration,\n\tcollection: SchemaCollection,\n\tfield: FlexFieldSchema,\n\terrors: string[],\n): void {\n\tconst describeField = (): string => `Root field schema`;\n\tvalidateField(lintConfiguration, collection, field, describeField, errors);\n}\n\nexport function validateField(\n\tlintConfiguration: SchemaLintConfiguration,\n\tcollection: SchemaCollection,\n\tfield: FlexFieldSchema,\n\tdescribeField: () => string,\n\terrors: string[],\n): void {\n\tconst types = field.allowedTypes;\n\tif (!allowedTypesIsAny(types)) {\n\t\tconst normalizedTypes = normalizeFlexListEager(types);\n\t\tfor (const type of normalizedTypes) {\n\t\t\tconst referenced = collection.nodeSchema.get(type.name);\n\t\t\tif (referenced === undefined) {\n\t\t\t\terrors.push(\n\t\t\t\t\t`${describeField()} references type \"${type.name}\" from library \"${\n\t\t\t\t\t\ttype.builder.name\n\t\t\t\t\t}\" which is not defined. Perhaps another type was intended, or that library needs to be added.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (types.length === 0 && lintConfiguration.rejectEmpty) {\n\t\t\terrors.push(\n\t\t\t\t`${describeField()} requires children to have a type from a set of zero types. This means the field must always be empty.`,\n\t\t\t);\n\t\t}\n\t}\n\n\tconst kind = field.kind;\n\tconst kindFromPolicy = defaultSchemaPolicy.fieldKinds.get(kind.identifier);\n\tif (kindFromPolicy === undefined) {\n\t\terrors.push(`\"${describeField()}\" has unknown field kind \"${kind.identifier}\".`);\n\t} else if (kindFromPolicy !== kind) {\n\t\terrors.push(\n\t\t\t`${describeField()} has field kind \"${\n\t\t\t\tkind.identifier\n\t\t\t}\" which isn't a reference to the default kind with that identifier.`,\n\t\t);\n\t} else if (kind === FieldKinds.forbidden) {\n\t\tif (lintConfiguration.rejectForbidden) {\n\t\t\terrors.push(\n\t\t\t\t`${describeField()} explicitly uses \"forbidden\" kind, which is not recommended.`,\n\t\t\t);\n\t\t}\n\t} // else if (kind !== counter) {\n\t// \terrors.push(\n\t// \t\t`${describeField()} explicitly uses \"counter\" kind, which is finished.`,\n\t// \t);\n\t// }\n}\n"]}
1
+ {"version":3,"file":"schemaCollection.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/schemaCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAIN,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAA4B,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAE7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAEN,iBAAiB,EACjB,oBAAoB,EAEpB,cAAc,GAEd,MAAM,sBAAsB,CAAC;AAsB9B,CAAC;AAED,CAAC;AAWD,MAAM,CAAC,MAAM,iBAAiB,GAA4B;IACzD,eAAe,EAAE,IAAI;IACrB,WAAW,EAAE,IAAI;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,wBAAwB,CACvC,IAAY,EACZ,iBAA0C,EAC1C,SAAsC,EACtC,eAAiC;IAEjC,MAAM,UAAU,GAAsD,IAAI,GAAG,EAAE,CAAC;IAChF,MAAM,QAAQ,GAAoB,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAE/C,MAAM,MAAM,GAAa,E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,IAAI;AACL,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype Adapters,\n\ttype TreeAdapter,\n\ttype TreeNodeSchemaIdentifier,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport { fail, type requireAssignableTo } from \"../../util/index.js\";\nimport { FieldKinds, defaultSchemaPolicy } from \"../default-schema/index.js\";\n\nimport { normalizeFlexListEager } from \"./flexList.js\";\nimport {\n\ttype FlexFieldSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype FlexTreeNodeSchema,\n\tLeafNodeSchema,\n\ttype SchemaCollection,\n} from \"./typedTreeSchema.js\";\nimport type { Sourced } from \"./view.js\";\n\n// TODO: tests for this file\n\n/**\n * Schema data collected by a single SchemaBuilder (does not include referenced libraries).\n * @internal\n */\nexport interface SchemaLibraryData extends SchemaCollection {\n\treadonly name: string;\n\treadonly adapters: Adapters;\n}\n\n/**\n * Mutable adapter collection which records the associated factory.\n * See {@link Adapters}.\n */\nexport interface SourcedAdapters {\n\treadonly tree: (Sourced & TreeAdapter)[];\n}\n\n{\n\ttype _check = requireAssignableTo<SourcedAdapters, Adapters>;\n}\n\n/**\n * Allows opting into and out of errors for some unusual schema patterns which are usually bugs.\n * @internal\n */\nexport interface SchemaLintConfiguration {\n\treadonly rejectForbidden: boolean;\n\treadonly rejectEmpty: boolean;\n}\n\nexport const schemaLintDefault: SchemaLintConfiguration = {\n\trejectForbidden: true,\n\trejectEmpty: true,\n};\n\n/**\n * Build and validate a SchemaCollection.\n *\n * As much as possible tries to detect anything that might be a mistake made by the schema author.\n * This will error on some valid but probably never intended to be used patterns\n * (like libraries with the same name, nodes which are impossible to create etc).\n *\n * @param name - Name of the resulting library.\n * @param lintConfiguration - configuration for what errors to generate.\n * @param libraries - Data to aggregate into the SchemaCollection.\n * @param rootFieldSchema - Only validated: not included in the result.\n *\n * @privateRemarks\n * This checks that input works with defaultSchemaPolicy.\n * If support fo other policies is added, this will need to take in the policy.\n */\nexport function aggregateSchemaLibraries(\n\tname: string,\n\tlintConfiguration: SchemaLintConfiguration,\n\tlibraries: Iterable<SchemaLibraryData>,\n\trootFieldSchema?: FlexFieldSchema,\n): SchemaLibraryData {\n\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, FlexTreeNodeSchema> = new Map();\n\tconst adapters: SourcedAdapters = { tree: [] };\n\n\tconst errors: string[] = [];\n\tconst librarySet: Set<SchemaLibraryData> = new Set();\n\tconst libraryNames: Set<string> = new Set();\n\n\tfor (const library of libraries) {\n\t\tif (librarySet.has(library)) {\n\t\t\t// SchemaBuilder should ensure this doesn't happen, but include it here for completeness.\n\t\t\terrors.push(`Duplicate library named \"${library.name}\"`);\n\t\t\tcontinue;\n\t\t}\n\t\tlibrarySet.add(library);\n\t\tif (libraryNames.has(library.name)) {\n\t\t\t// This wouldn't break anything, but could make error messages confusing, so its better to avoid duplicates.\n\t\t\terrors.push(`Found another library with name \"${library.name}\"`);\n\t\t}\n\n\t\tfor (const [key, tree] of library.nodeSchema) {\n\t\t\t// This check is an assert since if it fails, the other error messages would be incorrect.\n\t\t\tassert(\n\t\t\t\ttree.builder.name === library.name,\n\t\t\t\t0x6a9 /* tree must be part by the library its in */,\n\t\t\t);\n\t\t\tconst existing = nodeSchema.get(key);\n\t\t\tif (existing !== undefined) {\n\t\t\t\terrors.push(\n\t\t\t\t\t`Multiple tree schema for identifier \"${key}\". One from library \"${existing.builder.name}\" and one from \"${tree.builder.name}\"`,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tnodeSchema.set(key, tree);\n\t\t\t}\n\t\t}\n\t\tfor (const _adapter of library.adapters.tree ?? []) {\n\t\t\tfail(\"Adapters not yet supported\");\n\t\t}\n\t}\n\n\tif (errors.length !== 0) {\n\t\tfail(errors.join(\"\\n\"));\n\t}\n\n\tconst result = { rootFieldSchema, nodeSchema, adapters, policy: defaultSchemaPolicy };\n\tconst errors2 = validateSchemaCollection(lintConfiguration, result, rootFieldSchema);\n\tif (errors2.length !== 0) {\n\t\tfail(errors2.join(\"\\n\"));\n\t}\n\n\treturn {\n\t\tname,\n\t\tnodeSchema,\n\t\tadapters,\n\t};\n}\n\n/**\n * Returns an array of descriptions of errors in the collection.\n *\n * As much as possible tries to detect anything that might be a mistake made by the schema author.\n * This will error on some valid but probably never intended to be used patterns (like never nodes).\n */\nexport function validateSchemaCollection(\n\tlintConfiguration: SchemaLintConfiguration,\n\tcollection: SchemaCollection,\n\trootFieldSchema?: FlexFieldSchema,\n): string[] {\n\tconst errors: string[] = [];\n\n\t// TODO: make this check specific to document schema. Replace check here for no tre or field schema (empty library).\n\tif (collection.nodeSchema.size === 0 && lintConfiguration.rejectEmpty) {\n\t\terrors.push(\"No tree schema are included, meaning no data can possibly be stored.\");\n\t}\n\n\t// Validate that all schema referenced are included, and none are \"never\".\n\tif (rootFieldSchema !== undefined) {\n\t\tvalidateRootField(lintConfiguration, collection, rootFieldSchema, errors);\n\t}\n\tfor (const [identifier, tree] of collection.nodeSchema) {\n\t\tif (tree instanceof FlexMapNodeSchema) {\n\t\t\tvalidateField(\n\t\t\t\tlintConfiguration,\n\t\t\t\tcollection,\n\t\t\t\ttree.info as FlexFieldSchema,\n\t\t\t\t() => `Map fields of \"${identifier}\" schema from library \"${tree.builder.name}\"`,\n\t\t\t\terrors,\n\t\t\t);\n\t\t\tif ((tree.info as FlexFieldSchema).kind.multiplicity === Multiplicity.Single) {\n\t\t\t\terrors.push(\n\t\t\t\t\t`Map fields of \"${identifier}\" schema from library \"${tree.builder.name}\" has kind with multiplicity \"Single\". This is invalid since it requires all possible field keys to have a value under them.`,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (tree instanceof LeafNodeSchema) {\n\t\t\t// No validation for now.\n\t\t} else if (tree instanceof FlexObjectNodeSchema) {\n\t\t\tfor (const [key, field] of tree.objectNodeFields) {\n\t\t\t\tconst description = (): string =>\n\t\t\t\t\t`Object node field \"${key}\" of \"${identifier}\" schema from library \"${tree.builder.name}\"`;\n\t\t\t\tvalidateField(lintConfiguration, collection, field, description, errors);\n\t\t\t}\n\t\t} else {\n\t\t\t// TODO: there should be a common fallback that works for cases without a specialized implementation.\n\t\t\tfail(\"unrecognized node kind\");\n\t\t}\n\t}\n\n\t// TODO: validate adapters\n\treturn errors;\n}\n\nexport function validateRootField(\n\tlintConfiguration: SchemaLintConfiguration,\n\tcollection: SchemaCollection,\n\tfield: FlexFieldSchema,\n\terrors: string[],\n): void {\n\tconst describeField = (): string => `Root field schema`;\n\tvalidateField(lintConfiguration, collection, field, describeField, errors);\n}\n\nexport function validateField(\n\tlintConfiguration: SchemaLintConfiguration,\n\tcollection: SchemaCollection,\n\tfield: FlexFieldSchema,\n\tdescribeField: () => string,\n\terrors: string[],\n): void {\n\tconst types = field.allowedTypes;\n\n\tconst normalizedTypes = normalizeFlexListEager(types);\n\tfor (const type of normalizedTypes) {\n\t\tconst referenced = collection.nodeSchema.get(type.name);\n\t\tif (referenced === undefined) {\n\t\t\terrors.push(\n\t\t\t\t`${describeField()} references type \"${type.name}\" from library \"${\n\t\t\t\t\ttype.builder.name\n\t\t\t\t}\" which is not defined. Perhaps another type was intended, or that library needs to be added.`,\n\t\t\t);\n\t\t}\n\t}\n\tif (types.length === 0 && lintConfiguration.rejectEmpty) {\n\t\terrors.push(\n\t\t\t`${describeField()} requires children to have a type from a set of zero types. This means the field must always be empty.`,\n\t\t);\n\t}\n\n\tconst kind = field.kind;\n\tconst kindFromPolicy = defaultSchemaPolicy.fieldKinds.get(kind.identifier);\n\tif (kindFromPolicy === undefined) {\n\t\terrors.push(`\"${describeField()}\" has unknown field kind \"${kind.identifier}\".`);\n\t} else if (kindFromPolicy !== kind) {\n\t\terrors.push(\n\t\t\t`${describeField()} has field kind \"${\n\t\t\t\tkind.identifier\n\t\t\t}\" which isn't a reference to the default kind with that identifier.`,\n\t\t);\n\t} else if (kind === FieldKinds.forbidden) {\n\t\tif (lintConfiguration.rejectForbidden) {\n\t\t\terrors.push(\n\t\t\t\t`${describeField()} explicitly uses \"forbidden\" kind, which is not recommended.`,\n\t\t\t);\n\t\t}\n\t} // else if (kind !== counter) {\n\t// \terrors.push(\n\t// \t\t`${describeField()} explicitly uses \"counter\" kind, which is finished.`,\n\t// \t);\n\t// }\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { type Adapters, type FieldKey, type StoredSchemaCollection, type TreeFieldStoredSchema, type TreeNodeSchemaIdentifier, type TreeNodeStoredSchema, type TreeStoredSchema, type TreeTypeSet, type ValueSchema } from "../../core/index.js";
6
- import { type Assume, type MakeNominal, type Named } from "../../util/index.js";
6
+ import { type MakeNominal, type Named } from "../../util/index.js";
7
7
  import { FieldKinds } from "../default-schema/index.js";
8
8
  import type { FlexFieldKind, FullSchemaPolicy } from "../modular-schema/index.js";
9
9
  import type { LazyItem } from "./flexList.js";
@@ -12,11 +12,6 @@ import type { LazyItem } from "./flexList.js";
12
12
  export interface FlexObjectNodeFields {
13
13
  readonly [key: string]: FlexFieldSchema;
14
14
  }
15
- /**
16
- */
17
- export type NormalizeObjectNodeFields<T extends FlexObjectNodeFields> = {
18
- readonly [Property in keyof T]: NormalizeField<T[Property]>;
19
- };
20
15
  /**
21
16
  * A placeholder to use in {@link https://www.typescriptlang.org/docs/handbook/2/generics.html#generic-constraints | extends constraints} when using the real type breaks compilation of some recursive types due to {@link https://github.com/microsoft/TypeScript/issues/55758 | a design limitation of TypeScript}.
22
17
  *
@@ -31,39 +26,38 @@ export type Unenforced<_DesiredExtendsConstraint> = unknown;
31
26
  * This can not be enforced using TypeScript since doing so breaks recursive type support.
32
27
  * See note on SchemaBuilder.fieldRecursive.
33
28
  */
34
- export declare abstract class TreeNodeSchemaBase<const out Name extends string = string, const out Specification = unknown> {
29
+ export declare abstract class TreeNodeSchemaBase<const out Specification = unknown> {
35
30
  readonly builder: Named<string>;
36
- readonly name: TreeNodeSchemaIdentifier<Name>;
31
+ readonly name: TreeNodeSchemaIdentifier;
37
32
  readonly info: Specification;
38
33
  readonly stored: TreeNodeStoredSchema;
39
34
  protected _typeCheck: MakeNominal;
40
- protected constructor(builder: Named<string>, name: TreeNodeSchemaIdentifier<Name>, info: Specification, stored: TreeNodeStoredSchema);
35
+ protected constructor(builder: Named<string>, name: TreeNodeSchemaIdentifier, info: Specification, stored: TreeNodeStoredSchema);
41
36
  abstract getFieldSchema(field: FieldKey): FlexFieldSchema;
42
37
  }
43
38
  /**
44
39
  */
45
- export declare class FlexMapNodeSchema<const out Name extends string = string, const out Specification extends Unenforced<FlexMapFieldSchema> = FlexMapFieldSchema> extends TreeNodeSchemaBase<Name, Specification> {
40
+ export declare class FlexMapNodeSchema extends TreeNodeSchemaBase {
46
41
  get mapFields(): FlexMapFieldSchema;
47
42
  protected _typeCheck2?: MakeNominal;
48
- static create<const Name extends string, const Specification extends FlexMapFieldSchema>(builder: Named<string>, name: TreeNodeSchemaIdentifier<Name>, specification: Specification): FlexMapNodeSchema<Name, Specification>;
43
+ static create<const Name extends string>(builder: Named<string>, name: TreeNodeSchemaIdentifier<Name>, specification: FlexMapFieldSchema): FlexMapNodeSchema;
49
44
  getFieldSchema(field: FieldKey): FlexMapFieldSchema;
50
45
  }
51
46
  /**
52
47
  */
53
- export declare class LeafNodeSchema<const out Name extends string = string, const out Specification extends Unenforced<ValueSchema> = ValueSchema> extends TreeNodeSchemaBase<Name, Specification> {
54
- get leafValue(): ValueSchema;
48
+ export declare class LeafNodeSchema extends TreeNodeSchemaBase<ValueSchema> {
55
49
  protected _typeCheck2?: MakeNominal;
56
- static create<const Name extends string, const Specification extends ValueSchema>(builder: Named<string>, name: TreeNodeSchemaIdentifier<Name>, specification: Specification): LeafNodeSchema<Name, Specification>;
50
+ constructor(builder: Named<string>, name: string, specification: ValueSchema);
57
51
  getFieldSchema(field: FieldKey): FlexFieldSchema;
58
52
  }
59
53
  /**
60
54
  */
61
- export declare class FlexObjectNodeSchema<const out Name extends string = string, const out Specification extends Unenforced<FlexObjectNodeFields> = FlexObjectNodeFields> extends TreeNodeSchemaBase<Name, Specification> {
62
- readonly objectNodeFieldsObject: NormalizeObjectNodeFields<Assume<Specification, FlexObjectNodeFields>>;
55
+ export declare class FlexObjectNodeSchema extends TreeNodeSchemaBase {
56
+ readonly objectNodeFieldsObject: FlexObjectNodeFields;
63
57
  readonly objectNodeFields: ReadonlyMap<FieldKey, FlexFieldSchema>;
64
58
  protected _typeCheck2?: MakeNominal;
65
59
  readonly identifierFieldKeys: readonly FieldKey[];
66
- static create<const Name extends string, const Specification extends FlexObjectNodeFields>(builder: Named<string>, name: TreeNodeSchemaIdentifier<Name>, specification: Specification): FlexObjectNodeSchema<Name, Specification>;
60
+ static create(builder: Named<string>, name: TreeNodeSchemaIdentifier, specification: FlexObjectNodeFields): FlexObjectNodeSchema;
67
61
  private constructor();
68
62
  getFieldSchema(field: FieldKey): FlexFieldSchema;
69
63
  }
@@ -75,18 +69,6 @@ export declare class FlexObjectNodeSchema<const out Name extends string = string
75
69
  * For now this is using just the base type since the union is causing issues with schema aware typing, likely due to it being a union and thus distributing over extends clauses.
76
70
  */
77
71
  export type FlexTreeNodeSchema = TreeNodeSchemaBase;
78
- /**
79
- * Convert FieldSchemaSpecification | undefined into TreeFieldSchema.
80
- */
81
- export type NormalizeField<T extends FlexFieldSchema | undefined> = T extends FlexFieldSchema ? T : FlexFieldSchema<typeof FieldKinds.forbidden, []>;
82
- /**
83
- * Allow any node (as long as it meets the schema for its own type).
84
- */
85
- export declare const Any: "Any";
86
- /**
87
- * Allow any node (as long as it meets the schema for its own type).
88
- */
89
- export type Any = typeof Any;
90
72
  /**
91
73
  * Tree type, but can be wrapped in a function to allow referring to types before they are declared.
92
74
  * This makes recursive and co-recursive types possible.
@@ -94,14 +76,8 @@ export type Any = typeof Any;
94
76
  export type LazyTreeNodeSchema = FlexTreeNodeSchema | (() => FlexTreeNodeSchema);
95
77
  /**
96
78
  * Types for use in fields.
97
- *
98
- * "Any" is boxed in an array to allow use as variadic parameter.
99
- */
100
- export type FlexAllowedTypes = readonly [Any] | readonly LazyItem<FlexTreeNodeSchema>[];
101
- /**
102
- * Checks if an {@link FlexAllowedTypes} is {@link (Any:type)}.
103
79
  */
104
- export declare function allowedTypesIsAny(t: FlexAllowedTypes): t is readonly [Any];
80
+ export type FlexAllowedTypes = readonly LazyItem<FlexTreeNodeSchema>[];
105
81
  /**
106
82
  * Subset of TreeFieldSchema thats legal in maps.
107
83
  * This requires empty to be a valid value for the map.
@@ -121,26 +97,19 @@ export type FlexMapFieldSchema = FlexFieldSchema<typeof FieldKinds.optional | ty
121
97
  *
122
98
  * @sealed
123
99
  */
124
- export declare class FlexFieldSchema<out TKind extends FlexFieldKind = FlexFieldKind, const out TTypes extends Unenforced<FlexAllowedTypes> = FlexAllowedTypes> {
100
+ export declare class FlexFieldSchema<out TKind extends FlexFieldKind = FlexFieldKind> {
125
101
  readonly kind: TKind;
126
- readonly allowedTypes: TTypes;
102
+ readonly allowedTypes: FlexAllowedTypes;
127
103
  /**
128
104
  * Schema for a field which must always be empty.
129
105
  */
130
- static readonly empty: FlexFieldSchema<import("../default-schema/defaultFieldKinds.js").Forbidden, readonly []>;
106
+ static readonly empty: FlexFieldSchema<import("../default-schema/defaultFieldKinds.js").Forbidden>;
131
107
  /**
132
108
  * Constructs a TreeFieldSchema.
133
109
  * @privateRemarks
134
110
  * Alias for the constructor, but with extends clause for the `Types` parameter that {@link FlexFieldSchema} can not have (due to recursive type issues).
135
111
  */
136
- static create<TKind extends FlexFieldKind, const Types extends FlexAllowedTypes>(kind: TKind, allowedTypes: Types): FlexFieldSchema<TKind, Types>;
137
- /**
138
- * Constructs a TreeFieldSchema, but missing the extends clause which breaks most recursive types.
139
- * @remarks
140
- * `Types` here must extend `AllowedTypes`, but this cannot be enforced with an "extends" clause: see {@link Unenforced} for details.
141
- * Prefer {@link FlexFieldSchema.create} when possible.
142
- */
143
- static createUnsafe<TKind extends FlexFieldKind, const Types extends Unenforced<FlexAllowedTypes>>(kind: TKind, allowedTypes: Types): FlexFieldSchema<TKind, Types>;
112
+ static create<TKind extends FlexFieldKind>(kind: TKind, allowedTypes: FlexAllowedTypes): FlexFieldSchema<TKind>;
144
113
  protected _typeCheck: MakeNominal;
145
114
  /**
146
115
  * This is computed lazily since types can be recursive, which makes evaluating this have to happen after all the schema are defined.
@@ -190,7 +159,7 @@ export declare class FlexFieldSchema<out TKind extends FlexFieldKind = FlexField
190
159
  * See {@link TreeTypeSet} for a stored-schema compatible version using the {@link TreeNodeSchemaIdentifier}.
191
160
  * See {@link FlexAllowedTypes} for a compile time optimized version.
192
161
  */
193
- export type AllowedTypeSet = Any | ReadonlySet<FlexTreeNodeSchema>;
162
+ export type AllowedTypeSet = ReadonlySet<FlexTreeNodeSchema>;
194
163
  /**
195
164
  * Convert {@link FlexAllowedTypes} to {@link TreeTypeSet}.
196
165
  */
@@ -1 +1 @@
1
- {"version":3,"file":"typedTreeSchema.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/typedTreeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,QAAQ,EAIb,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,KAAK,EAMV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAElF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C;GACG;AACH,MAAM,WAAW,oB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