@fgv/ts-res 5.0.0-9 → 5.0.1-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 (382) hide show
  1. package/CHANGELOG.json +21 -0
  2. package/CHANGELOG.md +14 -1
  3. package/README.md +794 -137
  4. package/dist/ts-res.d.ts +2054 -276
  5. package/dist/tsdoc-metadata.json +1 -1
  6. package/eslint.config.js +16 -0
  7. package/lib/index.d.ts +2 -1
  8. package/lib/index.js +3 -1
  9. package/lib/packlets/bundle/bundleBuilder.js +7 -4
  10. package/lib/packlets/bundle/bundleLoader.js +1 -0
  11. package/lib/packlets/bundle/bundleUtils.js +14 -16
  12. package/lib/packlets/bundle/index.d.ts +3 -1
  13. package/lib/packlets/bundle/index.js +14 -3
  14. package/lib/packlets/common/convert.d.ts +15 -0
  15. package/lib/packlets/common/convert.js +16 -1
  16. package/lib/packlets/common/helpers/context.js +1 -0
  17. package/lib/packlets/common/helpers/resources.d.ts +7 -0
  18. package/lib/packlets/common/helpers/resources.js +13 -0
  19. package/lib/packlets/common/resources.d.ts +40 -1
  20. package/lib/packlets/common/validate/conditions.d.ts +17 -1
  21. package/lib/packlets/common/validate/conditions.js +32 -6
  22. package/lib/packlets/common/validate/regularExpressions.d.ts +4 -0
  23. package/lib/packlets/common/validate/regularExpressions.js +5 -1
  24. package/lib/packlets/common/validate/resources.d.ts +35 -1
  25. package/lib/packlets/common/validate/resources.js +55 -0
  26. package/lib/packlets/conditions/condition.js +1 -0
  27. package/lib/packlets/conditions/conditionSet.d.ts +9 -0
  28. package/lib/packlets/conditions/conditionSet.js +75 -1
  29. package/lib/packlets/config/configInitFactory.d.ts +217 -0
  30. package/lib/packlets/config/configInitFactory.js +302 -0
  31. package/lib/packlets/config/convert.d.ts +9 -0
  32. package/lib/packlets/config/convert.js +12 -1
  33. package/lib/packlets/config/index.d.ts +1 -0
  34. package/lib/packlets/config/index.js +1 -0
  35. package/lib/packlets/config/json.d.ts +1 -1
  36. package/lib/packlets/config/systemConfiguration.d.ts +16 -3
  37. package/lib/packlets/config/systemConfiguration.js +19 -40
  38. package/lib/packlets/import/fsItem.d.ts +2 -1
  39. package/lib/packlets/import/fsItem.js +9 -13
  40. package/lib/packlets/import/importManager.d.ts +2 -1
  41. package/lib/packlets/import/importers/jsonImporter.js +1 -0
  42. package/lib/packlets/import/importers/pathImporter.d.ts +2 -1
  43. package/lib/packlets/import/importers/pathImporter.js +2 -1
  44. package/lib/packlets/qualifier-types/config/convert.d.ts +22 -1
  45. package/lib/packlets/qualifier-types/config/convert.js +67 -2
  46. package/lib/packlets/qualifier-types/config/json.d.ts +24 -2
  47. package/lib/packlets/qualifier-types/config/json.js +11 -0
  48. package/lib/packlets/qualifier-types/convert.d.ts +1 -1
  49. package/lib/packlets/qualifier-types/helpers.d.ts +14 -5
  50. package/lib/packlets/qualifier-types/helpers.js +2 -2
  51. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +28 -2
  52. package/lib/packlets/qualifier-types/languageQualifierType.js +73 -0
  53. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +31 -5
  54. package/lib/packlets/qualifier-types/literalQualifierType.js +75 -0
  55. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +7 -11
  56. package/lib/packlets/qualifier-types/literalValueHierarchy.js +12 -1
  57. package/lib/packlets/qualifier-types/qualifierType.d.ts +31 -2
  58. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +31 -5
  59. package/lib/packlets/qualifier-types/territoryQualifierType.js +80 -0
  60. package/lib/packlets/qualifiers/qualifierCollector.js +1 -2
  61. package/lib/packlets/resource-json/compiled/convert.js +2 -1
  62. package/lib/packlets/resource-json/compiled/json.d.ts +6 -2
  63. package/lib/packlets/resource-types/config/convert.d.ts +1 -1
  64. package/lib/packlets/resource-types/config/convert.js +3 -1
  65. package/lib/packlets/resource-types/config/json.d.ts +3 -1
  66. package/lib/packlets/resource-types/jsonResourceType.d.ts +10 -1
  67. package/lib/packlets/resource-types/jsonResourceType.js +7 -3
  68. package/lib/packlets/resource-types/resourceType.d.ts +100 -8
  69. package/lib/packlets/resource-types/resourceType.js +39 -3
  70. package/lib/packlets/resources/candidateReducer.js +3 -0
  71. package/lib/packlets/resources/candidateValue.d.ts +92 -0
  72. package/lib/packlets/resources/candidateValue.js +128 -0
  73. package/lib/packlets/resources/candidateValueCollector.d.ts +55 -0
  74. package/lib/packlets/resources/candidateValueCollector.js +96 -0
  75. package/lib/packlets/resources/common.d.ts +14 -0
  76. package/lib/packlets/resources/index.d.ts +2 -0
  77. package/lib/packlets/resources/index.js +2 -0
  78. package/lib/packlets/resources/resource.d.ts +6 -6
  79. package/lib/packlets/resources/resource.js +5 -10
  80. package/lib/packlets/resources/resourceBuilder.d.ts +6 -0
  81. package/lib/packlets/resources/resourceBuilder.js +4 -1
  82. package/lib/packlets/resources/resourceCandidate.d.ts +15 -2
  83. package/lib/packlets/resources/resourceCandidate.js +17 -5
  84. package/lib/packlets/resources/resourceManagerBuilder.d.ts +127 -10
  85. package/lib/packlets/resources/resourceManagerBuilder.js +283 -45
  86. package/lib/packlets/runtime/compiledResourceCollection.d.ts +23 -11
  87. package/lib/packlets/runtime/compiledResourceCollection.js +65 -28
  88. package/lib/packlets/runtime/conditionSetResolutionResult.js +3 -0
  89. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +53 -3
  90. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +82 -37
  91. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +49 -77
  92. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +23 -2
  93. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +53 -31
  94. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +4 -4
  95. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +2 -2
  96. package/lib/packlets/runtime/iResourceManager.d.ts +13 -5
  97. package/lib/packlets/runtime/index.d.ts +1 -0
  98. package/lib/packlets/runtime/index.js +1 -0
  99. package/lib/packlets/runtime/resource-tree/common.d.ts +1 -1
  100. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +7 -7
  101. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +5 -5
  102. package/lib/packlets/runtime/resourceResolver.d.ts +39 -1
  103. package/lib/packlets/runtime/resourceResolver.js +50 -28
  104. package/lib/packlets/runtime/resourceTreeResolver.d.ts +152 -0
  105. package/lib/packlets/runtime/resourceTreeResolver.js +222 -0
  106. package/lib/packlets/runtime/validate.js +1 -0
  107. package/lib/packlets/zip-archive/convert.d.ts +52 -0
  108. package/lib/packlets/zip-archive/convert.js +103 -0
  109. package/lib/packlets/zip-archive/index.d.ts +23 -0
  110. package/lib/packlets/zip-archive/index.js +95 -0
  111. package/lib/packlets/zip-archive/json.d.ts +64 -0
  112. package/lib/packlets/zip-archive/json.js +24 -0
  113. package/lib/packlets/zip-archive/types.d.ts +98 -0
  114. package/lib/packlets/zip-archive/types.js +39 -0
  115. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts +35 -0
  116. package/lib/packlets/zip-archive/zipArchiveCreator.js +195 -0
  117. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts +70 -0
  118. package/lib/packlets/zip-archive/zipArchiveFormat.js +184 -0
  119. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts +70 -0
  120. package/lib/packlets/zip-archive/zipArchiveLoader.js +286 -0
  121. package/package.json +26 -32
  122. package/CLAUDE.md +0 -186
  123. package/EXAMPLE_INIT_PARAMS.md +0 -88
  124. package/PROGRESS_SUMMARY.md +0 -48
  125. package/lib/index.d.ts.map +0 -1
  126. package/lib/index.js.map +0 -1
  127. package/lib/packlets/bundle/bundleBuilder.d.ts.map +0 -1
  128. package/lib/packlets/bundle/bundleBuilder.js.map +0 -1
  129. package/lib/packlets/bundle/bundleLoader.d.ts.map +0 -1
  130. package/lib/packlets/bundle/bundleLoader.js.map +0 -1
  131. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +0 -1
  132. package/lib/packlets/bundle/bundleNormalizer.js.map +0 -1
  133. package/lib/packlets/bundle/bundleUtils.d.ts.map +0 -1
  134. package/lib/packlets/bundle/bundleUtils.js.map +0 -1
  135. package/lib/packlets/bundle/convert.d.ts.map +0 -1
  136. package/lib/packlets/bundle/convert.js.map +0 -1
  137. package/lib/packlets/bundle/index.d.ts.map +0 -1
  138. package/lib/packlets/bundle/index.js.map +0 -1
  139. package/lib/packlets/bundle/model.d.ts.map +0 -1
  140. package/lib/packlets/bundle/model.js.map +0 -1
  141. package/lib/packlets/common/conditions.d.ts.map +0 -1
  142. package/lib/packlets/common/conditions.js.map +0 -1
  143. package/lib/packlets/common/convert.d.ts.map +0 -1
  144. package/lib/packlets/common/convert.js.map +0 -1
  145. package/lib/packlets/common/helpers/conditions.d.ts.map +0 -1
  146. package/lib/packlets/common/helpers/conditions.js.map +0 -1
  147. package/lib/packlets/common/helpers/context.d.ts.map +0 -1
  148. package/lib/packlets/common/helpers/context.js.map +0 -1
  149. package/lib/packlets/common/helpers/index.d.ts.map +0 -1
  150. package/lib/packlets/common/helpers/index.js.map +0 -1
  151. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +0 -1
  152. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +0 -1
  153. package/lib/packlets/common/helpers/resources.d.ts.map +0 -1
  154. package/lib/packlets/common/helpers/resources.js.map +0 -1
  155. package/lib/packlets/common/index.d.ts.map +0 -1
  156. package/lib/packlets/common/index.js.map +0 -1
  157. package/lib/packlets/common/resources.d.ts.map +0 -1
  158. package/lib/packlets/common/resources.js.map +0 -1
  159. package/lib/packlets/common/validate/conditions.d.ts.map +0 -1
  160. package/lib/packlets/common/validate/conditions.js.map +0 -1
  161. package/lib/packlets/common/validate/index.d.ts.map +0 -1
  162. package/lib/packlets/common/validate/index.js.map +0 -1
  163. package/lib/packlets/common/validate/regularExpressions.d.ts.map +0 -1
  164. package/lib/packlets/common/validate/regularExpressions.js.map +0 -1
  165. package/lib/packlets/common/validate/resources.d.ts.map +0 -1
  166. package/lib/packlets/common/validate/resources.js.map +0 -1
  167. package/lib/packlets/conditions/condition.d.ts.map +0 -1
  168. package/lib/packlets/conditions/condition.js.map +0 -1
  169. package/lib/packlets/conditions/conditionCollector.d.ts.map +0 -1
  170. package/lib/packlets/conditions/conditionCollector.js.map +0 -1
  171. package/lib/packlets/conditions/conditionDecls.d.ts.map +0 -1
  172. package/lib/packlets/conditions/conditionDecls.js.map +0 -1
  173. package/lib/packlets/conditions/conditionSet.d.ts.map +0 -1
  174. package/lib/packlets/conditions/conditionSet.js.map +0 -1
  175. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +0 -1
  176. package/lib/packlets/conditions/conditionSetCollector.js.map +0 -1
  177. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +0 -1
  178. package/lib/packlets/conditions/conditionSetDecls.js.map +0 -1
  179. package/lib/packlets/conditions/conditionToken.d.ts.map +0 -1
  180. package/lib/packlets/conditions/conditionToken.js.map +0 -1
  181. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +0 -1
  182. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +0 -1
  183. package/lib/packlets/conditions/convert/decls.d.ts.map +0 -1
  184. package/lib/packlets/conditions/convert/decls.js.map +0 -1
  185. package/lib/packlets/conditions/convert/index.d.ts.map +0 -1
  186. package/lib/packlets/conditions/convert/index.js.map +0 -1
  187. package/lib/packlets/conditions/index.d.ts.map +0 -1
  188. package/lib/packlets/conditions/index.js.map +0 -1
  189. package/lib/packlets/config/common.d.ts.map +0 -1
  190. package/lib/packlets/config/common.js.map +0 -1
  191. package/lib/packlets/config/convert.d.ts.map +0 -1
  192. package/lib/packlets/config/convert.js.map +0 -1
  193. package/lib/packlets/config/index.d.ts.map +0 -1
  194. package/lib/packlets/config/index.js.map +0 -1
  195. package/lib/packlets/config/json.d.ts.map +0 -1
  196. package/lib/packlets/config/json.js.map +0 -1
  197. package/lib/packlets/config/predefined/default.d.ts.map +0 -1
  198. package/lib/packlets/config/predefined/default.js.map +0 -1
  199. package/lib/packlets/config/predefined/extended.d.ts.map +0 -1
  200. package/lib/packlets/config/predefined/extended.js.map +0 -1
  201. package/lib/packlets/config/predefined/index.d.ts.map +0 -1
  202. package/lib/packlets/config/predefined/index.js.map +0 -1
  203. package/lib/packlets/config/systemConfiguration.d.ts.map +0 -1
  204. package/lib/packlets/config/systemConfiguration.js.map +0 -1
  205. package/lib/packlets/context/contextDecls.d.ts.map +0 -1
  206. package/lib/packlets/context/contextDecls.js.map +0 -1
  207. package/lib/packlets/context/contextToken.d.ts.map +0 -1
  208. package/lib/packlets/context/contextToken.js.map +0 -1
  209. package/lib/packlets/context/convert/decls.d.ts.map +0 -1
  210. package/lib/packlets/context/convert/decls.js.map +0 -1
  211. package/lib/packlets/context/convert/index.d.ts.map +0 -1
  212. package/lib/packlets/context/convert/index.js.map +0 -1
  213. package/lib/packlets/context/index.d.ts.map +0 -1
  214. package/lib/packlets/context/index.js.map +0 -1
  215. package/lib/packlets/decisions/abstractDecision.d.ts.map +0 -1
  216. package/lib/packlets/decisions/abstractDecision.js.map +0 -1
  217. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +0 -1
  218. package/lib/packlets/decisions/abstractDecisionCollector.js.map +0 -1
  219. package/lib/packlets/decisions/candidate.d.ts.map +0 -1
  220. package/lib/packlets/decisions/candidate.js.map +0 -1
  221. package/lib/packlets/decisions/common.d.ts.map +0 -1
  222. package/lib/packlets/decisions/common.js.map +0 -1
  223. package/lib/packlets/decisions/concreteDecision.d.ts.map +0 -1
  224. package/lib/packlets/decisions/concreteDecision.js.map +0 -1
  225. package/lib/packlets/decisions/decision.d.ts.map +0 -1
  226. package/lib/packlets/decisions/decision.js.map +0 -1
  227. package/lib/packlets/decisions/index.d.ts.map +0 -1
  228. package/lib/packlets/decisions/index.js.map +0 -1
  229. package/lib/packlets/import/fsItem.d.ts.map +0 -1
  230. package/lib/packlets/import/fsItem.js.map +0 -1
  231. package/lib/packlets/import/importContext.d.ts.map +0 -1
  232. package/lib/packlets/import/importContext.js.map +0 -1
  233. package/lib/packlets/import/importManager.d.ts.map +0 -1
  234. package/lib/packlets/import/importManager.js.map +0 -1
  235. package/lib/packlets/import/importable.d.ts.map +0 -1
  236. package/lib/packlets/import/importable.js.map +0 -1
  237. package/lib/packlets/import/importers/collectionImporter.d.ts.map +0 -1
  238. package/lib/packlets/import/importers/collectionImporter.js.map +0 -1
  239. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +0 -1
  240. package/lib/packlets/import/importers/fsItemImporter.js.map +0 -1
  241. package/lib/packlets/import/importers/importer.d.ts.map +0 -1
  242. package/lib/packlets/import/importers/importer.js.map +0 -1
  243. package/lib/packlets/import/importers/index.d.ts.map +0 -1
  244. package/lib/packlets/import/importers/index.js.map +0 -1
  245. package/lib/packlets/import/importers/jsonImporter.d.ts.map +0 -1
  246. package/lib/packlets/import/importers/jsonImporter.js.map +0 -1
  247. package/lib/packlets/import/importers/pathImporter.d.ts.map +0 -1
  248. package/lib/packlets/import/importers/pathImporter.js.map +0 -1
  249. package/lib/packlets/import/index.d.ts.map +0 -1
  250. package/lib/packlets/import/index.js.map +0 -1
  251. package/lib/packlets/qualifier-types/config/convert.d.ts.map +0 -1
  252. package/lib/packlets/qualifier-types/config/convert.js.map +0 -1
  253. package/lib/packlets/qualifier-types/config/index.d.ts.map +0 -1
  254. package/lib/packlets/qualifier-types/config/index.js.map +0 -1
  255. package/lib/packlets/qualifier-types/config/json.d.ts.map +0 -1
  256. package/lib/packlets/qualifier-types/config/json.js.map +0 -1
  257. package/lib/packlets/qualifier-types/convert.d.ts.map +0 -1
  258. package/lib/packlets/qualifier-types/convert.js.map +0 -1
  259. package/lib/packlets/qualifier-types/helpers.d.ts.map +0 -1
  260. package/lib/packlets/qualifier-types/helpers.js.map +0 -1
  261. package/lib/packlets/qualifier-types/index.d.ts.map +0 -1
  262. package/lib/packlets/qualifier-types/index.js.map +0 -1
  263. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +0 -1
  264. package/lib/packlets/qualifier-types/languageQualifierType.js.map +0 -1
  265. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +0 -1
  266. package/lib/packlets/qualifier-types/literalQualifierType.js.map +0 -1
  267. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +0 -1
  268. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +0 -1
  269. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +0 -1
  270. package/lib/packlets/qualifier-types/qualifierType.js.map +0 -1
  271. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +0 -1
  272. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +0 -1
  273. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +0 -1
  274. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +0 -1
  275. package/lib/packlets/qualifiers/convert/decls.d.ts.map +0 -1
  276. package/lib/packlets/qualifiers/convert/decls.js.map +0 -1
  277. package/lib/packlets/qualifiers/convert/index.d.ts.map +0 -1
  278. package/lib/packlets/qualifiers/convert/index.js.map +0 -1
  279. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +0 -1
  280. package/lib/packlets/qualifiers/convert/qualifier.js.map +0 -1
  281. package/lib/packlets/qualifiers/index.d.ts.map +0 -1
  282. package/lib/packlets/qualifiers/index.js.map +0 -1
  283. package/lib/packlets/qualifiers/qualifier.d.ts.map +0 -1
  284. package/lib/packlets/qualifiers/qualifier.js.map +0 -1
  285. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +0 -1
  286. package/lib/packlets/qualifiers/qualifierCollector.js.map +0 -1
  287. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +0 -1
  288. package/lib/packlets/qualifiers/qualifierDecl.js.map +0 -1
  289. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +0 -1
  290. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +0 -1
  291. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +0 -1
  292. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +0 -1
  293. package/lib/packlets/resource-json/compiled/common.d.ts.map +0 -1
  294. package/lib/packlets/resource-json/compiled/common.js.map +0 -1
  295. package/lib/packlets/resource-json/compiled/convert.d.ts.map +0 -1
  296. package/lib/packlets/resource-json/compiled/convert.js.map +0 -1
  297. package/lib/packlets/resource-json/compiled/index.d.ts.map +0 -1
  298. package/lib/packlets/resource-json/compiled/index.js.map +0 -1
  299. package/lib/packlets/resource-json/compiled/json.d.ts.map +0 -1
  300. package/lib/packlets/resource-json/compiled/json.js.map +0 -1
  301. package/lib/packlets/resource-json/convert.d.ts.map +0 -1
  302. package/lib/packlets/resource-json/convert.js.map +0 -1
  303. package/lib/packlets/resource-json/helpers.d.ts.map +0 -1
  304. package/lib/packlets/resource-json/helpers.js.map +0 -1
  305. package/lib/packlets/resource-json/index.d.ts.map +0 -1
  306. package/lib/packlets/resource-json/index.js.map +0 -1
  307. package/lib/packlets/resource-json/json.d.ts.map +0 -1
  308. package/lib/packlets/resource-json/json.js.map +0 -1
  309. package/lib/packlets/resource-json/normalized.d.ts.map +0 -1
  310. package/lib/packlets/resource-json/normalized.js.map +0 -1
  311. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +0 -1
  312. package/lib/packlets/resource-json/resourceDeclCollection.js.map +0 -1
  313. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +0 -1
  314. package/lib/packlets/resource-json/resourceDeclContainer.js.map +0 -1
  315. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +0 -1
  316. package/lib/packlets/resource-json/resourceDeclTree.js.map +0 -1
  317. package/lib/packlets/resource-types/config/convert.d.ts.map +0 -1
  318. package/lib/packlets/resource-types/config/convert.js.map +0 -1
  319. package/lib/packlets/resource-types/config/index.d.ts.map +0 -1
  320. package/lib/packlets/resource-types/config/index.js.map +0 -1
  321. package/lib/packlets/resource-types/config/json.d.ts.map +0 -1
  322. package/lib/packlets/resource-types/config/json.js.map +0 -1
  323. package/lib/packlets/resource-types/helpers.d.ts.map +0 -1
  324. package/lib/packlets/resource-types/helpers.js.map +0 -1
  325. package/lib/packlets/resource-types/index.d.ts.map +0 -1
  326. package/lib/packlets/resource-types/index.js.map +0 -1
  327. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +0 -1
  328. package/lib/packlets/resource-types/jsonResourceType.js.map +0 -1
  329. package/lib/packlets/resource-types/resourceType.d.ts.map +0 -1
  330. package/lib/packlets/resource-types/resourceType.js.map +0 -1
  331. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +0 -1
  332. package/lib/packlets/resource-types/resourceTypeCollector.js.map +0 -1
  333. package/lib/packlets/resources/candidateReducer.d.ts.map +0 -1
  334. package/lib/packlets/resources/candidateReducer.js.map +0 -1
  335. package/lib/packlets/resources/common.d.ts.map +0 -1
  336. package/lib/packlets/resources/common.js.map +0 -1
  337. package/lib/packlets/resources/index.d.ts.map +0 -1
  338. package/lib/packlets/resources/index.js.map +0 -1
  339. package/lib/packlets/resources/resource.d.ts.map +0 -1
  340. package/lib/packlets/resources/resource.js.map +0 -1
  341. package/lib/packlets/resources/resourceBuilder.d.ts.map +0 -1
  342. package/lib/packlets/resources/resourceBuilder.js.map +0 -1
  343. package/lib/packlets/resources/resourceCandidate.d.ts.map +0 -1
  344. package/lib/packlets/resources/resourceCandidate.js.map +0 -1
  345. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +0 -1
  346. package/lib/packlets/resources/resourceManagerBuilder.js.map +0 -1
  347. package/lib/packlets/runtime/cacheListener.d.ts.map +0 -1
  348. package/lib/packlets/runtime/cacheListener.js.map +0 -1
  349. package/lib/packlets/runtime/cacheMetrics.d.ts.map +0 -1
  350. package/lib/packlets/runtime/cacheMetrics.js.map +0 -1
  351. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +0 -1
  352. package/lib/packlets/runtime/compiledResourceCollection.js.map +0 -1
  353. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +0 -1
  354. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +0 -1
  355. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +0 -1
  356. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +0 -1
  357. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +0 -1
  358. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +0 -1
  359. package/lib/packlets/runtime/context/index.d.ts.map +0 -1
  360. package/lib/packlets/runtime/context/index.js.map +0 -1
  361. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +0 -1
  362. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +0 -1
  363. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +0 -1
  364. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +0 -1
  365. package/lib/packlets/runtime/iResourceManager.d.ts.map +0 -1
  366. package/lib/packlets/runtime/iResourceManager.js.map +0 -1
  367. package/lib/packlets/runtime/index.d.ts.map +0 -1
  368. package/lib/packlets/runtime/index.js.map +0 -1
  369. package/lib/packlets/runtime/resource-tree/common.d.ts.map +0 -1
  370. package/lib/packlets/runtime/resource-tree/common.js.map +0 -1
  371. package/lib/packlets/runtime/resource-tree/index.d.ts.map +0 -1
  372. package/lib/packlets/runtime/resource-tree/index.js.map +0 -1
  373. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +0 -1
  374. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +0 -1
  375. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +0 -1
  376. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +0 -1
  377. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +0 -1
  378. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +0 -1
  379. package/lib/packlets/runtime/resourceResolver.d.ts.map +0 -1
  380. package/lib/packlets/runtime/resourceResolver.js.map +0 -1
  381. package/lib/packlets/runtime/validate.d.ts.map +0 -1
  382. package/lib/packlets/runtime/validate.js.map +0 -1
package/dist/ts-res.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import { Brand } from '@fgv/ts-utils';
2
2
  import { Collections } from '@fgv/ts-utils';
3
3
  import { Converter } from '@fgv/ts-utils';
4
+ import { Converters } from '@fgv/ts-json-base';
4
5
  import { DetailedResult } from '@fgv/ts-utils';
5
- import { FileTree } from '@fgv/ts-utils';
6
+ import { FileTree } from '@fgv/ts-json-base';
6
7
  import { Hash } from '@fgv/ts-utils';
7
8
  import { ICollectible } from '@fgv/ts-utils';
8
9
  import { IReadOnlyResultMap } from '@fgv/ts-utils';
10
+ import { JsonCompatible } from '@fgv/ts-json-base';
9
11
  import { JsonObject } from '@fgv/ts-json-base';
10
12
  import { JsonValue } from '@fgv/ts-json-base';
11
13
  import { ObjectConverter } from '@fgv/ts-utils';
@@ -14,6 +16,7 @@ import { ResultMap } from '@fgv/ts-utils';
14
16
  import { ValidatingCollector } from '@fgv/ts-utils';
15
17
  import { ValidatingConvertingCollector } from '@fgv/ts-utils';
16
18
  import { ValidatingResultMap } from '@fgv/ts-utils';
19
+ import { Validator } from '@fgv/ts-utils';
17
20
 
18
21
  /**
19
22
  * An abstract decision represents a class of decisions with candidates
@@ -131,6 +134,63 @@ declare const allPredefinedSystemConfigurations: ReadonlyArray<PredefinedSystemC
131
134
  */
132
135
  export declare const allResourceValueMergeMethods: ResourceValueMergeMethod[];
133
136
 
137
+ /**
138
+ * A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.
139
+ * @returns A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.
140
+ * @public
141
+ */
142
+ declare const anyQualifierTypeConfig: Converter<Model_2.IAnyQualifierTypeConfig, unknown>;
143
+
144
+ /**
145
+ * Base implementation class containing shared validation logic for both read-only and mutable validators.
146
+ * @internal
147
+ */
148
+ declare abstract class BaseContextQualifierProviderValidator<T extends IContextQualifierProvider = IContextQualifierProvider> implements IContextQualifierProviderValidatorBase<T> {
149
+ /**
150
+ * The wrapped context qualifier provider.
151
+ */
152
+ abstract readonly provider: T;
153
+ /**
154
+ * The readonly qualifier collector that defines and validates the qualifiers for this context.
155
+ */
156
+ get qualifiers(): IReadOnlyQualifierCollector;
157
+ /**
158
+ * Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
159
+ * @param name - The string name to convert and look up.
160
+ * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
161
+ * or `Failure` with an error message if not found or an error occurs.
162
+ */
163
+ get(name: string): Result<QualifierContextValue>;
164
+ /**
165
+ * Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
166
+ * @param index - The number index to convert and look up.
167
+ * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
168
+ * or `Failure` with an error message if not found or an error occurs.
169
+ */
170
+ getByIndex(index: number): Result<QualifierContextValue>;
171
+ /**
172
+ * Gets a validated qualifier context value by its string name.
173
+ * @param name - The string name to convert and look up.
174
+ * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
175
+ * or `Failure` with an error message if not found, invalid, or an error occurs.
176
+ */
177
+ getValidated(name: string): Result<QualifierContextValue>;
178
+ /**
179
+ * Gets a validated qualifier context value by its number index.
180
+ * @param index - The number index to convert and look up.
181
+ * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
182
+ * or `Failure` with an error message if not found, invalid, or an error occurs.
183
+ */
184
+ getValidatedByIndex(index: number): Result<QualifierContextValue>;
185
+ /**
186
+ * Checks if a qualifier value exists with the given string name.
187
+ * @param name - The string name to convert and check.
188
+ * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
189
+ * or `Failure` with an error message if an error occurs during the check.
190
+ */
191
+ has(name: string): Result<boolean>;
192
+ }
193
+
134
194
  /**
135
195
  * Converts an array of {@link Helpers.IConditionTokenParts | condition token parts} into an array of
136
196
  * syntactically validated {@link ConditionToken | condition tokens}.
@@ -179,6 +239,27 @@ declare function buildQualifierDefaultValuesToken(parts: ReadonlyArray<IQualifie
179
239
  */
180
240
  declare function buildQualifierDefaultValueToken({ qualifier, value }: IQualifierDefaultValueTokenParts): Result<QualifierDefaultValueToken>;
181
241
 
242
+ /**
243
+ * A factory that creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from
244
+ * {@link QualifierTypes.Config.IAnyQualifierTypeConfig | any qualifier type configuration}.
245
+ * @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}
246
+ * if successful, `Failure` with an error message otherwise.
247
+ * @public
248
+ */
249
+ declare class BuiltInQualifierTypeFactory implements IConfigInitFactory<QualifierTypes.Config.ISystemQualifierTypeConfig, SystemQualifierType> {
250
+ /** {@inheritDoc Config.IConfigInitFactory.create} */
251
+ create(config: QualifierTypes.Config.IAnyQualifierTypeConfig): Result<SystemQualifierType>;
252
+ }
253
+
254
+ /**
255
+ * A factory that creates a {@link ResourceTypes.ResourceType | ResourceType} from a {@link ResourceTypes.Config.IResourceTypeConfig | resource type configuration}.
256
+ * @public
257
+ */
258
+ declare class BuiltInResourceTypeFactory implements IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> {
259
+ /** {@inheritDoc Config.IConfigInitFactory.create} */
260
+ create(config: ResourceTypes.Config.IResourceTypeConfig): Result<ResourceType>;
261
+ }
262
+
182
263
  declare namespace Bundle {
183
264
  export {
184
265
  IBundleMetadata,
@@ -190,6 +271,7 @@ declare namespace Bundle {
190
271
  IBundleLoaderCreateParams,
191
272
  BundleUtils,
192
273
  IBundleComponents,
274
+ Model_4 as Model,
193
275
  Convert_10 as Convert,
194
276
  BundleNormalizer
195
277
  }
@@ -557,6 +639,139 @@ declare class CandidateReducer {
557
639
  reduceCandidate(candidate: ResourceCandidate): Result<IReducedCandidate | undefined>;
558
640
  }
559
641
 
642
+ /**
643
+ * Implementation of a candidate value that stores normalized JSON data.
644
+ * The value is normalized on creation and a hash-based key is generated
645
+ * for efficient deduplication.
646
+ * @public
647
+ */
648
+ declare class CandidateValue implements ICandidateValue {
649
+ private readonly _collectible;
650
+ private readonly _json;
651
+ /**
652
+ * The unique key for this candidate value.
653
+ */
654
+ get key(): CandidateValueKey;
655
+ /**
656
+ * The index of this candidate value in the collection.
657
+ */
658
+ get index(): CandidateValueIndex | undefined;
659
+ /**
660
+ * The normalized JSON value.
661
+ */
662
+ get json(): JsonValue;
663
+ /**
664
+ * Constructor for a {@link Resources.CandidateValue} object.
665
+ * @param params - Parameters to create the candidate value.
666
+ * @internal
667
+ */
668
+ protected constructor(params: ICandidateValueCreateParams);
669
+ /**
670
+ * Creates a new {@link Resources.CandidateValue} object.
671
+ * @param params - Parameters to create the candidate value.
672
+ * @returns `Success` with the new candidate value if successful,
673
+ * or `Failure` with an error message if not.
674
+ * @public
675
+ */
676
+ static create(params: ICandidateValueCreateParams): Result<CandidateValue>;
677
+ /**
678
+ * Sets the index of this candidate value.
679
+ * @param index - The index to set.
680
+ * @returns `Success` with the index if successful, or `Failure` with an error message if not.
681
+ * @public
682
+ */
683
+ setIndex(index: number): Result<CandidateValueIndex>;
684
+ }
685
+
686
+ /**
687
+ * A `ValidatingCollector` for {@link Resources.CandidateValue | CandidateValues},
688
+ * which collects candidate values supplied as either {@link Resources.CandidateValue | CandidateValue} or
689
+ * `JsonValue`.
690
+ * @public
691
+ */
692
+ declare class CandidateValueCollector extends ValidatingCollector<CandidateValue> {
693
+ readonly normalizer: Hash.HashingNormalizer;
694
+ /**
695
+ * Constructor for a {@link Resources.CandidateValueCollector} object.
696
+ * @param params - Parameters to create the collector.
697
+ * @internal
698
+ */
699
+ protected constructor(params?: ICandidateValueCollectorCreateParams);
700
+ /**
701
+ * Creates a new {@link Resources.CandidateValueCollector} object.
702
+ * @param params - Parameters to create the collector.
703
+ * @returns `Success` with the new collector if successful,
704
+ * or `Failure` with an error message if not.
705
+ * @public
706
+ */
707
+ static create(params?: ICandidateValueCollectorCreateParams): Result<CandidateValueCollector>;
708
+ /**
709
+ * Returns an array of JSON values ordered by their indices.
710
+ * @returns Array of JsonValue objects in index order.
711
+ * @public
712
+ */
713
+ getValuesByIndex(): JsonValue[];
714
+ /**
715
+ * Converter method to handle CandidateValue | JsonValue.
716
+ * @param from - The value to convert.
717
+ * @returns `Success` with the CandidateValue if successful, or `Failure` with an error message if not.
718
+ * @internal
719
+ */
720
+ private _toCandidateValue;
721
+ }
722
+
723
+ /**
724
+ * Branded number representing a validated candidate value index.
725
+ * Candidate value indices are used to identify candidate values
726
+ * within a resource set and to enable sharing of like values.
727
+ * @public
728
+ */
729
+ export declare type CandidateValueIndex = Brand<number, 'CandidateValueIndex'>;
730
+
731
+ /**
732
+ * `Converter` which validates an `unknown` value as a {@link CandidateValueIndex | CandidateValueIndex}.
733
+ * @public
734
+ */
735
+ declare const candidateValueIndex: Converter<CandidateValueIndex, unknown>;
736
+
737
+ /**
738
+ * Branded string representing a validated candidate value key.
739
+ * Candidate value keys are used to identify candidate values
740
+ * within a resource set and to enable sharing of like values.
741
+ * @public
742
+ */
743
+ export declare type CandidateValueKey = Brand<string, 'CandidateValueKey'>;
744
+
745
+ /**
746
+ * `Converter` which validates an `unknown` value as a {@link CandidateValueKey | CandidateValueKey}.
747
+ * @public
748
+ */
749
+ declare const candidateValueKey: Converter<CandidateValueKey, unknown>;
750
+
751
+ /**
752
+ * @internal
753
+ */
754
+ declare const candidateValueKey_2: RegExp;
755
+
756
+ /**
757
+ * A factory that chains multiple factories together.
758
+ * @public
759
+ */
760
+ declare class ChainedConfigInitFactory<TConfig, T> implements IConfigInitFactory<TConfig, T> {
761
+ readonly factories: IConfigInitFactory<TConfig, T>[];
762
+ /**
763
+ * Constructor for a chained config init factory.
764
+ * @param factories - The factories to chain.
765
+ */
766
+ constructor(factories: IConfigInitFactory<TConfig, T>[]);
767
+ /**
768
+ * Creates a new instance of a configuration object.
769
+ * @param config - The configuration object to create.
770
+ * @returns A result containing the new instance of the configuration object.
771
+ */
772
+ create(config: TConfig): Result<T>;
773
+ }
774
+
560
775
  /**
561
776
  * `Converter` for a normalized {@link ResourceJson.Json.IChildConditionDecl | child condition declaration}.
562
777
  * @public
@@ -668,7 +883,10 @@ declare namespace Common {
668
883
  ResourceTypeIndex,
669
884
  ResourceValueMergeMethod,
670
885
  allResourceValueMergeMethods,
671
- CandidateCompleteness
886
+ CandidateCompleteness,
887
+ CandidateValueIndex,
888
+ CandidateValueKey,
889
+ IResourceResolver
672
890
  }
673
891
  }
674
892
 
@@ -757,30 +975,35 @@ declare const compiledResource: ObjectConverter<Model_3.ICompiledResource, unkno
757
975
  * and use pre-compiled resource collections without rebuilding them from scratch.
758
976
  * @public
759
977
  */
760
- declare class CompiledResourceCollection implements IResourceManager {
978
+ declare class CompiledResourceCollection implements IResourceManager<IResource> {
761
979
  readonly conditions: ReadOnlyConditionCollector;
762
980
  readonly conditionSets: ReadOnlyConditionSetCollector;
763
981
  readonly decisions: ReadOnlyAbstractDecisionCollector;
764
982
  private readonly _qualifierTypes;
765
983
  private readonly _qualifiers;
766
984
  private readonly _resourceTypes;
985
+ private readonly _candidateValues;
767
986
  private readonly _builtResources;
768
987
  private _cachedResourceTree?;
769
988
  /**
770
- * A {@link QualifierTypes.QualifierTypeCollector | QualifierTypeCollector} which
989
+ * A {@link QualifierTypes.ReadOnlyQualifierTypeCollector | ReadOnlyQualifierTypeCollector} which
771
990
  * contains the {@link QualifierTypes.QualifierType | qualifier types} used in this collection.
772
991
  */
773
- get qualifierTypes(): QualifierTypeCollector;
992
+ get qualifierTypes(): ReadOnlyQualifierTypeCollector;
774
993
  /**
775
- * A {@link Qualifiers.QualifierCollector | QualifierCollector} which
994
+ * A {@link Qualifiers.IReadOnlyQualifierCollector | ReadOnlyQualifierCollector} which
776
995
  * contains the {@link Qualifiers.Qualifier | qualifiers} used in this collection.
777
996
  */
778
- get qualifiers(): QualifierCollector;
997
+ get qualifiers(): IReadOnlyQualifierCollector;
779
998
  /**
780
999
  * A {@link ResourceTypes.ResourceTypeCollector | ResourceTypeCollector} which
781
1000
  * contains the {@link ResourceTypes.ResourceType | resource types} used in this collection.
782
1001
  */
783
- get resourceTypes(): ResourceTypeCollector;
1002
+ get resourceTypes(): ReadOnlyResourceTypeCollector;
1003
+ /**
1004
+ * The candidate values in the collection.
1005
+ */
1006
+ get candidateValues(): ReadonlyArray<JsonValue>;
784
1007
  /**
785
1008
  * {@inheritdoc Runtime.IResourceManager.builtResources}
786
1009
  */
@@ -829,7 +1052,7 @@ declare class CompiledResourceCollection implements IResourceManager {
829
1052
  * @returns Result containing the resource tree root, or failure if tree construction fails
830
1053
  * @public
831
1054
  */
832
- getBuiltResourceTree(): Result<IReadOnlyResourceTreeRoot<IResource>>;
1055
+ getBuiltResourceTree(): Result<ReadOnlyResourceTreeRoot<IResource>>;
833
1056
  /**
834
1057
  * Reconstructs a QualifierTypeCollector from compiled data.
835
1058
  * @param compiled - The compiled resource collection
@@ -878,6 +1101,12 @@ declare class CompiledResourceCollection implements IResourceManager {
878
1101
  * @internal
879
1102
  */
880
1103
  private _buildDecisions;
1104
+ /**
1105
+ * Gets a candidate value from the collection.
1106
+ * @param valueIndex - The index of the candidate value to get.
1107
+ * @returns
1108
+ */
1109
+ private _getCandidateValue;
881
1110
  /**
882
1111
  * Reconstructs a ValidatingResultMap of resources from compiled data.
883
1112
  * @param compiled - The compiled resource collection
@@ -1292,6 +1521,14 @@ export declare class ConditionSet implements IValidatedConditionSetDecl {
1292
1521
  * @public
1293
1522
  */
1294
1523
  static getKeyForDecl(decl: IValidatedConditionSetDecl): Result<ConditionSetKey>;
1524
+ /**
1525
+ * Gets a condition set key from a loose condition set declaration.
1526
+ * @param conditionSet - The loose condition set declaration to convert.
1527
+ * @param conditionCollector - The condition collector used for validation.
1528
+ * @returns `Success` with the condition set key if successful, `Failure` otherwise.
1529
+ * @public
1530
+ */
1531
+ static getKeyFromLooseDecl(conditionSet: ResourceJson.Json.ConditionSetDecl | undefined, conditionCollector: ConditionCollector): Result<ConditionSetKey>;
1295
1532
  /**
1296
1533
  * Gets a {@link ConditionSetToken | condition set token} for this condition set,
1297
1534
  * if possible.
@@ -1641,6 +1878,18 @@ declare namespace Config {
1641
1878
  export {
1642
1879
  Model,
1643
1880
  Convert_9 as Convert,
1881
+ createQualifierTypeFactory,
1882
+ createResourceTypeFactory,
1883
+ QualifierTypeFactoryFunction,
1884
+ ResourceTypeFactoryFunction,
1885
+ IConfigInitFactory,
1886
+ ChainedConfigInitFactory,
1887
+ BuiltInQualifierTypeFactory,
1888
+ QualifierTypeFactory,
1889
+ ValidatingQualifierTypeFactory,
1890
+ BuiltInResourceTypeFactory,
1891
+ ResourceTypeFactory,
1892
+ ValidatingResourceTypeFactory,
1644
1893
  updateSystemConfigurationQualifierDefaultValues,
1645
1894
  ISystemConfigurationInitParams,
1646
1895
  SystemConfiguration,
@@ -1657,14 +1906,17 @@ export { Config }
1657
1906
  declare namespace Config_2 {
1658
1907
  export {
1659
1908
  Convert_2 as Convert,
1909
+ isSystemQualifierTypeConfig,
1660
1910
  IQualifierTypeConfig,
1661
1911
  ILanguageQualifierTypeConfig,
1912
+ LiteralValueHierarchyDecl,
1662
1913
  ITerritoryQualifierTypeConfig,
1663
1914
  ILiteralQualifierTypeConfig,
1664
1915
  ISystemLanguageQualifierTypeConfig,
1665
1916
  ISystemTerritoryQualifierTypeConfig,
1666
1917
  ISystemLiteralQualifierTypeConfig,
1667
- ISystemQualifierTypeConfig
1918
+ ISystemQualifierTypeConfig,
1919
+ IAnyQualifierTypeConfig
1668
1920
  }
1669
1921
  }
1670
1922
 
@@ -1683,7 +1935,7 @@ declare const containerContextDecl: Converter<Normalized.IContainerContextDecl>;
1683
1935
 
1684
1936
  declare namespace Context {
1685
1937
  export {
1686
- Convert_7 as Convert,
1938
+ Convert_8 as Convert,
1687
1939
  IContextMatchOptions,
1688
1940
  IContextQualifierValueDecl,
1689
1941
  IContextDecl,
@@ -1696,11 +1948,19 @@ export { Context }
1696
1948
 
1697
1949
  declare namespace Context_2 {
1698
1950
  export {
1951
+ IContextQualifierProviderBase,
1952
+ IReadOnlyContextQualifierProvider,
1953
+ IMutableContextQualifierProvider,
1699
1954
  IContextQualifierProvider,
1700
1955
  ContextQualifierProvider,
1956
+ IContextQualifierProviderValidatorBase,
1701
1957
  IReadOnlyContextQualifierProviderValidator,
1958
+ IMutableContextQualifierProviderValidator,
1959
+ IReadOnlyContextQualifierProviderValidatorCreateParams,
1960
+ IMutableContextQualifierProviderValidatorCreateParams,
1702
1961
  IContextQualifierProviderValidatorCreateParams,
1703
- ContextQualifierProviderValidator,
1962
+ ReadOnlyContextQualifierProviderValidator,
1963
+ MutableContextQualifierProviderValidator,
1704
1964
  ISimpleContextQualifierProviderCreateParams,
1705
1965
  SimpleContextQualifierProvider,
1706
1966
  IValidatingSimpleContextQualifierProviderCreateParams,
@@ -1719,7 +1979,7 @@ declare const contextDecl: Converter<Record<string, string>, unknown>;
1719
1979
  * Provides common functionality and enforces the contract for derived classes.
1720
1980
  * @public
1721
1981
  */
1722
- declare abstract class ContextQualifierProvider implements IContextQualifierProvider {
1982
+ declare abstract class ContextQualifierProvider implements IContextQualifierProviderBase {
1723
1983
  /**
1724
1984
  * The readonly qualifier collector that defines and validates the qualifiers for this context.
1725
1985
  */
@@ -1753,96 +2013,6 @@ declare abstract class ContextQualifierProvider implements IContextQualifierProv
1753
2013
  abstract getNames(): Result<ReadonlyArray<QualifierName>>;
1754
2014
  }
1755
2015
 
1756
- /**
1757
- * A wrapper for {@link Runtime.Context.IContextQualifierProvider | IContextQualifierProvider} that accepts
1758
- * string inputs and converts them to strongly-typed values before calling the wrapped provider.
1759
- * This eliminates the need for type casting in consumer code while maintaining type safety.
1760
- * @public
1761
- */
1762
- declare class ContextQualifierProviderValidator implements IReadOnlyContextQualifierProviderValidator {
1763
- /**
1764
- * The wrapped context qualifier provider.
1765
- */
1766
- readonly provider: IContextQualifierProvider;
1767
- /**
1768
- * The readonly qualifier collector that defines and validates the qualifiers for this context.
1769
- */
1770
- get qualifiers(): IReadOnlyQualifierCollector;
1771
- /**
1772
- * Constructs a new {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator}.
1773
- * @param params - Required parameters for constructing the validator.
1774
- */
1775
- constructor(params: IContextQualifierProviderValidatorCreateParams);
1776
- /**
1777
- * Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
1778
- * @param name - The string name to convert and look up.
1779
- * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
1780
- * or `Failure` with an error message if not found or an error occurs.
1781
- */
1782
- get(name: string): Result<QualifierContextValue>;
1783
- /**
1784
- * Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
1785
- * @param index - The number index to convert and look up.
1786
- * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
1787
- * or `Failure` with an error message if not found or an error occurs.
1788
- */
1789
- getByIndex(index: number): Result<QualifierContextValue>;
1790
- /**
1791
- * Gets a validated qualifier context value by its string name.
1792
- * @param name - The string name to convert and look up.
1793
- * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
1794
- * or `Failure` with an error message if not found, invalid, or an error occurs.
1795
- */
1796
- getValidated(name: string): Result<QualifierContextValue>;
1797
- /**
1798
- * Gets a validated qualifier context value by its number index.
1799
- * @param index - The number index to convert and look up.
1800
- * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
1801
- * or `Failure` with an error message if not found, invalid, or an error occurs.
1802
- */
1803
- getValidatedByIndex(index: number): Result<QualifierContextValue>;
1804
- /**
1805
- * Checks if a qualifier value exists with the given string name.
1806
- * @param name - The string name to convert and check.
1807
- * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
1808
- * or `Failure` with an error message if an error occurs during the check.
1809
- */
1810
- has(name: string): Result<boolean>;
1811
- /**
1812
- * Sets a qualifier value using string inputs, converting to strongly-typed values.
1813
- * @param name - The string name to convert.
1814
- * @param value - The string value to convert.
1815
- * @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
1816
- * or `Failure` with an error message if an error occurs.
1817
- */
1818
- set(name: string, value: string): Result<QualifierContextValue>;
1819
- /**
1820
- * Removes a qualifier value using string input, converting to strongly-typed QualifierName.
1821
- * @param name - The string name to convert.
1822
- * @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
1823
- * or `Failure` with an error message if an error occurs.
1824
- */
1825
- remove(name: string): Result<QualifierContextValue>;
1826
- /**
1827
- * Validates a string as a QualifierName.
1828
- * @param name - The string to validate.
1829
- * @returns `Success` with the strongly-typed QualifierName, or `Failure` if invalid.
1830
- */
1831
- private _validateQualifierName;
1832
- /**
1833
- * Validates a number as a QualifierIndex.
1834
- * @param index - The number to validate.
1835
- * @returns `Success` with the strongly-typed QualifierIndex, or `Failure` if invalid.
1836
- */
1837
- private _validateQualifierIndex;
1838
- /**
1839
- * Validates a string as a QualifierContextValue.
1840
- * @param value - The string to validate.
1841
- * @returns `Success` with the strongly-typed QualifierContextValue, or `Failure` if invalid.
1842
- */
1843
- private _validateQualifierContextValue;
1844
- }
1845
-
1846
2016
  /**
1847
2017
  * A string representing a validated context qualifier token. Context qualifier tokens are used
1848
2018
  * for filtering resources by context criteria. A context qualifier token has the form
@@ -1998,6 +2168,7 @@ declare namespace Convert {
1998
2168
  qualifierIndex,
1999
2169
  qualifierTypeName,
2000
2170
  qualifierTypeIndex,
2171
+ qualifierContextValue,
2001
2172
  qualifierMatchScore,
2002
2173
  conditionPriority,
2003
2174
  conditionOperator,
@@ -2015,6 +2186,8 @@ declare namespace Convert {
2015
2186
  resourceIndex,
2016
2187
  resourceTypeName,
2017
2188
  resourceTypeIndex,
2189
+ candidateValueKey,
2190
+ candidateValueIndex,
2018
2191
  resourceValueMergeMethod,
2019
2192
  contextQualifierToken,
2020
2193
  contextToken,
@@ -2024,7 +2197,7 @@ declare namespace Convert {
2024
2197
  }
2025
2198
  export { Convert }
2026
2199
 
2027
- export declare namespace Convert_10 {
2200
+ declare namespace Convert_10 {
2028
2201
  export {
2029
2202
  bundleMetadata,
2030
2203
  bundleExportMetadata,
@@ -2045,15 +2218,32 @@ declare namespace Convert_11 {
2045
2218
  }
2046
2219
  }
2047
2220
 
2221
+ declare namespace Convert_12 {
2222
+ export {
2223
+ zipArchiveInputType,
2224
+ zipArchiveConfigType,
2225
+ zipArchiveInputInfo,
2226
+ zipArchiveConfigInfo,
2227
+ zipArchiveManifest,
2228
+ mimeType,
2229
+ importedFile,
2230
+ importedDirectory,
2231
+ systemConfiguration_2 as systemConfiguration
2232
+ }
2233
+ }
2234
+
2048
2235
  declare namespace Convert_2 {
2049
2236
  export {
2237
+ qualifierTypeConfig,
2050
2238
  languageQualifierTypeConfig,
2051
2239
  territoryQualifierTypeConfig,
2052
2240
  literalQualifierTypeConfig,
2053
2241
  systemLanguageQualifierTypeConfig,
2054
2242
  systemTerritoryQualifierTypeConfig,
2055
2243
  systemLiteralQualifierTypeConfig,
2056
- systemQualifierTypeConfig
2244
+ systemQualifierTypeConfig,
2245
+ jsonQualifierTypeConfig,
2246
+ anyQualifierTypeConfig
2057
2247
  }
2058
2248
  }
2059
2249
 
@@ -2099,16 +2289,6 @@ declare namespace Convert_6 {
2099
2289
  }
2100
2290
 
2101
2291
  declare namespace Convert_7 {
2102
- export {
2103
- contextQualifierValueDecl,
2104
- contextDecl,
2105
- IContextDeclConvertContext,
2106
- validatedContextQualifierValueDecl,
2107
- validatedContextDecl
2108
- }
2109
- }
2110
-
2111
- declare namespace Convert_8 {
2112
2292
  export {
2113
2293
  looseConditionDecl,
2114
2294
  childConditionDecl,
@@ -2126,13 +2306,32 @@ declare namespace Convert_8 {
2126
2306
  }
2127
2307
  }
2128
2308
 
2309
+ declare namespace Convert_8 {
2310
+ export {
2311
+ contextQualifierValueDecl,
2312
+ contextDecl,
2313
+ IContextDeclConvertContext,
2314
+ validatedContextQualifierValueDecl,
2315
+ validatedContextDecl
2316
+ }
2317
+ }
2318
+
2129
2319
  declare namespace Convert_9 {
2130
2320
  export {
2321
+ validateSystemConfiguration,
2131
2322
  systemConfiguration,
2132
2323
  predefinedSystemConfiguration
2133
2324
  }
2134
2325
  }
2135
2326
 
2327
+ /**
2328
+ * Creates a {@link Config.IConfigInitFactory | IConfigInitFactory} from a factory function.
2329
+ * @param fn - The factory function to wrap.
2330
+ * @returns An `IConfigInitFactory` instance that delegates to the function.
2331
+ * @public
2332
+ */
2333
+ declare function createQualifierTypeFactory<T extends QualifierType = QualifierType>(fn: QualifierTypeFactoryFunction<T>): IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T>;
2334
+
2136
2335
  /**
2137
2336
  * Creates a {@link QualifierTypes.QualifierType | QualifierType} from a configuration object.
2138
2337
  * This factory function determines the appropriate qualifier type based on the systemType
@@ -2143,19 +2342,27 @@ declare namespace Convert_9 {
2143
2342
  * if successful, `Failure` with an error message otherwise.
2144
2343
  * @public
2145
2344
  */
2146
- declare function createQualifierTypeFromConfig(typeConfig: Config_2.IQualifierTypeConfig<JsonObject>): Result<QualifierType>;
2345
+ declare function createQualifierTypeFromConfig(typeConfig: Config_2.IAnyQualifierTypeConfig): Result<QualifierType>;
2147
2346
 
2148
2347
  /**
2149
- * Creates a {@link QualifierTypes.QualifierType | QualifierType} from a system configuration object.
2348
+ * Creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from a system configuration object.
2150
2349
  * This factory function determines the appropriate qualifier type based on the systemType
2151
2350
  * and delegates to the appropriate type-specific createFromConfig method.
2152
2351
  * @param typeConfig - The {@link QualifierTypes.Config.ISystemQualifierTypeConfig | configuration object}
2153
2352
  * containing the name, systemType, and optional type-specific configuration.
2154
- * @returns `Success` with the new {@link QualifierTypes.QualifierType | QualifierType}
2353
+ * @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}
2155
2354
  * if successful, `Failure` with an error message otherwise.
2156
2355
  * @public
2157
2356
  */
2158
- declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISystemQualifierTypeConfig): Result<QualifierType>;
2357
+ declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISystemQualifierTypeConfig): Result<SystemQualifierType>;
2358
+
2359
+ /**
2360
+ * Creates a {@link Config.IConfigInitFactory | IConfigInitFactory} from a resource type factory function.
2361
+ * @param fn - The factory function to wrap.
2362
+ * @returns An `IConfigInitFactory` instance that delegates to the function.
2363
+ * @public
2364
+ */
2365
+ declare function createResourceTypeFactory(fn: ResourceTypeFactoryFunction): IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType>;
2159
2366
 
2160
2367
  /**
2161
2368
  * Creates a {@link ResourceTypes.ResourceType | ResourceType} from a configuration object.
@@ -2167,6 +2374,17 @@ declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISyste
2167
2374
  */
2168
2375
  declare function createResourceTypeFromConfig(config: IResourceTypeConfig): Result<ResourceType>;
2169
2376
 
2377
+ /**
2378
+ * Create a ZIP archive manifest object
2379
+ * @param inputType - Type of input (file or directory)
2380
+ * @param originalPath - Original file/directory path
2381
+ * @param archivePath - Path within the archive
2382
+ * @param configPath - Optional configuration file path
2383
+ * @returns ZIP archive manifest
2384
+ * @public
2385
+ */
2386
+ declare function createZipArchiveManifest(inputType: 'file' | 'directory', originalPath: string, archivePath: string, configPath?: string): Json_2.IZipArchiveManifest;
2387
+
2170
2388
  /**
2171
2389
  * Simple collectible implementation of {@link Decisions.IDecision | IDecision}.
2172
2390
  * @public
@@ -2334,6 +2552,17 @@ declare const DefaultResourceTypes: ReadonlyArray<ResourceTypes.Config.IResource
2334
2552
  */
2335
2553
  declare const DefaultSystemConfiguration: ISystemConfiguration;
2336
2554
 
2555
+ /**
2556
+ * Type for handling empty branch nodes during tree composition.
2557
+ * The handler receives the branch node, names of failed children, and the resolver for recovery attempts.
2558
+ * It can return:
2559
+ * - Success(undefined) to omit the branch from the result
2560
+ * - Success(value) to use an alternate value for the branch
2561
+ * - Failure to propagate the error
2562
+ * @public
2563
+ */
2564
+ declare type EmptyBranchHandler = (branchNode: IReadOnlyResourceTreeNode<IResource>, failedChildNames: string[], resolver: ResourceResolver) => Result<JsonValue | undefined>;
2565
+
2337
2566
  declare namespace Example {
2338
2567
  export {
2339
2568
  ExtendedQualifierTypes,
@@ -2479,6 +2708,30 @@ declare class FsItemImporter implements IImporter {
2479
2708
  */
2480
2709
  declare type FsItemResultDetail = 'failed' | 'skipped' | 'succeeded';
2481
2710
 
2711
+ /**
2712
+ * Generate a timestamp-based filename for ZIP archives
2713
+ * @param customName - Optional custom name prefix
2714
+ * @returns Generated filename
2715
+ * @public
2716
+ */
2717
+ declare function generateZipArchiveFilename(customName?: string): string;
2718
+
2719
+ /**
2720
+ * Extract directory name from a file path
2721
+ * @param path - File path
2722
+ * @returns Directory name
2723
+ * @public
2724
+ */
2725
+ declare function getDirectoryName(path: string): string;
2726
+
2727
+ /**
2728
+ * Gets the name for a resource ID.
2729
+ * @param id - The resource ID to get the name for.
2730
+ * @returns The resource name if found, or undefined if not.
2731
+ * @public
2732
+ */
2733
+ declare function getNameForResourceId(id: string | undefined): Result<ResourceName>;
2734
+
2482
2735
  /**
2483
2736
  * Returns the {@link Config.Model.ISystemConfiguration | system configuration} declaration for the
2484
2737
  * specified predefined system configuration.
@@ -2520,7 +2773,8 @@ declare namespace Helpers {
2520
2773
  IQualifierDefaultValueTokenParts,
2521
2774
  splitResourceId,
2522
2775
  joinResourceIds,
2523
- joinOptionalResourceIds
2776
+ joinOptionalResourceIds,
2777
+ getNameForResourceId
2524
2778
  }
2525
2779
  }
2526
2780
  export { Helpers }
@@ -2559,6 +2813,12 @@ declare interface IAbstractDecisionCreateParams {
2559
2813
  index?: number;
2560
2814
  }
2561
2815
 
2816
+ /**
2817
+ * A union of all qualifier type configurations.
2818
+ * @public
2819
+ */
2820
+ declare type IAnyQualifierTypeConfig = IQualifierTypeConfig | ISystemQualifierTypeConfig;
2821
+
2562
2822
  /**
2563
2823
  * A complete resource bundle that encapsulates built resources, configuration, and metadata.
2564
2824
  * Bundles provide a portable, integrity-verified way to distribute pre-compiled resource collections.
@@ -2757,6 +3017,69 @@ declare interface ICandidateInfo {
2757
3017
  readonly json?: JsonObject;
2758
3018
  }
2759
3019
 
3020
+ /**
3021
+ * Interface for a candidate value that can be collected and indexed.
3022
+ * Candidate values are normalized JSON values that can be shared across
3023
+ * multiple resource candidates to reduce duplication.
3024
+ * @public
3025
+ */
3026
+ declare interface ICandidateValue extends Collections.ICollectible<CandidateValueKey, CandidateValueIndex> {
3027
+ /**
3028
+ * The unique key for this candidate value, derived from the hash of the normalized JSON.
3029
+ */
3030
+ readonly key: CandidateValueKey;
3031
+ /**
3032
+ * The index of this candidate value in the collection.
3033
+ */
3034
+ readonly index: CandidateValueIndex | undefined;
3035
+ /**
3036
+ * The normalized JSON value.
3037
+ */
3038
+ readonly json: JsonValue;
3039
+ /**
3040
+ * Sets the index of this candidate value.
3041
+ * @param index - The index to set.
3042
+ * @returns `Success` with the index if successful, or `Failure` with an error message if not.
3043
+ */
3044
+ setIndex(index: number): Result<CandidateValueIndex>;
3045
+ }
3046
+
3047
+ /**
3048
+ * Parameters for creating a {@link Resources.CandidateValueCollector}.
3049
+ * @public
3050
+ */
3051
+ declare interface ICandidateValueCollectorCreateParams {
3052
+ /**
3053
+ * Optional normalizer to use for normalizing JSON values.
3054
+ * If not provided, a default Crc32Normalizer will be used.
3055
+ */
3056
+ normalizer?: Hash.HashingNormalizer;
3057
+ /**
3058
+ * Optional initial candidate values to add to the collection.
3059
+ */
3060
+ candidateValues?: (CandidateValue | JsonValue)[];
3061
+ }
3062
+
3063
+ /**
3064
+ * Parameters for creating a {@link Resources.CandidateValue | CandidateValue}.
3065
+ * @public
3066
+ */
3067
+ declare interface ICandidateValueCreateParams {
3068
+ /**
3069
+ * The JSON value to store. Will be normalized during creation.
3070
+ */
3071
+ json: JsonValue;
3072
+ /**
3073
+ * Optional normalizer to use for normalizing the JSON value.
3074
+ * If not provided, a default Crc32Normalizer will be used.
3075
+ */
3076
+ normalizer?: Hash.Crc32Normalizer;
3077
+ /**
3078
+ * Optional index if the value is already indexed.
3079
+ */
3080
+ index?: number;
3081
+ }
3082
+
2760
3083
  /**
2761
3084
  * Non-validated child declaration of a {@link Conditions.Condition | condition}.
2762
3085
  * @public
@@ -2880,9 +3203,9 @@ declare interface ICompiledAbstractDecision {
2880
3203
  */
2881
3204
  declare interface ICompiledCandidate {
2882
3205
  /**
2883
- * The JSON value of the candidate.
3206
+ * The global index of the JSON value of the candidate.
2884
3207
  */
2885
- json: JsonValue;
3208
+ valueIndex: Common.CandidateValueIndex;
2886
3209
  /**
2887
3210
  * Indicates if this is a partial resource that needs to be merged.
2888
3211
  */
@@ -3055,6 +3378,10 @@ declare interface ICompiledResourceCollection {
3055
3378
  * Array of all decisions in the collection.
3056
3379
  */
3057
3380
  decisions: ReadonlyArray<ICompiledAbstractDecision>;
3381
+ /**
3382
+ * Array of all candidate values in the collection.
3383
+ */
3384
+ candidateValues: ReadonlyArray<JsonValue>;
3058
3385
  /**
3059
3386
  * Array of all resources in the collection.
3060
3387
  */
@@ -3246,6 +3573,19 @@ declare interface IConditionTokenParts {
3246
3573
  value: string;
3247
3574
  }
3248
3575
 
3576
+ /**
3577
+ * Interface for a factory that creates a new instance of a configuration object.
3578
+ * @public
3579
+ */
3580
+ declare interface IConfigInitFactory<TConfig, T> {
3581
+ /**
3582
+ * Creates a new instance of a configuration object.
3583
+ * @param config - The configuration object to create.
3584
+ * @returns A result containing the new instance of the configuration object.
3585
+ */
3586
+ create(config: TConfig): Result<T>;
3587
+ }
3588
+
3249
3589
  /**
3250
3590
  * Declared context for a resource container.
3251
3591
  * @public
@@ -3303,11 +3643,19 @@ declare interface IContextMatchOptions {
3303
3643
  }
3304
3644
 
3305
3645
  /**
3306
- * Abstract interface for providing qualifier values in an optimized runtime context.
3646
+ * Union type for context qualifier providers that can be either read-only or mutable.
3647
+ * Provides compile-time type discrimination via the `mutable` property.
3648
+ * @public
3649
+ */
3650
+ declare type IContextQualifierProvider = IReadOnlyContextQualifierProvider | IMutableContextQualifierProvider;
3651
+
3652
+ /**
3653
+ * Base interface for providing qualifier values in an optimized runtime context.
3654
+ * Contains common read-only operations shared by both mutable and immutable providers.
3307
3655
  * Acts as a property bag using the Result pattern for qualifier value lookups.
3308
3656
  * @public
3309
3657
  */
3310
- declare interface IContextQualifierProvider {
3658
+ declare interface IContextQualifierProviderBase {
3311
3659
  /**
3312
3660
  * Gets a qualifier value by its name, index, or qualifier object.
3313
3661
  * @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.
@@ -3342,13 +3690,62 @@ declare interface IContextQualifierProvider {
3342
3690
  }
3343
3691
 
3344
3692
  /**
3345
- * Parameters for constructing a {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator}.
3693
+ * Base interface for shared operations between read-only and mutable context qualifier provider validators.
3694
+ * Contains common methods that don't depend on provider mutability.
3346
3695
  * @public
3347
3696
  */
3348
- declare interface IContextQualifierProviderValidatorCreateParams {
3349
- provider: IContextQualifierProvider;
3697
+ declare interface IContextQualifierProviderValidatorBase<T extends IContextQualifierProvider = IContextQualifierProvider> {
3698
+ /**
3699
+ * The wrapped context qualifier provider.
3700
+ */
3701
+ readonly provider: T;
3702
+ /**
3703
+ * The readonly qualifier collector that defines and validates the qualifiers for this context.
3704
+ */
3705
+ readonly qualifiers: IReadOnlyQualifierCollector;
3706
+ /**
3707
+ * Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
3708
+ * @param name - The string name to convert and look up.
3709
+ * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
3710
+ * or `Failure` with an error message if not found or an error occurs.
3711
+ */
3712
+ get(name: string): Result<QualifierContextValue>;
3713
+ /**
3714
+ * Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
3715
+ * @param index - The number index to convert and look up.
3716
+ * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
3717
+ * or `Failure` with an error message if not found or an error occurs.
3718
+ */
3719
+ getByIndex(index: number): Result<QualifierContextValue>;
3720
+ /**
3721
+ * Gets a validated qualifier context value by its string name.
3722
+ * @param name - The string name to convert and look up.
3723
+ * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
3724
+ * or `Failure` with an error message if not found, invalid, or an error occurs.
3725
+ */
3726
+ getValidated(name: string): Result<QualifierContextValue>;
3727
+ /**
3728
+ * Gets a validated qualifier context value by its number index.
3729
+ * @param index - The number index to convert and look up.
3730
+ * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
3731
+ * or `Failure` with an error message if not found, invalid, or an error occurs.
3732
+ */
3733
+ getValidatedByIndex(index: number): Result<QualifierContextValue>;
3734
+ /**
3735
+ * Checks if a qualifier value exists with the given string name.
3736
+ * @param name - The string name to convert and check.
3737
+ * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
3738
+ * or `Failure` with an error message if an error occurs during the check.
3739
+ */
3740
+ has(name: string): Result<boolean>;
3350
3741
  }
3351
3742
 
3743
+ /**
3744
+ * Union type for validator constructor parameters.
3745
+ * @public
3746
+ */
3747
+ declare type IContextQualifierProviderValidatorCreateParams = IReadOnlyContextQualifierProviderValidatorCreateParams | IMutableContextQualifierProviderValidatorCreateParams;
3748
+
3352
3749
  /**
3353
3750
  * Non-validated declaration of a single context qualifier value.
3354
3751
  * @public
@@ -3530,6 +3927,46 @@ declare interface IImportContext {
3530
3927
  readonly conditions?: ReadonlyArray<IConditionDecl>;
3531
3928
  }
3532
3929
 
3930
+ /**
3931
+ * JSON representation of an imported directory structure
3932
+ * @public
3933
+ */
3934
+ declare interface IImportedDirectory {
3935
+ /** Directory name */
3936
+ name: string;
3937
+ /** Files in this directory */
3938
+ files: IImportedFile[];
3939
+ /** Subdirectories */
3940
+ subdirectories: IImportedDirectory[];
3941
+ }
3942
+
3943
+ /**
3944
+ * Imported directory structure
3945
+ * @public
3946
+ */
3947
+ declare type IImportedDirectory_2 = Json_2.IImportedDirectory;
3948
+
3949
+ /**
3950
+ * JSON representation of an imported file
3951
+ * @public
3952
+ */
3953
+ declare interface IImportedFile {
3954
+ /** File name */
3955
+ name: string;
3956
+ /** Full path within archive */
3957
+ path: string;
3958
+ /** File content as string */
3959
+ content: string;
3960
+ /** MIME type */
3961
+ type: string;
3962
+ }
3963
+
3964
+ /**
3965
+ * Imported file representation
3966
+ * @public
3967
+ */
3968
+ declare type IImportedFile_2 = Json_2.IImportedFile;
3969
+
3533
3970
  /**
3534
3971
  * Generic interface for an importer than accepts a typed
3535
3972
  * {@link Import.IImportable | importable} item, extracts any resources
@@ -3663,6 +4100,11 @@ declare interface IJsonResourceTypeCreateParams {
3663
4100
  * instance.
3664
4101
  */
3665
4102
  index?: number;
4103
+ /**
4104
+ * Optional template for new instances of {@link ResourceTypes.JsonResourceType | JsonResourceType}
4105
+ * resources.
4106
+ */
4107
+ template?: JsonObject;
3666
4108
  }
3667
4109
 
3668
4110
  /**
@@ -3727,10 +4169,10 @@ declare interface ILiteralQualifierTypeCreateParams {
3727
4169
  */
3728
4170
  enumeratedValues?: ReadonlyArray<string>;
3729
4171
  /**
3730
- * Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
4172
+ * Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
3731
4173
  * of literal values to use for matching. If not provided, no hierarchy will be used.
3732
4174
  */
3733
- hierarchy?: LiteralValueHierarchyDecl<string>;
4175
+ hierarchy?: Config_2.LiteralValueHierarchyDecl<string>;
3734
4176
  /**
3735
4177
  * Global index for this qualifier type.
3736
4178
  */
@@ -3754,7 +4196,7 @@ declare interface ILiteralValue<T extends string> {
3754
4196
  */
3755
4197
  declare interface ILiteralValueHierarchyCreateParams<T extends string = string> {
3756
4198
  values: ReadonlyArray<T>;
3757
- hierarchy?: LiteralValueHierarchyDecl<T>;
4199
+ hierarchy?: Partial<LiteralValueHierarchyDecl<T>>;
3758
4200
  }
3759
4201
 
3760
4202
  /**
@@ -3986,6 +4428,19 @@ declare class ImportContext implements IValidatedImportContext {
3986
4428
  static forContainerImport(container?: ResourceJson.Normalized.IContainerContextDecl, importer?: ImportContext): Result<ImportContext | undefined>;
3987
4429
  }
3988
4430
 
4431
+ /**
4432
+ * Converter for imported directory structure (recursive)
4433
+ * Note: Uses Converter pattern because Validators don't support recursion with self parameter
4434
+ * @public
4435
+ */
4436
+ declare const importedDirectory: Converter<Json_2.IImportedDirectory>;
4437
+
4438
+ /**
4439
+ * Converter for imported file
4440
+ * @public
4441
+ */
4442
+ declare const importedFile: Converter<Json_2.IImportedFile>;
4443
+
3989
4444
  /**
3990
4445
  * `Converter` for a normalized {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declaration}.
3991
4446
  * @public
@@ -4082,6 +4537,73 @@ declare class ImportManager {
4082
4537
  protected _import(): Result<ImportManager>;
4083
4538
  }
4084
4539
 
4540
+ /**
4541
+ * Mutable interface for providing qualifier values in an optimized runtime context.
4542
+ * Extends the base interface with mutation operations and explicit mutability marker.
4543
+ * @public
4544
+ */
4545
+ declare interface IMutableContextQualifierProvider extends IContextQualifierProviderBase {
4546
+ /**
4547
+ * Explicit mutability marker for compile-time type discrimination.
4548
+ * Always `true` for mutable providers.
4549
+ */
4550
+ readonly mutable: true;
4551
+ /**
4552
+ * Sets a qualifier value in this provider.
4553
+ * @param name - The {@link QualifierName | qualifier name} to set.
4554
+ * @param value - The {@link QualifierContextValue | qualifier context value} to set.
4555
+ * @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
4556
+ * or `Failure` with an error message if not.
4557
+ */
4558
+ set(name: QualifierName, value: QualifierContextValue): Result<QualifierContextValue>;
4559
+ /**
4560
+ * Removes a qualifier value from this provider.
4561
+ * @param name - The {@link QualifierName | qualifier name} to remove.
4562
+ * @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
4563
+ * or `Failure` with an error message if not found or an error occurs.
4564
+ */
4565
+ remove(name: QualifierName): Result<QualifierContextValue>;
4566
+ /**
4567
+ * Clears all qualifier values from this provider.
4568
+ */
4569
+ clear(): void;
4570
+ }
4571
+
4572
+ /**
4573
+ * A mutable interface for validators wrapping mutable context qualifier providers.
4574
+ * Extends the base interface with mutation operations and provides compile-time type safety.
4575
+ * @public
4576
+ */
4577
+ declare interface IMutableContextQualifierProviderValidator<T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider> extends IContextQualifierProviderValidatorBase<T> {
4578
+ /**
4579
+ * The wrapped mutable context qualifier provider.
4580
+ */
4581
+ readonly provider: T;
4582
+ /**
4583
+ * Sets a qualifier value using string inputs, converting to strongly-typed values.
4584
+ * @param name - The string name to convert.
4585
+ * @param value - The string value to convert.
4586
+ * @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
4587
+ * or `Failure` with an error message if an error occurs.
4588
+ */
4589
+ set(name: string, value: string): Result<QualifierContextValue>;
4590
+ /**
4591
+ * Removes a qualifier value using string input, converting to strongly-typed QualifierName.
4592
+ * @param name - The string name to convert.
4593
+ * @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
4594
+ * or `Failure` with an error message if an error occurs.
4595
+ */
4596
+ remove(name: string): Result<QualifierContextValue>;
4597
+ }
4598
+
4599
+ /**
4600
+ * Parameters for constructing a mutable context qualifier provider validator.
4601
+ * @public
4602
+ */
4603
+ declare interface IMutableContextQualifierProviderValidatorCreateParams<T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider> {
4604
+ provider: T;
4605
+ }
4606
+
4085
4607
  /**
4086
4608
  * Parameters for creating a {@link Import.Importers.PathImporter | PathImporter}.
4087
4609
  * @public
@@ -4171,11 +4693,15 @@ declare interface IQualifierDefaultValueTokenParts {
4171
4693
  * territories, etc).
4172
4694
  * @public
4173
4695
  */
4174
- declare interface IQualifierType extends ICollectible<QualifierTypeName, QualifierTypeIndex> {
4696
+ declare interface IQualifierType<TCFGJSON extends JsonObject = JsonObject> extends ICollectible<QualifierTypeName, QualifierTypeIndex> {
4175
4697
  /**
4176
4698
  * The name of the qualifier type.
4177
4699
  */
4178
4700
  readonly name: QualifierTypeName;
4701
+ /**
4702
+ * Name of the underlying system type.
4703
+ */
4704
+ readonly systemTypeName: QualifierTypeName;
4179
4705
  /**
4180
4706
  * Unique key for this qualifier.
4181
4707
  */
@@ -4238,6 +4764,17 @@ declare interface IQualifierType extends ICollectible<QualifierTypeName, Qualifi
4238
4764
  * Sets the index for this qualifier type. Once set, index is immutable.
4239
4765
  */
4240
4766
  setIndex(index: number): Result<QualifierTypeIndex>;
4767
+ /**
4768
+ * Gets the configuration for this qualifier type.
4769
+ * @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
4770
+ */
4771
+ getConfigurationJson(): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
4772
+ /**
4773
+ * Validates configuration JSON data for this qualifier type.
4774
+ * @param from - The unknown data to validate as configuration JSON.
4775
+ * @returns `Success` with validated JSON configuration if valid, `Failure` with an error message otherwise.
4776
+ */
4777
+ validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
4241
4778
  }
4242
4779
 
4243
4780
  /**
@@ -4292,89 +4829,57 @@ declare interface IQualifierTypeCreateParams {
4292
4829
  }
4293
4830
 
4294
4831
  /**
4295
- * A read-only interface exposing non-mutating methods of a {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator}.
4832
+ * Read-only interface for providing qualifier values in an optimized runtime context.
4833
+ * Explicitly marked as immutable with compile-time type discrimination.
4296
4834
  * @public
4297
4835
  */
4298
- declare interface IReadOnlyContextQualifierProviderValidator {
4836
+ declare interface IReadOnlyContextQualifierProvider extends IContextQualifierProviderBase {
4299
4837
  /**
4300
- * {@inheritdoc Runtime.Context.ContextQualifierProviderValidator.provider}
4838
+ * Explicit mutability marker for compile-time type discrimination.
4839
+ * Always `false` for read-only providers.
4301
4840
  */
4302
- readonly provider: IContextQualifierProvider;
4303
- /**
4304
- * {@inheritdoc Runtime.Context.ContextQualifierProviderValidator.qualifiers}
4305
- */
4306
- readonly qualifiers: IReadOnlyQualifierCollector;
4841
+ readonly mutable: false;
4842
+ }
4843
+
4844
+ /**
4845
+ * A read-only interface for validators wrapping read-only context qualifier providers.
4846
+ * Only exposes read operations, providing compile-time type safety by excluding mutation methods.
4847
+ * @public
4848
+ */
4849
+ declare interface IReadOnlyContextQualifierProviderValidator<T extends IReadOnlyContextQualifierProvider = IReadOnlyContextQualifierProvider> {
4307
4850
  /**
4308
- * Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
4309
- * @param name - The string name to convert and look up.
4310
- * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
4311
- * or `Failure` with an error message if not found or an error occurs.
4851
+ * The wrapped read-only context qualifier provider.
4312
4852
  */
4313
- get(name: string): Result<QualifierContextValue>;
4853
+ readonly provider: T;
4854
+ }
4855
+
4856
+ /**
4857
+ * Parameters for constructing a read-only context qualifier provider validator.
4858
+ * @public
4859
+ */
4860
+ declare interface IReadOnlyContextQualifierProviderValidatorCreateParams<T extends IReadOnlyContextQualifierProvider = IReadOnlyContextQualifierProvider> {
4861
+ provider: T;
4862
+ }
4863
+
4864
+ /**
4865
+ * Readonly version of {@link Qualifiers.QualifierCollector | QualifierCollector}.
4866
+ * @public
4867
+ */
4868
+ declare interface IReadOnlyQualifierCollector extends Collections.IReadOnlyValidatingCollector<Qualifier> {
4314
4869
  /**
4315
- * Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
4316
- * @param index - The number index to convert and look up.
4317
- * @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
4318
- * or `Failure` with an error message if not found or an error occurs.
4870
+ * {@inheritdoc Qualifiers.QualifierCollector.qualifierTypes}
4319
4871
  */
4320
- getByIndex(index: number): Result<QualifierContextValue>;
4872
+ readonly qualifierTypes: ReadOnlyQualifierTypeCollector;
4321
4873
  /**
4322
- * Gets a validated qualifier context value by its string name.
4323
- * @param name - The string name to convert and look up.
4324
- * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
4325
- * or `Failure` with an error message if not found, invalid, or an error occurs.
4874
+ * Gets a {@link Qualifiers.Qualifier | qualifier} by name or token.
4875
+ * @param nameOrToken - The name or token of the qualifier to retrieve.
4876
+ * @returns `Success` with the qualifier if found, or `Failure` if not.
4326
4877
  */
4327
- getValidated(name: string): Result<QualifierContextValue>;
4878
+ getByNameOrToken(nameOrToken: string): Result<Qualifier>;
4328
4879
  /**
4329
- * Gets a validated qualifier context value by its number index.
4330
- * @param index - The number index to convert and look up.
4331
- * @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
4332
- * or `Failure` with an error message if not found, invalid, or an error occurs.
4333
- */
4334
- getValidatedByIndex(index: number): Result<QualifierContextValue>;
4335
- /**
4336
- * Checks if a qualifier value exists with the given string name.
4337
- * @param name - The string name to convert and check.
4338
- * @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
4339
- * or `Failure` with an error message if an error occurs during the check.
4340
- */
4341
- has(name: string): Result<boolean>;
4342
- /**
4343
- * Sets a qualifier value using string inputs, converting to strongly-typed values.
4344
- * @param name - The string name to convert.
4345
- * @param value - The string value to convert.
4346
- * @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
4347
- * or `Failure` with an error message if an error occurs.
4348
- */
4349
- set(name: string, value: string): Result<QualifierContextValue>;
4350
- /**
4351
- * Removes a qualifier value using string input, converting to strongly-typed QualifierName.
4352
- * @param name - The string name to convert.
4353
- * @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
4354
- * or `Failure` with an error message if an error occurs.
4355
- */
4356
- remove(name: string): Result<QualifierContextValue>;
4357
- }
4358
-
4359
- /**
4360
- * Readonly version of {@link Qualifiers.QualifierCollector | QualifierCollector}.
4361
- * @public
4362
- */
4363
- declare interface IReadOnlyQualifierCollector extends Collections.IReadOnlyValidatingCollector<Qualifier> {
4364
- /**
4365
- * {@inheritdoc Qualifiers.QualifierCollector.qualifierTypes}
4366
- */
4367
- readonly qualifierTypes: ReadOnlyQualifierTypeCollector;
4368
- /**
4369
- * Gets a {@link Qualifiers.Qualifier | qualifier} by name or token.
4370
- * @param nameOrToken - The name or token of the qualifier to retrieve.
4371
- * @returns `Success` with the qualifier if found, or `Failure` if not.
4372
- */
4373
- getByNameOrToken(nameOrToken: string): Result<Qualifier>;
4374
- /**
4375
- * Checks if a qualifier with a given name or token is in the collection.
4376
- * @param nameOrToken - The name or token of the qualifier to check.
4377
- * @returns `true` if the qualifier is in the collection, `false` if not.
4880
+ * Checks if a qualifier with a given name or token is in the collection.
4881
+ * @param nameOrToken - The name or token of the qualifier to check.
4882
+ * @returns `true` if the qualifier is in the collection, `false` if not.
4378
4883
  */
4379
4884
  hasNameOrToken(nameOrToken: string): boolean;
4380
4885
  }
@@ -4398,7 +4903,7 @@ declare interface IReadOnlyResourceTreeBranch<T> {
4398
4903
  * Interface for a read-only result-based resource tree with navigation methods.
4399
4904
  * @public
4400
4905
  */
4401
- declare interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<ResourceName, IReadOnlyResourceTreeNode<T>> {
4906
+ declare interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<TNAME, IReadOnlyResourceTreeNode<T>> {
4402
4907
  /**
4403
4908
  * Gets a tree node by its full ResourceId path.
4404
4909
  * @param id - The ResourceId path to look up
@@ -4485,6 +4990,29 @@ declare interface IReducedCandidate {
4485
4990
  readonly mergeMethod?: ResourceValueMergeMethod;
4486
4991
  }
4487
4992
 
4993
+ /**
4994
+ * Options for configuring resource tree resolution.
4995
+ * @public
4996
+ */
4997
+ declare interface IResolveResourceTreeOptions {
4998
+ /**
4999
+ * Controls how errors are handled when resolving individual resources in the tree.
5000
+ * - 'fail': Aggregate all errors and fail if any resource fails to resolve
5001
+ * - 'ignore': Skip failed resources and omit them from the result
5002
+ * - callback: Custom error handler that can provide alternate values or propagate errors
5003
+ * @defaultValue 'fail'
5004
+ */
5005
+ onResourceError?: 'fail' | 'ignore' | ResourceErrorHandler;
5006
+ /**
5007
+ * Controls how empty branch nodes are handled during tree composition.
5008
+ * - 'allow': Include empty branches as empty objects in the result
5009
+ * - 'omit': Exclude empty branches from the parent object
5010
+ * - callback: Custom handler that can provide alternate values or recovery logic
5011
+ * @defaultValue 'allow'
5012
+ */
5013
+ onEmptyBranch?: 'allow' | 'omit' | EmptyBranchHandler;
5014
+ }
5015
+
4488
5016
  /**
4489
5017
  * Interface for a resource that can be used in the runtime layer.
4490
5018
  * This provides the minimal properties needed from a resource without requiring
@@ -4494,8 +5022,10 @@ declare interface IReducedCandidate {
4494
5022
  declare interface IResource {
4495
5023
  /** The resource identifier */
4496
5024
  readonly id: string;
5025
+ /** The resource name */
5026
+ readonly name: string;
4497
5027
  /** The resource type */
4498
- readonly resourceType: ResourceType;
5028
+ readonly resourceType: IResourceType;
4499
5029
  /** The decision used to select candidates */
4500
5030
  readonly decision: ConcreteDecision;
4501
5031
  /** The available candidates for this resource */
@@ -4512,6 +5042,7 @@ declare interface IResourceBuilderCreateParams {
4512
5042
  conditionSets: ConditionSetCollector;
4513
5043
  resourceTypes: ReadOnlyResourceTypeCollector;
4514
5044
  decisions: AbstractDecisionCollector;
5045
+ candidateValues: CandidateValueCollector;
4515
5046
  }
4516
5047
 
4517
5048
  /**
@@ -4541,6 +5072,7 @@ declare interface IResourceCandidateCreateParams {
4541
5072
  resourceType?: ResourceType;
4542
5073
  parentConditions?: ReadonlyArray<Condition>;
4543
5074
  conditionSets: ConditionSetCollector;
5075
+ candidateValues: CandidateValueCollector;
4544
5076
  }
4545
5077
 
4546
5078
  /**
@@ -4554,10 +5086,10 @@ declare interface IResourceCandidateValidationProperties {
4554
5086
  */
4555
5087
  id: ResourceId;
4556
5088
  /**
4557
- * {@inheritdoc ResourceJson.Json.ILooseResourceCandidateDecl.isPartial}
5089
+ * Describes how complete the candidate value is.
4558
5090
  * @public
4559
5091
  */
4560
- isPartial: boolean;
5092
+ completeness: CandidateCompleteness;
4561
5093
  /**
4562
5094
  * {@inheritdoc ResourceJson.Json.ILooseResourceCandidateDecl.json}
4563
5095
  * @public
@@ -4698,7 +5230,7 @@ declare interface IResourceDeclContainer {
4698
5230
  * implementations without requiring the full ResourceManagerBuilder build mechanics.
4699
5231
  * @public
4700
5232
  */
4701
- export declare interface IResourceManager {
5233
+ export declare interface IResourceManager<TR extends IResource = IResource> {
4702
5234
  /**
4703
5235
  * A {@link Conditions.ReadOnlyConditionCollector | ReadOnlyConditionCollector} which
4704
5236
  * contains the {@link Conditions.Condition | conditions} used by resource candidates.
@@ -4719,12 +5251,17 @@ export declare interface IResourceManager {
4719
5251
  * @param id - The resource identifier
4720
5252
  * @returns Success with the runtime resource if found, Failure otherwise
4721
5253
  */
4722
- getBuiltResource(id: string): Result<IResource>;
5254
+ getBuiltResource(id: string): Result<TR>;
5255
+ /**
5256
+ * Gets a resource tree built from the resources in this resource manager.
5257
+ * @returns Result containing the resource tree root, or failure if tree construction fails
5258
+ */
5259
+ getBuiltResourceTree(): Result<IReadOnlyResourceTreeRoot<TR>>;
4723
5260
  /**
4724
5261
  * A read-only result map of all built resources, keyed by resource ID.
4725
5262
  * Resources are built on-demand when accessed and returns Results for error handling.
4726
5263
  */
4727
- readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId, IResource>;
5264
+ readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId, TR>;
4728
5265
  /**
4729
5266
  * The number of resources in this resource manager.
4730
5267
  */
@@ -4761,6 +5298,43 @@ declare interface IResourceManagerCloneOptions extends IResourceDeclarationOptio
4761
5298
  * These conditions can modify or extend the resource candidates in the cloned manager.
4762
5299
  */
4763
5300
  readonly candidates?: ReadonlyArray<ResourceJson.Json.ILooseResourceCandidateDecl>;
5301
+ /**
5302
+ * Optional qualifier collector to use for the cloned manager.
5303
+ * If not provided, uses the same qualifiers as the original manager.
5304
+ * This allows creating clones with different qualifier configurations.
5305
+ */
5306
+ readonly qualifiers?: IReadOnlyQualifierCollector;
5307
+ /**
5308
+ * Optional resource type collector to use for the cloned manager.
5309
+ * If not provided, uses the same resource types as the original manager.
5310
+ * This allows creating clones with different resource type configurations.
5311
+ */
5312
+ readonly resourceTypes?: ReadOnlyResourceTypeCollector;
5313
+ }
5314
+
5315
+ /**
5316
+ * Minimal resource resolver
5317
+ * @public
5318
+ */
5319
+ export declare interface IResourceResolver {
5320
+ /**
5321
+ * Resolves a resource to a composed value by merging matching candidates according to their merge methods.
5322
+ * Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
5323
+ * priority "partial" candidates into it in ascending order of priority.
5324
+ * @param resource - The string id of the resource to resolve.
5325
+ * @returns `Success` with the composed JsonValue if successful,
5326
+ * or `Failure` with an error message if no candidates match or resolution fails.
5327
+ * @public
5328
+ */
5329
+ resolveComposedResourceValue(resource: string): Result<JsonValue>;
5330
+ /**
5331
+ * Creates a new {@link IResourceResolver | resource resolver} with the given context.
5332
+ * @param context - The context to use for the new resource resolver.
5333
+ * @returns `Success` with the new resource resolver if successful,
5334
+ * or `Failure` with an error message if the context is invalid.
5335
+ * @public
5336
+ */
5337
+ withContext(context: Record<string, string>): Result<IResourceResolver>;
4764
5338
  }
4765
5339
 
4766
5340
  /**
@@ -4906,13 +5480,82 @@ declare interface IResourceTreeRootInit<T> {
4906
5480
  readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;
4907
5481
  }
4908
5482
 
5483
+ /**
5484
+ * Interface for a resource type. Resource types are responsible for
5485
+ * validating and converting JSON values into the appropriate strongly-typed
5486
+ * resource value.
5487
+ * @public
5488
+ */
5489
+ declare interface IResourceType<T = unknown> extends ICollectible<ResourceTypeName, ResourceTypeIndex> {
5490
+ /**
5491
+ * The key for this resource type.
5492
+ */
5493
+ readonly key: ResourceTypeName;
5494
+ /**
5495
+ * The index for this resource type.
5496
+ */
5497
+ readonly index: ResourceTypeIndex | undefined;
5498
+ /**
5499
+ * Validates properties of a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration} for
5500
+ * a resource instance value.
5501
+ * @param props - The {@link ResourceTypes.IResourceCandidateValidationProperties | properties } to validate.
5502
+ * @returns `Success` with the strongly-typed resource value if the JSON and merge method
5503
+ * are valid, `Failure` with an error message otherwise.
5504
+ * @public
5505
+ */
5506
+ validateDeclaration(props: IResourceCandidateValidationProperties): Result<T | Partial<T>>;
5507
+ /**
5508
+ * Validates a JSON value for use as a partial resource instance value.
5509
+ * @param json - The JSON value to validate.
5510
+ * @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
5511
+ * @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
5512
+ * `Failure` with an error message otherwise.
5513
+ * @public
5514
+ */
5515
+ validate(json: JsonValue, completeness: CandidateCompleteness): Result<Partial<T>>;
5516
+ /**
5517
+ * Validates a JSON value for use as a complete resource instance value.
5518
+ * @param json - The JSON value to validate.
5519
+ * @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
5520
+ * @returns `Success` with the strongly-typed resource value if the JSON is valid,
5521
+ * `Failure` with an error message otherwise.
5522
+ * @public
5523
+ */
5524
+ validate(json: JsonValue, completeness: 'full'): Result<T>;
5525
+ /**
5526
+ * Validates a JSON value for use as a partial resource instance value.
5527
+ * @param json - The JSON value to validate.
5528
+ * @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
5529
+ * @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
5530
+ * `Failure` with an error message otherwise.
5531
+ * @public
5532
+ */
5533
+ validate(json: JsonValue, completeness: 'partial'): Result<Partial<T>>;
5534
+ /**
5535
+ * Sets the index for this resource type. Once set, the index cannot be changed.
5536
+ */
5537
+ setIndex(index: number): Result<ResourceTypeIndex>;
5538
+ /**
5539
+ * Creates a template for a new resource of this type.
5540
+ * The template provides a default structure for creating new resource instances.
5541
+ * @param resourceId - The id for the new resource.
5542
+ * @param init - An optional initial value for the resource.
5543
+ * @param resolver - An optional resource resolver that can be used to create the template.
5544
+ * @param conditions - An optional set of conditions that must be met for the resource to be selected.
5545
+ * @returns A loose resource declaration with default values for this resource type.
5546
+ * @public
5547
+ */
5548
+ createTemplate(resourceId: ResourceId, init?: JsonValue, conditions?: ResourceJson.Json.ConditionSetDecl, resolver?: IResourceResolver): Result<ResourceJson.Json.ILooseResourceDecl>;
5549
+ }
5550
+
4909
5551
  /**
4910
5552
  * Configuration for a {@link ResourceTypes.ResourceType | resource type}.
4911
5553
  * @public
4912
5554
  */
4913
- declare interface IResourceTypeConfig {
5555
+ declare interface IResourceTypeConfig<T extends JsonObject = JsonObject> {
4914
5556
  name: string;
4915
5557
  typeName: string;
5558
+ template?: T;
4916
5559
  }
4917
5560
 
4918
5561
  /**
@@ -4967,6 +5610,33 @@ declare function isResourceTreeLeafInit<T>(init: ResourceTreeNodeInit<T>): init
4967
5610
  */
4968
5611
  declare function isResourceTreeRootOrNodeInit<T>(init: ResourceTreeNodeInit<T> | IResourceTreeRootInit<T>): init is IResourceTreeBranchInit<T>;
4969
5612
 
5613
+ /**
5614
+ * Checks if a {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} is a
5615
+ * {@link QualifierTypes.Config.ISystemQualifierTypeConfig | system qualifier type configuration}.
5616
+ * @param config - The {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} to check.
5617
+ * @returns `true` if the configuration is a system qualifier type configuration, `false` otherwise.
5618
+ * @public
5619
+ */
5620
+ declare function isSystemQualifierTypeConfig(config: IAnyQualifierTypeConfig): config is ISystemQualifierTypeConfig;
5621
+
5622
+ /**
5623
+ * Checks if the given index is a valid candidate value index.
5624
+ *
5625
+ * @param index - The index to validate.
5626
+ * @returns `true` if the index is a valid candidate value index, otherwise `false`.
5627
+ * @public
5628
+ */
5629
+ declare function isValidCandidateValueIndex(index: number): index is CandidateValueIndex;
5630
+
5631
+ /**
5632
+ * Checks if the given key is a valid candidate value key.
5633
+ *
5634
+ * @param key - The key to validate.
5635
+ * @returns `true` if the key is a valid candidate value key, otherwise `false`.
5636
+ * @public
5637
+ */
5638
+ declare function isValidCandidateValueKey(key: string): key is CandidateValueKey;
5639
+
4970
5640
  /**
4971
5641
  * Determines whether a number is a valid condition index.
4972
5642
  * @param index - the number to validate
@@ -5080,6 +5750,15 @@ declare function isValidDecisionIndex(index: number): index is DecisionIndex;
5080
5750
  */
5081
5751
  declare function isValidDecisionKey(key: string): key is DecisionKey;
5082
5752
 
5753
+ /**
5754
+ * Determines whether a string is a valid qualifier context value.
5755
+ * For now, any non-empty string is considered a valid context value.
5756
+ * @param value - the string to validate
5757
+ * @returns true if the string is a valid qualifier context value, false otherwise.
5758
+ * @public
5759
+ */
5760
+ declare function isValidQualifierContextValue(value: string): value is QualifierContextValue;
5761
+
5083
5762
  /**
5084
5763
  * Determines whether a string is a valid qualifier default values token.
5085
5764
  * Qualifier default values tokens are pipe-separated lists of qualifier default value tokens.
@@ -5195,7 +5874,7 @@ declare interface ISystemConfiguration {
5195
5874
  /** Optional description explaining the purpose and use case of the configuration. */
5196
5875
  description?: string;
5197
5876
  /** Qualifier type configurations that define the available qualifier types in the system. */
5198
- qualifierTypes: QualifierTypes.Config.ISystemQualifierTypeConfig[];
5877
+ qualifierTypes: QualifierTypes.Config.IAnyQualifierTypeConfig[];
5199
5878
  /** Qualifier declarations that define the available qualifiers in the system. */
5200
5879
  qualifiers: Qualifiers.IQualifierDecl[];
5201
5880
  /** Resource type configurations that define the available resource types in the system. */
@@ -5213,6 +5892,8 @@ declare interface ISystemConfigurationInitParams {
5213
5892
  * Use `null` as the value to remove an existing default value.
5214
5893
  */
5215
5894
  qualifierDefaultValues?: Record<string, string | null>;
5895
+ qualifierTypeFactory?: IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, QualifierType>;
5896
+ resourceTypeFactory?: IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType>;
5216
5897
  }
5217
5898
 
5218
5899
  /**
@@ -5245,6 +5926,14 @@ declare interface ISystemTerritoryQualifierTypeConfig extends IQualifierTypeConf
5245
5926
  systemType: 'territory';
5246
5927
  }
5247
5928
 
5929
+ /**
5930
+ * Validate ZIP file extension
5931
+ * @param filename - Filename to validate
5932
+ * @returns True if filename has .zip extension
5933
+ * @public
5934
+ */
5935
+ declare function isZipFile(filename: string): boolean;
5936
+
5248
5937
  /**
5249
5938
  * Configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.
5250
5939
  * @public
@@ -5254,7 +5943,7 @@ declare interface ITerritoryQualifierTypeConfig {
5254
5943
  acceptLowercase?: boolean;
5255
5944
  allowedTerritories?: string[];
5256
5945
  /**
5257
- * Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
5946
+ * Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
5258
5947
  * of territory values to use for matching. If not provided, no hierarchy will be used.
5259
5948
  */
5260
5949
  hierarchy?: LiteralValueHierarchyDecl<string>;
@@ -5287,10 +5976,10 @@ declare interface ITerritoryQualifierTypeCreateParams {
5287
5976
  */
5288
5977
  acceptLowercase?: boolean;
5289
5978
  /**
5290
- * Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
5979
+ * Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
5291
5980
  * of territory values to use for matching. If not provided, no hierarchy will be used.
5292
5981
  */
5293
- hierarchy?: LiteralValueHierarchyDecl<string>;
5982
+ hierarchy?: Config_2.LiteralValueHierarchyDecl<string>;
5294
5983
  }
5295
5984
 
5296
5985
  /**
@@ -5418,6 +6107,111 @@ declare interface IValidatingSimpleContextQualifierProviderCreateParams {
5418
6107
  qualifierValues?: Record<string, string>;
5419
6108
  }
5420
6109
 
6110
+ /**
6111
+ * JSON representation of ZIP archive config information
6112
+ * @public
6113
+ */
6114
+ declare interface IZipArchiveConfigInfo {
6115
+ /** Type of config (always 'file') */
6116
+ type: 'file';
6117
+ /** Original config file path */
6118
+ originalPath: string;
6119
+ /** Path within the archive (e.g., "config.json") */
6120
+ archivePath: string;
6121
+ }
6122
+
6123
+ /**
6124
+ * Options for creating a ZIP archive buffer from a file tree
6125
+ * @public
6126
+ */
6127
+ declare interface IZipArchiveFileTreeOptions {
6128
+ /** Input file or directory */
6129
+ inputItem?: FileTree.FileTreeItem;
6130
+ /** Optional configuration file */
6131
+ configItem?: FileTree.IFileTreeFileItem;
6132
+ }
6133
+
6134
+ /**
6135
+ * JSON representation of ZIP archive input information
6136
+ * @public
6137
+ */
6138
+ declare interface IZipArchiveInputInfo {
6139
+ /** Type of input (file or directory) */
6140
+ type: 'file' | 'directory';
6141
+ /** Original file/directory path */
6142
+ originalPath: string;
6143
+ /** Path within the archive (e.g., "input/mydir") */
6144
+ archivePath: string;
6145
+ }
6146
+
6147
+ /**
6148
+ * Options for loading a ZIP archive
6149
+ * @public
6150
+ */
6151
+ declare interface IZipArchiveLoadOptions {
6152
+ /** Validate manifest strictly */
6153
+ strictManifestValidation?: boolean;
6154
+ }
6155
+
6156
+ /**
6157
+ * Result of ZIP archive loading
6158
+ * @public
6159
+ */
6160
+ declare interface IZipArchiveLoadResult {
6161
+ /** Parsed archive manifest */
6162
+ manifest: IZipArchiveManifest_2 | undefined;
6163
+ /** Loaded configuration */
6164
+ config: Model.ISystemConfiguration | undefined;
6165
+ /** All files extracted from the archive */
6166
+ files: IImportedFile_2[];
6167
+ /** Directory structure if available */
6168
+ directory: IImportedDirectory_2 | undefined;
6169
+ }
6170
+
6171
+ /**
6172
+ * JSON representation of a ZIP archive manifest
6173
+ * Compatible with existing tools from ts-res-browser-cli
6174
+ * @public
6175
+ */
6176
+ declare interface IZipArchiveManifest {
6177
+ /** Archive creation timestamp */
6178
+ timestamp: string;
6179
+ /** Optional input source information */
6180
+ input?: IZipArchiveInputInfo;
6181
+ /** Optional configuration file information */
6182
+ config?: IZipArchiveConfigInfo;
6183
+ }
6184
+
6185
+ /**
6186
+ * Standardized ZIP archive manifest format (compatible with existing tools)
6187
+ * @public
6188
+ */
6189
+ declare type IZipArchiveManifest_2 = Json_2.IZipArchiveManifest;
6190
+
6191
+ /**
6192
+ * Options for creating a ZIP archive buffer
6193
+ * @public
6194
+ */
6195
+ declare interface IZipArchivePathOptions {
6196
+ /** File or directory path to include in the archive */
6197
+ inputPath?: string;
6198
+ /** Optional configuration file path */
6199
+ configPath?: string;
6200
+ }
6201
+
6202
+ /**
6203
+ * Result of ZIP archive buffer creation
6204
+ * @public
6205
+ */
6206
+ declare interface IZipArchiveResult {
6207
+ /** Raw ZIP data buffer */
6208
+ zipBuffer: Uint8Array;
6209
+ /** Archive manifest with metadata */
6210
+ manifest: IZipArchiveManifest_2;
6211
+ /** Total ZIP size in bytes */
6212
+ size: number;
6213
+ }
6214
+
5421
6215
  /**
5422
6216
  * Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with
5423
6217
  * to create a new {@link ResourceId | resource ID}. Returns `undefined` if no names are defined.
@@ -5465,6 +6259,16 @@ declare namespace Json {
5465
6259
  }
5466
6260
  }
5467
6261
 
6262
+ declare namespace Json_2 {
6263
+ export {
6264
+ IZipArchiveInputInfo,
6265
+ IZipArchiveConfigInfo,
6266
+ IZipArchiveManifest,
6267
+ IImportedFile,
6268
+ IImportedDirectory
6269
+ }
6270
+ }
6271
+
5468
6272
  /**
5469
6273
  * {@link Import.Importers.IImporter | Importer} implementation which imports resources from a JSON object.
5470
6274
  * @public
@@ -5492,18 +6296,29 @@ declare class JsonImporter implements IImporter {
5492
6296
  private _tryImportResourceTree;
5493
6297
  }
5494
6298
 
6299
+ /**
6300
+ * A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
6301
+ * @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
6302
+ * @public
6303
+ */
6304
+ declare const jsonQualifierTypeConfig: Converter<Model_2.IQualifierTypeConfig<JsonObject>, Converters.IJsonConverterContext>;
6305
+
5495
6306
  /**
5496
6307
  * Implementation of a {@link ResourceTypes.ResourceType | ResourceType} for JSON values.
5497
6308
  * @public
5498
6309
  */
5499
6310
  declare class JsonResourceType extends ResourceType<JsonObject> {
6311
+ /**
6312
+ * {@inheritdoc ResourceTypes.ResourceType.systemTypeName}
6313
+ */
6314
+ readonly systemTypeName: ResourceTypeName;
5500
6315
  /**
5501
6316
  * Protected {@link ResourceTypes.JsonResourceType | JsonResourceType} constructor for use by subclasses.
5502
6317
  * Use {@link ResourceTypes.JsonResourceType.create | JsonResourceType.create} to create a new instance.
5503
6318
  * @param key - The key for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
5504
6319
  * @param index - Optional index for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
5505
6320
  */
5506
- protected constructor(key: ResourceTypeName, index?: number);
6321
+ protected constructor(key: ResourceTypeName, index?: number, template?: JsonObject);
5507
6322
  /**
5508
6323
  * Factory method to create a new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
5509
6324
  * @param params - {@link ResourceTypes.IJsonResourceTypeCreateParams | Parameters} to create the new instance.
@@ -5553,7 +6368,11 @@ declare const LanguagePrioritySystemConfiguration: ISystemConfiguration;
5553
6368
  * Accepts a list of language tags in the context by default.
5554
6369
  * @public
5555
6370
  */
5556
- declare class LanguageQualifierType extends QualifierType {
6371
+ declare class LanguageQualifierType extends QualifierType<JsonCompatible<Config_2.ILanguageQualifierTypeConfig>> {
6372
+ /**
6373
+ * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
6374
+ */
6375
+ readonly systemTypeName: QualifierTypeName;
5557
6376
  /**
5558
6377
  * Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.
5559
6378
  * @param name - Optional name for the qualifier type. Defaults to 'language'.
@@ -5583,6 +6402,27 @@ declare class LanguageQualifierType extends QualifierType {
5583
6402
  * {@inheritdoc QualifierTypes.IQualifierType.isValidConditionValue}
5584
6403
  */
5585
6404
  isValidConditionValue(value: string): value is QualifierConditionValue;
6405
+ /**
6406
+ * Gets a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
6407
+ * for this qualifier type.
6408
+ * @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
6409
+ */
6410
+ getConfiguration(): Result<Config_2.ISystemLanguageQualifierTypeConfig>;
6411
+ /**
6412
+ * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
6413
+ */
6414
+ getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemLanguageQualifierTypeConfig>>;
6415
+ /**
6416
+ * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
6417
+ */
6418
+ validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemLanguageQualifierTypeConfig>>;
6419
+ /**
6420
+ * Validates a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
6421
+ * for this qualifier type.
6422
+ * @param from - The unknown data to validate as a configuration object.
6423
+ * @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
6424
+ */
6425
+ validateConfiguration(from: unknown): Result<Config_2.ISystemLanguageQualifierTypeConfig>;
5586
6426
  /**
5587
6427
  * Matches a single language condition against a single language context value using
5588
6428
  * {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.
@@ -5606,7 +6446,11 @@ declare const languageQualifierTypeConfig: ObjectConverter<Model_2.ILanguageQual
5606
6446
  * optionally case-sensitive or matching against an ordered list of values at runtime.
5607
6447
  * @public
5608
6448
  */
5609
- declare class LiteralQualifierType extends QualifierType {
6449
+ declare class LiteralQualifierType extends QualifierType<JsonCompatible<Config_2.ILiteralQualifierTypeConfig>> {
6450
+ /**
6451
+ * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
6452
+ */
6453
+ readonly systemTypeName: QualifierTypeName;
5610
6454
  /**
5611
6455
  * Indicates whether the qualifier match is case-sensitive.
5612
6456
  */
@@ -5642,6 +6486,27 @@ declare class LiteralQualifierType extends QualifierType {
5642
6486
  * {@inheritdoc QualifierTypes.IQualifierType.isPotentialMatch}
5643
6487
  */
5644
6488
  isPotentialMatch(conditionValue: string, contextValue: string): boolean;
6489
+ /**
6490
+ * Gets a {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | strongly typed configuration object}
6491
+ * for this qualifier type.
6492
+ * @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
6493
+ */
6494
+ getConfiguration(): Result<Config_2.ISystemLiteralQualifierTypeConfig>;
6495
+ /**
6496
+ * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
6497
+ */
6498
+ getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemLiteralQualifierTypeConfig>>;
6499
+ /**
6500
+ * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
6501
+ */
6502
+ validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemLiteralQualifierTypeConfig>>;
6503
+ /**
6504
+ * Validates a {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | strongly typed configuration object}
6505
+ * for this qualifier type.
6506
+ * @param from - The unknown data to validate as a configuration object.
6507
+ * @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
6508
+ */
6509
+ validateConfiguration(from: unknown): Result<Config_2.ISystemLiteralQualifierTypeConfig>;
5645
6510
  /**
5646
6511
  * {@inheritdoc QualifierTypes.QualifierType._matchOne}
5647
6512
  */
@@ -5771,6 +6636,11 @@ declare class LiteralValueHierarchy<T extends string = string> {
5771
6636
  */
5772
6637
  match(condition: QualifierConditionValue, context: QualifierContextValue, __operator?: ConditionOperator): QualifierMatchScore;
5773
6638
  protected static _buildValuesFromHierarchy<T extends string>(params: ILiteralValueHierarchyCreateParams<T>): Result<ReadonlyMap<T, ILiteralValue<T>>>;
6639
+ /**
6640
+ * Converts the hierarchy to a record of parent-child relationships.
6641
+ * @returns A record of parent-child relationships.
6642
+ */
6643
+ asRecord(): Record<string, string>;
5774
6644
  }
5775
6645
 
5776
6646
  /**
@@ -5790,7 +6660,7 @@ declare function literalValueHierarchyCreateParams<T extends string>(valueConver
5790
6660
  * determine the relationship between values when matching conditions and contexts.
5791
6661
  * @public
5792
6662
  */
5793
- declare type LiteralValueHierarchyDecl<T extends string> = Partial<Record<T, T>>;
6663
+ declare type LiteralValueHierarchyDecl<T extends string> = Record<T, T>;
5794
6664
 
5795
6665
  /**
5796
6666
  * `Converter` for a normalized {@link ResourceJson.Json.ILooseConditionDecl | loose condition declaration}.
@@ -5933,6 +6803,12 @@ declare function mergeLooseCandidate(candidate: Normalized.IImporterResourceCand
5933
6803
  */
5934
6804
  declare function mergeLooseResource(resource: Normalized.IImporterResourceDecl, baseName?: string, baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>): Result<Normalized.ILooseResourceDecl>;
5935
6805
 
6806
+ /**
6807
+ * Validator for MIME type strings
6808
+ * @public
6809
+ */
6810
+ declare const mimeType: Validator<string>;
6811
+
5936
6812
  /**
5937
6813
  * Minimum valid priority for a condition.
5938
6814
  * @public
@@ -5947,14 +6823,17 @@ declare namespace Model {
5947
6823
 
5948
6824
  declare namespace Model_2 {
5949
6825
  export {
6826
+ isSystemQualifierTypeConfig,
5950
6827
  IQualifierTypeConfig,
5951
6828
  ILanguageQualifierTypeConfig,
6829
+ LiteralValueHierarchyDecl,
5952
6830
  ITerritoryQualifierTypeConfig,
5953
6831
  ILiteralQualifierTypeConfig,
5954
6832
  ISystemLanguageQualifierTypeConfig,
5955
6833
  ISystemTerritoryQualifierTypeConfig,
5956
6834
  ISystemLiteralQualifierTypeConfig,
5957
- ISystemQualifierTypeConfig
6835
+ ISystemQualifierTypeConfig,
6836
+ IAnyQualifierTypeConfig
5958
6837
  }
5959
6838
  }
5960
6839
 
@@ -5975,31 +6854,73 @@ declare namespace Model_3 {
5975
6854
  }
5976
6855
  }
5977
6856
 
5978
- /**
5979
- * {@link QualifierMatchScore | Match score} indicating no match.
5980
- * @public
5981
- */
5982
- export declare const NoMatch: QualifierMatchScore;
6857
+ declare namespace Model_4 {
6858
+ export {
6859
+ IBundleMetadata,
6860
+ IBundleExportMetadata,
6861
+ IBundle,
6862
+ IBundleCreateParams
6863
+ }
6864
+ }
5983
6865
 
5984
6866
  /**
5985
- * A no-op implementation of {@link Runtime.IResourceResolverCacheListener}.
6867
+ * A validator for mutable context qualifier providers that accepts string inputs
6868
+ * and converts them to strongly-typed values before calling the wrapped provider.
6869
+ * Provides both read and mutation operations.
5986
6870
  * @public
5987
6871
  */
5988
- declare class NoOpResourceResolverCacheListener implements IResourceResolverCacheListener {
5989
- /**
5990
- * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheHit}
5991
- */
5992
- onCacheHit(cache: ResourceResolverCacheType, index: number): void;
6872
+ declare class MutableContextQualifierProviderValidator<T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider> extends BaseContextQualifierProviderValidator<T> implements IMutableContextQualifierProviderValidator<T> {
5993
6873
  /**
5994
- * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheMiss}
6874
+ * The wrapped mutable context qualifier provider.
5995
6875
  */
5996
- onCacheMiss(cache: ResourceResolverCacheType, index: number): void;
6876
+ readonly provider: T;
5997
6877
  /**
5998
- * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheError}
6878
+ * Constructs a new {@link Runtime.Context.MutableContextQualifierProviderValidator | MutableContextQualifierProviderValidator}.
6879
+ * @param params - Required parameters for constructing the validator.
5999
6880
  */
6000
- onCacheError(cache: ResourceResolverCacheType, index: number): void;
6881
+ constructor(params: IMutableContextQualifierProviderValidatorCreateParams<T>);
6001
6882
  /**
6002
- * {@inheritDoc Runtime.IResourceResolverCacheListener.onContextError}
6883
+ * Sets a qualifier value using string inputs, converting to strongly-typed values.
6884
+ * @param name - The string name to convert.
6885
+ * @param value - The string value to convert.
6886
+ * @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
6887
+ * or `Failure` with an error message if an error occurs.
6888
+ */
6889
+ set(name: string, value: string): Result<QualifierContextValue>;
6890
+ /**
6891
+ * Removes a qualifier value using string input, converting to strongly-typed QualifierName.
6892
+ * @param name - The string name to convert.
6893
+ * @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
6894
+ * or `Failure` with an error message if an error occurs.
6895
+ */
6896
+ remove(name: string): Result<QualifierContextValue>;
6897
+ }
6898
+
6899
+ /**
6900
+ * {@link QualifierMatchScore | Match score} indicating no match.
6901
+ * @public
6902
+ */
6903
+ export declare const NoMatch: QualifierMatchScore;
6904
+
6905
+ /**
6906
+ * A no-op implementation of {@link Runtime.IResourceResolverCacheListener}.
6907
+ * @public
6908
+ */
6909
+ declare class NoOpResourceResolverCacheListener implements IResourceResolverCacheListener {
6910
+ /**
6911
+ * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheHit}
6912
+ */
6913
+ onCacheHit(cache: ResourceResolverCacheType, index: number): void;
6914
+ /**
6915
+ * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheMiss}
6916
+ */
6917
+ onCacheMiss(cache: ResourceResolverCacheType, index: number): void;
6918
+ /**
6919
+ * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheError}
6920
+ */
6921
+ onCacheError(cache: ResourceResolverCacheType, index: number): void;
6922
+ /**
6923
+ * {@inheritDoc Runtime.IResourceResolverCacheListener.onContextError}
6003
6924
  */
6004
6925
  onContextError(qualifier: string, error: string): void;
6005
6926
  /**
@@ -6025,6 +6946,14 @@ declare namespace Normalized {
6025
6946
  }
6026
6947
  }
6027
6948
 
6949
+ /**
6950
+ * Normalize path separators for cross-platform compatibility
6951
+ * @param path - Path to normalize
6952
+ * @returns Normalized path
6953
+ * @public
6954
+ */
6955
+ declare function normalizePath(path: string): string;
6956
+
6028
6957
  /**
6029
6958
  * Overall cache metrics across all cache types.
6030
6959
  * @public
@@ -6079,6 +7008,22 @@ declare function parseQualifierDefaultValuesTokenParts(token: string): Result<IQ
6079
7008
  */
6080
7009
  declare function parseQualifierDefaultValueTokenParts(token: string): Result<IQualifierDefaultValueTokenParts>;
6081
7010
 
7011
+ /**
7012
+ * Parse and validate configuration JSON
7013
+ * @param configData - JSON string containing configuration
7014
+ * @returns Result containing validated configuration
7015
+ * @public
7016
+ */
7017
+ declare function parseZipArchiveConfiguration(configData: string): Result<Model.ISystemConfiguration>;
7018
+
7019
+ /**
7020
+ * Parse and validate a ZIP archive manifest
7021
+ * @param manifestData - JSON string containing manifest data
7022
+ * @returns Result containing validated manifest
7023
+ * @public
7024
+ */
7025
+ declare function parseZipArchiveManifest(manifestData: string): Result<Json_2.IZipArchiveManifest>;
7026
+
6082
7027
  /**
6083
7028
  * {@link Import.Importers.IImporter | Importer} implementation which imports resources from a `FileTree`
6084
7029
  * given a path.
@@ -6306,6 +7251,12 @@ export declare type QualifierConditionValue = Brand<string, 'QualifierConditionV
6306
7251
  */
6307
7252
  export declare type QualifierContextValue = Brand<string, 'QualifierContextValue'>;
6308
7253
 
7254
+ /**
7255
+ * `Converter` which validates an `unknown` value as a {@link QualifierContextValue | QualifierContextValue}.
7256
+ * @public
7257
+ */
7258
+ declare const qualifierContextValue: Converter<QualifierContextValue, unknown>;
7259
+
6309
7260
  /**
6310
7261
  * Converter for a {@link Qualifiers.IQualifierDecl | qualifier declaration}.
6311
7262
  * @public
@@ -6509,11 +7460,15 @@ export { Qualifiers }
6509
7460
  * the {@link QualifierTypes.IQualifierType | IQualifierType} interface.
6510
7461
  * @public
6511
7462
  */
6512
- export declare abstract class QualifierType implements IQualifierType {
7463
+ export declare abstract class QualifierType<TCFGJSON extends JsonObject = JsonObject> implements IQualifierType<TCFGJSON> {
6513
7464
  /**
6514
7465
  * {@inheritdoc QualifierTypes.IQualifierType.name}
6515
7466
  */
6516
7467
  readonly name: QualifierTypeName;
7468
+ /**
7469
+ * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
7470
+ */
7471
+ abstract readonly systemTypeName: QualifierTypeName;
6517
7472
  /**
6518
7473
  * {@inheritdoc QualifierTypes.IQualifierType.key}
6519
7474
  */
@@ -6559,6 +7514,14 @@ export declare abstract class QualifierType implements IQualifierType {
6559
7514
  * {@inheritdoc QualifierTypes.IQualifierType.matches}
6560
7515
  */
6561
7516
  matches(condition: QualifierConditionValue, context: QualifierContextValue, operator: ConditionOperator): QualifierMatchScore;
7517
+ /**
7518
+ * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
7519
+ */
7520
+ abstract getConfigurationJson(): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
7521
+ /**
7522
+ * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
7523
+ */
7524
+ abstract validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
6562
7525
  /**
6563
7526
  * {@inheritdoc QualifierTypes.IQualifierType.setIndex}
6564
7527
  */
@@ -6614,7 +7577,7 @@ export declare abstract class QualifierType implements IQualifierType {
6614
7577
  * index from a supplied {@link QualifierTypes.Convert.IQualifierTypeConvertContext | conversion context}.
6615
7578
  * @public
6616
7579
  */
6617
- declare const qualifierType: Converter<QualifierType, IQualifierTypeConvertContext>;
7580
+ declare const qualifierType: Converter<QualifierType<JsonObject>, IQualifierTypeConvertContext>;
6618
7581
 
6619
7582
  /**
6620
7583
  * Collector for {@link QualifierTypes.QualifierType | QualifierType} objects.
@@ -6638,6 +7601,74 @@ declare class QualifierTypeCollector extends ValidatingConvertingCollector<Quali
6638
7601
  protected static _toQualifierType(from: unknown): Result<QualifierType>;
6639
7602
  }
6640
7603
 
7604
+ /**
7605
+ * A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
7606
+ * @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
7607
+ * @param config - A `Converter` for the configuration object.
7608
+ * @public
7609
+ */
7610
+ declare function qualifierTypeConfig<T, TD = unknown>(config: Converter<T, TD>): Converter<Model_2.IQualifierTypeConfig<T>, TD>;
7611
+
7612
+ /**
7613
+ * A factory that creates {@link QualifierTypes.QualifierType | QualifierType} instances from configuration,
7614
+ * supporting both built-in system types and custom external types.
7615
+ *
7616
+ * This factory allows external consumers to extend the qualifier type system with their own custom types
7617
+ * while maintaining support for all built-in types (Language, Territory, Literal).
7618
+ *
7619
+ * @typeParam T - The custom qualifier type(s) to support. Defaults to {@link QualifierTypes.SystemQualifierType | SystemQualifierType}.
7620
+ *
7621
+ * @example Creating a factory with custom qualifier types
7622
+ * ```typescript
7623
+ * // Define a custom qualifier type
7624
+ * class CustomQualifierType extends QualifierType {
7625
+ * // ... implementation
7626
+ * }
7627
+ *
7628
+ * // Define a discriminated union of all types
7629
+ * type AppQualifierType = SystemQualifierType | CustomQualifierType;
7630
+ *
7631
+ * // Create a factory that handles custom types
7632
+ * const customFactory: IConfigInitFactory<IAnyQualifierTypeConfig, CustomQualifierType> = {
7633
+ * create(config) {
7634
+ * // ... handle custom type creation
7635
+ * }
7636
+ * };
7637
+ *
7638
+ * // Create the combined factory
7639
+ * const qualifierTypeFactory = new QualifierTypeFactory<AppQualifierType>([customFactory]);
7640
+ *
7641
+ * // The factory returns T | SystemQualifierType, supporting all types
7642
+ * const result = qualifierTypeFactory.create(config); // Result<AppQualifierType | SystemQualifierType>
7643
+ * ```
7644
+ *
7645
+ * @remarks
7646
+ * - The factory chains custom factories with the built-in factory
7647
+ * - Custom factories are tried first, falling back to built-in types
7648
+ * - The return type is a union of custom types (T) and system types
7649
+ *
7650
+ * @public
7651
+ */
7652
+ declare class QualifierTypeFactory<T extends QualifierType = SystemQualifierType> extends ChainedConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T | SystemQualifierType> {
7653
+ /**
7654
+ * Constructor for a {@link Config.QualifierTypeFactory | qualifier type factory}.
7655
+ * @param factories - Array of factories for custom qualifier types. Can be:
7656
+ * - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
7657
+ * - {@link Config.QualifierTypeFactoryFunction | Factory functions}
7658
+ * - A mix of both
7659
+ * These are tried in order before falling back to built-in types.
7660
+ * @remarks The {@link Config.BuiltInQualifierTypeFactory | built-in factory} is always appended to handle
7661
+ * system qualifier types (Language, Territory, Literal).
7662
+ */
7663
+ constructor(factories: Array<IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T> | QualifierTypeFactoryFunction<T>>);
7664
+ }
7665
+
7666
+ /**
7667
+ * Function signature for creating a qualifier type from configuration.
7668
+ * @public
7669
+ */
7670
+ declare type QualifierTypeFactoryFunction<T extends QualifierType = QualifierType> = (config: QualifierTypes.Config.IAnyQualifierTypeConfig) => Result<T>;
7671
+
6641
7672
  /**
6642
7673
  * Branded number representing a validated qualifier type index.
6643
7674
  * @public
@@ -6673,7 +7704,6 @@ declare namespace QualifierTypes {
6673
7704
  LanguageQualifierType,
6674
7705
  ILiteralQualifierTypeCreateParams,
6675
7706
  LiteralQualifierType,
6676
- LiteralValueHierarchyDecl,
6677
7707
  ILiteralValue,
6678
7708
  ILiteralValueHierarchyCreateParams,
6679
7709
  LiteralValueHierarchy,
@@ -6683,7 +7713,8 @@ declare namespace QualifierTypes {
6683
7713
  QualifierTypeCollector,
6684
7714
  ReadOnlyQualifierTypeCollector,
6685
7715
  createQualifierTypeFromConfig,
6686
- createQualifierTypeFromSystemConfig
7716
+ createQualifierTypeFromSystemConfig,
7717
+ SystemQualifierType
6687
7718
  }
6688
7719
  }
6689
7720
  export { QualifierTypes }
@@ -6706,6 +7737,24 @@ declare type ReadOnlyConditionCollector = Collections.IReadOnlyValidatingCollect
6706
7737
  */
6707
7738
  declare type ReadOnlyConditionSetCollector = Collections.IReadOnlyValidatingCollector<ConditionSet>;
6708
7739
 
7740
+ /**
7741
+ * A validator for read-only context qualifier providers that accepts string inputs
7742
+ * and converts them to strongly-typed values before calling the wrapped provider.
7743
+ * Only provides read operations for compile-time type safety.
7744
+ * @public
7745
+ */
7746
+ declare class ReadOnlyContextQualifierProviderValidator<T extends IReadOnlyContextQualifierProvider = IReadOnlyContextQualifierProvider> extends BaseContextQualifierProviderValidator<T> implements IReadOnlyContextQualifierProviderValidator<T> {
7747
+ /**
7748
+ * The wrapped read-only context qualifier provider.
7749
+ */
7750
+ readonly provider: T;
7751
+ /**
7752
+ * Constructs a new {@link Runtime.Context.ReadOnlyContextQualifierProviderValidator | ReadOnlyContextQualifierProviderValidator}.
7753
+ * @param params - Required parameters for constructing the validator.
7754
+ */
7755
+ constructor(params: IReadOnlyContextQualifierProviderValidatorCreateParams<T>);
7756
+ }
7757
+
6709
7758
  /**
6710
7759
  * Interface exposing non-mutating members of a
6711
7760
  * {@link QualifierTypes.QualifierTypeCollector | QualifierTypeCollector}.
@@ -6851,6 +7900,7 @@ declare namespace RegularExpressions {
6851
7900
  contextToken_2 as contextToken,
6852
7901
  conditionSetHash_2 as conditionSetHash,
6853
7902
  decisionKey_2 as decisionKey,
7903
+ candidateValueKey_2 as candidateValueKey,
6854
7904
  qualifierDefaultValueToken_2 as qualifierDefaultValueToken,
6855
7905
  qualifierDefaultValuesToken_2 as qualifierDefaultValuesToken,
6856
7906
  territoryCode
@@ -6867,10 +7917,14 @@ export declare class Resource implements IResource {
6867
7917
  * The unique {@link ResourceId | id} of the resource.
6868
7918
  */
6869
7919
  readonly id: ResourceId;
7920
+ /**
7921
+ * The name of the resource.
7922
+ */
7923
+ readonly name: ResourceName;
6870
7924
  /**
6871
7925
  * The {@link ResourceTypes.ResourceType | type} of the resource.
6872
7926
  */
6873
- readonly _resourceType: ResourceType;
7927
+ readonly resourceType: ResourceType;
6874
7928
  /**
6875
7929
  * The array of {@link Resources.ResourceCandidate | candidates} for the resource.
6876
7930
  */
@@ -6879,10 +7933,6 @@ export declare class Resource implements IResource {
6879
7933
  * {@link Decisions.ConcreteDecision | Decision} for optimized resource resolution.
6880
7934
  */
6881
7935
  readonly decision: ConcreteDecision;
6882
- /**
6883
- * Gets the resource type (implements IResource interface).
6884
- */
6885
- get resourceType(): ResourceType;
6886
7936
  /**
6887
7937
  * Gets the resource type name as a string.
6888
7938
  */
@@ -7007,6 +8057,10 @@ declare class ResourceBuilder {
7007
8057
  * Collector for {@link Decisions.AbstractDecision | abstract decisions}.
7008
8058
  */
7009
8059
  protected _decisions: AbstractDecisionCollector;
8060
+ /**
8061
+ * Collector for candidate values.
8062
+ */
8063
+ protected _candidateValues: CandidateValueCollector;
7010
8064
  /**
7011
8065
  * Constructor for a {@link Resources.ResourceBuilder | ResourceBuilder} object.
7012
8066
  * @param params - Parameters to construct the new {@link Resources.ResourceBuilder | ResourceBuilder}.
@@ -7084,10 +8138,16 @@ export declare class ResourceCandidate implements IResourceCandidate {
7084
8138
  * is a possible instance.
7085
8139
  */
7086
8140
  readonly id: ResourceId;
8141
+ /**
8142
+ * The candidate value that contains the JSON representation of the instance data.
8143
+ */
8144
+ readonly candidateValue: CandidateValue;
7087
8145
  /**
7088
8146
  * The JSON representation of the instance data to be applied.
8147
+ * @remarks
8148
+ * This property provides access to the JSON data from the underlying candidate value.
7089
8149
  */
7090
- readonly json: JsonObject;
8150
+ get json(): JsonObject;
7091
8151
  /**
7092
8152
  * The conditions under which this candidate applies.
7093
8153
  */
@@ -7105,6 +8165,10 @@ export declare class ResourceCandidate implements IResourceCandidate {
7105
8165
  * this candidate belongs.
7106
8166
  */
7107
8167
  readonly resourceType: ResourceType | undefined;
8168
+ /**
8169
+ * The completeness of the candidate value.
8170
+ */
8171
+ get completeness(): CandidateCompleteness;
7108
8172
  /**
7109
8173
  * Constructor for a {@link Resources.ResourceCandidate | ResourceCandidate} object.
7110
8174
  * @param params - Parameters to create a new {@link Resources.ResourceCandidate | ResourceCandidate}.
@@ -7277,6 +8341,17 @@ declare class ResourceDeclTree implements IResourceDeclContainer {
7277
8341
  private _extract;
7278
8342
  }
7279
8343
 
8344
+ /**
8345
+ * Type for handling resource resolution errors during tree traversal.
8346
+ * The handler receives the resource that failed to resolve, the error message, and the resolver for recovery attempts.
8347
+ * It can return:
8348
+ * - Success(undefined) to omit the property from the result
8349
+ * - Success(value) to use an alternate value
8350
+ * - Failure to propagate the error
8351
+ * @public
8352
+ */
8353
+ declare type ResourceErrorHandler = (resource: IResource, message: string, resolver: ResourceResolver) => Result<JsonValue | undefined>;
8354
+
7280
8355
  /**
7281
8356
  * Branded string representing a validated resource id. A resource ID
7282
8357
  * is a dot-separated sequence of resource names.
@@ -7305,7 +8380,7 @@ declare const resourceIndex: Converter<ResourceIndex, unknown>;
7305
8380
  declare namespace ResourceJson {
7306
8381
  export {
7307
8382
  Compiled,
7308
- Convert_8 as Convert,
8383
+ Convert_7 as Convert,
7309
8384
  Helpers_2 as Helpers,
7310
8385
  Json,
7311
8386
  Normalized,
@@ -7323,15 +8398,59 @@ export { ResourceJson }
7323
8398
  * and builds a collection of {@link Resources.Resource | resources} once all candidates are collected.
7324
8399
  * @public
7325
8400
  */
7326
- export declare class ResourceManagerBuilder implements IResourceManager {
8401
+ export declare class ResourceManagerBuilder implements IResourceManager<Resource> {
8402
+ /**
8403
+ * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used by this resource manager.
8404
+ */
7327
8405
  readonly qualifiers: IReadOnlyQualifierCollector;
8406
+ /**
8407
+ * The {@link ResourceTypes.ReadOnlyResourceTypeCollector | resource types} used by this resource manager.
8408
+ */
7328
8409
  readonly resourceTypes: ReadOnlyResourceTypeCollector;
8410
+ /**
8411
+ * The {@link Conditions.ConditionCollector | condition collector} used by this resource manager.
8412
+ * @internal
8413
+ */
7329
8414
  protected readonly _conditions: ConditionCollector;
8415
+ /**
8416
+ * The {@link Conditions.ConditionSetCollector | condition set collector} used by this resource manager.
8417
+ * @internal
8418
+ */
7330
8419
  protected readonly _conditionSets: ConditionSetCollector;
8420
+ /**
8421
+ * The {@link Decisions.AbstractDecisionCollector | abstract decision collector} used by this resource manager.
8422
+ * @internal
8423
+ */
7331
8424
  protected readonly _decisions: AbstractDecisionCollector;
8425
+ /**
8426
+ * The candidate value collector used by this resource manager.
8427
+ * @internal
8428
+ */
8429
+ protected readonly _candidateValues: CandidateValueCollector;
8430
+ /**
8431
+ * The {@link Resources.ResourceBuilder | resource builders} used by this resource manager.
8432
+ * @internal
8433
+ */
7332
8434
  protected readonly _resources: ValidatingResultMap<ResourceId, ResourceBuilder>;
7333
- readonly _builtResources: ValidatingResultMap<ResourceId, Resource>;
8435
+ /**
8436
+ * The {@link Resources.Resource | resources} built by this resource manager.
8437
+ * @internal
8438
+ */
8439
+ protected readonly _builtResources: ValidatingResultMap<ResourceId, Resource>;
8440
+ /**
8441
+ * Whether the resources have been built.
8442
+ * @internal
8443
+ */
7334
8444
  protected _built: boolean;
8445
+ /**
8446
+ * The cached resource tree for this resource manager.
8447
+ * @internal
8448
+ */
8449
+ protected _cachedResourceTree?: ResourceTree.IReadOnlyResourceTreeRoot<Resource>;
8450
+ /**
8451
+ * The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier types} used by this resource manager.
8452
+ */
8453
+ get qualifierTypes(): ReadOnlyQualifierTypeCollector;
7335
8454
  /**
7336
8455
  * A {@link Conditions.ConditionCollector | ConditionCollector} which
7337
8456
  * contains the {@link Conditions.Condition | conditions} used so far by
@@ -7397,6 +8516,17 @@ export declare class ResourceManagerBuilder implements IResourceManager {
7397
8516
  * @public
7398
8517
  */
7399
8518
  static createPredefined(name: Config.PredefinedSystemConfiguration, qualifierDefaultValues?: Config.ISystemConfigurationInitParams['qualifierDefaultValues']): Result<ResourceManagerBuilder>;
8519
+ /**
8520
+ * Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} from a
8521
+ * {@link ResourceJson.Compiled.ICompiledResourceCollection | compiled resource collection}.
8522
+ * This method reconstructs an exactly equivalent builder where all qualifier, condition,
8523
+ * condition set, and decision indices match the original compiled collection.
8524
+ * @param compiledCollection - The compiled resource collection to reconstruct from.
8525
+ * @param systemConfig - The system configuration containing qualifiers and resource types.
8526
+ * @returns `Success` with the new manager if successful, or `Failure` with an error message if not.
8527
+ * @public
8528
+ */
8529
+ static createFromCompiledResourceCollection(compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection, systemConfig: Config.SystemConfiguration): Result<ResourceManagerBuilder>;
7400
8530
  /**
7401
8531
  * Given a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration}, builds and adds
7402
8532
  * a {@link Resources.ResourceCandidate | candidate} to the manager.
@@ -7450,6 +8580,19 @@ export declare class ResourceManagerBuilder implements IResourceManager {
7450
8580
  * @public
7451
8581
  */
7452
8582
  getAllBuiltResources(): Result<ReadonlyArray<Resource>>;
8583
+ /**
8584
+ * Builds and returns a hierarchical tree representation of all resources managed by this builder.
8585
+ * Resources are organized based on their dot-separated resource IDs (e.g., "app.messages.welcome"
8586
+ * becomes a tree with "app" as root, "messages" as branch, and "welcome" as leaf).
8587
+ *
8588
+ * String-based validation is available through the `children.validating` property,
8589
+ * allowing callers to use `tree.children.validating.getById(stringId)` for validated access.
8590
+ *
8591
+ * Uses lazy initialization with caching for performance.
8592
+ * @returns Result containing the resource tree root, or failure if tree construction fails
8593
+ * @public
8594
+ */
8595
+ getBuiltResourceTree(): Result<ResourceTree.IReadOnlyResourceTreeRoot<Resource>>;
7453
8596
  /**
7454
8597
  * Gets a read-only array of all {@link Resources.Resource | built resources} in the manager.
7455
8598
  * @returns `Success` with an array of resources if successful, or `Failure` with an error message if not.
@@ -7523,12 +8666,17 @@ export declare class ResourceManagerBuilder implements IResourceManager {
7523
8666
  */
7524
8667
  getResourceCollectionDecl(options?: IResourceDeclarationOptions): Result<ResourceJson.Normalized.IResourceCollectionDecl>;
7525
8668
  /**
7526
- * Creates a filtered clone of this ResourceManagerBuilder using the specified context.
7527
- * This is a convenience method that creates a new ResourceManagerBuilder with the same
7528
- * configuration but filtered to include only candidates that match the provided context.
7529
- * If candidates are provided for editing, they will be applied with collision detection.
7530
- * @param options - Options for the cloning operation, including the strongly-typed filterForContext property and optional candidates for edits.
7531
- * @returns A Result containing the new filtered ResourceManagerBuilder.
8669
+ * Creates a clone of this ResourceManagerBuilder with optional configuration overrides.
8670
+ * This method creates a new ResourceManagerBuilder that can optionally use different
8671
+ * qualifiers and/or resource types than the original. It can also be filtered to include
8672
+ * only candidates that match the provided context and apply candidate edits.
8673
+ *
8674
+ * @param options - Options for the cloning operation:
8675
+ * - `qualifiers`: Optional qualifier collector to use instead of the original
8676
+ * - `resourceTypes`: Optional resource type collector to use instead of the original
8677
+ * - `filterForContext`: Optional context filter for candidates
8678
+ * - `candidates`: Optional candidate edits to apply during cloning
8679
+ * @returns A Result containing the new ResourceManagerBuilder with the specified configuration.
7532
8680
  * @public
7533
8681
  */
7534
8682
  clone(options?: IResourceManagerCloneOptions): Result<ResourceManagerBuilder>;
@@ -7547,7 +8695,6 @@ export declare class ResourceManagerBuilder implements IResourceManager {
7547
8695
  * @returns A Result containing the ConditionSet token if successful, or failure if validation fails
7548
8696
  * @internal
7549
8697
  */
7550
- private static _getConditionSetToken;
7551
8698
  /**
7552
8699
  * Applies candidate edits to a resource declaration, handling collisions using condition set tokens.
7553
8700
  * If there's no collision, adds the candidate. If there's a collision, replaces the original candidate with the edit.
@@ -7568,6 +8715,49 @@ export declare class ResourceManagerBuilder implements IResourceManager {
7568
8715
  * @internal
7569
8716
  */
7570
8717
  private static _createResourceDeclFromCandidates;
8718
+ /**
8719
+ * Reconstructs conditions from a compiled collection and adds them to the builder.
8720
+ * @param builder - The builder to add conditions to.
8721
+ * @param compiledCollection - The compiled collection containing conditions.
8722
+ * @returns `Success` if all conditions were added successfully, `Failure` otherwise.
8723
+ * @internal
8724
+ */
8725
+ private static _reconstructConditions;
8726
+ /**
8727
+ * Reconstructs condition sets from a compiled collection and adds them to the builder.
8728
+ * @param builder - The builder to add condition sets to.
8729
+ * @param compiledCollection - The compiled collection containing condition sets.
8730
+ * @returns `Success` if all condition sets were added successfully, `Failure` otherwise.
8731
+ * @internal
8732
+ */
8733
+ private static _reconstructConditionSets;
8734
+ /**
8735
+ * Reconstructs decisions from a compiled collection and adds them to the builder.
8736
+ * @param builder - The builder to add decisions to.
8737
+ * @param compiledCollection - The compiled collection containing decisions.
8738
+ * @returns `Success` if all decisions were added successfully, `Failure` otherwise.
8739
+ * @internal
8740
+ */
8741
+ private static _reconstructDecisions;
8742
+ /**
8743
+ * Reconstructs resources and their candidates from a compiled collection and adds them to the builder.
8744
+ * @param builder - The builder to add resources to.
8745
+ * @param compiledCollection - The compiled collection containing resources.
8746
+ * @returns `Success` if all resources were added successfully, `Failure` otherwise.
8747
+ * @internal
8748
+ */
8749
+ private static _reconstructResources;
8750
+ /**
8751
+ * Helper method to create candidates from a decision's condition sets.
8752
+ * @param compiledResource - The compiled resource containing candidates.
8753
+ * @param decision - The decision containing condition sets.
8754
+ * @param resourceType - The resource type for the candidates.
8755
+ * @param builder - The builder to add candidates to.
8756
+ * @param candidateValues - Array of candidate values indexed by valueIndex.
8757
+ * @returns `Success` if all candidates were added successfully, `Failure` otherwise.
8758
+ * @internal
8759
+ */
8760
+ private static _createCandidatesFromDecision;
7571
8761
  }
7572
8762
 
7573
8763
  /**
@@ -7594,7 +8784,7 @@ declare const resourceName: Converter<ResourceName, unknown>;
7594
8784
  * and caching results for optimal performance.
7595
8785
  * @public
7596
8786
  */
7597
- export declare class ResourceResolver {
8787
+ export declare class ResourceResolver implements IResourceResolver {
7598
8788
  /**
7599
8789
  * The resource manager that defines available resources and provides condition access.
7600
8790
  */
@@ -7611,6 +8801,10 @@ export declare class ResourceResolver {
7611
8801
  * The configuration options for this resource resolver.
7612
8802
  */
7613
8803
  readonly options: IResourceResolverOptions;
8804
+ /**
8805
+ * The readonly qualifier collector that provides qualifier implementations.
8806
+ */
8807
+ get qualifiers(): IReadOnlyQualifierCollector;
7614
8808
  /**
7615
8809
  * The cache array for resolved conditions, indexed by condition index for O(1) lookup.
7616
8810
  * Each entry stores the resolved {@link Runtime.IConditionMatchResult | condition match result} for
@@ -7695,6 +8889,15 @@ export declare class ResourceResolver {
7695
8889
  * @public
7696
8890
  */
7697
8891
  resolveResource(resource: IResource): Result<IResourceCandidate>;
8892
+ /**
8893
+ * Resolves a resource by finding the best matching candidate.
8894
+ * Uses the resource's associated decision to determine the best match based on the current context.
8895
+ * @param resource - The string id of the resource to resolve.
8896
+ * @returns `Success` with the best matching candidate if successful,
8897
+ * or `Failure` with an error message if no candidates match or resolution fails.
8898
+ * @public
8899
+ */
8900
+ resolveResource(resource: string): Result<IResourceCandidate>;
7698
8901
  /**
7699
8902
  * Resolves all matching resource candidates in priority order.
7700
8903
  * Uses the resource's associated decision to determine all matching candidates based on the current context.
@@ -7704,6 +8907,15 @@ export declare class ResourceResolver {
7704
8907
  * @public
7705
8908
  */
7706
8909
  resolveAllResourceCandidates(resource: IResource): Result<ReadonlyArray<IResourceCandidate>>;
8910
+ /**
8911
+ * Resolves all matching resource candidates in priority order.
8912
+ * Uses the resource's associated decision to determine all matching candidates based on the current context.
8913
+ * @param resource - The string id of the resource to resolve.
8914
+ * @returns `Success` with an array of all matching candidates in priority order if successful,
8915
+ * or `Failure` with an error message if no candidates match or resolution fails.
8916
+ * @public
8917
+ */
8918
+ resolveAllResourceCandidates(resource: string): Result<ReadonlyArray<IResourceCandidate>>;
7707
8919
  /**
7708
8920
  * Resolves a resource to a composed value by merging matching candidates according to their merge methods.
7709
8921
  * Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
@@ -7714,6 +8926,20 @@ export declare class ResourceResolver {
7714
8926
  * @public
7715
8927
  */
7716
8928
  resolveComposedResourceValue(resource: IResource): Result<JsonValue>;
8929
+ /**
8930
+ * Resolves a resource to a composed value by merging matching candidates according to their merge methods.
8931
+ * Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
8932
+ * priority "partial" candidates into it in ascending order of priority.
8933
+ * @param resource - The string id of the resource to resolve.
8934
+ * @returns `Success` with the composed JsonValue if successful,
8935
+ * or `Failure` with an error message if no candidates match or resolution fails.
8936
+ * @public
8937
+ */
8938
+ resolveComposedResourceValue(resource: string): Result<JsonValue>;
8939
+ /**
8940
+ * {@inheritDoc IResourceResolver.withContext}
8941
+ */
8942
+ withContext(context: Record<string, string>): Result<ResourceResolver>;
7717
8943
  /**
7718
8944
  * Clears all caches (condition, condition set, and decision), forcing all cached items
7719
8945
  * to be re-evaluated on next access. This should be called when the context changes and cached
@@ -7801,6 +9027,11 @@ declare namespace Resources {
7801
9027
  ICandidateInfo,
7802
9028
  IReducedCandidate,
7803
9029
  CandidateReducer,
9030
+ ICandidateValue,
9031
+ ICandidateValueCreateParams,
9032
+ CandidateValue,
9033
+ ICandidateValueCollectorCreateParams,
9034
+ CandidateValueCollector,
7804
9035
  IResourceCandidateCreateParams,
7805
9036
  ICandidateDeclOptions,
7806
9037
  ResourceCandidate,
@@ -7861,7 +9092,7 @@ declare const resourceTreeChildNodeDecl: Converter<Normalized.IResourceTreeChild
7861
9092
  * strongly-typed internal tree operations, ensuring type safety and consistent
7862
9093
  * error handling throughout the resource tree navigation.
7863
9094
  *
7864
- * @internal
9095
+ * @public
7865
9096
  */
7866
9097
  declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeChildren<T, string, string> {
7867
9098
  private readonly _inner;
@@ -7916,17 +9147,17 @@ declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeC
7916
9147
  */
7917
9148
  forEach(cb: (value: unknown, key: string, map: IReadOnlyResultMap<string, unknown>, thisArg?: unknown) => void, arg?: unknown): void;
7918
9149
  /**
7919
- * Gets a child node by its ResourceName key with detailed error information.
7920
- * @param key - The ResourceName key to look up
9150
+ * Gets a child node by its string key with detailed error information.
9151
+ * @param key - The string key to look up
7921
9152
  * @returns DetailedResult containing the node if found, or failure with details
7922
9153
  */
7923
- get(key: ResourceName): DetailedResult<IReadOnlyResourceTreeNode<T>, Collections.ResultMapResultDetail>;
9154
+ get(key: string): DetailedResult<IReadOnlyResourceTreeNode<T>, Collections.ResultMapResultDetail>;
7924
9155
  /**
7925
- * Checks if a child node exists at the given ResourceName key.
7926
- * @param key - The ResourceName key to check
9156
+ * Checks if a child node exists at the given string key.
9157
+ * @param key - The string key to check
7927
9158
  * @returns True if a child node exists at the key, false otherwise
7928
9159
  */
7929
- has(key: ResourceName): boolean;
9160
+ has(key: string): boolean;
7930
9161
  /**
7931
9162
  * Returns an iterator of ResourceName keys for all child nodes.
7932
9163
  * @returns Map iterator for all child node keys
@@ -7950,6 +9181,111 @@ declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeC
7950
9181
  */
7951
9182
  declare type ResourceTreeNodeInit<T> = IResourceTreeLeafInit<T> | IResourceTreeBranchInit<T>;
7952
9183
 
9184
+ /**
9185
+ * Specialized resolver for resource tree operations, providing enhanced APIs for
9186
+ * resolving entire resource trees from either resource IDs or pre-built tree nodes.
9187
+ *
9188
+ * This class provides a clean separation between individual resource resolution
9189
+ * (handled by ResourceResolver) and tree-based operations, with support for
9190
+ * lazy tree construction and enhanced error handling.
9191
+ *
9192
+ * @public
9193
+ */
9194
+ declare class ResourceTreeResolver {
9195
+ /**
9196
+ * The {@link Runtime.ResourceResolver | ResourceResolver} to use for individual resource resolution
9197
+ */
9198
+ readonly resolver: ResourceResolver;
9199
+ /**
9200
+ * The {@link Runtime.IResourceManager | IResourceManager} to use for lazy tree construction.
9201
+ * @internal
9202
+ */
9203
+ private readonly _resourceManager;
9204
+ /**
9205
+ * The built resource tree, lazily built on first access.
9206
+ * @internal
9207
+ */
9208
+ private _tree?;
9209
+ /**
9210
+ * Creates a {@link Runtime.ResourceTreeResolver | ResourceTreeResolver} instance.
9211
+ * @param resolver - The ResourceResolver to use for individual resource resolution
9212
+ */
9213
+ constructor(resolver: ResourceResolver);
9214
+ /**
9215
+ * Creates a {@link Runtime.ResourceTreeResolver | ResourceTreeResolver} instance.
9216
+ * @param resolver - The ResourceResolver to use for individual resource resolution
9217
+ */
9218
+ static create(resolver: ResourceResolver): Result<ResourceTreeResolver>;
9219
+ /**
9220
+ * Gets the built resource tree, building it lazily on first access.
9221
+ * @returns The resource tree root
9222
+ * @throws Error if no resource manager was provided or tree building fails
9223
+ * @public
9224
+ */
9225
+ get tree(): IReadOnlyResourceTreeRoot<IResource>;
9226
+ /**
9227
+ * Resolves a resource tree from a resource ID, building the tree lazily from the resource manager.
9228
+ * @param resourceId - The ID of the root resource to resolve
9229
+ * @param options - Optional configuration for error handling during resolution
9230
+ * @returns Success with the composed JsonObject or undefined, or Failure with error message
9231
+ * @public
9232
+ */
9233
+ resolveComposedResourceTree(resourceId: string, options?: IResolveResourceTreeOptions): Result<JsonObject | undefined>;
9234
+ /**
9235
+ * Resolves a pre-built resource tree node.
9236
+ * @param node - The resource tree node to resolve
9237
+ * @param options - Optional configuration for error handling during resolution
9238
+ * @returns Success with the composed JsonObject or undefined, or Failure with error message
9239
+ * @public
9240
+ */
9241
+ resolveComposedResourceTree(node: IReadOnlyResourceTreeNode<IResource>, options?: IResolveResourceTreeOptions): Result<JsonObject | undefined>;
9242
+ private _getTree;
9243
+ /**
9244
+ * Resolves a tree from a resource ID by first building the tree from the resource manager.
9245
+ * @internal
9246
+ */
9247
+ private _resolveFromResourceId;
9248
+ /**
9249
+ * Resolves a pre-built tree node using the extracted tree resolution logic.
9250
+ * @internal
9251
+ */
9252
+ private _resolveFromTreeNode;
9253
+ /**
9254
+ * Handles resource resolution errors according to the specified mode.
9255
+ * @param resource - The resource that failed to resolve
9256
+ * @param message - The error message from the failed resolution
9257
+ * @param mode - The error handling mode
9258
+ * @param path - The path to the resource in the tree (for error context)
9259
+ * @internal
9260
+ */
9261
+ private _handleResourceError;
9262
+ /**
9263
+ * Handles empty branch nodes according to the specified mode.
9264
+ * @param node - The empty branch node
9265
+ * @param failedChildren - Names of children that failed to resolve
9266
+ * @param mode - The empty branch handling mode
9267
+ * @param path - The path to the branch in the tree (for error context)
9268
+ * @internal
9269
+ */
9270
+ private _handleEmptyBranch;
9271
+ /**
9272
+ * Processes a leaf node by resolving its resource value.
9273
+ * @param node - The leaf node to process (must be a leaf node)
9274
+ * @param path - The path to the node in the tree
9275
+ * @param resourceErrorMode - How to handle resource resolution errors
9276
+ * @internal
9277
+ */
9278
+ private _processLeafNode;
9279
+ /**
9280
+ * Processes a branch node by recursively resolving all its children.
9281
+ * @param node - The branch node to process (must be a branch node)
9282
+ * @param path - The path to the node in the tree
9283
+ * @param options - Resolution options
9284
+ * @internal
9285
+ */
9286
+ private _processBranchNode;
9287
+ }
9288
+
7953
9289
  /**
7954
9290
  * `Converter` for a normalized {@link ResourceJson.Normalized.IResourceTreeRootDecl | resource tree root declaration}.
7955
9291
  * @public
@@ -7962,17 +9298,22 @@ declare const resourceTreeRootDecl: Converter<Normalized.IResourceTreeRootDecl>;
7962
9298
  * resource value.
7963
9299
  * @public
7964
9300
  */
7965
- export declare abstract class ResourceType<T = unknown> implements ICollectible<ResourceTypeName, ResourceTypeIndex> {
9301
+ export declare abstract class ResourceType<T = unknown> implements IResourceType<T> {
7966
9302
  private _collectible;
9303
+ private _template;
7967
9304
  /**
7968
- * The key for this resource type.
9305
+ * {@inheritdoc ResourceTypes.IResourceType.key}
7969
9306
  */
7970
9307
  get key(): ResourceTypeName;
7971
9308
  /**
7972
- * The index for this resource type.
9309
+ * Name of the underlying system type.
9310
+ */
9311
+ abstract readonly systemTypeName: ResourceTypeName;
9312
+ /**
9313
+ * {@inheritdoc ResourceTypes.IResourceType.index}
7973
9314
  */
7974
9315
  get index(): ResourceTypeIndex | undefined;
7975
- protected constructor(key: ResourceTypeName, index?: number);
9316
+ protected constructor(key: ResourceTypeName, index?: number, template?: JsonObject);
7976
9317
  /**
7977
9318
  * Validates properties of a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration} for
7978
9319
  * a resource instance value.
@@ -8022,6 +9363,25 @@ export declare abstract class ResourceType<T = unknown> implements ICollectible<
8022
9363
  * Sets the index for this resource type. Once set, the index cannot be changed.
8023
9364
  */
8024
9365
  setIndex(index: number): Result<ResourceTypeIndex>;
9366
+ /**
9367
+ * Creates a template for a new resource of this type.
9368
+ * Default implementation provides a basic template.
9369
+ * Subclasses can override to provide type-specific templates.
9370
+ * @param resourceId - The id for the new resource
9371
+ * @param init - An optional initial value for the resource.
9372
+ * @param conditions - An optional set of conditions that must be met for the resource to be selected.
9373
+ * @param resolver - An optional resource resolver that can be used to create the template.
9374
+ * @returns A loose resource declaration with default values for this resource type
9375
+ * @public
9376
+ */
9377
+ createTemplate(resourceId: ResourceId, init?: JsonValue, conditions?: ResourceJson.Json.ConditionSetDecl, resolver?: IResourceResolver): Result<ResourceJson.Json.ILooseResourceDecl>;
9378
+ /**
9379
+ * Gets the default template value for this resource type.
9380
+ * Subclasses should override this to provide type-specific default values.
9381
+ * @returns The default JSON value for a new resource of this type
9382
+ * @public
9383
+ */
9384
+ getDefaultTemplateCandidate(json?: JsonValue, conditions?: ResourceJson.Json.ConditionSetDecl, __resolver?: IResourceResolver): Result<ResourceJson.Json.IChildResourceCandidateDecl>;
8025
9385
  }
8026
9386
 
8027
9387
  /**
@@ -8045,7 +9405,30 @@ declare class ResourceTypeCollector extends ValidatingCollector<ResourceType> {
8045
9405
  * @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
8046
9406
  * @public
8047
9407
  */
8048
- declare const resourceTypeConfig: ObjectConverter<IResourceTypeConfig, unknown>;
9408
+ declare const resourceTypeConfig: ObjectConverter<IResourceTypeConfig<JsonObject>, unknown>;
9409
+
9410
+ /**
9411
+ * A factory that creates a {@link ResourceTypes.ResourceType | ResourceType} from a {@link ResourceTypes.Config.IResourceTypeConfig | resource type configuration}
9412
+ * by chaining a supplied factory with a {@link Config.BuiltInResourceTypeFactory | built-in factory} that handles built-in resource types.
9413
+ * @public
9414
+ */
9415
+ declare class ResourceTypeFactory extends ChainedConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> {
9416
+ /**
9417
+ * Constructor for a resource type factory.
9418
+ * @param factories - Array of factories for resource types. Can be:
9419
+ * - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
9420
+ * - {@link Config.ResourceTypeFactoryFunction | Factory functions}
9421
+ * - A mix of both
9422
+ * @remarks The {@link Config.BuiltInResourceTypeFactory | built-in factory} is always added to the end of the chain.
9423
+ */
9424
+ constructor(factories: Array<IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> | ResourceTypeFactoryFunction>);
9425
+ }
9426
+
9427
+ /**
9428
+ * Function signature for creating a resource type from configuration.
9429
+ * @public
9430
+ */
9431
+ declare type ResourceTypeFactoryFunction = (config: ResourceTypes.Config.IResourceTypeConfig) => Result<ResourceType>;
8049
9432
 
8050
9433
  /**
8051
9434
  * Branded number representing a validated resource type index.
@@ -8075,6 +9458,7 @@ declare namespace ResourceTypes {
8075
9458
  export {
8076
9459
  Config_3 as Config,
8077
9460
  IResourceCandidateValidationProperties,
9461
+ IResourceType,
8078
9462
  ResourceType,
8079
9463
  IResourceCollectorCreateParams,
8080
9464
  ResourceTypeCollector,
@@ -8118,6 +9502,10 @@ declare namespace Runtime {
8118
9502
  IResourceResolverOptions,
8119
9503
  IResourceResolverCreateParams,
8120
9504
  ResourceResolver,
9505
+ ResourceErrorHandler,
9506
+ EmptyBranchHandler,
9507
+ IResolveResourceTreeOptions,
9508
+ ResourceTreeResolver,
8121
9509
  ConditionMatchType,
8122
9510
  IConditionMatchResult,
8123
9511
  ConditionSetResolutionResult,
@@ -8133,6 +9521,14 @@ declare namespace Runtime {
8133
9521
  }
8134
9522
  export { Runtime }
8135
9523
 
9524
+ /**
9525
+ * Create a safe filename by removing invalid characters
9526
+ * @param filename - Original filename
9527
+ * @returns Sanitized filename
9528
+ * @public
9529
+ */
9530
+ declare function sanitizeFilename(filename: string): string;
9531
+
8136
9532
  /**
8137
9533
  * @internal
8138
9534
  */
@@ -8143,7 +9539,12 @@ declare const segmentedIdentifier: RegExp;
8143
9539
  * using a `ResultMap` for qualifier value storage.
8144
9540
  * @public
8145
9541
  */
8146
- declare class SimpleContextQualifierProvider extends ContextQualifierProvider {
9542
+ declare class SimpleContextQualifierProvider extends ContextQualifierProvider implements IMutableContextQualifierProvider {
9543
+ /**
9544
+ * Explicit mutability marker for compile-time type discrimination.
9545
+ * Always `true` for mutable providers.
9546
+ */
9547
+ readonly mutable: true;
8147
9548
  /**
8148
9549
  * The readonly qualifier collector that defines and validates the qualifiers for this context.
8149
9550
  */
@@ -8221,6 +9622,14 @@ declare class SimpleContextQualifierProvider extends ContextQualifierProvider {
8221
9622
  * @public
8222
9623
  */
8223
9624
  clear(): void;
9625
+ /**
9626
+ * Resolves a qualifier from a name, index, or qualifier object.
9627
+ * @param nameOrIndexOrQualifier - The input to resolve.
9628
+ * @returns `Success` with the {@link Qualifier | qualifier} if successful,
9629
+ * or `Failure` with an error message if not found or invalid.
9630
+ * @internal
9631
+ */
9632
+ private _resolveQualifier;
8224
9633
  /**
8225
9634
  * Resolves a qualifier name from a name, index, or qualifier object.
8226
9635
  * @param nameOrIndexOrQualifier - The input to resolve.
@@ -8229,6 +9638,14 @@ declare class SimpleContextQualifierProvider extends ContextQualifierProvider {
8229
9638
  * @internal
8230
9639
  */
8231
9640
  private _resolveQualifierName;
9641
+ /**
9642
+ * Resolves a qualifier name from a qualifier-like object.
9643
+ * @param nameOrIndexOrQualifier - The input to resolve.
9644
+ * @returns `Success` with the {@link QualifierName | qualifier name} if successful,
9645
+ * or `Failure` with an error message if not found or invalid.
9646
+ * @internal
9647
+ */
9648
+ private static _qualifierNameFromQualifierLike;
8232
9649
  }
8233
9650
 
8234
9651
  /**
@@ -8274,7 +9691,7 @@ declare class SystemConfiguration {
8274
9691
  * @param config - The {@link Config.Model.ISystemConfiguration | system configuration} to use.
8275
9692
  * @public
8276
9693
  */
8277
- protected constructor(config: ISystemConfiguration);
9694
+ protected constructor(config: ISystemConfiguration, initParams?: ISystemConfigurationInitParams);
8278
9695
  /**
8279
9696
  * Creates a new {@link Config.SystemConfiguration | SystemConfiguration} from the supplied
8280
9697
  * {@link Config.Model.ISystemConfiguration | system configuration}.
@@ -8285,6 +9702,14 @@ declare class SystemConfiguration {
8285
9702
  * @public
8286
9703
  */
8287
9704
  static create(config: ISystemConfiguration, initParams?: ISystemConfigurationInitParams): Result<SystemConfiguration>;
9705
+ /**
9706
+ * Loads a {@link Config.SystemConfiguration | SystemConfiguration} from a file.
9707
+ * @param path - The path to the file to load.
9708
+ * @returns `Success` with the {@link Config.SystemConfiguration | SystemConfiguration}
9709
+ * if successful, `Failure` with an error message otherwise.
9710
+ * @public
9711
+ */
9712
+ static loadFromFile(path: string, initParams?: ISystemConfigurationInitParams): Result<SystemConfiguration>;
8288
9713
  /**
8289
9714
  * Returns the {@link Config.Model.ISystemConfiguration | system configuration} that this
8290
9715
  * {@link Config.SystemConfiguration | SystemConfiguration} was created from.
@@ -8302,6 +9727,13 @@ declare class SystemConfiguration {
8302
9727
  */
8303
9728
  declare const systemConfiguration: ObjectConverter<ISystemConfiguration, unknown>;
8304
9729
 
9730
+ /**
9731
+ * Validator for system configuration (delegates to config packlet)
9732
+ * This validates that the parsed JSON conforms to the system configuration schema
9733
+ * @public
9734
+ */
9735
+ declare const systemConfiguration_2: Validator<Model.ISystemConfiguration>;
9736
+
8305
9737
  /**
8306
9738
  * A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
8307
9739
  * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
@@ -8316,6 +9748,14 @@ declare const systemLanguageQualifierTypeConfig: ObjectConverter<Model_2.ISystem
8316
9748
  */
8317
9749
  declare const systemLiteralQualifierTypeConfig: ObjectConverter<Model_2.ISystemLiteralQualifierTypeConfig, unknown>;
8318
9750
 
9751
+ /**
9752
+ * A discriminated union of all system qualifier types.
9753
+ * This allows TypeScript to properly discriminate between specific qualifier type implementations
9754
+ * and access their specific methods like getConfiguration().
9755
+ * @public
9756
+ */
9757
+ declare type SystemQualifierType = LanguageQualifierType | TerritoryQualifierType | LiteralQualifierType;
9758
+
8319
9759
  /**
8320
9760
  * A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
8321
9761
  * @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
@@ -8359,7 +9799,11 @@ declare const TerritoryPrioritySystemConfiguration: ISystemConfiguration;
8359
9799
  * implementation handles incorrect casing.
8360
9800
  * @public
8361
9801
  */
8362
- declare class TerritoryQualifierType extends QualifierType {
9802
+ declare class TerritoryQualifierType extends QualifierType<JsonCompatible<Config_2.ITerritoryQualifierTypeConfig>> {
9803
+ /**
9804
+ * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
9805
+ */
9806
+ readonly systemTypeName: QualifierTypeName;
8363
9807
  /**
8364
9808
  * Optional array enumerating allowed territories to further constrain the type.
8365
9809
  */
@@ -8401,6 +9845,27 @@ declare class TerritoryQualifierType extends QualifierType {
8401
9845
  * @public
8402
9846
  */
8403
9847
  static createFromConfig(config: Config_2.IQualifierTypeConfig<Config_2.ITerritoryQualifierTypeConfig>): Result<TerritoryQualifierType>;
9848
+ /**
9849
+ * Gets the {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | strongly typed configuration}
9850
+ * for this qualifier type.
9851
+ * @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
9852
+ */
9853
+ getConfiguration(): Result<Config_2.ISystemTerritoryQualifierTypeConfig>;
9854
+ /**
9855
+ * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
9856
+ */
9857
+ getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemTerritoryQualifierTypeConfig>>;
9858
+ /**
9859
+ * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
9860
+ */
9861
+ validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemTerritoryQualifierTypeConfig>>;
9862
+ /**
9863
+ * Validates a {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | strongly typed configuration object}
9864
+ * for this qualifier type.
9865
+ * @param from - The unknown data to validate as a configuration object.
9866
+ * @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
9867
+ */
9868
+ validateConfiguration(from: unknown): Result<Config_2.ISystemTerritoryQualifierTypeConfig>;
8404
9869
  /**
8405
9870
  * {@inheritdoc QualifierTypes.QualifierType._matchOne}
8406
9871
  */
@@ -8433,6 +9898,26 @@ declare class TerritoryQualifierType extends QualifierType {
8433
9898
  */
8434
9899
  declare const territoryQualifierTypeConfig: ObjectConverter<Model_2.ITerritoryQualifierTypeConfig, unknown>;
8435
9900
 
9901
+ /**
9902
+ * Converts a number to a {@link CandidateValueIndex | candidate value index}.
9903
+ *
9904
+ * @param index - The number to convert.
9905
+ * @returns `Success` with the converted index if valid, or `Failure` with an error message
9906
+ * if not.
9907
+ * @public
9908
+ */
9909
+ declare function toCandidateValueIndex(index: number): Result<CandidateValueIndex>;
9910
+
9911
+ /**
9912
+ * Converts a string to a {@link CandidateValueKey | candidate value key}.
9913
+ *
9914
+ * @param key - The key to convert.
9915
+ * @returns `Success` with the converted key if valid, or `Failure` with an error message
9916
+ * if not.
9917
+ * @public
9918
+ */
9919
+ declare function toCandidateValueKey(key: string): Result<CandidateValueKey>;
9920
+
8436
9921
  /**
8437
9922
  * Converts a number to a {@link ConditionIndex} if it is a valid condition index.
8438
9923
  * @param index - the number to convert
@@ -8560,6 +10045,15 @@ declare function toDecisionKey(key: string): Result<DecisionKey>;
8560
10045
  */
8561
10046
  declare function toOptionalResourceId(id?: string): Result<ResourceId | undefined>;
8562
10047
 
10048
+ /**
10049
+ * Converts a string to a {@link QualifierContextValue} if it is a valid qualifier context value.
10050
+ * @param value - the string to convert
10051
+ * @returns `Success` with the converted {@link QualifierContextValue} if successful, or `Failure` with an
10052
+ * error message if not.
10053
+ * @public
10054
+ */
10055
+ declare function toQualifierContextValue(value: string): Result<QualifierContextValue>;
10056
+
8563
10057
  /**
8564
10058
  * Converts a string to a {@link QualifierDefaultValuesToken} if it is a valid qualifier default values token.
8565
10059
  * @param token - the string to convert
@@ -8703,7 +10197,9 @@ declare namespace Validate {
8703
10197
  isValidConditionSetHash,
8704
10198
  isValidDecisionKey,
8705
10199
  isValidDecisionIndex,
10200
+ isValidQualifierContextValue,
8706
10201
  toQualifierName,
10202
+ toQualifierContextValue,
8707
10203
  toQualifierIndex,
8708
10204
  toQualifierTypeName,
8709
10205
  toQualifierTypeIndex,
@@ -8732,12 +10228,16 @@ declare namespace Validate {
8732
10228
  isValidResourceIndex,
8733
10229
  isValidResourceTypeName,
8734
10230
  isValidResourceTypeIndex,
10231
+ isValidCandidateValueIndex,
10232
+ isValidCandidateValueKey,
8735
10233
  toResourceName,
8736
10234
  toResourceId,
8737
10235
  toOptionalResourceId,
8738
10236
  toResourceIndex,
8739
10237
  toResourceTypeName,
8740
- toResourceTypeIndex
10238
+ toResourceTypeIndex,
10239
+ toCandidateValueKey,
10240
+ toCandidateValueIndex
8741
10241
  }
8742
10242
  }
8743
10243
  export { Validate }
@@ -8782,19 +10282,107 @@ declare const validatedContextQualifierValueDecl: Converter<IValidatedContextQua
8782
10282
  */
8783
10283
  declare const validatedQualifierDecl: Converter<IValidatedQualifierDecl, IQualifierDeclConvertContext>;
8784
10284
 
10285
+ /**
10286
+ * Validate a {@link Config.Model.ISystemConfiguration | ISystemConfiguration} object.
10287
+ * @param config - The system configuration to validate
10288
+ * @returns `Success` with the validated system configuration if successful,
10289
+ * or `Failure` with an error message if validation fails.
10290
+ * @public
10291
+ */
10292
+ declare function validateSystemConfiguration(config: unknown): Result<ISystemConfiguration>;
10293
+
10294
+ /**
10295
+ * Validate a ZIP archive manifest object
10296
+ * @param manifest - Object to validate as manifest
10297
+ * @returns Result containing validated manifest
10298
+ * @public
10299
+ */
10300
+ declare function validateZipArchiveManifest(manifest: unknown): Result<Json_2.IZipArchiveManifest>;
10301
+
10302
+ /**
10303
+ * A factory that validates and creates {@link QualifierTypes.QualifierType | QualifierType} instances
10304
+ * from weakly-typed configuration objects. This factory accepts configurations with unvalidated
10305
+ * string properties and validates them before delegating to the underlying factory chain.
10306
+ *
10307
+ * This pattern is useful at package boundaries where type identity issues may occur with
10308
+ * branded types across different package instances.
10309
+ *
10310
+ * @example
10311
+ * ```typescript
10312
+ * // Accept weakly-typed config from external source
10313
+ * const validatingFactory = new ValidatingQualifierTypeFactory([customFactory]);
10314
+ *
10315
+ * // Config can have plain string types instead of branded types
10316
+ * const config = {
10317
+ * name: 'my-qualifier', // plain string, not QualifierTypeName
10318
+ * systemType: 'custom', // plain string
10319
+ * configuration: { ... }
10320
+ * };
10321
+ *
10322
+ * const result = validatingFactory.create(config); // Validates and converts internally
10323
+ * ```
10324
+ *
10325
+ * @public
10326
+ */
10327
+ declare class ValidatingQualifierTypeFactory<T extends QualifierType = SystemQualifierType> implements IConfigInitFactory<unknown, T | SystemQualifierType> {
10328
+ private readonly _innerFactory;
10329
+ /**
10330
+ * Constructor for a validating qualifier type factory.
10331
+ * @param factories - Array of factories for custom qualifier types. Can be:
10332
+ * - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
10333
+ * - {@link Config.QualifierTypeFactoryFunction | Factory functions}
10334
+ * - A mix of both
10335
+ */
10336
+ constructor(factories: Array<IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T> | QualifierTypeFactoryFunction<T>>);
10337
+ /**
10338
+ * Creates a qualifier type from a weakly-typed configuration object.
10339
+ * @param config - The configuration object to validate and use for creation.
10340
+ * @returns A result containing the new qualifier type if successful.
10341
+ */
10342
+ create(config: unknown): Result<T | SystemQualifierType>;
10343
+ }
10344
+
10345
+ /**
10346
+ * A factory that validates and creates {@link ResourceTypes.ResourceType | ResourceType} instances
10347
+ * from weakly-typed configuration objects. This factory accepts configurations with unvalidated
10348
+ * string properties and validates them before delegating to the underlying factory chain.
10349
+ *
10350
+ * This pattern is useful at package boundaries where type identity issues may occur with
10351
+ * branded types across different package instances.
10352
+ *
10353
+ * @public
10354
+ */
10355
+ declare class ValidatingResourceTypeFactory implements IConfigInitFactory<unknown, ResourceType> {
10356
+ private readonly _innerFactory;
10357
+ /**
10358
+ * Constructor for a validating resource type factory.
10359
+ * @param factories - Array of factories for resource types. Can be:
10360
+ * - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
10361
+ * - {@link Config.ResourceTypeFactoryFunction | Factory functions}
10362
+ * - A mix of both
10363
+ */
10364
+ constructor(factories: Array<IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> | ResourceTypeFactoryFunction>);
10365
+ /**
10366
+ * Creates a resource type from a weakly-typed configuration object.
10367
+ * @param config - The configuration object to validate and use for creation.
10368
+ * @returns A result containing the new resource type if successful.
10369
+ */
10370
+ create(config: unknown): Result<ResourceType>;
10371
+ }
10372
+
8785
10373
  /**
8786
10374
  * A {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider} with a
8787
- * {@link Runtime.Context.ContextQualifierProviderValidator | validator} property that enables
10375
+ * {@link Runtime.Context.MutableContextQualifierProviderValidator | validator} property that enables
8788
10376
  * validated use of the underlying provider with string keys and values.
8789
10377
  * This eliminates the need for type casting in consumer code.
8790
10378
  * @public
8791
10379
  */
8792
10380
  declare class ValidatingSimpleContextQualifierProvider extends SimpleContextQualifierProvider {
8793
10381
  /**
8794
- * A {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator} which validates
10382
+ * A {@link Runtime.Context.MutableContextQualifierProviderValidator | MutableContextQualifierProviderValidator} which validates
8795
10383
  * string inputs before passing them to this provider.
8796
10384
  */
8797
- readonly validating: IReadOnlyContextQualifierProviderValidator;
10385
+ readonly validating: IMutableContextQualifierProviderValidator;
8798
10386
  /**
8799
10387
  * Constructor for a {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider} object.
8800
10388
  * @param params - {@link Runtime.IValidatingSimpleContextQualifierProviderCreateParams | Parameters} used to create the provider.
@@ -8810,4 +10398,194 @@ declare class ValidatingSimpleContextQualifierProvider extends SimpleContextQual
8810
10398
  static create(params: IValidatingSimpleContextQualifierProviderCreateParams): Result<ValidatingSimpleContextQualifierProvider>;
8811
10399
  }
8812
10400
 
10401
+ declare namespace ZipArchive {
10402
+ export {
10403
+ Json_2 as Json,
10404
+ Convert_12 as Convert,
10405
+ ZipArchiveCreator,
10406
+ ZipArchiveLoader,
10407
+ IZipArchivePathOptions,
10408
+ IZipArchiveFileTreeOptions,
10409
+ ZipArchiveOptions,
10410
+ IZipArchiveResult,
10411
+ IZipArchiveManifest_2 as IZipArchiveManifest,
10412
+ IZipArchiveLoadOptions,
10413
+ IZipArchiveLoadResult,
10414
+ IImportedFile_2 as IImportedFile,
10415
+ IImportedDirectory_2 as IImportedDirectory,
10416
+ ZipArchiveProgressCallback,
10417
+ createZipArchiveManifest,
10418
+ parseZipArchiveManifest,
10419
+ validateZipArchiveManifest,
10420
+ parseZipArchiveConfiguration,
10421
+ generateZipArchiveFilename,
10422
+ normalizePath,
10423
+ getDirectoryName,
10424
+ sanitizeFilename,
10425
+ isZipFile,
10426
+ ZipArchiveConstants
10427
+ }
10428
+ }
10429
+ export { ZipArchive }
10430
+
10431
+ /**
10432
+ * Validator for ZIP archive config information
10433
+ * @public
10434
+ */
10435
+ declare const zipArchiveConfigInfo: Validator<Json_2.IZipArchiveConfigInfo>;
10436
+
10437
+ /**
10438
+ * Validator for ZIP archive config type
10439
+ * @public
10440
+ */
10441
+ declare const zipArchiveConfigType: Validator<'file'>;
10442
+
10443
+ /**
10444
+ * Constants for ZIP archive structure
10445
+ * @public
10446
+ */
10447
+ declare const ZipArchiveConstants: {
10448
+ /** Manifest file name */
10449
+ readonly MANIFEST_FILE: "manifest.json";
10450
+ /** Configuration file name */
10451
+ readonly CONFIG_FILE: "config.json";
10452
+ /** Input files directory */
10453
+ readonly INPUT_DIR: "input";
10454
+ /** Configuration files directory */
10455
+ readonly CONFIG_DIR: "config";
10456
+ };
10457
+
10458
+ /**
10459
+ * ZIP archive creator using fflate for universal compatibility
10460
+ * @public
10461
+ */
10462
+ declare class ZipArchiveCreator {
10463
+ /**
10464
+ * Create a ZIP archive buffer from a supplied buffer
10465
+ * @param options - Input paths and configuration
10466
+ * @param onProgress - Optional progress callback
10467
+ * @returns Result containing ZIP buffer and manifest
10468
+ */
10469
+ createFromBuffer(options: ZipArchiveOptions, onProgress?: ZipArchiveProgressCallback): Promise<Result<IZipArchiveResult>>;
10470
+ /**
10471
+ * Add a single FileTree item to the ZIP archive
10472
+ * @param files - ZIP files collection
10473
+ * @param fileItem - FileTree file item to add
10474
+ * @param archivePath - Path within the archive
10475
+ * @returns Result indicating success or failure
10476
+ */
10477
+ private _addFileTreeItemToZip;
10478
+ /**
10479
+ * Add a directory recursively to the ZIP archive using FileTree
10480
+ * @param files - ZIP files collection
10481
+ * @param directoryItem - FileTree directory item to add
10482
+ * @param archivePrefix - Prefix path within the archive
10483
+ * @param onProgress - Optional progress callback
10484
+ * @returns Result indicating success or failure
10485
+ */
10486
+ private _addDirectoryTreeToZip;
10487
+ private _getInputFileTreeItem;
10488
+ private _getConfigFileTreeItem;
10489
+ }
10490
+
10491
+ /**
10492
+ * Validator for ZIP archive input information
10493
+ * @public
10494
+ */
10495
+ declare const zipArchiveInputInfo: Validator<Json_2.IZipArchiveInputInfo>;
10496
+
10497
+ /**
10498
+ * Validator for ZIP archive input type
10499
+ * @public
10500
+ */
10501
+ declare const zipArchiveInputType: Validator<'file' | 'directory'>;
10502
+
10503
+ /**
10504
+ * ZIP archive loader extending ts-extras foundation
10505
+ * @public
10506
+ */
10507
+ declare class ZipArchiveLoader {
10508
+ /**
10509
+ * Load ZIP archive from File object (Browser)
10510
+ * @param file - File object from file input
10511
+ * @param options - Loading options
10512
+ * @param onProgress - Optional progress callback
10513
+ * @returns Result containing loaded archive data
10514
+ */
10515
+ loadFromFile(file: File, options?: IZipArchiveLoadOptions, onProgress?: ZipArchiveProgressCallback): Promise<Result<IZipArchiveLoadResult>>;
10516
+ /**
10517
+ * Load ZIP archive from ArrayBuffer (Universal)
10518
+ * @param buffer - ZIP data buffer
10519
+ * @param options - Loading options
10520
+ * @param onProgress - Optional progress callback
10521
+ * @returns Result containing loaded archive data
10522
+ */
10523
+ loadFromBuffer(buffer: ArrayBuffer, options?: IZipArchiveLoadOptions, onProgress?: ZipArchiveProgressCallback): Promise<Result<IZipArchiveLoadResult>>;
10524
+ /**
10525
+ * Load manifest from ZIP using ZipFileTreeAccessors
10526
+ * @param zipAccessors - ZIP file tree accessors
10527
+ * @returns Result containing parsed manifest
10528
+ */
10529
+ private _loadManifestFromAccessors;
10530
+ /**
10531
+ * Load configuration from ZIP using ZipFileTreeAccessors
10532
+ * @param zipAccessors - ZIP file tree accessors
10533
+ * @param manifest - Parsed manifest (may be undefined)
10534
+ * @param options - Loading options
10535
+ * @returns Result containing parsed configuration
10536
+ */
10537
+ private _loadConfigurationFromAccessors;
10538
+ /**
10539
+ * Extract files and directory structure from ZIP
10540
+ * @param zipAccessors - ZIP file tree accessors
10541
+ * @param onProgress - Optional progress callback
10542
+ * @returns Result containing files and directory structure
10543
+ */
10544
+ private _extractFilesFromAccessors;
10545
+ /**
10546
+ * Recursively process file tree items
10547
+ * @param zipAccessors - ZIP file tree accessors
10548
+ * @param currentPath - Current directory path
10549
+ * @param items - Items to process
10550
+ * @param files - Files collection
10551
+ * @param directories - Directories collection
10552
+ * @param onProgress - Optional progress callback
10553
+ * @param processed - Processing counter
10554
+ */
10555
+ private _processFileTreeItems;
10556
+ /**
10557
+ * Build directory structure from files
10558
+ * @param files - Extracted files
10559
+ * @param directories - Directories map
10560
+ * @returns Root directory structure or null
10561
+ */
10562
+ private _buildDirectoryStructure;
10563
+ /**
10564
+ * Get file MIME type based on extension
10565
+ * @param filename - Filename
10566
+ * @returns MIME type
10567
+ */
10568
+ private _getFileType;
10569
+ }
10570
+
10571
+ /**
10572
+ * Validator for ZIP archive manifest
10573
+ * Compatible with existing tools from ts-res-browser-cli
10574
+ * @public
10575
+ */
10576
+ declare const zipArchiveManifest: Validator<Json_2.IZipArchiveManifest>;
10577
+
10578
+ /**
10579
+ * Options for creating a ZIP archive buffer
10580
+ * @public
10581
+ */
10582
+ declare type ZipArchiveOptions = IZipArchivePathOptions | IZipArchiveFileTreeOptions;
10583
+
10584
+ /**
10585
+ * Progress callback for ZIP operations
10586
+ * @public
10587
+ */
10588
+ declare type ZipArchiveProgressCallback = (stage: 'reading-file' | 'parsing-zip' | 'loading-manifest' | 'loading-config' | 'extracting-files' | 'processing-resources' | 'creating-zip', progress: number, // 0-100
10589
+ details: string) => void;
10590
+
8813
10591
  export { }