@fgv/ts-res 5.0.0-8 → 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.
- package/CHANGELOG.json +21 -0
- package/CHANGELOG.md +14 -1
- package/README.md +794 -137
- package/dist/ts-res.d.ts +2533 -334
- package/dist/tsdoc-metadata.json +1 -1
- package/eslint.config.js +16 -0
- package/lib/index.d.ts +4 -1
- package/lib/index.js +8 -1
- package/lib/packlets/bundle/bundleBuilder.d.ts +41 -0
- package/lib/packlets/bundle/bundleBuilder.js +134 -0
- package/lib/packlets/bundle/bundleLoader.d.ts +72 -0
- package/lib/packlets/bundle/bundleLoader.js +105 -0
- package/lib/packlets/bundle/bundleNormalizer.d.ts +73 -0
- package/lib/packlets/bundle/bundleNormalizer.js +142 -0
- package/lib/packlets/bundle/bundleUtils.d.ts +70 -0
- package/lib/packlets/bundle/bundleUtils.js +117 -0
- package/lib/packlets/bundle/convert.d.ts +33 -0
- package/lib/packlets/bundle/convert.js +78 -0
- package/lib/packlets/bundle/index.d.ts +21 -0
- package/lib/packlets/bundle/index.js +83 -0
- package/lib/packlets/bundle/model.d.ts +100 -0
- package/lib/packlets/bundle/model.js +24 -0
- 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 +40 -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/index.d.ts +2 -0
- package/lib/packlets/resources/index.js +2 -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 +142 -11
- package/lib/packlets/resources/resourceManagerBuilder.js +314 -45
- package/lib/packlets/runtime/compiledResourceCollection.d.ts +23 -11
- package/lib/packlets/runtime/compiledResourceCollection.js +65 -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 +13 -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 +39 -1
- package/lib/packlets/runtime/resourceResolver.js +50 -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/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
package/dist/ts-res.d.ts
CHANGED
|
@@ -1,10 +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-
|
|
6
|
+
import { FileTree } from '@fgv/ts-json-base';
|
|
7
|
+
import { Hash } from '@fgv/ts-utils';
|
|
6
8
|
import { ICollectible } from '@fgv/ts-utils';
|
|
7
9
|
import { IReadOnlyResultMap } from '@fgv/ts-utils';
|
|
10
|
+
import { JsonCompatible } from '@fgv/ts-json-base';
|
|
8
11
|
import { JsonObject } from '@fgv/ts-json-base';
|
|
9
12
|
import { JsonValue } from '@fgv/ts-json-base';
|
|
10
13
|
import { ObjectConverter } from '@fgv/ts-utils';
|
|
@@ -13,6 +16,7 @@ import { ResultMap } from '@fgv/ts-utils';
|
|
|
13
16
|
import { ValidatingCollector } from '@fgv/ts-utils';
|
|
14
17
|
import { ValidatingConvertingCollector } from '@fgv/ts-utils';
|
|
15
18
|
import { ValidatingResultMap } from '@fgv/ts-utils';
|
|
19
|
+
import { Validator } from '@fgv/ts-utils';
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
* An abstract decision represents a class of decisions with candidates
|
|
@@ -130,6 +134,63 @@ declare const allPredefinedSystemConfigurations: ReadonlyArray<PredefinedSystemC
|
|
|
130
134
|
*/
|
|
131
135
|
export declare const allResourceValueMergeMethods: ResourceValueMergeMethod[];
|
|
132
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
|
+
|
|
133
194
|
/**
|
|
134
195
|
* Converts an array of {@link Helpers.IConditionTokenParts | condition token parts} into an array of
|
|
135
196
|
* syntactically validated {@link ConditionToken | condition tokens}.
|
|
@@ -178,6 +239,283 @@ declare function buildQualifierDefaultValuesToken(parts: ReadonlyArray<IQualifie
|
|
|
178
239
|
*/
|
|
179
240
|
declare function buildQualifierDefaultValueToken({ qualifier, value }: IQualifierDefaultValueTokenParts): Result<QualifierDefaultValueToken>;
|
|
180
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
|
+
|
|
263
|
+
declare namespace Bundle {
|
|
264
|
+
export {
|
|
265
|
+
IBundleMetadata,
|
|
266
|
+
IBundleExportMetadata,
|
|
267
|
+
IBundle,
|
|
268
|
+
IBundleCreateParams,
|
|
269
|
+
BundleBuilder,
|
|
270
|
+
BundleLoader,
|
|
271
|
+
IBundleLoaderCreateParams,
|
|
272
|
+
BundleUtils,
|
|
273
|
+
IBundleComponents,
|
|
274
|
+
Model_4 as Model,
|
|
275
|
+
Convert_10 as Convert,
|
|
276
|
+
BundleNormalizer
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
export { Bundle }
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* `Converter` for a {@link Bundle.IBundle | bundle} object.
|
|
283
|
+
* @public
|
|
284
|
+
*/
|
|
285
|
+
declare const bundle: Converter<IBundle>;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Builder for creating resource bundles from a ResourceManagerBuilder.
|
|
289
|
+
* Handles the compilation, configuration extraction, and integrity verification
|
|
290
|
+
* needed to create a complete, portable bundle.
|
|
291
|
+
* @public
|
|
292
|
+
*/
|
|
293
|
+
export declare class BundleBuilder {
|
|
294
|
+
/**
|
|
295
|
+
* Creates a resource bundle from a ResourceManagerBuilder.
|
|
296
|
+
* @param builder - The ResourceManagerBuilder containing the resources to bundle
|
|
297
|
+
* @param systemConfig - The SystemConfiguration used to create the builder
|
|
298
|
+
* @param params - Optional parameters for bundle creation
|
|
299
|
+
* @returns Success with the created bundle if successful, Failure with error message otherwise
|
|
300
|
+
* @public
|
|
301
|
+
*/
|
|
302
|
+
static create(builder: ResourceManagerBuilder, systemConfig: SystemConfiguration, params?: IBundleCreateParams): Result<IBundle>;
|
|
303
|
+
/**
|
|
304
|
+
* Creates a resource bundle from a ResourceManagerBuilder using a predefined system configuration.
|
|
305
|
+
* This is a convenience method for the common case of using predefined configurations.
|
|
306
|
+
* @param builder - The ResourceManagerBuilder containing the resources to bundle
|
|
307
|
+
* @param configName - The name of the predefined system configuration used
|
|
308
|
+
* @param params - Optional parameters for bundle creation
|
|
309
|
+
* @returns Success with the created bundle if successful, Failure with error message otherwise
|
|
310
|
+
* @public
|
|
311
|
+
*/
|
|
312
|
+
static createFromPredefined(builder: ResourceManagerBuilder, configName: PredefinedSystemConfiguration, params?: IBundleCreateParams): Result<IBundle>;
|
|
313
|
+
/**
|
|
314
|
+
* Generates a hash checksum for the compiled resource collection.
|
|
315
|
+
* The checksum is calculated using the provided hash normalizer.
|
|
316
|
+
* @param compiledCollection - The compiled resource collection to generate checksum for
|
|
317
|
+
* @param hashNormalizer - The hash normalizer to use for checksum generation
|
|
318
|
+
* @returns Success with the checksum string if successful, Failure otherwise
|
|
319
|
+
* @internal
|
|
320
|
+
*/
|
|
321
|
+
private static _generateChecksum;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* `Converter` for {@link Bundle.IBundleCreateParams | bundle creation parameters}.
|
|
326
|
+
* @public
|
|
327
|
+
*/
|
|
328
|
+
declare const bundleCreateParams: Converter<IBundleCreateParams>;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* `Converter` for {@link Bundle.IBundleExportMetadata | bundle export metadata}.
|
|
332
|
+
* @public
|
|
333
|
+
*/
|
|
334
|
+
declare const bundleExportMetadata: Converter<IBundleExportMetadata>;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Loader for creating an IResourceManager from a resource bundle.
|
|
338
|
+
* Handles integrity verification and reconstruction of the runtime resource manager.
|
|
339
|
+
* @public
|
|
340
|
+
*/
|
|
341
|
+
export declare class BundleLoader {
|
|
342
|
+
/**
|
|
343
|
+
* Creates an IResourceManager from a resource bundle.
|
|
344
|
+
* @param params - Parameters for bundle loading including the bundle and options
|
|
345
|
+
* @returns Success with the IResourceManager if successful, Failure with error message otherwise
|
|
346
|
+
* @public
|
|
347
|
+
*/
|
|
348
|
+
static createManagerFromBundle(params: IBundleLoaderCreateParams): Result<IResourceManager>;
|
|
349
|
+
/**
|
|
350
|
+
* Verifies the integrity of a bundle by checking its checksum.
|
|
351
|
+
* @param bundle - The bundle to verify
|
|
352
|
+
* @param skipVerification - Whether to skip verification
|
|
353
|
+
* @param hashNormalizer - The hash normalizer to use for verification
|
|
354
|
+
* @returns Success if verification passes or is skipped, Failure otherwise
|
|
355
|
+
* @internal
|
|
356
|
+
*/
|
|
357
|
+
private static _verifyBundleIntegrity;
|
|
358
|
+
/**
|
|
359
|
+
* Generates a hash checksum for the compiled resource collection.
|
|
360
|
+
* @param compiledCollection - The compiled resource collection to generate checksum for
|
|
361
|
+
* @param hashNormalizer - The hash normalizer to use for checksum generation
|
|
362
|
+
* @returns Success with the checksum string if successful, Failure otherwise
|
|
363
|
+
* @internal
|
|
364
|
+
*/
|
|
365
|
+
private static _generateChecksum;
|
|
366
|
+
/**
|
|
367
|
+
* Creates a SystemConfiguration from the bundle's configuration.
|
|
368
|
+
* @param bundle - The bundle containing the configuration
|
|
369
|
+
* @returns Success with the SystemConfiguration if successful, Failure otherwise
|
|
370
|
+
* @internal
|
|
371
|
+
*/
|
|
372
|
+
private static _createSystemConfiguration;
|
|
373
|
+
/**
|
|
374
|
+
* Creates a CompiledResourceCollection from the bundle.
|
|
375
|
+
* @param bundle - The bundle to load
|
|
376
|
+
* @param qualifierTypes - The qualifier type collector from the system configuration
|
|
377
|
+
* @param resourceTypes - The resource type collector from the system configuration
|
|
378
|
+
* @returns Success with the CompiledResourceCollection if successful, Failure otherwise
|
|
379
|
+
* @internal
|
|
380
|
+
*/
|
|
381
|
+
private static _createCompiledResourceCollection;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* `Converter` for a {@link Bundle.IBundleMetadata | bundle metadata} object.
|
|
386
|
+
* @public
|
|
387
|
+
*/
|
|
388
|
+
declare const bundleMetadata: Converter<IBundleMetadata>;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Normalizes ResourceManagerBuilder instances to ensure consistent ordering
|
|
392
|
+
* of internal entities, enabling order-independent bundle checksums.
|
|
393
|
+
*
|
|
394
|
+
* The normalization process rebuilds the ResourceManagerBuilder from the ground up
|
|
395
|
+
* in a canonical order to ensure identical index assignments regardless of
|
|
396
|
+
* original construction order.
|
|
397
|
+
* @public
|
|
398
|
+
*/
|
|
399
|
+
declare class BundleNormalizer {
|
|
400
|
+
/**
|
|
401
|
+
* Creates a normalized ResourceManagerBuilder from an existing builder.
|
|
402
|
+
* The normalized builder will have identical entities but arranged in
|
|
403
|
+
* canonical order to ensure consistent index assignments.
|
|
404
|
+
*
|
|
405
|
+
* @param originalBuilder - The ResourceManagerBuilder to normalize
|
|
406
|
+
* @param systemConfig - The SystemConfiguration used to create the original builder
|
|
407
|
+
* @returns Success with the normalized ResourceManagerBuilder if successful, Failure otherwise
|
|
408
|
+
*/
|
|
409
|
+
static normalize(originalBuilder: ResourceManagerBuilder, systemConfig: SystemConfiguration): Result<ResourceManagerBuilder>;
|
|
410
|
+
/**
|
|
411
|
+
* Creates a normalized ResourceManagerBuilder using a predefined system configuration.
|
|
412
|
+
* This is a convenience method for the common case of using predefined configurations.
|
|
413
|
+
*
|
|
414
|
+
* @param originalBuilder - The ResourceManagerBuilder to normalize
|
|
415
|
+
* @param configName - The name of the predefined system configuration used
|
|
416
|
+
* @returns Success with the normalized ResourceManagerBuilder if successful, Failure otherwise
|
|
417
|
+
*/
|
|
418
|
+
static normalizeFromPredefined(originalBuilder: ResourceManagerBuilder, configName: PredefinedSystemConfiguration): Result<ResourceManagerBuilder>;
|
|
419
|
+
/**
|
|
420
|
+
* Normalizes all conditions from the original builder by adding them to the
|
|
421
|
+
* normalized builder in sorted order using loose condition declarations.
|
|
422
|
+
*
|
|
423
|
+
* @param originalBuilder - The source ResourceManagerBuilder
|
|
424
|
+
* @param normalizedBuilder - The target normalized ResourceManagerBuilder
|
|
425
|
+
* @returns Success if all conditions were normalized successfully, Failure otherwise
|
|
426
|
+
* @internal
|
|
427
|
+
*/
|
|
428
|
+
private static _normalizeConditions;
|
|
429
|
+
/**
|
|
430
|
+
* Normalizes all condition sets from the original builder by adding them to the
|
|
431
|
+
* normalized builder in sorted order using loose condition set declarations.
|
|
432
|
+
*
|
|
433
|
+
* @param originalBuilder - The source ResourceManagerBuilder
|
|
434
|
+
* @param normalizedBuilder - The target normalized ResourceManagerBuilder
|
|
435
|
+
* @returns Success if all condition sets were normalized successfully, Failure otherwise
|
|
436
|
+
* @internal
|
|
437
|
+
*/
|
|
438
|
+
private static _normalizeConditionSets;
|
|
439
|
+
/**
|
|
440
|
+
* Normalizes all candidates by sorting them first by resource ID, then by condition set.
|
|
441
|
+
*
|
|
442
|
+
* @param originalBuilder - The source ResourceManagerBuilder
|
|
443
|
+
* @param normalizedBuilder - The target normalized ResourceManagerBuilder
|
|
444
|
+
* @returns Success if all candidates were normalized successfully, Failure otherwise
|
|
445
|
+
* @internal
|
|
446
|
+
*/
|
|
447
|
+
private static _normalizeCandidates;
|
|
448
|
+
/**
|
|
449
|
+
* Adds normalized resources to the target builder by first normalizing conditions,
|
|
450
|
+
* then condition sets, then candidates.
|
|
451
|
+
*
|
|
452
|
+
* @param originalBuilder - The source ResourceManagerBuilder
|
|
453
|
+
* @param normalizedBuilder - The target normalized ResourceManagerBuilder
|
|
454
|
+
* @returns Success if all resources were added successfully, Failure otherwise
|
|
455
|
+
* @internal
|
|
456
|
+
*/
|
|
457
|
+
private static _addNormalizedResources;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Lightweight converter for bundle structure validation without full processing.
|
|
462
|
+
* Useful for detecting bundle files without the overhead of full validation.
|
|
463
|
+
* @public
|
|
464
|
+
*/
|
|
465
|
+
declare const bundleStructure: Converter<{
|
|
466
|
+
metadata: IBundleMetadata;
|
|
467
|
+
config: unknown;
|
|
468
|
+
compiledCollection: unknown;
|
|
469
|
+
}>;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Utility functions for working with resource bundles.
|
|
473
|
+
* Provides reusable logic for bundle detection, parsing, and component extraction.
|
|
474
|
+
* @public
|
|
475
|
+
*/
|
|
476
|
+
declare class BundleUtils {
|
|
477
|
+
/**
|
|
478
|
+
* Checks if the given object appears to be a bundle file by examining its structure.
|
|
479
|
+
* This is a lightweight check that doesn't perform full validation.
|
|
480
|
+
* @param data - The data to check
|
|
481
|
+
* @returns True if the data appears to be a bundle structure
|
|
482
|
+
* @public
|
|
483
|
+
*/
|
|
484
|
+
static isBundleFile(data: unknown): boolean;
|
|
485
|
+
/**
|
|
486
|
+
* Extracts and validates components from a bundle for reuse.
|
|
487
|
+
* Performs full validation of the bundle structure and creates typed components.
|
|
488
|
+
* @param bundleData - The raw bundle data to extract components from
|
|
489
|
+
* @returns Success with bundle components if valid, Failure with error message otherwise
|
|
490
|
+
* @public
|
|
491
|
+
*/
|
|
492
|
+
static extractBundleComponents(bundleData: unknown): Result<IBundleComponents>;
|
|
493
|
+
/**
|
|
494
|
+
* Extracts just the metadata from potential bundle data without full validation.
|
|
495
|
+
* Useful for displaying bundle information without processing the entire bundle.
|
|
496
|
+
* @param data - The data to extract metadata from
|
|
497
|
+
* @returns Success with metadata if found and valid, Failure otherwise
|
|
498
|
+
* @public
|
|
499
|
+
*/
|
|
500
|
+
static extractBundleMetadata(data: unknown): Result<IBundleMetadata>;
|
|
501
|
+
/**
|
|
502
|
+
* Parses bundle data from a JSON string.
|
|
503
|
+
* Convenience method that combines JSON parsing with bundle component extraction.
|
|
504
|
+
* @param jsonString - The JSON string containing bundle data
|
|
505
|
+
* @returns Success with bundle components if valid, Failure with error message otherwise
|
|
506
|
+
* @public
|
|
507
|
+
*/
|
|
508
|
+
static parseBundleFromJson(jsonString: string): Result<IBundleComponents>;
|
|
509
|
+
/**
|
|
510
|
+
* Checks if a file name suggests it might be a bundle file.
|
|
511
|
+
* This is a heuristic check based on file naming conventions.
|
|
512
|
+
* @param fileName - The file name to check
|
|
513
|
+
* @returns True if the file name suggests a bundle file
|
|
514
|
+
* @public
|
|
515
|
+
*/
|
|
516
|
+
static isBundleFileName(fileName: string): boolean;
|
|
517
|
+
}
|
|
518
|
+
|
|
181
519
|
/**
|
|
182
520
|
* Simple implementation of {@link Decisions.ICandidate | ICandidate} with
|
|
183
521
|
* helper methods for sorting and presentation.
|
|
@@ -301,6 +639,139 @@ declare class CandidateReducer {
|
|
|
301
639
|
reduceCandidate(candidate: ResourceCandidate): Result<IReducedCandidate | undefined>;
|
|
302
640
|
}
|
|
303
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
|
+
|
|
304
775
|
/**
|
|
305
776
|
* `Converter` for a normalized {@link ResourceJson.Json.IChildConditionDecl | child condition declaration}.
|
|
306
777
|
* @public
|
|
@@ -412,13 +883,16 @@ declare namespace Common {
|
|
|
412
883
|
ResourceTypeIndex,
|
|
413
884
|
ResourceValueMergeMethod,
|
|
414
885
|
allResourceValueMergeMethods,
|
|
415
|
-
CandidateCompleteness
|
|
886
|
+
CandidateCompleteness,
|
|
887
|
+
CandidateValueIndex,
|
|
888
|
+
CandidateValueKey,
|
|
889
|
+
IResourceResolver
|
|
416
890
|
}
|
|
417
891
|
}
|
|
418
892
|
|
|
419
893
|
declare namespace Compiled {
|
|
420
894
|
export {
|
|
421
|
-
|
|
895
|
+
Convert_6 as Convert,
|
|
422
896
|
ICompiledResourceOptions,
|
|
423
897
|
ICompiledConditionMetadata,
|
|
424
898
|
ICompiledConditionSetMetadata,
|
|
@@ -439,61 +913,61 @@ declare namespace Compiled {
|
|
|
439
913
|
* Converter for a {@link ResourceJson.Compiled.ICompiledAbstractDecision | compiled abstract decision}.
|
|
440
914
|
* @public
|
|
441
915
|
*/
|
|
442
|
-
declare const compiledAbstractDecision: ObjectConverter<
|
|
916
|
+
declare const compiledAbstractDecision: ObjectConverter<Model_3.ICompiledAbstractDecision, unknown>;
|
|
443
917
|
|
|
444
918
|
/**
|
|
445
919
|
* Converter for a {@link ResourceJson.Compiled.ICompiledCandidate | compiled candidate}.
|
|
446
920
|
* @public
|
|
447
921
|
*/
|
|
448
|
-
declare const compiledCandidate: ObjectConverter<
|
|
922
|
+
declare const compiledCandidate: ObjectConverter<Model_3.ICompiledCandidate, unknown>;
|
|
449
923
|
|
|
450
924
|
/**
|
|
451
925
|
* Converter for a {@link ResourceJson.Compiled.ICompiledCondition | compiled condition}.
|
|
452
926
|
* @public
|
|
453
927
|
*/
|
|
454
|
-
declare const compiledCondition: ObjectConverter<
|
|
928
|
+
declare const compiledCondition: ObjectConverter<Model_3.ICompiledCondition, unknown>;
|
|
455
929
|
|
|
456
930
|
/**
|
|
457
931
|
* Converter for a {@link ResourceJson.Compiled.ICompiledConditionMetadata | compiled condition metadata}.
|
|
458
932
|
* @public
|
|
459
933
|
*/
|
|
460
|
-
declare const compiledConditionMetadata: ObjectConverter<
|
|
934
|
+
declare const compiledConditionMetadata: ObjectConverter<Model_3.ICompiledConditionMetadata, unknown>;
|
|
461
935
|
|
|
462
936
|
/**
|
|
463
937
|
* Converter for a {@link ResourceJson.Compiled.ICompiledConditionSet | compiled condition set}.
|
|
464
938
|
* @public
|
|
465
939
|
*/
|
|
466
|
-
declare const compiledConditionSet: ObjectConverter<
|
|
940
|
+
declare const compiledConditionSet: ObjectConverter<Model_3.ICompiledConditionSet, unknown>;
|
|
467
941
|
|
|
468
942
|
/**
|
|
469
943
|
* Converter for a {@link ResourceJson.Compiled.ICompiledConditionSetMetadata | compiled condition set metadata}.
|
|
470
944
|
* @public
|
|
471
945
|
*/
|
|
472
|
-
declare const compiledConditionSetMetadata: ObjectConverter<
|
|
946
|
+
declare const compiledConditionSetMetadata: ObjectConverter<Model_3.ICompiledConditionSetMetadata, unknown>;
|
|
473
947
|
|
|
474
948
|
/**
|
|
475
949
|
* Converter for a {@link ResourceJson.Compiled.ICompiledDecisionMetadata | compiled decision metadata}.
|
|
476
950
|
* @public
|
|
477
951
|
*/
|
|
478
|
-
declare const compiledDecisionMetadata: ObjectConverter<
|
|
952
|
+
declare const compiledDecisionMetadata: ObjectConverter<Model_3.ICompiledDecisionMetadata, unknown>;
|
|
479
953
|
|
|
480
954
|
/**
|
|
481
955
|
* Converter for a {@link ResourceJson.Compiled.ICompiledQualifier | compiled qualifier}.
|
|
482
956
|
* @public
|
|
483
957
|
*/
|
|
484
|
-
declare const compiledQualifier: ObjectConverter<
|
|
958
|
+
declare const compiledQualifier: ObjectConverter<Model_3.ICompiledQualifier, unknown>;
|
|
485
959
|
|
|
486
960
|
/**
|
|
487
961
|
* Converter for a {@link ResourceJson.Compiled.ICompiledQualifierType | compiled qualifier type}.
|
|
488
962
|
* @public
|
|
489
963
|
*/
|
|
490
|
-
declare const compiledQualifierType: ObjectConverter<
|
|
964
|
+
declare const compiledQualifierType: ObjectConverter<Model_3.ICompiledQualifierType, unknown>;
|
|
491
965
|
|
|
492
966
|
/**
|
|
493
967
|
* Converter for a {@link ResourceJson.Compiled.ICompiledResource | compiled resource}.
|
|
494
968
|
* @public
|
|
495
969
|
*/
|
|
496
|
-
declare const compiledResource: ObjectConverter<
|
|
970
|
+
declare const compiledResource: ObjectConverter<Model_3.ICompiledResource, unknown>;
|
|
497
971
|
|
|
498
972
|
/**
|
|
499
973
|
* A compiled resource collection implements {@link Runtime.IResourceManager | IResourceManager}
|
|
@@ -501,30 +975,35 @@ declare const compiledResource: ObjectConverter<Model.ICompiledResource, unknown
|
|
|
501
975
|
* and use pre-compiled resource collections without rebuilding them from scratch.
|
|
502
976
|
* @public
|
|
503
977
|
*/
|
|
504
|
-
declare class CompiledResourceCollection implements IResourceManager {
|
|
978
|
+
declare class CompiledResourceCollection implements IResourceManager<IResource> {
|
|
505
979
|
readonly conditions: ReadOnlyConditionCollector;
|
|
506
980
|
readonly conditionSets: ReadOnlyConditionSetCollector;
|
|
507
981
|
readonly decisions: ReadOnlyAbstractDecisionCollector;
|
|
508
982
|
private readonly _qualifierTypes;
|
|
509
983
|
private readonly _qualifiers;
|
|
510
984
|
private readonly _resourceTypes;
|
|
985
|
+
private readonly _candidateValues;
|
|
511
986
|
private readonly _builtResources;
|
|
512
987
|
private _cachedResourceTree?;
|
|
513
988
|
/**
|
|
514
|
-
* A {@link QualifierTypes.
|
|
989
|
+
* A {@link QualifierTypes.ReadOnlyQualifierTypeCollector | ReadOnlyQualifierTypeCollector} which
|
|
515
990
|
* contains the {@link QualifierTypes.QualifierType | qualifier types} used in this collection.
|
|
516
991
|
*/
|
|
517
|
-
get qualifierTypes():
|
|
992
|
+
get qualifierTypes(): ReadOnlyQualifierTypeCollector;
|
|
518
993
|
/**
|
|
519
|
-
* A {@link Qualifiers.
|
|
994
|
+
* A {@link Qualifiers.IReadOnlyQualifierCollector | ReadOnlyQualifierCollector} which
|
|
520
995
|
* contains the {@link Qualifiers.Qualifier | qualifiers} used in this collection.
|
|
521
996
|
*/
|
|
522
|
-
get qualifiers():
|
|
997
|
+
get qualifiers(): IReadOnlyQualifierCollector;
|
|
523
998
|
/**
|
|
524
999
|
* A {@link ResourceTypes.ResourceTypeCollector | ResourceTypeCollector} which
|
|
525
1000
|
* contains the {@link ResourceTypes.ResourceType | resource types} used in this collection.
|
|
526
1001
|
*/
|
|
527
|
-
get resourceTypes():
|
|
1002
|
+
get resourceTypes(): ReadOnlyResourceTypeCollector;
|
|
1003
|
+
/**
|
|
1004
|
+
* The candidate values in the collection.
|
|
1005
|
+
*/
|
|
1006
|
+
get candidateValues(): ReadonlyArray<JsonValue>;
|
|
528
1007
|
/**
|
|
529
1008
|
* {@inheritdoc Runtime.IResourceManager.builtResources}
|
|
530
1009
|
*/
|
|
@@ -573,7 +1052,7 @@ declare class CompiledResourceCollection implements IResourceManager {
|
|
|
573
1052
|
* @returns Result containing the resource tree root, or failure if tree construction fails
|
|
574
1053
|
* @public
|
|
575
1054
|
*/
|
|
576
|
-
getBuiltResourceTree(): Result<
|
|
1055
|
+
getBuiltResourceTree(): Result<ReadOnlyResourceTreeRoot<IResource>>;
|
|
577
1056
|
/**
|
|
578
1057
|
* Reconstructs a QualifierTypeCollector from compiled data.
|
|
579
1058
|
* @param compiled - The compiled resource collection
|
|
@@ -622,6 +1101,12 @@ declare class CompiledResourceCollection implements IResourceManager {
|
|
|
622
1101
|
* @internal
|
|
623
1102
|
*/
|
|
624
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;
|
|
625
1110
|
/**
|
|
626
1111
|
* Reconstructs a ValidatingResultMap of resources from compiled data.
|
|
627
1112
|
* @param compiled - The compiled resource collection
|
|
@@ -638,13 +1123,13 @@ declare class CompiledResourceCollection implements IResourceManager {
|
|
|
638
1123
|
* This combines all the individual converters into a single converter for the entire resource collection.
|
|
639
1124
|
* @public
|
|
640
1125
|
*/
|
|
641
|
-
declare const compiledResourceCollection: ObjectConverter<
|
|
1126
|
+
declare const compiledResourceCollection: ObjectConverter<Model_3.ICompiledResourceCollection, unknown>;
|
|
642
1127
|
|
|
643
1128
|
/**
|
|
644
1129
|
* Converter for a {@link ResourceJson.Compiled.ICompiledResourceType | compiled resource type}.
|
|
645
1130
|
* @public
|
|
646
1131
|
*/
|
|
647
|
-
declare const compiledResourceType: ObjectConverter<
|
|
1132
|
+
declare const compiledResourceType: ObjectConverter<Model_3.ICompiledResourceType, unknown>;
|
|
648
1133
|
|
|
649
1134
|
/**
|
|
650
1135
|
* A {@link Decisions.ConcreteDecision | concrete decision} is a {@link Decisions.IDecision | decision}
|
|
@@ -942,7 +1427,7 @@ declare const conditionPriority: Converter<ConditionPriority, unknown>;
|
|
|
942
1427
|
|
|
943
1428
|
declare namespace Conditions {
|
|
944
1429
|
export {
|
|
945
|
-
|
|
1430
|
+
Convert_11 as Convert,
|
|
946
1431
|
Condition,
|
|
947
1432
|
IConditionCollectorCreateParams,
|
|
948
1433
|
ConditionCollector,
|
|
@@ -1036,6 +1521,14 @@ export declare class ConditionSet implements IValidatedConditionSetDecl {
|
|
|
1036
1521
|
* @public
|
|
1037
1522
|
*/
|
|
1038
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>;
|
|
1039
1532
|
/**
|
|
1040
1533
|
* Gets a {@link ConditionSetToken | condition set token} for this condition set,
|
|
1041
1534
|
* if possible.
|
|
@@ -1383,8 +1876,20 @@ declare class ConditionTokens {
|
|
|
1383
1876
|
|
|
1384
1877
|
declare namespace Config {
|
|
1385
1878
|
export {
|
|
1386
|
-
|
|
1387
|
-
|
|
1879
|
+
Model,
|
|
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,
|
|
1388
1893
|
updateSystemConfigurationQualifierDefaultValues,
|
|
1389
1894
|
ISystemConfigurationInitParams,
|
|
1390
1895
|
SystemConfiguration,
|
|
@@ -1400,21 +1905,24 @@ export { Config }
|
|
|
1400
1905
|
|
|
1401
1906
|
declare namespace Config_2 {
|
|
1402
1907
|
export {
|
|
1403
|
-
|
|
1908
|
+
Convert_2 as Convert,
|
|
1909
|
+
isSystemQualifierTypeConfig,
|
|
1404
1910
|
IQualifierTypeConfig,
|
|
1405
1911
|
ILanguageQualifierTypeConfig,
|
|
1912
|
+
LiteralValueHierarchyDecl,
|
|
1406
1913
|
ITerritoryQualifierTypeConfig,
|
|
1407
1914
|
ILiteralQualifierTypeConfig,
|
|
1408
1915
|
ISystemLanguageQualifierTypeConfig,
|
|
1409
1916
|
ISystemTerritoryQualifierTypeConfig,
|
|
1410
1917
|
ISystemLiteralQualifierTypeConfig,
|
|
1411
|
-
ISystemQualifierTypeConfig
|
|
1918
|
+
ISystemQualifierTypeConfig,
|
|
1919
|
+
IAnyQualifierTypeConfig
|
|
1412
1920
|
}
|
|
1413
1921
|
}
|
|
1414
1922
|
|
|
1415
1923
|
declare namespace Config_3 {
|
|
1416
1924
|
export {
|
|
1417
|
-
|
|
1925
|
+
Convert_5 as Convert,
|
|
1418
1926
|
IResourceTypeConfig
|
|
1419
1927
|
}
|
|
1420
1928
|
}
|
|
@@ -1427,7 +1935,7 @@ declare const containerContextDecl: Converter<Normalized.IContainerContextDecl>;
|
|
|
1427
1935
|
|
|
1428
1936
|
declare namespace Context {
|
|
1429
1937
|
export {
|
|
1430
|
-
|
|
1938
|
+
Convert_8 as Convert,
|
|
1431
1939
|
IContextMatchOptions,
|
|
1432
1940
|
IContextQualifierValueDecl,
|
|
1433
1941
|
IContextDecl,
|
|
@@ -1440,11 +1948,19 @@ export { Context }
|
|
|
1440
1948
|
|
|
1441
1949
|
declare namespace Context_2 {
|
|
1442
1950
|
export {
|
|
1951
|
+
IContextQualifierProviderBase,
|
|
1952
|
+
IReadOnlyContextQualifierProvider,
|
|
1953
|
+
IMutableContextQualifierProvider,
|
|
1443
1954
|
IContextQualifierProvider,
|
|
1444
1955
|
ContextQualifierProvider,
|
|
1956
|
+
IContextQualifierProviderValidatorBase,
|
|
1445
1957
|
IReadOnlyContextQualifierProviderValidator,
|
|
1958
|
+
IMutableContextQualifierProviderValidator,
|
|
1959
|
+
IReadOnlyContextQualifierProviderValidatorCreateParams,
|
|
1960
|
+
IMutableContextQualifierProviderValidatorCreateParams,
|
|
1446
1961
|
IContextQualifierProviderValidatorCreateParams,
|
|
1447
|
-
|
|
1962
|
+
ReadOnlyContextQualifierProviderValidator,
|
|
1963
|
+
MutableContextQualifierProviderValidator,
|
|
1448
1964
|
ISimpleContextQualifierProviderCreateParams,
|
|
1449
1965
|
SimpleContextQualifierProvider,
|
|
1450
1966
|
IValidatingSimpleContextQualifierProviderCreateParams,
|
|
@@ -1463,7 +1979,7 @@ declare const contextDecl: Converter<Record<string, string>, unknown>;
|
|
|
1463
1979
|
* Provides common functionality and enforces the contract for derived classes.
|
|
1464
1980
|
* @public
|
|
1465
1981
|
*/
|
|
1466
|
-
declare abstract class ContextQualifierProvider implements
|
|
1982
|
+
declare abstract class ContextQualifierProvider implements IContextQualifierProviderBase {
|
|
1467
1983
|
/**
|
|
1468
1984
|
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
1469
1985
|
*/
|
|
@@ -1497,96 +2013,6 @@ declare abstract class ContextQualifierProvider implements IContextQualifierProv
|
|
|
1497
2013
|
abstract getNames(): Result<ReadonlyArray<QualifierName>>;
|
|
1498
2014
|
}
|
|
1499
2015
|
|
|
1500
|
-
/**
|
|
1501
|
-
* A wrapper for {@link Runtime.Context.IContextQualifierProvider | IContextQualifierProvider} that accepts
|
|
1502
|
-
* string inputs and converts them to strongly-typed values before calling the wrapped provider.
|
|
1503
|
-
* This eliminates the need for type casting in consumer code while maintaining type safety.
|
|
1504
|
-
* @public
|
|
1505
|
-
*/
|
|
1506
|
-
declare class ContextQualifierProviderValidator implements IReadOnlyContextQualifierProviderValidator {
|
|
1507
|
-
/**
|
|
1508
|
-
* The wrapped context qualifier provider.
|
|
1509
|
-
*/
|
|
1510
|
-
readonly provider: IContextQualifierProvider;
|
|
1511
|
-
/**
|
|
1512
|
-
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
1513
|
-
*/
|
|
1514
|
-
get qualifiers(): IReadOnlyQualifierCollector;
|
|
1515
|
-
/**
|
|
1516
|
-
* Constructs a new {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator}.
|
|
1517
|
-
* @param params - Required parameters for constructing the validator.
|
|
1518
|
-
*/
|
|
1519
|
-
constructor(params: IContextQualifierProviderValidatorCreateParams);
|
|
1520
|
-
/**
|
|
1521
|
-
* Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
|
|
1522
|
-
* @param name - The string name to convert and look up.
|
|
1523
|
-
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
1524
|
-
* or `Failure` with an error message if not found or an error occurs.
|
|
1525
|
-
*/
|
|
1526
|
-
get(name: string): Result<QualifierContextValue>;
|
|
1527
|
-
/**
|
|
1528
|
-
* Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
|
|
1529
|
-
* @param index - The number index to convert and look up.
|
|
1530
|
-
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
1531
|
-
* or `Failure` with an error message if not found or an error occurs.
|
|
1532
|
-
*/
|
|
1533
|
-
getByIndex(index: number): Result<QualifierContextValue>;
|
|
1534
|
-
/**
|
|
1535
|
-
* Gets a validated qualifier context value by its string name.
|
|
1536
|
-
* @param name - The string name to convert and look up.
|
|
1537
|
-
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
1538
|
-
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
1539
|
-
*/
|
|
1540
|
-
getValidated(name: string): Result<QualifierContextValue>;
|
|
1541
|
-
/**
|
|
1542
|
-
* Gets a validated qualifier context value by its number index.
|
|
1543
|
-
* @param index - The number index to convert and look up.
|
|
1544
|
-
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
1545
|
-
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
1546
|
-
*/
|
|
1547
|
-
getValidatedByIndex(index: number): Result<QualifierContextValue>;
|
|
1548
|
-
/**
|
|
1549
|
-
* Checks if a qualifier value exists with the given string name.
|
|
1550
|
-
* @param name - The string name to convert and check.
|
|
1551
|
-
* @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
|
|
1552
|
-
* or `Failure` with an error message if an error occurs during the check.
|
|
1553
|
-
*/
|
|
1554
|
-
has(name: string): Result<boolean>;
|
|
1555
|
-
/**
|
|
1556
|
-
* Sets a qualifier value using string inputs, converting to strongly-typed values.
|
|
1557
|
-
* @param name - The string name to convert.
|
|
1558
|
-
* @param value - The string value to convert.
|
|
1559
|
-
* @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
|
|
1560
|
-
* or `Failure` with an error message if an error occurs.
|
|
1561
|
-
*/
|
|
1562
|
-
set(name: string, value: string): Result<QualifierContextValue>;
|
|
1563
|
-
/**
|
|
1564
|
-
* Removes a qualifier value using string input, converting to strongly-typed QualifierName.
|
|
1565
|
-
* @param name - The string name to convert.
|
|
1566
|
-
* @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
|
|
1567
|
-
* or `Failure` with an error message if an error occurs.
|
|
1568
|
-
*/
|
|
1569
|
-
remove(name: string): Result<QualifierContextValue>;
|
|
1570
|
-
/**
|
|
1571
|
-
* Validates a string as a QualifierName.
|
|
1572
|
-
* @param name - The string to validate.
|
|
1573
|
-
* @returns `Success` with the strongly-typed QualifierName, or `Failure` if invalid.
|
|
1574
|
-
*/
|
|
1575
|
-
private _validateQualifierName;
|
|
1576
|
-
/**
|
|
1577
|
-
* Validates a number as a QualifierIndex.
|
|
1578
|
-
* @param index - The number to validate.
|
|
1579
|
-
* @returns `Success` with the strongly-typed QualifierIndex, or `Failure` if invalid.
|
|
1580
|
-
*/
|
|
1581
|
-
private _validateQualifierIndex;
|
|
1582
|
-
/**
|
|
1583
|
-
* Validates a string as a QualifierContextValue.
|
|
1584
|
-
* @param value - The string to validate.
|
|
1585
|
-
* @returns `Success` with the strongly-typed QualifierContextValue, or `Failure` if invalid.
|
|
1586
|
-
*/
|
|
1587
|
-
private _validateQualifierContextValue;
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
2016
|
/**
|
|
1591
2017
|
* A string representing a validated context qualifier token. Context qualifier tokens are used
|
|
1592
2018
|
* for filtering resources by context criteria. A context qualifier token has the form
|
|
@@ -1742,6 +2168,7 @@ declare namespace Convert {
|
|
|
1742
2168
|
qualifierIndex,
|
|
1743
2169
|
qualifierTypeName,
|
|
1744
2170
|
qualifierTypeIndex,
|
|
2171
|
+
qualifierContextValue,
|
|
1745
2172
|
qualifierMatchScore,
|
|
1746
2173
|
conditionPriority,
|
|
1747
2174
|
conditionOperator,
|
|
@@ -1759,6 +2186,8 @@ declare namespace Convert {
|
|
|
1759
2186
|
resourceIndex,
|
|
1760
2187
|
resourceTypeName,
|
|
1761
2188
|
resourceTypeIndex,
|
|
2189
|
+
candidateValueKey,
|
|
2190
|
+
candidateValueIndex,
|
|
1762
2191
|
resourceValueMergeMethod,
|
|
1763
2192
|
contextQualifierToken,
|
|
1764
2193
|
contextToken,
|
|
@@ -1770,22 +2199,79 @@ export { Convert }
|
|
|
1770
2199
|
|
|
1771
2200
|
declare namespace Convert_10 {
|
|
1772
2201
|
export {
|
|
1773
|
-
|
|
1774
|
-
|
|
2202
|
+
bundleMetadata,
|
|
2203
|
+
bundleExportMetadata,
|
|
2204
|
+
bundle,
|
|
2205
|
+
bundleCreateParams,
|
|
2206
|
+
bundleStructure
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
declare namespace Convert_11 {
|
|
2211
|
+
export {
|
|
2212
|
+
conditionDecl,
|
|
2213
|
+
IConditionDeclConvertContext,
|
|
2214
|
+
validatedConditionDecl,
|
|
2215
|
+
conditionSetDecl_2 as conditionSetDecl,
|
|
2216
|
+
IConditionSetDeclConvertContext,
|
|
2217
|
+
validatedConditionSetDecl
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
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
|
|
1775
2232
|
}
|
|
1776
2233
|
}
|
|
1777
2234
|
|
|
1778
2235
|
declare namespace Convert_2 {
|
|
1779
2236
|
export {
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
2237
|
+
qualifierTypeConfig,
|
|
2238
|
+
languageQualifierTypeConfig,
|
|
2239
|
+
territoryQualifierTypeConfig,
|
|
2240
|
+
literalQualifierTypeConfig,
|
|
2241
|
+
systemLanguageQualifierTypeConfig,
|
|
2242
|
+
systemTerritoryQualifierTypeConfig,
|
|
2243
|
+
systemLiteralQualifierTypeConfig,
|
|
2244
|
+
systemQualifierTypeConfig,
|
|
2245
|
+
jsonQualifierTypeConfig,
|
|
2246
|
+
anyQualifierTypeConfig
|
|
1785
2247
|
}
|
|
1786
2248
|
}
|
|
1787
2249
|
|
|
1788
2250
|
declare namespace Convert_3 {
|
|
2251
|
+
export {
|
|
2252
|
+
literalValueHierarchyCreateParams,
|
|
2253
|
+
IQualifierTypeConvertContext,
|
|
2254
|
+
qualifierType
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
declare namespace Convert_4 {
|
|
2259
|
+
export {
|
|
2260
|
+
qualifierDecl,
|
|
2261
|
+
IQualifierDeclConvertContext,
|
|
2262
|
+
validatedQualifierDecl,
|
|
2263
|
+
IQualifierConvertContext,
|
|
2264
|
+
qualifier
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
declare namespace Convert_5 {
|
|
2269
|
+
export {
|
|
2270
|
+
resourceTypeConfig
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
declare namespace Convert_6 {
|
|
1789
2275
|
export {
|
|
1790
2276
|
compiledConditionMetadata,
|
|
1791
2277
|
compiledConditionSetMetadata,
|
|
@@ -1802,7 +2288,7 @@ declare namespace Convert_3 {
|
|
|
1802
2288
|
}
|
|
1803
2289
|
}
|
|
1804
2290
|
|
|
1805
|
-
declare namespace
|
|
2291
|
+
declare namespace Convert_7 {
|
|
1806
2292
|
export {
|
|
1807
2293
|
looseConditionDecl,
|
|
1808
2294
|
childConditionDecl,
|
|
@@ -1820,53 +2306,32 @@ declare namespace Convert_4 {
|
|
|
1820
2306
|
}
|
|
1821
2307
|
}
|
|
1822
2308
|
|
|
1823
|
-
declare namespace Convert_5 {
|
|
1824
|
-
export {
|
|
1825
|
-
conditionDecl,
|
|
1826
|
-
IConditionDeclConvertContext,
|
|
1827
|
-
validatedConditionDecl,
|
|
1828
|
-
conditionSetDecl_2 as conditionSetDecl,
|
|
1829
|
-
IConditionSetDeclConvertContext,
|
|
1830
|
-
validatedConditionSetDecl
|
|
1831
|
-
}
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
declare namespace Convert_6 {
|
|
1835
|
-
export {
|
|
1836
|
-
languageQualifierTypeConfig,
|
|
1837
|
-
territoryQualifierTypeConfig,
|
|
1838
|
-
literalQualifierTypeConfig,
|
|
1839
|
-
systemLanguageQualifierTypeConfig,
|
|
1840
|
-
systemTerritoryQualifierTypeConfig,
|
|
1841
|
-
systemLiteralQualifierTypeConfig,
|
|
1842
|
-
systemQualifierTypeConfig
|
|
1843
|
-
}
|
|
1844
|
-
}
|
|
1845
|
-
|
|
1846
|
-
declare namespace Convert_7 {
|
|
1847
|
-
export {
|
|
1848
|
-
literalValueHierarchyCreateParams,
|
|
1849
|
-
IQualifierTypeConvertContext,
|
|
1850
|
-
qualifierType
|
|
1851
|
-
}
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
2309
|
declare namespace Convert_8 {
|
|
1855
2310
|
export {
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
2311
|
+
contextQualifierValueDecl,
|
|
2312
|
+
contextDecl,
|
|
2313
|
+
IContextDeclConvertContext,
|
|
2314
|
+
validatedContextQualifierValueDecl,
|
|
2315
|
+
validatedContextDecl
|
|
1861
2316
|
}
|
|
1862
2317
|
}
|
|
1863
2318
|
|
|
1864
2319
|
declare namespace Convert_9 {
|
|
1865
2320
|
export {
|
|
1866
|
-
|
|
2321
|
+
validateSystemConfiguration,
|
|
2322
|
+
systemConfiguration,
|
|
2323
|
+
predefinedSystemConfiguration
|
|
1867
2324
|
}
|
|
1868
2325
|
}
|
|
1869
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
|
+
|
|
1870
2335
|
/**
|
|
1871
2336
|
* Creates a {@link QualifierTypes.QualifierType | QualifierType} from a configuration object.
|
|
1872
2337
|
* This factory function determines the appropriate qualifier type based on the systemType
|
|
@@ -1877,19 +2342,27 @@ declare namespace Convert_9 {
|
|
|
1877
2342
|
* if successful, `Failure` with an error message otherwise.
|
|
1878
2343
|
* @public
|
|
1879
2344
|
*/
|
|
1880
|
-
declare function createQualifierTypeFromConfig(typeConfig: Config_2.
|
|
2345
|
+
declare function createQualifierTypeFromConfig(typeConfig: Config_2.IAnyQualifierTypeConfig): Result<QualifierType>;
|
|
1881
2346
|
|
|
1882
2347
|
/**
|
|
1883
|
-
* Creates a {@link QualifierTypes.
|
|
2348
|
+
* Creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from a system configuration object.
|
|
1884
2349
|
* This factory function determines the appropriate qualifier type based on the systemType
|
|
1885
2350
|
* and delegates to the appropriate type-specific createFromConfig method.
|
|
1886
2351
|
* @param typeConfig - The {@link QualifierTypes.Config.ISystemQualifierTypeConfig | configuration object}
|
|
1887
2352
|
* containing the name, systemType, and optional type-specific configuration.
|
|
1888
|
-
* @returns `Success` with the new {@link QualifierTypes.
|
|
2353
|
+
* @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}
|
|
1889
2354
|
* if successful, `Failure` with an error message otherwise.
|
|
1890
2355
|
* @public
|
|
1891
2356
|
*/
|
|
1892
|
-
declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISystemQualifierTypeConfig): Result<
|
|
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>;
|
|
1893
2366
|
|
|
1894
2367
|
/**
|
|
1895
2368
|
* Creates a {@link ResourceTypes.ResourceType | ResourceType} from a configuration object.
|
|
@@ -1901,6 +2374,17 @@ declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISyste
|
|
|
1901
2374
|
*/
|
|
1902
2375
|
declare function createResourceTypeFromConfig(config: IResourceTypeConfig): Result<ResourceType>;
|
|
1903
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
|
+
|
|
1904
2388
|
/**
|
|
1905
2389
|
* Simple collectible implementation of {@link Decisions.IDecision | IDecision}.
|
|
1906
2390
|
* @public
|
|
@@ -2068,6 +2552,17 @@ declare const DefaultResourceTypes: ReadonlyArray<ResourceTypes.Config.IResource
|
|
|
2068
2552
|
*/
|
|
2069
2553
|
declare const DefaultSystemConfiguration: ISystemConfiguration;
|
|
2070
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
|
+
|
|
2071
2566
|
declare namespace Example {
|
|
2072
2567
|
export {
|
|
2073
2568
|
ExtendedQualifierTypes,
|
|
@@ -2213,6 +2708,30 @@ declare class FsItemImporter implements IImporter {
|
|
|
2213
2708
|
*/
|
|
2214
2709
|
declare type FsItemResultDetail = 'failed' | 'skipped' | 'succeeded';
|
|
2215
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
|
+
|
|
2216
2735
|
/**
|
|
2217
2736
|
* Returns the {@link Config.Model.ISystemConfiguration | system configuration} declaration for the
|
|
2218
2737
|
* specified predefined system configuration.
|
|
@@ -2254,7 +2773,8 @@ declare namespace Helpers {
|
|
|
2254
2773
|
IQualifierDefaultValueTokenParts,
|
|
2255
2774
|
splitResourceId,
|
|
2256
2775
|
joinResourceIds,
|
|
2257
|
-
joinOptionalResourceIds
|
|
2776
|
+
joinOptionalResourceIds,
|
|
2777
|
+
getNameForResourceId
|
|
2258
2778
|
}
|
|
2259
2779
|
}
|
|
2260
2780
|
export { Helpers }
|
|
@@ -2293,6 +2813,153 @@ declare interface IAbstractDecisionCreateParams {
|
|
|
2293
2813
|
index?: number;
|
|
2294
2814
|
}
|
|
2295
2815
|
|
|
2816
|
+
/**
|
|
2817
|
+
* A union of all qualifier type configurations.
|
|
2818
|
+
* @public
|
|
2819
|
+
*/
|
|
2820
|
+
declare type IAnyQualifierTypeConfig = IQualifierTypeConfig | ISystemQualifierTypeConfig;
|
|
2821
|
+
|
|
2822
|
+
/**
|
|
2823
|
+
* A complete resource bundle that encapsulates built resources, configuration, and metadata.
|
|
2824
|
+
* Bundles provide a portable, integrity-verified way to distribute pre-compiled resource collections.
|
|
2825
|
+
* @public
|
|
2826
|
+
*/
|
|
2827
|
+
declare interface IBundle {
|
|
2828
|
+
/**
|
|
2829
|
+
* Metadata about the bundle including build date and integrity checksum.
|
|
2830
|
+
*/
|
|
2831
|
+
metadata: IBundleMetadata;
|
|
2832
|
+
/**
|
|
2833
|
+
* The system configuration that was used to build the resources in this bundle.
|
|
2834
|
+
*/
|
|
2835
|
+
config: Model.ISystemConfiguration;
|
|
2836
|
+
/**
|
|
2837
|
+
* The compiled resource collection containing all resources, conditions, and decisions.
|
|
2838
|
+
*/
|
|
2839
|
+
compiledCollection: Compiled.ICompiledResourceCollection;
|
|
2840
|
+
/**
|
|
2841
|
+
* Optional export metadata for tracking when and how the bundle was exported.
|
|
2842
|
+
*/
|
|
2843
|
+
exportMetadata?: IBundleExportMetadata;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
/**
|
|
2847
|
+
* Components extracted from a bundle for reuse in different contexts.
|
|
2848
|
+
* @public
|
|
2849
|
+
*/
|
|
2850
|
+
declare interface IBundleComponents {
|
|
2851
|
+
/**
|
|
2852
|
+
* The system configuration from the bundle.
|
|
2853
|
+
*/
|
|
2854
|
+
systemConfiguration: SystemConfiguration;
|
|
2855
|
+
/**
|
|
2856
|
+
* The compiled resource collection from the bundle.
|
|
2857
|
+
*/
|
|
2858
|
+
compiledCollection: Compiled.ICompiledResourceCollection;
|
|
2859
|
+
/**
|
|
2860
|
+
* The bundle metadata including build information.
|
|
2861
|
+
*/
|
|
2862
|
+
metadata: IBundleMetadata;
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
/**
|
|
2866
|
+
* Optional parameters for bundle creation.
|
|
2867
|
+
* @public
|
|
2868
|
+
*/
|
|
2869
|
+
declare interface IBundleCreateParams {
|
|
2870
|
+
/**
|
|
2871
|
+
* Optional version identifier to include in the bundle metadata.
|
|
2872
|
+
*/
|
|
2873
|
+
version?: string;
|
|
2874
|
+
/**
|
|
2875
|
+
* Optional description to include in the bundle metadata.
|
|
2876
|
+
*/
|
|
2877
|
+
description?: string;
|
|
2878
|
+
/**
|
|
2879
|
+
* Optional custom build date. If not provided, the current date will be used.
|
|
2880
|
+
*/
|
|
2881
|
+
dateBuilt?: string;
|
|
2882
|
+
/**
|
|
2883
|
+
* Optional hash normalizer for generating checksums. If not provided,
|
|
2884
|
+
* a CRC32 normalizer will be used for browser compatibility.
|
|
2885
|
+
*/
|
|
2886
|
+
hashNormalizer?: Hash.HashingNormalizer;
|
|
2887
|
+
/**
|
|
2888
|
+
* Whether to normalize the ResourceManagerBuilder before bundle creation.
|
|
2889
|
+
* When true, the builder is reconstructed in canonical order to ensure
|
|
2890
|
+
* order-independent checksums. Defaults to false for Phase 1 compatibility.
|
|
2891
|
+
*/
|
|
2892
|
+
normalize?: boolean;
|
|
2893
|
+
}
|
|
2894
|
+
|
|
2895
|
+
/**
|
|
2896
|
+
* Optional export metadata for tracking bundle export information.
|
|
2897
|
+
* @public
|
|
2898
|
+
*/
|
|
2899
|
+
declare interface IBundleExportMetadata {
|
|
2900
|
+
/**
|
|
2901
|
+
* ISO timestamp indicating when the bundle was exported.
|
|
2902
|
+
*/
|
|
2903
|
+
exportedAt: string;
|
|
2904
|
+
/**
|
|
2905
|
+
* Tool or application that exported the bundle.
|
|
2906
|
+
*/
|
|
2907
|
+
exportedFrom: string;
|
|
2908
|
+
/**
|
|
2909
|
+
* Type of bundle export (e.g., 'ts-res-bundle', 'ts-res-bundle-filtered').
|
|
2910
|
+
*/
|
|
2911
|
+
type: string;
|
|
2912
|
+
/**
|
|
2913
|
+
* Optional filter context if the bundle represents filtered data.
|
|
2914
|
+
*/
|
|
2915
|
+
filterContext?: Record<string, unknown>;
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
/**
|
|
2919
|
+
* Parameters for creating a BundleLoader.
|
|
2920
|
+
* @public
|
|
2921
|
+
*/
|
|
2922
|
+
declare interface IBundleLoaderCreateParams {
|
|
2923
|
+
/**
|
|
2924
|
+
* The bundle to load.
|
|
2925
|
+
*/
|
|
2926
|
+
bundle: IBundle;
|
|
2927
|
+
/**
|
|
2928
|
+
* Whether to skip checksum verification during loading.
|
|
2929
|
+
* Default is false - checksum verification is performed.
|
|
2930
|
+
*/
|
|
2931
|
+
skipChecksumVerification?: boolean;
|
|
2932
|
+
/**
|
|
2933
|
+
* Optional hash normalizer for verifying checksums. If not provided,
|
|
2934
|
+
* a CRC32 normalizer will be used for browser compatibility.
|
|
2935
|
+
* Must match the normalizer used during bundle creation.
|
|
2936
|
+
*/
|
|
2937
|
+
hashNormalizer?: Hash.HashingNormalizer;
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
/**
|
|
2941
|
+
* Metadata for a resource bundle, including build information and integrity verification.
|
|
2942
|
+
* @public
|
|
2943
|
+
*/
|
|
2944
|
+
declare interface IBundleMetadata {
|
|
2945
|
+
/**
|
|
2946
|
+
* ISO timestamp indicating when the bundle was built.
|
|
2947
|
+
*/
|
|
2948
|
+
dateBuilt: string;
|
|
2949
|
+
/**
|
|
2950
|
+
* SHA-256 checksum of the serialized compiled resource collection for integrity verification.
|
|
2951
|
+
*/
|
|
2952
|
+
checksum: string;
|
|
2953
|
+
/**
|
|
2954
|
+
* Optional version identifier for the bundle.
|
|
2955
|
+
*/
|
|
2956
|
+
version?: string;
|
|
2957
|
+
/**
|
|
2958
|
+
* Optional human-readable description of the bundle.
|
|
2959
|
+
*/
|
|
2960
|
+
description?: string;
|
|
2961
|
+
}
|
|
2962
|
+
|
|
2296
2963
|
/**
|
|
2297
2964
|
* Cache metrics interface for tracking cache performance.
|
|
2298
2965
|
* @public
|
|
@@ -2350,6 +3017,69 @@ declare interface ICandidateInfo {
|
|
|
2350
3017
|
readonly json?: JsonObject;
|
|
2351
3018
|
}
|
|
2352
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
|
+
|
|
2353
3083
|
/**
|
|
2354
3084
|
* Non-validated child declaration of a {@link Conditions.Condition | condition}.
|
|
2355
3085
|
* @public
|
|
@@ -2473,9 +3203,9 @@ declare interface ICompiledAbstractDecision {
|
|
|
2473
3203
|
*/
|
|
2474
3204
|
declare interface ICompiledCandidate {
|
|
2475
3205
|
/**
|
|
2476
|
-
* The JSON value of the candidate.
|
|
3206
|
+
* The global index of the JSON value of the candidate.
|
|
2477
3207
|
*/
|
|
2478
|
-
|
|
3208
|
+
valueIndex: Common.CandidateValueIndex;
|
|
2479
3209
|
/**
|
|
2480
3210
|
* Indicates if this is a partial resource that needs to be merged.
|
|
2481
3211
|
*/
|
|
@@ -2648,6 +3378,10 @@ declare interface ICompiledResourceCollection {
|
|
|
2648
3378
|
* Array of all decisions in the collection.
|
|
2649
3379
|
*/
|
|
2650
3380
|
decisions: ReadonlyArray<ICompiledAbstractDecision>;
|
|
3381
|
+
/**
|
|
3382
|
+
* Array of all candidate values in the collection.
|
|
3383
|
+
*/
|
|
3384
|
+
candidateValues: ReadonlyArray<JsonValue>;
|
|
2651
3385
|
/**
|
|
2652
3386
|
* Array of all resources in the collection.
|
|
2653
3387
|
*/
|
|
@@ -2839,6 +3573,19 @@ declare interface IConditionTokenParts {
|
|
|
2839
3573
|
value: string;
|
|
2840
3574
|
}
|
|
2841
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
|
+
|
|
2842
3589
|
/**
|
|
2843
3590
|
* Declared context for a resource container.
|
|
2844
3591
|
* @public
|
|
@@ -2896,11 +3643,19 @@ declare interface IContextMatchOptions {
|
|
|
2896
3643
|
}
|
|
2897
3644
|
|
|
2898
3645
|
/**
|
|
2899
|
-
*
|
|
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.
|
|
2900
3655
|
* Acts as a property bag using the Result pattern for qualifier value lookups.
|
|
2901
3656
|
* @public
|
|
2902
3657
|
*/
|
|
2903
|
-
declare interface
|
|
3658
|
+
declare interface IContextQualifierProviderBase {
|
|
2904
3659
|
/**
|
|
2905
3660
|
* Gets a qualifier value by its name, index, or qualifier object.
|
|
2906
3661
|
* @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.
|
|
@@ -2935,13 +3690,62 @@ declare interface IContextQualifierProvider {
|
|
|
2935
3690
|
}
|
|
2936
3691
|
|
|
2937
3692
|
/**
|
|
2938
|
-
*
|
|
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.
|
|
2939
3695
|
* @public
|
|
2940
3696
|
*/
|
|
2941
|
-
declare interface
|
|
2942
|
-
|
|
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>;
|
|
2943
3741
|
}
|
|
2944
3742
|
|
|
3743
|
+
/**
|
|
3744
|
+
* Union type for validator constructor parameters.
|
|
3745
|
+
* @public
|
|
3746
|
+
*/
|
|
3747
|
+
declare type IContextQualifierProviderValidatorCreateParams = IReadOnlyContextQualifierProviderValidatorCreateParams | IMutableContextQualifierProviderValidatorCreateParams;
|
|
3748
|
+
|
|
2945
3749
|
/**
|
|
2946
3750
|
* Non-validated declaration of a single context qualifier value.
|
|
2947
3751
|
* @public
|
|
@@ -3123,6 +3927,46 @@ declare interface IImportContext {
|
|
|
3123
3927
|
readonly conditions?: ReadonlyArray<IConditionDecl>;
|
|
3124
3928
|
}
|
|
3125
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
|
+
|
|
3126
3970
|
/**
|
|
3127
3971
|
* Generic interface for an importer than accepts a typed
|
|
3128
3972
|
* {@link Import.IImportable | importable} item, extracts any resources
|
|
@@ -3256,6 +4100,11 @@ declare interface IJsonResourceTypeCreateParams {
|
|
|
3256
4100
|
* instance.
|
|
3257
4101
|
*/
|
|
3258
4102
|
index?: number;
|
|
4103
|
+
/**
|
|
4104
|
+
* Optional template for new instances of {@link ResourceTypes.JsonResourceType | JsonResourceType}
|
|
4105
|
+
* resources.
|
|
4106
|
+
*/
|
|
4107
|
+
template?: JsonObject;
|
|
3259
4108
|
}
|
|
3260
4109
|
|
|
3261
4110
|
/**
|
|
@@ -3320,10 +4169,10 @@ declare interface ILiteralQualifierTypeCreateParams {
|
|
|
3320
4169
|
*/
|
|
3321
4170
|
enumeratedValues?: ReadonlyArray<string>;
|
|
3322
4171
|
/**
|
|
3323
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
4172
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
3324
4173
|
* of literal values to use for matching. If not provided, no hierarchy will be used.
|
|
3325
4174
|
*/
|
|
3326
|
-
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
4175
|
+
hierarchy?: Config_2.LiteralValueHierarchyDecl<string>;
|
|
3327
4176
|
/**
|
|
3328
4177
|
* Global index for this qualifier type.
|
|
3329
4178
|
*/
|
|
@@ -3347,7 +4196,7 @@ declare interface ILiteralValue<T extends string> {
|
|
|
3347
4196
|
*/
|
|
3348
4197
|
declare interface ILiteralValueHierarchyCreateParams<T extends string = string> {
|
|
3349
4198
|
values: ReadonlyArray<T>;
|
|
3350
|
-
hierarchy?: LiteralValueHierarchyDecl<T
|
|
4199
|
+
hierarchy?: Partial<LiteralValueHierarchyDecl<T>>;
|
|
3351
4200
|
}
|
|
3352
4201
|
|
|
3353
4202
|
/**
|
|
@@ -3579,6 +4428,19 @@ declare class ImportContext implements IValidatedImportContext {
|
|
|
3579
4428
|
static forContainerImport(container?: ResourceJson.Normalized.IContainerContextDecl, importer?: ImportContext): Result<ImportContext | undefined>;
|
|
3580
4429
|
}
|
|
3581
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
|
+
|
|
3582
4444
|
/**
|
|
3583
4445
|
* `Converter` for a normalized {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declaration}.
|
|
3584
4446
|
* @public
|
|
@@ -3665,14 +4527,81 @@ declare class ImportManager {
|
|
|
3665
4527
|
* @param tree - An optional `FileTree` for importing path items.
|
|
3666
4528
|
* @returns A read-only array of {@link Import.Importers.IImporter | importers}.
|
|
3667
4529
|
*/
|
|
3668
|
-
static getDefaultImporters(qualifiers: IReadOnlyQualifierCollector, tree?: FileTree.FileTree): ReadonlyArray<IImporter>;
|
|
4530
|
+
static getDefaultImporters(qualifiers: IReadOnlyQualifierCollector, tree?: FileTree.FileTree): ReadonlyArray<IImporter>;
|
|
4531
|
+
/**
|
|
4532
|
+
* Imports any items on the import stack.
|
|
4533
|
+
* @returns `Success` with the {@link Import.ImportManager | ImportManager} if successful,
|
|
4534
|
+
* or `Failure` with an error message if the import fails.
|
|
4535
|
+
* @public
|
|
4536
|
+
*/
|
|
4537
|
+
protected _import(): Result<ImportManager>;
|
|
4538
|
+
}
|
|
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;
|
|
3669
4582
|
/**
|
|
3670
|
-
*
|
|
3671
|
-
* @
|
|
3672
|
-
*
|
|
3673
|
-
* @
|
|
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.
|
|
3674
4588
|
*/
|
|
3675
|
-
|
|
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;
|
|
3676
4605
|
}
|
|
3677
4606
|
|
|
3678
4607
|
/**
|
|
@@ -3764,11 +4693,15 @@ declare interface IQualifierDefaultValueTokenParts {
|
|
|
3764
4693
|
* territories, etc).
|
|
3765
4694
|
* @public
|
|
3766
4695
|
*/
|
|
3767
|
-
declare interface IQualifierType extends ICollectible<QualifierTypeName, QualifierTypeIndex> {
|
|
4696
|
+
declare interface IQualifierType<TCFGJSON extends JsonObject = JsonObject> extends ICollectible<QualifierTypeName, QualifierTypeIndex> {
|
|
3768
4697
|
/**
|
|
3769
4698
|
* The name of the qualifier type.
|
|
3770
4699
|
*/
|
|
3771
4700
|
readonly name: QualifierTypeName;
|
|
4701
|
+
/**
|
|
4702
|
+
* Name of the underlying system type.
|
|
4703
|
+
*/
|
|
4704
|
+
readonly systemTypeName: QualifierTypeName;
|
|
3772
4705
|
/**
|
|
3773
4706
|
* Unique key for this qualifier.
|
|
3774
4707
|
*/
|
|
@@ -3831,6 +4764,17 @@ declare interface IQualifierType extends ICollectible<QualifierTypeName, Qualifi
|
|
|
3831
4764
|
* Sets the index for this qualifier type. Once set, index is immutable.
|
|
3832
4765
|
*/
|
|
3833
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>>>;
|
|
3834
4778
|
}
|
|
3835
4779
|
|
|
3836
4780
|
/**
|
|
@@ -3885,68 +4829,36 @@ declare interface IQualifierTypeCreateParams {
|
|
|
3885
4829
|
}
|
|
3886
4830
|
|
|
3887
4831
|
/**
|
|
3888
|
-
*
|
|
4832
|
+
* Read-only interface for providing qualifier values in an optimized runtime context.
|
|
4833
|
+
* Explicitly marked as immutable with compile-time type discrimination.
|
|
3889
4834
|
* @public
|
|
3890
4835
|
*/
|
|
3891
|
-
declare interface
|
|
3892
|
-
/**
|
|
3893
|
-
* {@inheritdoc Runtime.Context.ContextQualifierProviderValidator.provider}
|
|
3894
|
-
*/
|
|
3895
|
-
readonly provider: IContextQualifierProvider;
|
|
3896
|
-
/**
|
|
3897
|
-
* {@inheritdoc Runtime.Context.ContextQualifierProviderValidator.qualifiers}
|
|
3898
|
-
*/
|
|
3899
|
-
readonly qualifiers: IReadOnlyQualifierCollector;
|
|
3900
|
-
/**
|
|
3901
|
-
* Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
|
|
3902
|
-
* @param name - The string name to convert and look up.
|
|
3903
|
-
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
3904
|
-
* or `Failure` with an error message if not found or an error occurs.
|
|
3905
|
-
*/
|
|
3906
|
-
get(name: string): Result<QualifierContextValue>;
|
|
3907
|
-
/**
|
|
3908
|
-
* Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
|
|
3909
|
-
* @param index - The number index to convert and look up.
|
|
3910
|
-
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
3911
|
-
* or `Failure` with an error message if not found or an error occurs.
|
|
3912
|
-
*/
|
|
3913
|
-
getByIndex(index: number): Result<QualifierContextValue>;
|
|
3914
|
-
/**
|
|
3915
|
-
* Gets a validated qualifier context value by its string name.
|
|
3916
|
-
* @param name - The string name to convert and look up.
|
|
3917
|
-
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
3918
|
-
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
3919
|
-
*/
|
|
3920
|
-
getValidated(name: string): Result<QualifierContextValue>;
|
|
3921
|
-
/**
|
|
3922
|
-
* Gets a validated qualifier context value by its number index.
|
|
3923
|
-
* @param index - The number index to convert and look up.
|
|
3924
|
-
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
3925
|
-
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
3926
|
-
*/
|
|
3927
|
-
getValidatedByIndex(index: number): Result<QualifierContextValue>;
|
|
4836
|
+
declare interface IReadOnlyContextQualifierProvider extends IContextQualifierProviderBase {
|
|
3928
4837
|
/**
|
|
3929
|
-
*
|
|
3930
|
-
*
|
|
3931
|
-
* @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
|
|
3932
|
-
* or `Failure` with an error message if an error occurs during the check.
|
|
3933
|
-
*/
|
|
3934
|
-
has(name: string): Result<boolean>;
|
|
3935
|
-
/**
|
|
3936
|
-
* Sets a qualifier value using string inputs, converting to strongly-typed values.
|
|
3937
|
-
* @param name - The string name to convert.
|
|
3938
|
-
* @param value - The string value to convert.
|
|
3939
|
-
* @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
|
|
3940
|
-
* or `Failure` with an error message if an error occurs.
|
|
4838
|
+
* Explicit mutability marker for compile-time type discrimination.
|
|
4839
|
+
* Always `false` for read-only providers.
|
|
3941
4840
|
*/
|
|
3942
|
-
|
|
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> {
|
|
3943
4850
|
/**
|
|
3944
|
-
*
|
|
3945
|
-
* @param name - The string name to convert.
|
|
3946
|
-
* @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
|
|
3947
|
-
* or `Failure` with an error message if an error occurs.
|
|
4851
|
+
* The wrapped read-only context qualifier provider.
|
|
3948
4852
|
*/
|
|
3949
|
-
|
|
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;
|
|
3950
4862
|
}
|
|
3951
4863
|
|
|
3952
4864
|
/**
|
|
@@ -3991,7 +4903,7 @@ declare interface IReadOnlyResourceTreeBranch<T> {
|
|
|
3991
4903
|
* Interface for a read-only result-based resource tree with navigation methods.
|
|
3992
4904
|
* @public
|
|
3993
4905
|
*/
|
|
3994
|
-
declare interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<
|
|
4906
|
+
declare interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<TNAME, IReadOnlyResourceTreeNode<T>> {
|
|
3995
4907
|
/**
|
|
3996
4908
|
* Gets a tree node by its full ResourceId path.
|
|
3997
4909
|
* @param id - The ResourceId path to look up
|
|
@@ -4078,6 +4990,29 @@ declare interface IReducedCandidate {
|
|
|
4078
4990
|
readonly mergeMethod?: ResourceValueMergeMethod;
|
|
4079
4991
|
}
|
|
4080
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
|
+
|
|
4081
5016
|
/**
|
|
4082
5017
|
* Interface for a resource that can be used in the runtime layer.
|
|
4083
5018
|
* This provides the minimal properties needed from a resource without requiring
|
|
@@ -4087,8 +5022,10 @@ declare interface IReducedCandidate {
|
|
|
4087
5022
|
declare interface IResource {
|
|
4088
5023
|
/** The resource identifier */
|
|
4089
5024
|
readonly id: string;
|
|
5025
|
+
/** The resource name */
|
|
5026
|
+
readonly name: string;
|
|
4090
5027
|
/** The resource type */
|
|
4091
|
-
readonly resourceType:
|
|
5028
|
+
readonly resourceType: IResourceType;
|
|
4092
5029
|
/** The decision used to select candidates */
|
|
4093
5030
|
readonly decision: ConcreteDecision;
|
|
4094
5031
|
/** The available candidates for this resource */
|
|
@@ -4105,6 +5042,7 @@ declare interface IResourceBuilderCreateParams {
|
|
|
4105
5042
|
conditionSets: ConditionSetCollector;
|
|
4106
5043
|
resourceTypes: ReadOnlyResourceTypeCollector;
|
|
4107
5044
|
decisions: AbstractDecisionCollector;
|
|
5045
|
+
candidateValues: CandidateValueCollector;
|
|
4108
5046
|
}
|
|
4109
5047
|
|
|
4110
5048
|
/**
|
|
@@ -4134,6 +5072,7 @@ declare interface IResourceCandidateCreateParams {
|
|
|
4134
5072
|
resourceType?: ResourceType;
|
|
4135
5073
|
parentConditions?: ReadonlyArray<Condition>;
|
|
4136
5074
|
conditionSets: ConditionSetCollector;
|
|
5075
|
+
candidateValues: CandidateValueCollector;
|
|
4137
5076
|
}
|
|
4138
5077
|
|
|
4139
5078
|
/**
|
|
@@ -4147,10 +5086,10 @@ declare interface IResourceCandidateValidationProperties {
|
|
|
4147
5086
|
*/
|
|
4148
5087
|
id: ResourceId;
|
|
4149
5088
|
/**
|
|
4150
|
-
*
|
|
5089
|
+
* Describes how complete the candidate value is.
|
|
4151
5090
|
* @public
|
|
4152
5091
|
*/
|
|
4153
|
-
|
|
5092
|
+
completeness: CandidateCompleteness;
|
|
4154
5093
|
/**
|
|
4155
5094
|
* {@inheritdoc ResourceJson.Json.ILooseResourceCandidateDecl.json}
|
|
4156
5095
|
* @public
|
|
@@ -4291,7 +5230,7 @@ declare interface IResourceDeclContainer {
|
|
|
4291
5230
|
* implementations without requiring the full ResourceManagerBuilder build mechanics.
|
|
4292
5231
|
* @public
|
|
4293
5232
|
*/
|
|
4294
|
-
export declare interface IResourceManager {
|
|
5233
|
+
export declare interface IResourceManager<TR extends IResource = IResource> {
|
|
4295
5234
|
/**
|
|
4296
5235
|
* A {@link Conditions.ReadOnlyConditionCollector | ReadOnlyConditionCollector} which
|
|
4297
5236
|
* contains the {@link Conditions.Condition | conditions} used by resource candidates.
|
|
@@ -4312,12 +5251,17 @@ export declare interface IResourceManager {
|
|
|
4312
5251
|
* @param id - The resource identifier
|
|
4313
5252
|
* @returns Success with the runtime resource if found, Failure otherwise
|
|
4314
5253
|
*/
|
|
4315
|
-
getBuiltResource(id: string): Result<
|
|
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>>;
|
|
4316
5260
|
/**
|
|
4317
5261
|
* A read-only result map of all built resources, keyed by resource ID.
|
|
4318
5262
|
* Resources are built on-demand when accessed and returns Results for error handling.
|
|
4319
5263
|
*/
|
|
4320
|
-
readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId,
|
|
5264
|
+
readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId, TR>;
|
|
4321
5265
|
/**
|
|
4322
5266
|
* The number of resources in this resource manager.
|
|
4323
5267
|
*/
|
|
@@ -4354,6 +5298,43 @@ declare interface IResourceManagerCloneOptions extends IResourceDeclarationOptio
|
|
|
4354
5298
|
* These conditions can modify or extend the resource candidates in the cloned manager.
|
|
4355
5299
|
*/
|
|
4356
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>;
|
|
4357
5338
|
}
|
|
4358
5339
|
|
|
4359
5340
|
/**
|
|
@@ -4499,13 +5480,82 @@ declare interface IResourceTreeRootInit<T> {
|
|
|
4499
5480
|
readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;
|
|
4500
5481
|
}
|
|
4501
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
|
+
|
|
4502
5551
|
/**
|
|
4503
5552
|
* Configuration for a {@link ResourceTypes.ResourceType | resource type}.
|
|
4504
5553
|
* @public
|
|
4505
5554
|
*/
|
|
4506
|
-
declare interface IResourceTypeConfig {
|
|
5555
|
+
declare interface IResourceTypeConfig<T extends JsonObject = JsonObject> {
|
|
4507
5556
|
name: string;
|
|
4508
5557
|
typeName: string;
|
|
5558
|
+
template?: T;
|
|
4509
5559
|
}
|
|
4510
5560
|
|
|
4511
5561
|
/**
|
|
@@ -4560,6 +5610,33 @@ declare function isResourceTreeLeafInit<T>(init: ResourceTreeNodeInit<T>): init
|
|
|
4560
5610
|
*/
|
|
4561
5611
|
declare function isResourceTreeRootOrNodeInit<T>(init: ResourceTreeNodeInit<T> | IResourceTreeRootInit<T>): init is IResourceTreeBranchInit<T>;
|
|
4562
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
|
+
|
|
4563
5640
|
/**
|
|
4564
5641
|
* Determines whether a number is a valid condition index.
|
|
4565
5642
|
* @param index - the number to validate
|
|
@@ -4673,6 +5750,15 @@ declare function isValidDecisionIndex(index: number): index is DecisionIndex;
|
|
|
4673
5750
|
*/
|
|
4674
5751
|
declare function isValidDecisionKey(key: string): key is DecisionKey;
|
|
4675
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
|
+
|
|
4676
5762
|
/**
|
|
4677
5763
|
* Determines whether a string is a valid qualifier default values token.
|
|
4678
5764
|
* Qualifier default values tokens are pipe-separated lists of qualifier default value tokens.
|
|
@@ -4788,7 +5874,7 @@ declare interface ISystemConfiguration {
|
|
|
4788
5874
|
/** Optional description explaining the purpose and use case of the configuration. */
|
|
4789
5875
|
description?: string;
|
|
4790
5876
|
/** Qualifier type configurations that define the available qualifier types in the system. */
|
|
4791
|
-
qualifierTypes: QualifierTypes.Config.
|
|
5877
|
+
qualifierTypes: QualifierTypes.Config.IAnyQualifierTypeConfig[];
|
|
4792
5878
|
/** Qualifier declarations that define the available qualifiers in the system. */
|
|
4793
5879
|
qualifiers: Qualifiers.IQualifierDecl[];
|
|
4794
5880
|
/** Resource type configurations that define the available resource types in the system. */
|
|
@@ -4806,6 +5892,8 @@ declare interface ISystemConfigurationInitParams {
|
|
|
4806
5892
|
* Use `null` as the value to remove an existing default value.
|
|
4807
5893
|
*/
|
|
4808
5894
|
qualifierDefaultValues?: Record<string, string | null>;
|
|
5895
|
+
qualifierTypeFactory?: IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, QualifierType>;
|
|
5896
|
+
resourceTypeFactory?: IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType>;
|
|
4809
5897
|
}
|
|
4810
5898
|
|
|
4811
5899
|
/**
|
|
@@ -4838,6 +5926,14 @@ declare interface ISystemTerritoryQualifierTypeConfig extends IQualifierTypeConf
|
|
|
4838
5926
|
systemType: 'territory';
|
|
4839
5927
|
}
|
|
4840
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
|
+
|
|
4841
5937
|
/**
|
|
4842
5938
|
* Configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.
|
|
4843
5939
|
* @public
|
|
@@ -4847,7 +5943,7 @@ declare interface ITerritoryQualifierTypeConfig {
|
|
|
4847
5943
|
acceptLowercase?: boolean;
|
|
4848
5944
|
allowedTerritories?: string[];
|
|
4849
5945
|
/**
|
|
4850
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
5946
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
4851
5947
|
* of territory values to use for matching. If not provided, no hierarchy will be used.
|
|
4852
5948
|
*/
|
|
4853
5949
|
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
@@ -4880,10 +5976,10 @@ declare interface ITerritoryQualifierTypeCreateParams {
|
|
|
4880
5976
|
*/
|
|
4881
5977
|
acceptLowercase?: boolean;
|
|
4882
5978
|
/**
|
|
4883
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
5979
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
4884
5980
|
* of territory values to use for matching. If not provided, no hierarchy will be used.
|
|
4885
5981
|
*/
|
|
4886
|
-
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
5982
|
+
hierarchy?: Config_2.LiteralValueHierarchyDecl<string>;
|
|
4887
5983
|
}
|
|
4888
5984
|
|
|
4889
5985
|
/**
|
|
@@ -4993,22 +6089,127 @@ declare interface IValidatedQualifierDefaultValueDecl {
|
|
|
4993
6089
|
* {@link QualifierContextValue | qualifier context values} as values.
|
|
4994
6090
|
* @public
|
|
4995
6091
|
*/
|
|
4996
|
-
declare type IValidatedQualifierDefaultValuesDecl = Record<QualifierName, QualifierContextValue>;
|
|
6092
|
+
declare type IValidatedQualifierDefaultValuesDecl = Record<QualifierName, QualifierContextValue>;
|
|
6093
|
+
|
|
6094
|
+
/**
|
|
6095
|
+
* Parameters for creating a {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider}.
|
|
6096
|
+
* @public
|
|
6097
|
+
*/
|
|
6098
|
+
declare interface IValidatingSimpleContextQualifierProviderCreateParams {
|
|
6099
|
+
/**
|
|
6100
|
+
* The {@link Qualifiers.IReadOnlyQualifierCollector | readonly qualifier collector} that defines and validates qualifiers.
|
|
6101
|
+
*/
|
|
6102
|
+
qualifiers: IReadOnlyQualifierCollector;
|
|
6103
|
+
/**
|
|
6104
|
+
* Optional record of initial qualifier name-value pairs to populate the provider.
|
|
6105
|
+
* Accepts string keys and values which will be converted to strongly-typed values.
|
|
6106
|
+
*/
|
|
6107
|
+
qualifierValues?: Record<string, string>;
|
|
6108
|
+
}
|
|
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
|
+
}
|
|
4997
6201
|
|
|
4998
6202
|
/**
|
|
4999
|
-
*
|
|
6203
|
+
* Result of ZIP archive buffer creation
|
|
5000
6204
|
* @public
|
|
5001
6205
|
*/
|
|
5002
|
-
declare interface
|
|
5003
|
-
/**
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
/**
|
|
5008
|
-
|
|
5009
|
-
* Accepts string keys and values which will be converted to strongly-typed values.
|
|
5010
|
-
*/
|
|
5011
|
-
qualifierValues?: Record<string, string>;
|
|
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;
|
|
5012
6213
|
}
|
|
5013
6214
|
|
|
5014
6215
|
/**
|
|
@@ -5058,6 +6259,16 @@ declare namespace Json {
|
|
|
5058
6259
|
}
|
|
5059
6260
|
}
|
|
5060
6261
|
|
|
6262
|
+
declare namespace Json_2 {
|
|
6263
|
+
export {
|
|
6264
|
+
IZipArchiveInputInfo,
|
|
6265
|
+
IZipArchiveConfigInfo,
|
|
6266
|
+
IZipArchiveManifest,
|
|
6267
|
+
IImportedFile,
|
|
6268
|
+
IImportedDirectory
|
|
6269
|
+
}
|
|
6270
|
+
}
|
|
6271
|
+
|
|
5061
6272
|
/**
|
|
5062
6273
|
* {@link Import.Importers.IImporter | Importer} implementation which imports resources from a JSON object.
|
|
5063
6274
|
* @public
|
|
@@ -5085,18 +6296,29 @@ declare class JsonImporter implements IImporter {
|
|
|
5085
6296
|
private _tryImportResourceTree;
|
|
5086
6297
|
}
|
|
5087
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
|
+
|
|
5088
6306
|
/**
|
|
5089
6307
|
* Implementation of a {@link ResourceTypes.ResourceType | ResourceType} for JSON values.
|
|
5090
6308
|
* @public
|
|
5091
6309
|
*/
|
|
5092
6310
|
declare class JsonResourceType extends ResourceType<JsonObject> {
|
|
6311
|
+
/**
|
|
6312
|
+
* {@inheritdoc ResourceTypes.ResourceType.systemTypeName}
|
|
6313
|
+
*/
|
|
6314
|
+
readonly systemTypeName: ResourceTypeName;
|
|
5093
6315
|
/**
|
|
5094
6316
|
* Protected {@link ResourceTypes.JsonResourceType | JsonResourceType} constructor for use by subclasses.
|
|
5095
6317
|
* Use {@link ResourceTypes.JsonResourceType.create | JsonResourceType.create} to create a new instance.
|
|
5096
6318
|
* @param key - The key for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
|
|
5097
6319
|
* @param index - Optional index for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
|
|
5098
6320
|
*/
|
|
5099
|
-
protected constructor(key: ResourceTypeName, index?: number);
|
|
6321
|
+
protected constructor(key: ResourceTypeName, index?: number, template?: JsonObject);
|
|
5100
6322
|
/**
|
|
5101
6323
|
* Factory method to create a new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
|
|
5102
6324
|
* @param params - {@link ResourceTypes.IJsonResourceTypeCreateParams | Parameters} to create the new instance.
|
|
@@ -5146,7 +6368,11 @@ declare const LanguagePrioritySystemConfiguration: ISystemConfiguration;
|
|
|
5146
6368
|
* Accepts a list of language tags in the context by default.
|
|
5147
6369
|
* @public
|
|
5148
6370
|
*/
|
|
5149
|
-
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;
|
|
5150
6376
|
/**
|
|
5151
6377
|
* Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.
|
|
5152
6378
|
* @param name - Optional name for the qualifier type. Defaults to 'language'.
|
|
@@ -5176,6 +6402,27 @@ declare class LanguageQualifierType extends QualifierType {
|
|
|
5176
6402
|
* {@inheritdoc QualifierTypes.IQualifierType.isValidConditionValue}
|
|
5177
6403
|
*/
|
|
5178
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>;
|
|
5179
6426
|
/**
|
|
5180
6427
|
* Matches a single language condition against a single language context value using
|
|
5181
6428
|
* {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.
|
|
@@ -5192,14 +6439,18 @@ declare class LanguageQualifierType extends QualifierType {
|
|
|
5192
6439
|
* @returns A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
|
|
5193
6440
|
* @public
|
|
5194
6441
|
*/
|
|
5195
|
-
declare const languageQualifierTypeConfig: ObjectConverter<
|
|
6442
|
+
declare const languageQualifierTypeConfig: ObjectConverter<Model_2.ILanguageQualifierTypeConfig, unknown>;
|
|
5196
6443
|
|
|
5197
6444
|
/**
|
|
5198
6445
|
* A {@link QualifierTypes.QualifierType | qualifier} that matches a literal value,
|
|
5199
6446
|
* optionally case-sensitive or matching against an ordered list of values at runtime.
|
|
5200
6447
|
* @public
|
|
5201
6448
|
*/
|
|
5202
|
-
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;
|
|
5203
6454
|
/**
|
|
5204
6455
|
* Indicates whether the qualifier match is case-sensitive.
|
|
5205
6456
|
*/
|
|
@@ -5235,6 +6486,27 @@ declare class LiteralQualifierType extends QualifierType {
|
|
|
5235
6486
|
* {@inheritdoc QualifierTypes.IQualifierType.isPotentialMatch}
|
|
5236
6487
|
*/
|
|
5237
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>;
|
|
5238
6510
|
/**
|
|
5239
6511
|
* {@inheritdoc QualifierTypes.QualifierType._matchOne}
|
|
5240
6512
|
*/
|
|
@@ -5280,7 +6552,7 @@ declare class LiteralQualifierType extends QualifierType {
|
|
|
5280
6552
|
* @returns A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.
|
|
5281
6553
|
* @public
|
|
5282
6554
|
*/
|
|
5283
|
-
declare const literalQualifierTypeConfig: ObjectConverter<
|
|
6555
|
+
declare const literalQualifierTypeConfig: ObjectConverter<Model_2.ILiteralQualifierTypeConfig, unknown>;
|
|
5284
6556
|
|
|
5285
6557
|
/**
|
|
5286
6558
|
* A class that implements a hierarchy of literal values. The hierarchy is defined as a
|
|
@@ -5364,6 +6636,11 @@ declare class LiteralValueHierarchy<T extends string = string> {
|
|
|
5364
6636
|
*/
|
|
5365
6637
|
match(condition: QualifierConditionValue, context: QualifierContextValue, __operator?: ConditionOperator): QualifierMatchScore;
|
|
5366
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>;
|
|
5367
6644
|
}
|
|
5368
6645
|
|
|
5369
6646
|
/**
|
|
@@ -5383,7 +6660,7 @@ declare function literalValueHierarchyCreateParams<T extends string>(valueConver
|
|
|
5383
6660
|
* determine the relationship between values when matching conditions and contexts.
|
|
5384
6661
|
* @public
|
|
5385
6662
|
*/
|
|
5386
|
-
declare type LiteralValueHierarchyDecl<T extends string> =
|
|
6663
|
+
declare type LiteralValueHierarchyDecl<T extends string> = Record<T, T>;
|
|
5387
6664
|
|
|
5388
6665
|
/**
|
|
5389
6666
|
* `Converter` for a normalized {@link ResourceJson.Json.ILooseConditionDecl | loose condition declaration}.
|
|
@@ -5526,6 +6803,12 @@ declare function mergeLooseCandidate(candidate: Normalized.IImporterResourceCand
|
|
|
5526
6803
|
*/
|
|
5527
6804
|
declare function mergeLooseResource(resource: Normalized.IImporterResourceDecl, baseName?: string, baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>): Result<Normalized.ILooseResourceDecl>;
|
|
5528
6805
|
|
|
6806
|
+
/**
|
|
6807
|
+
* Validator for MIME type strings
|
|
6808
|
+
* @public
|
|
6809
|
+
*/
|
|
6810
|
+
declare const mimeType: Validator<string>;
|
|
6811
|
+
|
|
5529
6812
|
/**
|
|
5530
6813
|
* Minimum valid priority for a condition.
|
|
5531
6814
|
* @public
|
|
@@ -5533,6 +6816,28 @@ declare function mergeLooseResource(resource: Normalized.IImporterResourceDecl,
|
|
|
5533
6816
|
export declare const MinConditionPriority: ConditionPriority;
|
|
5534
6817
|
|
|
5535
6818
|
declare namespace Model {
|
|
6819
|
+
export {
|
|
6820
|
+
ISystemConfiguration
|
|
6821
|
+
}
|
|
6822
|
+
}
|
|
6823
|
+
|
|
6824
|
+
declare namespace Model_2 {
|
|
6825
|
+
export {
|
|
6826
|
+
isSystemQualifierTypeConfig,
|
|
6827
|
+
IQualifierTypeConfig,
|
|
6828
|
+
ILanguageQualifierTypeConfig,
|
|
6829
|
+
LiteralValueHierarchyDecl,
|
|
6830
|
+
ITerritoryQualifierTypeConfig,
|
|
6831
|
+
ILiteralQualifierTypeConfig,
|
|
6832
|
+
ISystemLanguageQualifierTypeConfig,
|
|
6833
|
+
ISystemTerritoryQualifierTypeConfig,
|
|
6834
|
+
ISystemLiteralQualifierTypeConfig,
|
|
6835
|
+
ISystemQualifierTypeConfig,
|
|
6836
|
+
IAnyQualifierTypeConfig
|
|
6837
|
+
}
|
|
6838
|
+
}
|
|
6839
|
+
|
|
6840
|
+
declare namespace Model_3 {
|
|
5536
6841
|
export {
|
|
5537
6842
|
ICompiledConditionMetadata,
|
|
5538
6843
|
ICompiledConditionSetMetadata,
|
|
@@ -5549,23 +6854,46 @@ declare namespace Model {
|
|
|
5549
6854
|
}
|
|
5550
6855
|
}
|
|
5551
6856
|
|
|
5552
|
-
declare namespace
|
|
6857
|
+
declare namespace Model_4 {
|
|
5553
6858
|
export {
|
|
5554
|
-
|
|
6859
|
+
IBundleMetadata,
|
|
6860
|
+
IBundleExportMetadata,
|
|
6861
|
+
IBundle,
|
|
6862
|
+
IBundleCreateParams
|
|
5555
6863
|
}
|
|
5556
6864
|
}
|
|
5557
6865
|
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
6866
|
+
/**
|
|
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.
|
|
6870
|
+
* @public
|
|
6871
|
+
*/
|
|
6872
|
+
declare class MutableContextQualifierProviderValidator<T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider> extends BaseContextQualifierProviderValidator<T> implements IMutableContextQualifierProviderValidator<T> {
|
|
6873
|
+
/**
|
|
6874
|
+
* The wrapped mutable context qualifier provider.
|
|
6875
|
+
*/
|
|
6876
|
+
readonly provider: T;
|
|
6877
|
+
/**
|
|
6878
|
+
* Constructs a new {@link Runtime.Context.MutableContextQualifierProviderValidator | MutableContextQualifierProviderValidator}.
|
|
6879
|
+
* @param params - Required parameters for constructing the validator.
|
|
6880
|
+
*/
|
|
6881
|
+
constructor(params: IMutableContextQualifierProviderValidatorCreateParams<T>);
|
|
6882
|
+
/**
|
|
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>;
|
|
5569
6897
|
}
|
|
5570
6898
|
|
|
5571
6899
|
/**
|
|
@@ -5618,6 +6946,14 @@ declare namespace Normalized {
|
|
|
5618
6946
|
}
|
|
5619
6947
|
}
|
|
5620
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
|
+
|
|
5621
6957
|
/**
|
|
5622
6958
|
* Overall cache metrics across all cache types.
|
|
5623
6959
|
* @public
|
|
@@ -5672,6 +7008,22 @@ declare function parseQualifierDefaultValuesTokenParts(token: string): Result<IQ
|
|
|
5672
7008
|
*/
|
|
5673
7009
|
declare function parseQualifierDefaultValueTokenParts(token: string): Result<IQualifierDefaultValueTokenParts>;
|
|
5674
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
|
+
|
|
5675
7027
|
/**
|
|
5676
7028
|
* {@link Import.Importers.IImporter | Importer} implementation which imports resources from a `FileTree`
|
|
5677
7029
|
* given a path.
|
|
@@ -5899,6 +7251,12 @@ export declare type QualifierConditionValue = Brand<string, 'QualifierConditionV
|
|
|
5899
7251
|
*/
|
|
5900
7252
|
export declare type QualifierContextValue = Brand<string, 'QualifierContextValue'>;
|
|
5901
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
|
+
|
|
5902
7260
|
/**
|
|
5903
7261
|
* Converter for a {@link Qualifiers.IQualifierDecl | qualifier declaration}.
|
|
5904
7262
|
* @public
|
|
@@ -6081,7 +7439,7 @@ declare const qualifierName: Converter<QualifierName, unknown>;
|
|
|
6081
7439
|
|
|
6082
7440
|
declare namespace Qualifiers {
|
|
6083
7441
|
export {
|
|
6084
|
-
|
|
7442
|
+
Convert_4 as Convert,
|
|
6085
7443
|
Qualifier,
|
|
6086
7444
|
IQualifierDecl,
|
|
6087
7445
|
IValidatedQualifierDecl,
|
|
@@ -6102,11 +7460,15 @@ export { Qualifiers }
|
|
|
6102
7460
|
* the {@link QualifierTypes.IQualifierType | IQualifierType} interface.
|
|
6103
7461
|
* @public
|
|
6104
7462
|
*/
|
|
6105
|
-
export declare abstract class QualifierType implements IQualifierType {
|
|
7463
|
+
export declare abstract class QualifierType<TCFGJSON extends JsonObject = JsonObject> implements IQualifierType<TCFGJSON> {
|
|
6106
7464
|
/**
|
|
6107
7465
|
* {@inheritdoc QualifierTypes.IQualifierType.name}
|
|
6108
7466
|
*/
|
|
6109
7467
|
readonly name: QualifierTypeName;
|
|
7468
|
+
/**
|
|
7469
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
7470
|
+
*/
|
|
7471
|
+
abstract readonly systemTypeName: QualifierTypeName;
|
|
6110
7472
|
/**
|
|
6111
7473
|
* {@inheritdoc QualifierTypes.IQualifierType.key}
|
|
6112
7474
|
*/
|
|
@@ -6152,6 +7514,14 @@ export declare abstract class QualifierType implements IQualifierType {
|
|
|
6152
7514
|
* {@inheritdoc QualifierTypes.IQualifierType.matches}
|
|
6153
7515
|
*/
|
|
6154
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>>>;
|
|
6155
7525
|
/**
|
|
6156
7526
|
* {@inheritdoc QualifierTypes.IQualifierType.setIndex}
|
|
6157
7527
|
*/
|
|
@@ -6207,7 +7577,7 @@ export declare abstract class QualifierType implements IQualifierType {
|
|
|
6207
7577
|
* index from a supplied {@link QualifierTypes.Convert.IQualifierTypeConvertContext | conversion context}.
|
|
6208
7578
|
* @public
|
|
6209
7579
|
*/
|
|
6210
|
-
declare const qualifierType: Converter<QualifierType
|
|
7580
|
+
declare const qualifierType: Converter<QualifierType<JsonObject>, IQualifierTypeConvertContext>;
|
|
6211
7581
|
|
|
6212
7582
|
/**
|
|
6213
7583
|
* Collector for {@link QualifierTypes.QualifierType | QualifierType} objects.
|
|
@@ -6231,6 +7601,74 @@ declare class QualifierTypeCollector extends ValidatingConvertingCollector<Quali
|
|
|
6231
7601
|
protected static _toQualifierType(from: unknown): Result<QualifierType>;
|
|
6232
7602
|
}
|
|
6233
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
|
+
|
|
6234
7672
|
/**
|
|
6235
7673
|
* Branded number representing a validated qualifier type index.
|
|
6236
7674
|
* @public
|
|
@@ -6258,7 +7696,7 @@ declare const qualifierTypeName: Converter<QualifierTypeName, unknown>;
|
|
|
6258
7696
|
declare namespace QualifierTypes {
|
|
6259
7697
|
export {
|
|
6260
7698
|
Config_2 as Config,
|
|
6261
|
-
|
|
7699
|
+
Convert_3 as Convert,
|
|
6262
7700
|
IQualifierType,
|
|
6263
7701
|
IQualifierTypeCreateParams,
|
|
6264
7702
|
QualifierType,
|
|
@@ -6266,7 +7704,6 @@ declare namespace QualifierTypes {
|
|
|
6266
7704
|
LanguageQualifierType,
|
|
6267
7705
|
ILiteralQualifierTypeCreateParams,
|
|
6268
7706
|
LiteralQualifierType,
|
|
6269
|
-
LiteralValueHierarchyDecl,
|
|
6270
7707
|
ILiteralValue,
|
|
6271
7708
|
ILiteralValueHierarchyCreateParams,
|
|
6272
7709
|
LiteralValueHierarchy,
|
|
@@ -6276,7 +7713,8 @@ declare namespace QualifierTypes {
|
|
|
6276
7713
|
QualifierTypeCollector,
|
|
6277
7714
|
ReadOnlyQualifierTypeCollector,
|
|
6278
7715
|
createQualifierTypeFromConfig,
|
|
6279
|
-
createQualifierTypeFromSystemConfig
|
|
7716
|
+
createQualifierTypeFromSystemConfig,
|
|
7717
|
+
SystemQualifierType
|
|
6280
7718
|
}
|
|
6281
7719
|
}
|
|
6282
7720
|
export { QualifierTypes }
|
|
@@ -6299,6 +7737,24 @@ declare type ReadOnlyConditionCollector = Collections.IReadOnlyValidatingCollect
|
|
|
6299
7737
|
*/
|
|
6300
7738
|
declare type ReadOnlyConditionSetCollector = Collections.IReadOnlyValidatingCollector<ConditionSet>;
|
|
6301
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
|
+
|
|
6302
7758
|
/**
|
|
6303
7759
|
* Interface exposing non-mutating members of a
|
|
6304
7760
|
* {@link QualifierTypes.QualifierTypeCollector | QualifierTypeCollector}.
|
|
@@ -6444,6 +7900,7 @@ declare namespace RegularExpressions {
|
|
|
6444
7900
|
contextToken_2 as contextToken,
|
|
6445
7901
|
conditionSetHash_2 as conditionSetHash,
|
|
6446
7902
|
decisionKey_2 as decisionKey,
|
|
7903
|
+
candidateValueKey_2 as candidateValueKey,
|
|
6447
7904
|
qualifierDefaultValueToken_2 as qualifierDefaultValueToken,
|
|
6448
7905
|
qualifierDefaultValuesToken_2 as qualifierDefaultValuesToken,
|
|
6449
7906
|
territoryCode
|
|
@@ -6460,10 +7917,14 @@ export declare class Resource implements IResource {
|
|
|
6460
7917
|
* The unique {@link ResourceId | id} of the resource.
|
|
6461
7918
|
*/
|
|
6462
7919
|
readonly id: ResourceId;
|
|
7920
|
+
/**
|
|
7921
|
+
* The name of the resource.
|
|
7922
|
+
*/
|
|
7923
|
+
readonly name: ResourceName;
|
|
6463
7924
|
/**
|
|
6464
7925
|
* The {@link ResourceTypes.ResourceType | type} of the resource.
|
|
6465
7926
|
*/
|
|
6466
|
-
readonly
|
|
7927
|
+
readonly resourceType: ResourceType;
|
|
6467
7928
|
/**
|
|
6468
7929
|
* The array of {@link Resources.ResourceCandidate | candidates} for the resource.
|
|
6469
7930
|
*/
|
|
@@ -6472,10 +7933,6 @@ export declare class Resource implements IResource {
|
|
|
6472
7933
|
* {@link Decisions.ConcreteDecision | Decision} for optimized resource resolution.
|
|
6473
7934
|
*/
|
|
6474
7935
|
readonly decision: ConcreteDecision;
|
|
6475
|
-
/**
|
|
6476
|
-
* Gets the resource type (implements IResource interface).
|
|
6477
|
-
*/
|
|
6478
|
-
get resourceType(): ResourceType;
|
|
6479
7936
|
/**
|
|
6480
7937
|
* Gets the resource type name as a string.
|
|
6481
7938
|
*/
|
|
@@ -6600,6 +8057,10 @@ declare class ResourceBuilder {
|
|
|
6600
8057
|
* Collector for {@link Decisions.AbstractDecision | abstract decisions}.
|
|
6601
8058
|
*/
|
|
6602
8059
|
protected _decisions: AbstractDecisionCollector;
|
|
8060
|
+
/**
|
|
8061
|
+
* Collector for candidate values.
|
|
8062
|
+
*/
|
|
8063
|
+
protected _candidateValues: CandidateValueCollector;
|
|
6603
8064
|
/**
|
|
6604
8065
|
* Constructor for a {@link Resources.ResourceBuilder | ResourceBuilder} object.
|
|
6605
8066
|
* @param params - Parameters to construct the new {@link Resources.ResourceBuilder | ResourceBuilder}.
|
|
@@ -6677,10 +8138,16 @@ export declare class ResourceCandidate implements IResourceCandidate {
|
|
|
6677
8138
|
* is a possible instance.
|
|
6678
8139
|
*/
|
|
6679
8140
|
readonly id: ResourceId;
|
|
8141
|
+
/**
|
|
8142
|
+
* The candidate value that contains the JSON representation of the instance data.
|
|
8143
|
+
*/
|
|
8144
|
+
readonly candidateValue: CandidateValue;
|
|
6680
8145
|
/**
|
|
6681
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.
|
|
6682
8149
|
*/
|
|
6683
|
-
|
|
8150
|
+
get json(): JsonObject;
|
|
6684
8151
|
/**
|
|
6685
8152
|
* The conditions under which this candidate applies.
|
|
6686
8153
|
*/
|
|
@@ -6698,6 +8165,10 @@ export declare class ResourceCandidate implements IResourceCandidate {
|
|
|
6698
8165
|
* this candidate belongs.
|
|
6699
8166
|
*/
|
|
6700
8167
|
readonly resourceType: ResourceType | undefined;
|
|
8168
|
+
/**
|
|
8169
|
+
* The completeness of the candidate value.
|
|
8170
|
+
*/
|
|
8171
|
+
get completeness(): CandidateCompleteness;
|
|
6701
8172
|
/**
|
|
6702
8173
|
* Constructor for a {@link Resources.ResourceCandidate | ResourceCandidate} object.
|
|
6703
8174
|
* @param params - Parameters to create a new {@link Resources.ResourceCandidate | ResourceCandidate}.
|
|
@@ -6870,6 +8341,17 @@ declare class ResourceDeclTree implements IResourceDeclContainer {
|
|
|
6870
8341
|
private _extract;
|
|
6871
8342
|
}
|
|
6872
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
|
+
|
|
6873
8355
|
/**
|
|
6874
8356
|
* Branded string representing a validated resource id. A resource ID
|
|
6875
8357
|
* is a dot-separated sequence of resource names.
|
|
@@ -6898,7 +8380,7 @@ declare const resourceIndex: Converter<ResourceIndex, unknown>;
|
|
|
6898
8380
|
declare namespace ResourceJson {
|
|
6899
8381
|
export {
|
|
6900
8382
|
Compiled,
|
|
6901
|
-
|
|
8383
|
+
Convert_7 as Convert,
|
|
6902
8384
|
Helpers_2 as Helpers,
|
|
6903
8385
|
Json,
|
|
6904
8386
|
Normalized,
|
|
@@ -6916,15 +8398,59 @@ export { ResourceJson }
|
|
|
6916
8398
|
* and builds a collection of {@link Resources.Resource | resources} once all candidates are collected.
|
|
6917
8399
|
* @public
|
|
6918
8400
|
*/
|
|
6919
|
-
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
|
+
*/
|
|
6920
8405
|
readonly qualifiers: IReadOnlyQualifierCollector;
|
|
8406
|
+
/**
|
|
8407
|
+
* The {@link ResourceTypes.ReadOnlyResourceTypeCollector | resource types} used by this resource manager.
|
|
8408
|
+
*/
|
|
6921
8409
|
readonly resourceTypes: ReadOnlyResourceTypeCollector;
|
|
8410
|
+
/**
|
|
8411
|
+
* The {@link Conditions.ConditionCollector | condition collector} used by this resource manager.
|
|
8412
|
+
* @internal
|
|
8413
|
+
*/
|
|
6922
8414
|
protected readonly _conditions: ConditionCollector;
|
|
8415
|
+
/**
|
|
8416
|
+
* The {@link Conditions.ConditionSetCollector | condition set collector} used by this resource manager.
|
|
8417
|
+
* @internal
|
|
8418
|
+
*/
|
|
6923
8419
|
protected readonly _conditionSets: ConditionSetCollector;
|
|
8420
|
+
/**
|
|
8421
|
+
* The {@link Decisions.AbstractDecisionCollector | abstract decision collector} used by this resource manager.
|
|
8422
|
+
* @internal
|
|
8423
|
+
*/
|
|
6924
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
|
+
*/
|
|
6925
8434
|
protected readonly _resources: ValidatingResultMap<ResourceId, ResourceBuilder>;
|
|
6926
|
-
|
|
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
|
+
*/
|
|
6927
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;
|
|
6928
8454
|
/**
|
|
6929
8455
|
* A {@link Conditions.ConditionCollector | ConditionCollector} which
|
|
6930
8456
|
* contains the {@link Conditions.Condition | conditions} used so far by
|
|
@@ -6990,6 +8516,17 @@ export declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
6990
8516
|
* @public
|
|
6991
8517
|
*/
|
|
6992
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>;
|
|
6993
8530
|
/**
|
|
6994
8531
|
* Given a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration}, builds and adds
|
|
6995
8532
|
* a {@link Resources.ResourceCandidate | candidate} to the manager.
|
|
@@ -6999,6 +8536,20 @@ export declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
6999
8536
|
*/
|
|
7000
8537
|
addLooseCandidate(decl: ResourceJson.Json.ILooseResourceCandidateDecl): DetailedResult<ResourceCandidate, ResourceBuilderResultDetail>;
|
|
7001
8538
|
addResource(decl: ResourceJson.Json.ILooseResourceDecl): DetailedResult<ResourceBuilder, ResourceBuilderResultDetail>;
|
|
8539
|
+
/**
|
|
8540
|
+
* Adds a condition to the manager.
|
|
8541
|
+
* @param decl - The condition declaration to add.
|
|
8542
|
+
* @returns `Success` with the condition if successful, or `Failure` with an error message if not.
|
|
8543
|
+
* @public
|
|
8544
|
+
*/
|
|
8545
|
+
addCondition(decl: ResourceJson.Json.ILooseConditionDecl): Result<Condition>;
|
|
8546
|
+
/**
|
|
8547
|
+
* Adds a condition set to the manager.
|
|
8548
|
+
* @param decl - The condition set declaration to add.
|
|
8549
|
+
* @returns `Success` with the condition set if successful, or `Failure` with an error message if not.
|
|
8550
|
+
* @public
|
|
8551
|
+
*/
|
|
8552
|
+
addConditionSet(conditions: ResourceJson.Normalized.ConditionSetDecl): Result<ConditionSet>;
|
|
7002
8553
|
/**
|
|
7003
8554
|
* Gets a read-only array of all {@link Resources.ResourceBuilder | resource builders} present in the manager.
|
|
7004
8555
|
* @returns `Success` with the {@link Resources.ResourceBuilder | resource builder} if successful,
|
|
@@ -7029,6 +8580,19 @@ export declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
7029
8580
|
* @public
|
|
7030
8581
|
*/
|
|
7031
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>>;
|
|
7032
8596
|
/**
|
|
7033
8597
|
* Gets a read-only array of all {@link Resources.Resource | built resources} in the manager.
|
|
7034
8598
|
* @returns `Success` with an array of resources if successful, or `Failure` with an error message if not.
|
|
@@ -7102,12 +8666,17 @@ export declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
7102
8666
|
*/
|
|
7103
8667
|
getResourceCollectionDecl(options?: IResourceDeclarationOptions): Result<ResourceJson.Normalized.IResourceCollectionDecl>;
|
|
7104
8668
|
/**
|
|
7105
|
-
* Creates a
|
|
7106
|
-
* This
|
|
7107
|
-
*
|
|
7108
|
-
*
|
|
7109
|
-
*
|
|
7110
|
-
* @
|
|
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.
|
|
7111
8680
|
* @public
|
|
7112
8681
|
*/
|
|
7113
8682
|
clone(options?: IResourceManagerCloneOptions): Result<ResourceManagerBuilder>;
|
|
@@ -7126,7 +8695,6 @@ export declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
7126
8695
|
* @returns A Result containing the ConditionSet token if successful, or failure if validation fails
|
|
7127
8696
|
* @internal
|
|
7128
8697
|
*/
|
|
7129
|
-
private static _getConditionSetToken;
|
|
7130
8698
|
/**
|
|
7131
8699
|
* Applies candidate edits to a resource declaration, handling collisions using condition set tokens.
|
|
7132
8700
|
* If there's no collision, adds the candidate. If there's a collision, replaces the original candidate with the edit.
|
|
@@ -7147,6 +8715,49 @@ export declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
7147
8715
|
* @internal
|
|
7148
8716
|
*/
|
|
7149
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;
|
|
7150
8761
|
}
|
|
7151
8762
|
|
|
7152
8763
|
/**
|
|
@@ -7173,7 +8784,7 @@ declare const resourceName: Converter<ResourceName, unknown>;
|
|
|
7173
8784
|
* and caching results for optimal performance.
|
|
7174
8785
|
* @public
|
|
7175
8786
|
*/
|
|
7176
|
-
export declare class ResourceResolver {
|
|
8787
|
+
export declare class ResourceResolver implements IResourceResolver {
|
|
7177
8788
|
/**
|
|
7178
8789
|
* The resource manager that defines available resources and provides condition access.
|
|
7179
8790
|
*/
|
|
@@ -7190,6 +8801,10 @@ export declare class ResourceResolver {
|
|
|
7190
8801
|
* The configuration options for this resource resolver.
|
|
7191
8802
|
*/
|
|
7192
8803
|
readonly options: IResourceResolverOptions;
|
|
8804
|
+
/**
|
|
8805
|
+
* The readonly qualifier collector that provides qualifier implementations.
|
|
8806
|
+
*/
|
|
8807
|
+
get qualifiers(): IReadOnlyQualifierCollector;
|
|
7193
8808
|
/**
|
|
7194
8809
|
* The cache array for resolved conditions, indexed by condition index for O(1) lookup.
|
|
7195
8810
|
* Each entry stores the resolved {@link Runtime.IConditionMatchResult | condition match result} for
|
|
@@ -7274,6 +8889,15 @@ export declare class ResourceResolver {
|
|
|
7274
8889
|
* @public
|
|
7275
8890
|
*/
|
|
7276
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>;
|
|
7277
8901
|
/**
|
|
7278
8902
|
* Resolves all matching resource candidates in priority order.
|
|
7279
8903
|
* Uses the resource's associated decision to determine all matching candidates based on the current context.
|
|
@@ -7283,6 +8907,15 @@ export declare class ResourceResolver {
|
|
|
7283
8907
|
* @public
|
|
7284
8908
|
*/
|
|
7285
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>>;
|
|
7286
8919
|
/**
|
|
7287
8920
|
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
7288
8921
|
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
@@ -7293,6 +8926,20 @@ export declare class ResourceResolver {
|
|
|
7293
8926
|
* @public
|
|
7294
8927
|
*/
|
|
7295
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>;
|
|
7296
8943
|
/**
|
|
7297
8944
|
* Clears all caches (condition, condition set, and decision), forcing all cached items
|
|
7298
8945
|
* to be re-evaluated on next access. This should be called when the context changes and cached
|
|
@@ -7380,6 +9027,11 @@ declare namespace Resources {
|
|
|
7380
9027
|
ICandidateInfo,
|
|
7381
9028
|
IReducedCandidate,
|
|
7382
9029
|
CandidateReducer,
|
|
9030
|
+
ICandidateValue,
|
|
9031
|
+
ICandidateValueCreateParams,
|
|
9032
|
+
CandidateValue,
|
|
9033
|
+
ICandidateValueCollectorCreateParams,
|
|
9034
|
+
CandidateValueCollector,
|
|
7383
9035
|
IResourceCandidateCreateParams,
|
|
7384
9036
|
ICandidateDeclOptions,
|
|
7385
9037
|
ResourceCandidate,
|
|
@@ -7440,7 +9092,7 @@ declare const resourceTreeChildNodeDecl: Converter<Normalized.IResourceTreeChild
|
|
|
7440
9092
|
* strongly-typed internal tree operations, ensuring type safety and consistent
|
|
7441
9093
|
* error handling throughout the resource tree navigation.
|
|
7442
9094
|
*
|
|
7443
|
-
* @
|
|
9095
|
+
* @public
|
|
7444
9096
|
*/
|
|
7445
9097
|
declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeChildren<T, string, string> {
|
|
7446
9098
|
private readonly _inner;
|
|
@@ -7495,17 +9147,17 @@ declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeC
|
|
|
7495
9147
|
*/
|
|
7496
9148
|
forEach(cb: (value: unknown, key: string, map: IReadOnlyResultMap<string, unknown>, thisArg?: unknown) => void, arg?: unknown): void;
|
|
7497
9149
|
/**
|
|
7498
|
-
* Gets a child node by its
|
|
7499
|
-
* @param key - The
|
|
9150
|
+
* Gets a child node by its string key with detailed error information.
|
|
9151
|
+
* @param key - The string key to look up
|
|
7500
9152
|
* @returns DetailedResult containing the node if found, or failure with details
|
|
7501
9153
|
*/
|
|
7502
|
-
get(key:
|
|
9154
|
+
get(key: string): DetailedResult<IReadOnlyResourceTreeNode<T>, Collections.ResultMapResultDetail>;
|
|
7503
9155
|
/**
|
|
7504
|
-
* Checks if a child node exists at the given
|
|
7505
|
-
* @param key - The
|
|
9156
|
+
* Checks if a child node exists at the given string key.
|
|
9157
|
+
* @param key - The string key to check
|
|
7506
9158
|
* @returns True if a child node exists at the key, false otherwise
|
|
7507
9159
|
*/
|
|
7508
|
-
has(key:
|
|
9160
|
+
has(key: string): boolean;
|
|
7509
9161
|
/**
|
|
7510
9162
|
* Returns an iterator of ResourceName keys for all child nodes.
|
|
7511
9163
|
* @returns Map iterator for all child node keys
|
|
@@ -7529,6 +9181,111 @@ declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeC
|
|
|
7529
9181
|
*/
|
|
7530
9182
|
declare type ResourceTreeNodeInit<T> = IResourceTreeLeafInit<T> | IResourceTreeBranchInit<T>;
|
|
7531
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
|
+
|
|
7532
9289
|
/**
|
|
7533
9290
|
* `Converter` for a normalized {@link ResourceJson.Normalized.IResourceTreeRootDecl | resource tree root declaration}.
|
|
7534
9291
|
* @public
|
|
@@ -7541,17 +9298,22 @@ declare const resourceTreeRootDecl: Converter<Normalized.IResourceTreeRootDecl>;
|
|
|
7541
9298
|
* resource value.
|
|
7542
9299
|
* @public
|
|
7543
9300
|
*/
|
|
7544
|
-
export declare abstract class ResourceType<T = unknown> implements
|
|
9301
|
+
export declare abstract class ResourceType<T = unknown> implements IResourceType<T> {
|
|
7545
9302
|
private _collectible;
|
|
9303
|
+
private _template;
|
|
7546
9304
|
/**
|
|
7547
|
-
*
|
|
9305
|
+
* {@inheritdoc ResourceTypes.IResourceType.key}
|
|
7548
9306
|
*/
|
|
7549
9307
|
get key(): ResourceTypeName;
|
|
7550
9308
|
/**
|
|
7551
|
-
*
|
|
9309
|
+
* Name of the underlying system type.
|
|
9310
|
+
*/
|
|
9311
|
+
abstract readonly systemTypeName: ResourceTypeName;
|
|
9312
|
+
/**
|
|
9313
|
+
* {@inheritdoc ResourceTypes.IResourceType.index}
|
|
7552
9314
|
*/
|
|
7553
9315
|
get index(): ResourceTypeIndex | undefined;
|
|
7554
|
-
protected constructor(key: ResourceTypeName, index?: number);
|
|
9316
|
+
protected constructor(key: ResourceTypeName, index?: number, template?: JsonObject);
|
|
7555
9317
|
/**
|
|
7556
9318
|
* Validates properties of a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration} for
|
|
7557
9319
|
* a resource instance value.
|
|
@@ -7601,6 +9363,25 @@ export declare abstract class ResourceType<T = unknown> implements ICollectible<
|
|
|
7601
9363
|
* Sets the index for this resource type. Once set, the index cannot be changed.
|
|
7602
9364
|
*/
|
|
7603
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>;
|
|
7604
9385
|
}
|
|
7605
9386
|
|
|
7606
9387
|
/**
|
|
@@ -7624,7 +9405,30 @@ declare class ResourceTypeCollector extends ValidatingCollector<ResourceType> {
|
|
|
7624
9405
|
* @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
|
|
7625
9406
|
* @public
|
|
7626
9407
|
*/
|
|
7627
|
-
declare const resourceTypeConfig: ObjectConverter<IResourceTypeConfig
|
|
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>;
|
|
7628
9432
|
|
|
7629
9433
|
/**
|
|
7630
9434
|
* Branded number representing a validated resource type index.
|
|
@@ -7654,6 +9458,7 @@ declare namespace ResourceTypes {
|
|
|
7654
9458
|
export {
|
|
7655
9459
|
Config_3 as Config,
|
|
7656
9460
|
IResourceCandidateValidationProperties,
|
|
9461
|
+
IResourceType,
|
|
7657
9462
|
ResourceType,
|
|
7658
9463
|
IResourceCollectorCreateParams,
|
|
7659
9464
|
ResourceTypeCollector,
|
|
@@ -7697,6 +9502,10 @@ declare namespace Runtime {
|
|
|
7697
9502
|
IResourceResolverOptions,
|
|
7698
9503
|
IResourceResolverCreateParams,
|
|
7699
9504
|
ResourceResolver,
|
|
9505
|
+
ResourceErrorHandler,
|
|
9506
|
+
EmptyBranchHandler,
|
|
9507
|
+
IResolveResourceTreeOptions,
|
|
9508
|
+
ResourceTreeResolver,
|
|
7700
9509
|
ConditionMatchType,
|
|
7701
9510
|
IConditionMatchResult,
|
|
7702
9511
|
ConditionSetResolutionResult,
|
|
@@ -7712,6 +9521,14 @@ declare namespace Runtime {
|
|
|
7712
9521
|
}
|
|
7713
9522
|
export { Runtime }
|
|
7714
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
|
+
|
|
7715
9532
|
/**
|
|
7716
9533
|
* @internal
|
|
7717
9534
|
*/
|
|
@@ -7722,7 +9539,12 @@ declare const segmentedIdentifier: RegExp;
|
|
|
7722
9539
|
* using a `ResultMap` for qualifier value storage.
|
|
7723
9540
|
* @public
|
|
7724
9541
|
*/
|
|
7725
|
-
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;
|
|
7726
9548
|
/**
|
|
7727
9549
|
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
7728
9550
|
*/
|
|
@@ -7800,6 +9622,14 @@ declare class SimpleContextQualifierProvider extends ContextQualifierProvider {
|
|
|
7800
9622
|
* @public
|
|
7801
9623
|
*/
|
|
7802
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;
|
|
7803
9633
|
/**
|
|
7804
9634
|
* Resolves a qualifier name from a name, index, or qualifier object.
|
|
7805
9635
|
* @param nameOrIndexOrQualifier - The input to resolve.
|
|
@@ -7808,6 +9638,14 @@ declare class SimpleContextQualifierProvider extends ContextQualifierProvider {
|
|
|
7808
9638
|
* @internal
|
|
7809
9639
|
*/
|
|
7810
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;
|
|
7811
9649
|
}
|
|
7812
9650
|
|
|
7813
9651
|
/**
|
|
@@ -7853,7 +9691,7 @@ declare class SystemConfiguration {
|
|
|
7853
9691
|
* @param config - The {@link Config.Model.ISystemConfiguration | system configuration} to use.
|
|
7854
9692
|
* @public
|
|
7855
9693
|
*/
|
|
7856
|
-
protected constructor(config: ISystemConfiguration);
|
|
9694
|
+
protected constructor(config: ISystemConfiguration, initParams?: ISystemConfigurationInitParams);
|
|
7857
9695
|
/**
|
|
7858
9696
|
* Creates a new {@link Config.SystemConfiguration | SystemConfiguration} from the supplied
|
|
7859
9697
|
* {@link Config.Model.ISystemConfiguration | system configuration}.
|
|
@@ -7864,6 +9702,14 @@ declare class SystemConfiguration {
|
|
|
7864
9702
|
* @public
|
|
7865
9703
|
*/
|
|
7866
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>;
|
|
7867
9713
|
/**
|
|
7868
9714
|
* Returns the {@link Config.Model.ISystemConfiguration | system configuration} that this
|
|
7869
9715
|
* {@link Config.SystemConfiguration | SystemConfiguration} was created from.
|
|
@@ -7881,33 +9727,48 @@ declare class SystemConfiguration {
|
|
|
7881
9727
|
*/
|
|
7882
9728
|
declare const systemConfiguration: ObjectConverter<ISystemConfiguration, unknown>;
|
|
7883
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
|
+
|
|
7884
9737
|
/**
|
|
7885
9738
|
* A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
|
|
7886
9739
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
|
|
7887
9740
|
* @public
|
|
7888
9741
|
*/
|
|
7889
|
-
declare const systemLanguageQualifierTypeConfig: ObjectConverter<
|
|
9742
|
+
declare const systemLanguageQualifierTypeConfig: ObjectConverter<Model_2.ISystemLanguageQualifierTypeConfig, unknown>;
|
|
7890
9743
|
|
|
7891
9744
|
/**
|
|
7892
9745
|
* A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
|
|
7893
9746
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
|
|
7894
9747
|
* @public
|
|
7895
9748
|
*/
|
|
7896
|
-
declare const systemLiteralQualifierTypeConfig: ObjectConverter<
|
|
9749
|
+
declare const systemLiteralQualifierTypeConfig: ObjectConverter<Model_2.ISystemLiteralQualifierTypeConfig, unknown>;
|
|
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;
|
|
7897
9758
|
|
|
7898
9759
|
/**
|
|
7899
9760
|
* A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
|
|
7900
9761
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
|
|
7901
9762
|
* @public
|
|
7902
9763
|
*/
|
|
7903
|
-
declare const systemQualifierTypeConfig: Converter<
|
|
9764
|
+
declare const systemQualifierTypeConfig: Converter<Model_2.ISystemQualifierTypeConfig, unknown>;
|
|
7904
9765
|
|
|
7905
9766
|
/**
|
|
7906
9767
|
* A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
|
|
7907
9768
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
|
|
7908
9769
|
* @public
|
|
7909
9770
|
*/
|
|
7910
|
-
declare const systemTerritoryQualifierTypeConfig: ObjectConverter<
|
|
9771
|
+
declare const systemTerritoryQualifierTypeConfig: ObjectConverter<Model_2.ISystemTerritoryQualifierTypeConfig, unknown>;
|
|
7911
9772
|
|
|
7912
9773
|
/**
|
|
7913
9774
|
* @internal
|
|
@@ -7938,7 +9799,11 @@ declare const TerritoryPrioritySystemConfiguration: ISystemConfiguration;
|
|
|
7938
9799
|
* implementation handles incorrect casing.
|
|
7939
9800
|
* @public
|
|
7940
9801
|
*/
|
|
7941
|
-
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;
|
|
7942
9807
|
/**
|
|
7943
9808
|
* Optional array enumerating allowed territories to further constrain the type.
|
|
7944
9809
|
*/
|
|
@@ -7980,6 +9845,27 @@ declare class TerritoryQualifierType extends QualifierType {
|
|
|
7980
9845
|
* @public
|
|
7981
9846
|
*/
|
|
7982
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>;
|
|
7983
9869
|
/**
|
|
7984
9870
|
* {@inheritdoc QualifierTypes.QualifierType._matchOne}
|
|
7985
9871
|
*/
|
|
@@ -8010,7 +9896,27 @@ declare class TerritoryQualifierType extends QualifierType {
|
|
|
8010
9896
|
* @returns A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.
|
|
8011
9897
|
* @public
|
|
8012
9898
|
*/
|
|
8013
|
-
declare const territoryQualifierTypeConfig: ObjectConverter<
|
|
9899
|
+
declare const territoryQualifierTypeConfig: ObjectConverter<Model_2.ITerritoryQualifierTypeConfig, unknown>;
|
|
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>;
|
|
8014
9920
|
|
|
8015
9921
|
/**
|
|
8016
9922
|
* Converts a number to a {@link ConditionIndex} if it is a valid condition index.
|
|
@@ -8139,6 +10045,15 @@ declare function toDecisionKey(key: string): Result<DecisionKey>;
|
|
|
8139
10045
|
*/
|
|
8140
10046
|
declare function toOptionalResourceId(id?: string): Result<ResourceId | undefined>;
|
|
8141
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
|
+
|
|
8142
10057
|
/**
|
|
8143
10058
|
* Converts a string to a {@link QualifierDefaultValuesToken} if it is a valid qualifier default values token.
|
|
8144
10059
|
* @param token - the string to convert
|
|
@@ -8282,7 +10197,9 @@ declare namespace Validate {
|
|
|
8282
10197
|
isValidConditionSetHash,
|
|
8283
10198
|
isValidDecisionKey,
|
|
8284
10199
|
isValidDecisionIndex,
|
|
10200
|
+
isValidQualifierContextValue,
|
|
8285
10201
|
toQualifierName,
|
|
10202
|
+
toQualifierContextValue,
|
|
8286
10203
|
toQualifierIndex,
|
|
8287
10204
|
toQualifierTypeName,
|
|
8288
10205
|
toQualifierTypeIndex,
|
|
@@ -8311,12 +10228,16 @@ declare namespace Validate {
|
|
|
8311
10228
|
isValidResourceIndex,
|
|
8312
10229
|
isValidResourceTypeName,
|
|
8313
10230
|
isValidResourceTypeIndex,
|
|
10231
|
+
isValidCandidateValueIndex,
|
|
10232
|
+
isValidCandidateValueKey,
|
|
8314
10233
|
toResourceName,
|
|
8315
10234
|
toResourceId,
|
|
8316
10235
|
toOptionalResourceId,
|
|
8317
10236
|
toResourceIndex,
|
|
8318
10237
|
toResourceTypeName,
|
|
8319
|
-
toResourceTypeIndex
|
|
10238
|
+
toResourceTypeIndex,
|
|
10239
|
+
toCandidateValueKey,
|
|
10240
|
+
toCandidateValueIndex
|
|
8320
10241
|
}
|
|
8321
10242
|
}
|
|
8322
10243
|
export { Validate }
|
|
@@ -8361,19 +10282,107 @@ declare const validatedContextQualifierValueDecl: Converter<IValidatedContextQua
|
|
|
8361
10282
|
*/
|
|
8362
10283
|
declare const validatedQualifierDecl: Converter<IValidatedQualifierDecl, IQualifierDeclConvertContext>;
|
|
8363
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
|
+
|
|
8364
10373
|
/**
|
|
8365
10374
|
* A {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider} with a
|
|
8366
|
-
* {@link Runtime.Context.
|
|
10375
|
+
* {@link Runtime.Context.MutableContextQualifierProviderValidator | validator} property that enables
|
|
8367
10376
|
* validated use of the underlying provider with string keys and values.
|
|
8368
10377
|
* This eliminates the need for type casting in consumer code.
|
|
8369
10378
|
* @public
|
|
8370
10379
|
*/
|
|
8371
10380
|
declare class ValidatingSimpleContextQualifierProvider extends SimpleContextQualifierProvider {
|
|
8372
10381
|
/**
|
|
8373
|
-
* A {@link Runtime.Context.
|
|
10382
|
+
* A {@link Runtime.Context.MutableContextQualifierProviderValidator | MutableContextQualifierProviderValidator} which validates
|
|
8374
10383
|
* string inputs before passing them to this provider.
|
|
8375
10384
|
*/
|
|
8376
|
-
readonly validating:
|
|
10385
|
+
readonly validating: IMutableContextQualifierProviderValidator;
|
|
8377
10386
|
/**
|
|
8378
10387
|
* Constructor for a {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider} object.
|
|
8379
10388
|
* @param params - {@link Runtime.IValidatingSimpleContextQualifierProviderCreateParams | Parameters} used to create the provider.
|
|
@@ -8389,4 +10398,194 @@ declare class ValidatingSimpleContextQualifierProvider extends SimpleContextQual
|
|
|
8389
10398
|
static create(params: IValidatingSimpleContextQualifierProviderCreateParams): Result<ValidatingSimpleContextQualifierProvider>;
|
|
8390
10399
|
}
|
|
8391
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
|
+
|
|
8392
10591
|
export { }
|