@fluidframework/tree 2.33.2 → 2.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (621) hide show
  1. package/.vscode/settings.json +2 -0
  2. package/CHANGELOG.md +64 -0
  3. package/api-report/tree.alpha.api.md +124 -51
  4. package/api-report/tree.beta.api.md +31 -27
  5. package/api-report/tree.legacy.alpha.api.md +24 -23
  6. package/api-report/tree.legacy.public.api.md +24 -23
  7. package/api-report/tree.public.api.md +24 -23
  8. package/dist/alpha.d.ts +17 -1
  9. package/dist/beta.d.ts +2 -0
  10. package/dist/codec/codec.d.ts +5 -1
  11. package/dist/codec/codec.d.ts.map +1 -1
  12. package/dist/codec/codec.js +6 -2
  13. package/dist/codec/codec.js.map +1 -1
  14. package/dist/codec/index.d.ts +1 -1
  15. package/dist/codec/index.d.ts.map +1 -1
  16. package/dist/codec/index.js +2 -1
  17. package/dist/codec/index.js.map +1 -1
  18. package/dist/core/index.d.ts +2 -2
  19. package/dist/core/index.d.ts.map +1 -1
  20. package/dist/core/index.js +2 -3
  21. package/dist/core/index.js.map +1 -1
  22. package/dist/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
  23. package/dist/core/schema-stored/formatV1.d.ts.map +1 -0
  24. package/dist/core/schema-stored/{format.js → formatV1.js} +1 -1
  25. package/dist/core/schema-stored/formatV1.js.map +1 -0
  26. package/dist/core/schema-stored/index.d.ts +3 -3
  27. package/dist/core/schema-stored/index.d.ts.map +1 -1
  28. package/dist/core/schema-stored/index.js +3 -3
  29. package/dist/core/schema-stored/index.js.map +1 -1
  30. package/dist/core/schema-stored/schema.d.ts +3 -1
  31. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  32. package/dist/core/schema-stored/schema.js +8 -6
  33. package/dist/core/schema-stored/schema.js.map +1 -1
  34. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  35. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  36. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  37. package/dist/core/schema-view/index.d.ts +1 -1
  38. package/dist/core/schema-view/index.d.ts.map +1 -1
  39. package/dist/core/schema-view/index.js +1 -2
  40. package/dist/core/schema-view/index.js.map +1 -1
  41. package/dist/core/schema-view/view.d.ts +0 -27
  42. package/dist/core/schema-view/view.d.ts.map +1 -1
  43. package/dist/core/schema-view/view.js +1 -35
  44. package/dist/core/schema-view/view.js.map +1 -1
  45. package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
  46. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  47. package/dist/core/tree/persistedTreeTextFormat.js +1 -1
  48. package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
  49. package/dist/feature-libraries/forest-summary/format.d.ts +2 -2
  50. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  51. package/dist/feature-libraries/forest-summary/format.js +1 -1
  52. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  53. package/dist/feature-libraries/index.d.ts +1 -1
  54. package/dist/feature-libraries/index.d.ts.map +1 -1
  55. package/dist/feature-libraries/index.js +4 -2
  56. package/dist/feature-libraries/index.js.map +1 -1
  57. package/dist/feature-libraries/mapTreeCursor.d.ts +3 -3
  58. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  59. package/dist/feature-libraries/mapTreeCursor.js +2 -2
  60. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  61. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
  62. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  63. package/dist/feature-libraries/modular-schema/modularChangeFormat.js +2 -2
  64. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  65. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
  66. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  67. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -5
  68. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  69. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  70. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  71. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  72. package/dist/feature-libraries/schema-index/codec.d.ts +34 -5
  73. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  74. package/dist/feature-libraries/schema-index/codec.js +63 -9
  75. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  76. package/{lib/feature-libraries/schema-index/format.d.ts → dist/feature-libraries/schema-index/formatV1.d.ts} +9 -9
  77. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
  78. package/dist/feature-libraries/schema-index/{format.js → formatV1.js} +4 -4
  79. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -0
  80. package/dist/feature-libraries/schema-index/index.d.ts +2 -2
  81. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  82. package/dist/feature-libraries/schema-index/index.js +6 -3
  83. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  84. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
  85. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  86. package/dist/feature-libraries/schema-index/schemaSummarizer.js +4 -4
  87. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  88. package/dist/index.d.ts +3 -2
  89. package/dist/index.d.ts.map +1 -1
  90. package/dist/index.js +10 -8
  91. package/dist/index.js.map +1 -1
  92. package/dist/internalTypes.d.ts +0 -1
  93. package/dist/internalTypes.d.ts.map +1 -1
  94. package/dist/internalTypes.js.map +1 -1
  95. package/dist/jsonDomainSchema.d.ts +2 -2
  96. package/dist/jsonDomainSchema.js +2 -2
  97. package/dist/jsonDomainSchema.js.map +1 -1
  98. package/dist/legacy.d.ts +2 -0
  99. package/dist/packageVersion.d.ts +1 -1
  100. package/dist/packageVersion.js +1 -1
  101. package/dist/packageVersion.js.map +1 -1
  102. package/dist/public.d.ts +2 -0
  103. package/dist/serializableDomainSchema.d.ts +3 -3
  104. package/dist/serializableDomainSchema.js +2 -2
  105. package/dist/serializableDomainSchema.js.map +1 -1
  106. package/dist/shared-tree/independentView.d.ts +1 -1
  107. package/dist/shared-tree/independentView.d.ts.map +1 -1
  108. package/dist/shared-tree/independentView.js +1 -1
  109. package/dist/shared-tree/independentView.js.map +1 -1
  110. package/dist/shared-tree/index.d.ts +4 -3
  111. package/dist/shared-tree/index.d.ts.map +1 -1
  112. package/dist/shared-tree/index.js +6 -5
  113. package/dist/shared-tree/index.js.map +1 -1
  114. package/dist/shared-tree/schematizeTree.d.ts +10 -11
  115. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  116. package/dist/shared-tree/schematizeTree.js +11 -36
  117. package/dist/shared-tree/schematizeTree.js.map +1 -1
  118. package/dist/shared-tree/schematizingTreeView.d.ts +3 -3
  119. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  120. package/dist/shared-tree/schematizingTreeView.js +4 -7
  121. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  122. package/dist/shared-tree/sharedTree.d.ts +28 -3
  123. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  124. package/dist/shared-tree/sharedTree.js +29 -3
  125. package/dist/shared-tree/sharedTree.js.map +1 -1
  126. package/dist/shared-tree/{treeApi.d.ts → tree.d.ts} +58 -34
  127. package/dist/shared-tree/tree.d.ts.map +1 -0
  128. package/dist/shared-tree/{treeApi.js → tree.js} +6 -6
  129. package/dist/shared-tree/tree.js.map +1 -0
  130. package/{lib/shared-tree/treeApiAlpha.d.ts → dist/shared-tree/treeAlpha.d.ts} +24 -14
  131. package/dist/shared-tree/treeAlpha.d.ts.map +1 -0
  132. package/dist/shared-tree/{treeApiAlpha.js → treeAlpha.js} +7 -5
  133. package/dist/shared-tree/treeAlpha.js.map +1 -0
  134. package/dist/shared-tree-core/branchCommitEnricher.d.ts +0 -1
  135. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  136. package/dist/shared-tree-core/branchCommitEnricher.js +0 -1
  137. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  138. package/dist/shared-tree-core/transactionEnricher.d.ts +1 -1
  139. package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  140. package/dist/shared-tree-core/transactionEnricher.js +4 -1
  141. package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
  142. package/dist/simple-tree/api/conciseTree.d.ts +1 -1
  143. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  144. package/dist/simple-tree/api/configuration.d.ts +177 -0
  145. package/dist/simple-tree/api/configuration.d.ts.map +1 -0
  146. package/dist/simple-tree/api/configuration.js +163 -0
  147. package/dist/simple-tree/api/configuration.js.map +1 -0
  148. package/dist/simple-tree/api/getJsonSchema.js +2 -2
  149. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  150. package/dist/simple-tree/api/index.d.ts +9 -5
  151. package/dist/simple-tree/api/index.d.ts.map +1 -1
  152. package/dist/simple-tree/api/index.js +9 -7
  153. package/dist/simple-tree/api/index.js.map +1 -1
  154. package/dist/simple-tree/api/{view.d.ts → schemaCompatibilityTester.d.ts} +8 -10
  155. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -0
  156. package/dist/simple-tree/api/{view.js → schemaCompatibilityTester.js} +9 -9
  157. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -0
  158. package/dist/simple-tree/api/schemaFactory.d.ts +25 -10
  159. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  160. package/dist/simple-tree/api/schemaFactory.js +27 -12
  161. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  162. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +12 -6
  163. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  164. package/dist/simple-tree/api/schemaFactoryAlpha.js +2 -2
  165. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  166. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +67 -4
  167. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  168. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  169. package/dist/simple-tree/api/schemaFromSimple.d.ts +1 -1
  170. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  171. package/dist/simple-tree/api/schemaFromSimple.js +1 -1
  172. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  173. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  174. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  175. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  176. package/dist/simple-tree/api/storedSchema.d.ts +11 -10
  177. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  178. package/dist/simple-tree/api/storedSchema.js +16 -11
  179. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  180. package/dist/simple-tree/api/tree.d.ts +30 -174
  181. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  182. package/dist/simple-tree/api/tree.js +1 -156
  183. package/dist/simple-tree/api/tree.js.map +1 -1
  184. package/{lib/simple-tree/api/treeApiBeta.d.ts → dist/simple-tree/api/treeBeta.d.ts} +17 -6
  185. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -0
  186. package/dist/simple-tree/api/{treeApiBeta.js → treeBeta.js} +5 -4
  187. package/dist/simple-tree/api/treeBeta.js.map +1 -0
  188. package/dist/simple-tree/api/treeChangeEvents.d.ts +83 -0
  189. package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
  190. package/dist/simple-tree/api/treeChangeEvents.js +7 -0
  191. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -0
  192. package/dist/simple-tree/api/treeNodeApi.d.ts +2 -1
  193. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  194. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  195. package/dist/simple-tree/api/typesUnsafe.d.ts +4 -9
  196. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  197. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  198. package/dist/simple-tree/arrayNode.d.ts +30 -2
  199. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  200. package/dist/simple-tree/arrayNode.js +3 -2
  201. package/dist/simple-tree/arrayNode.js.map +1 -1
  202. package/dist/simple-tree/arrayNodeTypes.d.ts +3 -3
  203. package/dist/simple-tree/arrayNodeTypes.d.ts.map +1 -1
  204. package/dist/simple-tree/arrayNodeTypes.js.map +1 -1
  205. package/dist/simple-tree/core/getOrCreateNode.d.ts +1 -1
  206. package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  207. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
  208. package/dist/simple-tree/core/index.d.ts +2 -1
  209. package/dist/simple-tree/core/index.d.ts.map +1 -1
  210. package/dist/simple-tree/core/index.js +5 -5
  211. package/dist/simple-tree/core/index.js.map +1 -1
  212. package/dist/simple-tree/core/treeNode.d.ts +94 -0
  213. package/dist/simple-tree/core/treeNode.d.ts.map +1 -0
  214. package/dist/simple-tree/core/treeNode.js +123 -0
  215. package/dist/simple-tree/core/treeNode.js.map +1 -0
  216. package/dist/simple-tree/core/treeNodeKernel.d.ts +2 -1
  217. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  218. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  219. package/dist/simple-tree/core/treeNodeSchema.d.ts +3 -1
  220. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  221. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  222. package/dist/simple-tree/core/types.d.ts +0 -165
  223. package/dist/simple-tree/core/types.d.ts.map +1 -1
  224. package/dist/simple-tree/core/types.js +1 -113
  225. package/dist/simple-tree/core/types.js.map +1 -1
  226. package/dist/simple-tree/core/withType.d.ts +1 -1
  227. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  228. package/dist/simple-tree/core/withType.js.map +1 -1
  229. package/dist/simple-tree/index.d.ts +4 -4
  230. package/dist/simple-tree/index.d.ts.map +1 -1
  231. package/dist/simple-tree/index.js +4 -3
  232. package/dist/simple-tree/index.js.map +1 -1
  233. package/dist/simple-tree/mapNode.d.ts +2 -2
  234. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  235. package/dist/simple-tree/mapNode.js +1 -1
  236. package/dist/simple-tree/mapNode.js.map +1 -1
  237. package/dist/simple-tree/mapNodeTypes.d.ts +3 -3
  238. package/dist/simple-tree/mapNodeTypes.d.ts.map +1 -1
  239. package/dist/simple-tree/mapNodeTypes.js.map +1 -1
  240. package/dist/simple-tree/objectNode.d.ts +18 -5
  241. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  242. package/dist/simple-tree/objectNode.js +4 -3
  243. package/dist/simple-tree/objectNode.js.map +1 -1
  244. package/dist/simple-tree/objectNodeTypes.d.ts +4 -4
  245. package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
  246. package/dist/simple-tree/objectNodeTypes.js.map +1 -1
  247. package/dist/simple-tree/schemaTypes.d.ts +164 -13
  248. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  249. package/dist/simple-tree/schemaTypes.js +107 -8
  250. package/dist/simple-tree/schemaTypes.js.map +1 -1
  251. package/dist/simple-tree/toStoredSchema.d.ts +8 -8
  252. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  253. package/dist/simple-tree/toStoredSchema.js +27 -32
  254. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  255. package/dist/simple-tree/treeNodeValid.js +2 -2
  256. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  257. package/dist/tableSchema.d.ts +455 -125
  258. package/dist/tableSchema.d.ts.map +1 -1
  259. package/dist/tableSchema.js +398 -101
  260. package/dist/tableSchema.js.map +1 -1
  261. package/dist/treeFactory.d.ts +1 -1
  262. package/dist/treeFactory.d.ts.map +1 -1
  263. package/dist/treeFactory.js +30 -75
  264. package/dist/treeFactory.js.map +1 -1
  265. package/dist/util/typeUtils.d.ts +1 -1
  266. package/dist/util/typeUtils.js.map +1 -1
  267. package/lib/alpha.d.ts +17 -1
  268. package/lib/beta.d.ts +2 -0
  269. package/lib/codec/codec.d.ts +5 -1
  270. package/lib/codec/codec.d.ts.map +1 -1
  271. package/lib/codec/codec.js +5 -1
  272. package/lib/codec/codec.js.map +1 -1
  273. package/lib/codec/index.d.ts +1 -1
  274. package/lib/codec/index.d.ts.map +1 -1
  275. package/lib/codec/index.js +1 -1
  276. package/lib/codec/index.js.map +1 -1
  277. package/lib/core/index.d.ts +2 -2
  278. package/lib/core/index.d.ts.map +1 -1
  279. package/lib/core/index.js +2 -2
  280. package/lib/core/index.js.map +1 -1
  281. package/lib/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
  282. package/lib/core/schema-stored/formatV1.d.ts.map +1 -0
  283. package/lib/core/schema-stored/{format.js → formatV1.js} +1 -1
  284. package/lib/core/schema-stored/formatV1.js.map +1 -0
  285. package/lib/core/schema-stored/index.d.ts +3 -3
  286. package/lib/core/schema-stored/index.d.ts.map +1 -1
  287. package/lib/core/schema-stored/index.js +2 -2
  288. package/lib/core/schema-stored/index.js.map +1 -1
  289. package/lib/core/schema-stored/schema.d.ts +3 -1
  290. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  291. package/lib/core/schema-stored/schema.js +3 -1
  292. package/lib/core/schema-stored/schema.js.map +1 -1
  293. package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  294. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  295. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  296. package/lib/core/schema-view/index.d.ts +1 -1
  297. package/lib/core/schema-view/index.d.ts.map +1 -1
  298. package/lib/core/schema-view/index.js +1 -1
  299. package/lib/core/schema-view/index.js.map +1 -1
  300. package/lib/core/schema-view/view.d.ts +0 -27
  301. package/lib/core/schema-view/view.d.ts.map +1 -1
  302. package/lib/core/schema-view/view.js +0 -34
  303. package/lib/core/schema-view/view.js.map +1 -1
  304. package/lib/core/tree/persistedTreeTextFormat.d.ts +4 -4
  305. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  306. package/lib/core/tree/persistedTreeTextFormat.js +2 -2
  307. package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
  308. package/lib/feature-libraries/forest-summary/format.d.ts +2 -2
  309. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  310. package/lib/feature-libraries/forest-summary/format.js +2 -2
  311. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  312. package/lib/feature-libraries/index.d.ts +1 -1
  313. package/lib/feature-libraries/index.d.ts.map +1 -1
  314. package/lib/feature-libraries/index.js +1 -1
  315. package/lib/feature-libraries/index.js.map +1 -1
  316. package/lib/feature-libraries/mapTreeCursor.d.ts +3 -3
  317. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  318. package/lib/feature-libraries/mapTreeCursor.js +2 -2
  319. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  320. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
  321. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  322. package/lib/feature-libraries/modular-schema/modularChangeFormat.js +3 -3
  323. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  324. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
  325. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  326. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -6
  327. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  328. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  329. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  330. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
  331. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  332. package/lib/feature-libraries/schema-index/codec.d.ts +34 -5
  333. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  334. package/lib/feature-libraries/schema-index/codec.js +61 -9
  335. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  336. package/{dist/feature-libraries/schema-index/format.d.ts → lib/feature-libraries/schema-index/formatV1.d.ts} +9 -9
  337. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
  338. package/lib/feature-libraries/schema-index/{format.js → formatV1.js} +5 -5
  339. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -0
  340. package/lib/feature-libraries/schema-index/index.d.ts +2 -2
  341. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  342. package/lib/feature-libraries/schema-index/index.js +2 -2
  343. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  344. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
  345. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  346. package/lib/feature-libraries/schema-index/schemaSummarizer.js +5 -5
  347. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  348. package/lib/index.d.ts +3 -2
  349. package/lib/index.d.ts.map +1 -1
  350. package/lib/index.js +1 -0
  351. package/lib/index.js.map +1 -1
  352. package/lib/internalTypes.d.ts +0 -1
  353. package/lib/internalTypes.d.ts.map +1 -1
  354. package/lib/internalTypes.js.map +1 -1
  355. package/lib/jsonDomainSchema.d.ts +2 -2
  356. package/lib/jsonDomainSchema.js +2 -2
  357. package/lib/jsonDomainSchema.js.map +1 -1
  358. package/lib/legacy.d.ts +2 -0
  359. package/lib/packageVersion.d.ts +1 -1
  360. package/lib/packageVersion.js +1 -1
  361. package/lib/packageVersion.js.map +1 -1
  362. package/lib/public.d.ts +2 -0
  363. package/lib/serializableDomainSchema.d.ts +3 -3
  364. package/lib/serializableDomainSchema.js +2 -2
  365. package/lib/serializableDomainSchema.js.map +1 -1
  366. package/lib/shared-tree/independentView.d.ts +1 -1
  367. package/lib/shared-tree/independentView.d.ts.map +1 -1
  368. package/lib/shared-tree/independentView.js +2 -2
  369. package/lib/shared-tree/independentView.js.map +1 -1
  370. package/lib/shared-tree/index.d.ts +4 -3
  371. package/lib/shared-tree/index.d.ts.map +1 -1
  372. package/lib/shared-tree/index.js +3 -3
  373. package/lib/shared-tree/index.js.map +1 -1
  374. package/lib/shared-tree/schematizeTree.d.ts +10 -11
  375. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  376. package/lib/shared-tree/schematizeTree.js +12 -37
  377. package/lib/shared-tree/schematizeTree.js.map +1 -1
  378. package/lib/shared-tree/schematizingTreeView.d.ts +3 -3
  379. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  380. package/lib/shared-tree/schematizingTreeView.js +6 -9
  381. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  382. package/lib/shared-tree/sharedTree.d.ts +28 -3
  383. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  384. package/lib/shared-tree/sharedTree.js +29 -4
  385. package/lib/shared-tree/sharedTree.js.map +1 -1
  386. package/lib/shared-tree/{treeApi.d.ts → tree.d.ts} +58 -34
  387. package/lib/shared-tree/tree.d.ts.map +1 -0
  388. package/lib/shared-tree/{treeApi.js → tree.js} +5 -5
  389. package/lib/shared-tree/tree.js.map +1 -0
  390. package/{dist/shared-tree/treeApiAlpha.d.ts → lib/shared-tree/treeAlpha.d.ts} +24 -14
  391. package/lib/shared-tree/treeAlpha.d.ts.map +1 -0
  392. package/lib/shared-tree/{treeApiAlpha.js → treeAlpha.js} +8 -6
  393. package/lib/shared-tree/treeAlpha.js.map +1 -0
  394. package/lib/shared-tree-core/branchCommitEnricher.d.ts +0 -1
  395. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  396. package/lib/shared-tree-core/branchCommitEnricher.js +0 -1
  397. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  398. package/lib/shared-tree-core/transactionEnricher.d.ts +1 -1
  399. package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  400. package/lib/shared-tree-core/transactionEnricher.js +4 -1
  401. package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
  402. package/lib/simple-tree/api/conciseTree.d.ts +1 -1
  403. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  404. package/lib/simple-tree/api/configuration.d.ts +177 -0
  405. package/lib/simple-tree/api/configuration.d.ts.map +1 -0
  406. package/lib/simple-tree/api/configuration.js +157 -0
  407. package/lib/simple-tree/api/configuration.js.map +1 -0
  408. package/lib/simple-tree/api/getJsonSchema.js +1 -1
  409. package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
  410. package/lib/simple-tree/api/index.d.ts +9 -5
  411. package/lib/simple-tree/api/index.d.ts.map +1 -1
  412. package/lib/simple-tree/api/index.js +5 -4
  413. package/lib/simple-tree/api/index.js.map +1 -1
  414. package/lib/simple-tree/api/{view.d.ts → schemaCompatibilityTester.d.ts} +8 -10
  415. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -0
  416. package/lib/simple-tree/api/{view.js → schemaCompatibilityTester.js} +7 -7
  417. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -0
  418. package/lib/simple-tree/api/schemaFactory.d.ts +25 -10
  419. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  420. package/lib/simple-tree/api/schemaFactory.js +27 -12
  421. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  422. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +12 -6
  423. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  424. package/lib/simple-tree/api/schemaFactoryAlpha.js +2 -2
  425. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  426. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +67 -4
  427. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  428. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  429. package/lib/simple-tree/api/schemaFromSimple.d.ts +1 -1
  430. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  431. package/lib/simple-tree/api/schemaFromSimple.js +1 -1
  432. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  433. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  434. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  435. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  436. package/lib/simple-tree/api/storedSchema.d.ts +11 -10
  437. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  438. package/lib/simple-tree/api/storedSchema.js +20 -13
  439. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  440. package/lib/simple-tree/api/tree.d.ts +30 -174
  441. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  442. package/lib/simple-tree/api/tree.js +0 -152
  443. package/lib/simple-tree/api/tree.js.map +1 -1
  444. package/{dist/simple-tree/api/treeApiBeta.d.ts → lib/simple-tree/api/treeBeta.d.ts} +17 -6
  445. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -0
  446. package/lib/simple-tree/api/{treeApiBeta.js → treeBeta.js} +5 -4
  447. package/lib/simple-tree/api/treeBeta.js.map +1 -0
  448. package/lib/simple-tree/api/treeChangeEvents.d.ts +83 -0
  449. package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
  450. package/lib/simple-tree/api/treeChangeEvents.js +6 -0
  451. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -0
  452. package/lib/simple-tree/api/treeNodeApi.d.ts +2 -1
  453. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  454. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  455. package/lib/simple-tree/api/typesUnsafe.d.ts +4 -9
  456. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  457. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  458. package/lib/simple-tree/arrayNode.d.ts +30 -2
  459. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  460. package/lib/simple-tree/arrayNode.js +4 -3
  461. package/lib/simple-tree/arrayNode.js.map +1 -1
  462. package/lib/simple-tree/arrayNodeTypes.d.ts +3 -3
  463. package/lib/simple-tree/arrayNodeTypes.d.ts.map +1 -1
  464. package/lib/simple-tree/arrayNodeTypes.js.map +1 -1
  465. package/lib/simple-tree/core/getOrCreateNode.d.ts +1 -1
  466. package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  467. package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
  468. package/lib/simple-tree/core/index.d.ts +2 -1
  469. package/lib/simple-tree/core/index.d.ts.map +1 -1
  470. package/lib/simple-tree/core/index.js +1 -1
  471. package/lib/simple-tree/core/index.js.map +1 -1
  472. package/lib/simple-tree/core/treeNode.d.ts +94 -0
  473. package/lib/simple-tree/core/treeNode.d.ts.map +1 -0
  474. package/lib/simple-tree/core/treeNode.js +118 -0
  475. package/lib/simple-tree/core/treeNode.js.map +1 -0
  476. package/lib/simple-tree/core/treeNodeKernel.d.ts +2 -1
  477. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  478. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  479. package/lib/simple-tree/core/treeNodeSchema.d.ts +3 -1
  480. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  481. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  482. package/lib/simple-tree/core/types.d.ts +0 -165
  483. package/lib/simple-tree/core/types.d.ts.map +1 -1
  484. package/lib/simple-tree/core/types.js +0 -110
  485. package/lib/simple-tree/core/types.js.map +1 -1
  486. package/lib/simple-tree/core/withType.d.ts +1 -1
  487. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  488. package/lib/simple-tree/core/withType.js.map +1 -1
  489. package/lib/simple-tree/index.d.ts +4 -4
  490. package/lib/simple-tree/index.d.ts.map +1 -1
  491. package/lib/simple-tree/index.js +1 -1
  492. package/lib/simple-tree/index.js.map +1 -1
  493. package/lib/simple-tree/mapNode.d.ts +2 -2
  494. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  495. package/lib/simple-tree/mapNode.js +2 -2
  496. package/lib/simple-tree/mapNode.js.map +1 -1
  497. package/lib/simple-tree/mapNodeTypes.d.ts +3 -3
  498. package/lib/simple-tree/mapNodeTypes.d.ts.map +1 -1
  499. package/lib/simple-tree/mapNodeTypes.js.map +1 -1
  500. package/lib/simple-tree/objectNode.d.ts +18 -5
  501. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  502. package/lib/simple-tree/objectNode.js +5 -4
  503. package/lib/simple-tree/objectNode.js.map +1 -1
  504. package/lib/simple-tree/objectNodeTypes.d.ts +4 -4
  505. package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
  506. package/lib/simple-tree/objectNodeTypes.js.map +1 -1
  507. package/lib/simple-tree/schemaTypes.d.ts +164 -13
  508. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  509. package/lib/simple-tree/schemaTypes.js +96 -8
  510. package/lib/simple-tree/schemaTypes.js.map +1 -1
  511. package/lib/simple-tree/toStoredSchema.d.ts +8 -8
  512. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  513. package/lib/simple-tree/toStoredSchema.js +26 -31
  514. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  515. package/lib/simple-tree/treeNodeValid.js +2 -2
  516. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  517. package/lib/tableSchema.d.ts +455 -125
  518. package/lib/tableSchema.d.ts.map +1 -1
  519. package/lib/tableSchema.js +398 -101
  520. package/lib/tableSchema.js.map +1 -1
  521. package/lib/treeFactory.d.ts +1 -1
  522. package/lib/treeFactory.d.ts.map +1 -1
  523. package/lib/treeFactory.js +30 -75
  524. package/lib/treeFactory.js.map +1 -1
  525. package/lib/util/typeUtils.d.ts +1 -1
  526. package/lib/util/typeUtils.js.map +1 -1
  527. package/package.json +21 -21
  528. package/src/codec/codec.ts +6 -1
  529. package/src/codec/index.ts +1 -0
  530. package/src/core/index.ts +1 -2
  531. package/src/core/schema-stored/index.ts +3 -3
  532. package/src/core/schema-stored/schema.ts +3 -1
  533. package/src/core/schema-stored/storedSchemaRepository.ts +1 -1
  534. package/src/core/schema-view/index.ts +0 -1
  535. package/src/core/schema-view/view.ts +0 -31
  536. package/src/core/tree/persistedTreeTextFormat.ts +2 -2
  537. package/src/feature-libraries/forest-summary/format.ts +2 -2
  538. package/src/feature-libraries/index.ts +7 -1
  539. package/src/feature-libraries/mapTreeCursor.ts +3 -3
  540. package/src/feature-libraries/modular-schema/modularChangeFormat.ts +3 -3
  541. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +38 -9
  542. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +3 -4
  543. package/src/feature-libraries/schema-index/codec.ts +80 -12
  544. package/src/feature-libraries/schema-index/{format.ts → formatV1.ts} +4 -4
  545. package/src/feature-libraries/schema-index/index.ts +7 -2
  546. package/src/feature-libraries/schema-index/schemaSummarizer.ts +9 -9
  547. package/src/index.ts +18 -1
  548. package/src/internalTypes.ts +0 -2
  549. package/src/jsonDomainSchema.ts +2 -2
  550. package/src/packageVersion.ts +1 -1
  551. package/src/serializableDomainSchema.ts +3 -3
  552. package/src/shared-tree/independentView.ts +4 -3
  553. package/src/shared-tree/index.ts +5 -6
  554. package/src/shared-tree/schematizeTree.ts +10 -40
  555. package/src/shared-tree/schematizingTreeView.ts +12 -17
  556. package/src/shared-tree/sharedTree.ts +67 -6
  557. package/src/shared-tree/{treeApi.ts → tree.ts} +75 -51
  558. package/src/shared-tree/{treeApiAlpha.ts → treeAlpha.ts} +28 -16
  559. package/src/shared-tree-core/branchCommitEnricher.ts +0 -1
  560. package/src/shared-tree-core/transactionEnricher.ts +4 -1
  561. package/src/simple-tree/api/conciseTree.ts +1 -1
  562. package/src/simple-tree/api/configuration.ts +353 -0
  563. package/src/simple-tree/api/getJsonSchema.ts +1 -1
  564. package/src/simple-tree/api/index.ts +23 -15
  565. package/src/simple-tree/api/{view.ts → schemaCompatibilityTester.ts} +8 -15
  566. package/src/simple-tree/api/schemaFactory.ts +139 -19
  567. package/src/simple-tree/api/schemaFactoryAlpha.ts +7 -5
  568. package/src/simple-tree/api/schemaFactoryRecursive.ts +102 -38
  569. package/src/simple-tree/api/schemaFromSimple.ts +2 -2
  570. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  571. package/src/simple-tree/api/storedSchema.ts +32 -17
  572. package/src/simple-tree/api/tree.ts +38 -354
  573. package/src/simple-tree/api/{treeApiBeta.ts → treeBeta.ts} +20 -6
  574. package/src/simple-tree/api/treeChangeEvents.ts +84 -0
  575. package/src/simple-tree/api/treeNodeApi.ts +1 -1
  576. package/src/simple-tree/api/typesUnsafe.ts +15 -11
  577. package/src/simple-tree/arrayNode.ts +38 -5
  578. package/src/simple-tree/arrayNodeTypes.ts +8 -7
  579. package/src/simple-tree/core/getOrCreateNode.ts +1 -1
  580. package/src/simple-tree/core/index.ts +5 -4
  581. package/src/simple-tree/core/treeNode.ts +163 -0
  582. package/src/simple-tree/core/treeNodeKernel.ts +2 -1
  583. package/src/simple-tree/core/treeNodeSchema.ts +3 -1
  584. package/src/simple-tree/core/types.ts +0 -234
  585. package/src/simple-tree/core/withType.ts +1 -1
  586. package/src/simple-tree/index.ts +19 -2
  587. package/src/simple-tree/mapNode.ts +11 -3
  588. package/src/simple-tree/mapNodeTypes.ts +10 -7
  589. package/src/simple-tree/objectNode.ts +39 -15
  590. package/src/simple-tree/objectNodeTypes.ts +9 -5
  591. package/src/simple-tree/schemaTypes.ts +354 -25
  592. package/src/simple-tree/toStoredSchema.ts +42 -41
  593. package/src/simple-tree/treeNodeValid.ts +2 -2
  594. package/src/tableSchema.ts +1206 -434
  595. package/src/treeFactory.ts +56 -173
  596. package/src/util/typeUtils.ts +1 -1
  597. package/dist/core/schema-stored/format.d.ts.map +0 -1
  598. package/dist/core/schema-stored/format.js.map +0 -1
  599. package/dist/feature-libraries/schema-index/format.d.ts.map +0 -1
  600. package/dist/feature-libraries/schema-index/format.js.map +0 -1
  601. package/dist/shared-tree/treeApi.d.ts.map +0 -1
  602. package/dist/shared-tree/treeApi.js.map +0 -1
  603. package/dist/shared-tree/treeApiAlpha.d.ts.map +0 -1
  604. package/dist/shared-tree/treeApiAlpha.js.map +0 -1
  605. package/dist/simple-tree/api/treeApiBeta.d.ts.map +0 -1
  606. package/dist/simple-tree/api/treeApiBeta.js.map +0 -1
  607. package/dist/simple-tree/api/view.d.ts.map +0 -1
  608. package/dist/simple-tree/api/view.js.map +0 -1
  609. package/lib/core/schema-stored/format.d.ts.map +0 -1
  610. package/lib/core/schema-stored/format.js.map +0 -1
  611. package/lib/feature-libraries/schema-index/format.d.ts.map +0 -1
  612. package/lib/feature-libraries/schema-index/format.js.map +0 -1
  613. package/lib/shared-tree/treeApi.d.ts.map +0 -1
  614. package/lib/shared-tree/treeApi.js.map +0 -1
  615. package/lib/shared-tree/treeApiAlpha.d.ts.map +0 -1
  616. package/lib/shared-tree/treeApiAlpha.js.map +0 -1
  617. package/lib/simple-tree/api/treeApiBeta.d.ts.map +0 -1
  618. package/lib/simple-tree/api/treeApiBeta.js.map +0 -1
  619. package/lib/simple-tree/api/view.d.ts.map +0 -1
  620. package/lib/simple-tree/api/view.js.map +0 -1
  621. /package/src/core/schema-stored/{format.ts → formatV1.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAY,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,KAAK,QAAQ,EAAE,cA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,gBAChB,SAAQ,UAAU,CAAC,uCAAuC,CAAC;CAAG;AAE/D,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAGnE"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAErF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC;AAE9B;;;;;;;GAOG;AACH,MAAM,WAAW,gBAChB,SAAQ,UAAU,CAAC,uCAAuC,CAAC;CAAG;AAE/D,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAGnE"}
@@ -3,122 +3,10 @@
3
3
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
4
  * Licensed under the MIT License.
5
5
  */
6
- var _TreeNode_brand;
7
6
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.toFlexTreeNode = exports.inPrototypeChain = exports.privateToken = exports.TreeNode = void 0;
7
+ exports.toFlexTreeNode = void 0;
9
8
  const internal_1 = require("@fluidframework/core-utils/internal");
10
- const internal_2 = require("@fluidframework/telemetry-utils/internal");
11
- const treeNodeSchema_js_1 = require("./treeNodeSchema.js");
12
- // eslint-disable-next-line import/no-deprecated
13
- const withType_js_1 = require("./withType.js");
14
- const treeNodeKernel_js_1 = require("./treeNodeKernel.js");
15
9
  const index_js_1 = require("../../feature-libraries/index.js");
16
- /**
17
- * A non-{@link NodeKind.Leaf|leaf} SharedTree node. Includes objects, arrays, and maps.
18
- *
19
- * @remarks
20
- * Base type which all nodes extend.
21
- *
22
- * This type can be used as a type to indicate/document values which should be tree nodes.
23
- * Runtime use of this class object (for example when used with `instanceof` or extending it), is not currently supported.
24
- *
25
- * There are three ways to get instances of TreeNode:
26
- *
27
- * 1. From a {@link TreeView} loading nodes from an existing document, or creating local copies of nodes inserted by a remote collaborator.
28
- * This case provides an {@link InternalTreeNode} to the constructor: subclasses must not modify how the constructor handles this case.
29
- * 2. Explicit construction of {@link Unhydrated} nodes using either {@link TreeNodeSchemaClass} as a constructor or {@link TreeNodeSchemaNonClass|TreeNodeSchemaNonClass.create}.
30
- * Either way the {@link TreeNodeSchema} produced must be produced using a {@link SchemaFactory}.
31
- * 3. Implicit construction: Several APIs which logically require an unhydrated TreeNode also allow passing in a value which could be used to explicitly construct the node instead.
32
- * These APIs internally call the constructor with the provided value, so it's really just a special case of the above option.
33
- * Note that when constructing nodes, sometimes implicit construction is not allowed
34
- * (either at runtime due to ambiguous types or at compile time due to TypeScript limitations):
35
- * in such cases, explicit construction must be used.
36
- *
37
- * @privateRemarks
38
- * This is a class not an interface to enable stricter type checking (see {@link TreeNode.#brand})
39
- * and some runtime enforcement of schema class policy (see the the validation in the constructor).
40
- * This class is however only `type` exported not value exported, preventing the class object from being used,
41
- * similar to how interfaces work.
42
- *
43
- * Not all node implementations include this in their prototype chain (some hide it with a proxy),
44
- * and thus cause the default/built in `instanceof` to return false despite our type checking and all other APIs treating them as TreeNodes.
45
- * This class provides a custom `Symbol.hasInstance` to fix `instanceof` for this class and all classes extending it.
46
- * For now the type-only export prevents use of `instanceof` on this class (but allows it in subclasses like schema classes).
47
- * @sealed @public
48
- */
49
- class TreeNode {
50
- static [(_TreeNode_brand = new WeakMap(), Symbol.hasInstance)](value) {
51
- const schema = (0, treeNodeKernel_js_1.tryGetTreeNodeSchema)(value);
52
- if (schema === undefined || schema.kind === treeNodeSchema_js_1.NodeKind.Leaf) {
53
- return false;
54
- }
55
- (0, internal_1.assert)("prototype" in schema, 0x98a /* expected class based schema */);
56
- return inPrototypeChain(schema.prototype, this.prototype);
57
- }
58
- /**
59
- * TreeNodes must extend schema classes created by SchemaFactory, and therefore this constructor should not be invoked directly by code outside this package.
60
- * @privateRemarks
61
- * `token` must be the {@link privateToken} value, which is not package exported.
62
- * This is used to detect invalid subclasses.
63
- *
64
- * All valid subclass should use {@link TreeNodeValid}, but this code doesn't directly reference it to avoid cyclic dependencies.
65
- */
66
- constructor(token) {
67
- /**
68
- * This is added to prevent TypeScript from implicitly allowing non-TreeNode types to be used as TreeNodes.
69
- * @remarks
70
- * This field forces TypeScript to use nominal instead of structural typing,
71
- * preventing compiler error messages and tools like "add missing properties"
72
- * from adding the [type] field as a solution when using a non-TreeNode object where a TreeNode is required.
73
- * Instead TreeNodes must be created through the appropriate APIs, see the documentation on {@link TreeNode} for details.
74
- *
75
- * @privateRemarks
76
- * This is a JavaScript private field, so is not accessible from outside this class.
77
- * This prevents it from having name collisions with object fields.
78
- * Since this is private, the type of this field is stripped in the d.ts file.
79
- * To get matching type checking within and from outside the package, the least informative type (`unknown`) is used.
80
- * To avoid this having any runtime impact, the field is uninitialized.
81
- *
82
- * Making this field optional results in different type checking within this project than outside of it, since the d.ts file drops the optional aspect of the field.
83
- * This is extra confusing since since the tests get in-project typing for intellisense and separate project checking at build time.
84
- * To avoid all this mess, this field is required, not optional.
85
- *
86
- * Another option would be to use a symbol (possibly as a private field).
87
- * That approach ran into some strange difficulties causing SchemaFactory to fail to compile, and was not investigated further.
88
- *
89
- * The [type] symbol provides a lot of the value this private brand does, but is not all of it:
90
- * someone could manually (or via Intellisense auto-implement completion, or in response to a type error)
91
- * make an object literal with the [type] field and pass it off as a node: this private brand prevents that.
92
- */
93
- _TreeNode_brand.set(this, void 0);
94
- if (token !== exports.privateToken) {
95
- throw new internal_2.UsageError("TreeNodes must extend schema classes created by SchemaFactory");
96
- }
97
- }
98
- }
99
- exports.TreeNode = TreeNode;
100
- /**
101
- * `token` to pass to {@link TreeNode}'s constructor used to detect invalid subclasses.
102
- */
103
- exports.privateToken = {};
104
- /**
105
- * Check if the prototype derived's prototype chain contains `base`.
106
- * @param derived - prototype to check
107
- * @param base - prototype to search for
108
- * @returns true iff `base` is in the prototype chain starting at `derived`.
109
- */
110
- // eslint-disable-next-line @rushstack/no-new-null
111
- function inPrototypeChain(derived, base) {
112
- let checking = derived;
113
- while (checking !== null) {
114
- if (base === checking) {
115
- return true;
116
- }
117
- checking = Reflect.getPrototypeOf(checking);
118
- }
119
- return false;
120
- }
121
- exports.inPrototypeChain = inPrototypeChain;
122
10
  function toFlexTreeNode(node) {
123
11
  (0, internal_1.assert)((0, index_js_1.isFlexTreeNode)(node), 0x963 /* Invalid InternalTreeNode */);
124
12
  return node;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/simple-tree/core/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kEAA6D;AAC7D,uEAAsE;AAGtE,2DAAyE;AACzE,gDAAgD;AAChD,+CAAqF;AACrF,2DAA2D;AAC3D,+DAAqF;AAkGrF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAsB,QAAQ;IAmEtB,MAAM,CAAC,mCAAC,MAAM,CAAC,WAAW,EAAC,CAA8B,KAAc;QAC7E,MAAM,MAAM,GAAG,IAAA,wCAAoB,EAAC,KAAK,CAAC,CAAC;QAE3C,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,4BAAQ,CAAC,IAAI,EAAE,CAAC;YAC3D,OAAO,KAAK,CAAC;QACd,CAAC;QAED,IAAA,iBAAM,EAAC,WAAW,IAAI,MAAM,EAAE,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvE,OAAO,gBAAgB,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;OAOG;IACH,YAAsB,KAAc;QArFpC;;;;;;;;;;;;;;;;;;;;;;;;;WAyBG;QACM,kCAAiB;QA4DzB,IAAI,KAAK,KAAK,oBAAY,EAAE,CAAC;YAC5B,MAAM,IAAI,qBAAU,CAAC,+DAA+D,CAAC,CAAC;QACvF,CAAC;IACF,CAAC;CACD;AA3FD,4BA2FC;AAED;;GAEG;AACU,QAAA,YAAY,GAAG,EAAE,CAAC;AAE/B;;;;;GAKG;AACH,kDAAkD;AAClD,SAAgB,gBAAgB,CAAC,OAAsB,EAAE,IAAY;IACpE,IAAI,QAAQ,GAAG,OAAO,CAAC;IACvB,OAAO,QAAQ,KAAK,IAAI,EAAE,CAAC;QAC1B,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACb,CAAC;QACD,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AATD,4CASC;AAaD,SAAgB,cAAc,CAAC,IAAsB;IACpD,IAAA,iBAAM,EAAC,IAAA,yBAAc,EAAC,IAAI,CAAC,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACnE,OAAO,IAAI,CAAC;AACb,CAAC;AAHD,wCAGC","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\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport type { ErasedType } from \"@fluidframework/core-interfaces\";\n\nimport { NodeKind, type TreeNodeSchemaClass } from \"./treeNodeSchema.js\";\n// eslint-disable-next-line import/no-deprecated\nimport { type WithType, typeNameSymbol, type typeSchemaSymbol } from \"./withType.js\";\nimport { tryGetTreeNodeSchema } from \"./treeNodeKernel.js\";\nimport { isFlexTreeNode, type FlexTreeNode } from \"../../feature-libraries/index.js\";\n\n/**\n * Type alias to document which values are un-hydrated.\n *\n * Un-hydrated values are nodes produced from schema's create functions that haven't been inserted into a tree yet.\n *\n * Since un-hydrated nodes become hydrated when inserted, strong typing can't be used to distinguish them.\n * This no-op wrapper is used instead.\n * @remarks\n * Nodes which are Unhydrated report {@link TreeStatus}.new from `Tree.status(node)`.\n * @privateRemarks\n * TODO: Linking tree status is failing in intellisense and linking directly to its .new item is failing in API extractor as well.\n * WOuld be nice to have a working link here.\n * @public\n */\nexport type Unhydrated<T> = T;\n\n/**\n * A collection of events that can be emitted by a {@link TreeNode}.\n *\n * @privateRemarks\n * TODO: add a way to subscribe to a specific field (for nodeChanged and treeChanged).\n * Probably have object node and map node specific APIs for this.\n *\n * TODO: ensure that subscription API for fields aligns with API for subscribing to the root.\n *\n * TODO: add more wider area (avoid needing tons of nodeChanged registration) events for use-cases other than treeChanged.\n * Some ideas:\n *\n * - treeChanged, but with some subtrees/fields/paths excluded\n * - helper to batch several nodeChanged calls to a treeChanged scope\n * - parent change (ex: registration on the parent field for a specific index: maybe allow it for a range. Ex: node event takes optional field and optional index range?)\n * - new content inserted into subtree. Either provide event for this and/or enough info to treeChanged to find and search the new sub-trees.\n * Add separate (non event related) API to efficiently scan tree for given set of types (using low level cursor and schema based filtering)\n * to allow efficiently searching for new content (and initial content) of a given type.\n *\n * @sealed @public\n */\nexport interface TreeChangeEvents {\n\t/**\n\t * Emitted by a node after a batch of changes has been applied to the tree, if any of the changes affected the node.\n\t *\n\t * - Object nodes define a change as being when the value of one of its properties changes (i.e., the property's value is set, including when set to `undefined`).\n\t *\n\t * - Array nodes define a change as when an element is added, removed, moved or replaced.\n\t *\n\t * - Map nodes define a change as when an entry is added, updated, or removed.\n\t *\n\t * @param unstable - Future versions of this API (such as the one in beta on TreeBeta) may use this argument to provide additional data to the event.\n\t * users of this event should ensure that they do not provide a listener callback which has an optional parameter in this position, since unexpected data might get provided to it.\n\t * This parameter exists to capture this fact in the type system.\n\t * Using an inline lambda expression as the listener callback is a good pattern to avoid cases like this were arguments are added from breaking due to optional arguments.\n\t *\n\t * @remarks\n\t * This event is not emitted when:\n\t *\n\t * - Properties of a child node change. Notably, updates to an array node or a map node (like adding or removing\n\t * elements/entries) will emit this event on the array/map node itself, but not on the node that contains the\n\t * array/map node as one of its properties.\n\t *\n\t * - The node is moved to a different location in the tree or removed from the tree.\n\t * In this case the event is emitted on the _parent_ node, not the node itself.\n\t *\n\t * For remote edits, this event is not guaranteed to occur in the same order or quantity that it did in\n\t * the client that made the original edit.\n\t *\n\t * When the event is emitted, the tree is guaranteed to be in-schema.\n\t *\n\t * @privateRemarks\n\t * This event occurs whenever the apparent contents of the node instance change, regardless of what caused the change.\n\t * For example, it will fire when the local client reassigns a child, when part of a remote edit is applied to the\n\t * node, or when the node has to be updated due to resolution of a merge conflict\n\t * (for example a previously applied local change might be undone, then reapplied differently or not at all).\n\t *\n\t * TODO: define and document event ordering (ex: bottom up, with nodeChanged before treeChange on each level).\n\t */\n\tnodeChanged(unstable?: unknown): void;\n\n\t/**\n\t * Emitted by a node after a batch of changes has been applied to the tree, when something changed anywhere in the\n\t * subtree rooted at it.\n\t *\n\t * @remarks\n\t * This event is not emitted when the node itself is moved to a different location in the tree or removed from the tree.\n\t * In that case it is emitted on the _parent_ node, not the node itself.\n\t *\n\t * The node itself is part of the subtree, so this event will be emitted even if the only changes are to the properties\n\t * of the node itself.\n\t *\n\t * For remote edits, this event is not guaranteed to occur in the same order or quantity that it did in\n\t * the client that made the original edit.\n\t *\n\t * When it is emitted, the tree is guaranteed to be in-schema.\n\t */\n\ttreeChanged(): void;\n}\n\n/**\n * A non-{@link NodeKind.Leaf|leaf} SharedTree node. Includes objects, arrays, and maps.\n *\n * @remarks\n * Base type which all nodes extend.\n *\n * This type can be used as a type to indicate/document values which should be tree nodes.\n * Runtime use of this class object (for example when used with `instanceof` or extending it), is not currently supported.\n *\n * There are three ways to get instances of TreeNode:\n *\n * 1. From a {@link TreeView} loading nodes from an existing document, or creating local copies of nodes inserted by a remote collaborator.\n * This case provides an {@link InternalTreeNode} to the constructor: subclasses must not modify how the constructor handles this case.\n * 2. Explicit construction of {@link Unhydrated} nodes using either {@link TreeNodeSchemaClass} as a constructor or {@link TreeNodeSchemaNonClass|TreeNodeSchemaNonClass.create}.\n * Either way the {@link TreeNodeSchema} produced must be produced using a {@link SchemaFactory}.\n * 3. Implicit construction: Several APIs which logically require an unhydrated TreeNode also allow passing in a value which could be used to explicitly construct the node instead.\n * These APIs internally call the constructor with the provided value, so it's really just a special case of the above option.\n * Note that when constructing nodes, sometimes implicit construction is not allowed\n * (either at runtime due to ambiguous types or at compile time due to TypeScript limitations):\n * in such cases, explicit construction must be used.\n *\n * @privateRemarks\n * This is a class not an interface to enable stricter type checking (see {@link TreeNode.#brand})\n * and some runtime enforcement of schema class policy (see the the validation in the constructor).\n * This class is however only `type` exported not value exported, preventing the class object from being used,\n * similar to how interfaces work.\n *\n * Not all node implementations include this in their prototype chain (some hide it with a proxy),\n * and thus cause the default/built in `instanceof` to return false despite our type checking and all other APIs treating them as TreeNodes.\n * This class provides a custom `Symbol.hasInstance` to fix `instanceof` for this class and all classes extending it.\n * For now the type-only export prevents use of `instanceof` on this class (but allows it in subclasses like schema classes).\n * @sealed @public\n */\nexport abstract class TreeNode implements WithType {\n\t/**\n\t * This is added to prevent TypeScript from implicitly allowing non-TreeNode types to be used as TreeNodes.\n\t * @remarks\n\t * This field forces TypeScript to use nominal instead of structural typing,\n\t * preventing compiler error messages and tools like \"add missing properties\"\n\t * from adding the [type] field as a solution when using a non-TreeNode object where a TreeNode is required.\n\t * Instead TreeNodes must be created through the appropriate APIs, see the documentation on {@link TreeNode} for details.\n\t *\n\t * @privateRemarks\n\t * This is a JavaScript private field, so is not accessible from outside this class.\n\t * This prevents it from having name collisions with object fields.\n\t * Since this is private, the type of this field is stripped in the d.ts file.\n\t * To get matching type checking within and from outside the package, the least informative type (`unknown`) is used.\n\t * To avoid this having any runtime impact, the field is uninitialized.\n\t *\n\t * Making this field optional results in different type checking within this project than outside of it, since the d.ts file drops the optional aspect of the field.\n\t * This is extra confusing since since the tests get in-project typing for intellisense and separate project checking at build time.\n\t * To avoid all this mess, this field is required, not optional.\n\t *\n\t * Another option would be to use a symbol (possibly as a private field).\n\t * That approach ran into some strange difficulties causing SchemaFactory to fail to compile, and was not investigated further.\n\t *\n\t * The [type] symbol provides a lot of the value this private brand does, but is not all of it:\n\t * someone could manually (or via Intellisense auto-implement completion, or in response to a type error)\n\t * make an object literal with the [type] field and pass it off as a node: this private brand prevents that.\n\t */\n\treadonly #brand!: unknown;\n\n\t/**\n\t * Adds a type symbol for stronger typing.\n\t * @privateRemarks\n\t * Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.\n\t * @deprecated Use {@link typeSchemaSymbol} instead.\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic abstract get [typeNameSymbol](): string;\n\n\t/**\n\t * Adds a type symbol for stronger typing.\n\t * @privateRemarks\n\t * Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.\n\t */\n\tpublic abstract get [typeSchemaSymbol](): TreeNodeSchemaClass;\n\n\t/**\n\t * Provides `instanceof` support for testing if a value is a `TreeNode`.\n\t * @remarks\n\t * For more options, like including leaf values or narrowing to collections of schema, use `is` or `schema` from {@link TreeNodeApi}.\n\t * @privateRemarks\n\t * Due to type-only export, this functionality is not available outside the package.\n\t */\n\tpublic static [Symbol.hasInstance](value: unknown): value is TreeNode;\n\n\t/**\n\t * Provides `instanceof` support for all schema classes with public constructors.\n\t * @remarks\n\t * For more options, like including leaf values or narrowing to collections of schema, use `is` or `schema` from {@link TreeNodeApi}.\n\t * @privateRemarks\n\t * Despite type-only export, this functionality is available outside the package since it is inherited by subclasses.\n\t */\n\tpublic static [Symbol.hasInstance]<\n\t\tTSchema extends abstract new (\n\t\t\t...args: any[]\n\t\t) => TreeNode,\n\t>(this: TSchema, value: unknown): value is InstanceType<TSchema>;\n\n\tpublic static [Symbol.hasInstance](this: { prototype: object }, value: unknown): boolean {\n\t\tconst schema = tryGetTreeNodeSchema(value);\n\n\t\tif (schema === undefined || schema.kind === NodeKind.Leaf) {\n\t\t\treturn false;\n\t\t}\n\n\t\tassert(\"prototype\" in schema, 0x98a /* expected class based schema */);\n\t\treturn inPrototypeChain(schema.prototype, this.prototype);\n\t}\n\n\t/**\n\t * TreeNodes must extend schema classes created by SchemaFactory, and therefore this constructor should not be invoked directly by code outside this package.\n\t * @privateRemarks\n\t * `token` must be the {@link privateToken} value, which is not package exported.\n\t * This is used to detect invalid subclasses.\n\t *\n\t * All valid subclass should use {@link TreeNodeValid}, but this code doesn't directly reference it to avoid cyclic dependencies.\n\t */\n\tprotected constructor(token: unknown) {\n\t\tif (token !== privateToken) {\n\t\t\tthrow new UsageError(\"TreeNodes must extend schema classes created by SchemaFactory\");\n\t\t}\n\t}\n}\n\n/**\n * `token` to pass to {@link TreeNode}'s constructor used to detect invalid subclasses.\n */\nexport const privateToken = {};\n\n/**\n * Check if the prototype derived's prototype chain contains `base`.\n * @param derived - prototype to check\n * @param base - prototype to search for\n * @returns true iff `base` is in the prototype chain starting at `derived`.\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport function inPrototypeChain(derived: object | null, base: object): boolean {\n\tlet checking = derived;\n\twhile (checking !== null) {\n\t\tif (base === checking) {\n\t\t\treturn true;\n\t\t}\n\t\tchecking = Reflect.getPrototypeOf(checking);\n\t}\n\treturn false;\n}\n\n/**\n * A node type internal to `@fluidframework/tree`.\n * @remarks\n * This type is used in the construction of {@link TreeNode} as an implementation detail, but leaks into the public API due to how schema are implemented.\n * @privateRemarks\n * A {@link FlexTreeNode}. Includes {@link RawTreeNode}s.\n * @sealed @public\n */\nexport interface InternalTreeNode\n\textends ErasedType<\"@fluidframework/tree.InternalTreeNode\"> {}\n\nexport function toFlexTreeNode(node: InternalTreeNode): FlexTreeNode {\n\tassert(isFlexTreeNode(node), 0x963 /* Invalid InternalTreeNode */);\n\treturn node;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/simple-tree/core/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAG7D,+DAAqF;AA6BrF,SAAgB,cAAc,CAAC,IAAsB;IACpD,IAAA,iBAAM,EAAC,IAAA,yBAAc,EAAC,IAAI,CAAC,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACnE,OAAO,IAAI,CAAC;AACb,CAAC;AAHD,wCAGC","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\";\nimport type { ErasedType } from \"@fluidframework/core-interfaces\";\n\nimport { isFlexTreeNode, type FlexTreeNode } from \"../../feature-libraries/index.js\";\n\n/**\n * Type alias to document which values are un-hydrated.\n *\n * Un-hydrated values are nodes produced from schema's create functions that haven't been inserted into a tree yet.\n *\n * Since un-hydrated nodes become hydrated when inserted, strong typing can't be used to distinguish them.\n * This no-op wrapper is used instead.\n * @remarks\n * Nodes which are Unhydrated report {@link TreeStatus}.new from `Tree.status(node)`.\n * @privateRemarks\n * TODO: Linking tree status is failing in intellisense and linking directly to its .new item is failing in API extractor as well.\n * WOuld be nice to have a working link here.\n * @public\n */\nexport type Unhydrated<T> = T;\n\n/**\n * A node type internal to `@fluidframework/tree`.\n * @remarks\n * This type is used in the construction of {@link TreeNode} as an implementation detail, but leaks into the public API due to how schema are implemented.\n * @privateRemarks\n * A {@link FlexTreeNode}. Includes {@link RawTreeNode}s.\n * @sealed @public\n */\nexport interface InternalTreeNode\n\textends ErasedType<\"@fluidframework/tree.InternalTreeNode\"> {}\n\nexport function toFlexTreeNode(node: InternalTreeNode): FlexTreeNode {\n\tassert(isFlexTreeNode(node), 0x963 /* Invalid InternalTreeNode */);\n\treturn node;\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { NodeKind, TreeNodeSchemaClass } from "./treeNodeSchema.js";
6
- import type { TreeNode } from "./types.js";
6
+ import type { TreeNode } from "./treeNode.js";
7
7
  /**
8
8
  * The type of a {@link TreeNode}.
9
9
  * For more information about the type, use `Tree.schema(theNode)` instead.
@@ -1 +1 @@
1
- {"version":3,"file":"withType.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/withType.ts"],"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G,MAAM,EACjC,GAAG,CAAC,KAAK,SAAS,QAAQ,GAAG,QAAQ,EACrC,GAAG,CAAC,KAAK,GAAG,OAAO;IAEnB;;;OAGG;IACH,IAAI,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC;IAE9B;;OAEG;IACH,IAAI,CAAC,gBAAgB,CAAC,IAAI,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;CAC7F"}
@@ -1 +1 @@
1
- {"version":3,"file":"withType.js","sourceRoot":"","sources":["../../../src/simple-tree/core/withType.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH;;;;;;;;;;;;;GAaG;AACU,QAAA,cAAc,GAAkB,MAAM,CAAC,eAAe,CAAC,CAAC;AAErE;;;;;;;;;;;;;;GAcG;AACU,QAAA,gBAAgB,GAAkB,MAAM,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NodeKind, TreeNodeSchemaClass } from \"./treeNodeSchema.js\";\nimport type { TreeNode } from \"./types.js\";\n\n/**\n * The type of a {@link TreeNode}.\n * For more information about the type, use `Tree.schema(theNode)` instead.\n * @remarks\n * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.\n * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.\n *\n * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where nodes are expected.\n * Instead construct a real node of the desired type using its constructor.\n * @privateRemarks\n * This prevents non-nodes from being accidentally used as nodes, as well as allows the type checker to distinguish different node types.\n * @deprecated External code should use `Tree.schema(theNode)` for schema related runtime data access. For type narrowing, use `WithType` instead of the symbols directly.\n * @system @public\n */\nexport const typeNameSymbol: unique symbol = Symbol(\"TreeNode Type\");\n\n/**\n * The type of a {@link TreeNode}.\n * For more information about the type, use `Tree.schema(theNode)` instead.\n * @remarks\n * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.\n * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.\n *\n * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where specific nodes are expected.\n * Instead construct a real node of the desired type using its constructor.\n *\n * This symbol should not be used directly for type narrowing. Instead use {@link WithType}.\n * @privateRemarks\n * This prevents non-nodes from being accidentally used as nodes and allows the type-checker to distinguish different node types.\n * @system @public\n */\nexport const typeSchemaSymbol: unique symbol = Symbol(\"TreeNode Schema\");\n\n/**\n * Adds a type symbol to a type for stronger typing.\n *\n * @typeParam TName - Same as {@link TreeNodeSchema}'s \"Name\" parameter.\n * @typeParam TKind - Same as {@link TreeNodeSchema}'s \"Kind\" parameter.\n * @typeParam TInfo - Same as {@link TreeNodeSchema}'s \"Info\" parameter: format depends on the Kind.\n * @remarks\n * Powers {@link TreeNode}'s strong typing setup.\n * @example Narrow types for overloading based on NodeKind\n * ```typescript\n * function getKeys(node: TreeNode & WithType<string, NodeKind.Array>): number[];\n * function getKeys(node: TreeNode & WithType<string, NodeKind.Map | NodeKind.Object>): string[];\n * function getKeys(node: TreeNode): string[] | number[];\n * function getKeys(node: TreeNode): string[] | number[] {\n * \tconst schema = Tree.schema(node);\n * \tswitch (schema.kind) {\n * \t\tcase NodeKind.Array: {\n * \t\t\tconst arrayNode = node as TreeArrayNode;\n * \t\t\tconst keys: number[] = [];\n * \t\t\tfor (let index = 0; index < arrayNode.length; index++) {\n * \t\t\t\tkeys.push(index);\n * \t\t\t}\n * \t\t\treturn keys;\n * \t\t}\n * \t\tcase NodeKind.Map:\n * \t\t\treturn [...(node as TreeMapNode).keys()];\n * \t\tcase NodeKind.Object:\n * \t\t\treturn Object.keys(node);\n * \t\tdefault:\n * \t\t\tthrow new Error(\"Unsupported Kind\");\n * \t}\n * }\n * ```\n * @sealed @public\n */\nexport interface WithType<\n\tout TName extends string = string,\n\tout TKind extends NodeKind = NodeKind,\n\tout TInfo = unknown,\n> {\n\t/**\n\t * Type symbol, marking a type in a way to increase type safety via strong type checking.\n\t * @deprecated Use {@link typeSchemaSymbol} instead.\n\t */\n\tget [typeNameSymbol](): TName;\n\n\t/**\n\t * Type symbol, marking a type in a way to increase type safety via strong type checking.\n\t */\n\tget [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;\n}\n"]}
1
+ {"version":3,"file":"withType.js","sourceRoot":"","sources":["../../../src/simple-tree/core/withType.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH;;;;;;;;;;;;;GAaG;AACU,QAAA,cAAc,GAAkB,MAAM,CAAC,eAAe,CAAC,CAAC;AAErE;;;;;;;;;;;;;;GAcG;AACU,QAAA,gBAAgB,GAAkB,MAAM,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NodeKind, TreeNodeSchemaClass } from \"./treeNodeSchema.js\";\nimport type { TreeNode } from \"./treeNode.js\";\n\n/**\n * The type of a {@link TreeNode}.\n * For more information about the type, use `Tree.schema(theNode)` instead.\n * @remarks\n * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.\n * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.\n *\n * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where nodes are expected.\n * Instead construct a real node of the desired type using its constructor.\n * @privateRemarks\n * This prevents non-nodes from being accidentally used as nodes, as well as allows the type checker to distinguish different node types.\n * @deprecated External code should use `Tree.schema(theNode)` for schema related runtime data access. For type narrowing, use `WithType` instead of the symbols directly.\n * @system @public\n */\nexport const typeNameSymbol: unique symbol = Symbol(\"TreeNode Type\");\n\n/**\n * The type of a {@link TreeNode}.\n * For more information about the type, use `Tree.schema(theNode)` instead.\n * @remarks\n * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.\n * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.\n *\n * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where specific nodes are expected.\n * Instead construct a real node of the desired type using its constructor.\n *\n * This symbol should not be used directly for type narrowing. Instead use {@link WithType}.\n * @privateRemarks\n * This prevents non-nodes from being accidentally used as nodes and allows the type-checker to distinguish different node types.\n * @system @public\n */\nexport const typeSchemaSymbol: unique symbol = Symbol(\"TreeNode Schema\");\n\n/**\n * Adds a type symbol to a type for stronger typing.\n *\n * @typeParam TName - Same as {@link TreeNodeSchema}'s \"Name\" parameter.\n * @typeParam TKind - Same as {@link TreeNodeSchema}'s \"Kind\" parameter.\n * @typeParam TInfo - Same as {@link TreeNodeSchema}'s \"Info\" parameter: format depends on the Kind.\n * @remarks\n * Powers {@link TreeNode}'s strong typing setup.\n * @example Narrow types for overloading based on NodeKind\n * ```typescript\n * function getKeys(node: TreeNode & WithType<string, NodeKind.Array>): number[];\n * function getKeys(node: TreeNode & WithType<string, NodeKind.Map | NodeKind.Object>): string[];\n * function getKeys(node: TreeNode): string[] | number[];\n * function getKeys(node: TreeNode): string[] | number[] {\n * \tconst schema = Tree.schema(node);\n * \tswitch (schema.kind) {\n * \t\tcase NodeKind.Array: {\n * \t\t\tconst arrayNode = node as TreeArrayNode;\n * \t\t\tconst keys: number[] = [];\n * \t\t\tfor (let index = 0; index < arrayNode.length; index++) {\n * \t\t\t\tkeys.push(index);\n * \t\t\t}\n * \t\t\treturn keys;\n * \t\t}\n * \t\tcase NodeKind.Map:\n * \t\t\treturn [...(node as TreeMapNode).keys()];\n * \t\tcase NodeKind.Object:\n * \t\t\treturn Object.keys(node);\n * \t\tdefault:\n * \t\t\tthrow new Error(\"Unsupported Kind\");\n * \t}\n * }\n * ```\n * @sealed @public\n */\nexport interface WithType<\n\tout TName extends string = string,\n\tout TKind extends NodeKind = NodeKind,\n\tout TInfo = unknown,\n> {\n\t/**\n\t * Type symbol, marking a type in a way to increase type safety via strong type checking.\n\t * @deprecated Use {@link typeSchemaSymbol} instead.\n\t */\n\tget [typeNameSymbol](): TName;\n\n\t/**\n\t * Type symbol, marking a type in a way to increase type safety via strong type checking.\n\t */\n\tget [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;\n}\n"]}
@@ -2,17 +2,17 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { typeNameSymbol, typeSchemaSymbol, type WithType, type TreeNodeSchema, NodeKind, type TreeNodeSchemaClass, type TreeNodeSchemaNonClass, type TreeNodeSchemaCore, type TreeChangeEvents, type TreeNode, type Unhydrated, type InternalTreeNode, isTreeNode, tryDisposeTreeNode, HydratedContext, SimpleContextSlot, getOrCreateInnerNode, getKernel, } from "./core/index.js";
6
- export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, TreeViewConfigurationAlpha, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, SchemaFactoryAlpha, type SchemaFactoryObjectOptions, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, treeNodeApi, type TreeNodeApi, cursorFromInsertable, createFromInsertable, type NodeChangedData, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, type TreeSchemaEncodingOptions, getJsonSchema, getSimpleSchema, type VerboseTreeNode, type TreeEncodingOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, comparePersistedSchemaInternal, ViewSchema, type Unenforced, type System_Unsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeViewAlpha, type TreeBranch, type TreeBranchEvents, tryGetSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, conciseFromCursor, createFromCursor, asTreeViewAlpha, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type FieldSchemaAlphaUnsafe, type TreeSchema, } from "./api/index.js";
5
+ export { typeNameSymbol, typeSchemaSymbol, type WithType, type TreeNodeSchema, NodeKind, type TreeNodeSchemaClass, type TreeNodeSchemaNonClass, type TreeNodeSchemaCore, type TreeNode, type Unhydrated, type InternalTreeNode, isTreeNode, tryDisposeTreeNode, HydratedContext, SimpleContextSlot, getOrCreateInnerNode, getKernel, } from "./core/index.js";
6
+ export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, TreeViewConfigurationAlpha, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, SchemaFactoryAlpha, type SchemaFactoryObjectOptions, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, treeNodeApi, type TreeNodeApi, cursorFromInsertable, createFromInsertable, type NodeChangedData, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, type TreeSchemaEncodingOptions, getJsonSchema, getSimpleSchema, type VerboseTreeNode, type TreeEncodingOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, comparePersistedSchemaInternal, SchemaCompatibilityTester, type Unenforced, type System_Unsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeViewAlpha, type TreeBranch, type TreeBranchEvents, tryGetSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, conciseFromCursor, createFromCursor, asTreeViewAlpha, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type FieldSchemaAlphaUnsafe, type TreeSchema, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, schemaStatics, type TreeChangeEvents, } from "./api/index.js";
7
7
  export type { SimpleTreeSchema, SimpleNodeSchema, SimpleFieldSchema, SimpleLeafNodeSchema, SimpleMapNodeSchema, SimpleArrayNodeSchema, SimpleObjectNodeSchema, SimpleNodeSchemaBase, SimpleObjectFieldSchema, } from "./simpleSchema.js";
8
- export { type NodeFromSchema, isTreeNodeSchemaClass, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type ImplicitAllowedTypes, type TreeNodeFromImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, type AllowedTypes, FieldKind, FieldSchema, type FieldSchemaAlpha, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, type NodeBuilderData, type DefaultProvider, type FieldProps, normalizeFieldSchema, areFieldSchemaEqual, areImplicitFieldSchemaEqual, type ApplyKind, type FieldSchemaMetadata, type InsertableField, type Insertable, type UnsafeUnknownSchema, normalizeAllowedTypes, type ApplyKindInput, type InsertableTreeNodeFromAllowedTypes, type Input, type ReadableField, type ReadSchema, type NodeSchemaOptions, type NodeSchemaMetadata, evaluateLazySchema, } from "./schemaTypes.js";
8
+ export { type NodeFromSchema, isTreeNodeSchemaClass, type AnnotatedAllowedType, type AnnotatedAllowedTypes, type ImplicitFieldSchema, type ImplicitAnnotatedFieldSchema, type TreeFieldFromImplicitField, type ImplicitAllowedTypes, type ImplicitAnnotatedAllowedTypes, type UnannotateImplicitAllowedTypes, type UnannotateAllowedTypes, type UnannotateAllowedType, type UnannotateAllowedTypesList, type UnannotateAllowedTypeOrLazyItem, type UnannotateImplicitFieldSchema, type UnannotateSchemaRecord, type TreeNodeFromImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, type AllowedTypes, type AllowedTypeMetadata, type AllowedTypesMetadata, FieldKind, FieldSchema, type FieldSchemaAlpha, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, type NodeBuilderData, type DefaultProvider, type FieldProps, normalizeFieldSchema, areFieldSchemaEqual, areImplicitFieldSchemaEqual, type ApplyKind, type FieldSchemaMetadata, type InsertableField, type Insertable, type UnsafeUnknownSchema, normalizeAllowedTypes, type ApplyKindInput, type InsertableTreeNodeFromAllowedTypes, type Input, type ReadableField, type ReadSchema, type NodeSchemaOptions, type NodeSchemaMetadata, evaluateLazySchema, } from "./schemaTypes.js";
9
9
  export { getTreeNodeForField, prepareContentForHydration, } from "./proxies.js";
10
10
  export { TreeArrayNode, IterableTreeArrayContent, type ReadonlyArrayNode, } from "./arrayNode.js";
11
11
  export type { ArrayNodeCustomizableSchema, ArrayNodePojoEmulationSchema, } from "./arrayNodeTypes.js";
12
12
  export { ArrayNodeSchema, isArrayNodeSchema } from "./arrayNodeTypes.js";
13
13
  export type { MapNodeCustomizableSchema, MapNodePojoEmulationSchema, } from "./mapNodeTypes.js";
14
14
  export { MapNodeSchema, isMapNodeSchema } from "./mapNodeTypes.js";
15
- export { type FieldHasDefault, type InsertableObjectFromSchemaRecord, type ObjectFromSchemaRecord, type TreeObjectNode, setField, createUnknownOptionalFieldPolicy, } from "./objectNode.js";
15
+ export { type FieldHasDefault, type InsertableObjectFromSchemaRecord, type ObjectFromSchemaRecord, type InsertableObjectFromAnnotatedSchemaRecord, type TreeObjectNode, setField, createUnknownOptionalFieldPolicy, } from "./objectNode.js";
16
16
  export { ObjectNodeSchema } from "./objectNodeTypes.js";
17
17
  export type { TreeMapNode, MapNodeInsertableData } from "./mapNode.js";
18
18
  export { mapTreeFromNodeData, type InsertableContent, type FactoryContent, type FactoryContentObject, } from "./toMapTree.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAGrB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,GACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,aAAa,EACb,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,SAAS,EACT,eAAe,EACf,eAAe,EACf,oBAAoB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qBAAqB,CAAC;AACtD,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
@@ -4,8 +4,8 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.normalizeFieldSchema = exports.FieldSchema = exports.FieldKind = exports.isTreeNodeSchemaClass = exports.allowUnused = exports.replaceVerboseTreeHandles = exports.replaceHandles = exports.replaceConciseTreeHandles = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.asTreeViewAlpha = exports.createFromCursor = exports.conciseFromCursor = exports.verboseFromCursor = exports.cursorFromVerbose = exports.applySchemaToParserOptions = exports.tryGetSchema = exports.ViewSchema = exports.comparePersistedSchemaInternal = exports.comparePersistedSchema = exports.extractPersistedSchema = exports.getSimpleSchema = exports.getJsonSchema = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.TreeBeta = exports.createFromInsertable = exports.cursorFromInsertable = exports.treeNodeApi = exports.test_RecursiveObjectPojoMode = exports.test_RecursiveObject_base = exports.test_RecursiveObject = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.TreeViewConfigurationAlpha = exports.TreeViewConfiguration = exports.getKernel = exports.getOrCreateInnerNode = exports.SimpleContextSlot = exports.HydratedContext = exports.tryDisposeTreeNode = exports.isTreeNode = exports.NodeKind = exports.typeSchemaSymbol = exports.typeNameSymbol = void 0;
8
- exports.nullSchema = exports.handleSchema = exports.booleanSchema = exports.stringSchema = exports.numberSchema = exports.getStoredSchema = exports.toStoredSchema = exports.mapTreeFromNodeData = exports.ObjectNodeSchema = exports.createUnknownOptionalFieldPolicy = exports.setField = exports.isMapNodeSchema = exports.MapNodeSchema = exports.isArrayNodeSchema = exports.ArrayNodeSchema = exports.IterableTreeArrayContent = exports.TreeArrayNode = exports.prepareContentForHydration = exports.getTreeNodeForField = exports.evaluateLazySchema = exports.normalizeAllowedTypes = exports.areImplicitFieldSchemaEqual = exports.areFieldSchemaEqual = void 0;
7
+ exports.FieldSchema = exports.FieldKind = exports.isTreeNodeSchemaClass = exports.schemaStatics = exports.allowUnused = exports.replaceVerboseTreeHandles = exports.replaceHandles = exports.replaceConciseTreeHandles = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.asTreeViewAlpha = exports.createFromCursor = exports.conciseFromCursor = exports.verboseFromCursor = exports.cursorFromVerbose = exports.applySchemaToParserOptions = exports.tryGetSchema = exports.SchemaCompatibilityTester = exports.comparePersistedSchemaInternal = exports.comparePersistedSchema = exports.extractPersistedSchema = exports.getSimpleSchema = exports.getJsonSchema = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.TreeBeta = exports.createFromInsertable = exports.cursorFromInsertable = exports.treeNodeApi = exports.test_RecursiveObjectPojoMode = exports.test_RecursiveObject_base = exports.test_RecursiveObject = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.TreeViewConfigurationAlpha = exports.TreeViewConfiguration = exports.getKernel = exports.getOrCreateInnerNode = exports.SimpleContextSlot = exports.HydratedContext = exports.tryDisposeTreeNode = exports.isTreeNode = exports.NodeKind = exports.typeSchemaSymbol = exports.typeNameSymbol = void 0;
8
+ exports.nullSchema = exports.handleSchema = exports.booleanSchema = exports.stringSchema = exports.numberSchema = exports.getStoredSchema = exports.toStoredSchema = exports.mapTreeFromNodeData = exports.ObjectNodeSchema = exports.createUnknownOptionalFieldPolicy = exports.setField = exports.isMapNodeSchema = exports.MapNodeSchema = exports.isArrayNodeSchema = exports.ArrayNodeSchema = exports.IterableTreeArrayContent = exports.TreeArrayNode = exports.prepareContentForHydration = exports.getTreeNodeForField = exports.evaluateLazySchema = exports.normalizeAllowedTypes = exports.areImplicitFieldSchemaEqual = exports.areFieldSchemaEqual = exports.normalizeFieldSchema = void 0;
9
9
  var index_js_1 = require("./core/index.js");
10
10
  Object.defineProperty(exports, "typeNameSymbol", { enumerable: true, get: function () { return index_js_1.typeNameSymbol; } });
11
11
  Object.defineProperty(exports, "typeSchemaSymbol", { enumerable: true, get: function () { return index_js_1.typeSchemaSymbol; } });
@@ -38,7 +38,7 @@ Object.defineProperty(exports, "getSimpleSchema", { enumerable: true, get: funct
38
38
  Object.defineProperty(exports, "extractPersistedSchema", { enumerable: true, get: function () { return index_js_2.extractPersistedSchema; } });
39
39
  Object.defineProperty(exports, "comparePersistedSchema", { enumerable: true, get: function () { return index_js_2.comparePersistedSchema; } });
40
40
  Object.defineProperty(exports, "comparePersistedSchemaInternal", { enumerable: true, get: function () { return index_js_2.comparePersistedSchemaInternal; } });
41
- Object.defineProperty(exports, "ViewSchema", { enumerable: true, get: function () { return index_js_2.ViewSchema; } });
41
+ Object.defineProperty(exports, "SchemaCompatibilityTester", { enumerable: true, get: function () { return index_js_2.SchemaCompatibilityTester; } });
42
42
  Object.defineProperty(exports, "tryGetSchema", { enumerable: true, get: function () { return index_js_2.tryGetSchema; } });
43
43
  Object.defineProperty(exports, "applySchemaToParserOptions", { enumerable: true, get: function () { return index_js_2.applySchemaToParserOptions; } });
44
44
  Object.defineProperty(exports, "cursorFromVerbose", { enumerable: true, get: function () { return index_js_2.cursorFromVerbose; } });
@@ -54,6 +54,7 @@ Object.defineProperty(exports, "replaceConciseTreeHandles", { enumerable: true,
54
54
  Object.defineProperty(exports, "replaceHandles", { enumerable: true, get: function () { return index_js_2.replaceHandles; } });
55
55
  Object.defineProperty(exports, "replaceVerboseTreeHandles", { enumerable: true, get: function () { return index_js_2.replaceVerboseTreeHandles; } });
56
56
  Object.defineProperty(exports, "allowUnused", { enumerable: true, get: function () { return index_js_2.allowUnused; } });
57
+ Object.defineProperty(exports, "schemaStatics", { enumerable: true, get: function () { return index_js_2.schemaStatics; } });
57
58
  var schemaTypes_js_1 = require("./schemaTypes.js");
58
59
  Object.defineProperty(exports, "isTreeNodeSchemaClass", { enumerable: true, get: function () { return schemaTypes_js_1.isTreeNodeSchemaClass; } });
59
60
  Object.defineProperty(exports, "FieldKind", { enumerable: true, get: function () { return schemaTypes_js_1.FieldKind; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,4CAqByB;AApBxB,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAGhB,oGAAA,QAAQ,OAAA;AAUR,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,6GAAA,iBAAiB,OAAA;AACjB,gHAAA,oBAAoB,OAAA;AACpB,qGAAA,SAAS,OAAA;AAEV,2CA+FwB;AA1FvB,iHAAA,qBAAqB,OAAA;AACrB,sHAAA,0BAA0B,OAAA;AAI1B,yGAAA,aAAa,OAAA;AACb,8GAAA,kBAAkB,OAAA;AAKlB,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AACf,gHAAA,oBAAoB,OAAA;AACpB,qHAAA,yBAAyB,OAAA;AACzB,wHAAA,4BAA4B,OAAA;AAC5B,uGAAA,WAAW,OAAA;AAEX,gHAAA,oBAAoB,OAAA;AACpB,gHAAA,oBAAoB,OAAA;AAEpB,oGAAA,QAAQ,OAAA;AAIR,iHAAA,qBAAqB,OAAA;AACrB,iHAAA,qBAAqB,OAAA;AAerB,yGAAA,aAAa,OAAA;AACb,2GAAA,eAAe,OAAA;AAIf,kHAAA,sBAAsB,OAAA;AACtB,kHAAA,sBAAsB,OAAA;AAEtB,0HAAA,8BAA8B,OAAA;AAC9B,sGAAA,UAAU,OAAA;AAQV,wGAAA,YAAY,OAAA;AACZ,sHAAA,0BAA0B,OAAA;AAC1B,6GAAA,iBAAiB,OAAA;AACjB,6GAAA,iBAAiB,OAAA;AACjB,6GAAA,iB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n */\n\nexport {\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype WithType,\n\ttype TreeNodeSchema,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n\ttype TreeChangeEvents,\n\t// TreeNode is only type exported, which prevents use of the class object for unsupported use-cases like direct sub-classing and instanceof.\n\t// See docs on TreeNode for more details.\n\ttype TreeNode,\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n\tisTreeNode,\n\ttryDisposeTreeNode,\n\tHydratedContext,\n\tSimpleContextSlot,\n\tgetOrCreateInnerNode,\n\tgetKernel,\n} from \"./core/index.js\";\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\ttype SchemaFactoryObjectOptions,\n\ttype ScopedSchemaName,\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttest_RecursiveObject,\n\ttest_RecursiveObject_base,\n\ttest_RecursiveObjectPojoMode,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\tcursorFromInsertable,\n\tcreateFromInsertable,\n\ttype NodeChangedData,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\ttype TreeSchemaEncodingOptions,\n\tgetJsonSchema,\n\tgetSimpleSchema,\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\tcomparePersistedSchemaInternal,\n\tViewSchema,\n\ttype Unenforced,\n\ttype System_Unsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeViewAlpha,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\ttryGetSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\tconciseFromCursor,\n\tcreateFromCursor,\n\tasTreeViewAlpha,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype FieldSchemaAlphaUnsafe,\n\ttype TreeSchema,\n} from \"./api/index.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBase,\n\tSimpleObjectFieldSchema,\n} from \"./simpleSchema.js\";\nexport {\n\ttype NodeFromSchema,\n\tisTreeNodeSchemaClass,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype ImplicitAllowedTypes,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype AllowedTypes,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\ttype NodeBuilderData,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\tnormalizeFieldSchema,\n\tareFieldSchemaEqual,\n\tareImplicitFieldSchemaEqual,\n\ttype ApplyKind,\n\ttype FieldSchemaMetadata,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype UnsafeUnknownSchema,\n\tnormalizeAllowedTypes,\n\ttype ApplyKindInput,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaMetadata,\n\tevaluateLazySchema,\n} from \"./schemaTypes.js\";\nexport {\n\tgetTreeNodeForField,\n\tprepareContentForHydration,\n} from \"./proxies.js\";\nexport {\n\tTreeArrayNode,\n\tIterableTreeArrayContent,\n\ttype ReadonlyArrayNode,\n} from \"./arrayNode.js\";\nexport type {\n\tArrayNodeCustomizableSchema,\n\tArrayNodePojoEmulationSchema,\n} from \"./arrayNodeTypes.js\";\nexport { ArrayNodeSchema, isArrayNodeSchema } from \"./arrayNodeTypes.js\";\nexport type {\n\tMapNodeCustomizableSchema,\n\tMapNodePojoEmulationSchema,\n} from \"./mapNodeTypes.js\";\nexport { MapNodeSchema, isMapNodeSchema } from \"./mapNodeTypes.js\";\nexport {\n\ttype FieldHasDefault,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype ObjectFromSchemaRecord,\n\ttype TreeObjectNode,\n\tsetField,\n\tcreateUnknownOptionalFieldPolicy,\n} from \"./objectNode.js\";\nexport { ObjectNodeSchema } from \"./objectNodeTypes.js\";\nexport type { TreeMapNode, MapNodeInsertableData } from \"./mapNode.js\";\nexport {\n\tmapTreeFromNodeData,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n} from \"./toMapTree.js\";\nexport { toStoredSchema, getStoredSchema } from \"./toStoredSchema.js\";\nexport {\n\tnumberSchema,\n\tstringSchema,\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n} from \"./leafNodeSchema.js\";\nexport type { LeafSchema } from \"./leafNodeSchema.js\";\nexport type { LazyItem, FlexList, FlexListToUnion, ExtractItemType } from \"./flexList.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,4CAoByB;AAnBxB,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAGhB,oGAAA,QAAQ,OAAA;AASR,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,6GAAA,iBAAiB,OAAA;AACjB,gHAAA,oBAAoB,OAAA;AACpB,qGAAA,SAAS,OAAA;AAEV,2CAmGwB;AA9FvB,iHAAA,qBAAqB,OAAA;AACrB,sHAAA,0BAA0B,OAAA;AAI1B,yGAAA,aAAa,OAAA;AACb,8GAAA,kBAAkB,OAAA;AAKlB,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AACf,gHAAA,oBAAoB,OAAA;AACpB,qHAAA,yBAAyB,OAAA;AACzB,wHAAA,4BAA4B,OAAA;AAC5B,uGAAA,WAAW,OAAA;AAEX,gHAAA,oBAAoB,OAAA;AACpB,gHAAA,oBAAoB,OAAA;AAEpB,oGAAA,QAAQ,OAAA;AAIR,iHAAA,qBAAqB,OAAA;AACrB,iHAAA,qBAAqB,OAAA;AAerB,yGAAA,aAAa,OAAA;AACb,2GAAA,eAAe,OAAA;AAIf,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A7D,mHAAA,cAAc,OAAA;AAAE,oHAAA,eAAe,OAAA;AACxC,yDAM6B;AAL5B,iHAAA,YAAY,OAAA;AACZ,iHAAA,YAAY,OAAA;AACZ,kHAAA,aAAa,OAAA;AACb,iHAAA,YAAY,OAAA;AACZ,+GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype WithType,\n\ttype TreeNodeSchema,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n\t// TreeNode is only type exported, which prevents use of the class object for unsupported use-cases like direct sub-classing and instanceof.\n\t// See docs on TreeNode for more details.\n\ttype TreeNode,\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n\tisTreeNode,\n\ttryDisposeTreeNode,\n\tHydratedContext,\n\tSimpleContextSlot,\n\tgetOrCreateInnerNode,\n\tgetKernel,\n} from \"./core/index.js\";\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\ttype SchemaFactoryObjectOptions,\n\ttype ScopedSchemaName,\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttest_RecursiveObject,\n\ttest_RecursiveObject_base,\n\ttest_RecursiveObjectPojoMode,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\tcursorFromInsertable,\n\tcreateFromInsertable,\n\ttype NodeChangedData,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\ttype TreeSchemaEncodingOptions,\n\tgetJsonSchema,\n\tgetSimpleSchema,\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\tcomparePersistedSchemaInternal,\n\tSchemaCompatibilityTester,\n\ttype Unenforced,\n\ttype System_Unsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeViewAlpha,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\ttryGetSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\tconciseFromCursor,\n\tcreateFromCursor,\n\tasTreeViewAlpha,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype FieldSchemaAlphaUnsafe,\n\ttype TreeSchema,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tschemaStatics,\n\ttype TreeChangeEvents,\n} from \"./api/index.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBase,\n\tSimpleObjectFieldSchema,\n} from \"./simpleSchema.js\";\nexport {\n\ttype NodeFromSchema,\n\tisTreeNodeSchemaClass,\n\ttype AnnotatedAllowedType,\n\ttype AnnotatedAllowedTypes,\n\ttype ImplicitFieldSchema,\n\ttype ImplicitAnnotatedFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype ImplicitAllowedTypes,\n\ttype ImplicitAnnotatedAllowedTypes,\n\ttype UnannotateImplicitAllowedTypes,\n\ttype UnannotateAllowedTypes,\n\ttype UnannotateAllowedType,\n\ttype UnannotateAllowedTypesList,\n\ttype UnannotateAllowedTypeOrLazyItem,\n\ttype UnannotateImplicitFieldSchema,\n\ttype UnannotateSchemaRecord,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype AllowedTypes,\n\ttype AllowedTypeMetadata,\n\ttype AllowedTypesMetadata,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\ttype NodeBuilderData,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\tnormalizeFieldSchema,\n\tareFieldSchemaEqual,\n\tareImplicitFieldSchemaEqual,\n\ttype ApplyKind,\n\ttype FieldSchemaMetadata,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype UnsafeUnknownSchema,\n\tnormalizeAllowedTypes,\n\ttype ApplyKindInput,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaMetadata,\n\tevaluateLazySchema,\n} from \"./schemaTypes.js\";\nexport {\n\tgetTreeNodeForField,\n\tprepareContentForHydration,\n} from \"./proxies.js\";\nexport {\n\tTreeArrayNode,\n\tIterableTreeArrayContent,\n\ttype ReadonlyArrayNode,\n} from \"./arrayNode.js\";\nexport type {\n\tArrayNodeCustomizableSchema,\n\tArrayNodePojoEmulationSchema,\n} from \"./arrayNodeTypes.js\";\nexport { ArrayNodeSchema, isArrayNodeSchema } from \"./arrayNodeTypes.js\";\nexport type {\n\tMapNodeCustomizableSchema,\n\tMapNodePojoEmulationSchema,\n} from \"./mapNodeTypes.js\";\nexport { MapNodeSchema, isMapNodeSchema } from \"./mapNodeTypes.js\";\nexport {\n\ttype FieldHasDefault,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype ObjectFromSchemaRecord,\n\ttype InsertableObjectFromAnnotatedSchemaRecord,\n\ttype TreeObjectNode,\n\tsetField,\n\tcreateUnknownOptionalFieldPolicy,\n} from \"./objectNode.js\";\nexport { ObjectNodeSchema } from \"./objectNodeTypes.js\";\nexport type { TreeMapNode, MapNodeInsertableData } from \"./mapNode.js\";\nexport {\n\tmapTreeFromNodeData,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n} from \"./toMapTree.js\";\nexport { toStoredSchema, getStoredSchema } from \"./toStoredSchema.js\";\nexport {\n\tnumberSchema,\n\tstringSchema,\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n} from \"./leafNodeSchema.js\";\nexport type { LeafSchema } from \"./leafNodeSchema.js\";\nexport type { LazyItem, FlexList, FlexListToUnion, ExtractItemType } from \"./flexList.js\";\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type ImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type NodeSchemaMetadata, type TreeNodeFromImplicitAllowedTypes } from "./schemaTypes.js";
5
+ import { type ImplicitAllowedTypes, type ImplicitAnnotatedAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type NodeSchemaMetadata, type TreeNodeFromImplicitAllowedTypes } from "./schemaTypes.js";
6
6
  import { type TreeNode } from "./core/index.js";
7
7
  import { type RestrictiveStringRecord } from "../util/index.js";
8
8
  import type { MapNodeCustomizableSchema, MapNodePojoEmulationSchema } from "./mapNodeTypes.js";
@@ -79,7 +79,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
79
79
  * @param base - base schema type to extend.
80
80
  * @param useMapPrototype - should this type emulate a ES6 Map object (by faking its prototype with a proxy).
81
81
  */
82
- export declare function mapSchema<TName extends string, const T extends ImplicitAllowedTypes, const ImplicitlyConstructable extends boolean, const TCustomMetadata = unknown>(identifier: TName, info: T, implicitlyConstructable: ImplicitlyConstructable, useMapPrototype: boolean, metadata?: NodeSchemaMetadata<TCustomMetadata>): MapNodeCustomizableSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> & MapNodePojoEmulationSchema<TName, T, ImplicitlyConstructable, TCustomMetadata>;
82
+ export declare function mapSchema<TName extends string, const T extends ImplicitAnnotatedAllowedTypes, const ImplicitlyConstructable extends boolean, const TCustomMetadata = unknown>(identifier: TName, info: T, implicitlyConstructable: ImplicitlyConstructable, useMapPrototype: boolean, metadata?: NodeSchemaMetadata<TCustomMetadata>): MapNodeCustomizableSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> & MapNodePojoEmulationSchema<TName, T, ImplicitlyConstructable, TCustomMetadata>;
83
83
  /**
84
84
  * Content which can be used to construct a Map node, explicitly or implicitly.
85
85
  * @system @public
@@ -1 +1 @@
1
- {"version":3,"file":"mapNode.d.ts","sourceRoot":"","sources":["../../src/simple-tree/mapNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EAIN,KAAK,oBAAoB,EACzB,KAAK,0C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explicit-function-return-type
98
98
  function mapSchema(identifier, info, implicitlyConstructable, useMapPrototype, metadata) {
99
- const lazyChildTypes = new internal_1.Lazy(() => (0, schemaTypes_js_1.normalizeAllowedTypes)(info));
99
+ const lazyChildTypes = new internal_1.Lazy(() => (0, schemaTypes_js_1.normalizeAllowedTypes)((0, schemaTypes_js_1.unannotateImplicitAllowedTypes)(info)));
100
100
  const lazyAllowedTypesIdentifiers = new internal_1.Lazy(() => new Set([...lazyChildTypes.value].map((type) => type.identifier)));
101
101
  let unhydratedContext;
102
102
  class Schema extends CustomMapNodeBase {
@@ -1 +1 @@
1
- {"version":3,"file":"mapNode.js","sourceRoot":"","sources":["../../src/simple-tree/mapNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAC3D,4DAKuC;AACvC,6CAA+E;AAC/E,qDAQ0B;AAC1B,8CAayB;AACzB,iDAIwB;AACxB,+CAA8E;AAC9E,yDAAyE;AAEzE,yDAA0D;AAuF1D,0IAA0I;AAC1I,uDAAuD;AACvD,8DAA8D;AAC9D,MAAM,OAAO,GAAmC;IAC/C,cAAc,EAAE,GAAG,EAAE;QACpB,OAAO,GAAG,CAAC,SAAS,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,MAAe,iBAAwD,SAAQ,gCAE9E;IAGA,YAAmB,KAA+D;QACjF,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IACpB,CAAC;IAEM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACvB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;IAED,IAAY,SAAS;QACpB,OAAO,IAAA,+BAAoB,EAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAEO,MAAM,CAAC,GAAW;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAA,gBAAK,EAAC,GAAG,CAAC,CAA0B,CAAC;QAC3E,OAAO,KAAK,CAAC,MAAM,CAAC;IACrB,CAAC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,CAAC;YAC1B,OAAO,UAAU,CAAC;QACnB,CAAC;QACD,IAAW,CAAC,2BAAgB,CAAC;YAC5B,OAAO,MAAM,CAAC,iBAAiB,EAAE,WAA6C,CAAC;QAChF,CAAC;;IAvByB,wBAAiB,GAAgC,SAAS,CAAC;IAQ9D,iBAAU,GAAG,UAAU,CAAC;IACxB,WAAI,GAAG,IAAI,CAAC;IACZ,8BAAuB,GAC7C,uBAAuB,CAAC;IAIF,eAAQ,GAAwC,QAAQ,IAAI,EAAE,CAAC;IAUvF,MAAM,YAAY,GAMgE,MAAM,CAAC;IACzF,OAAO,YAAY,CAAC;AACrB,CAAC;AA/ED,8BA+EC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Lazy } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype OptionalFieldEditBuilder,\n\tgetSchemaAndPolicy,\n} from \"../feature-libraries/index.js\";\nimport { getTreeNodeForField, prepareContentForHydration } from \"./proxies.js\";\nimport {\n\tcreateFieldSchema,\n\tFieldKind,\n\tnormalizeAllowedTypes,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype TreeNodeFromImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport {\n\tgetKernel,\n\ttype InnerNode,\n\tNodeKind,\n\ttype TreeNodeSchema,\n\t// eslint-disable-next-line import/no-deprecated\n\ttypeNameSymbol,\n\ttype TreeNode,\n\ttypeSchemaSymbol,\n\ttype Context,\n\tUnhydratedFlexTreeNode,\n\tgetOrCreateInnerNode,\n\ttype InternalTreeNode,\n} from \"./core/index.js\";\nimport {\n\tmapTreeFromNodeData,\n\ttype FactoryContent,\n\ttype InsertableContent,\n} from \"./toMapTree.js\";\nimport { brand, count, type RestrictiveStringRecord } from \"../util/index.js\";\nimport { TreeNodeValid, type MostDerivedData } from \"./treeNodeValid.js\";\nimport type { ExclusiveMapTree } from \"../core/index.js\";\nimport { getUnhydratedContext } from \"./createContext.js\";\nimport type { MapNodeCustomizableSchema, MapNodePojoEmulationSchema } from \"./mapNodeTypes.js\";\n\n/**\n * A map of string keys to tree objects.\n *\n * @privateRemarks\n * Add support for `clear` once we have established merge semantics for it.\n *\n * @sealed @public\n */\nexport interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes>\n\textends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\tTreeNode {\n\t/**\n\t * Adds or updates an entry in the map with a specified `key` and a `value`.\n\t *\n\t * @param key - The key of the element to add to the map.\n\t * @param value - The value of the element to add to the map.\n\t *\n\t * @remarks\n\t * Setting the value at a key to `undefined` is equivalent to calling {@link TreeMapNode.delete} with that key.\n\t */\n\tset(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T> | undefined): void;\n\n\t/**\n\t * Removes the specified element from this map by its `key`.\n\t *\n\t * @remarks\n\t * Note: unlike JavaScript's Map API, this method does not return a flag indicating whether or not the value was\n\t * deleted.\n\t *\n\t * @privateRemarks\n\t * Regarding the choice to not return a boolean: Since this data structure is distributed in nature, it isn't\n\t * possible to tell whether or not the item was deleted as a result of this method call. Returning a \"best guess\"\n\t * is more likely to create issues / promote bad usage patterns than offer useful information.\n\t *\n\t * @param key - The key of the element to remove from the map.\n\t */\n\tdelete(key: string): void;\n\n\t/**\n\t * Returns an iterable of keys in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the keys returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tkeys(): IterableIterator<string>;\n\n\t/**\n\t * Returns an iterable of values in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the values returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tvalues(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the entries returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tentries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;\n\n\t/**\n\t * Executes the provided function once per each key/value pair in this map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order in which the function is called with respect to the map's entries.\n\t * If your usage scenario depends on consistent ordering, you will need to account for this.\n\t */\n\tforEach(\n\t\tcallbackfn: (\n\t\t\tvalue: TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\tkey: string,\n\t\t\tmap: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\t) => void,\n\t\t// Typing inherited from `ReadonlyMap`.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tthisArg?: any,\n\t): void;\n}\n\n// TreeMapNode is invariant over schema type, so for this handler to work with all schema, the only possible type for the schema is `any`.\n// This is not ideal, but no alternatives are possible.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst handler: ProxyHandler<TreeMapNode<any>> = {\n\tgetPrototypeOf: () => {\n\t\treturn Map.prototype;\n\t},\n};\n\nabstract class CustomMapNodeBase<const T extends ImplicitAllowedTypes> extends TreeNodeValid<\n\tMapNodeInsertableData<T>\n> {\n\tpublic static readonly kind = NodeKind.Map;\n\n\tpublic constructor(input?: InternalTreeNode | MapNodeInsertableData<T> | undefined) {\n\t\tsuper(input ?? []);\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\treturn this.entries();\n\t}\n\n\tprivate get innerNode(): InnerNode {\n\t\treturn getOrCreateInnerNode(this);\n\t}\n\n\tprivate editor(key: string): OptionalFieldEditBuilder<ExclusiveMapTree> {\n\t\tconst field = this.innerNode.getBoxed(brand(key)) as FlexTreeOptionalField;\n\t\treturn field.editor;\n\t}\n\n\tpublic delete(key: string): void {\n\t\tconst field = this.innerNode.getBoxed(brand(key));\n\t\tthis.editor(key).set(undefined, field.length === 0);\n\t}\n\tpublic *entries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\tconst node = this.innerNode;\n\t\tfor (const key of node.keys()) {\n\t\t\tyield [\n\t\t\t\tkey,\n\t\t\t\tgetTreeNodeForField(node.getBoxed(key)) as TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\t];\n\t\t}\n\t}\n\tpublic get(key: string): TreeNodeFromImplicitAllowedTypes<T> {\n\t\tconst node = this.innerNode;\n\t\tconst field = node.getBoxed(brand(key));\n\t\treturn getTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t}\n\tpublic has(key: string): boolean {\n\t\treturn this.innerNode.tryGetField(brand(key)) !== undefined;\n\t}\n\tpublic keys(): IterableIterator<string> {\n\t\tconst node = this.innerNode;\n\t\treturn node.keys();\n\t}\n\tpublic set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T>): this {\n\t\tconst kernel = getKernel(this);\n\t\tconst node = this.innerNode;\n\t\tconst mapTree = mapTreeFromNodeData(\n\t\t\tvalue as InsertableContent | undefined,\n\t\t\tcreateFieldSchema(FieldKind.Optional, kernel.schema.info as ImplicitAllowedTypes),\n\t\t\tnode.context.isHydrated() ? node.context.nodeKeyManager : undefined,\n\t\t\tgetSchemaAndPolicy(node),\n\t\t);\n\n\t\tconst field = node.getBoxed(brand(key));\n\t\tif (node.context.isHydrated()) {\n\t\t\tprepareContentForHydration(mapTree, node.context.checkout.forest);\n\t\t}\n\n\t\tthis.editor(key).set(mapTree, field.length === 0);\n\t\treturn this;\n\t}\n\tpublic get size(): number {\n\t\treturn count(this.innerNode.keys());\n\t}\n\tpublic *values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\tfor (const [, value] of this.entries()) {\n\t\t\tyield value;\n\t\t}\n\t}\n\tpublic forEach<TThis extends TreeMapNode<T>>(\n\t\tthis: TThis,\n\t\tcallbackFn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: TThis) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tfor (const field of getOrCreateInnerNode(this).boxedIterator()) {\n\t\t\tconst node = getTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t\t\tcallbackFn.call(thisArg, node, field.key, this);\n\t\t}\n\t}\n\t// TODO: add `clear` once we have established merge semantics for it.\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n *\n * @param base - base schema type to extend.\n * @param useMapPrototype - should this type emulate a ES6 Map object (by faking its prototype with a proxy).\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function mapSchema<\n\tTName extends string,\n\tconst T extends ImplicitAllowedTypes,\n\tconst ImplicitlyConstructable extends boolean,\n\tconst TCustomMetadata = unknown,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tuseMapPrototype: boolean,\n\tmetadata?: NodeSchemaMetadata<TCustomMetadata>,\n) {\n\tconst lazyChildTypes = new Lazy(() => normalizeAllowedTypes(info));\n\tconst lazyAllowedTypesIdentifiers = new Lazy(\n\t\t() => new Set([...lazyChildTypes.value].map((type) => type.identifier)),\n\t);\n\n\tlet unhydratedContext: Context;\n\n\tclass Schema extends CustomMapNodeBase<T> implements TreeMapNode<T> {\n\t\tpublic static override prepareInstance<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tflexNode: FlexTreeNode,\n\t\t): TreeNodeValid<T2> {\n\t\t\tif (useMapPrototype) {\n\t\t\t\treturn new Proxy<Schema>(instance as Schema, handler as ProxyHandler<Schema>);\n\t\t\t}\n\t\t\treturn instance;\n\t\t}\n\n\t\tpublic static override buildRawNode<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tinput: T2,\n\t\t): UnhydratedFlexTreeNode {\n\t\t\treturn UnhydratedFlexTreeNode.getOrCreate(\n\t\t\t\tunhydratedContext,\n\t\t\t\tmapTreeFromNodeData(input as FactoryContent, this as unknown as ImplicitAllowedTypes),\n\t\t\t);\n\t\t}\n\n\t\tpublic static get allowedTypesIdentifiers(): ReadonlySet<string> {\n\t\t\treturn lazyAllowedTypesIdentifiers.value;\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup<T2>(this: typeof TreeNodeValid<T2>): Context {\n\t\t\tconst schema = this as unknown as TreeNodeSchema;\n\t\t\tunhydratedContext = getUnhydratedContext(schema);\n\t\t\treturn unhydratedContext;\n\t\t}\n\n\t\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: ImplicitlyConstructable =\n\t\t\timplicitlyConstructable;\n\t\tpublic static get childTypes(): ReadonlySet<TreeNodeSchema> {\n\t\t\treturn lazyChildTypes.value;\n\t\t}\n\t\tpublic static readonly metadata: NodeSchemaMetadata<TCustomMetadata> = metadata ?? {};\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): typeof schemaErased {\n\t\t\treturn Schema.constructorCached?.constructor as unknown as typeof schemaErased;\n\t\t}\n\t}\n\tconst schemaErased: MapNodeCustomizableSchema<\n\t\tTName,\n\t\tT,\n\t\tImplicitlyConstructable,\n\t\tTCustomMetadata\n\t> &\n\t\tMapNodePojoEmulationSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> = Schema;\n\treturn schemaErased;\n}\n\n/**\n * Content which can be used to construct a Map node, explicitly or implicitly.\n * @system @public\n */\nexport type MapNodeInsertableData<T extends ImplicitAllowedTypes> =\n\t| Iterable<readonly [string, InsertableTreeNodeFromImplicitAllowedTypes<T>]>\n\t| RestrictiveStringRec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IAAI,EAAE,CAAC;IAUvF,MAAM,YAAY,GAMgE,MAAM,CAAC;IACzF,OAAO,YAAY,CAAC;AACrB,CAAC;AApFD,8BAoFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Lazy } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype OptionalFieldEditBuilder,\n\tgetSchemaAndPolicy,\n} from \"../feature-libraries/index.js\";\nimport { getTreeNodeForField, prepareContentForHydration } from \"./proxies.js\";\nimport {\n\tcreateFieldSchema,\n\tFieldKind,\n\tnormalizeAllowedTypes,\n\tunannotateImplicitAllowedTypes,\n\ttype ImplicitAllowedTypes,\n\ttype ImplicitAnnotatedAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype UnannotateImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport {\n\tgetKernel,\n\ttype InnerNode,\n\tNodeKind,\n\ttype TreeNodeSchema,\n\t// eslint-disable-next-line import/no-deprecated\n\ttypeNameSymbol,\n\ttype TreeNode,\n\ttypeSchemaSymbol,\n\ttype Context,\n\tUnhydratedFlexTreeNode,\n\tgetOrCreateInnerNode,\n\ttype InternalTreeNode,\n} from \"./core/index.js\";\nimport {\n\tmapTreeFromNodeData,\n\ttype FactoryContent,\n\ttype InsertableContent,\n} from \"./toMapTree.js\";\nimport { brand, count, type RestrictiveStringRecord } from \"../util/index.js\";\nimport { TreeNodeValid, type MostDerivedData } from \"./treeNodeValid.js\";\nimport type { ExclusiveMapTree } from \"../core/index.js\";\nimport { getUnhydratedContext } from \"./createContext.js\";\nimport type { MapNodeCustomizableSchema, MapNodePojoEmulationSchema } from \"./mapNodeTypes.js\";\n\n/**\n * A map of string keys to tree objects.\n *\n * @privateRemarks\n * Add support for `clear` once we have established merge semantics for it.\n *\n * @sealed @public\n */\nexport interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes>\n\textends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\tTreeNode {\n\t/**\n\t * Adds or updates an entry in the map with a specified `key` and a `value`.\n\t *\n\t * @param key - The key of the element to add to the map.\n\t * @param value - The value of the element to add to the map.\n\t *\n\t * @remarks\n\t * Setting the value at a key to `undefined` is equivalent to calling {@link TreeMapNode.delete} with that key.\n\t */\n\tset(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T> | undefined): void;\n\n\t/**\n\t * Removes the specified element from this map by its `key`.\n\t *\n\t * @remarks\n\t * Note: unlike JavaScript's Map API, this method does not return a flag indicating whether or not the value was\n\t * deleted.\n\t *\n\t * @privateRemarks\n\t * Regarding the choice to not return a boolean: Since this data structure is distributed in nature, it isn't\n\t * possible to tell whether or not the item was deleted as a result of this method call. Returning a \"best guess\"\n\t * is more likely to create issues / promote bad usage patterns than offer useful information.\n\t *\n\t * @param key - The key of the element to remove from the map.\n\t */\n\tdelete(key: string): void;\n\n\t/**\n\t * Returns an iterable of keys in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the keys returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tkeys(): IterableIterator<string>;\n\n\t/**\n\t * Returns an iterable of values in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the values returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tvalues(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the entries returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tentries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;\n\n\t/**\n\t * Executes the provided function once per each key/value pair in this map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order in which the function is called with respect to the map's entries.\n\t * If your usage scenario depends on consistent ordering, you will need to account for this.\n\t */\n\tforEach(\n\t\tcallbackfn: (\n\t\t\tvalue: TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\tkey: string,\n\t\t\tmap: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\t) => void,\n\t\t// Typing inherited from `ReadonlyMap`.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tthisArg?: any,\n\t): void;\n}\n\n// TreeMapNode is invariant over schema type, so for this handler to work with all schema, the only possible type for the schema is `any`.\n// This is not ideal, but no alternatives are possible.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst handler: ProxyHandler<TreeMapNode<any>> = {\n\tgetPrototypeOf: () => {\n\t\treturn Map.prototype;\n\t},\n};\n\nabstract class CustomMapNodeBase<const T extends ImplicitAllowedTypes> extends TreeNodeValid<\n\tMapNodeInsertableData<T>\n> {\n\tpublic static readonly kind = NodeKind.Map;\n\n\tpublic constructor(input?: InternalTreeNode | MapNodeInsertableData<T> | undefined) {\n\t\tsuper(input ?? []);\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\treturn this.entries();\n\t}\n\n\tprivate get innerNode(): InnerNode {\n\t\treturn getOrCreateInnerNode(this);\n\t}\n\n\tprivate editor(key: string): OptionalFieldEditBuilder<ExclusiveMapTree> {\n\t\tconst field = this.innerNode.getBoxed(brand(key)) as FlexTreeOptionalField;\n\t\treturn field.editor;\n\t}\n\n\tpublic delete(key: string): void {\n\t\tconst field = this.innerNode.getBoxed(brand(key));\n\t\tthis.editor(key).set(undefined, field.length === 0);\n\t}\n\tpublic *entries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\tconst node = this.innerNode;\n\t\tfor (const key of node.keys()) {\n\t\t\tyield [\n\t\t\t\tkey,\n\t\t\t\tgetTreeNodeForField(node.getBoxed(key)) as TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\t];\n\t\t}\n\t}\n\tpublic get(key: string): TreeNodeFromImplicitAllowedTypes<T> {\n\t\tconst node = this.innerNode;\n\t\tconst field = node.getBoxed(brand(key));\n\t\treturn getTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t}\n\tpublic has(key: string): boolean {\n\t\treturn this.innerNode.tryGetField(brand(key)) !== undefined;\n\t}\n\tpublic keys(): IterableIterator<string> {\n\t\tconst node = this.innerNode;\n\t\treturn node.keys();\n\t}\n\tpublic set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T>): this {\n\t\tconst kernel = getKernel(this);\n\t\tconst node = this.innerNode;\n\t\tconst mapTree = mapTreeFromNodeData(\n\t\t\tvalue as InsertableContent | undefined,\n\t\t\tcreateFieldSchema(FieldKind.Optional, kernel.schema.info as ImplicitAllowedTypes),\n\t\t\tnode.context.isHydrated() ? node.context.nodeKeyManager : undefined,\n\t\t\tgetSchemaAndPolicy(node),\n\t\t);\n\n\t\tconst field = node.getBoxed(brand(key));\n\t\tif (node.context.isHydrated()) {\n\t\t\tprepareContentForHydration(mapTree, node.context.checkout.forest);\n\t\t}\n\n\t\tthis.editor(key).set(mapTree, field.length === 0);\n\t\treturn this;\n\t}\n\tpublic get size(): number {\n\t\treturn count(this.innerNode.keys());\n\t}\n\tpublic *values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\tfor (const [, value] of this.entries()) {\n\t\t\tyield value;\n\t\t}\n\t}\n\tpublic forEach<TThis extends TreeMapNode<T>>(\n\t\tthis: TThis,\n\t\tcallbackFn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: TThis) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tfor (const field of getOrCreateInnerNode(this).boxedIterator()) {\n\t\t\tconst node = getTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t\t\tcallbackFn.call(thisArg, node, field.key, this);\n\t\t}\n\t}\n\t// TODO: add `clear` once we have established merge semantics for it.\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n *\n * @param base - base schema type to extend.\n * @param useMapPrototype - should this type emulate a ES6 Map object (by faking its prototype with a proxy).\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function mapSchema<\n\tTName extends string,\n\tconst T extends ImplicitAnnotatedAllowedTypes,\n\tconst ImplicitlyConstructable extends boolean,\n\tconst TCustomMetadata = unknown,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tuseMapPrototype: boolean,\n\tmetadata?: NodeSchemaMetadata<TCustomMetadata>,\n) {\n\tconst lazyChildTypes = new Lazy(() =>\n\t\tnormalizeAllowedTypes(unannotateImplicitAllowedTypes(info)),\n\t);\n\tconst lazyAllowedTypesIdentifiers = new Lazy(\n\t\t() => new Set([...lazyChildTypes.value].map((type) => type.identifier)),\n\t);\n\n\tlet unhydratedContext: Context;\n\n\tclass Schema\n\t\textends CustomMapNodeBase<UnannotateImplicitAllowedTypes<T>>\n\t\timplements TreeMapNode<UnannotateImplicitAllowedTypes<T>>\n\t{\n\t\tpublic static override prepareInstance<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tflexNode: FlexTreeNode,\n\t\t): TreeNodeValid<T2> {\n\t\t\tif (useMapPrototype) {\n\t\t\t\treturn new Proxy<Schema>(instance as Schema, handler as ProxyHandler<Schema>);\n\t\t\t}\n\t\t\treturn instance;\n\t\t}\n\n\t\tpublic static override buildRawNode<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tinput: T2,\n\t\t): UnhydratedFlexTreeNode {\n\t\t\treturn UnhydratedFlexTreeNode.getOrCreate(\n\t\t\t\tunhydratedContext,\n\t\t\t\tmapTreeFromNodeData(input as FactoryContent, this as unknown as ImplicitAllowedTypes),\n\t\t\t);\n\t\t}\n\n\t\tpublic static get allowedTypesIdentifiers(): ReadonlySet<string> {\n\t\t\treturn lazyAllowedTypesIdentifiers.value;\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup<T2>(this: typeof TreeNodeValid<T2>): Context {\n\t\t\tconst schema = this as unknown as TreeNodeSchema;\n\t\t\tunhydratedContext = getUnhydratedContext(schema);\n\t\t\treturn unhydratedContext;\n\t\t}\n\n\t\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: ImplicitlyConstructable =\n\t\t\timplicitlyConstructable;\n\t\tpublic static get childTypes(): ReadonlySet<TreeNodeSchema> {\n\t\t\treturn lazyChildTypes.value;\n\t\t}\n\t\tpublic static readonly metadata: NodeSchemaMetadata<TCustomMetadata> = metadata ?? {};\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): typeof schemaErased {\n\t\t\treturn Schema.constructorCached?.constructor as unknown as typeof schemaErased;\n\t\t}\n\t}\n\tconst schemaErased: MapNodeCustomizableSchema<\n\t\tTName,\n\t\tT,\n\t\tImplicitlyConstructable,\n\t\tTCustomMetadata\n\t> &\n\t\tMapNodePojoEmulationSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> = Schema;\n\treturn schemaErased;\n}\n\n/**\n * Content which can be used to construct a Map node, explicitly or implicitly.\n * @system @public\n */\nexport type MapNodeInsertableData<T extends ImplicitAllowedTypes> =\n\t| Iterable<readonly [string, InsertableTreeNodeFromImplicitAllowedTypes<T>]>\n\t| RestrictiveStringRecord<InsertableTreeNodeFromImplicitAllowedTypes<T>>;\n"]}
@@ -3,20 +3,20 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { MapNodeInsertableData, TreeMapNode } from "./mapNode.js";
6
- import type { ImplicitAllowedTypes } from "./schemaTypes.js";
6
+ import type { ImplicitAnnotatedAllowedTypes, UnannotateImplicitAllowedTypes } from "./schemaTypes.js";
7
7
  import { NodeKind, type TreeNodeSchemaClass, type TreeNodeSchema, type TreeNodeSchemaNonClass, type WithType } from "./core/index.js";
8
8
  import type { SimpleMapNodeSchema } from "./simpleSchema.js";
9
9
  /**
10
10
  * A schema for customizable {@link (TreeMapNode:interface)}s.
11
11
  * @system @sealed @alpha
12
12
  */
13
- export interface MapNodeCustomizableSchema<out TName extends string = string, in out T extends ImplicitAllowedTypes = ImplicitAllowedTypes, out ImplicitlyConstructable extends boolean = true, out TCustomMetadata = unknown> extends TreeNodeSchemaClass<TName, NodeKind.Map, TreeMapNode<T> & WithType<TName, NodeKind.Map, T>, MapNodeInsertableData<T>, ImplicitlyConstructable, T, undefined, TCustomMetadata>, SimpleMapNodeSchema<TCustomMetadata> {
13
+ export interface MapNodeCustomizableSchema<out TName extends string = string, in out T extends ImplicitAnnotatedAllowedTypes = ImplicitAnnotatedAllowedTypes, out ImplicitlyConstructable extends boolean = true, out TCustomMetadata = unknown> extends TreeNodeSchemaClass<TName, NodeKind.Map, TreeMapNode<UnannotateImplicitAllowedTypes<T>> & WithType<TName, NodeKind.Map, T>, MapNodeInsertableData<UnannotateImplicitAllowedTypes<T>>, ImplicitlyConstructable, T, undefined, TCustomMetadata>, SimpleMapNodeSchema<TCustomMetadata> {
14
14
  }
15
15
  /**
16
16
  * A schema for POJO emulation mode {@link (TreeMapNode:interface)}s.
17
17
  * @system @sealed @alpha
18
18
  */
19
- export interface MapNodePojoEmulationSchema<out TName extends string = string, in out T extends ImplicitAllowedTypes = ImplicitAllowedTypes, out ImplicitlyConstructable extends boolean = true, out TCustomMetadata = unknown> extends TreeNodeSchemaNonClass<TName, NodeKind.Map, TreeMapNode<T> & WithType<TName, NodeKind.Map, T>, MapNodeInsertableData<T>, ImplicitlyConstructable, T, undefined, TCustomMetadata>, SimpleMapNodeSchema<TCustomMetadata> {
19
+ export interface MapNodePojoEmulationSchema<out TName extends string = string, in out T extends ImplicitAnnotatedAllowedTypes = ImplicitAnnotatedAllowedTypes, out ImplicitlyConstructable extends boolean = true, out TCustomMetadata = unknown> extends TreeNodeSchemaNonClass<TName, NodeKind.Map, TreeMapNode<UnannotateImplicitAllowedTypes<T>> & WithType<TName, NodeKind.Map, T>, MapNodeInsertableData<UnannotateImplicitAllowedTypes<T>>, ImplicitlyConstructable, T, undefined, TCustomMetadata>, SimpleMapNodeSchema<TCustomMetadata> {
20
20
  }
21
21
  /**
22
22
  * A schema for {@link (TreeMapNode:interface)}s.
@@ -1 +1 @@
1
- {"version":3,"file":"mapNodeTypes.d.ts","sourceRoot":"","sources":["../../src/simple-tree/mapNodeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACN,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,EACb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,yBAAyB,CACzC,GAAG,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EACjC,EAAE,CAAC,GAAG,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,EAC5D,GAAG,CAAC,uBAAuB,SAAS,OAAO,GAAG,IAAI,EAClD,GAAG,CAAC,eAAe,GAAG,OAAO,CAC5B,SAAQ,mBAAmB,CAC1B,KAAK,EACL,QAAQ,CAAC,GAAG,EACZ,WAAW,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,EAAE,C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AC;CAAG;AAEzC;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,yBAAyB,GAAG,0BAA0B,CAAC;AAEnF;;GAEG;AACH,eAAO,MAAM,aAAa;IACzB;;OAEG;2CACyB,cAAc;CAGjC,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,IAAI,aAAa,CAE/E"}
@@ -1 +1 @@
1
- {"version":3,"file":"mapNodeTypes.js","sourceRoot":"","sources":["../../src/simple-tree/mapNodeTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,8CAMyB;AAwDzB;;GAEG;AACU,QAAA,aAAa,GAAG;IAC5B;;OAEG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAqB;QACzC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACQ,CAAC;AAEX;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,MAAsB;IACrD,OAAO,MAAM,CAAC,IAAI,KAAK,mBAAQ,CAAC,GAAG,CAAC;AACrC,CAAC;AAFD,0CAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { MapNodeInsertableData, TreeMapNode } from \"./mapNode.js\";\nimport type { ImplicitAllowedTypes } from \"./schemaTypes.js\";\nimport {\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaNonClass,\n\ttype WithType,\n} from \"./core/index.js\";\n\nimport type { SimpleMapNodeSchema } from \"./simpleSchema.js\";\n\n/**\n * A schema for customizable {@link (TreeMapNode:interface)}s.\n * @system @sealed @alpha\n */\nexport interface MapNodeCustomizableSchema<\n\tout TName extends string = string,\n\tin out T extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\tout ImplicitlyConstructable extends boolean = true,\n\tout TCustomMetadata = unknown,\n> extends TreeNodeSchemaClass<\n\t\t\tTName,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<T> & WithType<TName, NodeKind.Map, T>,\n\t\t\tMapNodeInsertableData<T>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleMapNodeSchema<TCustomMetadata> {}\n\n/**\n * A schema for POJO emulation mode {@link (TreeMapNode:interface)}s.\n * @system @sealed @alpha\n */\nexport interface MapNodePojoEmulationSchema<\n\tout TName extends string = string,\n\tin out T extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\tout ImplicitlyConstructable extends boolean = true,\n\tout TCustomMetadata = unknown,\n> extends TreeNodeSchemaNonClass<\n\t\t\tTName,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<T> & WithType<TName, NodeKind.Map, T>,\n\t\t\tMapNodeInsertableData<T>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleMapNodeSchema<TCustomMetadata> {}\n\n/**\n * A schema for {@link (TreeMapNode:interface)}s.\n * @privateRemarks\n * This could have generic arguments added and forwarded.\n * The expected use-cases for this don't need them however, and if they did want an argument it would probably be the allowed types;\n * perhaps if moving to an order independent way to pass generic arguments, adding support for them here would make sense.\n * @alpha\n */\nexport type MapNodeSchema = MapNodeCustomizableSchema | MapNodePojoEmulationSchema;\n\n/**\n * @alpha\n */\nexport const MapNodeSchema = {\n\t/**\n\t * instanceof-based narrowing support for MapNodeSchema in Javascript and TypeScript 5.3 or newer.\n\t */\n\t[Symbol.hasInstance](value: TreeNodeSchema): value is MapNodeSchema {\n\t\treturn isMapNodeSchema(value);\n\t},\n} as const;\n\n/**\n * Narrows a {@link (TreeNodeSchema:interface)} to an {@link (MapNodeSchema:interface)}.\n * @privateRemarks\n * If at some point we want to have internal only APIs for MapNodeSchema (like done for objects),\n * this can include those since its not the public facing API.\n */\nexport function isMapNodeSchema(schema: TreeNodeSchema): schema is MapNodeSchema {\n\treturn schema.kind === NodeKind.Map;\n}\n"]}
1
+ {"version":3,"file":"mapNodeTypes.js","sourceRoot":"","sources":["../../src/simple-tree/mapNodeTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,8CAMyB;AAwDzB;;GAEG;AACU,QAAA,aAAa,GAAG;IAC5B;;OAEG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAqB;QACzC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACQ,CAAC;AAEX;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,MAAsB;IACrD,OAAO,MAAM,CAAC,IAAI,KAAK,mBAAQ,CAAC,GAAG,CAAC;AACrC,CAAC;AAFD,0CAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { MapNodeInsertableData, TreeMapNode } from \"./mapNode.js\";\nimport type {\n\tImplicitAnnotatedAllowedTypes,\n\tUnannotateImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport {\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaNonClass,\n\ttype WithType,\n} from \"./core/index.js\";\n\nimport type { SimpleMapNodeSchema } from \"./simpleSchema.js\";\n\n/**\n * A schema for customizable {@link (TreeMapNode:interface)}s.\n * @system @sealed @alpha\n */\nexport interface MapNodeCustomizableSchema<\n\tout TName extends string = string,\n\tin out T extends ImplicitAnnotatedAllowedTypes = ImplicitAnnotatedAllowedTypes,\n\tout ImplicitlyConstructable extends boolean = true,\n\tout TCustomMetadata = unknown,\n> extends TreeNodeSchemaClass<\n\t\t\tTName,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<UnannotateImplicitAllowedTypes<T>> & WithType<TName, NodeKind.Map, T>,\n\t\t\tMapNodeInsertableData<UnannotateImplicitAllowedTypes<T>>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleMapNodeSchema<TCustomMetadata> {}\n\n/**\n * A schema for POJO emulation mode {@link (TreeMapNode:interface)}s.\n * @system @sealed @alpha\n */\nexport interface MapNodePojoEmulationSchema<\n\tout TName extends string = string,\n\tin out T extends ImplicitAnnotatedAllowedTypes = ImplicitAnnotatedAllowedTypes,\n\tout ImplicitlyConstructable extends boolean = true,\n\tout TCustomMetadata = unknown,\n> extends TreeNodeSchemaNonClass<\n\t\t\tTName,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<UnannotateImplicitAllowedTypes<T>> & WithType<TName, NodeKind.Map, T>,\n\t\t\tMapNodeInsertableData<UnannotateImplicitAllowedTypes<T>>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleMapNodeSchema<TCustomMetadata> {}\n\n/**\n * A schema for {@link (TreeMapNode:interface)}s.\n * @privateRemarks\n * This could have generic arguments added and forwarded.\n * The expected use-cases for this don't need them however, and if they did want an argument it would probably be the allowed types;\n * perhaps if moving to an order independent way to pass generic arguments, adding support for them here would make sense.\n * @alpha\n */\nexport type MapNodeSchema = MapNodeCustomizableSchema | MapNodePojoEmulationSchema;\n\n/**\n * @alpha\n */\nexport const MapNodeSchema = {\n\t/**\n\t * instanceof-based narrowing support for MapNodeSchema in Javascript and TypeScript 5.3 or newer.\n\t */\n\t[Symbol.hasInstance](value: TreeNodeSchema): value is MapNodeSchema {\n\t\treturn isMapNodeSchema(value);\n\t},\n} as const;\n\n/**\n * Narrows a {@link (TreeNodeSchema:interface)} to an {@link (MapNodeSchema:interface)}.\n * @privateRemarks\n * If at some point we want to have internal only APIs for MapNodeSchema (like done for objects),\n * this can include those since its not the public facing API.\n */\nexport function isMapNodeSchema(schema: TreeNodeSchema): schema is MapNodeSchema {\n\treturn schema.kind === NodeKind.Map;\n}\n"]}