@fgv/ts-res 5.0.0-9 → 5.0.1-1
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.
- package/CHANGELOG.json +21 -0
- package/CHANGELOG.md +14 -1
- package/README.md +794 -137
- package/dist/ts-res.d.ts +2257 -268
- package/dist/tsdoc-metadata.json +1 -1
- package/eslint.config.js +16 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -1
- package/lib/packlets/bundle/bundleBuilder.js +7 -4
- package/lib/packlets/bundle/bundleLoader.js +1 -0
- package/lib/packlets/bundle/bundleUtils.js +14 -16
- package/lib/packlets/bundle/index.d.ts +3 -1
- package/lib/packlets/bundle/index.js +14 -3
- package/lib/packlets/common/convert.d.ts +15 -0
- package/lib/packlets/common/convert.js +16 -1
- package/lib/packlets/common/helpers/context.js +1 -0
- package/lib/packlets/common/helpers/resources.d.ts +7 -0
- package/lib/packlets/common/helpers/resources.js +13 -0
- package/lib/packlets/common/resources.d.ts +44 -1
- package/lib/packlets/common/validate/conditions.d.ts +17 -1
- package/lib/packlets/common/validate/conditions.js +32 -6
- package/lib/packlets/common/validate/regularExpressions.d.ts +4 -0
- package/lib/packlets/common/validate/regularExpressions.js +5 -1
- package/lib/packlets/common/validate/resources.d.ts +35 -1
- package/lib/packlets/common/validate/resources.js +55 -0
- package/lib/packlets/conditions/condition.js +1 -0
- package/lib/packlets/conditions/conditionSet.d.ts +9 -0
- package/lib/packlets/conditions/conditionSet.js +75 -1
- package/lib/packlets/config/configInitFactory.d.ts +217 -0
- package/lib/packlets/config/configInitFactory.js +302 -0
- package/lib/packlets/config/convert.d.ts +9 -0
- package/lib/packlets/config/convert.js +12 -1
- package/lib/packlets/config/index.d.ts +1 -0
- package/lib/packlets/config/index.js +1 -0
- package/lib/packlets/config/json.d.ts +1 -1
- package/lib/packlets/config/systemConfiguration.d.ts +16 -3
- package/lib/packlets/config/systemConfiguration.js +19 -40
- package/lib/packlets/import/fsItem.d.ts +2 -1
- package/lib/packlets/import/fsItem.js +9 -13
- package/lib/packlets/import/importManager.d.ts +2 -1
- package/lib/packlets/import/importers/jsonImporter.js +1 -0
- package/lib/packlets/import/importers/pathImporter.d.ts +2 -1
- package/lib/packlets/import/importers/pathImporter.js +2 -1
- package/lib/packlets/qualifier-types/config/convert.d.ts +22 -1
- package/lib/packlets/qualifier-types/config/convert.js +67 -2
- package/lib/packlets/qualifier-types/config/json.d.ts +24 -2
- package/lib/packlets/qualifier-types/config/json.js +11 -0
- package/lib/packlets/qualifier-types/convert.d.ts +1 -1
- package/lib/packlets/qualifier-types/helpers.d.ts +14 -5
- package/lib/packlets/qualifier-types/helpers.js +2 -2
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts +28 -2
- package/lib/packlets/qualifier-types/languageQualifierType.js +73 -0
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts +31 -5
- package/lib/packlets/qualifier-types/literalQualifierType.js +75 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +7 -11
- package/lib/packlets/qualifier-types/literalValueHierarchy.js +12 -1
- package/lib/packlets/qualifier-types/qualifierType.d.ts +31 -2
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +31 -5
- package/lib/packlets/qualifier-types/territoryQualifierType.js +80 -0
- package/lib/packlets/qualifiers/qualifierCollector.js +1 -2
- package/lib/packlets/resource-json/compiled/convert.js +2 -1
- package/lib/packlets/resource-json/compiled/json.d.ts +6 -2
- package/lib/packlets/resource-types/config/convert.d.ts +1 -1
- package/lib/packlets/resource-types/config/convert.js +3 -1
- package/lib/packlets/resource-types/config/json.d.ts +3 -1
- package/lib/packlets/resource-types/jsonResourceType.d.ts +10 -1
- package/lib/packlets/resource-types/jsonResourceType.js +7 -3
- package/lib/packlets/resource-types/resourceType.d.ts +100 -8
- package/lib/packlets/resource-types/resourceType.js +39 -3
- package/lib/packlets/resources/candidateReducer.js +3 -0
- package/lib/packlets/resources/candidateValue.d.ts +92 -0
- package/lib/packlets/resources/candidateValue.js +128 -0
- package/lib/packlets/resources/candidateValueCollector.d.ts +55 -0
- package/lib/packlets/resources/candidateValueCollector.js +96 -0
- package/lib/packlets/resources/common.d.ts +14 -0
- package/lib/packlets/resources/deltaGenerator.d.ts +189 -0
- package/lib/packlets/resources/deltaGenerator.js +344 -0
- package/lib/packlets/resources/index.d.ts +3 -0
- package/lib/packlets/resources/index.js +3 -0
- package/lib/packlets/resources/resource.d.ts +6 -6
- package/lib/packlets/resources/resource.js +5 -10
- package/lib/packlets/resources/resourceBuilder.d.ts +6 -0
- package/lib/packlets/resources/resourceBuilder.js +4 -1
- package/lib/packlets/resources/resourceCandidate.d.ts +15 -2
- package/lib/packlets/resources/resourceCandidate.js +17 -5
- package/lib/packlets/resources/resourceManagerBuilder.d.ts +131 -10
- package/lib/packlets/resources/resourceManagerBuilder.js +289 -45
- package/lib/packlets/runtime/compiledResourceCollection.d.ts +27 -11
- package/lib/packlets/runtime/compiledResourceCollection.js +71 -28
- package/lib/packlets/runtime/conditionSetResolutionResult.js +3 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +53 -3
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +82 -37
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +49 -77
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +23 -2
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +53 -31
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +4 -4
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +2 -2
- package/lib/packlets/runtime/iResourceManager.d.ts +17 -5
- package/lib/packlets/runtime/index.d.ts +1 -0
- package/lib/packlets/runtime/index.js +1 -0
- package/lib/packlets/runtime/resource-tree/common.d.ts +1 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +7 -7
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +5 -5
- package/lib/packlets/runtime/resourceResolver.d.ts +43 -1
- package/lib/packlets/runtime/resourceResolver.js +56 -28
- package/lib/packlets/runtime/resourceTreeResolver.d.ts +152 -0
- package/lib/packlets/runtime/resourceTreeResolver.js +222 -0
- package/lib/packlets/runtime/validate.js +1 -0
- package/lib/packlets/zip-archive/convert.d.ts +52 -0
- package/lib/packlets/zip-archive/convert.js +103 -0
- package/lib/packlets/zip-archive/index.d.ts +23 -0
- package/lib/packlets/zip-archive/index.js +95 -0
- package/lib/packlets/zip-archive/json.d.ts +64 -0
- package/lib/packlets/zip-archive/json.js +24 -0
- package/lib/packlets/zip-archive/types.d.ts +98 -0
- package/lib/packlets/zip-archive/types.js +39 -0
- package/lib/packlets/zip-archive/zipArchiveCreator.d.ts +35 -0
- package/lib/packlets/zip-archive/zipArchiveCreator.js +195 -0
- package/lib/packlets/zip-archive/zipArchiveFormat.d.ts +70 -0
- package/lib/packlets/zip-archive/zipArchiveFormat.js +184 -0
- package/lib/packlets/zip-archive/zipArchiveLoader.d.ts +70 -0
- package/lib/packlets/zip-archive/zipArchiveLoader.js +286 -0
- package/package.json +26 -32
- package/CLAUDE.md +0 -186
- package/EXAMPLE_INIT_PARAMS.md +0 -88
- package/PROGRESS_SUMMARY.md +0 -48
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/packlets/bundle/bundleBuilder.d.ts.map +0 -1
- package/lib/packlets/bundle/bundleBuilder.js.map +0 -1
- package/lib/packlets/bundle/bundleLoader.d.ts.map +0 -1
- package/lib/packlets/bundle/bundleLoader.js.map +0 -1
- package/lib/packlets/bundle/bundleNormalizer.d.ts.map +0 -1
- package/lib/packlets/bundle/bundleNormalizer.js.map +0 -1
- package/lib/packlets/bundle/bundleUtils.d.ts.map +0 -1
- package/lib/packlets/bundle/bundleUtils.js.map +0 -1
- package/lib/packlets/bundle/convert.d.ts.map +0 -1
- package/lib/packlets/bundle/convert.js.map +0 -1
- package/lib/packlets/bundle/index.d.ts.map +0 -1
- package/lib/packlets/bundle/index.js.map +0 -1
- package/lib/packlets/bundle/model.d.ts.map +0 -1
- package/lib/packlets/bundle/model.js.map +0 -1
- package/lib/packlets/common/conditions.d.ts.map +0 -1
- package/lib/packlets/common/conditions.js.map +0 -1
- package/lib/packlets/common/convert.d.ts.map +0 -1
- package/lib/packlets/common/convert.js.map +0 -1
- package/lib/packlets/common/helpers/conditions.d.ts.map +0 -1
- package/lib/packlets/common/helpers/conditions.js.map +0 -1
- package/lib/packlets/common/helpers/context.d.ts.map +0 -1
- package/lib/packlets/common/helpers/context.js.map +0 -1
- package/lib/packlets/common/helpers/index.d.ts.map +0 -1
- package/lib/packlets/common/helpers/index.js.map +0 -1
- package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +0 -1
- package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +0 -1
- package/lib/packlets/common/helpers/resources.d.ts.map +0 -1
- package/lib/packlets/common/helpers/resources.js.map +0 -1
- package/lib/packlets/common/index.d.ts.map +0 -1
- package/lib/packlets/common/index.js.map +0 -1
- package/lib/packlets/common/resources.d.ts.map +0 -1
- package/lib/packlets/common/resources.js.map +0 -1
- package/lib/packlets/common/validate/conditions.d.ts.map +0 -1
- package/lib/packlets/common/validate/conditions.js.map +0 -1
- package/lib/packlets/common/validate/index.d.ts.map +0 -1
- package/lib/packlets/common/validate/index.js.map +0 -1
- package/lib/packlets/common/validate/regularExpressions.d.ts.map +0 -1
- package/lib/packlets/common/validate/regularExpressions.js.map +0 -1
- package/lib/packlets/common/validate/resources.d.ts.map +0 -1
- package/lib/packlets/common/validate/resources.js.map +0 -1
- package/lib/packlets/conditions/condition.d.ts.map +0 -1
- package/lib/packlets/conditions/condition.js.map +0 -1
- package/lib/packlets/conditions/conditionCollector.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionCollector.js.map +0 -1
- package/lib/packlets/conditions/conditionDecls.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionDecls.js.map +0 -1
- package/lib/packlets/conditions/conditionSet.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionSet.js.map +0 -1
- package/lib/packlets/conditions/conditionSetCollector.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionSetCollector.js.map +0 -1
- package/lib/packlets/conditions/conditionSetDecls.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionSetDecls.js.map +0 -1
- package/lib/packlets/conditions/conditionToken.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionToken.js.map +0 -1
- package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +0 -1
- package/lib/packlets/conditions/convert/conditionSetDecls.js.map +0 -1
- package/lib/packlets/conditions/convert/decls.d.ts.map +0 -1
- package/lib/packlets/conditions/convert/decls.js.map +0 -1
- package/lib/packlets/conditions/convert/index.d.ts.map +0 -1
- package/lib/packlets/conditions/convert/index.js.map +0 -1
- package/lib/packlets/conditions/index.d.ts.map +0 -1
- package/lib/packlets/conditions/index.js.map +0 -1
- package/lib/packlets/config/common.d.ts.map +0 -1
- package/lib/packlets/config/common.js.map +0 -1
- package/lib/packlets/config/convert.d.ts.map +0 -1
- package/lib/packlets/config/convert.js.map +0 -1
- package/lib/packlets/config/index.d.ts.map +0 -1
- package/lib/packlets/config/index.js.map +0 -1
- package/lib/packlets/config/json.d.ts.map +0 -1
- package/lib/packlets/config/json.js.map +0 -1
- package/lib/packlets/config/predefined/default.d.ts.map +0 -1
- package/lib/packlets/config/predefined/default.js.map +0 -1
- package/lib/packlets/config/predefined/extended.d.ts.map +0 -1
- package/lib/packlets/config/predefined/extended.js.map +0 -1
- package/lib/packlets/config/predefined/index.d.ts.map +0 -1
- package/lib/packlets/config/predefined/index.js.map +0 -1
- package/lib/packlets/config/systemConfiguration.d.ts.map +0 -1
- package/lib/packlets/config/systemConfiguration.js.map +0 -1
- package/lib/packlets/context/contextDecls.d.ts.map +0 -1
- package/lib/packlets/context/contextDecls.js.map +0 -1
- package/lib/packlets/context/contextToken.d.ts.map +0 -1
- package/lib/packlets/context/contextToken.js.map +0 -1
- package/lib/packlets/context/convert/decls.d.ts.map +0 -1
- package/lib/packlets/context/convert/decls.js.map +0 -1
- package/lib/packlets/context/convert/index.d.ts.map +0 -1
- package/lib/packlets/context/convert/index.js.map +0 -1
- package/lib/packlets/context/index.d.ts.map +0 -1
- package/lib/packlets/context/index.js.map +0 -1
- package/lib/packlets/decisions/abstractDecision.d.ts.map +0 -1
- package/lib/packlets/decisions/abstractDecision.js.map +0 -1
- package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +0 -1
- package/lib/packlets/decisions/abstractDecisionCollector.js.map +0 -1
- package/lib/packlets/decisions/candidate.d.ts.map +0 -1
- package/lib/packlets/decisions/candidate.js.map +0 -1
- package/lib/packlets/decisions/common.d.ts.map +0 -1
- package/lib/packlets/decisions/common.js.map +0 -1
- package/lib/packlets/decisions/concreteDecision.d.ts.map +0 -1
- package/lib/packlets/decisions/concreteDecision.js.map +0 -1
- package/lib/packlets/decisions/decision.d.ts.map +0 -1
- package/lib/packlets/decisions/decision.js.map +0 -1
- package/lib/packlets/decisions/index.d.ts.map +0 -1
- package/lib/packlets/decisions/index.js.map +0 -1
- package/lib/packlets/import/fsItem.d.ts.map +0 -1
- package/lib/packlets/import/fsItem.js.map +0 -1
- package/lib/packlets/import/importContext.d.ts.map +0 -1
- package/lib/packlets/import/importContext.js.map +0 -1
- package/lib/packlets/import/importManager.d.ts.map +0 -1
- package/lib/packlets/import/importManager.js.map +0 -1
- package/lib/packlets/import/importable.d.ts.map +0 -1
- package/lib/packlets/import/importable.js.map +0 -1
- package/lib/packlets/import/importers/collectionImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/collectionImporter.js.map +0 -1
- package/lib/packlets/import/importers/fsItemImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/fsItemImporter.js.map +0 -1
- package/lib/packlets/import/importers/importer.d.ts.map +0 -1
- package/lib/packlets/import/importers/importer.js.map +0 -1
- package/lib/packlets/import/importers/index.d.ts.map +0 -1
- package/lib/packlets/import/importers/index.js.map +0 -1
- package/lib/packlets/import/importers/jsonImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/jsonImporter.js.map +0 -1
- package/lib/packlets/import/importers/pathImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/pathImporter.js.map +0 -1
- package/lib/packlets/import/index.d.ts.map +0 -1
- package/lib/packlets/import/index.js.map +0 -1
- package/lib/packlets/qualifier-types/config/convert.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/config/convert.js.map +0 -1
- package/lib/packlets/qualifier-types/config/index.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/config/index.js.map +0 -1
- package/lib/packlets/qualifier-types/config/json.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/config/json.js.map +0 -1
- package/lib/packlets/qualifier-types/convert.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/convert.js.map +0 -1
- package/lib/packlets/qualifier-types/helpers.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/helpers.js.map +0 -1
- package/lib/packlets/qualifier-types/index.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/index.js.map +0 -1
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/languageQualifierType.js.map +0 -1
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/literalQualifierType.js.map +0 -1
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +0 -1
- package/lib/packlets/qualifier-types/qualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/qualifierType.js.map +0 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +0 -1
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/territoryQualifierType.js.map +0 -1
- package/lib/packlets/qualifiers/convert/decls.d.ts.map +0 -1
- package/lib/packlets/qualifiers/convert/decls.js.map +0 -1
- package/lib/packlets/qualifiers/convert/index.d.ts.map +0 -1
- package/lib/packlets/qualifiers/convert/index.js.map +0 -1
- package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +0 -1
- package/lib/packlets/qualifiers/convert/qualifier.js.map +0 -1
- package/lib/packlets/qualifiers/index.d.ts.map +0 -1
- package/lib/packlets/qualifiers/index.js.map +0 -1
- package/lib/packlets/qualifiers/qualifier.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifier.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierCollector.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierDecl.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +0 -1
- package/lib/packlets/resource-json/compiled/common.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/common.js.map +0 -1
- package/lib/packlets/resource-json/compiled/convert.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/convert.js.map +0 -1
- package/lib/packlets/resource-json/compiled/index.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/index.js.map +0 -1
- package/lib/packlets/resource-json/compiled/json.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/json.js.map +0 -1
- package/lib/packlets/resource-json/convert.d.ts.map +0 -1
- package/lib/packlets/resource-json/convert.js.map +0 -1
- package/lib/packlets/resource-json/helpers.d.ts.map +0 -1
- package/lib/packlets/resource-json/helpers.js.map +0 -1
- package/lib/packlets/resource-json/index.d.ts.map +0 -1
- package/lib/packlets/resource-json/index.js.map +0 -1
- package/lib/packlets/resource-json/json.d.ts.map +0 -1
- package/lib/packlets/resource-json/json.js.map +0 -1
- package/lib/packlets/resource-json/normalized.d.ts.map +0 -1
- package/lib/packlets/resource-json/normalized.js.map +0 -1
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +0 -1
- package/lib/packlets/resource-json/resourceDeclCollection.js.map +0 -1
- package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +0 -1
- package/lib/packlets/resource-json/resourceDeclContainer.js.map +0 -1
- package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +0 -1
- package/lib/packlets/resource-json/resourceDeclTree.js.map +0 -1
- package/lib/packlets/resource-types/config/convert.d.ts.map +0 -1
- package/lib/packlets/resource-types/config/convert.js.map +0 -1
- package/lib/packlets/resource-types/config/index.d.ts.map +0 -1
- package/lib/packlets/resource-types/config/index.js.map +0 -1
- package/lib/packlets/resource-types/config/json.d.ts.map +0 -1
- package/lib/packlets/resource-types/config/json.js.map +0 -1
- package/lib/packlets/resource-types/helpers.d.ts.map +0 -1
- package/lib/packlets/resource-types/helpers.js.map +0 -1
- package/lib/packlets/resource-types/index.d.ts.map +0 -1
- package/lib/packlets/resource-types/index.js.map +0 -1
- package/lib/packlets/resource-types/jsonResourceType.d.ts.map +0 -1
- package/lib/packlets/resource-types/jsonResourceType.js.map +0 -1
- package/lib/packlets/resource-types/resourceType.d.ts.map +0 -1
- package/lib/packlets/resource-types/resourceType.js.map +0 -1
- package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +0 -1
- package/lib/packlets/resource-types/resourceTypeCollector.js.map +0 -1
- package/lib/packlets/resources/candidateReducer.d.ts.map +0 -1
- package/lib/packlets/resources/candidateReducer.js.map +0 -1
- package/lib/packlets/resources/common.d.ts.map +0 -1
- package/lib/packlets/resources/common.js.map +0 -1
- package/lib/packlets/resources/index.d.ts.map +0 -1
- package/lib/packlets/resources/index.js.map +0 -1
- package/lib/packlets/resources/resource.d.ts.map +0 -1
- package/lib/packlets/resources/resource.js.map +0 -1
- package/lib/packlets/resources/resourceBuilder.d.ts.map +0 -1
- package/lib/packlets/resources/resourceBuilder.js.map +0 -1
- package/lib/packlets/resources/resourceCandidate.d.ts.map +0 -1
- package/lib/packlets/resources/resourceCandidate.js.map +0 -1
- package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +0 -1
- package/lib/packlets/resources/resourceManagerBuilder.js.map +0 -1
- package/lib/packlets/runtime/cacheListener.d.ts.map +0 -1
- package/lib/packlets/runtime/cacheListener.js.map +0 -1
- package/lib/packlets/runtime/cacheMetrics.d.ts.map +0 -1
- package/lib/packlets/runtime/cacheMetrics.js.map +0 -1
- package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +0 -1
- package/lib/packlets/runtime/compiledResourceCollection.js.map +0 -1
- package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +0 -1
- package/lib/packlets/runtime/conditionSetResolutionResult.js.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProvider.js.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +0 -1
- package/lib/packlets/runtime/context/index.d.ts.map +0 -1
- package/lib/packlets/runtime/context/index.js.map +0 -1
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +0 -1
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +0 -1
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +0 -1
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +0 -1
- package/lib/packlets/runtime/iResourceManager.d.ts.map +0 -1
- package/lib/packlets/runtime/iResourceManager.js.map +0 -1
- package/lib/packlets/runtime/index.d.ts.map +0 -1
- package/lib/packlets/runtime/index.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/common.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/common.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/index.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/index.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +0 -1
- package/lib/packlets/runtime/resourceResolver.d.ts.map +0 -1
- package/lib/packlets/runtime/resourceResolver.js.map +0 -1
- package/lib/packlets/runtime/validate.d.ts.map +0 -1
- package/lib/packlets/runtime/validate.js.map +0 -1
|
@@ -26,12 +26,16 @@ exports.isValidResourceId = isValidResourceId;
|
|
|
26
26
|
exports.isValidResourceIndex = isValidResourceIndex;
|
|
27
27
|
exports.isValidResourceTypeName = isValidResourceTypeName;
|
|
28
28
|
exports.isValidResourceTypeIndex = isValidResourceTypeIndex;
|
|
29
|
+
exports.isValidCandidateValueIndex = isValidCandidateValueIndex;
|
|
30
|
+
exports.isValidCandidateValueKey = isValidCandidateValueKey;
|
|
29
31
|
exports.toResourceName = toResourceName;
|
|
30
32
|
exports.toResourceId = toResourceId;
|
|
31
33
|
exports.toOptionalResourceId = toOptionalResourceId;
|
|
32
34
|
exports.toResourceIndex = toResourceIndex;
|
|
33
35
|
exports.toResourceTypeName = toResourceTypeName;
|
|
34
36
|
exports.toResourceTypeIndex = toResourceTypeIndex;
|
|
37
|
+
exports.toCandidateValueKey = toCandidateValueKey;
|
|
38
|
+
exports.toCandidateValueIndex = toCandidateValueIndex;
|
|
35
39
|
const ts_utils_1 = require("@fgv/ts-utils");
|
|
36
40
|
const regularExpressions_1 = require("./regularExpressions");
|
|
37
41
|
/**
|
|
@@ -84,6 +88,26 @@ function isValidResourceTypeName(name) {
|
|
|
84
88
|
function isValidResourceTypeIndex(index) {
|
|
85
89
|
return index >= 0;
|
|
86
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Checks if the given index is a valid candidate value index.
|
|
93
|
+
*
|
|
94
|
+
* @param index - The index to validate.
|
|
95
|
+
* @returns `true` if the index is a valid candidate value index, otherwise `false`.
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
function isValidCandidateValueIndex(index) {
|
|
99
|
+
return index >= 0;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Checks if the given key is a valid candidate value key.
|
|
103
|
+
*
|
|
104
|
+
* @param key - The key to validate.
|
|
105
|
+
* @returns `true` if the key is a valid candidate value key, otherwise `false`.
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
function isValidCandidateValueKey(key) {
|
|
109
|
+
return regularExpressions_1.candidateValueKey.test(key);
|
|
110
|
+
}
|
|
87
111
|
/**
|
|
88
112
|
* Converts a string to a {@link ResourceName | resource name}.
|
|
89
113
|
*
|
|
@@ -108,6 +132,7 @@ function toResourceName(name) {
|
|
|
108
132
|
* @public
|
|
109
133
|
*/
|
|
110
134
|
function toResourceId(id) {
|
|
135
|
+
/* c8 ignore next 3 - defensive coding: resource ID validation should prevent invalid IDs */
|
|
111
136
|
if (!isValidResourceId(id)) {
|
|
112
137
|
return (0, ts_utils_1.fail)(`${id}: not a valid resource ID.`);
|
|
113
138
|
}
|
|
@@ -168,4 +193,34 @@ function toResourceTypeIndex(index) {
|
|
|
168
193
|
}
|
|
169
194
|
return (0, ts_utils_1.succeed)(index);
|
|
170
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* Converts a string to a {@link CandidateValueKey | candidate value key}.
|
|
198
|
+
*
|
|
199
|
+
* @param key - The key to convert.
|
|
200
|
+
* @returns `Success` with the converted key if valid, or `Failure` with an error message
|
|
201
|
+
* if not.
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
function toCandidateValueKey(key) {
|
|
205
|
+
/* c8 ignore next 3 - coverage having issues */
|
|
206
|
+
if (!isValidCandidateValueKey(key)) {
|
|
207
|
+
return (0, ts_utils_1.fail)(`${key}: not a valid candidate value key.`);
|
|
208
|
+
}
|
|
209
|
+
return (0, ts_utils_1.succeed)(key);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Converts a number to a {@link CandidateValueIndex | candidate value index}.
|
|
213
|
+
*
|
|
214
|
+
* @param index - The number to convert.
|
|
215
|
+
* @returns `Success` with the converted index if valid, or `Failure` with an error message
|
|
216
|
+
* if not.
|
|
217
|
+
* @public
|
|
218
|
+
*/
|
|
219
|
+
function toCandidateValueIndex(index) {
|
|
220
|
+
/* c8 ignore next 3 - coverage having issues */
|
|
221
|
+
if (!isValidCandidateValueIndex(index)) {
|
|
222
|
+
return (0, ts_utils_1.fail)(`${index}: not a valid candidate value index.`);
|
|
223
|
+
}
|
|
224
|
+
return (0, ts_utils_1.succeed)(index);
|
|
225
|
+
}
|
|
171
226
|
//# sourceMappingURL=resources.js.map
|
|
@@ -43,6 +43,7 @@ class Condition {
|
|
|
43
43
|
*/
|
|
44
44
|
constructor({ qualifier, value, operator, priority, scoreAsDefault, index }) {
|
|
45
45
|
if (scoreAsDefault === undefined && qualifier.defaultValue !== undefined) {
|
|
46
|
+
/* c8 ignore next 4 - edge case: default value matching logic rarely triggered */
|
|
46
47
|
const defaultMatch = qualifier.type.matches(value, qualifier.defaultValue, 'matches');
|
|
47
48
|
if (defaultMatch !== common_1.NoMatch) {
|
|
48
49
|
scoreAsDefault = defaultMatch;
|
|
@@ -2,6 +2,7 @@ import { Collections, Result } from '@fgv/ts-utils';
|
|
|
2
2
|
import { Condition } from './condition';
|
|
3
3
|
import { ConditionSetIndex, ConditionSetKey, QualifierName } from '../common';
|
|
4
4
|
import { IValidatedConditionSetDecl } from './conditionSetDecls';
|
|
5
|
+
import { ConditionCollector } from './conditionCollector';
|
|
5
6
|
import * as ResourceJson from '../resource-json';
|
|
6
7
|
import * as Context from '../context';
|
|
7
8
|
/**
|
|
@@ -93,6 +94,14 @@ export declare class ConditionSet implements IValidatedConditionSetDecl {
|
|
|
93
94
|
* @public
|
|
94
95
|
*/
|
|
95
96
|
static getKeyForDecl(decl: IValidatedConditionSetDecl): Result<ConditionSetKey>;
|
|
97
|
+
/**
|
|
98
|
+
* Gets a condition set key from a loose condition set declaration.
|
|
99
|
+
* @param conditionSet - The loose condition set declaration to convert.
|
|
100
|
+
* @param conditionCollector - The condition collector used for validation.
|
|
101
|
+
* @returns `Success` with the condition set key if successful, `Failure` otherwise.
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
static getKeyFromLooseDecl(conditionSet: ResourceJson.Json.ConditionSetDecl | undefined, conditionCollector: ConditionCollector): Result<ConditionSetKey>;
|
|
96
105
|
/**
|
|
97
106
|
* Gets a {@link ConditionSetToken | condition set token} for this condition set,
|
|
98
107
|
* if possible.
|
|
@@ -20,11 +20,45 @@
|
|
|
20
20
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
* SOFTWARE.
|
|
22
22
|
*/
|
|
23
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}) : function(o, v) {
|
|
37
|
+
o["default"] = v;
|
|
38
|
+
});
|
|
39
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
40
|
+
var ownKeys = function(o) {
|
|
41
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
42
|
+
var ar = [];
|
|
43
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
44
|
+
return ar;
|
|
45
|
+
};
|
|
46
|
+
return ownKeys(o);
|
|
47
|
+
};
|
|
48
|
+
return function (mod) {
|
|
49
|
+
if (mod && mod.__esModule) return mod;
|
|
50
|
+
var result = {};
|
|
51
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
52
|
+
__setModuleDefault(result, mod);
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
23
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
57
|
exports.ConditionSet = void 0;
|
|
25
58
|
const ts_utils_1 = require("@fgv/ts-utils");
|
|
26
59
|
const condition_1 = require("./condition");
|
|
27
60
|
const common_1 = require("../common");
|
|
61
|
+
const ConditionsConvert = __importStar(require("./convert"));
|
|
28
62
|
/**
|
|
29
63
|
* Represents a set of {@link Conditions.Condition | conditions} that must all be met in some runtime
|
|
30
64
|
* context for a resource instance to be valid.
|
|
@@ -129,6 +163,44 @@ class ConditionSet {
|
|
|
129
163
|
static getKeyForDecl(decl) {
|
|
130
164
|
return common_1.Validate.toConditionSetKey(decl.conditions.map((c) => c.toKey()).join('+'));
|
|
131
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Gets a condition set key from a loose condition set declaration.
|
|
168
|
+
* @param conditionSet - The loose condition set declaration to convert.
|
|
169
|
+
* @param conditionCollector - The condition collector used for validation.
|
|
170
|
+
* @returns `Success` with the condition set key if successful, `Failure` otherwise.
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
static getKeyFromLooseDecl(conditionSet, conditionCollector) {
|
|
174
|
+
if (!conditionSet) {
|
|
175
|
+
return (0, ts_utils_1.succeed)(ConditionSet.UnconditionalKey);
|
|
176
|
+
}
|
|
177
|
+
// Convert ConditionSetDecl to IConditionSetDecl format
|
|
178
|
+
let conditionSetDecl;
|
|
179
|
+
if (Array.isArray(conditionSet)) {
|
|
180
|
+
// ConditionSetDeclAsArray: array of ILooseConditionDecl
|
|
181
|
+
conditionSetDecl = { conditions: conditionSet };
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
// ConditionSetDeclAsRecord: Record<string, string | IChildConditionDecl>
|
|
185
|
+
const conditions = Object.entries(conditionSet).map(([qualifierName, value]) => {
|
|
186
|
+
if (typeof value === 'string') {
|
|
187
|
+
return { qualifierName, value };
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
/* c8 ignore next 1 - edge case: object spread pattern rarely used */
|
|
191
|
+
return Object.assign({ qualifierName }, value);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
conditionSetDecl = { conditions };
|
|
195
|
+
}
|
|
196
|
+
// Validate and convert to IValidatedConditionSetDecl
|
|
197
|
+
return ConditionsConvert.validatedConditionSetDecl
|
|
198
|
+
.convert(conditionSetDecl, { conditions: conditionCollector })
|
|
199
|
+
.onSuccess((validatedDecl) => {
|
|
200
|
+
// Use proper ConditionSet.getKeyForDecl method to generate the key
|
|
201
|
+
return ConditionSet.getKeyForDecl(validatedDecl);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
132
204
|
/**
|
|
133
205
|
* Gets a {@link ConditionSetToken | condition set token} for this condition set,
|
|
134
206
|
* if possible.
|
|
@@ -174,7 +246,8 @@ class ConditionSet {
|
|
|
174
246
|
toConditionSetRecordDecl(options) {
|
|
175
247
|
const qualifiersToReduce = options === null || options === void 0 ? void 0 : options.qualifiersToReduce;
|
|
176
248
|
const conditions = qualifiersToReduce
|
|
177
|
-
?
|
|
249
|
+
? /* c8 ignore next 1 - coverage intermittently misses the next line */
|
|
250
|
+
this.conditions.filter((c) => !qualifiersToReduce.has(c.qualifier.name))
|
|
178
251
|
: this.conditions;
|
|
179
252
|
return Object.fromEntries(conditions.map((c) => {
|
|
180
253
|
return [c.qualifier.name, c.toValueOrChildConditionDecl(options)];
|
|
@@ -186,6 +259,7 @@ class ConditionSet {
|
|
|
186
259
|
* @returns The {@link ResourceJson.Json.ConditionSetDeclAsArray | condition set declaration as an array} for this condition set.
|
|
187
260
|
*/
|
|
188
261
|
toConditionSetArrayDecl(options) {
|
|
262
|
+
/* c8 ignore next 1 - defense in depth */
|
|
189
263
|
const qualifiersToReduce = options === null || options === void 0 ? void 0 : options.qualifiersToReduce;
|
|
190
264
|
const conditions = qualifiersToReduce
|
|
191
265
|
? this.conditions.filter((c) => !qualifiersToReduce.has(c.qualifier.name))
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { Result } from '@fgv/ts-utils';
|
|
2
|
+
import { QualifierType, SystemQualifierType } from '../qualifier-types';
|
|
3
|
+
import * as QualifierTypes from '../qualifier-types';
|
|
4
|
+
import * as ResourceTypes from '../resource-types';
|
|
5
|
+
import { ResourceType } from '../resource-types';
|
|
6
|
+
/**
|
|
7
|
+
* Function signature for creating a qualifier type from configuration.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export type QualifierTypeFactoryFunction<T extends QualifierType = QualifierType> = (config: QualifierTypes.Config.IAnyQualifierTypeConfig) => Result<T>;
|
|
11
|
+
/**
|
|
12
|
+
* Function signature for creating a resource type from configuration.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export type ResourceTypeFactoryFunction = (config: ResourceTypes.Config.IResourceTypeConfig) => Result<ResourceType>;
|
|
16
|
+
/**
|
|
17
|
+
* Interface for a factory that creates a new instance of a configuration object.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export interface IConfigInitFactory<TConfig, T> {
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new instance of a configuration object.
|
|
23
|
+
* @param config - The configuration object to create.
|
|
24
|
+
* @returns A result containing the new instance of the configuration object.
|
|
25
|
+
*/
|
|
26
|
+
create(config: TConfig): Result<T>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates a {@link Config.IConfigInitFactory | IConfigInitFactory} from a factory function.
|
|
30
|
+
* @param fn - The factory function to wrap.
|
|
31
|
+
* @returns An `IConfigInitFactory` instance that delegates to the function.
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export declare function createQualifierTypeFactory<T extends QualifierType = QualifierType>(fn: QualifierTypeFactoryFunction<T>): IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T>;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a {@link Config.IConfigInitFactory | IConfigInitFactory} from a resource type factory function.
|
|
37
|
+
* @param fn - The factory function to wrap.
|
|
38
|
+
* @returns An `IConfigInitFactory` instance that delegates to the function.
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export declare function createResourceTypeFactory(fn: ResourceTypeFactoryFunction): IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType>;
|
|
42
|
+
/**
|
|
43
|
+
* A factory that chains multiple factories together.
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
export declare class ChainedConfigInitFactory<TConfig, T> implements IConfigInitFactory<TConfig, T> {
|
|
47
|
+
readonly factories: IConfigInitFactory<TConfig, T>[];
|
|
48
|
+
/**
|
|
49
|
+
* Constructor for a chained config init factory.
|
|
50
|
+
* @param factories - The factories to chain.
|
|
51
|
+
*/
|
|
52
|
+
constructor(factories: IConfigInitFactory<TConfig, T>[]);
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new instance of a configuration object.
|
|
55
|
+
* @param config - The configuration object to create.
|
|
56
|
+
* @returns A result containing the new instance of the configuration object.
|
|
57
|
+
*/
|
|
58
|
+
create(config: TConfig): Result<T>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A factory that creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from
|
|
62
|
+
* {@link QualifierTypes.Config.IAnyQualifierTypeConfig | any qualifier type configuration}.
|
|
63
|
+
* @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}
|
|
64
|
+
* if successful, `Failure` with an error message otherwise.
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
export declare class BuiltInQualifierTypeFactory implements IConfigInitFactory<QualifierTypes.Config.ISystemQualifierTypeConfig, SystemQualifierType> {
|
|
68
|
+
/** {@inheritDoc Config.IConfigInitFactory.create} */
|
|
69
|
+
create(config: QualifierTypes.Config.IAnyQualifierTypeConfig): Result<SystemQualifierType>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A factory that creates {@link QualifierTypes.QualifierType | QualifierType} instances from configuration,
|
|
73
|
+
* supporting both built-in system types and custom external types.
|
|
74
|
+
*
|
|
75
|
+
* This factory allows external consumers to extend the qualifier type system with their own custom types
|
|
76
|
+
* while maintaining support for all built-in types (Language, Territory, Literal).
|
|
77
|
+
*
|
|
78
|
+
* @typeParam T - The custom qualifier type(s) to support. Defaults to {@link QualifierTypes.SystemQualifierType | SystemQualifierType}.
|
|
79
|
+
*
|
|
80
|
+
* @example Creating a factory with custom qualifier types
|
|
81
|
+
* ```typescript
|
|
82
|
+
* // Define a custom qualifier type
|
|
83
|
+
* class CustomQualifierType extends QualifierType {
|
|
84
|
+
* // ... implementation
|
|
85
|
+
* }
|
|
86
|
+
*
|
|
87
|
+
* // Define a discriminated union of all types
|
|
88
|
+
* type AppQualifierType = SystemQualifierType | CustomQualifierType;
|
|
89
|
+
*
|
|
90
|
+
* // Create a factory that handles custom types
|
|
91
|
+
* const customFactory: IConfigInitFactory<IAnyQualifierTypeConfig, CustomQualifierType> = {
|
|
92
|
+
* create(config) {
|
|
93
|
+
* // ... handle custom type creation
|
|
94
|
+
* }
|
|
95
|
+
* };
|
|
96
|
+
*
|
|
97
|
+
* // Create the combined factory
|
|
98
|
+
* const qualifierTypeFactory = new QualifierTypeFactory<AppQualifierType>([customFactory]);
|
|
99
|
+
*
|
|
100
|
+
* // The factory returns T | SystemQualifierType, supporting all types
|
|
101
|
+
* const result = qualifierTypeFactory.create(config); // Result<AppQualifierType | SystemQualifierType>
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @remarks
|
|
105
|
+
* - The factory chains custom factories with the built-in factory
|
|
106
|
+
* - Custom factories are tried first, falling back to built-in types
|
|
107
|
+
* - The return type is a union of custom types (T) and system types
|
|
108
|
+
*
|
|
109
|
+
* @public
|
|
110
|
+
*/
|
|
111
|
+
export declare class QualifierTypeFactory<T extends QualifierType = SystemQualifierType> extends ChainedConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T | SystemQualifierType> {
|
|
112
|
+
/**
|
|
113
|
+
* Constructor for a {@link Config.QualifierTypeFactory | qualifier type factory}.
|
|
114
|
+
* @param factories - Array of factories for custom qualifier types. Can be:
|
|
115
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
116
|
+
* - {@link Config.QualifierTypeFactoryFunction | Factory functions}
|
|
117
|
+
* - A mix of both
|
|
118
|
+
* These are tried in order before falling back to built-in types.
|
|
119
|
+
* @remarks The {@link Config.BuiltInQualifierTypeFactory | built-in factory} is always appended to handle
|
|
120
|
+
* system qualifier types (Language, Territory, Literal).
|
|
121
|
+
*/
|
|
122
|
+
constructor(factories: Array<IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T> | QualifierTypeFactoryFunction<T>>);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* A factory that validates and creates {@link QualifierTypes.QualifierType | QualifierType} instances
|
|
126
|
+
* from weakly-typed configuration objects. This factory accepts configurations with unvalidated
|
|
127
|
+
* string properties and validates them before delegating to the underlying factory chain.
|
|
128
|
+
*
|
|
129
|
+
* This pattern is useful at package boundaries where type identity issues may occur with
|
|
130
|
+
* branded types across different package instances.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```typescript
|
|
134
|
+
* // Accept weakly-typed config from external source
|
|
135
|
+
* const validatingFactory = new ValidatingQualifierTypeFactory([customFactory]);
|
|
136
|
+
*
|
|
137
|
+
* // Config can have plain string types instead of branded types
|
|
138
|
+
* const config = {
|
|
139
|
+
* name: 'my-qualifier', // plain string, not QualifierTypeName
|
|
140
|
+
* systemType: 'custom', // plain string
|
|
141
|
+
* configuration: { ... }
|
|
142
|
+
* };
|
|
143
|
+
*
|
|
144
|
+
* const result = validatingFactory.create(config); // Validates and converts internally
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
147
|
+
* @public
|
|
148
|
+
*/
|
|
149
|
+
export declare class ValidatingQualifierTypeFactory<T extends QualifierType = SystemQualifierType> implements IConfigInitFactory<unknown, T | SystemQualifierType> {
|
|
150
|
+
private readonly _innerFactory;
|
|
151
|
+
/**
|
|
152
|
+
* Constructor for a validating qualifier type factory.
|
|
153
|
+
* @param factories - Array of factories for custom qualifier types. Can be:
|
|
154
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
155
|
+
* - {@link Config.QualifierTypeFactoryFunction | Factory functions}
|
|
156
|
+
* - A mix of both
|
|
157
|
+
*/
|
|
158
|
+
constructor(factories: Array<IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T> | QualifierTypeFactoryFunction<T>>);
|
|
159
|
+
/**
|
|
160
|
+
* Creates a qualifier type from a weakly-typed configuration object.
|
|
161
|
+
* @param config - The configuration object to validate and use for creation.
|
|
162
|
+
* @returns A result containing the new qualifier type if successful.
|
|
163
|
+
*/
|
|
164
|
+
create(config: unknown): Result<T | SystemQualifierType>;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* A factory that creates a {@link ResourceTypes.ResourceType | ResourceType} from a {@link ResourceTypes.Config.IResourceTypeConfig | resource type configuration}.
|
|
168
|
+
* @public
|
|
169
|
+
*/
|
|
170
|
+
export declare class BuiltInResourceTypeFactory implements IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> {
|
|
171
|
+
/** {@inheritDoc Config.IConfigInitFactory.create} */
|
|
172
|
+
create(config: ResourceTypes.Config.IResourceTypeConfig): Result<ResourceType>;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* A factory that creates a {@link ResourceTypes.ResourceType | ResourceType} from a {@link ResourceTypes.Config.IResourceTypeConfig | resource type configuration}
|
|
176
|
+
* by chaining a supplied factory with a {@link Config.BuiltInResourceTypeFactory | built-in factory} that handles built-in resource types.
|
|
177
|
+
* @public
|
|
178
|
+
*/
|
|
179
|
+
export declare class ResourceTypeFactory extends ChainedConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> {
|
|
180
|
+
/**
|
|
181
|
+
* Constructor for a resource type factory.
|
|
182
|
+
* @param factories - Array of factories for resource types. Can be:
|
|
183
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
184
|
+
* - {@link Config.ResourceTypeFactoryFunction | Factory functions}
|
|
185
|
+
* - A mix of both
|
|
186
|
+
* @remarks The {@link Config.BuiltInResourceTypeFactory | built-in factory} is always added to the end of the chain.
|
|
187
|
+
*/
|
|
188
|
+
constructor(factories: Array<IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> | ResourceTypeFactoryFunction>);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* A factory that validates and creates {@link ResourceTypes.ResourceType | ResourceType} instances
|
|
192
|
+
* from weakly-typed configuration objects. This factory accepts configurations with unvalidated
|
|
193
|
+
* string properties and validates them before delegating to the underlying factory chain.
|
|
194
|
+
*
|
|
195
|
+
* This pattern is useful at package boundaries where type identity issues may occur with
|
|
196
|
+
* branded types across different package instances.
|
|
197
|
+
*
|
|
198
|
+
* @public
|
|
199
|
+
*/
|
|
200
|
+
export declare class ValidatingResourceTypeFactory implements IConfigInitFactory<unknown, ResourceType> {
|
|
201
|
+
private readonly _innerFactory;
|
|
202
|
+
/**
|
|
203
|
+
* Constructor for a validating resource type factory.
|
|
204
|
+
* @param factories - Array of factories for resource types. Can be:
|
|
205
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
206
|
+
* - {@link Config.ResourceTypeFactoryFunction | Factory functions}
|
|
207
|
+
* - A mix of both
|
|
208
|
+
*/
|
|
209
|
+
constructor(factories: Array<IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> | ResourceTypeFactoryFunction>);
|
|
210
|
+
/**
|
|
211
|
+
* Creates a resource type from a weakly-typed configuration object.
|
|
212
|
+
* @param config - The configuration object to validate and use for creation.
|
|
213
|
+
* @returns A result containing the new resource type if successful.
|
|
214
|
+
*/
|
|
215
|
+
create(config: unknown): Result<ResourceType>;
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=configInitFactory.d.ts.map
|