@fgv/ts-res 4.5.0-2 → 5.0.0-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 (405) hide show
  1. package/CHANGELOG.json +26 -0
  2. package/CHANGELOG.md +14 -0
  3. package/CLAUDE.md +186 -0
  4. package/EXAMPLE_INIT_PARAMS.md +88 -0
  5. package/PROGRESS_SUMMARY.md +48 -0
  6. package/README.md +535 -14
  7. package/dist/ts-res.d.ts +4225 -324
  8. package/dist/tsdoc-metadata.json +1 -1
  9. package/lib/index.d.ts +4 -1
  10. package/lib/index.d.ts.map +1 -1
  11. package/lib/index.js +7 -1
  12. package/lib/index.js.map +1 -1
  13. package/lib/packlets/common/conditions.d.ts +30 -0
  14. package/lib/packlets/common/conditions.d.ts.map +1 -1
  15. package/lib/packlets/common/conditions.js.map +1 -1
  16. package/lib/packlets/common/convert.d.ts +22 -2
  17. package/lib/packlets/common/convert.d.ts.map +1 -1
  18. package/lib/packlets/common/convert.js +21 -1
  19. package/lib/packlets/common/convert.js.map +1 -1
  20. package/lib/packlets/common/helpers/context.d.ts +39 -0
  21. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  22. package/lib/packlets/common/helpers/context.js +108 -0
  23. package/lib/packlets/common/helpers/context.js.map +1 -0
  24. package/lib/packlets/common/helpers/index.d.ts +2 -0
  25. package/lib/packlets/common/helpers/index.d.ts.map +1 -1
  26. package/lib/packlets/common/helpers/index.js +2 -0
  27. package/lib/packlets/common/helpers/index.js.map +1 -1
  28. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts +39 -0
  29. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  30. package/lib/packlets/common/helpers/qualifierDefaultValues.js +105 -0
  31. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  32. package/lib/packlets/common/helpers/resources.d.ts.map +1 -1
  33. package/lib/packlets/common/helpers/resources.js +6 -2
  34. package/lib/packlets/common/helpers/resources.js.map +1 -1
  35. package/lib/packlets/common/validate/conditions.d.ts +69 -1
  36. package/lib/packlets/common/validate/conditions.d.ts.map +1 -1
  37. package/lib/packlets/common/validate/conditions.js +126 -0
  38. package/lib/packlets/common/validate/conditions.js.map +1 -1
  39. package/lib/packlets/common/validate/regularExpressions.d.ts +20 -0
  40. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -1
  41. package/lib/packlets/common/validate/regularExpressions.js +21 -1
  42. package/lib/packlets/common/validate/regularExpressions.js.map +1 -1
  43. package/lib/packlets/conditions/condition.d.ts +37 -0
  44. package/lib/packlets/conditions/condition.d.ts.map +1 -1
  45. package/lib/packlets/conditions/condition.js +67 -1
  46. package/lib/packlets/conditions/condition.js.map +1 -1
  47. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -1
  48. package/lib/packlets/conditions/conditionCollector.js +1 -0
  49. package/lib/packlets/conditions/conditionCollector.js.map +1 -1
  50. package/lib/packlets/conditions/conditionSet.d.ts +34 -3
  51. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -1
  52. package/lib/packlets/conditions/conditionSet.js +31 -3
  53. package/lib/packlets/conditions/conditionSet.js.map +1 -1
  54. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -1
  55. package/lib/packlets/conditions/conditionSetCollector.js +3 -0
  56. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -1
  57. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -1
  58. package/lib/packlets/conditions/conditionToken.js +2 -1
  59. package/lib/packlets/conditions/conditionToken.js.map +1 -1
  60. package/lib/packlets/conditions/convert/decls.js +1 -1
  61. package/lib/packlets/conditions/convert/decls.js.map +1 -1
  62. package/lib/packlets/config/common.d.ts +35 -0
  63. package/lib/packlets/config/common.d.ts.map +1 -0
  64. package/lib/packlets/config/common.js +96 -0
  65. package/lib/packlets/config/common.js.map +1 -0
  66. package/lib/packlets/config/convert.d.ts +14 -0
  67. package/lib/packlets/config/convert.d.ts.map +1 -0
  68. package/lib/packlets/config/convert.js +82 -0
  69. package/lib/packlets/config/convert.js.map +1 -0
  70. package/lib/packlets/config/index.d.ts +6 -0
  71. package/lib/packlets/config/index.d.ts.map +1 -0
  72. package/lib/packlets/config/index.js +67 -0
  73. package/lib/packlets/config/index.js.map +1 -0
  74. package/lib/packlets/config/json.d.ts +20 -0
  75. package/lib/packlets/config/json.d.ts.map +1 -0
  76. package/lib/packlets/config/json.js +24 -0
  77. package/lib/packlets/config/json.js.map +1 -0
  78. package/lib/packlets/config/predefined/default.d.ts +57 -0
  79. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  80. package/lib/packlets/config/predefined/default.js +141 -0
  81. package/lib/packlets/config/predefined/default.js.map +1 -0
  82. package/lib/packlets/config/predefined/extended.d.ts +25 -0
  83. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  84. package/lib/packlets/config/predefined/extended.js +193 -0
  85. package/lib/packlets/config/predefined/extended.js.map +1 -0
  86. package/lib/packlets/config/predefined/index.d.ts +4 -0
  87. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  88. package/lib/packlets/config/predefined/index.js +62 -0
  89. package/lib/packlets/config/predefined/index.js.map +1 -0
  90. package/lib/packlets/config/systemConfiguration.d.ts +81 -0
  91. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  92. package/lib/packlets/config/systemConfiguration.js +172 -0
  93. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  94. package/lib/packlets/context/contextDecls.d.ts +49 -0
  95. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  96. package/lib/packlets/context/contextDecls.js +24 -0
  97. package/lib/packlets/context/contextDecls.js.map +1 -0
  98. package/lib/packlets/context/contextToken.d.ts +111 -0
  99. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  100. package/lib/packlets/context/contextToken.js +206 -0
  101. package/lib/packlets/context/contextToken.js.map +1 -0
  102. package/lib/packlets/context/convert/decls.d.ts +37 -0
  103. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  104. package/lib/packlets/context/convert/decls.js +94 -0
  105. package/lib/packlets/context/convert/decls.js.map +1 -0
  106. package/lib/packlets/context/convert/index.d.ts +2 -0
  107. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  108. package/lib/packlets/context/convert/index.js +39 -0
  109. package/lib/packlets/context/convert/index.js.map +1 -0
  110. package/lib/packlets/context/index.d.ts +5 -0
  111. package/lib/packlets/context/index.d.ts.map +1 -0
  112. package/lib/packlets/context/index.js +65 -0
  113. package/lib/packlets/context/index.js.map +1 -0
  114. package/lib/packlets/decisions/abstractDecision.d.ts +8 -0
  115. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -1
  116. package/lib/packlets/decisions/abstractDecision.js +9 -0
  117. package/lib/packlets/decisions/abstractDecision.js.map +1 -1
  118. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -1
  119. package/lib/packlets/decisions/abstractDecisionCollector.js +2 -0
  120. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -1
  121. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -1
  122. package/lib/packlets/decisions/concreteDecision.js +3 -2
  123. package/lib/packlets/decisions/concreteDecision.js.map +1 -1
  124. package/lib/packlets/decisions/decision.d.ts.map +1 -1
  125. package/lib/packlets/decisions/decision.js +4 -0
  126. package/lib/packlets/decisions/decision.js.map +1 -1
  127. package/lib/packlets/import/fsItem.d.ts.map +1 -1
  128. package/lib/packlets/import/fsItem.js +1 -0
  129. package/lib/packlets/import/fsItem.js.map +1 -1
  130. package/lib/packlets/import/importContext.d.ts +19 -0
  131. package/lib/packlets/import/importContext.d.ts.map +1 -1
  132. package/lib/packlets/import/importContext.js +39 -0
  133. package/lib/packlets/import/importContext.js.map +1 -1
  134. package/lib/packlets/import/importManager.d.ts +5 -5
  135. package/lib/packlets/import/importManager.d.ts.map +1 -1
  136. package/lib/packlets/import/importManager.js.map +1 -1
  137. package/lib/packlets/import/importers/collectionImporter.d.ts +11 -13
  138. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -1
  139. package/lib/packlets/import/importers/collectionImporter.js +29 -20
  140. package/lib/packlets/import/importers/collectionImporter.js.map +1 -1
  141. package/lib/packlets/import/importers/fsItemImporter.d.ts +2 -2
  142. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -1
  143. package/lib/packlets/import/importers/fsItemImporter.js +2 -2
  144. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -1
  145. package/lib/packlets/import/importers/importer.d.ts +3 -3
  146. package/lib/packlets/import/importers/importer.d.ts.map +1 -1
  147. package/lib/packlets/import/importers/importer.js.map +1 -1
  148. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -3
  149. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -1
  150. package/lib/packlets/import/importers/jsonImporter.js +10 -20
  151. package/lib/packlets/import/importers/jsonImporter.js.map +1 -1
  152. package/lib/packlets/import/importers/pathImporter.d.ts +2 -2
  153. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -1
  154. package/lib/packlets/import/importers/pathImporter.js.map +1 -1
  155. package/lib/packlets/qualifier-types/config/convert.d.ts +44 -0
  156. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  157. package/lib/packlets/qualifier-types/config/convert.js +96 -0
  158. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  159. package/lib/packlets/qualifier-types/config/index.d.ts +4 -0
  160. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  161. package/lib/packlets/qualifier-types/config/index.js +64 -0
  162. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  163. package/lib/packlets/qualifier-types/config/json.d.ts +69 -0
  164. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  165. package/lib/packlets/qualifier-types/config/json.js +24 -0
  166. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  167. package/lib/packlets/qualifier-types/convert.d.ts +10 -2
  168. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -1
  169. package/lib/packlets/qualifier-types/convert.js +15 -0
  170. package/lib/packlets/qualifier-types/convert.js.map +1 -1
  171. package/lib/packlets/qualifier-types/helpers.d.ts +27 -0
  172. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  173. package/lib/packlets/qualifier-types/helpers.js +118 -0
  174. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  175. package/lib/packlets/qualifier-types/index.d.ts +4 -1
  176. package/lib/packlets/qualifier-types/index.d.ts.map +1 -1
  177. package/lib/packlets/qualifier-types/index.js +5 -1
  178. package/lib/packlets/qualifier-types/index.js.map +1 -1
  179. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +19 -8
  180. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -1
  181. package/lib/packlets/qualifier-types/languageQualifierType.js +28 -9
  182. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -1
  183. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +38 -13
  184. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -1
  185. package/lib/packlets/qualifier-types/literalQualifierType.js +44 -10
  186. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -1
  187. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +107 -0
  188. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  189. package/lib/packlets/qualifier-types/literalValueHierarchy.js +215 -0
  190. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  191. package/lib/packlets/qualifier-types/qualifierType.d.ts +22 -18
  192. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -1
  193. package/lib/packlets/qualifier-types/qualifierType.js +9 -4
  194. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -1
  195. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts +4 -2
  196. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -1
  197. package/lib/packlets/qualifier-types/qualifierTypeCollector.js +2 -1
  198. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -1
  199. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +47 -11
  200. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -1
  201. package/lib/packlets/qualifier-types/territoryQualifierType.js +61 -17
  202. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -1
  203. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -1
  204. package/lib/packlets/qualifiers/convert/decls.js +17 -15
  205. package/lib/packlets/qualifiers/convert/decls.js.map +1 -1
  206. package/lib/packlets/qualifiers/index.d.ts +2 -0
  207. package/lib/packlets/qualifiers/index.d.ts.map +1 -1
  208. package/lib/packlets/qualifiers/index.js +2 -0
  209. package/lib/packlets/qualifiers/index.js.map +1 -1
  210. package/lib/packlets/qualifiers/qualifier.d.ts +22 -2
  211. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -1
  212. package/lib/packlets/qualifiers/qualifier.js +26 -1
  213. package/lib/packlets/qualifiers/qualifier.js.map +1 -1
  214. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -1
  215. package/lib/packlets/qualifiers/qualifierCollector.js +4 -0
  216. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -1
  217. package/lib/packlets/qualifiers/qualifierDecl.d.ts +6 -1
  218. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -1
  219. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -1
  220. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts +32 -0
  221. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  222. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js +24 -0
  223. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  224. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts +96 -0
  225. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  226. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js +179 -0
  227. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  228. package/lib/packlets/resource-json/compiled/common.d.ts +14 -0
  229. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  230. package/lib/packlets/resource-json/compiled/common.js +24 -0
  231. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  232. package/lib/packlets/resource-json/compiled/convert.d.ts +63 -0
  233. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  234. package/lib/packlets/resource-json/compiled/convert.js +167 -0
  235. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  236. package/lib/packlets/resource-json/compiled/index.d.ts +5 -0
  237. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  238. package/lib/packlets/resource-json/compiled/index.js +65 -0
  239. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  240. package/lib/packlets/resource-json/compiled/json.d.ts +204 -0
  241. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  242. package/lib/packlets/resource-json/compiled/json.js +3 -0
  243. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  244. package/lib/packlets/resource-json/convert.d.ts +16 -0
  245. package/lib/packlets/resource-json/convert.d.ts.map +1 -1
  246. package/lib/packlets/resource-json/convert.js +41 -6
  247. package/lib/packlets/resource-json/convert.js.map +1 -1
  248. package/lib/packlets/resource-json/helpers.d.ts +82 -3
  249. package/lib/packlets/resource-json/helpers.d.ts.map +1 -1
  250. package/lib/packlets/resource-json/helpers.js +185 -2
  251. package/lib/packlets/resource-json/helpers.js.map +1 -1
  252. package/lib/packlets/resource-json/index.d.ts +2 -1
  253. package/lib/packlets/resource-json/index.d.ts.map +1 -1
  254. package/lib/packlets/resource-json/index.js +3 -1
  255. package/lib/packlets/resource-json/index.js.map +1 -1
  256. package/lib/packlets/resource-json/json.d.ts +55 -3
  257. package/lib/packlets/resource-json/json.d.ts.map +1 -1
  258. package/lib/packlets/resource-json/json.js +16 -0
  259. package/lib/packlets/resource-json/json.js.map +1 -1
  260. package/lib/packlets/resource-json/normalized.d.ts +46 -3
  261. package/lib/packlets/resource-json/normalized.d.ts.map +1 -1
  262. package/lib/packlets/resource-json/normalized.js.map +1 -1
  263. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +14 -10
  264. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -1
  265. package/lib/packlets/resource-json/resourceDeclCollection.js +18 -14
  266. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -1
  267. package/lib/packlets/resource-json/resourceDeclContainer.d.ts +15 -2
  268. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -1
  269. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -1
  270. package/lib/packlets/resource-json/resourceDeclTree.d.ts +6 -2
  271. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -1
  272. package/lib/packlets/resource-json/resourceDeclTree.js +12 -3
  273. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -1
  274. package/lib/packlets/resource-types/config/convert.d.ts +8 -0
  275. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  276. package/lib/packlets/resource-types/config/convert.js +36 -0
  277. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  278. package/lib/packlets/resource-types/config/index.d.ts +4 -0
  279. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  280. package/lib/packlets/resource-types/config/index.js +64 -0
  281. package/lib/packlets/resource-types/config/index.js.map +1 -0
  282. package/lib/packlets/resource-types/config/json.d.ts +9 -0
  283. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  284. package/lib/packlets/resource-types/config/json.js +24 -0
  285. package/lib/packlets/resource-types/config/json.js.map +1 -0
  286. package/lib/packlets/resource-types/helpers.d.ts +13 -0
  287. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  288. package/lib/packlets/resource-types/helpers.js +44 -0
  289. package/lib/packlets/resource-types/helpers.js.map +1 -0
  290. package/lib/packlets/resource-types/index.d.ts +3 -0
  291. package/lib/packlets/resource-types/index.d.ts.map +1 -1
  292. package/lib/packlets/resource-types/index.js +26 -0
  293. package/lib/packlets/resource-types/index.js.map +1 -1
  294. package/lib/packlets/resource-types/jsonResourceType.d.ts +5 -13
  295. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -1
  296. package/lib/packlets/resource-types/jsonResourceType.js +5 -2
  297. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -1
  298. package/lib/packlets/resource-types/resourceType.d.ts +33 -32
  299. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -1
  300. package/lib/packlets/resource-types/resourceType.js.map +1 -1
  301. package/lib/packlets/resources/candidateReducer.d.ts +98 -0
  302. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  303. package/lib/packlets/resources/candidateReducer.js +247 -0
  304. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  305. package/lib/packlets/resources/common.d.ts +60 -0
  306. package/lib/packlets/resources/common.d.ts.map +1 -0
  307. package/lib/packlets/resources/common.js +24 -0
  308. package/lib/packlets/resources/common.js.map +1 -0
  309. package/lib/packlets/resources/index.d.ts +3 -1
  310. package/lib/packlets/resources/index.d.ts.map +1 -1
  311. package/lib/packlets/resources/index.js +3 -1
  312. package/lib/packlets/resources/index.js.map +1 -1
  313. package/lib/packlets/resources/resource.d.ts +57 -5
  314. package/lib/packlets/resources/resource.d.ts.map +1 -1
  315. package/lib/packlets/resources/resource.js +96 -6
  316. package/lib/packlets/resources/resource.js.map +1 -1
  317. package/lib/packlets/resources/resourceBuilder.d.ts +14 -0
  318. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -1
  319. package/lib/packlets/resources/resourceBuilder.js +19 -1
  320. package/lib/packlets/resources/resourceBuilder.js.map +1 -1
  321. package/lib/packlets/resources/resourceCandidate.d.ts +42 -6
  322. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -1
  323. package/lib/packlets/resources/resourceCandidate.js +40 -1
  324. package/lib/packlets/resources/resourceCandidate.js.map +1 -1
  325. package/lib/packlets/resources/resourceManagerBuilder.d.ts +220 -0
  326. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  327. package/lib/packlets/resources/resourceManagerBuilder.js +451 -0
  328. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  329. package/lib/packlets/runtime/cacheListener.d.ts +62 -0
  330. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  331. package/lib/packlets/runtime/cacheListener.js +56 -0
  332. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  333. package/lib/packlets/runtime/cacheMetrics.d.ts +82 -0
  334. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  335. package/lib/packlets/runtime/cacheMetrics.js +143 -0
  336. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  337. package/lib/packlets/runtime/compiledResourceCollection.d.ts +167 -0
  338. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  339. package/lib/packlets/runtime/compiledResourceCollection.js +466 -0
  340. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  341. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts +70 -0
  342. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  343. package/lib/packlets/runtime/conditionSetResolutionResult.js +135 -0
  344. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  345. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +80 -0
  346. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  347. package/lib/packlets/runtime/context/contextQualifierProvider.js +33 -0
  348. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  349. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +165 -0
  350. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  351. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +179 -0
  352. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  353. package/lib/packlets/runtime/context/index.d.ts +5 -0
  354. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  355. package/lib/packlets/runtime/context/index.js +42 -0
  356. package/lib/packlets/runtime/context/index.js.map +1 -0
  357. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +111 -0
  358. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  359. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +177 -0
  360. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  361. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +47 -0
  362. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  363. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +64 -0
  364. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  365. package/lib/packlets/runtime/iResourceManager.d.ts +88 -0
  366. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  367. package/lib/packlets/runtime/iResourceManager.js +24 -0
  368. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  369. package/lib/packlets/runtime/index.d.ts +12 -0
  370. package/lib/packlets/runtime/index.d.ts.map +1 -0
  371. package/lib/packlets/runtime/index.js +73 -0
  372. package/lib/packlets/runtime/index.js.map +1 -0
  373. package/lib/packlets/runtime/resource-tree/common.d.ts +91 -0
  374. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  375. package/lib/packlets/runtime/resource-tree/common.js +24 -0
  376. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  377. package/lib/packlets/runtime/resource-tree/index.d.ts +5 -0
  378. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  379. package/lib/packlets/runtime/resource-tree/index.js +42 -0
  380. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  381. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts +141 -0
  382. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  383. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js +224 -0
  384. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  385. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts +24 -0
  386. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  387. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js +98 -0
  388. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  389. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +99 -0
  390. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  391. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +165 -0
  392. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  393. package/lib/packlets/runtime/resourceResolver.d.ts +196 -0
  394. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  395. package/lib/packlets/runtime/resourceResolver.js +437 -0
  396. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  397. package/lib/packlets/runtime/validate.d.ts +13 -0
  398. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  399. package/lib/packlets/runtime/validate.js +49 -0
  400. package/lib/packlets/runtime/validate.js.map +1 -0
  401. package/package.json +76 -75
  402. package/lib/packlets/resources/resourceManager.d.ts +0 -104
  403. package/lib/packlets/resources/resourceManager.d.ts.map +0 -1
  404. package/lib/packlets/resources/resourceManager.js +0 -201
  405. package/lib/packlets/resources/resourceManager.js.map +0 -1
@@ -11,10 +11,14 @@ export declare class ResourceDeclCollection implements IResourceDeclContainer {
11
11
  * The {@link ResourceJson.Normalized.IResourceCollectionDecl | resource collection declaration}
12
12
  * being processed.
13
13
  */
14
- readonly collection: Normalized.IResourceCollectionDecl;
15
- protected _resources: Normalized.ILooseResourceDecl[];
16
- protected _candidates: Normalized.ILooseResourceCandidateDecl[];
17
- protected constructor(collection: Normalized.IResourceCollectionDecl);
14
+ readonly collection: Normalized.IImporterResourceCollectionDecl;
15
+ /**
16
+ * {@inheritdoc ResourceJson.IResourceDeclContainer.context}
17
+ */
18
+ get context(): Normalized.IContainerContextDecl | undefined;
19
+ protected _resources: Normalized.IImporterResourceDecl[];
20
+ protected _candidates: Normalized.IImporterResourceCandidateDecl[];
21
+ protected constructor(collection: Normalized.IImporterResourceCollectionDecl);
18
22
  /**
19
23
  * Creates a new {@link ResourceJson.ResourceDeclCollection | ResourceDeclCollection} from an
20
24
  * untyped {@link ResourceJson.Json.IResourceCollectionDecl | resource collection declaration}.
@@ -23,17 +27,17 @@ export declare class ResourceDeclCollection implements IResourceDeclContainer {
23
27
  */
24
28
  static create(from: unknown): Result<ResourceDeclCollection>;
25
29
  /**
26
- * Gets the loose resources extracted from the collection.
27
- * @returns The {@link ResourceJson.Normalized.ILooseResourceDecl | loose resource declarations}
30
+ * Gets the importer resources extracted from the collection.
31
+ * @returns The {@link ResourceJson.Normalized.IImporterResourceDecl | importer resource declarations}
28
32
  * extracted from the collection.
29
33
  */
30
- getLooseResources(): ReadonlyArray<Normalized.ILooseResourceDecl>;
34
+ getImporterResources(): ReadonlyArray<Normalized.IImporterResourceDecl>;
31
35
  /**
32
- * Gets the loose candidates extracted from the collection.
33
- * @returns The {@link ResourceJson.Normalized.ILooseResourceCandidateDecl | loose resource candidate declarations}
36
+ * Gets the importer candidates extracted from the collection.
37
+ * @returns The {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declarations}
34
38
  * extracted from the collection.
35
39
  */
36
- getLooseCandidates(): ReadonlyArray<Normalized.ILooseResourceCandidateDecl>;
40
+ getImporterCandidates(): ReadonlyArray<Normalized.IImporterResourceCandidateDecl>;
37
41
  private _extract;
38
42
  }
39
43
  //# sourceMappingURL=resourceDeclCollection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resourceDeclCollection.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclCollection.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAgD,MAAM,EAAW,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAK3C;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,sBAAsB;IACnE;;;OAGG;IACH,SAAgB,UAAU,EAAE,UAAU,CAAC,uBAAuB,CAAC;IAE/D,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,kBAAkB,EAAE,CAAM;IAC3D,SAAS,CAAC,WAAW,EAAE,UAAU,CAAC,2BAA2B,EAAE,CAAM;IAErE,SAAS,aAAa,UAAU,EAAE,UAAU,CAAC,uBAAuB;IAKpE;;;;;OAKG;WACW,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,sBAAsB,CAAC;IASnE;;;;OAIG;IACI,iBAAiB,IAAI,aAAa,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAIxE;;;;OAIG;IACI,kBAAkB,IAAI,aAAa,CAAC,UAAU,CAAC,2BAA2B,CAAC;IAIlF,OAAO,CAAC,QAAQ;CAwBjB"}
1
+ {"version":3,"file":"resourceDeclCollection.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclCollection.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAgD,MAAM,EAAW,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAI3C;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,sBAAsB;IACnE;;;OAGG;IACH,SAAgB,UAAU,EAAE,UAAU,CAAC,+BAA+B,CAAC;IAEvE;;OAEG;IACH,IAAW,OAAO,IAAI,UAAU,CAAC,qBAAqB,GAAG,SAAS,CAEjE;IAED,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,qBAAqB,EAAE,CAAM;IAC9D,SAAS,CAAC,WAAW,EAAE,UAAU,CAAC,8BAA8B,EAAE,CAAM;IAExE,SAAS,aAAa,UAAU,EAAE,UAAU,CAAC,+BAA+B;IAK5E;;;;;OAKG;WACW,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,sBAAsB,CAAC;IASnE;;;;OAIG;IACI,oBAAoB,IAAI,aAAa,CAAC,UAAU,CAAC,qBAAqB,CAAC;IAI9E;;;;OAIG;IACI,qBAAqB,IAAI,aAAa,CAAC,UAAU,CAAC,8BAA8B,CAAC;IAIxF,OAAO,CAAC,QAAQ;CA2BjB"}
@@ -57,7 +57,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
57
57
  exports.ResourceDeclCollection = void 0;
58
58
  const ts_utils_1 = require("@fgv/ts-utils");
59
59
  const Convert = __importStar(require("./convert"));
60
- const common_1 = require("../common");
61
60
  const helpers_1 = require("./helpers");
62
61
  /**
63
62
  * Class that extracts resources and candidates from a
@@ -65,6 +64,12 @@ const helpers_1 = require("./helpers");
65
64
  * @public
66
65
  */
67
66
  class ResourceDeclCollection {
67
+ /**
68
+ * {@inheritdoc ResourceJson.IResourceDeclContainer.context}
69
+ */
70
+ get context() {
71
+ return this.collection.context;
72
+ }
68
73
  constructor(collection) {
69
74
  this._resources = [];
70
75
  this._candidates = [];
@@ -78,7 +83,7 @@ class ResourceDeclCollection {
78
83
  * @returns `Success` with the new collection if the JSON object is valid, otherwise `Failure`.
79
84
  */
80
85
  static create(from) {
81
- return Convert.resourceCollectionDecl
86
+ return Convert.importerResourceCollectionDecl
82
87
  .convert(from)
83
88
  .withErrorFormat((err) => `Invalid resource collection: ${err}`)
84
89
  .onSuccess((decl) => {
@@ -86,31 +91,30 @@ class ResourceDeclCollection {
86
91
  });
87
92
  }
88
93
  /**
89
- * Gets the loose resources extracted from the collection.
90
- * @returns The {@link ResourceJson.Normalized.ILooseResourceDecl | loose resource declarations}
94
+ * Gets the importer resources extracted from the collection.
95
+ * @returns The {@link ResourceJson.Normalized.IImporterResourceDecl | importer resource declarations}
91
96
  * extracted from the collection.
92
97
  */
93
- getLooseResources() {
98
+ getImporterResources() {
94
99
  return this._resources;
95
100
  }
96
101
  /**
97
- * Gets the loose candidates extracted from the collection.
98
- * @returns The {@link ResourceJson.Normalized.ILooseResourceCandidateDecl | loose resource candidate declarations}
102
+ * Gets the importer candidates extracted from the collection.
103
+ * @returns The {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declarations}
99
104
  * extracted from the collection.
100
105
  */
101
- getLooseCandidates() {
106
+ getImporterCandidates() {
102
107
  return this._candidates;
103
108
  }
104
109
  _extract(collection, parentName, parentConditions) {
105
110
  const errors = new ts_utils_1.MessageAggregator();
106
- return common_1.Helpers.joinOptionalResourceIds(parentName, collection.baseName).onSuccess((baseName) => {
107
- var _a, _b, _c, _d, _e, _f;
108
- const baseConditions = [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), ...((_a = collection.baseConditions) !== null && _a !== void 0 ? _a : [])];
109
- const mergedCandidates = (_c = (_b = collection.candidates) === null || _b === void 0 ? void 0 : _b.map((candidate) => (0, helpers_1.mergeLooseCandidate)(candidate, baseName, baseConditions))) !== null && _c !== void 0 ? _c : [];
111
+ return (0, helpers_1.mergeContextDecl)(collection.context, parentName, parentConditions).onSuccess(({ baseId: baseName, conditions: baseConditions }) => {
112
+ var _a, _b, _c, _d, _e;
113
+ const mergedCandidates = (_b = (_a = collection.candidates) === null || _a === void 0 ? void 0 : _a.map((candidate) => (0, helpers_1.mergeImporterCandidate)(candidate, baseName, baseConditions))) !== null && _b !== void 0 ? _b : [];
110
114
  this._candidates.push(...(0, ts_utils_1.mapResults)(mergedCandidates).aggregateError(errors).orDefault([]));
111
- const mergedResources = (_e = (_d = collection.resources) === null || _d === void 0 ? void 0 : _d.map((resource) => (0, helpers_1.mergeLooseResource)(resource, baseName, baseConditions))) !== null && _e !== void 0 ? _e : [];
115
+ const mergedResources = (_d = (_c = collection.resources) === null || _c === void 0 ? void 0 : _c.map((resource) => (0, helpers_1.mergeImporterResource)(resource, baseName, baseConditions))) !== null && _d !== void 0 ? _d : [];
112
116
  this._resources.push(...(0, ts_utils_1.mapResults)(mergedResources).aggregateError(errors).orDefault([]));
113
- (_f = collection.collections) === null || _f === void 0 ? void 0 : _f.forEach((subCollection) => {
117
+ (_e = collection.collections) === null || _e === void 0 ? void 0 : _e.forEach((subCollection) => {
114
118
  this._extract(subCollection, baseName, baseConditions).aggregateError(errors);
115
119
  });
116
120
  return errors.returnOrReport((0, ts_utils_1.succeed)(this));
@@ -1 +1 @@
1
- {"version":3,"file":"resourceDeclCollection.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclCollection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA8F;AAE9F,mDAAqC;AAGrC,sCAAqD;AACrD,uCAAoE;AAEpE;;;;GAIG;AACH,MAAa,sBAAsB;IAUjC,YAAsB,UAA8C;QAH1D,eAAU,GAAoC,EAAE,CAAC;QACjD,gBAAW,GAA6C,EAAE,CAAC;QAGnE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,IAAa;QAChC,OAAO,OAAO,CAAC,sBAAsB;aAClC,OAAO,CAAC,IAAI,CAAC;aACb,eAAe,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,gCAAgC,GAAG,EAAE,CAAC;aAC/D,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YAClB,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACI,iBAA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AU,CAAC,WAAW,0CAAE,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;gBAChD,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAChF,CAAC,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxED,wDAwEC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, mapResults, MessageAggregator, Result, succeed } from '@fgv/ts-utils';\nimport { IResourceDeclContainer } from './resourceDeclContainer';\nimport * as Convert from './convert';\nimport * as Normalized from './normalized';\nimport * as Json from './json';\nimport { Helpers as CommonHelpers } from '../common';\nimport { mergeLooseCandidate, mergeLooseResource } from './helpers';\n\n/**\n * Class that extracts resources and candidates from a\n * {@link ResourceJson.Json.IResourceCollectionDecl | resource collection declaration}.\n * @public\n */\nexport class ResourceDeclCollection implements IResourceDeclContainer {\n /**\n * The {@link ResourceJson.Normalized.IResourceCollectionDecl | resource collection declaration}\n * being processed.\n */\n public readonly collection: Normalized.IResourceCollectionDecl;\n\n protected _resources: Normalized.ILooseResourceDecl[] = [];\n protected _candidates: Normalized.ILooseResourceCandidateDecl[] = [];\n\n protected constructor(collection: Normalized.IResourceCollectionDecl) {\n this.collection = collection;\n this._extract(collection).orThrow();\n }\n\n /**\n * Creates a new {@link ResourceJson.ResourceDeclCollection | ResourceDeclCollection} from an\n * untyped {@link ResourceJson.Json.IResourceCollectionDecl | resource collection declaration}.\n * @param from - The JSON object to convert.\n * @returns `Success` with the new collection if the JSON object is valid, otherwise `Failure`.\n */\n public static create(from: unknown): Result<ResourceDeclCollection> {\n return Convert.resourceCollectionDecl\n .convert(from)\n .withErrorFormat((err) => `Invalid resource collection: ${err}`)\n .onSuccess((decl) => {\n return captureResult(() => new ResourceDeclCollection(decl));\n });\n }\n\n /**\n * Gets the loose resources extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.ILooseResourceDecl | loose resource declarations}\n * extracted from the collection.\n */\n public getLooseResources(): ReadonlyArray<Normalized.ILooseResourceDecl> {\n return this._resources;\n }\n\n /**\n * Gets the loose candidates extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.ILooseResourceCandidateDecl | loose resource candidate declarations}\n * extracted from the collection.\n */\n public getLooseCandidates(): ReadonlyArray<Normalized.ILooseResourceCandidateDecl> {\n return this._candidates;\n }\n\n private _extract(\n collection: Normalized.IResourceCollectionDecl,\n parentName?: string,\n parentConditions?: Json.ILooseConditionDecl[]\n ): Result<this> {\n const errors: MessageAggregator = new MessageAggregator();\n return CommonHelpers.joinOptionalResourceIds(parentName, collection.baseName).onSuccess((baseName) => {\n const baseConditions = [...(parentConditions ?? []), ...(collection.baseConditions ?? [])];\n\n const mergedCandidates =\n collection.candidates?.map((candidate) => mergeLooseCandidate(candidate, baseName, baseConditions)) ??\n [];\n this._candidates.push(...mapResults(mergedCandidates).aggregateError(errors).orDefault([]));\n\n const mergedResources =\n collection.resources?.map((resource) => mergeLooseResource(resource, baseName, baseConditions)) ?? [];\n this._resources.push(...mapResults(mergedResources).aggregateError(errors).orDefault([]));\n\n collection.collections?.forEach((subCollection) => {\n this._extract(subCollection, baseName, baseConditions).aggregateError(errors);\n });\n return errors.returnOrReport(succeed(this));\n });\n }\n}\n"]}
1
+ {"version":3,"file":"resourceDeclCollection.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclCollection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA8F;AAE9F,mDAAqC;AAGrC,uCAA4F;AAE5F;;;;GAIG;AACH,MAAa,sBAAsB;IAOjC;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IACjC,CAAC;IAKD,YAAsB,UAAsD;QAHlE,eAAU,GAAuC,EAAE,CAAC;QACpD,gBAAW,GAAgD,EAAE,CAAC;QAGtE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,IAAa;QAChC,OAAO,OAAO,CAAC,8BAA8B;aAC1C,OAAO,CAAC,IAAI,CAAC;aACb,eAAe,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,gCAAgC,GAAG,EAAE,CAAC;aAC/D,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YAClB,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG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,EAAE,cAAc,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAChF,CAAC,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAlFD,wDAkFC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, mapResults, MessageAggregator, Result, succeed } from '@fgv/ts-utils';\nimport { IResourceDeclContainer } from './resourceDeclContainer';\nimport * as Convert from './convert';\nimport * as Normalized from './normalized';\nimport * as Json from './json';\nimport { mergeContextDecl, mergeImporterCandidate, mergeImporterResource } from './helpers';\n\n/**\n * Class that extracts resources and candidates from a\n * {@link ResourceJson.Json.IResourceCollectionDecl | resource collection declaration}.\n * @public\n */\nexport class ResourceDeclCollection implements IResourceDeclContainer {\n /**\n * The {@link ResourceJson.Normalized.IResourceCollectionDecl | resource collection declaration}\n * being processed.\n */\n public readonly collection: Normalized.IImporterResourceCollectionDecl;\n\n /**\n * {@inheritdoc ResourceJson.IResourceDeclContainer.context}\n */\n public get context(): Normalized.IContainerContextDecl | undefined {\n return this.collection.context;\n }\n\n protected _resources: Normalized.IImporterResourceDecl[] = [];\n protected _candidates: Normalized.IImporterResourceCandidateDecl[] = [];\n\n protected constructor(collection: Normalized.IImporterResourceCollectionDecl) {\n this.collection = collection;\n this._extract(collection).orThrow();\n }\n\n /**\n * Creates a new {@link ResourceJson.ResourceDeclCollection | ResourceDeclCollection} from an\n * untyped {@link ResourceJson.Json.IResourceCollectionDecl | resource collection declaration}.\n * @param from - The JSON object to convert.\n * @returns `Success` with the new collection if the JSON object is valid, otherwise `Failure`.\n */\n public static create(from: unknown): Result<ResourceDeclCollection> {\n return Convert.importerResourceCollectionDecl\n .convert(from)\n .withErrorFormat((err) => `Invalid resource collection: ${err}`)\n .onSuccess((decl) => {\n return captureResult(() => new ResourceDeclCollection(decl));\n });\n }\n\n /**\n * Gets the importer resources extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.IImporterResourceDecl | importer resource declarations}\n * extracted from the collection.\n */\n public getImporterResources(): ReadonlyArray<Normalized.IImporterResourceDecl> {\n return this._resources;\n }\n\n /**\n * Gets the importer candidates extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declarations}\n * extracted from the collection.\n */\n public getImporterCandidates(): ReadonlyArray<Normalized.IImporterResourceCandidateDecl> {\n return this._candidates;\n }\n\n private _extract(\n collection: Normalized.IImporterResourceCollectionDecl,\n parentName?: string,\n parentConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n ): Result<this> {\n const errors: MessageAggregator = new MessageAggregator();\n return mergeContextDecl(collection.context, parentName, parentConditions).onSuccess(\n ({ baseId: baseName, conditions: baseConditions }) => {\n const mergedCandidates =\n collection.candidates?.map((candidate) =>\n mergeImporterCandidate(candidate, baseName, baseConditions)\n ) ?? [];\n this._candidates.push(...mapResults(mergedCandidates).aggregateError(errors).orDefault([]));\n\n const mergedResources =\n collection.resources?.map((resource) =>\n mergeImporterResource(resource, baseName, baseConditions)\n ) ?? [];\n this._resources.push(...mapResults(mergedResources).aggregateError(errors).orDefault([]));\n\n collection.collections?.forEach((subCollection) => {\n this._extract(subCollection, baseName, baseConditions).aggregateError(errors);\n });\n return errors.returnOrReport(succeed(this));\n }\n );\n }\n}\n"]}
@@ -5,7 +5,20 @@ import * as Normalized from './normalized';
5
5
  * @public
6
6
  */
7
7
  export interface IResourceDeclContainer {
8
- getLooseResources(): ReadonlyArray<Normalized.ILooseResourceDecl>;
9
- getLooseCandidates(): ReadonlyArray<Normalized.ILooseResourceCandidateDecl>;
8
+ /**
9
+ * Optional initial {@link ResourceJson.Normalized.IContainerContextDecl | resource context}
10
+ * declaration for the container.
11
+ */
12
+ readonly context?: Normalized.IContainerContextDecl;
13
+ /**
14
+ * Gets a normalized array of {@link ResourceJson.Normalized.IImporterResourceDecl | importer resource}
15
+ * declarations for all resources in the container, including children.
16
+ */
17
+ getImporterResources(): ReadonlyArray<Normalized.IImporterResourceDecl>;
18
+ /**
19
+ * Gets a normalized array of {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate}
20
+ * declarations for all resources in the container, including children.
21
+ */
22
+ getImporterCandidates(): ReadonlyArray<Normalized.IImporterResourceCandidateDecl>;
10
23
  }
11
24
  //# sourceMappingURL=resourceDeclContainer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resourceDeclContainer.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclContainer.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,iBAAiB,IAAI,aAAa,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAClE,kBAAkB,IAAI,aAAa,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;CAC7E"}
1
+ {"version":3,"file":"resourceDeclContainer.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclContainer.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,qBAAqB,CAAC;IAEpD;;;OAGG;IACH,oBAAoB,IAAI,aAAa,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAExE;;;OAGG;IACH,qBAAqB,IAAI,aAAa,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;CACnF"}
@@ -1 +1 @@
1
- {"version":3,"file":"resourceDeclContainer.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclContainer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Normalized from './normalized';\n\n/**\n * Generic container for resource and resource candidate\n * declarations.\n * @public\n */\nexport interface IResourceDeclContainer {\n getLooseResources(): ReadonlyArray<Normalized.ILooseResourceDecl>;\n getLooseCandidates(): ReadonlyArray<Normalized.ILooseResourceCandidateDecl>;\n}\n"]}
1
+ {"version":3,"file":"resourceDeclContainer.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclContainer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Normalized from './normalized';\n\n/**\n * Generic container for resource and resource candidate\n * declarations.\n * @public\n */\nexport interface IResourceDeclContainer {\n /**\n * Optional initial {@link ResourceJson.Normalized.IContainerContextDecl | resource context}\n * declaration for the container.\n */\n readonly context?: Normalized.IContainerContextDecl;\n\n /**\n * Gets a normalized array of {@link ResourceJson.Normalized.IImporterResourceDecl | importer resource}\n * declarations for all resources in the container, including children.\n */\n getImporterResources(): ReadonlyArray<Normalized.IImporterResourceDecl>;\n\n /**\n * Gets a normalized array of {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate}\n * declarations for all resources in the container, including children.\n */\n getImporterCandidates(): ReadonlyArray<Normalized.IImporterResourceCandidateDecl>;\n}\n"]}
@@ -12,6 +12,10 @@ export declare class ResourceDeclTree implements IResourceDeclContainer {
12
12
  * being processed.
13
13
  */
14
14
  readonly tree: Normalized.IResourceTreeRootDecl;
15
+ /**
16
+ * {@inheritdoc ResourceJson.IResourceDeclContainer.context}
17
+ */
18
+ get context(): Normalized.IContainerContextDecl | undefined;
15
19
  protected _resources: Normalized.ILooseResourceDecl[];
16
20
  protected _candidates: Normalized.ILooseResourceCandidateDecl[];
17
21
  protected constructor(tree: Normalized.IResourceTreeRootDecl);
@@ -27,13 +31,13 @@ export declare class ResourceDeclTree implements IResourceDeclContainer {
27
31
  * @returns The {@link ResourceJson.Normalized.ILooseResourceDecl | loose resource declarations}
28
32
  * extracted from the collection.
29
33
  */
30
- getLooseResources(): ReadonlyArray<Normalized.ILooseResourceDecl>;
34
+ getImporterResources(): ReadonlyArray<Normalized.ILooseResourceDecl>;
31
35
  /**
32
36
  * Gets the loose candidates extracted from the collection.
33
37
  * @returns The {@link ResourceJson.Normalized.ILooseResourceCandidateDecl | loose resource candidate declarations}
34
38
  * extracted from the collection.
35
39
  */
36
- getLooseCandidates(): ReadonlyArray<Normalized.ILooseResourceCandidateDecl>;
40
+ getImporterCandidates(): ReadonlyArray<Normalized.ILooseResourceCandidateDecl>;
37
41
  private _extract;
38
42
  }
39
43
  //# sourceMappingURL=resourceDeclTree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resourceDeclTree.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclTree.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAgD,MAAM,EAAW,M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,EAAE,CAAM;IAErE,SAAS,aAAa,IAAI,EAAE,UAAU,CAAC,qBAAqB;IAO5D;;;;;OAKG;WACW,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAS7D;;;;OAIG;IACI,oBAAoB,IAAI,aAAa,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAI3E;;;;OAIG;IACI,qBAAqB,IAAI,aAAa,CAAC,UAAU,CAAC,2BAA2B,CAAC;IAIrF,OAAO,CAAC,QAAQ;CAuBjB"}
@@ -65,11 +65,20 @@ const helpers_1 = require("./helpers");
65
65
  * @public
66
66
  */
67
67
  class ResourceDeclTree {
68
+ /**
69
+ * {@inheritdoc ResourceJson.IResourceDeclContainer.context}
70
+ */
71
+ get context() {
72
+ return this.tree.context;
73
+ }
68
74
  constructor(tree) {
75
+ var _a, _b;
69
76
  this._resources = [];
70
77
  this._candidates = [];
71
78
  this.tree = tree;
72
- this._extract(tree, tree.baseName).orThrow();
79
+ const id = (_a = tree.context) === null || _a === void 0 ? void 0 : _a.baseId;
80
+ const conditions = (_b = tree.context) === null || _b === void 0 ? void 0 : _b.conditions;
81
+ this._extract(tree, id, conditions).orThrow();
73
82
  }
74
83
  /**
75
84
  * Creates a new {@link ResourceJson.ResourceDeclTree | ResourceDeclTree} from an
@@ -90,7 +99,7 @@ class ResourceDeclTree {
90
99
  * @returns The {@link ResourceJson.Normalized.ILooseResourceDecl | loose resource declarations}
91
100
  * extracted from the collection.
92
101
  */
93
- getLooseResources() {
102
+ getImporterResources() {
94
103
  return this._resources;
95
104
  }
96
105
  /**
@@ -98,7 +107,7 @@ class ResourceDeclTree {
98
107
  * @returns The {@link ResourceJson.Normalized.ILooseResourceCandidateDecl | loose resource candidate declarations}
99
108
  * extracted from the collection.
100
109
  */
101
- getLooseCandidates() {
110
+ getImporterCandidates() {
102
111
  return this._candidates;
103
112
  }
104
113
  _extract(node, parentName, parentConditions) {
@@ -1 +1 @@
1
- {"version":3,"file":"res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ACzE,MAAM,eAAe,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,CAC/D,IAAA,4BAAkB,EAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,CAAC,CACjE,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAA,qBAAU,EAAC,eAAe,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAE1F,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAA,IAAI,CAAC,QAAQ,mCAAI,EAAE,CAAC,CAAC,CAAC;QACjE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE;YACrC,gBAAa,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC;iBAC5C,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE;gBACvB,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACtF,CAAC,CAAC;iBACD,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AAvED,4CAuEC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, mapResults, MessageAggregator, Result, succeed } from '@fgv/ts-utils';\nimport { IResourceDeclContainer } from './resourceDeclContainer';\nimport * as Convert from './convert';\nimport * as Normalized from './normalized';\nimport * as Json from './json';\nimport { Helpers as CommonHelpers } from '../common';\nimport { mergeChildResource } from './helpers';\n\n/**\n * Class that extracts resources and candidates from a\n * {@link ResourceJson.Json.IResourceTreeRootDecl | resource tree root}.\n * @public\n */\nexport class ResourceDeclTree implements IResourceDeclContainer {\n /**\n * The {@link ResourceJson.Normalized.IResourceTreeRootDecl | resource tree root declaration}\n * being processed.\n */\n public readonly tree: Normalized.IResourceTreeRootDecl;\n\n protected _resources: Normalized.ILooseResourceDecl[] = [];\n protected _candidates: Normalized.ILooseResourceCandidateDecl[] = [];\n\n protected constructor(tree: Normalized.IResourceTreeRootDecl) {\n this.tree = tree;\n this._extract(tree, tree.baseName).orThrow();\n }\n\n /**\n * Creates a new {@link ResourceJson.ResourceDeclTree | ResourceDeclTree} from an\n * untyped {@link ResourceJson.Json.IResourceTreeRootDecl | resource tree root declaration}.\n * @param from - The JSON object to convert.\n * @returns `Success` with the new tree if the JSON object is valid, otherwise `Failure`.\n */\n public static create(from: unknown): Result<ResourceDeclTree> {\n return Convert.resourceTreeRootDecl\n .convert(from)\n .withErrorFormat((err) => `Invalid resource tree: ${err}`)\n .onSuccess((decl) => {\n return captureResult(() => new ResourceDeclTree(decl));\n });\n }\n\n /**\n * Gets the loose resources extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.ILooseResourceDecl | loose resource declarations}\n * extracted from the collection.\n */\n public getLooseResources(): ReadonlyArray<Normalized.ILooseResourceDecl> {\n return this._resources;\n }\n\n /**\n * Gets the loose candidates extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.ILooseResourceCandidateDecl | loose resource candidate declarations}\n * extracted from the collection.\n */\n public getLooseCandidates(): ReadonlyArray<Normalized.ILooseResourceCandidateDecl> {\n return this._candidates;\n }\n\n private _extract(\n node: Normalized.IResourceTreeChildNodeDecl,\n parentName?: string,\n parentConditions?: Json.ILooseConditionDecl[]\n ): Result<this> {\n const errors: MessageAggregator = new MessageAggregator();\n\n const resourceEntries = Array.from(Object.entries(node.resources ?? {}));\n const mergedResources = resourceEntries.map(([name, resource]) =>\n mergeChildResource(resource, name, parentName, parentConditions)\n );\n this._resources.push(...mapResults(mergedResources).aggregateError(errors).orDefault([]));\n\n const children = Array.from(Object.entries(node.children ?? {}));\n children.forEach(([name, childNode]) => {\n CommonHelpers.joinResourceIds(parentName, name)\n .onSuccess((childName) => {\n return this._extract(childNode, childName, parentConditions).aggregateError(errors);\n })\n .aggregateError(errors);\n });\n return errors.returnOrReport(succeed(this));\n }\n}\n"]}
1
+ {"version":3,"file":"resourceDeclTree.js","sourceRoot":"","sources":["../../../src/packlets/resource-json/resourceDeclTree.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA8F;AAE9F,mDAAqC;AAGrC,sCAAqD;AACrD,uCAA+C;AAE/C;;;;GAIG;AACH,MAAa,gBAAgB;IAO3B;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAKD,YAAsB,IAAsC;;QAHlD,eAAU,GAAo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U,EAAE,gBAAgB,CAAC,CACjE,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAA,qBAAU,EAAC,eAAe,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAE1F,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAA,IAAI,CAAC,QAAQ,mCAAI,EAAE,CAAC,CAAC,CAAC;QACjE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE;YACrC,gBAAa,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC;iBAC5C,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE;gBACvB,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACtF,CAAC,CAAC;iBACD,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AAhFD,4CAgFC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, mapResults, MessageAggregator, Result, succeed } from '@fgv/ts-utils';\nimport { IResourceDeclContainer } from './resourceDeclContainer';\nimport * as Convert from './convert';\nimport * as Normalized from './normalized';\nimport * as Json from './json';\nimport { Helpers as CommonHelpers } from '../common';\nimport { mergeChildResource } from './helpers';\n\n/**\n * Class that extracts resources and candidates from a\n * {@link ResourceJson.Json.IResourceTreeRootDecl | resource tree root}.\n * @public\n */\nexport class ResourceDeclTree implements IResourceDeclContainer {\n /**\n * The {@link ResourceJson.Normalized.IResourceTreeRootDecl | resource tree root declaration}\n * being processed.\n */\n public readonly tree: Normalized.IResourceTreeRootDecl;\n\n /**\n * {@inheritdoc ResourceJson.IResourceDeclContainer.context}\n */\n public get context(): Normalized.IContainerContextDecl | undefined {\n return this.tree.context;\n }\n\n protected _resources: Normalized.ILooseResourceDecl[] = [];\n protected _candidates: Normalized.ILooseResourceCandidateDecl[] = [];\n\n protected constructor(tree: Normalized.IResourceTreeRootDecl) {\n this.tree = tree;\n const id = tree.context?.baseId;\n const conditions = tree.context?.conditions;\n this._extract(tree, id, conditions).orThrow();\n }\n\n /**\n * Creates a new {@link ResourceJson.ResourceDeclTree | ResourceDeclTree} from an\n * untyped {@link ResourceJson.Json.IResourceTreeRootDecl | resource tree root declaration}.\n * @param from - The JSON object to convert.\n * @returns `Success` with the new tree if the JSON object is valid, otherwise `Failure`.\n */\n public static create(from: unknown): Result<ResourceDeclTree> {\n return Convert.resourceTreeRootDecl\n .convert(from)\n .withErrorFormat((err) => `Invalid resource tree: ${err}`)\n .onSuccess((decl) => {\n return captureResult(() => new ResourceDeclTree(decl));\n });\n }\n\n /**\n * Gets the loose resources extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.ILooseResourceDecl | loose resource declarations}\n * extracted from the collection.\n */\n public getImporterResources(): ReadonlyArray<Normalized.ILooseResourceDecl> {\n return this._resources;\n }\n\n /**\n * Gets the loose candidates extracted from the collection.\n * @returns The {@link ResourceJson.Normalized.ILooseResourceCandidateDecl | loose resource candidate declarations}\n * extracted from the collection.\n */\n public getImporterCandidates(): ReadonlyArray<Normalized.ILooseResourceCandidateDecl> {\n return this._candidates;\n }\n\n private _extract(\n node: Normalized.IResourceTreeChildNodeDecl,\n parentName?: string,\n parentConditions?: ReadonlyArray<Json.ILooseConditionDecl>\n ): Result<this> {\n const errors: MessageAggregator = new MessageAggregator();\n\n const resourceEntries = Array.from(Object.entries(node.resources ?? {}));\n const mergedResources = resourceEntries.map(([name, resource]) =>\n mergeChildResource(resource, name, parentName, parentConditions)\n );\n this._resources.push(...mapResults(mergedResources).aggregateError(errors).orDefault([]));\n\n const children = Array.from(Object.entries(node.children ?? {}));\n children.forEach(([name, childNode]) => {\n CommonHelpers.joinResourceIds(parentName, name)\n .onSuccess((childName) => {\n return this._extract(childNode, childName, parentConditions).aggregateError(errors);\n })\n .aggregateError(errors);\n });\n return errors.returnOrReport(succeed(this));\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { IResourceTypeConfig } from './json';
2
+ /**
3
+ * A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
4
+ * @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
5
+ * @public
6
+ */
7
+ export declare const resourceTypeConfig: import("@fgv/ts-utils").ObjectConverter<IResourceTypeConfig, unknown>;
8
+ //# sourceMappingURL=convert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/convert.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,uEAG7B,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.resourceTypeConfig = void 0;
25
+ /* eslint-disable @rushstack/typedef-var */
26
+ const ts_utils_1 = require("@fgv/ts-utils");
27
+ /**
28
+ * A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
29
+ * @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
30
+ * @public
31
+ */
32
+ exports.resourceTypeConfig = ts_utils_1.Converters.strictObject({
33
+ name: ts_utils_1.Converters.string,
34
+ typeName: ts_utils_1.Converters.string
35
+ });
36
+ //# sourceMappingURL=convert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/convert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,2CAA2C;AAE3C,4CAA2C;AAG3C;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,qBAAU,CAAC,YAAY,CAAsB;IAC7E,IAAI,EAAE,qBAAU,CAAC,MAAM;IACvB,QAAQ,EAAE,qBAAU,CAAC,MAAM;CAC5B,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* eslint-disable @rushstack/typedef-var */\n\nimport { Converters } from '@fgv/ts-utils';\nimport { IResourceTypeConfig } from './json';\n\n/**\n * A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.\n * @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.\n * @public\n */\nexport const resourceTypeConfig = Converters.strictObject<IResourceTypeConfig>({\n name: Converters.string,\n typeName: Converters.string\n});\n"]}
@@ -0,0 +1,4 @@
1
+ import * as Convert from './convert';
2
+ export * from './json';
3
+ export { Convert };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ var desc = Object.getOwnPropertyDescriptor(m, k);
26
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
27
+ desc = { enumerable: true, get: function() { return m[k]; } };
28
+ }
29
+ Object.defineProperty(o, k2, desc);
30
+ }) : (function(o, m, k, k2) {
31
+ if (k2 === undefined) k2 = k;
32
+ o[k2] = m[k];
33
+ }));
34
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
35
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
36
+ }) : function(o, v) {
37
+ o["default"] = v;
38
+ });
39
+ var __importStar = (this && this.__importStar) || (function () {
40
+ var ownKeys = function(o) {
41
+ ownKeys = Object.getOwnPropertyNames || function (o) {
42
+ var ar = [];
43
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
44
+ return ar;
45
+ };
46
+ return ownKeys(o);
47
+ };
48
+ return function (mod) {
49
+ if (mod && mod.__esModule) return mod;
50
+ var result = {};
51
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
52
+ __setModuleDefault(result, mod);
53
+ return result;
54
+ };
55
+ })();
56
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
57
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
58
+ };
59
+ Object.defineProperty(exports, "__esModule", { value: true });
60
+ exports.Convert = void 0;
61
+ const Convert = __importStar(require("./convert"));
62
+ exports.Convert = Convert;
63
+ __exportStar(require("./json"), exports);
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAI5B,0BAAO;AAFhB,yCAAuB","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\n\nexport * from './json';\n\nexport { Convert };\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Configuration for a {@link ResourceTypes.ResourceType | resource type}.
3
+ * @public
4
+ */
5
+ export interface IResourceTypeConfig {
6
+ name: string;
7
+ typeName: string;
8
+ }
9
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/json.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/packlets/resource-types/config/json.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Configuration for a {@link ResourceTypes.ResourceType | resource type}.\n * @public\n */\nexport interface IResourceTypeConfig {\n name: string;\n typeName: string;\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import { Result } from '@fgv/ts-utils';
2
+ import { IResourceTypeConfig } from './config';
3
+ import { ResourceType } from './resourceType';
4
+ /**
5
+ * Creates a {@link ResourceTypes.ResourceType | ResourceType} from a configuration object.
6
+ * @param config - The {@link ResourceTypes.Config.IResourceTypeConfig | configuration object}
7
+ * containing the name and type name of the resource type.
8
+ * @returns `Success` with the new {@link ResourceTypes.ResourceType | ResourceType}
9
+ * if successful, `Failure` with an error message otherwise.
10
+ * @public
11
+ */
12
+ export declare function createResourceTypeFromConfig(config: IResourceTypeConfig): Result<ResourceType>;
13
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-types/helpers.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAQ,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAAC,YAAY,CAAC,CAO9F"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.createResourceTypeFromConfig = createResourceTypeFromConfig;
25
+ const ts_utils_1 = require("@fgv/ts-utils");
26
+ const jsonResourceType_1 = require("./jsonResourceType");
27
+ const common_1 = require("../common");
28
+ /**
29
+ * Creates a {@link ResourceTypes.ResourceType | ResourceType} from a configuration object.
30
+ * @param config - The {@link ResourceTypes.Config.IResourceTypeConfig | configuration object}
31
+ * containing the name and type name of the resource type.
32
+ * @returns `Success` with the new {@link ResourceTypes.ResourceType | ResourceType}
33
+ * if successful, `Failure` with an error message otherwise.
34
+ * @public
35
+ */
36
+ function createResourceTypeFromConfig(config) {
37
+ if (config.typeName === 'json') {
38
+ return common_1.Convert.resourceTypeName
39
+ .convert(config.name)
40
+ .onSuccess((key) => jsonResourceType_1.JsonResourceType.create({ key }));
41
+ }
42
+ return (0, ts_utils_1.fail)(`${config.typeName}: Unknown resource type.`);
43
+ }
44
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/packlets/resource-types/helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAgBH,oEAOC;AArBD,4CAA6C;AAG7C,yDAAsD;AACtD,sCAAwD;AAExD;;;;;;;GAOG;AACH,SAAgB,4BAA4B,CAAC,MAA2B;IACtE,IAAI,MAAM,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QAC/B,OAAO,gBAAgB,CAAC,gBAAgB;aACrC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;aACpB,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,mCAAgB,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,IAAA,eAAI,EAAC,GAAG,MAAM,CAAC,QAAQ,0BAA0B,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { fail, Result } from '@fgv/ts-utils';\nimport { IResourceTypeConfig } from './config';\nimport { ResourceType } from './resourceType';\nimport { JsonResourceType } from './jsonResourceType';\nimport { Convert as CommonConverters } from '../common';\n\n/**\n * Creates a {@link ResourceTypes.ResourceType | ResourceType} from a configuration object.\n * @param config - The {@link ResourceTypes.Config.IResourceTypeConfig | configuration object}\n * containing the name and type name of the resource type.\n * @returns `Success` with the new {@link ResourceTypes.ResourceType | ResourceType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function createResourceTypeFromConfig(config: IResourceTypeConfig): Result<ResourceType> {\n if (config.typeName === 'json') {\n return CommonConverters.resourceTypeName\n .convert(config.name)\n .onSuccess((key) => JsonResourceType.create({ key }));\n }\n return fail(`${config.typeName}: Unknown resource type.`);\n}\n"]}
@@ -1,4 +1,7 @@
1
+ import * as Config from './config';
1
2
  export * from './resourceType';
2
3
  export * from './resourceTypeCollector';
3
4
  export * from './jsonResourceType';
5
+ export * from './helpers';
6
+ export { Config };
4
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-types/index.ts"],"names":[],"mappings":"AAsBA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/resource-types/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,CAAC"}