@fgv/ts-res 4.5.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 (293) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +27 -0
  3. package/dist/ts-res.d.ts +4282 -0
  4. package/dist/tsdoc-metadata.json +11 -0
  5. package/lib/index.d.ts +12 -0
  6. package/lib/index.d.ts.map +1 -0
  7. package/lib/index.js +79 -0
  8. package/lib/index.js.map +1 -0
  9. package/lib/packlets/common/conditions.d.ts +148 -0
  10. package/lib/packlets/common/conditions.d.ts.map +1 -0
  11. package/lib/packlets/common/conditions.js +50 -0
  12. package/lib/packlets/common/conditions.js.map +1 -0
  13. package/lib/packlets/common/convert.d.ts +111 -0
  14. package/lib/packlets/common/convert.d.ts.map +1 -0
  15. package/lib/packlets/common/convert.js +173 -0
  16. package/lib/packlets/common/convert.js.map +1 -0
  17. package/lib/packlets/common/helpers/conditions.d.ts +39 -0
  18. package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
  19. package/lib/packlets/common/helpers/conditions.js +105 -0
  20. package/lib/packlets/common/helpers/conditions.js.map +1 -0
  21. package/lib/packlets/common/helpers/index.d.ts +3 -0
  22. package/lib/packlets/common/helpers/index.d.ts.map +1 -0
  23. package/lib/packlets/common/helpers/index.js +40 -0
  24. package/lib/packlets/common/helpers/index.js.map +1 -0
  25. package/lib/packlets/common/helpers/resources.d.ts +34 -0
  26. package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
  27. package/lib/packlets/common/helpers/resources.js +81 -0
  28. package/lib/packlets/common/helpers/resources.js.map +1 -0
  29. package/lib/packlets/common/index.d.ts +7 -0
  30. package/lib/packlets/common/index.d.ts.map +1 -0
  31. package/lib/packlets/common/index.js +69 -0
  32. package/lib/packlets/common/index.js.map +1 -0
  33. package/lib/packlets/common/resources.d.ts +41 -0
  34. package/lib/packlets/common/resources.d.ts.map +1 -0
  35. package/lib/packlets/common/resources.js +30 -0
  36. package/lib/packlets/common/resources.js.map +1 -0
  37. package/lib/packlets/common/validate/conditions.d.ts +248 -0
  38. package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
  39. package/lib/packlets/common/validate/conditions.js +436 -0
  40. package/lib/packlets/common/validate/conditions.js.map +1 -0
  41. package/lib/packlets/common/validate/index.d.ts +5 -0
  42. package/lib/packlets/common/validate/index.d.ts.map +1 -0
  43. package/lib/packlets/common/validate/index.js +65 -0
  44. package/lib/packlets/common/validate/index.js.map +1 -0
  45. package/lib/packlets/common/validate/regularExpressions.d.ts +39 -0
  46. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
  47. package/lib/packlets/common/validate/regularExpressions.js +63 -0
  48. package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
  49. package/lib/packlets/common/validate/resources.d.ts +97 -0
  50. package/lib/packlets/common/validate/resources.d.ts.map +1 -0
  51. package/lib/packlets/common/validate/resources.js +171 -0
  52. package/lib/packlets/common/validate/resources.js.map +1 -0
  53. package/lib/packlets/conditions/condition.d.ts +91 -0
  54. package/lib/packlets/conditions/condition.d.ts.map +1 -0
  55. package/lib/packlets/conditions/condition.js +146 -0
  56. package/lib/packlets/conditions/condition.js.map +1 -0
  57. package/lib/packlets/conditions/conditionCollector.d.ts +54 -0
  58. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
  59. package/lib/packlets/conditions/conditionCollector.js +72 -0
  60. package/lib/packlets/conditions/conditionCollector.js.map +1 -0
  61. package/lib/packlets/conditions/conditionDecls.d.ts +26 -0
  62. package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
  63. package/lib/packlets/conditions/conditionDecls.js +24 -0
  64. package/lib/packlets/conditions/conditionDecls.js.map +1 -0
  65. package/lib/packlets/conditions/conditionSet.d.ts +99 -0
  66. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
  67. package/lib/packlets/conditions/conditionSet.js +164 -0
  68. package/lib/packlets/conditions/conditionSet.js.map +1 -0
  69. package/lib/packlets/conditions/conditionSetCollector.d.ts +65 -0
  70. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
  71. package/lib/packlets/conditions/conditionSetCollector.js +90 -0
  72. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
  73. package/lib/packlets/conditions/conditionSetDecls.d.ts +18 -0
  74. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
  75. package/lib/packlets/conditions/conditionSetDecls.js +24 -0
  76. package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
  77. package/lib/packlets/conditions/conditionToken.d.ts +86 -0
  78. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
  79. package/lib/packlets/conditions/conditionToken.js +150 -0
  80. package/lib/packlets/conditions/conditionToken.js.map +1 -0
  81. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts +24 -0
  82. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
  83. package/lib/packlets/conditions/convert/conditionSetDecls.js +54 -0
  84. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  85. package/lib/packlets/conditions/convert/decls.d.ts +24 -0
  86. package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
  87. package/lib/packlets/conditions/convert/decls.js +111 -0
  88. package/lib/packlets/conditions/convert/decls.js.map +1 -0
  89. package/lib/packlets/conditions/convert/index.d.ts +3 -0
  90. package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
  91. package/lib/packlets/conditions/convert/index.js +40 -0
  92. package/lib/packlets/conditions/convert/index.js.map +1 -0
  93. package/lib/packlets/conditions/index.d.ts +10 -0
  94. package/lib/packlets/conditions/index.d.ts.map +1 -0
  95. package/lib/packlets/conditions/index.js +70 -0
  96. package/lib/packlets/conditions/index.js.map +1 -0
  97. package/lib/packlets/decisions/abstractDecision.d.ts +39 -0
  98. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
  99. package/lib/packlets/decisions/abstractDecision.js +63 -0
  100. package/lib/packlets/decisions/abstractDecision.js.map +1 -0
  101. package/lib/packlets/decisions/abstractDecisionCollector.d.ts +59 -0
  102. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
  103. package/lib/packlets/decisions/abstractDecisionCollector.js +92 -0
  104. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  105. package/lib/packlets/decisions/candidate.d.ts +58 -0
  106. package/lib/packlets/decisions/candidate.d.ts.map +1 -0
  107. package/lib/packlets/decisions/candidate.js +80 -0
  108. package/lib/packlets/decisions/candidate.js.map +1 -0
  109. package/lib/packlets/decisions/common.d.ts +15 -0
  110. package/lib/packlets/decisions/common.d.ts.map +1 -0
  111. package/lib/packlets/decisions/common.js +24 -0
  112. package/lib/packlets/decisions/common.js.map +1 -0
  113. package/lib/packlets/decisions/concreteDecision.d.ts +74 -0
  114. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
  115. package/lib/packlets/decisions/concreteDecision.js +114 -0
  116. package/lib/packlets/decisions/concreteDecision.js.map +1 -0
  117. package/lib/packlets/decisions/decision.d.ts +91 -0
  118. package/lib/packlets/decisions/decision.d.ts.map +1 -0
  119. package/lib/packlets/decisions/decision.js +126 -0
  120. package/lib/packlets/decisions/decision.js.map +1 -0
  121. package/lib/packlets/decisions/index.d.ts +7 -0
  122. package/lib/packlets/decisions/index.d.ts.map +1 -0
  123. package/lib/packlets/decisions/index.js +44 -0
  124. package/lib/packlets/decisions/index.js.map +1 -0
  125. package/lib/packlets/import/fsItem.d.ts +99 -0
  126. package/lib/packlets/import/fsItem.d.ts.map +1 -0
  127. package/lib/packlets/import/fsItem.js +174 -0
  128. package/lib/packlets/import/fsItem.js.map +1 -0
  129. package/lib/packlets/import/importContext.d.ts +85 -0
  130. package/lib/packlets/import/importContext.d.ts.map +1 -0
  131. package/lib/packlets/import/importContext.js +94 -0
  132. package/lib/packlets/import/importContext.js.map +1 -0
  133. package/lib/packlets/import/importManager.d.ts +93 -0
  134. package/lib/packlets/import/importManager.d.ts.map +1 -0
  135. package/lib/packlets/import/importManager.js +133 -0
  136. package/lib/packlets/import/importManager.js.map +1 -0
  137. package/lib/packlets/import/importable.d.ts +71 -0
  138. package/lib/packlets/import/importable.d.ts.map +1 -0
  139. package/lib/packlets/import/importable.js +35 -0
  140. package/lib/packlets/import/importable.js.map +1 -0
  141. package/lib/packlets/import/importers/collectionImporter.d.ts +60 -0
  142. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
  143. package/lib/packlets/import/importers/collectionImporter.js +146 -0
  144. package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
  145. package/lib/packlets/import/importers/fsItemImporter.d.ts +49 -0
  146. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
  147. package/lib/packlets/import/importers/fsItemImporter.js +120 -0
  148. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
  149. package/lib/packlets/import/importers/importer.d.ts +31 -0
  150. package/lib/packlets/import/importers/importer.d.ts.map +1 -0
  151. package/lib/packlets/import/importers/importer.js +24 -0
  152. package/lib/packlets/import/importers/importer.js.map +1 -0
  153. package/lib/packlets/import/importers/index.d.ts +6 -0
  154. package/lib/packlets/import/importers/index.d.ts.map +1 -0
  155. package/lib/packlets/import/importers/index.js +43 -0
  156. package/lib/packlets/import/importers/index.js.map +1 -0
  157. package/lib/packlets/import/importers/jsonImporter.d.ts +32 -0
  158. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
  159. package/lib/packlets/import/importers/jsonImporter.js +140 -0
  160. package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
  161. package/lib/packlets/import/importers/pathImporter.d.ts +61 -0
  162. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
  163. package/lib/packlets/import/importers/pathImporter.js +87 -0
  164. package/lib/packlets/import/importers/pathImporter.js.map +1 -0
  165. package/lib/packlets/import/index.d.ts +7 -0
  166. package/lib/packlets/import/index.d.ts.map +1 -0
  167. package/lib/packlets/import/index.js +67 -0
  168. package/lib/packlets/import/index.js.map +1 -0
  169. package/lib/packlets/qualifier-types/convert.d.ts +19 -0
  170. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
  171. package/lib/packlets/qualifier-types/convert.js +45 -0
  172. package/lib/packlets/qualifier-types/convert.js.map +1 -0
  173. package/lib/packlets/qualifier-types/index.d.ts +8 -0
  174. package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
  175. package/lib/packlets/qualifier-types/index.js +68 -0
  176. package/lib/packlets/qualifier-types/index.js.map +1 -0
  177. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +56 -0
  178. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
  179. package/lib/packlets/qualifier-types/languageQualifierType.js +87 -0
  180. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  181. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +92 -0
  182. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
  183. package/lib/packlets/qualifier-types/literalQualifierType.js +114 -0
  184. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  185. package/lib/packlets/qualifier-types/qualifierType.d.ts +184 -0
  186. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
  187. package/lib/packlets/qualifier-types/qualifierType.js +173 -0
  188. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
  189. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts +40 -0
  190. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
  191. package/lib/packlets/qualifier-types/qualifierTypeCollector.js +102 -0
  192. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  193. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +74 -0
  194. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
  195. package/lib/packlets/qualifier-types/territoryQualifierType.js +113 -0
  196. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  197. package/lib/packlets/qualifiers/convert/decls.d.ts +23 -0
  198. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
  199. package/lib/packlets/qualifiers/convert/decls.js +71 -0
  200. package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
  201. package/lib/packlets/qualifiers/convert/index.d.ts +3 -0
  202. package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
  203. package/lib/packlets/qualifiers/convert/index.js +40 -0
  204. package/lib/packlets/qualifiers/convert/index.js.map +1 -0
  205. package/lib/packlets/qualifiers/convert/qualifier.d.ts +17 -0
  206. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
  207. package/lib/packlets/qualifiers/convert/qualifier.js +43 -0
  208. package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
  209. package/lib/packlets/qualifiers/index.d.ts +6 -0
  210. package/lib/packlets/qualifiers/index.d.ts.map +1 -0
  211. package/lib/packlets/qualifiers/index.js +66 -0
  212. package/lib/packlets/qualifiers/index.js.map +1 -0
  213. package/lib/packlets/qualifiers/qualifier.d.ts +68 -0
  214. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
  215. package/lib/packlets/qualifiers/qualifier.js +87 -0
  216. package/lib/packlets/qualifiers/qualifier.js.map +1 -0
  217. package/lib/packlets/qualifiers/qualifierCollector.d.ts +90 -0
  218. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
  219. package/lib/packlets/qualifiers/qualifierCollector.js +157 -0
  220. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
  221. package/lib/packlets/qualifiers/qualifierDecl.d.ts +46 -0
  222. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
  223. package/lib/packlets/qualifiers/qualifierDecl.js +24 -0
  224. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
  225. package/lib/packlets/resource-json/convert.d.ts +54 -0
  226. package/lib/packlets/resource-json/convert.d.ts.map +1 -0
  227. package/lib/packlets/resource-json/convert.js +139 -0
  228. package/lib/packlets/resource-json/convert.js.map +1 -0
  229. package/lib/packlets/resource-json/helpers.d.ts +41 -0
  230. package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
  231. package/lib/packlets/resource-json/helpers.js +96 -0
  232. package/lib/packlets/resource-json/helpers.js.map +1 -0
  233. package/lib/packlets/resource-json/index.d.ts +9 -0
  234. package/lib/packlets/resource-json/index.d.ts.map +1 -0
  235. package/lib/packlets/resource-json/index.js +72 -0
  236. package/lib/packlets/resource-json/index.js.map +1 -0
  237. package/lib/packlets/resource-json/json.d.ts +182 -0
  238. package/lib/packlets/resource-json/json.d.ts.map +1 -0
  239. package/lib/packlets/resource-json/json.js +24 -0
  240. package/lib/packlets/resource-json/json.js.map +1 -0
  241. package/lib/packlets/resource-json/normalized.d.ts +123 -0
  242. package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
  243. package/lib/packlets/resource-json/normalized.js +24 -0
  244. package/lib/packlets/resource-json/normalized.js.map +1 -0
  245. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +39 -0
  246. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
  247. package/lib/packlets/resource-json/resourceDeclCollection.js +121 -0
  248. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  249. package/lib/packlets/resource-json/resourceDeclContainer.d.ts +11 -0
  250. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
  251. package/lib/packlets/resource-json/resourceDeclContainer.js +24 -0
  252. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  253. package/lib/packlets/resource-json/resourceDeclTree.d.ts +39 -0
  254. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
  255. package/lib/packlets/resource-json/resourceDeclTree.js +122 -0
  256. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
  257. package/lib/packlets/resource-types/index.d.ts +4 -0
  258. package/lib/packlets/resource-types/index.d.ts.map +1 -0
  259. package/lib/packlets/resource-types/index.js +41 -0
  260. package/lib/packlets/resource-types/index.js.map +1 -0
  261. package/lib/packlets/resource-types/jsonResourceType.d.ts +65 -0
  262. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
  263. package/lib/packlets/resource-types/jsonResourceType.js +63 -0
  264. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
  265. package/lib/packlets/resource-types/resourceType.d.ts +87 -0
  266. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
  267. package/lib/packlets/resource-types/resourceType.js +62 -0
  268. package/lib/packlets/resource-types/resourceType.js.map +1 -0
  269. package/lib/packlets/resource-types/resourceTypeCollector.d.ts +30 -0
  270. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
  271. package/lib/packlets/resource-types/resourceTypeCollector.js +65 -0
  272. package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  273. package/lib/packlets/resources/index.d.ts +5 -0
  274. package/lib/packlets/resources/index.d.ts.map +1 -0
  275. package/lib/packlets/resources/index.js +42 -0
  276. package/lib/packlets/resources/index.js.map +1 -0
  277. package/lib/packlets/resources/resource.d.ts +75 -0
  278. package/lib/packlets/resources/resource.d.ts.map +1 -0
  279. package/lib/packlets/resources/resource.js +109 -0
  280. package/lib/packlets/resources/resource.js.map +1 -0
  281. package/lib/packlets/resources/resourceBuilder.d.ts +112 -0
  282. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
  283. package/lib/packlets/resources/resourceBuilder.js +162 -0
  284. package/lib/packlets/resources/resourceBuilder.js.map +1 -0
  285. package/lib/packlets/resources/resourceCandidate.d.ts +102 -0
  286. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
  287. package/lib/packlets/resources/resourceCandidate.js +180 -0
  288. package/lib/packlets/resources/resourceCandidate.js.map +1 -0
  289. package/lib/packlets/resources/resourceManager.d.ts +104 -0
  290. package/lib/packlets/resources/resourceManager.d.ts.map +1 -0
  291. package/lib/packlets/resources/resourceManager.js +193 -0
  292. package/lib/packlets/resources/resourceManager.js.map +1 -0
  293. package/package.json +76 -0
@@ -0,0 +1,66 @@
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("./qualifier"), exports);
64
+ __exportStar(require("./qualifierDecl"), exports);
65
+ __exportStar(require("./qualifierCollector"), exports);
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAM5B,0BAAO;AAJhB,8CAA4B;AAC5B,kDAAgC;AAChC,uDAAqC","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 './qualifier';\nexport * from './qualifierDecl';\nexport * from './qualifierCollector';\n\nexport { Convert };\n"]}
@@ -0,0 +1,68 @@
1
+ import { Collections, ICollectible, Result } from '@fgv/ts-utils';
2
+ import { ConditionPriority, QualifierIndex, QualifierName } from '../common';
3
+ import { QualifierType } from '../qualifier-types';
4
+ import { IValidatedQualifierDecl } from './qualifierDecl';
5
+ /**
6
+ * Represents a qualifier that can be used to identify the context in
7
+ * which a resource is used.
8
+ * @public
9
+ */
10
+ export declare class Qualifier implements IValidatedQualifierDecl, ICollectible<QualifierName, QualifierIndex> {
11
+ /**
12
+ * The name of the qualifier.
13
+ */
14
+ readonly name: QualifierName;
15
+ /**
16
+ * The token used to identify the qualifier in the name or
17
+ * path of a resource being imported.
18
+ */
19
+ readonly token: QualifierName;
20
+ /**
21
+ * The {@link QualifierTypes.QualifierType | type} of the qualifier.
22
+ */
23
+ readonly type: QualifierType;
24
+ /**
25
+ * Indicates whether the token is optional in the name or path of a resource being imported.
26
+ */
27
+ readonly tokenIsOptional: boolean;
28
+ /**
29
+ * The index of the qualifier.
30
+ */
31
+ get index(): QualifierIndex | undefined;
32
+ /**
33
+ * The collector key for this qualifier.
34
+ */
35
+ get key(): QualifierName;
36
+ /**
37
+ * The default {@link ConditionPriority | priority} of conditions
38
+ * that depend on this qualifier.
39
+ */
40
+ readonly defaultPriority: ConditionPriority;
41
+ protected readonly _collectible: Collections.Collectible<QualifierName, QualifierIndex>;
42
+ /**
43
+ * Constructs a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the
44
+ * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.
45
+ * @param name - The name of the qualifier.
46
+ * @param type - The {@link QualifierTypes.QualifierType | type} of the qualifier.
47
+ * @param defaultPriority - The default {@link ConditionPriority | priority} of conditions
48
+ * @public
49
+ */
50
+ protected constructor({ name, token, type, defaultPriority, tokenIsOptional, index }: IValidatedQualifierDecl);
51
+ /**
52
+ * Creates a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the
53
+ * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.
54
+ * @param decl - The {@link Qualifiers.IValidatedQualifierDecl | validated declaration}
55
+ * for the new instance.
56
+ * @returns `Success` with the new {@link Qualifiers.Qualifier | Qualifier} if successful,
57
+ * `Failure` with an error message otherwise.
58
+ * @public
59
+ */
60
+ static create(decl: IValidatedQualifierDecl): Result<Qualifier>;
61
+ /**
62
+ * Sets the index of this qualifier. Once set, the index cannot be changed.
63
+ * @param index - The index to set.
64
+ * @returns `Success` with the index if successful, `Failure` with an error message otherwise.
65
+ */
66
+ setIndex(index: QualifierIndex): Result<QualifierIndex>;
67
+ }
68
+ //# sourceMappingURL=qualifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifier.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifier.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAA4B,MAAM,WAAW,CAAC;AACvG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,SAAU,YAAW,uBAAuB,EAAE,YAAY,CAAC,aAAa,EAAE,cAAc,CAAC;IACpG;;OAEG;IACH,SAAgB,IAAI,EAAE,aAAa,CAAC;IAEpC;;;OAGG;IACH,SAAgB,KAAK,EAAE,aAAa,CAAC;IAErC;;OAEG;IACH,SAAgB,IAAI,EAAE,aAAa,CAAC;IAEpC;;OAEG;IACH,SAAgB,eAAe,EAAE,OAAO,CAAC;IAEzC;;OAEG;IACH,IAAW,KAAK,IAAI,cAAc,GAAG,SAAS,CAE7C;IAED;;OAEG;IACH,IAAW,GAAG,IAAI,aAAa,CAE9B;IAED;;;OAGG;IACH,SAAgB,eAAe,EAAE,iBAAiB,CAAC;IAEnD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,WAAW,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAExF;;;;;;;OAOG;IACH,SAAS,aAAa,EACpB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,eAAe,EACf,eAAe,EACf,KAAK,EACN,EAAE,uBAAuB;IAa1B;;;;;;;;OAQG;WACW,MAAM,CAAC,IAAI,EAAE,uBAAuB,GAAG,MAAM,CAAC,SAAS,CAAC;IAItE;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;CAG/D"}
@@ -0,0 +1,87 @@
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.Qualifier = void 0;
25
+ const ts_utils_1 = require("@fgv/ts-utils");
26
+ const common_1 = require("../common");
27
+ /**
28
+ * Represents a qualifier that can be used to identify the context in
29
+ * which a resource is used.
30
+ * @public
31
+ */
32
+ class Qualifier {
33
+ /**
34
+ * The index of the qualifier.
35
+ */
36
+ get index() {
37
+ return this._collectible.index;
38
+ }
39
+ /**
40
+ * The collector key for this qualifier.
41
+ */
42
+ get key() {
43
+ return this._collectible.key;
44
+ }
45
+ /**
46
+ * Constructs a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the
47
+ * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.
48
+ * @param name - The name of the qualifier.
49
+ * @param type - The {@link QualifierTypes.QualifierType | type} of the qualifier.
50
+ * @param defaultPriority - The default {@link ConditionPriority | priority} of conditions
51
+ * @public
52
+ */
53
+ constructor({ name, token, type, defaultPriority, tokenIsOptional, index }) {
54
+ this.name = name;
55
+ this.token = token;
56
+ this.type = type;
57
+ this.defaultPriority = defaultPriority;
58
+ this.tokenIsOptional = tokenIsOptional;
59
+ this._collectible = new ts_utils_1.Collections.Collectible({
60
+ key: name,
61
+ index,
62
+ indexConverter: common_1.Convert.qualifierIndex
63
+ });
64
+ }
65
+ /**
66
+ * Creates a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the
67
+ * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.
68
+ * @param decl - The {@link Qualifiers.IValidatedQualifierDecl | validated declaration}
69
+ * for the new instance.
70
+ * @returns `Success` with the new {@link Qualifiers.Qualifier | Qualifier} if successful,
71
+ * `Failure` with an error message otherwise.
72
+ * @public
73
+ */
74
+ static create(decl) {
75
+ return (0, ts_utils_1.captureResult)(() => new Qualifier(decl));
76
+ }
77
+ /**
78
+ * Sets the index of this qualifier. Once set, the index cannot be changed.
79
+ * @param index - The index to set.
80
+ * @returns `Success` with the index if successful, `Failure` with an error message otherwise.
81
+ */
82
+ setIndex(index) {
83
+ return this._collectible.setIndex(index);
84
+ }
85
+ }
86
+ exports.Qualifier = Qualifier;
87
+ //# sourceMappingURL=qualifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifier.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifier.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAiF;AACjF,sCAAuG;AAIvG;;;;GAIG;AACH,MAAa,SAAS;IAsBpB;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;IAC/B,CAAC;IAUD;;;;;;;OAOG;IACH,YAAsB,EACpB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,eAAe,EACf,eAAe,EACf,KAAK,EACmB;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,IAAI,sBAAW,CAAC,WAAW,CAAgC;YAC7E,GAAG,EAAE,IAAI;YACT,KAAK;YACL,cAAc,EAAE,gBAAa,CAAC,cAAc;SAC7C,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,MAAM,CAAC,IAA6B;QAChD,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACI,QAAQ,CAAC,KAAqB;QACnC,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;CACF;AA7FD,8BA6FC","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, Collections, ICollectible, Result } from '@fgv/ts-utils';\nimport { ConditionPriority, QualifierIndex, QualifierName, Convert as CommonConvert } from '../common';\nimport { QualifierType } from '../qualifier-types';\nimport { IValidatedQualifierDecl } from './qualifierDecl';\n\n/**\n * Represents a qualifier that can be used to identify the context in\n * which a resource is used.\n * @public\n */\nexport class Qualifier implements IValidatedQualifierDecl, ICollectible<QualifierName, QualifierIndex> {\n /**\n * The name of the qualifier.\n */\n public readonly name: QualifierName;\n\n /**\n * The token used to identify the qualifier in the name or\n * path of a resource being imported.\n */\n public readonly token: QualifierName;\n\n /**\n * The {@link QualifierTypes.QualifierType | type} of the qualifier.\n */\n public readonly type: QualifierType;\n\n /**\n * Indicates whether the token is optional in the name or path of a resource being imported.\n */\n public readonly tokenIsOptional: boolean;\n\n /**\n * The index of the qualifier.\n */\n public get index(): QualifierIndex | undefined {\n return this._collectible.index;\n }\n\n /**\n * The collector key for this qualifier.\n */\n public get key(): QualifierName {\n return this._collectible.key;\n }\n\n /**\n * The default {@link ConditionPriority | priority} of conditions\n * that depend on this qualifier.\n */\n public readonly defaultPriority: ConditionPriority;\n\n protected readonly _collectible: Collections.Collectible<QualifierName, QualifierIndex>;\n\n /**\n * Constructs a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the\n * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.\n * @param name - The name of the qualifier.\n * @param type - The {@link QualifierTypes.QualifierType | type} of the qualifier.\n * @param defaultPriority - The default {@link ConditionPriority | priority} of conditions\n * @public\n */\n protected constructor({\n name,\n token,\n type,\n defaultPriority,\n tokenIsOptional,\n index\n }: IValidatedQualifierDecl) {\n this.name = name;\n this.token = token;\n this.type = type;\n this.defaultPriority = defaultPriority;\n this.tokenIsOptional = tokenIsOptional;\n this._collectible = new Collections.Collectible<QualifierName, QualifierIndex>({\n key: name,\n index,\n indexConverter: CommonConvert.qualifierIndex\n });\n }\n\n /**\n * Creates a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the\n * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.\n * @param decl - The {@link Qualifiers.IValidatedQualifierDecl | validated declaration}\n * for the new instance.\n * @returns `Success` with the new {@link Qualifiers.Qualifier | Qualifier} if successful,\n * `Failure` with an error message otherwise.\n * @public\n */\n public static create(decl: IValidatedQualifierDecl): Result<Qualifier> {\n return captureResult(() => new Qualifier(decl));\n }\n\n /**\n * Sets the index of this qualifier. Once set, the index cannot be changed.\n * @param index - The index to set.\n * @returns `Success` with the index if successful, `Failure` with an error message otherwise.\n */\n public setIndex(index: QualifierIndex): Result<QualifierIndex> {\n return this._collectible.setIndex(index);\n }\n}\n"]}
@@ -0,0 +1,90 @@
1
+ import { Collections, Result, ValidatingConvertingCollector } from '@fgv/ts-utils';
2
+ import { IQualifierDecl } from './qualifierDecl';
3
+ import { QualifierName } from '../common';
4
+ import { Qualifier } from './qualifier';
5
+ import { ReadOnlyQualifierTypeCollector } from '../qualifier-types';
6
+ /**
7
+ * Readonly version of {@link Qualifiers.QualifierCollector | QualifierCollector}.
8
+ * @public
9
+ */
10
+ export interface IReadOnlyQualifierCollector extends Collections.IReadOnlyValidatingCollector<Qualifier> {
11
+ /**
12
+ * {@inheritdoc Qualifiers.QualifierCollector.qualifierTypes}
13
+ */
14
+ readonly qualifierTypes: ReadOnlyQualifierTypeCollector;
15
+ /**
16
+ * Gets a {@link Qualifiers.Qualifier | qualifier} by name or token.
17
+ * @param nameOrToken - The name or token of the qualifier to retrieve.
18
+ * @returns `Success` with the qualifier if found, or `Failure` if not.
19
+ */
20
+ getByNameOrToken(nameOrToken: string): Result<Qualifier>;
21
+ /**
22
+ * Checks if a qualifier with a given name or token is in the collection.
23
+ * @param nameOrToken - The name or token of the qualifier to check.
24
+ * @returns `true` if the qualifier is in the collection, `false` if not.
25
+ */
26
+ hasNameOrToken(nameOrToken: string): boolean;
27
+ }
28
+ /**
29
+ * Parameters for creating a new {@link Qualifiers.QualifierCollector}.
30
+ * @public
31
+ */
32
+ export interface IQualifierCollectorCreateParams {
33
+ /**
34
+ * The {@link QualifierTypes.QualifierTypeCollector | qualifier types} used to
35
+ * create {@link Qualifiers.Qualifier | qualifiers} from {@link Qualifiers.IQualifierDecl | declarations}.
36
+ */
37
+ qualifierTypes: ReadOnlyQualifierTypeCollector;
38
+ /**
39
+ * Optional list of {@link Qualifiers.IQualifierDecl | declarations} for the qualifiers to add to the collection
40
+ * upon creation.
41
+ */
42
+ qualifiers?: IQualifierDecl[];
43
+ }
44
+ /**
45
+ * Collects {@link Qualifiers.Qualifier | Qualifiers} from {@link Qualifiers.IQualifierDecl | declarations},
46
+ * with strongly-typed ({@link QualifierName | QualifierName} and {@link QualifierIndex | QualifierIndex}) key
47
+ * and index.
48
+ * @public
49
+ */
50
+ export declare class QualifierCollector extends ValidatingConvertingCollector<Qualifier, IQualifierDecl> implements IReadOnlyQualifierCollector {
51
+ /**
52
+ * The {@link QualifierTypes.QualifierTypeCollector | qualifier types} that this collector uses.
53
+ */
54
+ qualifierTypes: ReadOnlyQualifierTypeCollector;
55
+ /**
56
+ * Constructor for a {@link Qualifiers.QualifierCollector | QualifierCollector} object.
57
+ * @param params - Parameters for creating the collector.
58
+ * @public
59
+ */
60
+ protected constructor(params: IQualifierCollectorCreateParams);
61
+ /**
62
+ * Creates a new {@link Qualifiers.QualifierCollector | QualifierCollector} object.
63
+ * @param params - {@link Qualifiers.IQualifierCollectorCreateParams | Parameters} for creating a new {@link Qualifiers.QualifierCollector | QualifierCollector}.
64
+ * @returns `Success` with the new collector if successful, or `Failure` if not.
65
+ */
66
+ static create(params: IQualifierCollectorCreateParams): Result<QualifierCollector>;
67
+ /**
68
+ * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}
69
+ */
70
+ getByNameOrToken(nameOrToken: string): Result<Qualifier>;
71
+ /**
72
+ * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}
73
+ */
74
+ hasNameOrToken(nameOrToken: string): boolean;
75
+ /**
76
+ * Gets a read-only view of this collector.
77
+ * @returns A read-only view of this collector.
78
+ */
79
+ toReadOnly(): IReadOnlyQualifierCollector;
80
+ /**
81
+ * Factory method for creating a {@link Qualifiers.Qualifier | Qualifier} from a {@link Qualifiers.IQualifierDecl | declaration}.
82
+ * @param __key - The key for the qualifier.
83
+ * @param index - The index of the qualifier.
84
+ * @param decl - The {@link Qualifiers.IQualifierDecl | declaration} for the qualifier.
85
+ * @returns `Success` with the new {@link Qualifiers.Qualifier | Qualifier} if successful, or `Failure` if not.
86
+ * @public
87
+ */
88
+ protected _qualifierFactory(__key: QualifierName, index: number, decl: IQualifierDecl): Result<Qualifier>;
89
+ }
90
+ //# sourceMappingURL=qualifierCollector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifierCollector.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierCollector.ts"],"names":[],"mappings":"AAuBA,OAAO,EAEL,WAAW,EAEX,MAAM,EAIN,6BAA6B,EAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAA2B,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,WAAW,CAAC,4BAA4B,CAAC,SAAS,CAAC;IACtG;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,8BAA8B,CAAC;IAExD;;;;OAIG;IACH,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAEzD;;;;OAIG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9C;AAED;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;OAGG;IACH,cAAc,EAAE,8BAA8B,CAAC;IAE/C;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;CAC/B;AAED;;;;;GAKG;AACH,qBAAa,kBACX,SAAQ,6BAA6B,CAAC,SAAS,EAAE,cAAc,CAC/D,YAAW,2BAA2B;IAEtC;;OAEG;IACI,cAAc,EAAE,8BAA8B,CAAC;IAEtD;;;;OAIG;IACH,SAAS,aAAa,MAAM,EAAE,+BAA+B;IAa7D;;;;OAIG;WACW,MAAM,CAAC,MAAM,EAAE,+BAA+B,GAAG,MAAM,CAAC,kBAAkB,CAAC;IAIzF;;OAEG;IACI,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;IAW/D;;OAEG;IACI,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAYnD;;;OAGG;IACI,UAAU,IAAI,2BAA2B;IAIhD;;;;;;;OAOG;IACH,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC;CAqB1G"}
@@ -0,0 +1,157 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.QualifierCollector = void 0;
58
+ const Common = __importStar(require("../common"));
59
+ const ts_utils_1 = require("@fgv/ts-utils");
60
+ const qualifier_1 = require("./qualifier");
61
+ const convert_1 = require("./convert");
62
+ /**
63
+ * Collects {@link Qualifiers.Qualifier | Qualifiers} from {@link Qualifiers.IQualifierDecl | declarations},
64
+ * with strongly-typed ({@link QualifierName | QualifierName} and {@link QualifierIndex | QualifierIndex}) key
65
+ * and index.
66
+ * @public
67
+ */
68
+ class QualifierCollector extends ts_utils_1.ValidatingConvertingCollector {
69
+ /**
70
+ * Constructor for a {@link Qualifiers.QualifierCollector | QualifierCollector} object.
71
+ * @param params - Parameters for creating the collector.
72
+ * @public
73
+ */
74
+ constructor(params) {
75
+ var _a;
76
+ super({
77
+ factory: (k, i, v) => this._qualifierFactory(k, i, v),
78
+ converters: new ts_utils_1.Collections.KeyValueConverters({
79
+ key: Common.Convert.qualifierName,
80
+ value: convert_1.qualifierDecl
81
+ })
82
+ });
83
+ this.qualifierTypes = params.qualifierTypes;
84
+ /* c8 ignore next 1 - coverage misses the branch intermittently */
85
+ (_a = params.qualifiers) === null || _a === void 0 ? void 0 : _a.forEach((q) => this.validating.add(q.name, q).orThrow());
86
+ }
87
+ /**
88
+ * Creates a new {@link Qualifiers.QualifierCollector | QualifierCollector} object.
89
+ * @param params - {@link Qualifiers.IQualifierCollectorCreateParams | Parameters} for creating a new {@link Qualifiers.QualifierCollector | QualifierCollector}.
90
+ * @returns `Success` with the new collector if successful, or `Failure` if not.
91
+ */
92
+ static create(params) {
93
+ return (0, ts_utils_1.captureResult)(() => new QualifierCollector(params));
94
+ }
95
+ /**
96
+ * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}
97
+ */
98
+ getByNameOrToken(nameOrToken) {
99
+ return this.validating.get(nameOrToken).onFailure((message) => {
100
+ for (const q of this.values()) {
101
+ if (q.token === nameOrToken) {
102
+ return (0, ts_utils_1.succeedWithDetail)(q, 'success');
103
+ }
104
+ }
105
+ return (0, ts_utils_1.failWithDetail)(`Qualifier token '${nameOrToken}' not found`, 'not-found');
106
+ });
107
+ }
108
+ /**
109
+ * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}
110
+ */
111
+ hasNameOrToken(nameOrToken) {
112
+ if (this.validating.has(nameOrToken)) {
113
+ return true;
114
+ }
115
+ for (const q of this.values()) {
116
+ if (q.token === nameOrToken) {
117
+ return true;
118
+ }
119
+ }
120
+ return false;
121
+ }
122
+ /**
123
+ * Gets a read-only view of this collector.
124
+ * @returns A read-only view of this collector.
125
+ */
126
+ toReadOnly() {
127
+ return this;
128
+ }
129
+ /**
130
+ * Factory method for creating a {@link Qualifiers.Qualifier | Qualifier} from a {@link Qualifiers.IQualifierDecl | declaration}.
131
+ * @param __key - The key for the qualifier.
132
+ * @param index - The index of the qualifier.
133
+ * @param decl - The {@link Qualifiers.IQualifierDecl | declaration} for the qualifier.
134
+ * @returns `Success` with the new {@link Qualifiers.Qualifier | Qualifier} if successful, or `Failure` if not.
135
+ * @public
136
+ */
137
+ _qualifierFactory(__key, index, decl) {
138
+ const convertContext = {
139
+ qualifierTypes: this.qualifierTypes,
140
+ qualifierIndex: index
141
+ };
142
+ return convert_1.validatedQualifierDecl
143
+ .convert(decl, convertContext)
144
+ .onSuccess((validated) => {
145
+ if (this.hasNameOrToken(validated.token)) {
146
+ return (0, ts_utils_1.fail)(`Qualifier token '${validated.token}' is not unique or collides with name`);
147
+ }
148
+ else if (this.hasNameOrToken(validated.name)) {
149
+ return (0, ts_utils_1.fail)(`Qualifier name '${validated.name}' is not unique or collides with token`);
150
+ }
151
+ return (0, ts_utils_1.succeed)(validated);
152
+ })
153
+ .onSuccess(qualifier_1.Qualifier.create);
154
+ }
155
+ }
156
+ exports.QualifierCollector = QualifierCollector;
157
+ //# sourceMappingURL=qualifierCollector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifierCollector.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierCollector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAAoC;AACpC,4CASuB;AAGvB,2CAAwC;AACxC,uCAAgG;AA8ChG;;;;;GAKG;AACH,MAAa,kBACX,SAAQ,wCAAwD;IAQhE;;;;OAIG;IACH,YAAsB,MAAuC;;QAC3D,KAAK,CAAC;YACJ,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACrD,UAAU,EAAE,IAAI,sBAAW,CAAC,kBAAkB,CAAC;gBAC7C,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa;gBACjC,KAAK,EAAE,uBAAa;aACrB,CAAC;SACH,CAAC,CAAC;QACH,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,kEAAkE;QAClE,MAAA,MAAM,CAAC,UAAU,0CAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,MAAM,CAAC,MAAuC;QAC1D,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAC,WAAmB;QACzC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5D,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC9B,IAAI,CAAC,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;oBAC5B,OAAO,IAAA,4BAAiB,EAAC,CAAC,EAAE,SAAS,CAAC,CAAC;gBACzC,CAAC;YACH,CAAC;YACD,OAAO,IAAA,yBAAc,EAAC,oBAAoB,WAAW,aAAa,EAAE,WAAW,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,WAAmB;QACvC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YAC9B,IAAI,CAAC,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;gBAC5B,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;OAGG;IACI,UAAU;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACO,iBAAiB,CAAC,KAAoB,EAAE,KAAa,EAAE,IAAoB;QACnF,MAAM,cAAc,GAAiC;YACnD,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,cAAc,EAAE,KAAK;SACtB,CAAC;QACF,OAAO,gCAAsB;aAC1B,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC;aAC7B,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE;YACvB,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzC,OAAO,IAAA,eAAI,EACT,oBAAoB,SAAS,CAAC,KAAK,uCAAuC,CAC3E,CAAC;YACJ,CAAC;iBAAM,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/C,OAAO,IAAA,eAAI,EACT,mBAAmB,SAAS,CAAC,IAAI,wCAAwC,CAC1E,CAAC;YACJ,CAAC;YACD,OAAO,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,CAAC;aACD,SAAS,CAAC,qBAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;CACF;AAtGD,gDAsGC","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 Common from '../common';\nimport {\n captureResult,\n Collections,\n failWithDetail,\n Result,\n fail,\n succeed,\n succeedWithDetail,\n ValidatingConvertingCollector\n} from '@fgv/ts-utils';\nimport { IQualifierDecl, IValidatedQualifierDecl } from './qualifierDecl';\nimport { QualifierName } from '../common';\nimport { Qualifier } from './qualifier';\nimport { IQualifierDeclConvertContext, qualifierDecl, validatedQualifierDecl } from './convert';\nimport { ReadOnlyQualifierTypeCollector } from '../qualifier-types';\n\n/**\n * Readonly version of {@link Qualifiers.QualifierCollector | QualifierCollector}.\n * @public\n */\nexport interface IReadOnlyQualifierCollector extends Collections.IReadOnlyValidatingCollector<Qualifier> {\n /**\n * {@inheritdoc Qualifiers.QualifierCollector.qualifierTypes}\n */\n readonly qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * Gets a {@link Qualifiers.Qualifier | qualifier} by name or token.\n * @param nameOrToken - The name or token of the qualifier to retrieve.\n * @returns `Success` with the qualifier if found, or `Failure` if not.\n */\n getByNameOrToken(nameOrToken: string): Result<Qualifier>;\n\n /**\n * Checks if a qualifier with a given name or token is in the collection.\n * @param nameOrToken - The name or token of the qualifier to check.\n * @returns `true` if the qualifier is in the collection, `false` if not.\n */\n hasNameOrToken(nameOrToken: string): boolean;\n}\n\n/**\n * Parameters for creating a new {@link Qualifiers.QualifierCollector}.\n * @public\n */\nexport interface IQualifierCollectorCreateParams {\n /**\n * The {@link QualifierTypes.QualifierTypeCollector | qualifier types} used to\n * create {@link Qualifiers.Qualifier | qualifiers} from {@link Qualifiers.IQualifierDecl | declarations}.\n */\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * Optional list of {@link Qualifiers.IQualifierDecl | declarations} for the qualifiers to add to the collection\n * upon creation.\n */\n qualifiers?: IQualifierDecl[];\n}\n\n/**\n * Collects {@link Qualifiers.Qualifier | Qualifiers} from {@link Qualifiers.IQualifierDecl | declarations},\n * with strongly-typed ({@link QualifierName | QualifierName} and {@link QualifierIndex | QualifierIndex}) key\n * and index.\n * @public\n */\nexport class QualifierCollector\n extends ValidatingConvertingCollector<Qualifier, IQualifierDecl>\n implements IReadOnlyQualifierCollector\n{\n /**\n * The {@link QualifierTypes.QualifierTypeCollector | qualifier types} that this collector uses.\n */\n public qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * Constructor for a {@link Qualifiers.QualifierCollector | QualifierCollector} object.\n * @param params - Parameters for creating the collector.\n * @public\n */\n protected constructor(params: IQualifierCollectorCreateParams) {\n super({\n factory: (k, i, v) => this._qualifierFactory(k, i, v),\n converters: new Collections.KeyValueConverters({\n key: Common.Convert.qualifierName,\n value: qualifierDecl\n })\n });\n this.qualifierTypes = params.qualifierTypes;\n /* c8 ignore next 1 - coverage misses the branch intermittently */\n params.qualifiers?.forEach((q) => this.validating.add(q.name, q).orThrow());\n }\n\n /**\n * Creates a new {@link Qualifiers.QualifierCollector | QualifierCollector} object.\n * @param params - {@link Qualifiers.IQualifierCollectorCreateParams | Parameters} for creating a new {@link Qualifiers.QualifierCollector | QualifierCollector}.\n * @returns `Success` with the new collector if successful, or `Failure` if not.\n */\n public static create(params: IQualifierCollectorCreateParams): Result<QualifierCollector> {\n return captureResult(() => new QualifierCollector(params));\n }\n\n /**\n * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}\n */\n public getByNameOrToken(nameOrToken: string): Result<Qualifier> {\n return this.validating.get(nameOrToken).onFailure((message) => {\n for (const q of this.values()) {\n if (q.token === nameOrToken) {\n return succeedWithDetail(q, 'success');\n }\n }\n return failWithDetail(`Qualifier token '${nameOrToken}' not found`, 'not-found');\n });\n }\n\n /**\n * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}\n */\n public hasNameOrToken(nameOrToken: string): boolean {\n if (this.validating.has(nameOrToken)) {\n return true;\n }\n for (const q of this.values()) {\n if (q.token === nameOrToken) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets a read-only view of this collector.\n * @returns A read-only view of this collector.\n */\n public toReadOnly(): IReadOnlyQualifierCollector {\n return this;\n }\n\n /**\n * Factory method for creating a {@link Qualifiers.Qualifier | Qualifier} from a {@link Qualifiers.IQualifierDecl | declaration}.\n * @param __key - The key for the qualifier.\n * @param index - The index of the qualifier.\n * @param decl - The {@link Qualifiers.IQualifierDecl | declaration} for the qualifier.\n * @returns `Success` with the new {@link Qualifiers.Qualifier | Qualifier} if successful, or `Failure` if not.\n * @public\n */\n protected _qualifierFactory(__key: QualifierName, index: number, decl: IQualifierDecl): Result<Qualifier> {\n const convertContext: IQualifierDeclConvertContext = {\n qualifierTypes: this.qualifierTypes,\n qualifierIndex: index\n };\n return validatedQualifierDecl\n .convert(decl, convertContext)\n .onSuccess((validated) => {\n if (this.hasNameOrToken(validated.token)) {\n return fail<IValidatedQualifierDecl>(\n `Qualifier token '${validated.token}' is not unique or collides with name`\n );\n } else if (this.hasNameOrToken(validated.name)) {\n return fail<IValidatedQualifierDecl>(\n `Qualifier name '${validated.name}' is not unique or collides with token`\n );\n }\n return succeed(validated);\n })\n .onSuccess(Qualifier.create);\n }\n}\n"]}
@@ -0,0 +1,46 @@
1
+ import { ConditionPriority, QualifierIndex, QualifierName } from '../common';
2
+ import { QualifierType } from '../qualifier-types';
3
+ /**
4
+ * Simple declaration for a {@link Qualifiers.Qualifier | Qualifier}.
5
+ * @public
6
+ */
7
+ export interface IQualifierDecl {
8
+ name: string;
9
+ typeName: string;
10
+ defaultPriority: number;
11
+ token?: string;
12
+ tokenIsOptional?: boolean;
13
+ }
14
+ /**
15
+ * Validated declaration for a {@link Qualifiers.Qualifier | Qualifier}.
16
+ * @public
17
+ */
18
+ export interface IValidatedQualifierDecl {
19
+ /**
20
+ * The name of the qualifier.
21
+ */
22
+ name: QualifierName;
23
+ /**
24
+ * The token used to identify the qualifier in the name or
25
+ * path of a resource being imported.
26
+ */
27
+ token: QualifierName;
28
+ /**
29
+ * The {@link QualifierTypes.QualifierType | type} of the qualifier.
30
+ */
31
+ type: QualifierType;
32
+ /**
33
+ * The default {@link ConditionPriority | priority} of conditions
34
+ * that depend on this qualifier.
35
+ */
36
+ defaultPriority: ConditionPriority;
37
+ /**
38
+ * Indicates whether the token is optional when parsing a resource token.
39
+ */
40
+ tokenIsOptional: boolean;
41
+ /**
42
+ * Index of the qualifier.
43
+ */
44
+ index: QualifierIndex | undefined;
45
+ }
46
+ //# sourceMappingURL=qualifierDecl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifierDecl.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDecl.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,IAAI,EAAE,aAAa,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,aAAa,CAAC;IAErB;;OAEG;IACH,IAAI,EAAE,aAAa,CAAC;IAEpB;;;OAGG;IACH,eAAe,EAAE,iBAAiB,CAAC;IAEnC;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,KAAK,EAAE,cAAc,GAAG,SAAS,CAAC;CACnC"}
@@ -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=qualifierDecl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifierDecl.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDecl.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 { ConditionPriority, QualifierIndex, QualifierName } from '../common';\nimport { QualifierType } from '../qualifier-types';\n\n/**\n * Simple declaration for a {@link Qualifiers.Qualifier | Qualifier}.\n * @public\n */\nexport interface IQualifierDecl {\n name: string;\n typeName: string;\n defaultPriority: number;\n token?: string;\n tokenIsOptional?: boolean;\n}\n\n/**\n * Validated declaration for a {@link Qualifiers.Qualifier | Qualifier}.\n * @public\n */\nexport interface IValidatedQualifierDecl {\n /**\n * The name of the qualifier.\n */\n name: QualifierName;\n\n /**\n * The token used to identify the qualifier in the name or\n * path of a resource being imported.\n */\n token: QualifierName;\n\n /**\n * The {@link QualifierTypes.QualifierType | type} of the qualifier.\n */\n type: QualifierType;\n\n /**\n * The default {@link ConditionPriority | priority} of conditions\n * that depend on this qualifier.\n */\n defaultPriority: ConditionPriority;\n\n /**\n * Indicates whether the token is optional when parsing a resource token.\n */\n tokenIsOptional: boolean;\n\n /**\n * Index of the qualifier.\n */\n index: QualifierIndex | undefined;\n}\n"]}