@fgv/ts-res 5.0.0-9 → 5.0.1-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +21 -0
- package/CHANGELOG.md +14 -1
- package/README.md +794 -137
- package/dist/ts-res.d.ts +2257 -268
- package/dist/tsdoc-metadata.json +1 -1
- package/eslint.config.js +16 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -1
- package/lib/packlets/bundle/bundleBuilder.js +7 -4
- package/lib/packlets/bundle/bundleLoader.js +1 -0
- package/lib/packlets/bundle/bundleUtils.js +14 -16
- package/lib/packlets/bundle/index.d.ts +3 -1
- package/lib/packlets/bundle/index.js +14 -3
- package/lib/packlets/common/convert.d.ts +15 -0
- package/lib/packlets/common/convert.js +16 -1
- package/lib/packlets/common/helpers/context.js +1 -0
- package/lib/packlets/common/helpers/resources.d.ts +7 -0
- package/lib/packlets/common/helpers/resources.js +13 -0
- package/lib/packlets/common/resources.d.ts +44 -1
- package/lib/packlets/common/validate/conditions.d.ts +17 -1
- package/lib/packlets/common/validate/conditions.js +32 -6
- package/lib/packlets/common/validate/regularExpressions.d.ts +4 -0
- package/lib/packlets/common/validate/regularExpressions.js +5 -1
- package/lib/packlets/common/validate/resources.d.ts +35 -1
- package/lib/packlets/common/validate/resources.js +55 -0
- package/lib/packlets/conditions/condition.js +1 -0
- package/lib/packlets/conditions/conditionSet.d.ts +9 -0
- package/lib/packlets/conditions/conditionSet.js +75 -1
- package/lib/packlets/config/configInitFactory.d.ts +217 -0
- package/lib/packlets/config/configInitFactory.js +302 -0
- package/lib/packlets/config/convert.d.ts +9 -0
- package/lib/packlets/config/convert.js +12 -1
- package/lib/packlets/config/index.d.ts +1 -0
- package/lib/packlets/config/index.js +1 -0
- package/lib/packlets/config/json.d.ts +1 -1
- package/lib/packlets/config/systemConfiguration.d.ts +16 -3
- package/lib/packlets/config/systemConfiguration.js +19 -40
- package/lib/packlets/import/fsItem.d.ts +2 -1
- package/lib/packlets/import/fsItem.js +9 -13
- package/lib/packlets/import/importManager.d.ts +2 -1
- package/lib/packlets/import/importers/jsonImporter.js +1 -0
- package/lib/packlets/import/importers/pathImporter.d.ts +2 -1
- package/lib/packlets/import/importers/pathImporter.js +2 -1
- package/lib/packlets/qualifier-types/config/convert.d.ts +22 -1
- package/lib/packlets/qualifier-types/config/convert.js +67 -2
- package/lib/packlets/qualifier-types/config/json.d.ts +24 -2
- package/lib/packlets/qualifier-types/config/json.js +11 -0
- package/lib/packlets/qualifier-types/convert.d.ts +1 -1
- package/lib/packlets/qualifier-types/helpers.d.ts +14 -5
- package/lib/packlets/qualifier-types/helpers.js +2 -2
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts +28 -2
- package/lib/packlets/qualifier-types/languageQualifierType.js +73 -0
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts +31 -5
- package/lib/packlets/qualifier-types/literalQualifierType.js +75 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +7 -11
- package/lib/packlets/qualifier-types/literalValueHierarchy.js +12 -1
- package/lib/packlets/qualifier-types/qualifierType.d.ts +31 -2
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +31 -5
- package/lib/packlets/qualifier-types/territoryQualifierType.js +80 -0
- package/lib/packlets/qualifiers/qualifierCollector.js +1 -2
- package/lib/packlets/resource-json/compiled/convert.js +2 -1
- package/lib/packlets/resource-json/compiled/json.d.ts +6 -2
- package/lib/packlets/resource-types/config/convert.d.ts +1 -1
- package/lib/packlets/resource-types/config/convert.js +3 -1
- package/lib/packlets/resource-types/config/json.d.ts +3 -1
- package/lib/packlets/resource-types/jsonResourceType.d.ts +10 -1
- package/lib/packlets/resource-types/jsonResourceType.js +7 -3
- package/lib/packlets/resource-types/resourceType.d.ts +100 -8
- package/lib/packlets/resource-types/resourceType.js +39 -3
- package/lib/packlets/resources/candidateReducer.js +3 -0
- package/lib/packlets/resources/candidateValue.d.ts +92 -0
- package/lib/packlets/resources/candidateValue.js +128 -0
- package/lib/packlets/resources/candidateValueCollector.d.ts +55 -0
- package/lib/packlets/resources/candidateValueCollector.js +96 -0
- package/lib/packlets/resources/common.d.ts +14 -0
- package/lib/packlets/resources/deltaGenerator.d.ts +189 -0
- package/lib/packlets/resources/deltaGenerator.js +344 -0
- package/lib/packlets/resources/index.d.ts +3 -0
- package/lib/packlets/resources/index.js +3 -0
- package/lib/packlets/resources/resource.d.ts +6 -6
- package/lib/packlets/resources/resource.js +5 -10
- package/lib/packlets/resources/resourceBuilder.d.ts +6 -0
- package/lib/packlets/resources/resourceBuilder.js +4 -1
- package/lib/packlets/resources/resourceCandidate.d.ts +15 -2
- package/lib/packlets/resources/resourceCandidate.js +17 -5
- package/lib/packlets/resources/resourceManagerBuilder.d.ts +131 -10
- package/lib/packlets/resources/resourceManagerBuilder.js +289 -45
- package/lib/packlets/runtime/compiledResourceCollection.d.ts +27 -11
- package/lib/packlets/runtime/compiledResourceCollection.js +71 -28
- package/lib/packlets/runtime/conditionSetResolutionResult.js +3 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +53 -3
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +82 -37
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +49 -77
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +23 -2
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +53 -31
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +4 -4
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +2 -2
- package/lib/packlets/runtime/iResourceManager.d.ts +17 -5
- package/lib/packlets/runtime/index.d.ts +1 -0
- package/lib/packlets/runtime/index.js +1 -0
- package/lib/packlets/runtime/resource-tree/common.d.ts +1 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +7 -7
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +5 -5
- package/lib/packlets/runtime/resourceResolver.d.ts +43 -1
- package/lib/packlets/runtime/resourceResolver.js +56 -28
- package/lib/packlets/runtime/resourceTreeResolver.d.ts +152 -0
- package/lib/packlets/runtime/resourceTreeResolver.js +222 -0
- package/lib/packlets/runtime/validate.js +1 -0
- package/lib/packlets/zip-archive/convert.d.ts +52 -0
- package/lib/packlets/zip-archive/convert.js +103 -0
- package/lib/packlets/zip-archive/index.d.ts +23 -0
- package/lib/packlets/zip-archive/index.js +95 -0
- package/lib/packlets/zip-archive/json.d.ts +64 -0
- package/lib/packlets/zip-archive/json.js +24 -0
- package/lib/packlets/zip-archive/types.d.ts +98 -0
- package/lib/packlets/zip-archive/types.js +39 -0
- package/lib/packlets/zip-archive/zipArchiveCreator.d.ts +35 -0
- package/lib/packlets/zip-archive/zipArchiveCreator.js +195 -0
- package/lib/packlets/zip-archive/zipArchiveFormat.d.ts +70 -0
- package/lib/packlets/zip-archive/zipArchiveFormat.js +184 -0
- package/lib/packlets/zip-archive/zipArchiveLoader.d.ts +70 -0
- package/lib/packlets/zip-archive/zipArchiveLoader.js +286 -0
- package/package.json +26 -32
- package/CLAUDE.md +0 -186
- package/EXAMPLE_INIT_PARAMS.md +0 -88
- package/PROGRESS_SUMMARY.md +0 -48
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/packlets/bundle/bundleBuilder.d.ts.map +0 -1
- package/lib/packlets/bundle/bundleBuilder.js.map +0 -1
- package/lib/packlets/bundle/bundleLoader.d.ts.map +0 -1
- package/lib/packlets/bundle/bundleLoader.js.map +0 -1
- package/lib/packlets/bundle/bundleNormalizer.d.ts.map +0 -1
- package/lib/packlets/bundle/bundleNormalizer.js.map +0 -1
- package/lib/packlets/bundle/bundleUtils.d.ts.map +0 -1
- package/lib/packlets/bundle/bundleUtils.js.map +0 -1
- package/lib/packlets/bundle/convert.d.ts.map +0 -1
- package/lib/packlets/bundle/convert.js.map +0 -1
- package/lib/packlets/bundle/index.d.ts.map +0 -1
- package/lib/packlets/bundle/index.js.map +0 -1
- package/lib/packlets/bundle/model.d.ts.map +0 -1
- package/lib/packlets/bundle/model.js.map +0 -1
- package/lib/packlets/common/conditions.d.ts.map +0 -1
- package/lib/packlets/common/conditions.js.map +0 -1
- package/lib/packlets/common/convert.d.ts.map +0 -1
- package/lib/packlets/common/convert.js.map +0 -1
- package/lib/packlets/common/helpers/conditions.d.ts.map +0 -1
- package/lib/packlets/common/helpers/conditions.js.map +0 -1
- package/lib/packlets/common/helpers/context.d.ts.map +0 -1
- package/lib/packlets/common/helpers/context.js.map +0 -1
- package/lib/packlets/common/helpers/index.d.ts.map +0 -1
- package/lib/packlets/common/helpers/index.js.map +0 -1
- package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +0 -1
- package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +0 -1
- package/lib/packlets/common/helpers/resources.d.ts.map +0 -1
- package/lib/packlets/common/helpers/resources.js.map +0 -1
- package/lib/packlets/common/index.d.ts.map +0 -1
- package/lib/packlets/common/index.js.map +0 -1
- package/lib/packlets/common/resources.d.ts.map +0 -1
- package/lib/packlets/common/resources.js.map +0 -1
- package/lib/packlets/common/validate/conditions.d.ts.map +0 -1
- package/lib/packlets/common/validate/conditions.js.map +0 -1
- package/lib/packlets/common/validate/index.d.ts.map +0 -1
- package/lib/packlets/common/validate/index.js.map +0 -1
- package/lib/packlets/common/validate/regularExpressions.d.ts.map +0 -1
- package/lib/packlets/common/validate/regularExpressions.js.map +0 -1
- package/lib/packlets/common/validate/resources.d.ts.map +0 -1
- package/lib/packlets/common/validate/resources.js.map +0 -1
- package/lib/packlets/conditions/condition.d.ts.map +0 -1
- package/lib/packlets/conditions/condition.js.map +0 -1
- package/lib/packlets/conditions/conditionCollector.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionCollector.js.map +0 -1
- package/lib/packlets/conditions/conditionDecls.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionDecls.js.map +0 -1
- package/lib/packlets/conditions/conditionSet.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionSet.js.map +0 -1
- package/lib/packlets/conditions/conditionSetCollector.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionSetCollector.js.map +0 -1
- package/lib/packlets/conditions/conditionSetDecls.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionSetDecls.js.map +0 -1
- package/lib/packlets/conditions/conditionToken.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionToken.js.map +0 -1
- package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +0 -1
- package/lib/packlets/conditions/convert/conditionSetDecls.js.map +0 -1
- package/lib/packlets/conditions/convert/decls.d.ts.map +0 -1
- package/lib/packlets/conditions/convert/decls.js.map +0 -1
- package/lib/packlets/conditions/convert/index.d.ts.map +0 -1
- package/lib/packlets/conditions/convert/index.js.map +0 -1
- package/lib/packlets/conditions/index.d.ts.map +0 -1
- package/lib/packlets/conditions/index.js.map +0 -1
- package/lib/packlets/config/common.d.ts.map +0 -1
- package/lib/packlets/config/common.js.map +0 -1
- package/lib/packlets/config/convert.d.ts.map +0 -1
- package/lib/packlets/config/convert.js.map +0 -1
- package/lib/packlets/config/index.d.ts.map +0 -1
- package/lib/packlets/config/index.js.map +0 -1
- package/lib/packlets/config/json.d.ts.map +0 -1
- package/lib/packlets/config/json.js.map +0 -1
- package/lib/packlets/config/predefined/default.d.ts.map +0 -1
- package/lib/packlets/config/predefined/default.js.map +0 -1
- package/lib/packlets/config/predefined/extended.d.ts.map +0 -1
- package/lib/packlets/config/predefined/extended.js.map +0 -1
- package/lib/packlets/config/predefined/index.d.ts.map +0 -1
- package/lib/packlets/config/predefined/index.js.map +0 -1
- package/lib/packlets/config/systemConfiguration.d.ts.map +0 -1
- package/lib/packlets/config/systemConfiguration.js.map +0 -1
- package/lib/packlets/context/contextDecls.d.ts.map +0 -1
- package/lib/packlets/context/contextDecls.js.map +0 -1
- package/lib/packlets/context/contextToken.d.ts.map +0 -1
- package/lib/packlets/context/contextToken.js.map +0 -1
- package/lib/packlets/context/convert/decls.d.ts.map +0 -1
- package/lib/packlets/context/convert/decls.js.map +0 -1
- package/lib/packlets/context/convert/index.d.ts.map +0 -1
- package/lib/packlets/context/convert/index.js.map +0 -1
- package/lib/packlets/context/index.d.ts.map +0 -1
- package/lib/packlets/context/index.js.map +0 -1
- package/lib/packlets/decisions/abstractDecision.d.ts.map +0 -1
- package/lib/packlets/decisions/abstractDecision.js.map +0 -1
- package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +0 -1
- package/lib/packlets/decisions/abstractDecisionCollector.js.map +0 -1
- package/lib/packlets/decisions/candidate.d.ts.map +0 -1
- package/lib/packlets/decisions/candidate.js.map +0 -1
- package/lib/packlets/decisions/common.d.ts.map +0 -1
- package/lib/packlets/decisions/common.js.map +0 -1
- package/lib/packlets/decisions/concreteDecision.d.ts.map +0 -1
- package/lib/packlets/decisions/concreteDecision.js.map +0 -1
- package/lib/packlets/decisions/decision.d.ts.map +0 -1
- package/lib/packlets/decisions/decision.js.map +0 -1
- package/lib/packlets/decisions/index.d.ts.map +0 -1
- package/lib/packlets/decisions/index.js.map +0 -1
- package/lib/packlets/import/fsItem.d.ts.map +0 -1
- package/lib/packlets/import/fsItem.js.map +0 -1
- package/lib/packlets/import/importContext.d.ts.map +0 -1
- package/lib/packlets/import/importContext.js.map +0 -1
- package/lib/packlets/import/importManager.d.ts.map +0 -1
- package/lib/packlets/import/importManager.js.map +0 -1
- package/lib/packlets/import/importable.d.ts.map +0 -1
- package/lib/packlets/import/importable.js.map +0 -1
- package/lib/packlets/import/importers/collectionImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/collectionImporter.js.map +0 -1
- package/lib/packlets/import/importers/fsItemImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/fsItemImporter.js.map +0 -1
- package/lib/packlets/import/importers/importer.d.ts.map +0 -1
- package/lib/packlets/import/importers/importer.js.map +0 -1
- package/lib/packlets/import/importers/index.d.ts.map +0 -1
- package/lib/packlets/import/importers/index.js.map +0 -1
- package/lib/packlets/import/importers/jsonImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/jsonImporter.js.map +0 -1
- package/lib/packlets/import/importers/pathImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/pathImporter.js.map +0 -1
- package/lib/packlets/import/index.d.ts.map +0 -1
- package/lib/packlets/import/index.js.map +0 -1
- package/lib/packlets/qualifier-types/config/convert.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/config/convert.js.map +0 -1
- package/lib/packlets/qualifier-types/config/index.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/config/index.js.map +0 -1
- package/lib/packlets/qualifier-types/config/json.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/config/json.js.map +0 -1
- package/lib/packlets/qualifier-types/convert.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/convert.js.map +0 -1
- package/lib/packlets/qualifier-types/helpers.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/helpers.js.map +0 -1
- package/lib/packlets/qualifier-types/index.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/index.js.map +0 -1
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/languageQualifierType.js.map +0 -1
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/literalQualifierType.js.map +0 -1
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +0 -1
- package/lib/packlets/qualifier-types/qualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/qualifierType.js.map +0 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +0 -1
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/territoryQualifierType.js.map +0 -1
- package/lib/packlets/qualifiers/convert/decls.d.ts.map +0 -1
- package/lib/packlets/qualifiers/convert/decls.js.map +0 -1
- package/lib/packlets/qualifiers/convert/index.d.ts.map +0 -1
- package/lib/packlets/qualifiers/convert/index.js.map +0 -1
- package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +0 -1
- package/lib/packlets/qualifiers/convert/qualifier.js.map +0 -1
- package/lib/packlets/qualifiers/index.d.ts.map +0 -1
- package/lib/packlets/qualifiers/index.js.map +0 -1
- package/lib/packlets/qualifiers/qualifier.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifier.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierCollector.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierDecl.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +0 -1
- package/lib/packlets/resource-json/compiled/common.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/common.js.map +0 -1
- package/lib/packlets/resource-json/compiled/convert.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/convert.js.map +0 -1
- package/lib/packlets/resource-json/compiled/index.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/index.js.map +0 -1
- package/lib/packlets/resource-json/compiled/json.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/json.js.map +0 -1
- package/lib/packlets/resource-json/convert.d.ts.map +0 -1
- package/lib/packlets/resource-json/convert.js.map +0 -1
- package/lib/packlets/resource-json/helpers.d.ts.map +0 -1
- package/lib/packlets/resource-json/helpers.js.map +0 -1
- package/lib/packlets/resource-json/index.d.ts.map +0 -1
- package/lib/packlets/resource-json/index.js.map +0 -1
- package/lib/packlets/resource-json/json.d.ts.map +0 -1
- package/lib/packlets/resource-json/json.js.map +0 -1
- package/lib/packlets/resource-json/normalized.d.ts.map +0 -1
- package/lib/packlets/resource-json/normalized.js.map +0 -1
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +0 -1
- package/lib/packlets/resource-json/resourceDeclCollection.js.map +0 -1
- package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +0 -1
- package/lib/packlets/resource-json/resourceDeclContainer.js.map +0 -1
- package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +0 -1
- package/lib/packlets/resource-json/resourceDeclTree.js.map +0 -1
- package/lib/packlets/resource-types/config/convert.d.ts.map +0 -1
- package/lib/packlets/resource-types/config/convert.js.map +0 -1
- package/lib/packlets/resource-types/config/index.d.ts.map +0 -1
- package/lib/packlets/resource-types/config/index.js.map +0 -1
- package/lib/packlets/resource-types/config/json.d.ts.map +0 -1
- package/lib/packlets/resource-types/config/json.js.map +0 -1
- package/lib/packlets/resource-types/helpers.d.ts.map +0 -1
- package/lib/packlets/resource-types/helpers.js.map +0 -1
- package/lib/packlets/resource-types/index.d.ts.map +0 -1
- package/lib/packlets/resource-types/index.js.map +0 -1
- package/lib/packlets/resource-types/jsonResourceType.d.ts.map +0 -1
- package/lib/packlets/resource-types/jsonResourceType.js.map +0 -1
- package/lib/packlets/resource-types/resourceType.d.ts.map +0 -1
- package/lib/packlets/resource-types/resourceType.js.map +0 -1
- package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +0 -1
- package/lib/packlets/resource-types/resourceTypeCollector.js.map +0 -1
- package/lib/packlets/resources/candidateReducer.d.ts.map +0 -1
- package/lib/packlets/resources/candidateReducer.js.map +0 -1
- package/lib/packlets/resources/common.d.ts.map +0 -1
- package/lib/packlets/resources/common.js.map +0 -1
- package/lib/packlets/resources/index.d.ts.map +0 -1
- package/lib/packlets/resources/index.js.map +0 -1
- package/lib/packlets/resources/resource.d.ts.map +0 -1
- package/lib/packlets/resources/resource.js.map +0 -1
- package/lib/packlets/resources/resourceBuilder.d.ts.map +0 -1
- package/lib/packlets/resources/resourceBuilder.js.map +0 -1
- package/lib/packlets/resources/resourceCandidate.d.ts.map +0 -1
- package/lib/packlets/resources/resourceCandidate.js.map +0 -1
- package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +0 -1
- package/lib/packlets/resources/resourceManagerBuilder.js.map +0 -1
- package/lib/packlets/runtime/cacheListener.d.ts.map +0 -1
- package/lib/packlets/runtime/cacheListener.js.map +0 -1
- package/lib/packlets/runtime/cacheMetrics.d.ts.map +0 -1
- package/lib/packlets/runtime/cacheMetrics.js.map +0 -1
- package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +0 -1
- package/lib/packlets/runtime/compiledResourceCollection.js.map +0 -1
- package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +0 -1
- package/lib/packlets/runtime/conditionSetResolutionResult.js.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProvider.js.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +0 -1
- package/lib/packlets/runtime/context/index.d.ts.map +0 -1
- package/lib/packlets/runtime/context/index.js.map +0 -1
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +0 -1
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +0 -1
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +0 -1
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +0 -1
- package/lib/packlets/runtime/iResourceManager.d.ts.map +0 -1
- package/lib/packlets/runtime/iResourceManager.js.map +0 -1
- package/lib/packlets/runtime/index.d.ts.map +0 -1
- package/lib/packlets/runtime/index.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/common.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/common.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/index.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/index.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +0 -1
- package/lib/packlets/runtime/resourceResolver.d.ts.map +0 -1
- package/lib/packlets/runtime/resourceResolver.js.map +0 -1
- package/lib/packlets/runtime/validate.d.ts.map +0 -1
- package/lib/packlets/runtime/validate.js.map +0 -1
package/dist/ts-res.d.ts
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
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';
|
|
6
7
|
import { Hash } from '@fgv/ts-utils';
|
|
7
8
|
import { ICollectible } from '@fgv/ts-utils';
|
|
8
9
|
import { IReadOnlyResultMap } from '@fgv/ts-utils';
|
|
10
|
+
import { JsonCompatible } from '@fgv/ts-json-base';
|
|
9
11
|
import { JsonObject } from '@fgv/ts-json-base';
|
|
10
12
|
import { JsonValue } from '@fgv/ts-json-base';
|
|
13
|
+
import { Logging } from '@fgv/ts-utils';
|
|
11
14
|
import { ObjectConverter } from '@fgv/ts-utils';
|
|
12
15
|
import { Result } from '@fgv/ts-utils';
|
|
13
16
|
import { ResultMap } from '@fgv/ts-utils';
|
|
14
17
|
import { ValidatingCollector } from '@fgv/ts-utils';
|
|
15
18
|
import { ValidatingConvertingCollector } from '@fgv/ts-utils';
|
|
16
19
|
import { ValidatingResultMap } from '@fgv/ts-utils';
|
|
20
|
+
import { Validator } from '@fgv/ts-utils';
|
|
17
21
|
|
|
18
22
|
/**
|
|
19
23
|
* An abstract decision represents a class of decisions with candidates
|
|
@@ -131,6 +135,63 @@ declare const allPredefinedSystemConfigurations: ReadonlyArray<PredefinedSystemC
|
|
|
131
135
|
*/
|
|
132
136
|
export declare const allResourceValueMergeMethods: ResourceValueMergeMethod[];
|
|
133
137
|
|
|
138
|
+
/**
|
|
139
|
+
* A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.
|
|
140
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.
|
|
141
|
+
* @public
|
|
142
|
+
*/
|
|
143
|
+
declare const anyQualifierTypeConfig: Converter<Model_2.IAnyQualifierTypeConfig, unknown>;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Base implementation class containing shared validation logic for both read-only and mutable validators.
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
declare abstract class BaseContextQualifierProviderValidator<T extends IContextQualifierProvider = IContextQualifierProvider> implements IContextQualifierProviderValidatorBase<T> {
|
|
150
|
+
/**
|
|
151
|
+
* The wrapped context qualifier provider.
|
|
152
|
+
*/
|
|
153
|
+
abstract readonly provider: T;
|
|
154
|
+
/**
|
|
155
|
+
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
156
|
+
*/
|
|
157
|
+
get qualifiers(): IReadOnlyQualifierCollector;
|
|
158
|
+
/**
|
|
159
|
+
* Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
|
|
160
|
+
* @param name - The string name to convert and look up.
|
|
161
|
+
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
162
|
+
* or `Failure` with an error message if not found or an error occurs.
|
|
163
|
+
*/
|
|
164
|
+
get(name: string): Result<QualifierContextValue>;
|
|
165
|
+
/**
|
|
166
|
+
* Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
|
|
167
|
+
* @param index - The number index to convert and look up.
|
|
168
|
+
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
169
|
+
* or `Failure` with an error message if not found or an error occurs.
|
|
170
|
+
*/
|
|
171
|
+
getByIndex(index: number): Result<QualifierContextValue>;
|
|
172
|
+
/**
|
|
173
|
+
* Gets a validated qualifier context value by its string name.
|
|
174
|
+
* @param name - The string name to convert and look up.
|
|
175
|
+
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
176
|
+
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
177
|
+
*/
|
|
178
|
+
getValidated(name: string): Result<QualifierContextValue>;
|
|
179
|
+
/**
|
|
180
|
+
* Gets a validated qualifier context value by its number index.
|
|
181
|
+
* @param index - The number index to convert and look up.
|
|
182
|
+
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
183
|
+
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
184
|
+
*/
|
|
185
|
+
getValidatedByIndex(index: number): Result<QualifierContextValue>;
|
|
186
|
+
/**
|
|
187
|
+
* Checks if a qualifier value exists with the given string name.
|
|
188
|
+
* @param name - The string name to convert and check.
|
|
189
|
+
* @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
|
|
190
|
+
* or `Failure` with an error message if an error occurs during the check.
|
|
191
|
+
*/
|
|
192
|
+
has(name: string): Result<boolean>;
|
|
193
|
+
}
|
|
194
|
+
|
|
134
195
|
/**
|
|
135
196
|
* Converts an array of {@link Helpers.IConditionTokenParts | condition token parts} into an array of
|
|
136
197
|
* syntactically validated {@link ConditionToken | condition tokens}.
|
|
@@ -179,6 +240,27 @@ declare function buildQualifierDefaultValuesToken(parts: ReadonlyArray<IQualifie
|
|
|
179
240
|
*/
|
|
180
241
|
declare function buildQualifierDefaultValueToken({ qualifier, value }: IQualifierDefaultValueTokenParts): Result<QualifierDefaultValueToken>;
|
|
181
242
|
|
|
243
|
+
/**
|
|
244
|
+
* A factory that creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from
|
|
245
|
+
* {@link QualifierTypes.Config.IAnyQualifierTypeConfig | any qualifier type configuration}.
|
|
246
|
+
* @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}
|
|
247
|
+
* if successful, `Failure` with an error message otherwise.
|
|
248
|
+
* @public
|
|
249
|
+
*/
|
|
250
|
+
declare class BuiltInQualifierTypeFactory implements IConfigInitFactory<QualifierTypes.Config.ISystemQualifierTypeConfig, SystemQualifierType> {
|
|
251
|
+
/** {@inheritDoc Config.IConfigInitFactory.create} */
|
|
252
|
+
create(config: QualifierTypes.Config.IAnyQualifierTypeConfig): Result<SystemQualifierType>;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* A factory that creates a {@link ResourceTypes.ResourceType | ResourceType} from a {@link ResourceTypes.Config.IResourceTypeConfig | resource type configuration}.
|
|
257
|
+
* @public
|
|
258
|
+
*/
|
|
259
|
+
declare class BuiltInResourceTypeFactory implements IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> {
|
|
260
|
+
/** {@inheritDoc Config.IConfigInitFactory.create} */
|
|
261
|
+
create(config: ResourceTypes.Config.IResourceTypeConfig): Result<ResourceType>;
|
|
262
|
+
}
|
|
263
|
+
|
|
182
264
|
declare namespace Bundle {
|
|
183
265
|
export {
|
|
184
266
|
IBundleMetadata,
|
|
@@ -190,6 +272,7 @@ declare namespace Bundle {
|
|
|
190
272
|
IBundleLoaderCreateParams,
|
|
191
273
|
BundleUtils,
|
|
192
274
|
IBundleComponents,
|
|
275
|
+
Model_4 as Model,
|
|
193
276
|
Convert_10 as Convert,
|
|
194
277
|
BundleNormalizer
|
|
195
278
|
}
|
|
@@ -557,6 +640,139 @@ declare class CandidateReducer {
|
|
|
557
640
|
reduceCandidate(candidate: ResourceCandidate): Result<IReducedCandidate | undefined>;
|
|
558
641
|
}
|
|
559
642
|
|
|
643
|
+
/**
|
|
644
|
+
* Implementation of a candidate value that stores normalized JSON data.
|
|
645
|
+
* The value is normalized on creation and a hash-based key is generated
|
|
646
|
+
* for efficient deduplication.
|
|
647
|
+
* @public
|
|
648
|
+
*/
|
|
649
|
+
declare class CandidateValue implements ICandidateValue {
|
|
650
|
+
private readonly _collectible;
|
|
651
|
+
private readonly _json;
|
|
652
|
+
/**
|
|
653
|
+
* The unique key for this candidate value.
|
|
654
|
+
*/
|
|
655
|
+
get key(): CandidateValueKey;
|
|
656
|
+
/**
|
|
657
|
+
* The index of this candidate value in the collection.
|
|
658
|
+
*/
|
|
659
|
+
get index(): CandidateValueIndex | undefined;
|
|
660
|
+
/**
|
|
661
|
+
* The normalized JSON value.
|
|
662
|
+
*/
|
|
663
|
+
get json(): JsonValue;
|
|
664
|
+
/**
|
|
665
|
+
* Constructor for a {@link Resources.CandidateValue} object.
|
|
666
|
+
* @param params - Parameters to create the candidate value.
|
|
667
|
+
* @internal
|
|
668
|
+
*/
|
|
669
|
+
protected constructor(params: ICandidateValueCreateParams);
|
|
670
|
+
/**
|
|
671
|
+
* Creates a new {@link Resources.CandidateValue} object.
|
|
672
|
+
* @param params - Parameters to create the candidate value.
|
|
673
|
+
* @returns `Success` with the new candidate value if successful,
|
|
674
|
+
* or `Failure` with an error message if not.
|
|
675
|
+
* @public
|
|
676
|
+
*/
|
|
677
|
+
static create(params: ICandidateValueCreateParams): Result<CandidateValue>;
|
|
678
|
+
/**
|
|
679
|
+
* Sets the index of this candidate value.
|
|
680
|
+
* @param index - The index to set.
|
|
681
|
+
* @returns `Success` with the index if successful, or `Failure` with an error message if not.
|
|
682
|
+
* @public
|
|
683
|
+
*/
|
|
684
|
+
setIndex(index: number): Result<CandidateValueIndex>;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* A `ValidatingCollector` for {@link Resources.CandidateValue | CandidateValues},
|
|
689
|
+
* which collects candidate values supplied as either {@link Resources.CandidateValue | CandidateValue} or
|
|
690
|
+
* `JsonValue`.
|
|
691
|
+
* @public
|
|
692
|
+
*/
|
|
693
|
+
declare class CandidateValueCollector extends ValidatingCollector<CandidateValue> {
|
|
694
|
+
readonly normalizer: Hash.HashingNormalizer;
|
|
695
|
+
/**
|
|
696
|
+
* Constructor for a {@link Resources.CandidateValueCollector} object.
|
|
697
|
+
* @param params - Parameters to create the collector.
|
|
698
|
+
* @internal
|
|
699
|
+
*/
|
|
700
|
+
protected constructor(params?: ICandidateValueCollectorCreateParams);
|
|
701
|
+
/**
|
|
702
|
+
* Creates a new {@link Resources.CandidateValueCollector} object.
|
|
703
|
+
* @param params - Parameters to create the collector.
|
|
704
|
+
* @returns `Success` with the new collector if successful,
|
|
705
|
+
* or `Failure` with an error message if not.
|
|
706
|
+
* @public
|
|
707
|
+
*/
|
|
708
|
+
static create(params?: ICandidateValueCollectorCreateParams): Result<CandidateValueCollector>;
|
|
709
|
+
/**
|
|
710
|
+
* Returns an array of JSON values ordered by their indices.
|
|
711
|
+
* @returns Array of JsonValue objects in index order.
|
|
712
|
+
* @public
|
|
713
|
+
*/
|
|
714
|
+
getValuesByIndex(): JsonValue[];
|
|
715
|
+
/**
|
|
716
|
+
* Converter method to handle CandidateValue | JsonValue.
|
|
717
|
+
* @param from - The value to convert.
|
|
718
|
+
* @returns `Success` with the CandidateValue if successful, or `Failure` with an error message if not.
|
|
719
|
+
* @internal
|
|
720
|
+
*/
|
|
721
|
+
private _toCandidateValue;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Branded number representing a validated candidate value index.
|
|
726
|
+
* Candidate value indices are used to identify candidate values
|
|
727
|
+
* within a resource set and to enable sharing of like values.
|
|
728
|
+
* @public
|
|
729
|
+
*/
|
|
730
|
+
export declare type CandidateValueIndex = Brand<number, 'CandidateValueIndex'>;
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* `Converter` which validates an `unknown` value as a {@link CandidateValueIndex | CandidateValueIndex}.
|
|
734
|
+
* @public
|
|
735
|
+
*/
|
|
736
|
+
declare const candidateValueIndex: Converter<CandidateValueIndex, unknown>;
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Branded string representing a validated candidate value key.
|
|
740
|
+
* Candidate value keys are used to identify candidate values
|
|
741
|
+
* within a resource set and to enable sharing of like values.
|
|
742
|
+
* @public
|
|
743
|
+
*/
|
|
744
|
+
export declare type CandidateValueKey = Brand<string, 'CandidateValueKey'>;
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* `Converter` which validates an `unknown` value as a {@link CandidateValueKey | CandidateValueKey}.
|
|
748
|
+
* @public
|
|
749
|
+
*/
|
|
750
|
+
declare const candidateValueKey: Converter<CandidateValueKey, unknown>;
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* @internal
|
|
754
|
+
*/
|
|
755
|
+
declare const candidateValueKey_2: RegExp;
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* A factory that chains multiple factories together.
|
|
759
|
+
* @public
|
|
760
|
+
*/
|
|
761
|
+
declare class ChainedConfigInitFactory<TConfig, T> implements IConfigInitFactory<TConfig, T> {
|
|
762
|
+
readonly factories: IConfigInitFactory<TConfig, T>[];
|
|
763
|
+
/**
|
|
764
|
+
* Constructor for a chained config init factory.
|
|
765
|
+
* @param factories - The factories to chain.
|
|
766
|
+
*/
|
|
767
|
+
constructor(factories: IConfigInitFactory<TConfig, T>[]);
|
|
768
|
+
/**
|
|
769
|
+
* Creates a new instance of a configuration object.
|
|
770
|
+
* @param config - The configuration object to create.
|
|
771
|
+
* @returns A result containing the new instance of the configuration object.
|
|
772
|
+
*/
|
|
773
|
+
create(config: TConfig): Result<T>;
|
|
774
|
+
}
|
|
775
|
+
|
|
560
776
|
/**
|
|
561
777
|
* `Converter` for a normalized {@link ResourceJson.Json.IChildConditionDecl | child condition declaration}.
|
|
562
778
|
* @public
|
|
@@ -668,7 +884,10 @@ declare namespace Common {
|
|
|
668
884
|
ResourceTypeIndex,
|
|
669
885
|
ResourceValueMergeMethod,
|
|
670
886
|
allResourceValueMergeMethods,
|
|
671
|
-
CandidateCompleteness
|
|
887
|
+
CandidateCompleteness,
|
|
888
|
+
CandidateValueIndex,
|
|
889
|
+
CandidateValueKey,
|
|
890
|
+
IResourceResolver
|
|
672
891
|
}
|
|
673
892
|
}
|
|
674
893
|
|
|
@@ -757,30 +976,39 @@ declare const compiledResource: ObjectConverter<Model_3.ICompiledResource, unkno
|
|
|
757
976
|
* and use pre-compiled resource collections without rebuilding them from scratch.
|
|
758
977
|
* @public
|
|
759
978
|
*/
|
|
760
|
-
declare class CompiledResourceCollection implements IResourceManager {
|
|
979
|
+
declare class CompiledResourceCollection implements IResourceManager<IResource> {
|
|
761
980
|
readonly conditions: ReadOnlyConditionCollector;
|
|
762
981
|
readonly conditionSets: ReadOnlyConditionSetCollector;
|
|
763
982
|
readonly decisions: ReadOnlyAbstractDecisionCollector;
|
|
764
983
|
private readonly _qualifierTypes;
|
|
765
984
|
private readonly _qualifiers;
|
|
766
985
|
private readonly _resourceTypes;
|
|
986
|
+
private readonly _candidateValues;
|
|
767
987
|
private readonly _builtResources;
|
|
768
988
|
private _cachedResourceTree?;
|
|
769
989
|
/**
|
|
770
|
-
* A {@link QualifierTypes.
|
|
990
|
+
* A {@link QualifierTypes.ReadOnlyQualifierTypeCollector | ReadOnlyQualifierTypeCollector} which
|
|
771
991
|
* contains the {@link QualifierTypes.QualifierType | qualifier types} used in this collection.
|
|
772
992
|
*/
|
|
773
|
-
get qualifierTypes():
|
|
993
|
+
get qualifierTypes(): ReadOnlyQualifierTypeCollector;
|
|
774
994
|
/**
|
|
775
|
-
* A {@link Qualifiers.
|
|
995
|
+
* A {@link Qualifiers.IReadOnlyQualifierCollector | ReadOnlyQualifierCollector} which
|
|
776
996
|
* contains the {@link Qualifiers.Qualifier | qualifiers} used in this collection.
|
|
777
997
|
*/
|
|
778
|
-
get qualifiers():
|
|
998
|
+
get qualifiers(): IReadOnlyQualifierCollector;
|
|
999
|
+
/**
|
|
1000
|
+
* The resource IDs contained in this compiled resource collection.
|
|
1001
|
+
*/
|
|
1002
|
+
get resourceIds(): ReadonlyArray<ResourceId>;
|
|
779
1003
|
/**
|
|
780
1004
|
* A {@link ResourceTypes.ResourceTypeCollector | ResourceTypeCollector} which
|
|
781
1005
|
* contains the {@link ResourceTypes.ResourceType | resource types} used in this collection.
|
|
782
1006
|
*/
|
|
783
|
-
get resourceTypes():
|
|
1007
|
+
get resourceTypes(): ReadOnlyResourceTypeCollector;
|
|
1008
|
+
/**
|
|
1009
|
+
* The candidate values in the collection.
|
|
1010
|
+
*/
|
|
1011
|
+
get candidateValues(): ReadonlyArray<JsonValue>;
|
|
784
1012
|
/**
|
|
785
1013
|
* {@inheritdoc Runtime.IResourceManager.builtResources}
|
|
786
1014
|
*/
|
|
@@ -829,7 +1057,7 @@ declare class CompiledResourceCollection implements IResourceManager {
|
|
|
829
1057
|
* @returns Result containing the resource tree root, or failure if tree construction fails
|
|
830
1058
|
* @public
|
|
831
1059
|
*/
|
|
832
|
-
getBuiltResourceTree(): Result<
|
|
1060
|
+
getBuiltResourceTree(): Result<ReadOnlyResourceTreeRoot<IResource>>;
|
|
833
1061
|
/**
|
|
834
1062
|
* Reconstructs a QualifierTypeCollector from compiled data.
|
|
835
1063
|
* @param compiled - The compiled resource collection
|
|
@@ -878,6 +1106,12 @@ declare class CompiledResourceCollection implements IResourceManager {
|
|
|
878
1106
|
* @internal
|
|
879
1107
|
*/
|
|
880
1108
|
private _buildDecisions;
|
|
1109
|
+
/**
|
|
1110
|
+
* Gets a candidate value from the collection.
|
|
1111
|
+
* @param valueIndex - The index of the candidate value to get.
|
|
1112
|
+
* @returns
|
|
1113
|
+
*/
|
|
1114
|
+
private _getCandidateValue;
|
|
881
1115
|
/**
|
|
882
1116
|
* Reconstructs a ValidatingResultMap of resources from compiled data.
|
|
883
1117
|
* @param compiled - The compiled resource collection
|
|
@@ -1292,6 +1526,14 @@ export declare class ConditionSet implements IValidatedConditionSetDecl {
|
|
|
1292
1526
|
* @public
|
|
1293
1527
|
*/
|
|
1294
1528
|
static getKeyForDecl(decl: IValidatedConditionSetDecl): Result<ConditionSetKey>;
|
|
1529
|
+
/**
|
|
1530
|
+
* Gets a condition set key from a loose condition set declaration.
|
|
1531
|
+
* @param conditionSet - The loose condition set declaration to convert.
|
|
1532
|
+
* @param conditionCollector - The condition collector used for validation.
|
|
1533
|
+
* @returns `Success` with the condition set key if successful, `Failure` otherwise.
|
|
1534
|
+
* @public
|
|
1535
|
+
*/
|
|
1536
|
+
static getKeyFromLooseDecl(conditionSet: ResourceJson.Json.ConditionSetDecl | undefined, conditionCollector: ConditionCollector): Result<ConditionSetKey>;
|
|
1295
1537
|
/**
|
|
1296
1538
|
* Gets a {@link ConditionSetToken | condition set token} for this condition set,
|
|
1297
1539
|
* if possible.
|
|
@@ -1641,6 +1883,18 @@ declare namespace Config {
|
|
|
1641
1883
|
export {
|
|
1642
1884
|
Model,
|
|
1643
1885
|
Convert_9 as Convert,
|
|
1886
|
+
createQualifierTypeFactory,
|
|
1887
|
+
createResourceTypeFactory,
|
|
1888
|
+
QualifierTypeFactoryFunction,
|
|
1889
|
+
ResourceTypeFactoryFunction,
|
|
1890
|
+
IConfigInitFactory,
|
|
1891
|
+
ChainedConfigInitFactory,
|
|
1892
|
+
BuiltInQualifierTypeFactory,
|
|
1893
|
+
QualifierTypeFactory,
|
|
1894
|
+
ValidatingQualifierTypeFactory,
|
|
1895
|
+
BuiltInResourceTypeFactory,
|
|
1896
|
+
ResourceTypeFactory,
|
|
1897
|
+
ValidatingResourceTypeFactory,
|
|
1644
1898
|
updateSystemConfigurationQualifierDefaultValues,
|
|
1645
1899
|
ISystemConfigurationInitParams,
|
|
1646
1900
|
SystemConfiguration,
|
|
@@ -1657,14 +1911,17 @@ export { Config }
|
|
|
1657
1911
|
declare namespace Config_2 {
|
|
1658
1912
|
export {
|
|
1659
1913
|
Convert_2 as Convert,
|
|
1914
|
+
isSystemQualifierTypeConfig,
|
|
1660
1915
|
IQualifierTypeConfig,
|
|
1661
1916
|
ILanguageQualifierTypeConfig,
|
|
1917
|
+
LiteralValueHierarchyDecl,
|
|
1662
1918
|
ITerritoryQualifierTypeConfig,
|
|
1663
1919
|
ILiteralQualifierTypeConfig,
|
|
1664
1920
|
ISystemLanguageQualifierTypeConfig,
|
|
1665
1921
|
ISystemTerritoryQualifierTypeConfig,
|
|
1666
1922
|
ISystemLiteralQualifierTypeConfig,
|
|
1667
|
-
ISystemQualifierTypeConfig
|
|
1923
|
+
ISystemQualifierTypeConfig,
|
|
1924
|
+
IAnyQualifierTypeConfig
|
|
1668
1925
|
}
|
|
1669
1926
|
}
|
|
1670
1927
|
|
|
@@ -1683,7 +1940,7 @@ declare const containerContextDecl: Converter<Normalized.IContainerContextDecl>;
|
|
|
1683
1940
|
|
|
1684
1941
|
declare namespace Context {
|
|
1685
1942
|
export {
|
|
1686
|
-
|
|
1943
|
+
Convert_8 as Convert,
|
|
1687
1944
|
IContextMatchOptions,
|
|
1688
1945
|
IContextQualifierValueDecl,
|
|
1689
1946
|
IContextDecl,
|
|
@@ -1696,11 +1953,19 @@ export { Context }
|
|
|
1696
1953
|
|
|
1697
1954
|
declare namespace Context_2 {
|
|
1698
1955
|
export {
|
|
1956
|
+
IContextQualifierProviderBase,
|
|
1957
|
+
IReadOnlyContextQualifierProvider,
|
|
1958
|
+
IMutableContextQualifierProvider,
|
|
1699
1959
|
IContextQualifierProvider,
|
|
1700
1960
|
ContextQualifierProvider,
|
|
1961
|
+
IContextQualifierProviderValidatorBase,
|
|
1701
1962
|
IReadOnlyContextQualifierProviderValidator,
|
|
1963
|
+
IMutableContextQualifierProviderValidator,
|
|
1964
|
+
IReadOnlyContextQualifierProviderValidatorCreateParams,
|
|
1965
|
+
IMutableContextQualifierProviderValidatorCreateParams,
|
|
1702
1966
|
IContextQualifierProviderValidatorCreateParams,
|
|
1703
|
-
|
|
1967
|
+
ReadOnlyContextQualifierProviderValidator,
|
|
1968
|
+
MutableContextQualifierProviderValidator,
|
|
1704
1969
|
ISimpleContextQualifierProviderCreateParams,
|
|
1705
1970
|
SimpleContextQualifierProvider,
|
|
1706
1971
|
IValidatingSimpleContextQualifierProviderCreateParams,
|
|
@@ -1719,7 +1984,7 @@ declare const contextDecl: Converter<Record<string, string>, unknown>;
|
|
|
1719
1984
|
* Provides common functionality and enforces the contract for derived classes.
|
|
1720
1985
|
* @public
|
|
1721
1986
|
*/
|
|
1722
|
-
declare abstract class ContextQualifierProvider implements
|
|
1987
|
+
declare abstract class ContextQualifierProvider implements IContextQualifierProviderBase {
|
|
1723
1988
|
/**
|
|
1724
1989
|
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
1725
1990
|
*/
|
|
@@ -1753,96 +2018,6 @@ declare abstract class ContextQualifierProvider implements IContextQualifierProv
|
|
|
1753
2018
|
abstract getNames(): Result<ReadonlyArray<QualifierName>>;
|
|
1754
2019
|
}
|
|
1755
2020
|
|
|
1756
|
-
/**
|
|
1757
|
-
* A wrapper for {@link Runtime.Context.IContextQualifierProvider | IContextQualifierProvider} that accepts
|
|
1758
|
-
* string inputs and converts them to strongly-typed values before calling the wrapped provider.
|
|
1759
|
-
* This eliminates the need for type casting in consumer code while maintaining type safety.
|
|
1760
|
-
* @public
|
|
1761
|
-
*/
|
|
1762
|
-
declare class ContextQualifierProviderValidator implements IReadOnlyContextQualifierProviderValidator {
|
|
1763
|
-
/**
|
|
1764
|
-
* The wrapped context qualifier provider.
|
|
1765
|
-
*/
|
|
1766
|
-
readonly provider: IContextQualifierProvider;
|
|
1767
|
-
/**
|
|
1768
|
-
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
1769
|
-
*/
|
|
1770
|
-
get qualifiers(): IReadOnlyQualifierCollector;
|
|
1771
|
-
/**
|
|
1772
|
-
* Constructs a new {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator}.
|
|
1773
|
-
* @param params - Required parameters for constructing the validator.
|
|
1774
|
-
*/
|
|
1775
|
-
constructor(params: IContextQualifierProviderValidatorCreateParams);
|
|
1776
|
-
/**
|
|
1777
|
-
* Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
|
|
1778
|
-
* @param name - The string name to convert and look up.
|
|
1779
|
-
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
1780
|
-
* or `Failure` with an error message if not found or an error occurs.
|
|
1781
|
-
*/
|
|
1782
|
-
get(name: string): Result<QualifierContextValue>;
|
|
1783
|
-
/**
|
|
1784
|
-
* Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
|
|
1785
|
-
* @param index - The number index to convert and look up.
|
|
1786
|
-
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
1787
|
-
* or `Failure` with an error message if not found or an error occurs.
|
|
1788
|
-
*/
|
|
1789
|
-
getByIndex(index: number): Result<QualifierContextValue>;
|
|
1790
|
-
/**
|
|
1791
|
-
* Gets a validated qualifier context value by its string name.
|
|
1792
|
-
* @param name - The string name to convert and look up.
|
|
1793
|
-
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
1794
|
-
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
1795
|
-
*/
|
|
1796
|
-
getValidated(name: string): Result<QualifierContextValue>;
|
|
1797
|
-
/**
|
|
1798
|
-
* Gets a validated qualifier context value by its number index.
|
|
1799
|
-
* @param index - The number index to convert and look up.
|
|
1800
|
-
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
1801
|
-
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
1802
|
-
*/
|
|
1803
|
-
getValidatedByIndex(index: number): Result<QualifierContextValue>;
|
|
1804
|
-
/**
|
|
1805
|
-
* Checks if a qualifier value exists with the given string name.
|
|
1806
|
-
* @param name - The string name to convert and check.
|
|
1807
|
-
* @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
|
|
1808
|
-
* or `Failure` with an error message if an error occurs during the check.
|
|
1809
|
-
*/
|
|
1810
|
-
has(name: string): Result<boolean>;
|
|
1811
|
-
/**
|
|
1812
|
-
* Sets a qualifier value using string inputs, converting to strongly-typed values.
|
|
1813
|
-
* @param name - The string name to convert.
|
|
1814
|
-
* @param value - The string value to convert.
|
|
1815
|
-
* @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
|
|
1816
|
-
* or `Failure` with an error message if an error occurs.
|
|
1817
|
-
*/
|
|
1818
|
-
set(name: string, value: string): Result<QualifierContextValue>;
|
|
1819
|
-
/**
|
|
1820
|
-
* Removes a qualifier value using string input, converting to strongly-typed QualifierName.
|
|
1821
|
-
* @param name - The string name to convert.
|
|
1822
|
-
* @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
|
|
1823
|
-
* or `Failure` with an error message if an error occurs.
|
|
1824
|
-
*/
|
|
1825
|
-
remove(name: string): Result<QualifierContextValue>;
|
|
1826
|
-
/**
|
|
1827
|
-
* Validates a string as a QualifierName.
|
|
1828
|
-
* @param name - The string to validate.
|
|
1829
|
-
* @returns `Success` with the strongly-typed QualifierName, or `Failure` if invalid.
|
|
1830
|
-
*/
|
|
1831
|
-
private _validateQualifierName;
|
|
1832
|
-
/**
|
|
1833
|
-
* Validates a number as a QualifierIndex.
|
|
1834
|
-
* @param index - The number to validate.
|
|
1835
|
-
* @returns `Success` with the strongly-typed QualifierIndex, or `Failure` if invalid.
|
|
1836
|
-
*/
|
|
1837
|
-
private _validateQualifierIndex;
|
|
1838
|
-
/**
|
|
1839
|
-
* Validates a string as a QualifierContextValue.
|
|
1840
|
-
* @param value - The string to validate.
|
|
1841
|
-
* @returns `Success` with the strongly-typed QualifierContextValue, or `Failure` if invalid.
|
|
1842
|
-
*/
|
|
1843
|
-
private _validateQualifierContextValue;
|
|
1844
|
-
}
|
|
1845
|
-
|
|
1846
2021
|
/**
|
|
1847
2022
|
* A string representing a validated context qualifier token. Context qualifier tokens are used
|
|
1848
2023
|
* for filtering resources by context criteria. A context qualifier token has the form
|
|
@@ -1998,6 +2173,7 @@ declare namespace Convert {
|
|
|
1998
2173
|
qualifierIndex,
|
|
1999
2174
|
qualifierTypeName,
|
|
2000
2175
|
qualifierTypeIndex,
|
|
2176
|
+
qualifierContextValue,
|
|
2001
2177
|
qualifierMatchScore,
|
|
2002
2178
|
conditionPriority,
|
|
2003
2179
|
conditionOperator,
|
|
@@ -2015,6 +2191,8 @@ declare namespace Convert {
|
|
|
2015
2191
|
resourceIndex,
|
|
2016
2192
|
resourceTypeName,
|
|
2017
2193
|
resourceTypeIndex,
|
|
2194
|
+
candidateValueKey,
|
|
2195
|
+
candidateValueIndex,
|
|
2018
2196
|
resourceValueMergeMethod,
|
|
2019
2197
|
contextQualifierToken,
|
|
2020
2198
|
contextToken,
|
|
@@ -2024,7 +2202,7 @@ declare namespace Convert {
|
|
|
2024
2202
|
}
|
|
2025
2203
|
export { Convert }
|
|
2026
2204
|
|
|
2027
|
-
|
|
2205
|
+
declare namespace Convert_10 {
|
|
2028
2206
|
export {
|
|
2029
2207
|
bundleMetadata,
|
|
2030
2208
|
bundleExportMetadata,
|
|
@@ -2045,15 +2223,32 @@ declare namespace Convert_11 {
|
|
|
2045
2223
|
}
|
|
2046
2224
|
}
|
|
2047
2225
|
|
|
2226
|
+
declare namespace Convert_12 {
|
|
2227
|
+
export {
|
|
2228
|
+
zipArchiveInputType,
|
|
2229
|
+
zipArchiveConfigType,
|
|
2230
|
+
zipArchiveInputInfo,
|
|
2231
|
+
zipArchiveConfigInfo,
|
|
2232
|
+
zipArchiveManifest,
|
|
2233
|
+
mimeType,
|
|
2234
|
+
importedFile,
|
|
2235
|
+
importedDirectory,
|
|
2236
|
+
systemConfiguration_2 as systemConfiguration
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2048
2240
|
declare namespace Convert_2 {
|
|
2049
2241
|
export {
|
|
2242
|
+
qualifierTypeConfig,
|
|
2050
2243
|
languageQualifierTypeConfig,
|
|
2051
2244
|
territoryQualifierTypeConfig,
|
|
2052
2245
|
literalQualifierTypeConfig,
|
|
2053
2246
|
systemLanguageQualifierTypeConfig,
|
|
2054
2247
|
systemTerritoryQualifierTypeConfig,
|
|
2055
2248
|
systemLiteralQualifierTypeConfig,
|
|
2056
|
-
systemQualifierTypeConfig
|
|
2249
|
+
systemQualifierTypeConfig,
|
|
2250
|
+
jsonQualifierTypeConfig,
|
|
2251
|
+
anyQualifierTypeConfig
|
|
2057
2252
|
}
|
|
2058
2253
|
}
|
|
2059
2254
|
|
|
@@ -2099,16 +2294,6 @@ declare namespace Convert_6 {
|
|
|
2099
2294
|
}
|
|
2100
2295
|
|
|
2101
2296
|
declare namespace Convert_7 {
|
|
2102
|
-
export {
|
|
2103
|
-
contextQualifierValueDecl,
|
|
2104
|
-
contextDecl,
|
|
2105
|
-
IContextDeclConvertContext,
|
|
2106
|
-
validatedContextQualifierValueDecl,
|
|
2107
|
-
validatedContextDecl
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
|
|
2111
|
-
declare namespace Convert_8 {
|
|
2112
2297
|
export {
|
|
2113
2298
|
looseConditionDecl,
|
|
2114
2299
|
childConditionDecl,
|
|
@@ -2126,13 +2311,32 @@ declare namespace Convert_8 {
|
|
|
2126
2311
|
}
|
|
2127
2312
|
}
|
|
2128
2313
|
|
|
2314
|
+
declare namespace Convert_8 {
|
|
2315
|
+
export {
|
|
2316
|
+
contextQualifierValueDecl,
|
|
2317
|
+
contextDecl,
|
|
2318
|
+
IContextDeclConvertContext,
|
|
2319
|
+
validatedContextQualifierValueDecl,
|
|
2320
|
+
validatedContextDecl
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2129
2324
|
declare namespace Convert_9 {
|
|
2130
2325
|
export {
|
|
2326
|
+
validateSystemConfiguration,
|
|
2131
2327
|
systemConfiguration,
|
|
2132
2328
|
predefinedSystemConfiguration
|
|
2133
2329
|
}
|
|
2134
2330
|
}
|
|
2135
2331
|
|
|
2332
|
+
/**
|
|
2333
|
+
* Creates a {@link Config.IConfigInitFactory | IConfigInitFactory} from a factory function.
|
|
2334
|
+
* @param fn - The factory function to wrap.
|
|
2335
|
+
* @returns An `IConfigInitFactory` instance that delegates to the function.
|
|
2336
|
+
* @public
|
|
2337
|
+
*/
|
|
2338
|
+
declare function createQualifierTypeFactory<T extends QualifierType = QualifierType>(fn: QualifierTypeFactoryFunction<T>): IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T>;
|
|
2339
|
+
|
|
2136
2340
|
/**
|
|
2137
2341
|
* Creates a {@link QualifierTypes.QualifierType | QualifierType} from a configuration object.
|
|
2138
2342
|
* This factory function determines the appropriate qualifier type based on the systemType
|
|
@@ -2143,19 +2347,27 @@ declare namespace Convert_9 {
|
|
|
2143
2347
|
* if successful, `Failure` with an error message otherwise.
|
|
2144
2348
|
* @public
|
|
2145
2349
|
*/
|
|
2146
|
-
declare function createQualifierTypeFromConfig(typeConfig: Config_2.
|
|
2350
|
+
declare function createQualifierTypeFromConfig(typeConfig: Config_2.IAnyQualifierTypeConfig): Result<QualifierType>;
|
|
2147
2351
|
|
|
2148
2352
|
/**
|
|
2149
|
-
* Creates a {@link QualifierTypes.
|
|
2353
|
+
* Creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from a system configuration object.
|
|
2150
2354
|
* This factory function determines the appropriate qualifier type based on the systemType
|
|
2151
2355
|
* and delegates to the appropriate type-specific createFromConfig method.
|
|
2152
2356
|
* @param typeConfig - The {@link QualifierTypes.Config.ISystemQualifierTypeConfig | configuration object}
|
|
2153
2357
|
* containing the name, systemType, and optional type-specific configuration.
|
|
2154
|
-
* @returns `Success` with the new {@link QualifierTypes.
|
|
2358
|
+
* @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}
|
|
2155
2359
|
* if successful, `Failure` with an error message otherwise.
|
|
2156
2360
|
* @public
|
|
2157
2361
|
*/
|
|
2158
|
-
declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISystemQualifierTypeConfig): Result<
|
|
2362
|
+
declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISystemQualifierTypeConfig): Result<SystemQualifierType>;
|
|
2363
|
+
|
|
2364
|
+
/**
|
|
2365
|
+
* Creates a {@link Config.IConfigInitFactory | IConfigInitFactory} from a resource type factory function.
|
|
2366
|
+
* @param fn - The factory function to wrap.
|
|
2367
|
+
* @returns An `IConfigInitFactory` instance that delegates to the function.
|
|
2368
|
+
* @public
|
|
2369
|
+
*/
|
|
2370
|
+
declare function createResourceTypeFactory(fn: ResourceTypeFactoryFunction): IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType>;
|
|
2159
2371
|
|
|
2160
2372
|
/**
|
|
2161
2373
|
* Creates a {@link ResourceTypes.ResourceType | ResourceType} from a configuration object.
|
|
@@ -2167,6 +2379,17 @@ declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISyste
|
|
|
2167
2379
|
*/
|
|
2168
2380
|
declare function createResourceTypeFromConfig(config: IResourceTypeConfig): Result<ResourceType>;
|
|
2169
2381
|
|
|
2382
|
+
/**
|
|
2383
|
+
* Create a ZIP archive manifest object
|
|
2384
|
+
* @param inputType - Type of input (file or directory)
|
|
2385
|
+
* @param originalPath - Original file/directory path
|
|
2386
|
+
* @param archivePath - Path within the archive
|
|
2387
|
+
* @param configPath - Optional configuration file path
|
|
2388
|
+
* @returns ZIP archive manifest
|
|
2389
|
+
* @public
|
|
2390
|
+
*/
|
|
2391
|
+
declare function createZipArchiveManifest(inputType: 'file' | 'directory', originalPath: string, archivePath: string, configPath?: string): Json_2.IZipArchiveManifest;
|
|
2392
|
+
|
|
2170
2393
|
/**
|
|
2171
2394
|
* Simple collectible implementation of {@link Decisions.IDecision | IDecision}.
|
|
2172
2395
|
* @public
|
|
@@ -2334,8 +2557,163 @@ declare const DefaultResourceTypes: ReadonlyArray<ResourceTypes.Config.IResource
|
|
|
2334
2557
|
*/
|
|
2335
2558
|
declare const DefaultSystemConfiguration: ISystemConfiguration;
|
|
2336
2559
|
|
|
2337
|
-
|
|
2338
|
-
|
|
2560
|
+
/**
|
|
2561
|
+
* Class for generating resource deltas between baseline and delta resolvers.
|
|
2562
|
+
* Creates partial/augment candidates for updated resources and full/replace candidates for new resources.
|
|
2563
|
+
* Uses Diff.jsonThreeWayDiff for efficient delta computation.
|
|
2564
|
+
* @public
|
|
2565
|
+
*/
|
|
2566
|
+
declare class DeltaGenerator {
|
|
2567
|
+
/**
|
|
2568
|
+
* The baseline resource resolver to compare against.
|
|
2569
|
+
* @internal
|
|
2570
|
+
*/
|
|
2571
|
+
private readonly _baselineResolver;
|
|
2572
|
+
/**
|
|
2573
|
+
* The delta resource resolver containing changes.
|
|
2574
|
+
* @internal
|
|
2575
|
+
*/
|
|
2576
|
+
private readonly _deltaResolver;
|
|
2577
|
+
/**
|
|
2578
|
+
* The resource manager to clone and update.
|
|
2579
|
+
* @internal
|
|
2580
|
+
*/
|
|
2581
|
+
private readonly _resourceManager;
|
|
2582
|
+
/**
|
|
2583
|
+
* Logger for status and error reporting.
|
|
2584
|
+
* @internal
|
|
2585
|
+
*/
|
|
2586
|
+
private readonly _logger;
|
|
2587
|
+
/**
|
|
2588
|
+
* Constructor for a {@link Resources.DeltaGenerator | DeltaGenerator} object.
|
|
2589
|
+
* @param params - Parameters to create a new {@link Resources.DeltaGenerator | DeltaGenerator}.
|
|
2590
|
+
* @internal
|
|
2591
|
+
*/
|
|
2592
|
+
protected constructor(params: IDeltaGeneratorParams);
|
|
2593
|
+
/**
|
|
2594
|
+
* Creates a new {@link Resources.DeltaGenerator | DeltaGenerator} object.
|
|
2595
|
+
* @param params - Parameters to create a new {@link Resources.DeltaGenerator | DeltaGenerator}.
|
|
2596
|
+
* @returns `Success` with the new {@link Resources.DeltaGenerator | DeltaGenerator} object if successful,
|
|
2597
|
+
* or `Failure` with an error message if not.
|
|
2598
|
+
* @public
|
|
2599
|
+
*/
|
|
2600
|
+
static create(params: IDeltaGeneratorParams): Result<DeltaGenerator>;
|
|
2601
|
+
/**
|
|
2602
|
+
* Generates deltas between baseline and delta resolvers.
|
|
2603
|
+
* Creates a cloned resource manager with partial/augment candidates for updates
|
|
2604
|
+
* and full/replace candidates for new resources.
|
|
2605
|
+
*
|
|
2606
|
+
* @param options - Options controlling delta generation behavior.
|
|
2607
|
+
* @returns `Success` with the updated resource manager if successful,
|
|
2608
|
+
* or `Failure` with an error message if not.
|
|
2609
|
+
* @public
|
|
2610
|
+
*/
|
|
2611
|
+
generate(options?: IDeltaGeneratorOptions): Result<ResourceManagerBuilder>;
|
|
2612
|
+
/**
|
|
2613
|
+
* Validates the provided context declaration.
|
|
2614
|
+
* @param context - The context declaration to validate.
|
|
2615
|
+
* @returns `Success` with the validated context if successful, `Failure` otherwise.
|
|
2616
|
+
* @internal
|
|
2617
|
+
*/
|
|
2618
|
+
private _validateContext;
|
|
2619
|
+
/**
|
|
2620
|
+
* Enumerates target resource IDs for delta generation.
|
|
2621
|
+
* If specific resource IDs are provided, uses those. Otherwise, discovers all resources
|
|
2622
|
+
* from both the baseline resource manager and the delta resolver to ensure comprehensive
|
|
2623
|
+
* coverage of all potential resources.
|
|
2624
|
+
*
|
|
2625
|
+
* @param requestedIds - Optional array of specific resource IDs to target.
|
|
2626
|
+
* @param context - The validated context to use for resource discovery.
|
|
2627
|
+
* @returns `Success` with array of resource IDs if successful, `Failure` otherwise.
|
|
2628
|
+
* @internal
|
|
2629
|
+
*/
|
|
2630
|
+
private _enumerateTargetResources;
|
|
2631
|
+
/**
|
|
2632
|
+
* Discovers all unique resource IDs from both baseline and delta resolvers.
|
|
2633
|
+
* Creates a union of resource IDs from the baseline resource manager and delta resolver
|
|
2634
|
+
* to ensure comprehensive coverage of all resources.
|
|
2635
|
+
*
|
|
2636
|
+
* @returns `Success` with array of unique resource IDs if successful, `Failure` otherwise.
|
|
2637
|
+
* @internal
|
|
2638
|
+
*/
|
|
2639
|
+
private _discoverAllResourceIds;
|
|
2640
|
+
/**
|
|
2641
|
+
* Creates a clone of the resource manager for delta operations.
|
|
2642
|
+
* @returns `Success` with the cloned resource manager if successful, `Failure` otherwise.
|
|
2643
|
+
* @internal
|
|
2644
|
+
*/
|
|
2645
|
+
private _cloneResourceManager;
|
|
2646
|
+
/**
|
|
2647
|
+
* Generates deltas for the specified resources and adds them to the cloned manager.
|
|
2648
|
+
*
|
|
2649
|
+
* @param clonedManager - The cloned resource manager to update.
|
|
2650
|
+
* @param resourceIds - Array of resource IDs to process.
|
|
2651
|
+
* @param context - The context to use for resource resolution.
|
|
2652
|
+
* @param skipUnchanged - Whether to skip resources that haven't changed.
|
|
2653
|
+
* @returns `Success` with the updated manager if successful, `Failure` otherwise.
|
|
2654
|
+
* @internal
|
|
2655
|
+
*/
|
|
2656
|
+
private _generateDeltas;
|
|
2657
|
+
/**
|
|
2658
|
+
* Generates a delta for a single resource and adds appropriate candidates to the manager.
|
|
2659
|
+
*
|
|
2660
|
+
* @param manager - The resource manager to update.
|
|
2661
|
+
* @param resourceId - The resource ID to process.
|
|
2662
|
+
* @param context - The context to use for resource resolution.
|
|
2663
|
+
* @param skipUnchanged - Whether to skip resources that haven't changed.
|
|
2664
|
+
* @returns `Success` with the resource delta result if successful, `Failure` otherwise.
|
|
2665
|
+
* @internal
|
|
2666
|
+
*/
|
|
2667
|
+
private _generateResourceDelta;
|
|
2668
|
+
/**
|
|
2669
|
+
* Checks if two JSON values are identical.
|
|
2670
|
+
* @param value1 - First value to compare.
|
|
2671
|
+
* @param value2 - Second value to compare.
|
|
2672
|
+
* @returns True if values are identical, false otherwise.
|
|
2673
|
+
* @internal
|
|
2674
|
+
*/
|
|
2675
|
+
private _areValuesIdentical;
|
|
2676
|
+
/**
|
|
2677
|
+
* Creates a new resource candidate for a newly discovered resource.
|
|
2678
|
+
* Uses full/replace merge method since this is a completely new resource.
|
|
2679
|
+
*
|
|
2680
|
+
* @param manager - The resource manager to update.
|
|
2681
|
+
* @param resourceId - The resource ID for the new resource.
|
|
2682
|
+
* @param value - The resolved value for the new resource.
|
|
2683
|
+
* @param context - The context used for resolution.
|
|
2684
|
+
* @returns `Success` if the candidate was added successfully, `Failure` otherwise.
|
|
2685
|
+
* @internal
|
|
2686
|
+
*/
|
|
2687
|
+
private _createNewResourceCandidate;
|
|
2688
|
+
/**
|
|
2689
|
+
* Creates a delta candidate for an updated resource.
|
|
2690
|
+
* Computes the difference between baseline and delta values and creates
|
|
2691
|
+
* a partial/augment candidate with only the changed properties.
|
|
2692
|
+
*
|
|
2693
|
+
* @param manager - The resource manager to update.
|
|
2694
|
+
* @param resourceId - The resource ID for the updated resource.
|
|
2695
|
+
* @param baselineValue - The baseline resolved value.
|
|
2696
|
+
* @param deltaValue - The delta resolved value.
|
|
2697
|
+
* @param context - The context used for resolution.
|
|
2698
|
+
* @returns `Success` if the candidate was added successfully, `Failure` otherwise.
|
|
2699
|
+
* @internal
|
|
2700
|
+
*/
|
|
2701
|
+
private _createDeltaCandidate;
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2704
|
+
/**
|
|
2705
|
+
* Type for handling empty branch nodes during tree composition.
|
|
2706
|
+
* The handler receives the branch node, names of failed children, and the resolver for recovery attempts.
|
|
2707
|
+
* It can return:
|
|
2708
|
+
* - Success(undefined) to omit the branch from the result
|
|
2709
|
+
* - Success(value) to use an alternate value for the branch
|
|
2710
|
+
* - Failure to propagate the error
|
|
2711
|
+
* @public
|
|
2712
|
+
*/
|
|
2713
|
+
declare type EmptyBranchHandler = (branchNode: IReadOnlyResourceTreeNode<IResource>, failedChildNames: string[], resolver: ResourceResolver) => Result<JsonValue | undefined>;
|
|
2714
|
+
|
|
2715
|
+
declare namespace Example {
|
|
2716
|
+
export {
|
|
2339
2717
|
ExtendedQualifierTypes,
|
|
2340
2718
|
ExtendedQualifiers,
|
|
2341
2719
|
ExtendedResourceTypes,
|
|
@@ -2479,6 +2857,30 @@ declare class FsItemImporter implements IImporter {
|
|
|
2479
2857
|
*/
|
|
2480
2858
|
declare type FsItemResultDetail = 'failed' | 'skipped' | 'succeeded';
|
|
2481
2859
|
|
|
2860
|
+
/**
|
|
2861
|
+
* Generate a timestamp-based filename for ZIP archives
|
|
2862
|
+
* @param customName - Optional custom name prefix
|
|
2863
|
+
* @returns Generated filename
|
|
2864
|
+
* @public
|
|
2865
|
+
*/
|
|
2866
|
+
declare function generateZipArchiveFilename(customName?: string): string;
|
|
2867
|
+
|
|
2868
|
+
/**
|
|
2869
|
+
* Extract directory name from a file path
|
|
2870
|
+
* @param path - File path
|
|
2871
|
+
* @returns Directory name
|
|
2872
|
+
* @public
|
|
2873
|
+
*/
|
|
2874
|
+
declare function getDirectoryName(path: string): string;
|
|
2875
|
+
|
|
2876
|
+
/**
|
|
2877
|
+
* Gets the name for a resource ID.
|
|
2878
|
+
* @param id - The resource ID to get the name for.
|
|
2879
|
+
* @returns The resource name if found, or undefined if not.
|
|
2880
|
+
* @public
|
|
2881
|
+
*/
|
|
2882
|
+
declare function getNameForResourceId(id: string | undefined): Result<ResourceName>;
|
|
2883
|
+
|
|
2482
2884
|
/**
|
|
2483
2885
|
* Returns the {@link Config.Model.ISystemConfiguration | system configuration} declaration for the
|
|
2484
2886
|
* specified predefined system configuration.
|
|
@@ -2520,7 +2922,8 @@ declare namespace Helpers {
|
|
|
2520
2922
|
IQualifierDefaultValueTokenParts,
|
|
2521
2923
|
splitResourceId,
|
|
2522
2924
|
joinResourceIds,
|
|
2523
|
-
joinOptionalResourceIds
|
|
2925
|
+
joinOptionalResourceIds,
|
|
2926
|
+
getNameForResourceId
|
|
2524
2927
|
}
|
|
2525
2928
|
}
|
|
2526
2929
|
export { Helpers }
|
|
@@ -2559,6 +2962,12 @@ declare interface IAbstractDecisionCreateParams {
|
|
|
2559
2962
|
index?: number;
|
|
2560
2963
|
}
|
|
2561
2964
|
|
|
2965
|
+
/**
|
|
2966
|
+
* A union of all qualifier type configurations.
|
|
2967
|
+
* @public
|
|
2968
|
+
*/
|
|
2969
|
+
declare type IAnyQualifierTypeConfig = IQualifierTypeConfig | ISystemQualifierTypeConfig;
|
|
2970
|
+
|
|
2562
2971
|
/**
|
|
2563
2972
|
* A complete resource bundle that encapsulates built resources, configuration, and metadata.
|
|
2564
2973
|
* Bundles provide a portable, integrity-verified way to distribute pre-compiled resource collections.
|
|
@@ -2757,6 +3166,69 @@ declare interface ICandidateInfo {
|
|
|
2757
3166
|
readonly json?: JsonObject;
|
|
2758
3167
|
}
|
|
2759
3168
|
|
|
3169
|
+
/**
|
|
3170
|
+
* Interface for a candidate value that can be collected and indexed.
|
|
3171
|
+
* Candidate values are normalized JSON values that can be shared across
|
|
3172
|
+
* multiple resource candidates to reduce duplication.
|
|
3173
|
+
* @public
|
|
3174
|
+
*/
|
|
3175
|
+
declare interface ICandidateValue extends Collections.ICollectible<CandidateValueKey, CandidateValueIndex> {
|
|
3176
|
+
/**
|
|
3177
|
+
* The unique key for this candidate value, derived from the hash of the normalized JSON.
|
|
3178
|
+
*/
|
|
3179
|
+
readonly key: CandidateValueKey;
|
|
3180
|
+
/**
|
|
3181
|
+
* The index of this candidate value in the collection.
|
|
3182
|
+
*/
|
|
3183
|
+
readonly index: CandidateValueIndex | undefined;
|
|
3184
|
+
/**
|
|
3185
|
+
* The normalized JSON value.
|
|
3186
|
+
*/
|
|
3187
|
+
readonly json: JsonValue;
|
|
3188
|
+
/**
|
|
3189
|
+
* Sets the index of this candidate value.
|
|
3190
|
+
* @param index - The index to set.
|
|
3191
|
+
* @returns `Success` with the index if successful, or `Failure` with an error message if not.
|
|
3192
|
+
*/
|
|
3193
|
+
setIndex(index: number): Result<CandidateValueIndex>;
|
|
3194
|
+
}
|
|
3195
|
+
|
|
3196
|
+
/**
|
|
3197
|
+
* Parameters for creating a {@link Resources.CandidateValueCollector}.
|
|
3198
|
+
* @public
|
|
3199
|
+
*/
|
|
3200
|
+
declare interface ICandidateValueCollectorCreateParams {
|
|
3201
|
+
/**
|
|
3202
|
+
* Optional normalizer to use for normalizing JSON values.
|
|
3203
|
+
* If not provided, a default Crc32Normalizer will be used.
|
|
3204
|
+
*/
|
|
3205
|
+
normalizer?: Hash.HashingNormalizer;
|
|
3206
|
+
/**
|
|
3207
|
+
* Optional initial candidate values to add to the collection.
|
|
3208
|
+
*/
|
|
3209
|
+
candidateValues?: (CandidateValue | JsonValue)[];
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
/**
|
|
3213
|
+
* Parameters for creating a {@link Resources.CandidateValue | CandidateValue}.
|
|
3214
|
+
* @public
|
|
3215
|
+
*/
|
|
3216
|
+
declare interface ICandidateValueCreateParams {
|
|
3217
|
+
/**
|
|
3218
|
+
* The JSON value to store. Will be normalized during creation.
|
|
3219
|
+
*/
|
|
3220
|
+
json: JsonValue;
|
|
3221
|
+
/**
|
|
3222
|
+
* Optional normalizer to use for normalizing the JSON value.
|
|
3223
|
+
* If not provided, a default Crc32Normalizer will be used.
|
|
3224
|
+
*/
|
|
3225
|
+
normalizer?: Hash.Crc32Normalizer;
|
|
3226
|
+
/**
|
|
3227
|
+
* Optional index if the value is already indexed.
|
|
3228
|
+
*/
|
|
3229
|
+
index?: number;
|
|
3230
|
+
}
|
|
3231
|
+
|
|
2760
3232
|
/**
|
|
2761
3233
|
* Non-validated child declaration of a {@link Conditions.Condition | condition}.
|
|
2762
3234
|
* @public
|
|
@@ -2880,9 +3352,9 @@ declare interface ICompiledAbstractDecision {
|
|
|
2880
3352
|
*/
|
|
2881
3353
|
declare interface ICompiledCandidate {
|
|
2882
3354
|
/**
|
|
2883
|
-
* The JSON value of the candidate.
|
|
3355
|
+
* The global index of the JSON value of the candidate.
|
|
2884
3356
|
*/
|
|
2885
|
-
|
|
3357
|
+
valueIndex: Common.CandidateValueIndex;
|
|
2886
3358
|
/**
|
|
2887
3359
|
* Indicates if this is a partial resource that needs to be merged.
|
|
2888
3360
|
*/
|
|
@@ -3055,6 +3527,10 @@ declare interface ICompiledResourceCollection {
|
|
|
3055
3527
|
* Array of all decisions in the collection.
|
|
3056
3528
|
*/
|
|
3057
3529
|
decisions: ReadonlyArray<ICompiledAbstractDecision>;
|
|
3530
|
+
/**
|
|
3531
|
+
* Array of all candidate values in the collection.
|
|
3532
|
+
*/
|
|
3533
|
+
candidateValues: ReadonlyArray<JsonValue>;
|
|
3058
3534
|
/**
|
|
3059
3535
|
* Array of all resources in the collection.
|
|
3060
3536
|
*/
|
|
@@ -3246,6 +3722,19 @@ declare interface IConditionTokenParts {
|
|
|
3246
3722
|
value: string;
|
|
3247
3723
|
}
|
|
3248
3724
|
|
|
3725
|
+
/**
|
|
3726
|
+
* Interface for a factory that creates a new instance of a configuration object.
|
|
3727
|
+
* @public
|
|
3728
|
+
*/
|
|
3729
|
+
declare interface IConfigInitFactory<TConfig, T> {
|
|
3730
|
+
/**
|
|
3731
|
+
* Creates a new instance of a configuration object.
|
|
3732
|
+
* @param config - The configuration object to create.
|
|
3733
|
+
* @returns A result containing the new instance of the configuration object.
|
|
3734
|
+
*/
|
|
3735
|
+
create(config: TConfig): Result<T>;
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3249
3738
|
/**
|
|
3250
3739
|
* Declared context for a resource container.
|
|
3251
3740
|
* @public
|
|
@@ -3303,11 +3792,19 @@ declare interface IContextMatchOptions {
|
|
|
3303
3792
|
}
|
|
3304
3793
|
|
|
3305
3794
|
/**
|
|
3306
|
-
*
|
|
3795
|
+
* Union type for context qualifier providers that can be either read-only or mutable.
|
|
3796
|
+
* Provides compile-time type discrimination via the `mutable` property.
|
|
3797
|
+
* @public
|
|
3798
|
+
*/
|
|
3799
|
+
declare type IContextQualifierProvider = IReadOnlyContextQualifierProvider | IMutableContextQualifierProvider;
|
|
3800
|
+
|
|
3801
|
+
/**
|
|
3802
|
+
* Base interface for providing qualifier values in an optimized runtime context.
|
|
3803
|
+
* Contains common read-only operations shared by both mutable and immutable providers.
|
|
3307
3804
|
* Acts as a property bag using the Result pattern for qualifier value lookups.
|
|
3308
3805
|
* @public
|
|
3309
3806
|
*/
|
|
3310
|
-
declare interface
|
|
3807
|
+
declare interface IContextQualifierProviderBase {
|
|
3311
3808
|
/**
|
|
3312
3809
|
* Gets a qualifier value by its name, index, or qualifier object.
|
|
3313
3810
|
* @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.
|
|
@@ -3342,13 +3839,62 @@ declare interface IContextQualifierProvider {
|
|
|
3342
3839
|
}
|
|
3343
3840
|
|
|
3344
3841
|
/**
|
|
3345
|
-
*
|
|
3842
|
+
* Base interface for shared operations between read-only and mutable context qualifier provider validators.
|
|
3843
|
+
* Contains common methods that don't depend on provider mutability.
|
|
3346
3844
|
* @public
|
|
3347
3845
|
*/
|
|
3348
|
-
declare interface
|
|
3349
|
-
|
|
3846
|
+
declare interface IContextQualifierProviderValidatorBase<T extends IContextQualifierProvider = IContextQualifierProvider> {
|
|
3847
|
+
/**
|
|
3848
|
+
* The wrapped context qualifier provider.
|
|
3849
|
+
*/
|
|
3850
|
+
readonly provider: T;
|
|
3851
|
+
/**
|
|
3852
|
+
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
3853
|
+
*/
|
|
3854
|
+
readonly qualifiers: IReadOnlyQualifierCollector;
|
|
3855
|
+
/**
|
|
3856
|
+
* Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
|
|
3857
|
+
* @param name - The string name to convert and look up.
|
|
3858
|
+
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
3859
|
+
* or `Failure` with an error message if not found or an error occurs.
|
|
3860
|
+
*/
|
|
3861
|
+
get(name: string): Result<QualifierContextValue>;
|
|
3862
|
+
/**
|
|
3863
|
+
* Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
|
|
3864
|
+
* @param index - The number index to convert and look up.
|
|
3865
|
+
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
3866
|
+
* or `Failure` with an error message if not found or an error occurs.
|
|
3867
|
+
*/
|
|
3868
|
+
getByIndex(index: number): Result<QualifierContextValue>;
|
|
3869
|
+
/**
|
|
3870
|
+
* Gets a validated qualifier context value by its string name.
|
|
3871
|
+
* @param name - The string name to convert and look up.
|
|
3872
|
+
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
3873
|
+
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
3874
|
+
*/
|
|
3875
|
+
getValidated(name: string): Result<QualifierContextValue>;
|
|
3876
|
+
/**
|
|
3877
|
+
* Gets a validated qualifier context value by its number index.
|
|
3878
|
+
* @param index - The number index to convert and look up.
|
|
3879
|
+
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
3880
|
+
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
3881
|
+
*/
|
|
3882
|
+
getValidatedByIndex(index: number): Result<QualifierContextValue>;
|
|
3883
|
+
/**
|
|
3884
|
+
* Checks if a qualifier value exists with the given string name.
|
|
3885
|
+
* @param name - The string name to convert and check.
|
|
3886
|
+
* @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
|
|
3887
|
+
* or `Failure` with an error message if an error occurs during the check.
|
|
3888
|
+
*/
|
|
3889
|
+
has(name: string): Result<boolean>;
|
|
3350
3890
|
}
|
|
3351
3891
|
|
|
3892
|
+
/**
|
|
3893
|
+
* Union type for validator constructor parameters.
|
|
3894
|
+
* @public
|
|
3895
|
+
*/
|
|
3896
|
+
declare type IContextQualifierProviderValidatorCreateParams = IReadOnlyContextQualifierProviderValidatorCreateParams | IMutableContextQualifierProviderValidatorCreateParams;
|
|
3897
|
+
|
|
3352
3898
|
/**
|
|
3353
3899
|
* Non-validated declaration of a single context qualifier value.
|
|
3354
3900
|
* @public
|
|
@@ -3416,6 +3962,49 @@ declare interface IDeclarationOptions {
|
|
|
3416
3962
|
normalized?: boolean;
|
|
3417
3963
|
}
|
|
3418
3964
|
|
|
3965
|
+
/**
|
|
3966
|
+
* Interface for options controlling delta generation behavior.
|
|
3967
|
+
* @public
|
|
3968
|
+
*/
|
|
3969
|
+
declare interface IDeltaGeneratorOptions {
|
|
3970
|
+
/**
|
|
3971
|
+
* Context to use when resolving resources. If not provided, uses empty context.
|
|
3972
|
+
*/
|
|
3973
|
+
context?: Context.IContextDecl;
|
|
3974
|
+
/**
|
|
3975
|
+
* Array of specific resource IDs to include in delta generation.
|
|
3976
|
+
* If not provided, generates deltas for all resources in the delta resolver.
|
|
3977
|
+
*/
|
|
3978
|
+
resourceIds?: ReadonlyArray<string>;
|
|
3979
|
+
/**
|
|
3980
|
+
* Whether to skip resources that haven't changed. Default: true.
|
|
3981
|
+
*/
|
|
3982
|
+
skipUnchanged?: boolean;
|
|
3983
|
+
}
|
|
3984
|
+
|
|
3985
|
+
/**
|
|
3986
|
+
* Interface for parameters to create a {@link Resources.DeltaGenerator | DeltaGenerator}.
|
|
3987
|
+
* @public
|
|
3988
|
+
*/
|
|
3989
|
+
declare interface IDeltaGeneratorParams {
|
|
3990
|
+
/**
|
|
3991
|
+
* The baseline resource resolver to compare against.
|
|
3992
|
+
*/
|
|
3993
|
+
baselineResolver: IResourceResolver;
|
|
3994
|
+
/**
|
|
3995
|
+
* The delta resource resolver containing changes.
|
|
3996
|
+
*/
|
|
3997
|
+
deltaResolver: IResourceResolver;
|
|
3998
|
+
/**
|
|
3999
|
+
* The resource manager to clone and update.
|
|
4000
|
+
*/
|
|
4001
|
+
resourceManager: ResourceManagerBuilder;
|
|
4002
|
+
/**
|
|
4003
|
+
* Optional logger for status and error reporting.
|
|
4004
|
+
*/
|
|
4005
|
+
logger?: Logging.ILogger;
|
|
4006
|
+
}
|
|
4007
|
+
|
|
3419
4008
|
/**
|
|
3420
4009
|
* @internal
|
|
3421
4010
|
*/
|
|
@@ -3530,6 +4119,46 @@ declare interface IImportContext {
|
|
|
3530
4119
|
readonly conditions?: ReadonlyArray<IConditionDecl>;
|
|
3531
4120
|
}
|
|
3532
4121
|
|
|
4122
|
+
/**
|
|
4123
|
+
* JSON representation of an imported directory structure
|
|
4124
|
+
* @public
|
|
4125
|
+
*/
|
|
4126
|
+
declare interface IImportedDirectory {
|
|
4127
|
+
/** Directory name */
|
|
4128
|
+
name: string;
|
|
4129
|
+
/** Files in this directory */
|
|
4130
|
+
files: IImportedFile[];
|
|
4131
|
+
/** Subdirectories */
|
|
4132
|
+
subdirectories: IImportedDirectory[];
|
|
4133
|
+
}
|
|
4134
|
+
|
|
4135
|
+
/**
|
|
4136
|
+
* Imported directory structure
|
|
4137
|
+
* @public
|
|
4138
|
+
*/
|
|
4139
|
+
declare type IImportedDirectory_2 = Json_2.IImportedDirectory;
|
|
4140
|
+
|
|
4141
|
+
/**
|
|
4142
|
+
* JSON representation of an imported file
|
|
4143
|
+
* @public
|
|
4144
|
+
*/
|
|
4145
|
+
declare interface IImportedFile {
|
|
4146
|
+
/** File name */
|
|
4147
|
+
name: string;
|
|
4148
|
+
/** Full path within archive */
|
|
4149
|
+
path: string;
|
|
4150
|
+
/** File content as string */
|
|
4151
|
+
content: string;
|
|
4152
|
+
/** MIME type */
|
|
4153
|
+
type: string;
|
|
4154
|
+
}
|
|
4155
|
+
|
|
4156
|
+
/**
|
|
4157
|
+
* Imported file representation
|
|
4158
|
+
* @public
|
|
4159
|
+
*/
|
|
4160
|
+
declare type IImportedFile_2 = Json_2.IImportedFile;
|
|
4161
|
+
|
|
3533
4162
|
/**
|
|
3534
4163
|
* Generic interface for an importer than accepts a typed
|
|
3535
4164
|
* {@link Import.IImportable | importable} item, extracts any resources
|
|
@@ -3663,6 +4292,11 @@ declare interface IJsonResourceTypeCreateParams {
|
|
|
3663
4292
|
* instance.
|
|
3664
4293
|
*/
|
|
3665
4294
|
index?: number;
|
|
4295
|
+
/**
|
|
4296
|
+
* Optional template for new instances of {@link ResourceTypes.JsonResourceType | JsonResourceType}
|
|
4297
|
+
* resources.
|
|
4298
|
+
*/
|
|
4299
|
+
template?: JsonObject;
|
|
3666
4300
|
}
|
|
3667
4301
|
|
|
3668
4302
|
/**
|
|
@@ -3727,10 +4361,10 @@ declare interface ILiteralQualifierTypeCreateParams {
|
|
|
3727
4361
|
*/
|
|
3728
4362
|
enumeratedValues?: ReadonlyArray<string>;
|
|
3729
4363
|
/**
|
|
3730
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
4364
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
3731
4365
|
* of literal values to use for matching. If not provided, no hierarchy will be used.
|
|
3732
4366
|
*/
|
|
3733
|
-
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
4367
|
+
hierarchy?: Config_2.LiteralValueHierarchyDecl<string>;
|
|
3734
4368
|
/**
|
|
3735
4369
|
* Global index for this qualifier type.
|
|
3736
4370
|
*/
|
|
@@ -3754,7 +4388,7 @@ declare interface ILiteralValue<T extends string> {
|
|
|
3754
4388
|
*/
|
|
3755
4389
|
declare interface ILiteralValueHierarchyCreateParams<T extends string = string> {
|
|
3756
4390
|
values: ReadonlyArray<T>;
|
|
3757
|
-
hierarchy?: LiteralValueHierarchyDecl<T
|
|
4391
|
+
hierarchy?: Partial<LiteralValueHierarchyDecl<T>>;
|
|
3758
4392
|
}
|
|
3759
4393
|
|
|
3760
4394
|
/**
|
|
@@ -3986,6 +4620,19 @@ declare class ImportContext implements IValidatedImportContext {
|
|
|
3986
4620
|
static forContainerImport(container?: ResourceJson.Normalized.IContainerContextDecl, importer?: ImportContext): Result<ImportContext | undefined>;
|
|
3987
4621
|
}
|
|
3988
4622
|
|
|
4623
|
+
/**
|
|
4624
|
+
* Converter for imported directory structure (recursive)
|
|
4625
|
+
* Note: Uses Converter pattern because Validators don't support recursion with self parameter
|
|
4626
|
+
* @public
|
|
4627
|
+
*/
|
|
4628
|
+
declare const importedDirectory: Converter<Json_2.IImportedDirectory>;
|
|
4629
|
+
|
|
4630
|
+
/**
|
|
4631
|
+
* Converter for imported file
|
|
4632
|
+
* @public
|
|
4633
|
+
*/
|
|
4634
|
+
declare const importedFile: Converter<Json_2.IImportedFile>;
|
|
4635
|
+
|
|
3989
4636
|
/**
|
|
3990
4637
|
* `Converter` for a normalized {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declaration}.
|
|
3991
4638
|
* @public
|
|
@@ -4083,30 +4730,97 @@ declare class ImportManager {
|
|
|
4083
4730
|
}
|
|
4084
4731
|
|
|
4085
4732
|
/**
|
|
4086
|
-
*
|
|
4087
|
-
*
|
|
4088
|
-
*/
|
|
4089
|
-
declare interface IPathImporterCreateParams {
|
|
4090
|
-
qualifiers: IReadOnlyQualifierCollector;
|
|
4091
|
-
tree?: FileTree.FileTree;
|
|
4092
|
-
ignoreFileTypes?: string[];
|
|
4093
|
-
}
|
|
4094
|
-
|
|
4095
|
-
/**
|
|
4096
|
-
* Parameters for creating a new {@link Qualifiers.QualifierCollector}.
|
|
4733
|
+
* Mutable interface for providing qualifier values in an optimized runtime context.
|
|
4734
|
+
* Extends the base interface with mutation operations and explicit mutability marker.
|
|
4097
4735
|
* @public
|
|
4098
4736
|
*/
|
|
4099
|
-
declare interface
|
|
4737
|
+
declare interface IMutableContextQualifierProvider extends IContextQualifierProviderBase {
|
|
4100
4738
|
/**
|
|
4101
|
-
*
|
|
4102
|
-
*
|
|
4739
|
+
* Explicit mutability marker for compile-time type discrimination.
|
|
4740
|
+
* Always `true` for mutable providers.
|
|
4103
4741
|
*/
|
|
4104
|
-
|
|
4742
|
+
readonly mutable: true;
|
|
4105
4743
|
/**
|
|
4106
|
-
*
|
|
4107
|
-
*
|
|
4108
|
-
|
|
4109
|
-
|
|
4744
|
+
* Sets a qualifier value in this provider.
|
|
4745
|
+
* @param name - The {@link QualifierName | qualifier name} to set.
|
|
4746
|
+
* @param value - The {@link QualifierContextValue | qualifier context value} to set.
|
|
4747
|
+
* @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
|
|
4748
|
+
* or `Failure` with an error message if not.
|
|
4749
|
+
*/
|
|
4750
|
+
set(name: QualifierName, value: QualifierContextValue): Result<QualifierContextValue>;
|
|
4751
|
+
/**
|
|
4752
|
+
* Removes a qualifier value from this provider.
|
|
4753
|
+
* @param name - The {@link QualifierName | qualifier name} to remove.
|
|
4754
|
+
* @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
|
|
4755
|
+
* or `Failure` with an error message if not found or an error occurs.
|
|
4756
|
+
*/
|
|
4757
|
+
remove(name: QualifierName): Result<QualifierContextValue>;
|
|
4758
|
+
/**
|
|
4759
|
+
* Clears all qualifier values from this provider.
|
|
4760
|
+
*/
|
|
4761
|
+
clear(): void;
|
|
4762
|
+
}
|
|
4763
|
+
|
|
4764
|
+
/**
|
|
4765
|
+
* A mutable interface for validators wrapping mutable context qualifier providers.
|
|
4766
|
+
* Extends the base interface with mutation operations and provides compile-time type safety.
|
|
4767
|
+
* @public
|
|
4768
|
+
*/
|
|
4769
|
+
declare interface IMutableContextQualifierProviderValidator<T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider> extends IContextQualifierProviderValidatorBase<T> {
|
|
4770
|
+
/**
|
|
4771
|
+
* The wrapped mutable context qualifier provider.
|
|
4772
|
+
*/
|
|
4773
|
+
readonly provider: T;
|
|
4774
|
+
/**
|
|
4775
|
+
* Sets a qualifier value using string inputs, converting to strongly-typed values.
|
|
4776
|
+
* @param name - The string name to convert.
|
|
4777
|
+
* @param value - The string value to convert.
|
|
4778
|
+
* @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
|
|
4779
|
+
* or `Failure` with an error message if an error occurs.
|
|
4780
|
+
*/
|
|
4781
|
+
set(name: string, value: string): Result<QualifierContextValue>;
|
|
4782
|
+
/**
|
|
4783
|
+
* Removes a qualifier value using string input, converting to strongly-typed QualifierName.
|
|
4784
|
+
* @param name - The string name to convert.
|
|
4785
|
+
* @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
|
|
4786
|
+
* or `Failure` with an error message if an error occurs.
|
|
4787
|
+
*/
|
|
4788
|
+
remove(name: string): Result<QualifierContextValue>;
|
|
4789
|
+
}
|
|
4790
|
+
|
|
4791
|
+
/**
|
|
4792
|
+
* Parameters for constructing a mutable context qualifier provider validator.
|
|
4793
|
+
* @public
|
|
4794
|
+
*/
|
|
4795
|
+
declare interface IMutableContextQualifierProviderValidatorCreateParams<T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider> {
|
|
4796
|
+
provider: T;
|
|
4797
|
+
}
|
|
4798
|
+
|
|
4799
|
+
/**
|
|
4800
|
+
* Parameters for creating a {@link Import.Importers.PathImporter | PathImporter}.
|
|
4801
|
+
* @public
|
|
4802
|
+
*/
|
|
4803
|
+
declare interface IPathImporterCreateParams {
|
|
4804
|
+
qualifiers: IReadOnlyQualifierCollector;
|
|
4805
|
+
tree?: FileTree.FileTree;
|
|
4806
|
+
ignoreFileTypes?: string[];
|
|
4807
|
+
}
|
|
4808
|
+
|
|
4809
|
+
/**
|
|
4810
|
+
* Parameters for creating a new {@link Qualifiers.QualifierCollector}.
|
|
4811
|
+
* @public
|
|
4812
|
+
*/
|
|
4813
|
+
declare interface IQualifierCollectorCreateParams {
|
|
4814
|
+
/**
|
|
4815
|
+
* The {@link QualifierTypes.QualifierTypeCollector | qualifier types} used to
|
|
4816
|
+
* create {@link Qualifiers.Qualifier | qualifiers} from {@link Qualifiers.IQualifierDecl | declarations}.
|
|
4817
|
+
*/
|
|
4818
|
+
qualifierTypes: ReadOnlyQualifierTypeCollector;
|
|
4819
|
+
/**
|
|
4820
|
+
* Optional list of {@link Qualifiers.IQualifierDecl | declarations} for the qualifiers to add to the collection
|
|
4821
|
+
* upon creation.
|
|
4822
|
+
*/
|
|
4823
|
+
qualifiers?: IQualifierDecl[];
|
|
4110
4824
|
}
|
|
4111
4825
|
|
|
4112
4826
|
/**
|
|
@@ -4171,11 +4885,15 @@ declare interface IQualifierDefaultValueTokenParts {
|
|
|
4171
4885
|
* territories, etc).
|
|
4172
4886
|
* @public
|
|
4173
4887
|
*/
|
|
4174
|
-
declare interface IQualifierType extends ICollectible<QualifierTypeName, QualifierTypeIndex> {
|
|
4888
|
+
declare interface IQualifierType<TCFGJSON extends JsonObject = JsonObject> extends ICollectible<QualifierTypeName, QualifierTypeIndex> {
|
|
4175
4889
|
/**
|
|
4176
4890
|
* The name of the qualifier type.
|
|
4177
4891
|
*/
|
|
4178
4892
|
readonly name: QualifierTypeName;
|
|
4893
|
+
/**
|
|
4894
|
+
* Name of the underlying system type.
|
|
4895
|
+
*/
|
|
4896
|
+
readonly systemTypeName: QualifierTypeName;
|
|
4179
4897
|
/**
|
|
4180
4898
|
* Unique key for this qualifier.
|
|
4181
4899
|
*/
|
|
@@ -4238,6 +4956,17 @@ declare interface IQualifierType extends ICollectible<QualifierTypeName, Qualifi
|
|
|
4238
4956
|
* Sets the index for this qualifier type. Once set, index is immutable.
|
|
4239
4957
|
*/
|
|
4240
4958
|
setIndex(index: number): Result<QualifierTypeIndex>;
|
|
4959
|
+
/**
|
|
4960
|
+
* Gets the configuration for this qualifier type.
|
|
4961
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
4962
|
+
*/
|
|
4963
|
+
getConfigurationJson(): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
|
|
4964
|
+
/**
|
|
4965
|
+
* Validates configuration JSON data for this qualifier type.
|
|
4966
|
+
* @param from - The unknown data to validate as configuration JSON.
|
|
4967
|
+
* @returns `Success` with validated JSON configuration if valid, `Failure` with an error message otherwise.
|
|
4968
|
+
*/
|
|
4969
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
|
|
4241
4970
|
}
|
|
4242
4971
|
|
|
4243
4972
|
/**
|
|
@@ -4292,68 +5021,36 @@ declare interface IQualifierTypeCreateParams {
|
|
|
4292
5021
|
}
|
|
4293
5022
|
|
|
4294
5023
|
/**
|
|
4295
|
-
*
|
|
5024
|
+
* Read-only interface for providing qualifier values in an optimized runtime context.
|
|
5025
|
+
* Explicitly marked as immutable with compile-time type discrimination.
|
|
4296
5026
|
* @public
|
|
4297
5027
|
*/
|
|
4298
|
-
declare interface
|
|
4299
|
-
/**
|
|
4300
|
-
* {@inheritdoc Runtime.Context.ContextQualifierProviderValidator.provider}
|
|
4301
|
-
*/
|
|
4302
|
-
readonly provider: IContextQualifierProvider;
|
|
4303
|
-
/**
|
|
4304
|
-
* {@inheritdoc Runtime.Context.ContextQualifierProviderValidator.qualifiers}
|
|
4305
|
-
*/
|
|
4306
|
-
readonly qualifiers: IReadOnlyQualifierCollector;
|
|
4307
|
-
/**
|
|
4308
|
-
* Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
|
|
4309
|
-
* @param name - The string name to convert and look up.
|
|
4310
|
-
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
4311
|
-
* or `Failure` with an error message if not found or an error occurs.
|
|
4312
|
-
*/
|
|
4313
|
-
get(name: string): Result<QualifierContextValue>;
|
|
4314
|
-
/**
|
|
4315
|
-
* Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
|
|
4316
|
-
* @param index - The number index to convert and look up.
|
|
4317
|
-
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
4318
|
-
* or `Failure` with an error message if not found or an error occurs.
|
|
4319
|
-
*/
|
|
4320
|
-
getByIndex(index: number): Result<QualifierContextValue>;
|
|
4321
|
-
/**
|
|
4322
|
-
* Gets a validated qualifier context value by its string name.
|
|
4323
|
-
* @param name - The string name to convert and look up.
|
|
4324
|
-
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
4325
|
-
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
4326
|
-
*/
|
|
4327
|
-
getValidated(name: string): Result<QualifierContextValue>;
|
|
4328
|
-
/**
|
|
4329
|
-
* Gets a validated qualifier context value by its number index.
|
|
4330
|
-
* @param index - The number index to convert and look up.
|
|
4331
|
-
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
4332
|
-
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
4333
|
-
*/
|
|
4334
|
-
getValidatedByIndex(index: number): Result<QualifierContextValue>;
|
|
4335
|
-
/**
|
|
4336
|
-
* Checks if a qualifier value exists with the given string name.
|
|
4337
|
-
* @param name - The string name to convert and check.
|
|
4338
|
-
* @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
|
|
4339
|
-
* or `Failure` with an error message if an error occurs during the check.
|
|
4340
|
-
*/
|
|
4341
|
-
has(name: string): Result<boolean>;
|
|
5028
|
+
declare interface IReadOnlyContextQualifierProvider extends IContextQualifierProviderBase {
|
|
4342
5029
|
/**
|
|
4343
|
-
*
|
|
4344
|
-
*
|
|
4345
|
-
* @param value - The string value to convert.
|
|
4346
|
-
* @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
|
|
4347
|
-
* or `Failure` with an error message if an error occurs.
|
|
5030
|
+
* Explicit mutability marker for compile-time type discrimination.
|
|
5031
|
+
* Always `false` for read-only providers.
|
|
4348
5032
|
*/
|
|
4349
|
-
|
|
5033
|
+
readonly mutable: false;
|
|
5034
|
+
}
|
|
5035
|
+
|
|
5036
|
+
/**
|
|
5037
|
+
* A read-only interface for validators wrapping read-only context qualifier providers.
|
|
5038
|
+
* Only exposes read operations, providing compile-time type safety by excluding mutation methods.
|
|
5039
|
+
* @public
|
|
5040
|
+
*/
|
|
5041
|
+
declare interface IReadOnlyContextQualifierProviderValidator<T extends IReadOnlyContextQualifierProvider = IReadOnlyContextQualifierProvider> {
|
|
4350
5042
|
/**
|
|
4351
|
-
*
|
|
4352
|
-
* @param name - The string name to convert.
|
|
4353
|
-
* @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
|
|
4354
|
-
* or `Failure` with an error message if an error occurs.
|
|
5043
|
+
* The wrapped read-only context qualifier provider.
|
|
4355
5044
|
*/
|
|
4356
|
-
|
|
5045
|
+
readonly provider: T;
|
|
5046
|
+
}
|
|
5047
|
+
|
|
5048
|
+
/**
|
|
5049
|
+
* Parameters for constructing a read-only context qualifier provider validator.
|
|
5050
|
+
* @public
|
|
5051
|
+
*/
|
|
5052
|
+
declare interface IReadOnlyContextQualifierProviderValidatorCreateParams<T extends IReadOnlyContextQualifierProvider = IReadOnlyContextQualifierProvider> {
|
|
5053
|
+
provider: T;
|
|
4357
5054
|
}
|
|
4358
5055
|
|
|
4359
5056
|
/**
|
|
@@ -4398,7 +5095,7 @@ declare interface IReadOnlyResourceTreeBranch<T> {
|
|
|
4398
5095
|
* Interface for a read-only result-based resource tree with navigation methods.
|
|
4399
5096
|
* @public
|
|
4400
5097
|
*/
|
|
4401
|
-
declare interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<
|
|
5098
|
+
declare interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<TNAME, IReadOnlyResourceTreeNode<T>> {
|
|
4402
5099
|
/**
|
|
4403
5100
|
* Gets a tree node by its full ResourceId path.
|
|
4404
5101
|
* @param id - The ResourceId path to look up
|
|
@@ -4485,6 +5182,29 @@ declare interface IReducedCandidate {
|
|
|
4485
5182
|
readonly mergeMethod?: ResourceValueMergeMethod;
|
|
4486
5183
|
}
|
|
4487
5184
|
|
|
5185
|
+
/**
|
|
5186
|
+
* Options for configuring resource tree resolution.
|
|
5187
|
+
* @public
|
|
5188
|
+
*/
|
|
5189
|
+
declare interface IResolveResourceTreeOptions {
|
|
5190
|
+
/**
|
|
5191
|
+
* Controls how errors are handled when resolving individual resources in the tree.
|
|
5192
|
+
* - 'fail': Aggregate all errors and fail if any resource fails to resolve
|
|
5193
|
+
* - 'ignore': Skip failed resources and omit them from the result
|
|
5194
|
+
* - callback: Custom error handler that can provide alternate values or propagate errors
|
|
5195
|
+
* @defaultValue 'fail'
|
|
5196
|
+
*/
|
|
5197
|
+
onResourceError?: 'fail' | 'ignore' | ResourceErrorHandler;
|
|
5198
|
+
/**
|
|
5199
|
+
* Controls how empty branch nodes are handled during tree composition.
|
|
5200
|
+
* - 'allow': Include empty branches as empty objects in the result
|
|
5201
|
+
* - 'omit': Exclude empty branches from the parent object
|
|
5202
|
+
* - callback: Custom handler that can provide alternate values or recovery logic
|
|
5203
|
+
* @defaultValue 'allow'
|
|
5204
|
+
*/
|
|
5205
|
+
onEmptyBranch?: 'allow' | 'omit' | EmptyBranchHandler;
|
|
5206
|
+
}
|
|
5207
|
+
|
|
4488
5208
|
/**
|
|
4489
5209
|
* Interface for a resource that can be used in the runtime layer.
|
|
4490
5210
|
* This provides the minimal properties needed from a resource without requiring
|
|
@@ -4494,8 +5214,10 @@ declare interface IReducedCandidate {
|
|
|
4494
5214
|
declare interface IResource {
|
|
4495
5215
|
/** The resource identifier */
|
|
4496
5216
|
readonly id: string;
|
|
5217
|
+
/** The resource name */
|
|
5218
|
+
readonly name: string;
|
|
4497
5219
|
/** The resource type */
|
|
4498
|
-
readonly resourceType:
|
|
5220
|
+
readonly resourceType: IResourceType;
|
|
4499
5221
|
/** The decision used to select candidates */
|
|
4500
5222
|
readonly decision: ConcreteDecision;
|
|
4501
5223
|
/** The available candidates for this resource */
|
|
@@ -4512,6 +5234,7 @@ declare interface IResourceBuilderCreateParams {
|
|
|
4512
5234
|
conditionSets: ConditionSetCollector;
|
|
4513
5235
|
resourceTypes: ReadOnlyResourceTypeCollector;
|
|
4514
5236
|
decisions: AbstractDecisionCollector;
|
|
5237
|
+
candidateValues: CandidateValueCollector;
|
|
4515
5238
|
}
|
|
4516
5239
|
|
|
4517
5240
|
/**
|
|
@@ -4541,6 +5264,7 @@ declare interface IResourceCandidateCreateParams {
|
|
|
4541
5264
|
resourceType?: ResourceType;
|
|
4542
5265
|
parentConditions?: ReadonlyArray<Condition>;
|
|
4543
5266
|
conditionSets: ConditionSetCollector;
|
|
5267
|
+
candidateValues: CandidateValueCollector;
|
|
4544
5268
|
}
|
|
4545
5269
|
|
|
4546
5270
|
/**
|
|
@@ -4554,10 +5278,10 @@ declare interface IResourceCandidateValidationProperties {
|
|
|
4554
5278
|
*/
|
|
4555
5279
|
id: ResourceId;
|
|
4556
5280
|
/**
|
|
4557
|
-
*
|
|
5281
|
+
* Describes how complete the candidate value is.
|
|
4558
5282
|
* @public
|
|
4559
5283
|
*/
|
|
4560
|
-
|
|
5284
|
+
completeness: CandidateCompleteness;
|
|
4561
5285
|
/**
|
|
4562
5286
|
* {@inheritdoc ResourceJson.Json.ILooseResourceCandidateDecl.json}
|
|
4563
5287
|
* @public
|
|
@@ -4698,7 +5422,7 @@ declare interface IResourceDeclContainer {
|
|
|
4698
5422
|
* implementations without requiring the full ResourceManagerBuilder build mechanics.
|
|
4699
5423
|
* @public
|
|
4700
5424
|
*/
|
|
4701
|
-
export declare interface IResourceManager {
|
|
5425
|
+
export declare interface IResourceManager<TR extends IResource = IResource> {
|
|
4702
5426
|
/**
|
|
4703
5427
|
* A {@link Conditions.ReadOnlyConditionCollector | ReadOnlyConditionCollector} which
|
|
4704
5428
|
* contains the {@link Conditions.Condition | conditions} used by resource candidates.
|
|
@@ -4719,16 +5443,25 @@ export declare interface IResourceManager {
|
|
|
4719
5443
|
* @param id - The resource identifier
|
|
4720
5444
|
* @returns Success with the runtime resource if found, Failure otherwise
|
|
4721
5445
|
*/
|
|
4722
|
-
getBuiltResource(id: string): Result<
|
|
5446
|
+
getBuiltResource(id: string): Result<TR>;
|
|
5447
|
+
/**
|
|
5448
|
+
* Gets a resource tree built from the resources in this resource manager.
|
|
5449
|
+
* @returns Result containing the resource tree root, or failure if tree construction fails
|
|
5450
|
+
*/
|
|
5451
|
+
getBuiltResourceTree(): Result<IReadOnlyResourceTreeRoot<TR>>;
|
|
4723
5452
|
/**
|
|
4724
5453
|
* A read-only result map of all built resources, keyed by resource ID.
|
|
4725
5454
|
* Resources are built on-demand when accessed and returns Results for error handling.
|
|
4726
5455
|
*/
|
|
4727
|
-
readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId,
|
|
5456
|
+
readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId, TR>;
|
|
4728
5457
|
/**
|
|
4729
5458
|
* The number of resources in this resource manager.
|
|
4730
5459
|
*/
|
|
4731
5460
|
readonly numResources: number;
|
|
5461
|
+
/**
|
|
5462
|
+
* The resource IDs that this resource manager can resolve.
|
|
5463
|
+
*/
|
|
5464
|
+
readonly resourceIds: ReadonlyArray<ResourceId>;
|
|
4732
5465
|
/**
|
|
4733
5466
|
* The number of candidates in this resource manager.
|
|
4734
5467
|
*/
|
|
@@ -4761,6 +5494,47 @@ declare interface IResourceManagerCloneOptions extends IResourceDeclarationOptio
|
|
|
4761
5494
|
* These conditions can modify or extend the resource candidates in the cloned manager.
|
|
4762
5495
|
*/
|
|
4763
5496
|
readonly candidates?: ReadonlyArray<ResourceJson.Json.ILooseResourceCandidateDecl>;
|
|
5497
|
+
/**
|
|
5498
|
+
* Optional qualifier collector to use for the cloned manager.
|
|
5499
|
+
* If not provided, uses the same qualifiers as the original manager.
|
|
5500
|
+
* This allows creating clones with different qualifier configurations.
|
|
5501
|
+
*/
|
|
5502
|
+
readonly qualifiers?: IReadOnlyQualifierCollector;
|
|
5503
|
+
/**
|
|
5504
|
+
* Optional resource type collector to use for the cloned manager.
|
|
5505
|
+
* If not provided, uses the same resource types as the original manager.
|
|
5506
|
+
* This allows creating clones with different resource type configurations.
|
|
5507
|
+
*/
|
|
5508
|
+
readonly resourceTypes?: ReadOnlyResourceTypeCollector;
|
|
5509
|
+
}
|
|
5510
|
+
|
|
5511
|
+
/**
|
|
5512
|
+
* Minimal resource resolver
|
|
5513
|
+
* @public
|
|
5514
|
+
*/
|
|
5515
|
+
export declare interface IResourceResolver {
|
|
5516
|
+
/**
|
|
5517
|
+
* The resource IDs that this resolver can resolve.
|
|
5518
|
+
*/
|
|
5519
|
+
readonly resourceIds: ReadonlyArray<ResourceId>;
|
|
5520
|
+
/**
|
|
5521
|
+
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
5522
|
+
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
5523
|
+
* priority "partial" candidates into it in ascending order of priority.
|
|
5524
|
+
* @param resource - The string id of the resource to resolve.
|
|
5525
|
+
* @returns `Success` with the composed JsonValue if successful,
|
|
5526
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
5527
|
+
* @public
|
|
5528
|
+
*/
|
|
5529
|
+
resolveComposedResourceValue(resource: string): Result<JsonValue>;
|
|
5530
|
+
/**
|
|
5531
|
+
* Creates a new {@link IResourceResolver | resource resolver} with the given context.
|
|
5532
|
+
* @param context - The context to use for the new resource resolver.
|
|
5533
|
+
* @returns `Success` with the new resource resolver if successful,
|
|
5534
|
+
* or `Failure` with an error message if the context is invalid.
|
|
5535
|
+
* @public
|
|
5536
|
+
*/
|
|
5537
|
+
withContext(context: Record<string, string>): Result<IResourceResolver>;
|
|
4764
5538
|
}
|
|
4765
5539
|
|
|
4766
5540
|
/**
|
|
@@ -4906,13 +5680,82 @@ declare interface IResourceTreeRootInit<T> {
|
|
|
4906
5680
|
readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;
|
|
4907
5681
|
}
|
|
4908
5682
|
|
|
5683
|
+
/**
|
|
5684
|
+
* Interface for a resource type. Resource types are responsible for
|
|
5685
|
+
* validating and converting JSON values into the appropriate strongly-typed
|
|
5686
|
+
* resource value.
|
|
5687
|
+
* @public
|
|
5688
|
+
*/
|
|
5689
|
+
declare interface IResourceType<T = unknown> extends ICollectible<ResourceTypeName, ResourceTypeIndex> {
|
|
5690
|
+
/**
|
|
5691
|
+
* The key for this resource type.
|
|
5692
|
+
*/
|
|
5693
|
+
readonly key: ResourceTypeName;
|
|
5694
|
+
/**
|
|
5695
|
+
* The index for this resource type.
|
|
5696
|
+
*/
|
|
5697
|
+
readonly index: ResourceTypeIndex | undefined;
|
|
5698
|
+
/**
|
|
5699
|
+
* Validates properties of a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration} for
|
|
5700
|
+
* a resource instance value.
|
|
5701
|
+
* @param props - The {@link ResourceTypes.IResourceCandidateValidationProperties | properties } to validate.
|
|
5702
|
+
* @returns `Success` with the strongly-typed resource value if the JSON and merge method
|
|
5703
|
+
* are valid, `Failure` with an error message otherwise.
|
|
5704
|
+
* @public
|
|
5705
|
+
*/
|
|
5706
|
+
validateDeclaration(props: IResourceCandidateValidationProperties): Result<T | Partial<T>>;
|
|
5707
|
+
/**
|
|
5708
|
+
* Validates a JSON value for use as a partial resource instance value.
|
|
5709
|
+
* @param json - The JSON value to validate.
|
|
5710
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
5711
|
+
* @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
|
|
5712
|
+
* `Failure` with an error message otherwise.
|
|
5713
|
+
* @public
|
|
5714
|
+
*/
|
|
5715
|
+
validate(json: JsonValue, completeness: CandidateCompleteness): Result<Partial<T>>;
|
|
5716
|
+
/**
|
|
5717
|
+
* Validates a JSON value for use as a complete resource instance value.
|
|
5718
|
+
* @param json - The JSON value to validate.
|
|
5719
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
5720
|
+
* @returns `Success` with the strongly-typed resource value if the JSON is valid,
|
|
5721
|
+
* `Failure` with an error message otherwise.
|
|
5722
|
+
* @public
|
|
5723
|
+
*/
|
|
5724
|
+
validate(json: JsonValue, completeness: 'full'): Result<T>;
|
|
5725
|
+
/**
|
|
5726
|
+
* Validates a JSON value for use as a partial resource instance value.
|
|
5727
|
+
* @param json - The JSON value to validate.
|
|
5728
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
5729
|
+
* @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
|
|
5730
|
+
* `Failure` with an error message otherwise.
|
|
5731
|
+
* @public
|
|
5732
|
+
*/
|
|
5733
|
+
validate(json: JsonValue, completeness: 'partial'): Result<Partial<T>>;
|
|
5734
|
+
/**
|
|
5735
|
+
* Sets the index for this resource type. Once set, the index cannot be changed.
|
|
5736
|
+
*/
|
|
5737
|
+
setIndex(index: number): Result<ResourceTypeIndex>;
|
|
5738
|
+
/**
|
|
5739
|
+
* Creates a template for a new resource of this type.
|
|
5740
|
+
* The template provides a default structure for creating new resource instances.
|
|
5741
|
+
* @param resourceId - The id for the new resource.
|
|
5742
|
+
* @param init - An optional initial value for the resource.
|
|
5743
|
+
* @param resolver - An optional resource resolver that can be used to create the template.
|
|
5744
|
+
* @param conditions - An optional set of conditions that must be met for the resource to be selected.
|
|
5745
|
+
* @returns A loose resource declaration with default values for this resource type.
|
|
5746
|
+
* @public
|
|
5747
|
+
*/
|
|
5748
|
+
createTemplate(resourceId: ResourceId, init?: JsonValue, conditions?: ResourceJson.Json.ConditionSetDecl, resolver?: IResourceResolver): Result<ResourceJson.Json.ILooseResourceDecl>;
|
|
5749
|
+
}
|
|
5750
|
+
|
|
4909
5751
|
/**
|
|
4910
5752
|
* Configuration for a {@link ResourceTypes.ResourceType | resource type}.
|
|
4911
5753
|
* @public
|
|
4912
5754
|
*/
|
|
4913
|
-
declare interface IResourceTypeConfig {
|
|
5755
|
+
declare interface IResourceTypeConfig<T extends JsonObject = JsonObject> {
|
|
4914
5756
|
name: string;
|
|
4915
5757
|
typeName: string;
|
|
5758
|
+
template?: T;
|
|
4916
5759
|
}
|
|
4917
5760
|
|
|
4918
5761
|
/**
|
|
@@ -4967,6 +5810,33 @@ declare function isResourceTreeLeafInit<T>(init: ResourceTreeNodeInit<T>): init
|
|
|
4967
5810
|
*/
|
|
4968
5811
|
declare function isResourceTreeRootOrNodeInit<T>(init: ResourceTreeNodeInit<T> | IResourceTreeRootInit<T>): init is IResourceTreeBranchInit<T>;
|
|
4969
5812
|
|
|
5813
|
+
/**
|
|
5814
|
+
* Checks if a {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} is a
|
|
5815
|
+
* {@link QualifierTypes.Config.ISystemQualifierTypeConfig | system qualifier type configuration}.
|
|
5816
|
+
* @param config - The {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} to check.
|
|
5817
|
+
* @returns `true` if the configuration is a system qualifier type configuration, `false` otherwise.
|
|
5818
|
+
* @public
|
|
5819
|
+
*/
|
|
5820
|
+
declare function isSystemQualifierTypeConfig(config: IAnyQualifierTypeConfig): config is ISystemQualifierTypeConfig;
|
|
5821
|
+
|
|
5822
|
+
/**
|
|
5823
|
+
* Checks if the given index is a valid candidate value index.
|
|
5824
|
+
*
|
|
5825
|
+
* @param index - The index to validate.
|
|
5826
|
+
* @returns `true` if the index is a valid candidate value index, otherwise `false`.
|
|
5827
|
+
* @public
|
|
5828
|
+
*/
|
|
5829
|
+
declare function isValidCandidateValueIndex(index: number): index is CandidateValueIndex;
|
|
5830
|
+
|
|
5831
|
+
/**
|
|
5832
|
+
* Checks if the given key is a valid candidate value key.
|
|
5833
|
+
*
|
|
5834
|
+
* @param key - The key to validate.
|
|
5835
|
+
* @returns `true` if the key is a valid candidate value key, otherwise `false`.
|
|
5836
|
+
* @public
|
|
5837
|
+
*/
|
|
5838
|
+
declare function isValidCandidateValueKey(key: string): key is CandidateValueKey;
|
|
5839
|
+
|
|
4970
5840
|
/**
|
|
4971
5841
|
* Determines whether a number is a valid condition index.
|
|
4972
5842
|
* @param index - the number to validate
|
|
@@ -5080,6 +5950,15 @@ declare function isValidDecisionIndex(index: number): index is DecisionIndex;
|
|
|
5080
5950
|
*/
|
|
5081
5951
|
declare function isValidDecisionKey(key: string): key is DecisionKey;
|
|
5082
5952
|
|
|
5953
|
+
/**
|
|
5954
|
+
* Determines whether a string is a valid qualifier context value.
|
|
5955
|
+
* For now, any non-empty string is considered a valid context value.
|
|
5956
|
+
* @param value - the string to validate
|
|
5957
|
+
* @returns true if the string is a valid qualifier context value, false otherwise.
|
|
5958
|
+
* @public
|
|
5959
|
+
*/
|
|
5960
|
+
declare function isValidQualifierContextValue(value: string): value is QualifierContextValue;
|
|
5961
|
+
|
|
5083
5962
|
/**
|
|
5084
5963
|
* Determines whether a string is a valid qualifier default values token.
|
|
5085
5964
|
* Qualifier default values tokens are pipe-separated lists of qualifier default value tokens.
|
|
@@ -5195,7 +6074,7 @@ declare interface ISystemConfiguration {
|
|
|
5195
6074
|
/** Optional description explaining the purpose and use case of the configuration. */
|
|
5196
6075
|
description?: string;
|
|
5197
6076
|
/** Qualifier type configurations that define the available qualifier types in the system. */
|
|
5198
|
-
qualifierTypes: QualifierTypes.Config.
|
|
6077
|
+
qualifierTypes: QualifierTypes.Config.IAnyQualifierTypeConfig[];
|
|
5199
6078
|
/** Qualifier declarations that define the available qualifiers in the system. */
|
|
5200
6079
|
qualifiers: Qualifiers.IQualifierDecl[];
|
|
5201
6080
|
/** Resource type configurations that define the available resource types in the system. */
|
|
@@ -5213,6 +6092,8 @@ declare interface ISystemConfigurationInitParams {
|
|
|
5213
6092
|
* Use `null` as the value to remove an existing default value.
|
|
5214
6093
|
*/
|
|
5215
6094
|
qualifierDefaultValues?: Record<string, string | null>;
|
|
6095
|
+
qualifierTypeFactory?: IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, QualifierType>;
|
|
6096
|
+
resourceTypeFactory?: IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType>;
|
|
5216
6097
|
}
|
|
5217
6098
|
|
|
5218
6099
|
/**
|
|
@@ -5245,6 +6126,14 @@ declare interface ISystemTerritoryQualifierTypeConfig extends IQualifierTypeConf
|
|
|
5245
6126
|
systemType: 'territory';
|
|
5246
6127
|
}
|
|
5247
6128
|
|
|
6129
|
+
/**
|
|
6130
|
+
* Validate ZIP file extension
|
|
6131
|
+
* @param filename - Filename to validate
|
|
6132
|
+
* @returns True if filename has .zip extension
|
|
6133
|
+
* @public
|
|
6134
|
+
*/
|
|
6135
|
+
declare function isZipFile(filename: string): boolean;
|
|
6136
|
+
|
|
5248
6137
|
/**
|
|
5249
6138
|
* Configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.
|
|
5250
6139
|
* @public
|
|
@@ -5254,7 +6143,7 @@ declare interface ITerritoryQualifierTypeConfig {
|
|
|
5254
6143
|
acceptLowercase?: boolean;
|
|
5255
6144
|
allowedTerritories?: string[];
|
|
5256
6145
|
/**
|
|
5257
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
6146
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
5258
6147
|
* of territory values to use for matching. If not provided, no hierarchy will be used.
|
|
5259
6148
|
*/
|
|
5260
6149
|
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
@@ -5287,10 +6176,10 @@ declare interface ITerritoryQualifierTypeCreateParams {
|
|
|
5287
6176
|
*/
|
|
5288
6177
|
acceptLowercase?: boolean;
|
|
5289
6178
|
/**
|
|
5290
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
6179
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
5291
6180
|
* of territory values to use for matching. If not provided, no hierarchy will be used.
|
|
5292
6181
|
*/
|
|
5293
|
-
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
6182
|
+
hierarchy?: Config_2.LiteralValueHierarchyDecl<string>;
|
|
5294
6183
|
}
|
|
5295
6184
|
|
|
5296
6185
|
/**
|
|
@@ -5419,8 +6308,113 @@ declare interface IValidatingSimpleContextQualifierProviderCreateParams {
|
|
|
5419
6308
|
}
|
|
5420
6309
|
|
|
5421
6310
|
/**
|
|
5422
|
-
*
|
|
5423
|
-
*
|
|
6311
|
+
* JSON representation of ZIP archive config information
|
|
6312
|
+
* @public
|
|
6313
|
+
*/
|
|
6314
|
+
declare interface IZipArchiveConfigInfo {
|
|
6315
|
+
/** Type of config (always 'file') */
|
|
6316
|
+
type: 'file';
|
|
6317
|
+
/** Original config file path */
|
|
6318
|
+
originalPath: string;
|
|
6319
|
+
/** Path within the archive (e.g., "config.json") */
|
|
6320
|
+
archivePath: string;
|
|
6321
|
+
}
|
|
6322
|
+
|
|
6323
|
+
/**
|
|
6324
|
+
* Options for creating a ZIP archive buffer from a file tree
|
|
6325
|
+
* @public
|
|
6326
|
+
*/
|
|
6327
|
+
declare interface IZipArchiveFileTreeOptions {
|
|
6328
|
+
/** Input file or directory */
|
|
6329
|
+
inputItem?: FileTree.FileTreeItem;
|
|
6330
|
+
/** Optional configuration file */
|
|
6331
|
+
configItem?: FileTree.IFileTreeFileItem;
|
|
6332
|
+
}
|
|
6333
|
+
|
|
6334
|
+
/**
|
|
6335
|
+
* JSON representation of ZIP archive input information
|
|
6336
|
+
* @public
|
|
6337
|
+
*/
|
|
6338
|
+
declare interface IZipArchiveInputInfo {
|
|
6339
|
+
/** Type of input (file or directory) */
|
|
6340
|
+
type: 'file' | 'directory';
|
|
6341
|
+
/** Original file/directory path */
|
|
6342
|
+
originalPath: string;
|
|
6343
|
+
/** Path within the archive (e.g., "input/mydir") */
|
|
6344
|
+
archivePath: string;
|
|
6345
|
+
}
|
|
6346
|
+
|
|
6347
|
+
/**
|
|
6348
|
+
* Options for loading a ZIP archive
|
|
6349
|
+
* @public
|
|
6350
|
+
*/
|
|
6351
|
+
declare interface IZipArchiveLoadOptions {
|
|
6352
|
+
/** Validate manifest strictly */
|
|
6353
|
+
strictManifestValidation?: boolean;
|
|
6354
|
+
}
|
|
6355
|
+
|
|
6356
|
+
/**
|
|
6357
|
+
* Result of ZIP archive loading
|
|
6358
|
+
* @public
|
|
6359
|
+
*/
|
|
6360
|
+
declare interface IZipArchiveLoadResult {
|
|
6361
|
+
/** Parsed archive manifest */
|
|
6362
|
+
manifest: IZipArchiveManifest_2 | undefined;
|
|
6363
|
+
/** Loaded configuration */
|
|
6364
|
+
config: Model.ISystemConfiguration | undefined;
|
|
6365
|
+
/** All files extracted from the archive */
|
|
6366
|
+
files: IImportedFile_2[];
|
|
6367
|
+
/** Directory structure if available */
|
|
6368
|
+
directory: IImportedDirectory_2 | undefined;
|
|
6369
|
+
}
|
|
6370
|
+
|
|
6371
|
+
/**
|
|
6372
|
+
* JSON representation of a ZIP archive manifest
|
|
6373
|
+
* Compatible with existing tools from ts-res-browser-cli
|
|
6374
|
+
* @public
|
|
6375
|
+
*/
|
|
6376
|
+
declare interface IZipArchiveManifest {
|
|
6377
|
+
/** Archive creation timestamp */
|
|
6378
|
+
timestamp: string;
|
|
6379
|
+
/** Optional input source information */
|
|
6380
|
+
input?: IZipArchiveInputInfo;
|
|
6381
|
+
/** Optional configuration file information */
|
|
6382
|
+
config?: IZipArchiveConfigInfo;
|
|
6383
|
+
}
|
|
6384
|
+
|
|
6385
|
+
/**
|
|
6386
|
+
* Standardized ZIP archive manifest format (compatible with existing tools)
|
|
6387
|
+
* @public
|
|
6388
|
+
*/
|
|
6389
|
+
declare type IZipArchiveManifest_2 = Json_2.IZipArchiveManifest;
|
|
6390
|
+
|
|
6391
|
+
/**
|
|
6392
|
+
* Options for creating a ZIP archive buffer
|
|
6393
|
+
* @public
|
|
6394
|
+
*/
|
|
6395
|
+
declare interface IZipArchivePathOptions {
|
|
6396
|
+
/** File or directory path to include in the archive */
|
|
6397
|
+
inputPath?: string;
|
|
6398
|
+
/** Optional configuration file path */
|
|
6399
|
+
configPath?: string;
|
|
6400
|
+
}
|
|
6401
|
+
|
|
6402
|
+
/**
|
|
6403
|
+
* Result of ZIP archive buffer creation
|
|
6404
|
+
* @public
|
|
6405
|
+
*/
|
|
6406
|
+
declare interface IZipArchiveResult {
|
|
6407
|
+
/** Raw ZIP data buffer */
|
|
6408
|
+
zipBuffer: Uint8Array;
|
|
6409
|
+
/** Archive manifest with metadata */
|
|
6410
|
+
manifest: IZipArchiveManifest_2;
|
|
6411
|
+
/** Total ZIP size in bytes */
|
|
6412
|
+
size: number;
|
|
6413
|
+
}
|
|
6414
|
+
|
|
6415
|
+
/**
|
|
6416
|
+
* Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with
|
|
6417
|
+
* to create a new {@link ResourceId | resource ID}. Returns `undefined` if no names are defined.
|
|
5424
6418
|
*
|
|
5425
6419
|
* @param base - The base name or ID to join.
|
|
5426
6420
|
* @param names - Additional names to join.
|
|
@@ -5465,6 +6459,16 @@ declare namespace Json {
|
|
|
5465
6459
|
}
|
|
5466
6460
|
}
|
|
5467
6461
|
|
|
6462
|
+
declare namespace Json_2 {
|
|
6463
|
+
export {
|
|
6464
|
+
IZipArchiveInputInfo,
|
|
6465
|
+
IZipArchiveConfigInfo,
|
|
6466
|
+
IZipArchiveManifest,
|
|
6467
|
+
IImportedFile,
|
|
6468
|
+
IImportedDirectory
|
|
6469
|
+
}
|
|
6470
|
+
}
|
|
6471
|
+
|
|
5468
6472
|
/**
|
|
5469
6473
|
* {@link Import.Importers.IImporter | Importer} implementation which imports resources from a JSON object.
|
|
5470
6474
|
* @public
|
|
@@ -5492,18 +6496,29 @@ declare class JsonImporter implements IImporter {
|
|
|
5492
6496
|
private _tryImportResourceTree;
|
|
5493
6497
|
}
|
|
5494
6498
|
|
|
6499
|
+
/**
|
|
6500
|
+
* A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
6501
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
6502
|
+
* @public
|
|
6503
|
+
*/
|
|
6504
|
+
declare const jsonQualifierTypeConfig: Converter<Model_2.IQualifierTypeConfig<JsonObject>, Converters.IJsonConverterContext>;
|
|
6505
|
+
|
|
5495
6506
|
/**
|
|
5496
6507
|
* Implementation of a {@link ResourceTypes.ResourceType | ResourceType} for JSON values.
|
|
5497
6508
|
* @public
|
|
5498
6509
|
*/
|
|
5499
6510
|
declare class JsonResourceType extends ResourceType<JsonObject> {
|
|
6511
|
+
/**
|
|
6512
|
+
* {@inheritdoc ResourceTypes.ResourceType.systemTypeName}
|
|
6513
|
+
*/
|
|
6514
|
+
readonly systemTypeName: ResourceTypeName;
|
|
5500
6515
|
/**
|
|
5501
6516
|
* Protected {@link ResourceTypes.JsonResourceType | JsonResourceType} constructor for use by subclasses.
|
|
5502
6517
|
* Use {@link ResourceTypes.JsonResourceType.create | JsonResourceType.create} to create a new instance.
|
|
5503
6518
|
* @param key - The key for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
|
|
5504
6519
|
* @param index - Optional index for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
|
|
5505
6520
|
*/
|
|
5506
|
-
protected constructor(key: ResourceTypeName, index?: number);
|
|
6521
|
+
protected constructor(key: ResourceTypeName, index?: number, template?: JsonObject);
|
|
5507
6522
|
/**
|
|
5508
6523
|
* Factory method to create a new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
|
|
5509
6524
|
* @param params - {@link ResourceTypes.IJsonResourceTypeCreateParams | Parameters} to create the new instance.
|
|
@@ -5553,7 +6568,11 @@ declare const LanguagePrioritySystemConfiguration: ISystemConfiguration;
|
|
|
5553
6568
|
* Accepts a list of language tags in the context by default.
|
|
5554
6569
|
* @public
|
|
5555
6570
|
*/
|
|
5556
|
-
declare class LanguageQualifierType extends QualifierType {
|
|
6571
|
+
declare class LanguageQualifierType extends QualifierType<JsonCompatible<Config_2.ILanguageQualifierTypeConfig>> {
|
|
6572
|
+
/**
|
|
6573
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
6574
|
+
*/
|
|
6575
|
+
readonly systemTypeName: QualifierTypeName;
|
|
5557
6576
|
/**
|
|
5558
6577
|
* Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.
|
|
5559
6578
|
* @param name - Optional name for the qualifier type. Defaults to 'language'.
|
|
@@ -5583,6 +6602,27 @@ declare class LanguageQualifierType extends QualifierType {
|
|
|
5583
6602
|
* {@inheritdoc QualifierTypes.IQualifierType.isValidConditionValue}
|
|
5584
6603
|
*/
|
|
5585
6604
|
isValidConditionValue(value: string): value is QualifierConditionValue;
|
|
6605
|
+
/**
|
|
6606
|
+
* Gets a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
|
|
6607
|
+
* for this qualifier type.
|
|
6608
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
6609
|
+
*/
|
|
6610
|
+
getConfiguration(): Result<Config_2.ISystemLanguageQualifierTypeConfig>;
|
|
6611
|
+
/**
|
|
6612
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
6613
|
+
*/
|
|
6614
|
+
getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemLanguageQualifierTypeConfig>>;
|
|
6615
|
+
/**
|
|
6616
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
6617
|
+
*/
|
|
6618
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemLanguageQualifierTypeConfig>>;
|
|
6619
|
+
/**
|
|
6620
|
+
* Validates a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
|
|
6621
|
+
* for this qualifier type.
|
|
6622
|
+
* @param from - The unknown data to validate as a configuration object.
|
|
6623
|
+
* @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
|
|
6624
|
+
*/
|
|
6625
|
+
validateConfiguration(from: unknown): Result<Config_2.ISystemLanguageQualifierTypeConfig>;
|
|
5586
6626
|
/**
|
|
5587
6627
|
* Matches a single language condition against a single language context value using
|
|
5588
6628
|
* {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.
|
|
@@ -5606,7 +6646,11 @@ declare const languageQualifierTypeConfig: ObjectConverter<Model_2.ILanguageQual
|
|
|
5606
6646
|
* optionally case-sensitive or matching against an ordered list of values at runtime.
|
|
5607
6647
|
* @public
|
|
5608
6648
|
*/
|
|
5609
|
-
declare class LiteralQualifierType extends QualifierType {
|
|
6649
|
+
declare class LiteralQualifierType extends QualifierType<JsonCompatible<Config_2.ILiteralQualifierTypeConfig>> {
|
|
6650
|
+
/**
|
|
6651
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
6652
|
+
*/
|
|
6653
|
+
readonly systemTypeName: QualifierTypeName;
|
|
5610
6654
|
/**
|
|
5611
6655
|
* Indicates whether the qualifier match is case-sensitive.
|
|
5612
6656
|
*/
|
|
@@ -5642,6 +6686,27 @@ declare class LiteralQualifierType extends QualifierType {
|
|
|
5642
6686
|
* {@inheritdoc QualifierTypes.IQualifierType.isPotentialMatch}
|
|
5643
6687
|
*/
|
|
5644
6688
|
isPotentialMatch(conditionValue: string, contextValue: string): boolean;
|
|
6689
|
+
/**
|
|
6690
|
+
* Gets a {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | strongly typed configuration object}
|
|
6691
|
+
* for this qualifier type.
|
|
6692
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
6693
|
+
*/
|
|
6694
|
+
getConfiguration(): Result<Config_2.ISystemLiteralQualifierTypeConfig>;
|
|
6695
|
+
/**
|
|
6696
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
6697
|
+
*/
|
|
6698
|
+
getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemLiteralQualifierTypeConfig>>;
|
|
6699
|
+
/**
|
|
6700
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
6701
|
+
*/
|
|
6702
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemLiteralQualifierTypeConfig>>;
|
|
6703
|
+
/**
|
|
6704
|
+
* Validates a {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | strongly typed configuration object}
|
|
6705
|
+
* for this qualifier type.
|
|
6706
|
+
* @param from - The unknown data to validate as a configuration object.
|
|
6707
|
+
* @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
|
|
6708
|
+
*/
|
|
6709
|
+
validateConfiguration(from: unknown): Result<Config_2.ISystemLiteralQualifierTypeConfig>;
|
|
5645
6710
|
/**
|
|
5646
6711
|
* {@inheritdoc QualifierTypes.QualifierType._matchOne}
|
|
5647
6712
|
*/
|
|
@@ -5771,6 +6836,11 @@ declare class LiteralValueHierarchy<T extends string = string> {
|
|
|
5771
6836
|
*/
|
|
5772
6837
|
match(condition: QualifierConditionValue, context: QualifierContextValue, __operator?: ConditionOperator): QualifierMatchScore;
|
|
5773
6838
|
protected static _buildValuesFromHierarchy<T extends string>(params: ILiteralValueHierarchyCreateParams<T>): Result<ReadonlyMap<T, ILiteralValue<T>>>;
|
|
6839
|
+
/**
|
|
6840
|
+
* Converts the hierarchy to a record of parent-child relationships.
|
|
6841
|
+
* @returns A record of parent-child relationships.
|
|
6842
|
+
*/
|
|
6843
|
+
asRecord(): Record<string, string>;
|
|
5774
6844
|
}
|
|
5775
6845
|
|
|
5776
6846
|
/**
|
|
@@ -5790,7 +6860,7 @@ declare function literalValueHierarchyCreateParams<T extends string>(valueConver
|
|
|
5790
6860
|
* determine the relationship between values when matching conditions and contexts.
|
|
5791
6861
|
* @public
|
|
5792
6862
|
*/
|
|
5793
|
-
declare type LiteralValueHierarchyDecl<T extends string> =
|
|
6863
|
+
declare type LiteralValueHierarchyDecl<T extends string> = Record<T, T>;
|
|
5794
6864
|
|
|
5795
6865
|
/**
|
|
5796
6866
|
* `Converter` for a normalized {@link ResourceJson.Json.ILooseConditionDecl | loose condition declaration}.
|
|
@@ -5933,6 +7003,12 @@ declare function mergeLooseCandidate(candidate: Normalized.IImporterResourceCand
|
|
|
5933
7003
|
*/
|
|
5934
7004
|
declare function mergeLooseResource(resource: Normalized.IImporterResourceDecl, baseName?: string, baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>): Result<Normalized.ILooseResourceDecl>;
|
|
5935
7005
|
|
|
7006
|
+
/**
|
|
7007
|
+
* Validator for MIME type strings
|
|
7008
|
+
* @public
|
|
7009
|
+
*/
|
|
7010
|
+
declare const mimeType: Validator<string>;
|
|
7011
|
+
|
|
5936
7012
|
/**
|
|
5937
7013
|
* Minimum valid priority for a condition.
|
|
5938
7014
|
* @public
|
|
@@ -5947,14 +7023,17 @@ declare namespace Model {
|
|
|
5947
7023
|
|
|
5948
7024
|
declare namespace Model_2 {
|
|
5949
7025
|
export {
|
|
7026
|
+
isSystemQualifierTypeConfig,
|
|
5950
7027
|
IQualifierTypeConfig,
|
|
5951
7028
|
ILanguageQualifierTypeConfig,
|
|
7029
|
+
LiteralValueHierarchyDecl,
|
|
5952
7030
|
ITerritoryQualifierTypeConfig,
|
|
5953
7031
|
ILiteralQualifierTypeConfig,
|
|
5954
7032
|
ISystemLanguageQualifierTypeConfig,
|
|
5955
7033
|
ISystemTerritoryQualifierTypeConfig,
|
|
5956
7034
|
ISystemLiteralQualifierTypeConfig,
|
|
5957
|
-
ISystemQualifierTypeConfig
|
|
7035
|
+
ISystemQualifierTypeConfig,
|
|
7036
|
+
IAnyQualifierTypeConfig
|
|
5958
7037
|
}
|
|
5959
7038
|
}
|
|
5960
7039
|
|
|
@@ -5975,6 +7054,48 @@ declare namespace Model_3 {
|
|
|
5975
7054
|
}
|
|
5976
7055
|
}
|
|
5977
7056
|
|
|
7057
|
+
declare namespace Model_4 {
|
|
7058
|
+
export {
|
|
7059
|
+
IBundleMetadata,
|
|
7060
|
+
IBundleExportMetadata,
|
|
7061
|
+
IBundle,
|
|
7062
|
+
IBundleCreateParams
|
|
7063
|
+
}
|
|
7064
|
+
}
|
|
7065
|
+
|
|
7066
|
+
/**
|
|
7067
|
+
* A validator for mutable context qualifier providers that accepts string inputs
|
|
7068
|
+
* and converts them to strongly-typed values before calling the wrapped provider.
|
|
7069
|
+
* Provides both read and mutation operations.
|
|
7070
|
+
* @public
|
|
7071
|
+
*/
|
|
7072
|
+
declare class MutableContextQualifierProviderValidator<T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider> extends BaseContextQualifierProviderValidator<T> implements IMutableContextQualifierProviderValidator<T> {
|
|
7073
|
+
/**
|
|
7074
|
+
* The wrapped mutable context qualifier provider.
|
|
7075
|
+
*/
|
|
7076
|
+
readonly provider: T;
|
|
7077
|
+
/**
|
|
7078
|
+
* Constructs a new {@link Runtime.Context.MutableContextQualifierProviderValidator | MutableContextQualifierProviderValidator}.
|
|
7079
|
+
* @param params - Required parameters for constructing the validator.
|
|
7080
|
+
*/
|
|
7081
|
+
constructor(params: IMutableContextQualifierProviderValidatorCreateParams<T>);
|
|
7082
|
+
/**
|
|
7083
|
+
* Sets a qualifier value using string inputs, converting to strongly-typed values.
|
|
7084
|
+
* @param name - The string name to convert.
|
|
7085
|
+
* @param value - The string value to convert.
|
|
7086
|
+
* @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
|
|
7087
|
+
* or `Failure` with an error message if an error occurs.
|
|
7088
|
+
*/
|
|
7089
|
+
set(name: string, value: string): Result<QualifierContextValue>;
|
|
7090
|
+
/**
|
|
7091
|
+
* Removes a qualifier value using string input, converting to strongly-typed QualifierName.
|
|
7092
|
+
* @param name - The string name to convert.
|
|
7093
|
+
* @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
|
|
7094
|
+
* or `Failure` with an error message if an error occurs.
|
|
7095
|
+
*/
|
|
7096
|
+
remove(name: string): Result<QualifierContextValue>;
|
|
7097
|
+
}
|
|
7098
|
+
|
|
5978
7099
|
/**
|
|
5979
7100
|
* {@link QualifierMatchScore | Match score} indicating no match.
|
|
5980
7101
|
* @public
|
|
@@ -6025,6 +7146,14 @@ declare namespace Normalized {
|
|
|
6025
7146
|
}
|
|
6026
7147
|
}
|
|
6027
7148
|
|
|
7149
|
+
/**
|
|
7150
|
+
* Normalize path separators for cross-platform compatibility
|
|
7151
|
+
* @param path - Path to normalize
|
|
7152
|
+
* @returns Normalized path
|
|
7153
|
+
* @public
|
|
7154
|
+
*/
|
|
7155
|
+
declare function normalizePath(path: string): string;
|
|
7156
|
+
|
|
6028
7157
|
/**
|
|
6029
7158
|
* Overall cache metrics across all cache types.
|
|
6030
7159
|
* @public
|
|
@@ -6079,6 +7208,22 @@ declare function parseQualifierDefaultValuesTokenParts(token: string): Result<IQ
|
|
|
6079
7208
|
*/
|
|
6080
7209
|
declare function parseQualifierDefaultValueTokenParts(token: string): Result<IQualifierDefaultValueTokenParts>;
|
|
6081
7210
|
|
|
7211
|
+
/**
|
|
7212
|
+
* Parse and validate configuration JSON
|
|
7213
|
+
* @param configData - JSON string containing configuration
|
|
7214
|
+
* @returns Result containing validated configuration
|
|
7215
|
+
* @public
|
|
7216
|
+
*/
|
|
7217
|
+
declare function parseZipArchiveConfiguration(configData: string): Result<Model.ISystemConfiguration>;
|
|
7218
|
+
|
|
7219
|
+
/**
|
|
7220
|
+
* Parse and validate a ZIP archive manifest
|
|
7221
|
+
* @param manifestData - JSON string containing manifest data
|
|
7222
|
+
* @returns Result containing validated manifest
|
|
7223
|
+
* @public
|
|
7224
|
+
*/
|
|
7225
|
+
declare function parseZipArchiveManifest(manifestData: string): Result<Json_2.IZipArchiveManifest>;
|
|
7226
|
+
|
|
6082
7227
|
/**
|
|
6083
7228
|
* {@link Import.Importers.IImporter | Importer} implementation which imports resources from a `FileTree`
|
|
6084
7229
|
* given a path.
|
|
@@ -6306,6 +7451,12 @@ export declare type QualifierConditionValue = Brand<string, 'QualifierConditionV
|
|
|
6306
7451
|
*/
|
|
6307
7452
|
export declare type QualifierContextValue = Brand<string, 'QualifierContextValue'>;
|
|
6308
7453
|
|
|
7454
|
+
/**
|
|
7455
|
+
* `Converter` which validates an `unknown` value as a {@link QualifierContextValue | QualifierContextValue}.
|
|
7456
|
+
* @public
|
|
7457
|
+
*/
|
|
7458
|
+
declare const qualifierContextValue: Converter<QualifierContextValue, unknown>;
|
|
7459
|
+
|
|
6309
7460
|
/**
|
|
6310
7461
|
* Converter for a {@link Qualifiers.IQualifierDecl | qualifier declaration}.
|
|
6311
7462
|
* @public
|
|
@@ -6509,11 +7660,15 @@ export { Qualifiers }
|
|
|
6509
7660
|
* the {@link QualifierTypes.IQualifierType | IQualifierType} interface.
|
|
6510
7661
|
* @public
|
|
6511
7662
|
*/
|
|
6512
|
-
export declare abstract class QualifierType implements IQualifierType {
|
|
7663
|
+
export declare abstract class QualifierType<TCFGJSON extends JsonObject = JsonObject> implements IQualifierType<TCFGJSON> {
|
|
6513
7664
|
/**
|
|
6514
7665
|
* {@inheritdoc QualifierTypes.IQualifierType.name}
|
|
6515
7666
|
*/
|
|
6516
7667
|
readonly name: QualifierTypeName;
|
|
7668
|
+
/**
|
|
7669
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
7670
|
+
*/
|
|
7671
|
+
abstract readonly systemTypeName: QualifierTypeName;
|
|
6517
7672
|
/**
|
|
6518
7673
|
* {@inheritdoc QualifierTypes.IQualifierType.key}
|
|
6519
7674
|
*/
|
|
@@ -6559,6 +7714,14 @@ export declare abstract class QualifierType implements IQualifierType {
|
|
|
6559
7714
|
* {@inheritdoc QualifierTypes.IQualifierType.matches}
|
|
6560
7715
|
*/
|
|
6561
7716
|
matches(condition: QualifierConditionValue, context: QualifierContextValue, operator: ConditionOperator): QualifierMatchScore;
|
|
7717
|
+
/**
|
|
7718
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
7719
|
+
*/
|
|
7720
|
+
abstract getConfigurationJson(): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
|
|
7721
|
+
/**
|
|
7722
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
7723
|
+
*/
|
|
7724
|
+
abstract validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
|
|
6562
7725
|
/**
|
|
6563
7726
|
* {@inheritdoc QualifierTypes.IQualifierType.setIndex}
|
|
6564
7727
|
*/
|
|
@@ -6614,7 +7777,7 @@ export declare abstract class QualifierType implements IQualifierType {
|
|
|
6614
7777
|
* index from a supplied {@link QualifierTypes.Convert.IQualifierTypeConvertContext | conversion context}.
|
|
6615
7778
|
* @public
|
|
6616
7779
|
*/
|
|
6617
|
-
declare const qualifierType: Converter<QualifierType
|
|
7780
|
+
declare const qualifierType: Converter<QualifierType<JsonObject>, IQualifierTypeConvertContext>;
|
|
6618
7781
|
|
|
6619
7782
|
/**
|
|
6620
7783
|
* Collector for {@link QualifierTypes.QualifierType | QualifierType} objects.
|
|
@@ -6638,6 +7801,74 @@ declare class QualifierTypeCollector extends ValidatingConvertingCollector<Quali
|
|
|
6638
7801
|
protected static _toQualifierType(from: unknown): Result<QualifierType>;
|
|
6639
7802
|
}
|
|
6640
7803
|
|
|
7804
|
+
/**
|
|
7805
|
+
* A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
7806
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
7807
|
+
* @param config - A `Converter` for the configuration object.
|
|
7808
|
+
* @public
|
|
7809
|
+
*/
|
|
7810
|
+
declare function qualifierTypeConfig<T, TD = unknown>(config: Converter<T, TD>): Converter<Model_2.IQualifierTypeConfig<T>, TD>;
|
|
7811
|
+
|
|
7812
|
+
/**
|
|
7813
|
+
* A factory that creates {@link QualifierTypes.QualifierType | QualifierType} instances from configuration,
|
|
7814
|
+
* supporting both built-in system types and custom external types.
|
|
7815
|
+
*
|
|
7816
|
+
* This factory allows external consumers to extend the qualifier type system with their own custom types
|
|
7817
|
+
* while maintaining support for all built-in types (Language, Territory, Literal).
|
|
7818
|
+
*
|
|
7819
|
+
* @typeParam T - The custom qualifier type(s) to support. Defaults to {@link QualifierTypes.SystemQualifierType | SystemQualifierType}.
|
|
7820
|
+
*
|
|
7821
|
+
* @example Creating a factory with custom qualifier types
|
|
7822
|
+
* ```typescript
|
|
7823
|
+
* // Define a custom qualifier type
|
|
7824
|
+
* class CustomQualifierType extends QualifierType {
|
|
7825
|
+
* // ... implementation
|
|
7826
|
+
* }
|
|
7827
|
+
*
|
|
7828
|
+
* // Define a discriminated union of all types
|
|
7829
|
+
* type AppQualifierType = SystemQualifierType | CustomQualifierType;
|
|
7830
|
+
*
|
|
7831
|
+
* // Create a factory that handles custom types
|
|
7832
|
+
* const customFactory: IConfigInitFactory<IAnyQualifierTypeConfig, CustomQualifierType> = {
|
|
7833
|
+
* create(config) {
|
|
7834
|
+
* // ... handle custom type creation
|
|
7835
|
+
* }
|
|
7836
|
+
* };
|
|
7837
|
+
*
|
|
7838
|
+
* // Create the combined factory
|
|
7839
|
+
* const qualifierTypeFactory = new QualifierTypeFactory<AppQualifierType>([customFactory]);
|
|
7840
|
+
*
|
|
7841
|
+
* // The factory returns T | SystemQualifierType, supporting all types
|
|
7842
|
+
* const result = qualifierTypeFactory.create(config); // Result<AppQualifierType | SystemQualifierType>
|
|
7843
|
+
* ```
|
|
7844
|
+
*
|
|
7845
|
+
* @remarks
|
|
7846
|
+
* - The factory chains custom factories with the built-in factory
|
|
7847
|
+
* - Custom factories are tried first, falling back to built-in types
|
|
7848
|
+
* - The return type is a union of custom types (T) and system types
|
|
7849
|
+
*
|
|
7850
|
+
* @public
|
|
7851
|
+
*/
|
|
7852
|
+
declare class QualifierTypeFactory<T extends QualifierType = SystemQualifierType> extends ChainedConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T | SystemQualifierType> {
|
|
7853
|
+
/**
|
|
7854
|
+
* Constructor for a {@link Config.QualifierTypeFactory | qualifier type factory}.
|
|
7855
|
+
* @param factories - Array of factories for custom qualifier types. Can be:
|
|
7856
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
7857
|
+
* - {@link Config.QualifierTypeFactoryFunction | Factory functions}
|
|
7858
|
+
* - A mix of both
|
|
7859
|
+
* These are tried in order before falling back to built-in types.
|
|
7860
|
+
* @remarks The {@link Config.BuiltInQualifierTypeFactory | built-in factory} is always appended to handle
|
|
7861
|
+
* system qualifier types (Language, Territory, Literal).
|
|
7862
|
+
*/
|
|
7863
|
+
constructor(factories: Array<IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T> | QualifierTypeFactoryFunction<T>>);
|
|
7864
|
+
}
|
|
7865
|
+
|
|
7866
|
+
/**
|
|
7867
|
+
* Function signature for creating a qualifier type from configuration.
|
|
7868
|
+
* @public
|
|
7869
|
+
*/
|
|
7870
|
+
declare type QualifierTypeFactoryFunction<T extends QualifierType = QualifierType> = (config: QualifierTypes.Config.IAnyQualifierTypeConfig) => Result<T>;
|
|
7871
|
+
|
|
6641
7872
|
/**
|
|
6642
7873
|
* Branded number representing a validated qualifier type index.
|
|
6643
7874
|
* @public
|
|
@@ -6673,7 +7904,6 @@ declare namespace QualifierTypes {
|
|
|
6673
7904
|
LanguageQualifierType,
|
|
6674
7905
|
ILiteralQualifierTypeCreateParams,
|
|
6675
7906
|
LiteralQualifierType,
|
|
6676
|
-
LiteralValueHierarchyDecl,
|
|
6677
7907
|
ILiteralValue,
|
|
6678
7908
|
ILiteralValueHierarchyCreateParams,
|
|
6679
7909
|
LiteralValueHierarchy,
|
|
@@ -6683,7 +7913,8 @@ declare namespace QualifierTypes {
|
|
|
6683
7913
|
QualifierTypeCollector,
|
|
6684
7914
|
ReadOnlyQualifierTypeCollector,
|
|
6685
7915
|
createQualifierTypeFromConfig,
|
|
6686
|
-
createQualifierTypeFromSystemConfig
|
|
7916
|
+
createQualifierTypeFromSystemConfig,
|
|
7917
|
+
SystemQualifierType
|
|
6687
7918
|
}
|
|
6688
7919
|
}
|
|
6689
7920
|
export { QualifierTypes }
|
|
@@ -6706,6 +7937,24 @@ declare type ReadOnlyConditionCollector = Collections.IReadOnlyValidatingCollect
|
|
|
6706
7937
|
*/
|
|
6707
7938
|
declare type ReadOnlyConditionSetCollector = Collections.IReadOnlyValidatingCollector<ConditionSet>;
|
|
6708
7939
|
|
|
7940
|
+
/**
|
|
7941
|
+
* A validator for read-only context qualifier providers that accepts string inputs
|
|
7942
|
+
* and converts them to strongly-typed values before calling the wrapped provider.
|
|
7943
|
+
* Only provides read operations for compile-time type safety.
|
|
7944
|
+
* @public
|
|
7945
|
+
*/
|
|
7946
|
+
declare class ReadOnlyContextQualifierProviderValidator<T extends IReadOnlyContextQualifierProvider = IReadOnlyContextQualifierProvider> extends BaseContextQualifierProviderValidator<T> implements IReadOnlyContextQualifierProviderValidator<T> {
|
|
7947
|
+
/**
|
|
7948
|
+
* The wrapped read-only context qualifier provider.
|
|
7949
|
+
*/
|
|
7950
|
+
readonly provider: T;
|
|
7951
|
+
/**
|
|
7952
|
+
* Constructs a new {@link Runtime.Context.ReadOnlyContextQualifierProviderValidator | ReadOnlyContextQualifierProviderValidator}.
|
|
7953
|
+
* @param params - Required parameters for constructing the validator.
|
|
7954
|
+
*/
|
|
7955
|
+
constructor(params: IReadOnlyContextQualifierProviderValidatorCreateParams<T>);
|
|
7956
|
+
}
|
|
7957
|
+
|
|
6709
7958
|
/**
|
|
6710
7959
|
* Interface exposing non-mutating members of a
|
|
6711
7960
|
* {@link QualifierTypes.QualifierTypeCollector | QualifierTypeCollector}.
|
|
@@ -6851,6 +8100,7 @@ declare namespace RegularExpressions {
|
|
|
6851
8100
|
contextToken_2 as contextToken,
|
|
6852
8101
|
conditionSetHash_2 as conditionSetHash,
|
|
6853
8102
|
decisionKey_2 as decisionKey,
|
|
8103
|
+
candidateValueKey_2 as candidateValueKey,
|
|
6854
8104
|
qualifierDefaultValueToken_2 as qualifierDefaultValueToken,
|
|
6855
8105
|
qualifierDefaultValuesToken_2 as qualifierDefaultValuesToken,
|
|
6856
8106
|
territoryCode
|
|
@@ -6867,10 +8117,14 @@ export declare class Resource implements IResource {
|
|
|
6867
8117
|
* The unique {@link ResourceId | id} of the resource.
|
|
6868
8118
|
*/
|
|
6869
8119
|
readonly id: ResourceId;
|
|
8120
|
+
/**
|
|
8121
|
+
* The name of the resource.
|
|
8122
|
+
*/
|
|
8123
|
+
readonly name: ResourceName;
|
|
6870
8124
|
/**
|
|
6871
8125
|
* The {@link ResourceTypes.ResourceType | type} of the resource.
|
|
6872
8126
|
*/
|
|
6873
|
-
readonly
|
|
8127
|
+
readonly resourceType: ResourceType;
|
|
6874
8128
|
/**
|
|
6875
8129
|
* The array of {@link Resources.ResourceCandidate | candidates} for the resource.
|
|
6876
8130
|
*/
|
|
@@ -6879,10 +8133,6 @@ export declare class Resource implements IResource {
|
|
|
6879
8133
|
* {@link Decisions.ConcreteDecision | Decision} for optimized resource resolution.
|
|
6880
8134
|
*/
|
|
6881
8135
|
readonly decision: ConcreteDecision;
|
|
6882
|
-
/**
|
|
6883
|
-
* Gets the resource type (implements IResource interface).
|
|
6884
|
-
*/
|
|
6885
|
-
get resourceType(): ResourceType;
|
|
6886
8136
|
/**
|
|
6887
8137
|
* Gets the resource type name as a string.
|
|
6888
8138
|
*/
|
|
@@ -7007,6 +8257,10 @@ declare class ResourceBuilder {
|
|
|
7007
8257
|
* Collector for {@link Decisions.AbstractDecision | abstract decisions}.
|
|
7008
8258
|
*/
|
|
7009
8259
|
protected _decisions: AbstractDecisionCollector;
|
|
8260
|
+
/**
|
|
8261
|
+
* Collector for candidate values.
|
|
8262
|
+
*/
|
|
8263
|
+
protected _candidateValues: CandidateValueCollector;
|
|
7010
8264
|
/**
|
|
7011
8265
|
* Constructor for a {@link Resources.ResourceBuilder | ResourceBuilder} object.
|
|
7012
8266
|
* @param params - Parameters to construct the new {@link Resources.ResourceBuilder | ResourceBuilder}.
|
|
@@ -7084,10 +8338,16 @@ export declare class ResourceCandidate implements IResourceCandidate {
|
|
|
7084
8338
|
* is a possible instance.
|
|
7085
8339
|
*/
|
|
7086
8340
|
readonly id: ResourceId;
|
|
8341
|
+
/**
|
|
8342
|
+
* The candidate value that contains the JSON representation of the instance data.
|
|
8343
|
+
*/
|
|
8344
|
+
readonly candidateValue: CandidateValue;
|
|
7087
8345
|
/**
|
|
7088
8346
|
* The JSON representation of the instance data to be applied.
|
|
8347
|
+
* @remarks
|
|
8348
|
+
* This property provides access to the JSON data from the underlying candidate value.
|
|
7089
8349
|
*/
|
|
7090
|
-
|
|
8350
|
+
get json(): JsonObject;
|
|
7091
8351
|
/**
|
|
7092
8352
|
* The conditions under which this candidate applies.
|
|
7093
8353
|
*/
|
|
@@ -7105,6 +8365,10 @@ export declare class ResourceCandidate implements IResourceCandidate {
|
|
|
7105
8365
|
* this candidate belongs.
|
|
7106
8366
|
*/
|
|
7107
8367
|
readonly resourceType: ResourceType | undefined;
|
|
8368
|
+
/**
|
|
8369
|
+
* The completeness of the candidate value.
|
|
8370
|
+
*/
|
|
8371
|
+
get completeness(): CandidateCompleteness;
|
|
7108
8372
|
/**
|
|
7109
8373
|
* Constructor for a {@link Resources.ResourceCandidate | ResourceCandidate} object.
|
|
7110
8374
|
* @param params - Parameters to create a new {@link Resources.ResourceCandidate | ResourceCandidate}.
|
|
@@ -7277,6 +8541,17 @@ declare class ResourceDeclTree implements IResourceDeclContainer {
|
|
|
7277
8541
|
private _extract;
|
|
7278
8542
|
}
|
|
7279
8543
|
|
|
8544
|
+
/**
|
|
8545
|
+
* Type for handling resource resolution errors during tree traversal.
|
|
8546
|
+
* The handler receives the resource that failed to resolve, the error message, and the resolver for recovery attempts.
|
|
8547
|
+
* It can return:
|
|
8548
|
+
* - Success(undefined) to omit the property from the result
|
|
8549
|
+
* - Success(value) to use an alternate value
|
|
8550
|
+
* - Failure to propagate the error
|
|
8551
|
+
* @public
|
|
8552
|
+
*/
|
|
8553
|
+
declare type ResourceErrorHandler = (resource: IResource, message: string, resolver: ResourceResolver) => Result<JsonValue | undefined>;
|
|
8554
|
+
|
|
7280
8555
|
/**
|
|
7281
8556
|
* Branded string representing a validated resource id. A resource ID
|
|
7282
8557
|
* is a dot-separated sequence of resource names.
|
|
@@ -7305,7 +8580,7 @@ declare const resourceIndex: Converter<ResourceIndex, unknown>;
|
|
|
7305
8580
|
declare namespace ResourceJson {
|
|
7306
8581
|
export {
|
|
7307
8582
|
Compiled,
|
|
7308
|
-
|
|
8583
|
+
Convert_7 as Convert,
|
|
7309
8584
|
Helpers_2 as Helpers,
|
|
7310
8585
|
Json,
|
|
7311
8586
|
Normalized,
|
|
@@ -7323,21 +8598,69 @@ export { ResourceJson }
|
|
|
7323
8598
|
* and builds a collection of {@link Resources.Resource | resources} once all candidates are collected.
|
|
7324
8599
|
* @public
|
|
7325
8600
|
*/
|
|
7326
|
-
export declare class ResourceManagerBuilder implements IResourceManager {
|
|
8601
|
+
export declare class ResourceManagerBuilder implements IResourceManager<Resource> {
|
|
8602
|
+
/**
|
|
8603
|
+
* The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used by this resource manager.
|
|
8604
|
+
*/
|
|
7327
8605
|
readonly qualifiers: IReadOnlyQualifierCollector;
|
|
8606
|
+
/**
|
|
8607
|
+
* The {@link ResourceTypes.ReadOnlyResourceTypeCollector | resource types} used by this resource manager.
|
|
8608
|
+
*/
|
|
7328
8609
|
readonly resourceTypes: ReadOnlyResourceTypeCollector;
|
|
8610
|
+
/**
|
|
8611
|
+
* The {@link Conditions.ConditionCollector | condition collector} used by this resource manager.
|
|
8612
|
+
* @internal
|
|
8613
|
+
*/
|
|
7329
8614
|
protected readonly _conditions: ConditionCollector;
|
|
8615
|
+
/**
|
|
8616
|
+
* The {@link Conditions.ConditionSetCollector | condition set collector} used by this resource manager.
|
|
8617
|
+
* @internal
|
|
8618
|
+
*/
|
|
7330
8619
|
protected readonly _conditionSets: ConditionSetCollector;
|
|
8620
|
+
/**
|
|
8621
|
+
* The {@link Decisions.AbstractDecisionCollector | abstract decision collector} used by this resource manager.
|
|
8622
|
+
* @internal
|
|
8623
|
+
*/
|
|
7331
8624
|
protected readonly _decisions: AbstractDecisionCollector;
|
|
8625
|
+
/**
|
|
8626
|
+
* The candidate value collector used by this resource manager.
|
|
8627
|
+
* @internal
|
|
8628
|
+
*/
|
|
8629
|
+
protected readonly _candidateValues: CandidateValueCollector;
|
|
8630
|
+
/**
|
|
8631
|
+
* The {@link Resources.ResourceBuilder | resource builders} used by this resource manager.
|
|
8632
|
+
* @internal
|
|
8633
|
+
*/
|
|
7332
8634
|
protected readonly _resources: ValidatingResultMap<ResourceId, ResourceBuilder>;
|
|
7333
|
-
|
|
8635
|
+
/**
|
|
8636
|
+
* The {@link Resources.Resource | resources} built by this resource manager.
|
|
8637
|
+
* @internal
|
|
8638
|
+
*/
|
|
8639
|
+
protected readonly _builtResources: ValidatingResultMap<ResourceId, Resource>;
|
|
8640
|
+
/**
|
|
8641
|
+
* Whether the resources have been built.
|
|
8642
|
+
* @internal
|
|
8643
|
+
*/
|
|
7334
8644
|
protected _built: boolean;
|
|
8645
|
+
/**
|
|
8646
|
+
* The cached resource tree for this resource manager.
|
|
8647
|
+
* @internal
|
|
8648
|
+
*/
|
|
8649
|
+
protected _cachedResourceTree?: ResourceTree.IReadOnlyResourceTreeRoot<Resource>;
|
|
8650
|
+
/**
|
|
8651
|
+
* The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier types} used by this resource manager.
|
|
8652
|
+
*/
|
|
8653
|
+
get qualifierTypes(): ReadOnlyQualifierTypeCollector;
|
|
7335
8654
|
/**
|
|
7336
8655
|
* A {@link Conditions.ConditionCollector | ConditionCollector} which
|
|
7337
8656
|
* contains the {@link Conditions.Condition | conditions} used so far by
|
|
7338
8657
|
* the {@link Resources.ResourceCandidate | resource candidates} in this manager.
|
|
7339
8658
|
*/
|
|
7340
8659
|
get conditions(): ReadOnlyConditionCollector;
|
|
8660
|
+
/**
|
|
8661
|
+
* The resource IDs that this resource manager can resolve.
|
|
8662
|
+
*/
|
|
8663
|
+
get resourceIds(): ReadonlyArray<ResourceId>;
|
|
7341
8664
|
/**
|
|
7342
8665
|
* A {@link Conditions.ConditionSetCollector | ConditionSetCollector} which
|
|
7343
8666
|
* contains the {@link Conditions.ConditionSet | condition sets} used so far by
|
|
@@ -7397,6 +8720,17 @@ export declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
7397
8720
|
* @public
|
|
7398
8721
|
*/
|
|
7399
8722
|
static createPredefined(name: Config.PredefinedSystemConfiguration, qualifierDefaultValues?: Config.ISystemConfigurationInitParams['qualifierDefaultValues']): Result<ResourceManagerBuilder>;
|
|
8723
|
+
/**
|
|
8724
|
+
* Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} from a
|
|
8725
|
+
* {@link ResourceJson.Compiled.ICompiledResourceCollection | compiled resource collection}.
|
|
8726
|
+
* This method reconstructs an exactly equivalent builder where all qualifier, condition,
|
|
8727
|
+
* condition set, and decision indices match the original compiled collection.
|
|
8728
|
+
* @param compiledCollection - The compiled resource collection to reconstruct from.
|
|
8729
|
+
* @param systemConfig - The system configuration containing qualifiers and resource types.
|
|
8730
|
+
* @returns `Success` with the new manager if successful, or `Failure` with an error message if not.
|
|
8731
|
+
* @public
|
|
8732
|
+
*/
|
|
8733
|
+
static createFromCompiledResourceCollection(compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection, systemConfig: Config.SystemConfiguration): Result<ResourceManagerBuilder>;
|
|
7400
8734
|
/**
|
|
7401
8735
|
* Given a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration}, builds and adds
|
|
7402
8736
|
* a {@link Resources.ResourceCandidate | candidate} to the manager.
|
|
@@ -7450,6 +8784,19 @@ export declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
7450
8784
|
* @public
|
|
7451
8785
|
*/
|
|
7452
8786
|
getAllBuiltResources(): Result<ReadonlyArray<Resource>>;
|
|
8787
|
+
/**
|
|
8788
|
+
* Builds and returns a hierarchical tree representation of all resources managed by this builder.
|
|
8789
|
+
* Resources are organized based on their dot-separated resource IDs (e.g., "app.messages.welcome"
|
|
8790
|
+
* becomes a tree with "app" as root, "messages" as branch, and "welcome" as leaf).
|
|
8791
|
+
*
|
|
8792
|
+
* String-based validation is available through the `children.validating` property,
|
|
8793
|
+
* allowing callers to use `tree.children.validating.getById(stringId)` for validated access.
|
|
8794
|
+
*
|
|
8795
|
+
* Uses lazy initialization with caching for performance.
|
|
8796
|
+
* @returns Result containing the resource tree root, or failure if tree construction fails
|
|
8797
|
+
* @public
|
|
8798
|
+
*/
|
|
8799
|
+
getBuiltResourceTree(): Result<ResourceTree.IReadOnlyResourceTreeRoot<Resource>>;
|
|
7453
8800
|
/**
|
|
7454
8801
|
* Gets a read-only array of all {@link Resources.Resource | built resources} in the manager.
|
|
7455
8802
|
* @returns `Success` with an array of resources if successful, or `Failure` with an error message if not.
|
|
@@ -7523,12 +8870,17 @@ export declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
7523
8870
|
*/
|
|
7524
8871
|
getResourceCollectionDecl(options?: IResourceDeclarationOptions): Result<ResourceJson.Normalized.IResourceCollectionDecl>;
|
|
7525
8872
|
/**
|
|
7526
|
-
* Creates a
|
|
7527
|
-
* This
|
|
7528
|
-
*
|
|
7529
|
-
*
|
|
7530
|
-
*
|
|
7531
|
-
* @
|
|
8873
|
+
* Creates a clone of this ResourceManagerBuilder with optional configuration overrides.
|
|
8874
|
+
* This method creates a new ResourceManagerBuilder that can optionally use different
|
|
8875
|
+
* qualifiers and/or resource types than the original. It can also be filtered to include
|
|
8876
|
+
* only candidates that match the provided context and apply candidate edits.
|
|
8877
|
+
*
|
|
8878
|
+
* @param options - Options for the cloning operation:
|
|
8879
|
+
* - `qualifiers`: Optional qualifier collector to use instead of the original
|
|
8880
|
+
* - `resourceTypes`: Optional resource type collector to use instead of the original
|
|
8881
|
+
* - `filterForContext`: Optional context filter for candidates
|
|
8882
|
+
* - `candidates`: Optional candidate edits to apply during cloning
|
|
8883
|
+
* @returns A Result containing the new ResourceManagerBuilder with the specified configuration.
|
|
7532
8884
|
* @public
|
|
7533
8885
|
*/
|
|
7534
8886
|
clone(options?: IResourceManagerCloneOptions): Result<ResourceManagerBuilder>;
|
|
@@ -7547,7 +8899,6 @@ export declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
7547
8899
|
* @returns A Result containing the ConditionSet token if successful, or failure if validation fails
|
|
7548
8900
|
* @internal
|
|
7549
8901
|
*/
|
|
7550
|
-
private static _getConditionSetToken;
|
|
7551
8902
|
/**
|
|
7552
8903
|
* Applies candidate edits to a resource declaration, handling collisions using condition set tokens.
|
|
7553
8904
|
* If there's no collision, adds the candidate. If there's a collision, replaces the original candidate with the edit.
|
|
@@ -7568,6 +8919,49 @@ export declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
7568
8919
|
* @internal
|
|
7569
8920
|
*/
|
|
7570
8921
|
private static _createResourceDeclFromCandidates;
|
|
8922
|
+
/**
|
|
8923
|
+
* Reconstructs conditions from a compiled collection and adds them to the builder.
|
|
8924
|
+
* @param builder - The builder to add conditions to.
|
|
8925
|
+
* @param compiledCollection - The compiled collection containing conditions.
|
|
8926
|
+
* @returns `Success` if all conditions were added successfully, `Failure` otherwise.
|
|
8927
|
+
* @internal
|
|
8928
|
+
*/
|
|
8929
|
+
private static _reconstructConditions;
|
|
8930
|
+
/**
|
|
8931
|
+
* Reconstructs condition sets from a compiled collection and adds them to the builder.
|
|
8932
|
+
* @param builder - The builder to add condition sets to.
|
|
8933
|
+
* @param compiledCollection - The compiled collection containing condition sets.
|
|
8934
|
+
* @returns `Success` if all condition sets were added successfully, `Failure` otherwise.
|
|
8935
|
+
* @internal
|
|
8936
|
+
*/
|
|
8937
|
+
private static _reconstructConditionSets;
|
|
8938
|
+
/**
|
|
8939
|
+
* Reconstructs decisions from a compiled collection and adds them to the builder.
|
|
8940
|
+
* @param builder - The builder to add decisions to.
|
|
8941
|
+
* @param compiledCollection - The compiled collection containing decisions.
|
|
8942
|
+
* @returns `Success` if all decisions were added successfully, `Failure` otherwise.
|
|
8943
|
+
* @internal
|
|
8944
|
+
*/
|
|
8945
|
+
private static _reconstructDecisions;
|
|
8946
|
+
/**
|
|
8947
|
+
* Reconstructs resources and their candidates from a compiled collection and adds them to the builder.
|
|
8948
|
+
* @param builder - The builder to add resources to.
|
|
8949
|
+
* @param compiledCollection - The compiled collection containing resources.
|
|
8950
|
+
* @returns `Success` if all resources were added successfully, `Failure` otherwise.
|
|
8951
|
+
* @internal
|
|
8952
|
+
*/
|
|
8953
|
+
private static _reconstructResources;
|
|
8954
|
+
/**
|
|
8955
|
+
* Helper method to create candidates from a decision's condition sets.
|
|
8956
|
+
* @param compiledResource - The compiled resource containing candidates.
|
|
8957
|
+
* @param decision - The decision containing condition sets.
|
|
8958
|
+
* @param resourceType - The resource type for the candidates.
|
|
8959
|
+
* @param builder - The builder to add candidates to.
|
|
8960
|
+
* @param candidateValues - Array of candidate values indexed by valueIndex.
|
|
8961
|
+
* @returns `Success` if all candidates were added successfully, `Failure` otherwise.
|
|
8962
|
+
* @internal
|
|
8963
|
+
*/
|
|
8964
|
+
private static _createCandidatesFromDecision;
|
|
7571
8965
|
}
|
|
7572
8966
|
|
|
7573
8967
|
/**
|
|
@@ -7594,7 +8988,7 @@ declare const resourceName: Converter<ResourceName, unknown>;
|
|
|
7594
8988
|
* and caching results for optimal performance.
|
|
7595
8989
|
* @public
|
|
7596
8990
|
*/
|
|
7597
|
-
export declare class ResourceResolver {
|
|
8991
|
+
export declare class ResourceResolver implements IResourceResolver {
|
|
7598
8992
|
/**
|
|
7599
8993
|
* The resource manager that defines available resources and provides condition access.
|
|
7600
8994
|
*/
|
|
@@ -7612,7 +9006,15 @@ export declare class ResourceResolver {
|
|
|
7612
9006
|
*/
|
|
7613
9007
|
readonly options: IResourceResolverOptions;
|
|
7614
9008
|
/**
|
|
7615
|
-
* The
|
|
9009
|
+
* The readonly qualifier collector that provides qualifier implementations.
|
|
9010
|
+
*/
|
|
9011
|
+
get qualifiers(): IReadOnlyQualifierCollector;
|
|
9012
|
+
/**
|
|
9013
|
+
* The resource IDs that this resolver can resolve.
|
|
9014
|
+
*/
|
|
9015
|
+
get resourceIds(): ReadonlyArray<ResourceId>;
|
|
9016
|
+
/**
|
|
9017
|
+
* The cache array for resolved conditions, indexed by condition index for O(1) lookup.
|
|
7616
9018
|
* Each entry stores the resolved {@link Runtime.IConditionMatchResult | condition match result} for
|
|
7617
9019
|
* the corresponding condition.
|
|
7618
9020
|
*/
|
|
@@ -7695,6 +9097,15 @@ export declare class ResourceResolver {
|
|
|
7695
9097
|
* @public
|
|
7696
9098
|
*/
|
|
7697
9099
|
resolveResource(resource: IResource): Result<IResourceCandidate>;
|
|
9100
|
+
/**
|
|
9101
|
+
* Resolves a resource by finding the best matching candidate.
|
|
9102
|
+
* Uses the resource's associated decision to determine the best match based on the current context.
|
|
9103
|
+
* @param resource - The string id of the resource to resolve.
|
|
9104
|
+
* @returns `Success` with the best matching candidate if successful,
|
|
9105
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
9106
|
+
* @public
|
|
9107
|
+
*/
|
|
9108
|
+
resolveResource(resource: string): Result<IResourceCandidate>;
|
|
7698
9109
|
/**
|
|
7699
9110
|
* Resolves all matching resource candidates in priority order.
|
|
7700
9111
|
* Uses the resource's associated decision to determine all matching candidates based on the current context.
|
|
@@ -7704,6 +9115,15 @@ export declare class ResourceResolver {
|
|
|
7704
9115
|
* @public
|
|
7705
9116
|
*/
|
|
7706
9117
|
resolveAllResourceCandidates(resource: IResource): Result<ReadonlyArray<IResourceCandidate>>;
|
|
9118
|
+
/**
|
|
9119
|
+
* Resolves all matching resource candidates in priority order.
|
|
9120
|
+
* Uses the resource's associated decision to determine all matching candidates based on the current context.
|
|
9121
|
+
* @param resource - The string id of the resource to resolve.
|
|
9122
|
+
* @returns `Success` with an array of all matching candidates in priority order if successful,
|
|
9123
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
9124
|
+
* @public
|
|
9125
|
+
*/
|
|
9126
|
+
resolveAllResourceCandidates(resource: string): Result<ReadonlyArray<IResourceCandidate>>;
|
|
7707
9127
|
/**
|
|
7708
9128
|
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
7709
9129
|
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
@@ -7714,6 +9134,20 @@ export declare class ResourceResolver {
|
|
|
7714
9134
|
* @public
|
|
7715
9135
|
*/
|
|
7716
9136
|
resolveComposedResourceValue(resource: IResource): Result<JsonValue>;
|
|
9137
|
+
/**
|
|
9138
|
+
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
9139
|
+
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
9140
|
+
* priority "partial" candidates into it in ascending order of priority.
|
|
9141
|
+
* @param resource - The string id of the resource to resolve.
|
|
9142
|
+
* @returns `Success` with the composed JsonValue if successful,
|
|
9143
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
9144
|
+
* @public
|
|
9145
|
+
*/
|
|
9146
|
+
resolveComposedResourceValue(resource: string): Result<JsonValue>;
|
|
9147
|
+
/**
|
|
9148
|
+
* {@inheritDoc IResourceResolver.withContext}
|
|
9149
|
+
*/
|
|
9150
|
+
withContext(context: Record<string, string>): Result<ResourceResolver>;
|
|
7717
9151
|
/**
|
|
7718
9152
|
* Clears all caches (condition, condition set, and decision), forcing all cached items
|
|
7719
9153
|
* to be re-evaluated on next access. This should be called when the context changes and cached
|
|
@@ -7801,6 +9235,14 @@ declare namespace Resources {
|
|
|
7801
9235
|
ICandidateInfo,
|
|
7802
9236
|
IReducedCandidate,
|
|
7803
9237
|
CandidateReducer,
|
|
9238
|
+
ICandidateValue,
|
|
9239
|
+
ICandidateValueCreateParams,
|
|
9240
|
+
CandidateValue,
|
|
9241
|
+
ICandidateValueCollectorCreateParams,
|
|
9242
|
+
CandidateValueCollector,
|
|
9243
|
+
IDeltaGeneratorParams,
|
|
9244
|
+
IDeltaGeneratorOptions,
|
|
9245
|
+
DeltaGenerator,
|
|
7804
9246
|
IResourceCandidateCreateParams,
|
|
7805
9247
|
ICandidateDeclOptions,
|
|
7806
9248
|
ResourceCandidate,
|
|
@@ -7861,7 +9303,7 @@ declare const resourceTreeChildNodeDecl: Converter<Normalized.IResourceTreeChild
|
|
|
7861
9303
|
* strongly-typed internal tree operations, ensuring type safety and consistent
|
|
7862
9304
|
* error handling throughout the resource tree navigation.
|
|
7863
9305
|
*
|
|
7864
|
-
* @
|
|
9306
|
+
* @public
|
|
7865
9307
|
*/
|
|
7866
9308
|
declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeChildren<T, string, string> {
|
|
7867
9309
|
private readonly _inner;
|
|
@@ -7916,17 +9358,17 @@ declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeC
|
|
|
7916
9358
|
*/
|
|
7917
9359
|
forEach(cb: (value: unknown, key: string, map: IReadOnlyResultMap<string, unknown>, thisArg?: unknown) => void, arg?: unknown): void;
|
|
7918
9360
|
/**
|
|
7919
|
-
* Gets a child node by its
|
|
7920
|
-
* @param key - The
|
|
9361
|
+
* Gets a child node by its string key with detailed error information.
|
|
9362
|
+
* @param key - The string key to look up
|
|
7921
9363
|
* @returns DetailedResult containing the node if found, or failure with details
|
|
7922
9364
|
*/
|
|
7923
|
-
get(key:
|
|
9365
|
+
get(key: string): DetailedResult<IReadOnlyResourceTreeNode<T>, Collections.ResultMapResultDetail>;
|
|
7924
9366
|
/**
|
|
7925
|
-
* Checks if a child node exists at the given
|
|
7926
|
-
* @param key - The
|
|
9367
|
+
* Checks if a child node exists at the given string key.
|
|
9368
|
+
* @param key - The string key to check
|
|
7927
9369
|
* @returns True if a child node exists at the key, false otherwise
|
|
7928
9370
|
*/
|
|
7929
|
-
has(key:
|
|
9371
|
+
has(key: string): boolean;
|
|
7930
9372
|
/**
|
|
7931
9373
|
* Returns an iterator of ResourceName keys for all child nodes.
|
|
7932
9374
|
* @returns Map iterator for all child node keys
|
|
@@ -7950,6 +9392,111 @@ declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeC
|
|
|
7950
9392
|
*/
|
|
7951
9393
|
declare type ResourceTreeNodeInit<T> = IResourceTreeLeafInit<T> | IResourceTreeBranchInit<T>;
|
|
7952
9394
|
|
|
9395
|
+
/**
|
|
9396
|
+
* Specialized resolver for resource tree operations, providing enhanced APIs for
|
|
9397
|
+
* resolving entire resource trees from either resource IDs or pre-built tree nodes.
|
|
9398
|
+
*
|
|
9399
|
+
* This class provides a clean separation between individual resource resolution
|
|
9400
|
+
* (handled by ResourceResolver) and tree-based operations, with support for
|
|
9401
|
+
* lazy tree construction and enhanced error handling.
|
|
9402
|
+
*
|
|
9403
|
+
* @public
|
|
9404
|
+
*/
|
|
9405
|
+
declare class ResourceTreeResolver {
|
|
9406
|
+
/**
|
|
9407
|
+
* The {@link Runtime.ResourceResolver | ResourceResolver} to use for individual resource resolution
|
|
9408
|
+
*/
|
|
9409
|
+
readonly resolver: ResourceResolver;
|
|
9410
|
+
/**
|
|
9411
|
+
* The {@link Runtime.IResourceManager | IResourceManager} to use for lazy tree construction.
|
|
9412
|
+
* @internal
|
|
9413
|
+
*/
|
|
9414
|
+
private readonly _resourceManager;
|
|
9415
|
+
/**
|
|
9416
|
+
* The built resource tree, lazily built on first access.
|
|
9417
|
+
* @internal
|
|
9418
|
+
*/
|
|
9419
|
+
private _tree?;
|
|
9420
|
+
/**
|
|
9421
|
+
* Creates a {@link Runtime.ResourceTreeResolver | ResourceTreeResolver} instance.
|
|
9422
|
+
* @param resolver - The ResourceResolver to use for individual resource resolution
|
|
9423
|
+
*/
|
|
9424
|
+
constructor(resolver: ResourceResolver);
|
|
9425
|
+
/**
|
|
9426
|
+
* Creates a {@link Runtime.ResourceTreeResolver | ResourceTreeResolver} instance.
|
|
9427
|
+
* @param resolver - The ResourceResolver to use for individual resource resolution
|
|
9428
|
+
*/
|
|
9429
|
+
static create(resolver: ResourceResolver): Result<ResourceTreeResolver>;
|
|
9430
|
+
/**
|
|
9431
|
+
* Gets the built resource tree, building it lazily on first access.
|
|
9432
|
+
* @returns The resource tree root
|
|
9433
|
+
* @throws Error if no resource manager was provided or tree building fails
|
|
9434
|
+
* @public
|
|
9435
|
+
*/
|
|
9436
|
+
get tree(): IReadOnlyResourceTreeRoot<IResource>;
|
|
9437
|
+
/**
|
|
9438
|
+
* Resolves a resource tree from a resource ID, building the tree lazily from the resource manager.
|
|
9439
|
+
* @param resourceId - The ID of the root resource to resolve
|
|
9440
|
+
* @param options - Optional configuration for error handling during resolution
|
|
9441
|
+
* @returns Success with the composed JsonObject or undefined, or Failure with error message
|
|
9442
|
+
* @public
|
|
9443
|
+
*/
|
|
9444
|
+
resolveComposedResourceTree(resourceId: string, options?: IResolveResourceTreeOptions): Result<JsonObject | undefined>;
|
|
9445
|
+
/**
|
|
9446
|
+
* Resolves a pre-built resource tree node.
|
|
9447
|
+
* @param node - The resource tree node to resolve
|
|
9448
|
+
* @param options - Optional configuration for error handling during resolution
|
|
9449
|
+
* @returns Success with the composed JsonObject or undefined, or Failure with error message
|
|
9450
|
+
* @public
|
|
9451
|
+
*/
|
|
9452
|
+
resolveComposedResourceTree(node: IReadOnlyResourceTreeNode<IResource>, options?: IResolveResourceTreeOptions): Result<JsonObject | undefined>;
|
|
9453
|
+
private _getTree;
|
|
9454
|
+
/**
|
|
9455
|
+
* Resolves a tree from a resource ID by first building the tree from the resource manager.
|
|
9456
|
+
* @internal
|
|
9457
|
+
*/
|
|
9458
|
+
private _resolveFromResourceId;
|
|
9459
|
+
/**
|
|
9460
|
+
* Resolves a pre-built tree node using the extracted tree resolution logic.
|
|
9461
|
+
* @internal
|
|
9462
|
+
*/
|
|
9463
|
+
private _resolveFromTreeNode;
|
|
9464
|
+
/**
|
|
9465
|
+
* Handles resource resolution errors according to the specified mode.
|
|
9466
|
+
* @param resource - The resource that failed to resolve
|
|
9467
|
+
* @param message - The error message from the failed resolution
|
|
9468
|
+
* @param mode - The error handling mode
|
|
9469
|
+
* @param path - The path to the resource in the tree (for error context)
|
|
9470
|
+
* @internal
|
|
9471
|
+
*/
|
|
9472
|
+
private _handleResourceError;
|
|
9473
|
+
/**
|
|
9474
|
+
* Handles empty branch nodes according to the specified mode.
|
|
9475
|
+
* @param node - The empty branch node
|
|
9476
|
+
* @param failedChildren - Names of children that failed to resolve
|
|
9477
|
+
* @param mode - The empty branch handling mode
|
|
9478
|
+
* @param path - The path to the branch in the tree (for error context)
|
|
9479
|
+
* @internal
|
|
9480
|
+
*/
|
|
9481
|
+
private _handleEmptyBranch;
|
|
9482
|
+
/**
|
|
9483
|
+
* Processes a leaf node by resolving its resource value.
|
|
9484
|
+
* @param node - The leaf node to process (must be a leaf node)
|
|
9485
|
+
* @param path - The path to the node in the tree
|
|
9486
|
+
* @param resourceErrorMode - How to handle resource resolution errors
|
|
9487
|
+
* @internal
|
|
9488
|
+
*/
|
|
9489
|
+
private _processLeafNode;
|
|
9490
|
+
/**
|
|
9491
|
+
* Processes a branch node by recursively resolving all its children.
|
|
9492
|
+
* @param node - The branch node to process (must be a branch node)
|
|
9493
|
+
* @param path - The path to the node in the tree
|
|
9494
|
+
* @param options - Resolution options
|
|
9495
|
+
* @internal
|
|
9496
|
+
*/
|
|
9497
|
+
private _processBranchNode;
|
|
9498
|
+
}
|
|
9499
|
+
|
|
7953
9500
|
/**
|
|
7954
9501
|
* `Converter` for a normalized {@link ResourceJson.Normalized.IResourceTreeRootDecl | resource tree root declaration}.
|
|
7955
9502
|
* @public
|
|
@@ -7962,17 +9509,22 @@ declare const resourceTreeRootDecl: Converter<Normalized.IResourceTreeRootDecl>;
|
|
|
7962
9509
|
* resource value.
|
|
7963
9510
|
* @public
|
|
7964
9511
|
*/
|
|
7965
|
-
export declare abstract class ResourceType<T = unknown> implements
|
|
9512
|
+
export declare abstract class ResourceType<T = unknown> implements IResourceType<T> {
|
|
7966
9513
|
private _collectible;
|
|
9514
|
+
private _template;
|
|
7967
9515
|
/**
|
|
7968
|
-
*
|
|
9516
|
+
* {@inheritdoc ResourceTypes.IResourceType.key}
|
|
7969
9517
|
*/
|
|
7970
9518
|
get key(): ResourceTypeName;
|
|
7971
9519
|
/**
|
|
7972
|
-
*
|
|
9520
|
+
* Name of the underlying system type.
|
|
9521
|
+
*/
|
|
9522
|
+
abstract readonly systemTypeName: ResourceTypeName;
|
|
9523
|
+
/**
|
|
9524
|
+
* {@inheritdoc ResourceTypes.IResourceType.index}
|
|
7973
9525
|
*/
|
|
7974
9526
|
get index(): ResourceTypeIndex | undefined;
|
|
7975
|
-
protected constructor(key: ResourceTypeName, index?: number);
|
|
9527
|
+
protected constructor(key: ResourceTypeName, index?: number, template?: JsonObject);
|
|
7976
9528
|
/**
|
|
7977
9529
|
* Validates properties of a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration} for
|
|
7978
9530
|
* a resource instance value.
|
|
@@ -8022,6 +9574,25 @@ export declare abstract class ResourceType<T = unknown> implements ICollectible<
|
|
|
8022
9574
|
* Sets the index for this resource type. Once set, the index cannot be changed.
|
|
8023
9575
|
*/
|
|
8024
9576
|
setIndex(index: number): Result<ResourceTypeIndex>;
|
|
9577
|
+
/**
|
|
9578
|
+
* Creates a template for a new resource of this type.
|
|
9579
|
+
* Default implementation provides a basic template.
|
|
9580
|
+
* Subclasses can override to provide type-specific templates.
|
|
9581
|
+
* @param resourceId - The id for the new resource
|
|
9582
|
+
* @param init - An optional initial value for the resource.
|
|
9583
|
+
* @param conditions - An optional set of conditions that must be met for the resource to be selected.
|
|
9584
|
+
* @param resolver - An optional resource resolver that can be used to create the template.
|
|
9585
|
+
* @returns A loose resource declaration with default values for this resource type
|
|
9586
|
+
* @public
|
|
9587
|
+
*/
|
|
9588
|
+
createTemplate(resourceId: ResourceId, init?: JsonValue, conditions?: ResourceJson.Json.ConditionSetDecl, resolver?: IResourceResolver): Result<ResourceJson.Json.ILooseResourceDecl>;
|
|
9589
|
+
/**
|
|
9590
|
+
* Gets the default template value for this resource type.
|
|
9591
|
+
* Subclasses should override this to provide type-specific default values.
|
|
9592
|
+
* @returns The default JSON value for a new resource of this type
|
|
9593
|
+
* @public
|
|
9594
|
+
*/
|
|
9595
|
+
getDefaultTemplateCandidate(json?: JsonValue, conditions?: ResourceJson.Json.ConditionSetDecl, __resolver?: IResourceResolver): Result<ResourceJson.Json.IChildResourceCandidateDecl>;
|
|
8025
9596
|
}
|
|
8026
9597
|
|
|
8027
9598
|
/**
|
|
@@ -8045,7 +9616,30 @@ declare class ResourceTypeCollector extends ValidatingCollector<ResourceType> {
|
|
|
8045
9616
|
* @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
|
|
8046
9617
|
* @public
|
|
8047
9618
|
*/
|
|
8048
|
-
declare const resourceTypeConfig: ObjectConverter<IResourceTypeConfig
|
|
9619
|
+
declare const resourceTypeConfig: ObjectConverter<IResourceTypeConfig<JsonObject>, unknown>;
|
|
9620
|
+
|
|
9621
|
+
/**
|
|
9622
|
+
* A factory that creates a {@link ResourceTypes.ResourceType | ResourceType} from a {@link ResourceTypes.Config.IResourceTypeConfig | resource type configuration}
|
|
9623
|
+
* by chaining a supplied factory with a {@link Config.BuiltInResourceTypeFactory | built-in factory} that handles built-in resource types.
|
|
9624
|
+
* @public
|
|
9625
|
+
*/
|
|
9626
|
+
declare class ResourceTypeFactory extends ChainedConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> {
|
|
9627
|
+
/**
|
|
9628
|
+
* Constructor for a resource type factory.
|
|
9629
|
+
* @param factories - Array of factories for resource types. Can be:
|
|
9630
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
9631
|
+
* - {@link Config.ResourceTypeFactoryFunction | Factory functions}
|
|
9632
|
+
* - A mix of both
|
|
9633
|
+
* @remarks The {@link Config.BuiltInResourceTypeFactory | built-in factory} is always added to the end of the chain.
|
|
9634
|
+
*/
|
|
9635
|
+
constructor(factories: Array<IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> | ResourceTypeFactoryFunction>);
|
|
9636
|
+
}
|
|
9637
|
+
|
|
9638
|
+
/**
|
|
9639
|
+
* Function signature for creating a resource type from configuration.
|
|
9640
|
+
* @public
|
|
9641
|
+
*/
|
|
9642
|
+
declare type ResourceTypeFactoryFunction = (config: ResourceTypes.Config.IResourceTypeConfig) => Result<ResourceType>;
|
|
8049
9643
|
|
|
8050
9644
|
/**
|
|
8051
9645
|
* Branded number representing a validated resource type index.
|
|
@@ -8075,6 +9669,7 @@ declare namespace ResourceTypes {
|
|
|
8075
9669
|
export {
|
|
8076
9670
|
Config_3 as Config,
|
|
8077
9671
|
IResourceCandidateValidationProperties,
|
|
9672
|
+
IResourceType,
|
|
8078
9673
|
ResourceType,
|
|
8079
9674
|
IResourceCollectorCreateParams,
|
|
8080
9675
|
ResourceTypeCollector,
|
|
@@ -8118,6 +9713,10 @@ declare namespace Runtime {
|
|
|
8118
9713
|
IResourceResolverOptions,
|
|
8119
9714
|
IResourceResolverCreateParams,
|
|
8120
9715
|
ResourceResolver,
|
|
9716
|
+
ResourceErrorHandler,
|
|
9717
|
+
EmptyBranchHandler,
|
|
9718
|
+
IResolveResourceTreeOptions,
|
|
9719
|
+
ResourceTreeResolver,
|
|
8121
9720
|
ConditionMatchType,
|
|
8122
9721
|
IConditionMatchResult,
|
|
8123
9722
|
ConditionSetResolutionResult,
|
|
@@ -8133,6 +9732,14 @@ declare namespace Runtime {
|
|
|
8133
9732
|
}
|
|
8134
9733
|
export { Runtime }
|
|
8135
9734
|
|
|
9735
|
+
/**
|
|
9736
|
+
* Create a safe filename by removing invalid characters
|
|
9737
|
+
* @param filename - Original filename
|
|
9738
|
+
* @returns Sanitized filename
|
|
9739
|
+
* @public
|
|
9740
|
+
*/
|
|
9741
|
+
declare function sanitizeFilename(filename: string): string;
|
|
9742
|
+
|
|
8136
9743
|
/**
|
|
8137
9744
|
* @internal
|
|
8138
9745
|
*/
|
|
@@ -8143,7 +9750,12 @@ declare const segmentedIdentifier: RegExp;
|
|
|
8143
9750
|
* using a `ResultMap` for qualifier value storage.
|
|
8144
9751
|
* @public
|
|
8145
9752
|
*/
|
|
8146
|
-
declare class SimpleContextQualifierProvider extends ContextQualifierProvider {
|
|
9753
|
+
declare class SimpleContextQualifierProvider extends ContextQualifierProvider implements IMutableContextQualifierProvider {
|
|
9754
|
+
/**
|
|
9755
|
+
* Explicit mutability marker for compile-time type discrimination.
|
|
9756
|
+
* Always `true` for mutable providers.
|
|
9757
|
+
*/
|
|
9758
|
+
readonly mutable: true;
|
|
8147
9759
|
/**
|
|
8148
9760
|
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
8149
9761
|
*/
|
|
@@ -8221,6 +9833,14 @@ declare class SimpleContextQualifierProvider extends ContextQualifierProvider {
|
|
|
8221
9833
|
* @public
|
|
8222
9834
|
*/
|
|
8223
9835
|
clear(): void;
|
|
9836
|
+
/**
|
|
9837
|
+
* Resolves a qualifier from a name, index, or qualifier object.
|
|
9838
|
+
* @param nameOrIndexOrQualifier - The input to resolve.
|
|
9839
|
+
* @returns `Success` with the {@link Qualifier | qualifier} if successful,
|
|
9840
|
+
* or `Failure` with an error message if not found or invalid.
|
|
9841
|
+
* @internal
|
|
9842
|
+
*/
|
|
9843
|
+
private _resolveQualifier;
|
|
8224
9844
|
/**
|
|
8225
9845
|
* Resolves a qualifier name from a name, index, or qualifier object.
|
|
8226
9846
|
* @param nameOrIndexOrQualifier - The input to resolve.
|
|
@@ -8229,6 +9849,14 @@ declare class SimpleContextQualifierProvider extends ContextQualifierProvider {
|
|
|
8229
9849
|
* @internal
|
|
8230
9850
|
*/
|
|
8231
9851
|
private _resolveQualifierName;
|
|
9852
|
+
/**
|
|
9853
|
+
* Resolves a qualifier name from a qualifier-like object.
|
|
9854
|
+
* @param nameOrIndexOrQualifier - The input to resolve.
|
|
9855
|
+
* @returns `Success` with the {@link QualifierName | qualifier name} if successful,
|
|
9856
|
+
* or `Failure` with an error message if not found or invalid.
|
|
9857
|
+
* @internal
|
|
9858
|
+
*/
|
|
9859
|
+
private static _qualifierNameFromQualifierLike;
|
|
8232
9860
|
}
|
|
8233
9861
|
|
|
8234
9862
|
/**
|
|
@@ -8274,7 +9902,7 @@ declare class SystemConfiguration {
|
|
|
8274
9902
|
* @param config - The {@link Config.Model.ISystemConfiguration | system configuration} to use.
|
|
8275
9903
|
* @public
|
|
8276
9904
|
*/
|
|
8277
|
-
protected constructor(config: ISystemConfiguration);
|
|
9905
|
+
protected constructor(config: ISystemConfiguration, initParams?: ISystemConfigurationInitParams);
|
|
8278
9906
|
/**
|
|
8279
9907
|
* Creates a new {@link Config.SystemConfiguration | SystemConfiguration} from the supplied
|
|
8280
9908
|
* {@link Config.Model.ISystemConfiguration | system configuration}.
|
|
@@ -8285,6 +9913,14 @@ declare class SystemConfiguration {
|
|
|
8285
9913
|
* @public
|
|
8286
9914
|
*/
|
|
8287
9915
|
static create(config: ISystemConfiguration, initParams?: ISystemConfigurationInitParams): Result<SystemConfiguration>;
|
|
9916
|
+
/**
|
|
9917
|
+
* Loads a {@link Config.SystemConfiguration | SystemConfiguration} from a file.
|
|
9918
|
+
* @param path - The path to the file to load.
|
|
9919
|
+
* @returns `Success` with the {@link Config.SystemConfiguration | SystemConfiguration}
|
|
9920
|
+
* if successful, `Failure` with an error message otherwise.
|
|
9921
|
+
* @public
|
|
9922
|
+
*/
|
|
9923
|
+
static loadFromFile(path: string, initParams?: ISystemConfigurationInitParams): Result<SystemConfiguration>;
|
|
8288
9924
|
/**
|
|
8289
9925
|
* Returns the {@link Config.Model.ISystemConfiguration | system configuration} that this
|
|
8290
9926
|
* {@link Config.SystemConfiguration | SystemConfiguration} was created from.
|
|
@@ -8302,6 +9938,13 @@ declare class SystemConfiguration {
|
|
|
8302
9938
|
*/
|
|
8303
9939
|
declare const systemConfiguration: ObjectConverter<ISystemConfiguration, unknown>;
|
|
8304
9940
|
|
|
9941
|
+
/**
|
|
9942
|
+
* Validator for system configuration (delegates to config packlet)
|
|
9943
|
+
* This validates that the parsed JSON conforms to the system configuration schema
|
|
9944
|
+
* @public
|
|
9945
|
+
*/
|
|
9946
|
+
declare const systemConfiguration_2: Validator<Model.ISystemConfiguration>;
|
|
9947
|
+
|
|
8305
9948
|
/**
|
|
8306
9949
|
* A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
|
|
8307
9950
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
|
|
@@ -8316,6 +9959,14 @@ declare const systemLanguageQualifierTypeConfig: ObjectConverter<Model_2.ISystem
|
|
|
8316
9959
|
*/
|
|
8317
9960
|
declare const systemLiteralQualifierTypeConfig: ObjectConverter<Model_2.ISystemLiteralQualifierTypeConfig, unknown>;
|
|
8318
9961
|
|
|
9962
|
+
/**
|
|
9963
|
+
* A discriminated union of all system qualifier types.
|
|
9964
|
+
* This allows TypeScript to properly discriminate between specific qualifier type implementations
|
|
9965
|
+
* and access their specific methods like getConfiguration().
|
|
9966
|
+
* @public
|
|
9967
|
+
*/
|
|
9968
|
+
declare type SystemQualifierType = LanguageQualifierType | TerritoryQualifierType | LiteralQualifierType;
|
|
9969
|
+
|
|
8319
9970
|
/**
|
|
8320
9971
|
* A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
|
|
8321
9972
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
|
|
@@ -8359,7 +10010,11 @@ declare const TerritoryPrioritySystemConfiguration: ISystemConfiguration;
|
|
|
8359
10010
|
* implementation handles incorrect casing.
|
|
8360
10011
|
* @public
|
|
8361
10012
|
*/
|
|
8362
|
-
declare class TerritoryQualifierType extends QualifierType {
|
|
10013
|
+
declare class TerritoryQualifierType extends QualifierType<JsonCompatible<Config_2.ITerritoryQualifierTypeConfig>> {
|
|
10014
|
+
/**
|
|
10015
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
10016
|
+
*/
|
|
10017
|
+
readonly systemTypeName: QualifierTypeName;
|
|
8363
10018
|
/**
|
|
8364
10019
|
* Optional array enumerating allowed territories to further constrain the type.
|
|
8365
10020
|
*/
|
|
@@ -8401,6 +10056,27 @@ declare class TerritoryQualifierType extends QualifierType {
|
|
|
8401
10056
|
* @public
|
|
8402
10057
|
*/
|
|
8403
10058
|
static createFromConfig(config: Config_2.IQualifierTypeConfig<Config_2.ITerritoryQualifierTypeConfig>): Result<TerritoryQualifierType>;
|
|
10059
|
+
/**
|
|
10060
|
+
* Gets the {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | strongly typed configuration}
|
|
10061
|
+
* for this qualifier type.
|
|
10062
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
10063
|
+
*/
|
|
10064
|
+
getConfiguration(): Result<Config_2.ISystemTerritoryQualifierTypeConfig>;
|
|
10065
|
+
/**
|
|
10066
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
10067
|
+
*/
|
|
10068
|
+
getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemTerritoryQualifierTypeConfig>>;
|
|
10069
|
+
/**
|
|
10070
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
10071
|
+
*/
|
|
10072
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemTerritoryQualifierTypeConfig>>;
|
|
10073
|
+
/**
|
|
10074
|
+
* Validates a {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | strongly typed configuration object}
|
|
10075
|
+
* for this qualifier type.
|
|
10076
|
+
* @param from - The unknown data to validate as a configuration object.
|
|
10077
|
+
* @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
|
|
10078
|
+
*/
|
|
10079
|
+
validateConfiguration(from: unknown): Result<Config_2.ISystemTerritoryQualifierTypeConfig>;
|
|
8404
10080
|
/**
|
|
8405
10081
|
* {@inheritdoc QualifierTypes.QualifierType._matchOne}
|
|
8406
10082
|
*/
|
|
@@ -8433,6 +10109,26 @@ declare class TerritoryQualifierType extends QualifierType {
|
|
|
8433
10109
|
*/
|
|
8434
10110
|
declare const territoryQualifierTypeConfig: ObjectConverter<Model_2.ITerritoryQualifierTypeConfig, unknown>;
|
|
8435
10111
|
|
|
10112
|
+
/**
|
|
10113
|
+
* Converts a number to a {@link CandidateValueIndex | candidate value index}.
|
|
10114
|
+
*
|
|
10115
|
+
* @param index - The number to convert.
|
|
10116
|
+
* @returns `Success` with the converted index if valid, or `Failure` with an error message
|
|
10117
|
+
* if not.
|
|
10118
|
+
* @public
|
|
10119
|
+
*/
|
|
10120
|
+
declare function toCandidateValueIndex(index: number): Result<CandidateValueIndex>;
|
|
10121
|
+
|
|
10122
|
+
/**
|
|
10123
|
+
* Converts a string to a {@link CandidateValueKey | candidate value key}.
|
|
10124
|
+
*
|
|
10125
|
+
* @param key - The key to convert.
|
|
10126
|
+
* @returns `Success` with the converted key if valid, or `Failure` with an error message
|
|
10127
|
+
* if not.
|
|
10128
|
+
* @public
|
|
10129
|
+
*/
|
|
10130
|
+
declare function toCandidateValueKey(key: string): Result<CandidateValueKey>;
|
|
10131
|
+
|
|
8436
10132
|
/**
|
|
8437
10133
|
* Converts a number to a {@link ConditionIndex} if it is a valid condition index.
|
|
8438
10134
|
* @param index - the number to convert
|
|
@@ -8560,6 +10256,15 @@ declare function toDecisionKey(key: string): Result<DecisionKey>;
|
|
|
8560
10256
|
*/
|
|
8561
10257
|
declare function toOptionalResourceId(id?: string): Result<ResourceId | undefined>;
|
|
8562
10258
|
|
|
10259
|
+
/**
|
|
10260
|
+
* Converts a string to a {@link QualifierContextValue} if it is a valid qualifier context value.
|
|
10261
|
+
* @param value - the string to convert
|
|
10262
|
+
* @returns `Success` with the converted {@link QualifierContextValue} if successful, or `Failure` with an
|
|
10263
|
+
* error message if not.
|
|
10264
|
+
* @public
|
|
10265
|
+
*/
|
|
10266
|
+
declare function toQualifierContextValue(value: string): Result<QualifierContextValue>;
|
|
10267
|
+
|
|
8563
10268
|
/**
|
|
8564
10269
|
* Converts a string to a {@link QualifierDefaultValuesToken} if it is a valid qualifier default values token.
|
|
8565
10270
|
* @param token - the string to convert
|
|
@@ -8703,7 +10408,9 @@ declare namespace Validate {
|
|
|
8703
10408
|
isValidConditionSetHash,
|
|
8704
10409
|
isValidDecisionKey,
|
|
8705
10410
|
isValidDecisionIndex,
|
|
10411
|
+
isValidQualifierContextValue,
|
|
8706
10412
|
toQualifierName,
|
|
10413
|
+
toQualifierContextValue,
|
|
8707
10414
|
toQualifierIndex,
|
|
8708
10415
|
toQualifierTypeName,
|
|
8709
10416
|
toQualifierTypeIndex,
|
|
@@ -8732,12 +10439,16 @@ declare namespace Validate {
|
|
|
8732
10439
|
isValidResourceIndex,
|
|
8733
10440
|
isValidResourceTypeName,
|
|
8734
10441
|
isValidResourceTypeIndex,
|
|
10442
|
+
isValidCandidateValueIndex,
|
|
10443
|
+
isValidCandidateValueKey,
|
|
8735
10444
|
toResourceName,
|
|
8736
10445
|
toResourceId,
|
|
8737
10446
|
toOptionalResourceId,
|
|
8738
10447
|
toResourceIndex,
|
|
8739
10448
|
toResourceTypeName,
|
|
8740
|
-
toResourceTypeIndex
|
|
10449
|
+
toResourceTypeIndex,
|
|
10450
|
+
toCandidateValueKey,
|
|
10451
|
+
toCandidateValueIndex
|
|
8741
10452
|
}
|
|
8742
10453
|
}
|
|
8743
10454
|
export { Validate }
|
|
@@ -8782,19 +10493,107 @@ declare const validatedContextQualifierValueDecl: Converter<IValidatedContextQua
|
|
|
8782
10493
|
*/
|
|
8783
10494
|
declare const validatedQualifierDecl: Converter<IValidatedQualifierDecl, IQualifierDeclConvertContext>;
|
|
8784
10495
|
|
|
10496
|
+
/**
|
|
10497
|
+
* Validate a {@link Config.Model.ISystemConfiguration | ISystemConfiguration} object.
|
|
10498
|
+
* @param config - The system configuration to validate
|
|
10499
|
+
* @returns `Success` with the validated system configuration if successful,
|
|
10500
|
+
* or `Failure` with an error message if validation fails.
|
|
10501
|
+
* @public
|
|
10502
|
+
*/
|
|
10503
|
+
declare function validateSystemConfiguration(config: unknown): Result<ISystemConfiguration>;
|
|
10504
|
+
|
|
10505
|
+
/**
|
|
10506
|
+
* Validate a ZIP archive manifest object
|
|
10507
|
+
* @param manifest - Object to validate as manifest
|
|
10508
|
+
* @returns Result containing validated manifest
|
|
10509
|
+
* @public
|
|
10510
|
+
*/
|
|
10511
|
+
declare function validateZipArchiveManifest(manifest: unknown): Result<Json_2.IZipArchiveManifest>;
|
|
10512
|
+
|
|
10513
|
+
/**
|
|
10514
|
+
* A factory that validates and creates {@link QualifierTypes.QualifierType | QualifierType} instances
|
|
10515
|
+
* from weakly-typed configuration objects. This factory accepts configurations with unvalidated
|
|
10516
|
+
* string properties and validates them before delegating to the underlying factory chain.
|
|
10517
|
+
*
|
|
10518
|
+
* This pattern is useful at package boundaries where type identity issues may occur with
|
|
10519
|
+
* branded types across different package instances.
|
|
10520
|
+
*
|
|
10521
|
+
* @example
|
|
10522
|
+
* ```typescript
|
|
10523
|
+
* // Accept weakly-typed config from external source
|
|
10524
|
+
* const validatingFactory = new ValidatingQualifierTypeFactory([customFactory]);
|
|
10525
|
+
*
|
|
10526
|
+
* // Config can have plain string types instead of branded types
|
|
10527
|
+
* const config = {
|
|
10528
|
+
* name: 'my-qualifier', // plain string, not QualifierTypeName
|
|
10529
|
+
* systemType: 'custom', // plain string
|
|
10530
|
+
* configuration: { ... }
|
|
10531
|
+
* };
|
|
10532
|
+
*
|
|
10533
|
+
* const result = validatingFactory.create(config); // Validates and converts internally
|
|
10534
|
+
* ```
|
|
10535
|
+
*
|
|
10536
|
+
* @public
|
|
10537
|
+
*/
|
|
10538
|
+
declare class ValidatingQualifierTypeFactory<T extends QualifierType = SystemQualifierType> implements IConfigInitFactory<unknown, T | SystemQualifierType> {
|
|
10539
|
+
private readonly _innerFactory;
|
|
10540
|
+
/**
|
|
10541
|
+
* Constructor for a validating qualifier type factory.
|
|
10542
|
+
* @param factories - Array of factories for custom qualifier types. Can be:
|
|
10543
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
10544
|
+
* - {@link Config.QualifierTypeFactoryFunction | Factory functions}
|
|
10545
|
+
* - A mix of both
|
|
10546
|
+
*/
|
|
10547
|
+
constructor(factories: Array<IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T> | QualifierTypeFactoryFunction<T>>);
|
|
10548
|
+
/**
|
|
10549
|
+
* Creates a qualifier type from a weakly-typed configuration object.
|
|
10550
|
+
* @param config - The configuration object to validate and use for creation.
|
|
10551
|
+
* @returns A result containing the new qualifier type if successful.
|
|
10552
|
+
*/
|
|
10553
|
+
create(config: unknown): Result<T | SystemQualifierType>;
|
|
10554
|
+
}
|
|
10555
|
+
|
|
10556
|
+
/**
|
|
10557
|
+
* A factory that validates and creates {@link ResourceTypes.ResourceType | ResourceType} instances
|
|
10558
|
+
* from weakly-typed configuration objects. This factory accepts configurations with unvalidated
|
|
10559
|
+
* string properties and validates them before delegating to the underlying factory chain.
|
|
10560
|
+
*
|
|
10561
|
+
* This pattern is useful at package boundaries where type identity issues may occur with
|
|
10562
|
+
* branded types across different package instances.
|
|
10563
|
+
*
|
|
10564
|
+
* @public
|
|
10565
|
+
*/
|
|
10566
|
+
declare class ValidatingResourceTypeFactory implements IConfigInitFactory<unknown, ResourceType> {
|
|
10567
|
+
private readonly _innerFactory;
|
|
10568
|
+
/**
|
|
10569
|
+
* Constructor for a validating resource type factory.
|
|
10570
|
+
* @param factories - Array of factories for resource types. Can be:
|
|
10571
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
10572
|
+
* - {@link Config.ResourceTypeFactoryFunction | Factory functions}
|
|
10573
|
+
* - A mix of both
|
|
10574
|
+
*/
|
|
10575
|
+
constructor(factories: Array<IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> | ResourceTypeFactoryFunction>);
|
|
10576
|
+
/**
|
|
10577
|
+
* Creates a resource type from a weakly-typed configuration object.
|
|
10578
|
+
* @param config - The configuration object to validate and use for creation.
|
|
10579
|
+
* @returns A result containing the new resource type if successful.
|
|
10580
|
+
*/
|
|
10581
|
+
create(config: unknown): Result<ResourceType>;
|
|
10582
|
+
}
|
|
10583
|
+
|
|
8785
10584
|
/**
|
|
8786
10585
|
* A {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider} with a
|
|
8787
|
-
* {@link Runtime.Context.
|
|
10586
|
+
* {@link Runtime.Context.MutableContextQualifierProviderValidator | validator} property that enables
|
|
8788
10587
|
* validated use of the underlying provider with string keys and values.
|
|
8789
10588
|
* This eliminates the need for type casting in consumer code.
|
|
8790
10589
|
* @public
|
|
8791
10590
|
*/
|
|
8792
10591
|
declare class ValidatingSimpleContextQualifierProvider extends SimpleContextQualifierProvider {
|
|
8793
10592
|
/**
|
|
8794
|
-
* A {@link Runtime.Context.
|
|
10593
|
+
* A {@link Runtime.Context.MutableContextQualifierProviderValidator | MutableContextQualifierProviderValidator} which validates
|
|
8795
10594
|
* string inputs before passing them to this provider.
|
|
8796
10595
|
*/
|
|
8797
|
-
readonly validating:
|
|
10596
|
+
readonly validating: IMutableContextQualifierProviderValidator;
|
|
8798
10597
|
/**
|
|
8799
10598
|
* Constructor for a {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider} object.
|
|
8800
10599
|
* @param params - {@link Runtime.IValidatingSimpleContextQualifierProviderCreateParams | Parameters} used to create the provider.
|
|
@@ -8810,4 +10609,194 @@ declare class ValidatingSimpleContextQualifierProvider extends SimpleContextQual
|
|
|
8810
10609
|
static create(params: IValidatingSimpleContextQualifierProviderCreateParams): Result<ValidatingSimpleContextQualifierProvider>;
|
|
8811
10610
|
}
|
|
8812
10611
|
|
|
10612
|
+
declare namespace ZipArchive {
|
|
10613
|
+
export {
|
|
10614
|
+
Json_2 as Json,
|
|
10615
|
+
Convert_12 as Convert,
|
|
10616
|
+
ZipArchiveCreator,
|
|
10617
|
+
ZipArchiveLoader,
|
|
10618
|
+
IZipArchivePathOptions,
|
|
10619
|
+
IZipArchiveFileTreeOptions,
|
|
10620
|
+
ZipArchiveOptions,
|
|
10621
|
+
IZipArchiveResult,
|
|
10622
|
+
IZipArchiveManifest_2 as IZipArchiveManifest,
|
|
10623
|
+
IZipArchiveLoadOptions,
|
|
10624
|
+
IZipArchiveLoadResult,
|
|
10625
|
+
IImportedFile_2 as IImportedFile,
|
|
10626
|
+
IImportedDirectory_2 as IImportedDirectory,
|
|
10627
|
+
ZipArchiveProgressCallback,
|
|
10628
|
+
createZipArchiveManifest,
|
|
10629
|
+
parseZipArchiveManifest,
|
|
10630
|
+
validateZipArchiveManifest,
|
|
10631
|
+
parseZipArchiveConfiguration,
|
|
10632
|
+
generateZipArchiveFilename,
|
|
10633
|
+
normalizePath,
|
|
10634
|
+
getDirectoryName,
|
|
10635
|
+
sanitizeFilename,
|
|
10636
|
+
isZipFile,
|
|
10637
|
+
ZipArchiveConstants
|
|
10638
|
+
}
|
|
10639
|
+
}
|
|
10640
|
+
export { ZipArchive }
|
|
10641
|
+
|
|
10642
|
+
/**
|
|
10643
|
+
* Validator for ZIP archive config information
|
|
10644
|
+
* @public
|
|
10645
|
+
*/
|
|
10646
|
+
declare const zipArchiveConfigInfo: Validator<Json_2.IZipArchiveConfigInfo>;
|
|
10647
|
+
|
|
10648
|
+
/**
|
|
10649
|
+
* Validator for ZIP archive config type
|
|
10650
|
+
* @public
|
|
10651
|
+
*/
|
|
10652
|
+
declare const zipArchiveConfigType: Validator<'file'>;
|
|
10653
|
+
|
|
10654
|
+
/**
|
|
10655
|
+
* Constants for ZIP archive structure
|
|
10656
|
+
* @public
|
|
10657
|
+
*/
|
|
10658
|
+
declare const ZipArchiveConstants: {
|
|
10659
|
+
/** Manifest file name */
|
|
10660
|
+
readonly MANIFEST_FILE: "manifest.json";
|
|
10661
|
+
/** Configuration file name */
|
|
10662
|
+
readonly CONFIG_FILE: "config.json";
|
|
10663
|
+
/** Input files directory */
|
|
10664
|
+
readonly INPUT_DIR: "input";
|
|
10665
|
+
/** Configuration files directory */
|
|
10666
|
+
readonly CONFIG_DIR: "config";
|
|
10667
|
+
};
|
|
10668
|
+
|
|
10669
|
+
/**
|
|
10670
|
+
* ZIP archive creator using fflate for universal compatibility
|
|
10671
|
+
* @public
|
|
10672
|
+
*/
|
|
10673
|
+
declare class ZipArchiveCreator {
|
|
10674
|
+
/**
|
|
10675
|
+
* Create a ZIP archive buffer from a supplied buffer
|
|
10676
|
+
* @param options - Input paths and configuration
|
|
10677
|
+
* @param onProgress - Optional progress callback
|
|
10678
|
+
* @returns Result containing ZIP buffer and manifest
|
|
10679
|
+
*/
|
|
10680
|
+
createFromBuffer(options: ZipArchiveOptions, onProgress?: ZipArchiveProgressCallback): Promise<Result<IZipArchiveResult>>;
|
|
10681
|
+
/**
|
|
10682
|
+
* Add a single FileTree item to the ZIP archive
|
|
10683
|
+
* @param files - ZIP files collection
|
|
10684
|
+
* @param fileItem - FileTree file item to add
|
|
10685
|
+
* @param archivePath - Path within the archive
|
|
10686
|
+
* @returns Result indicating success or failure
|
|
10687
|
+
*/
|
|
10688
|
+
private _addFileTreeItemToZip;
|
|
10689
|
+
/**
|
|
10690
|
+
* Add a directory recursively to the ZIP archive using FileTree
|
|
10691
|
+
* @param files - ZIP files collection
|
|
10692
|
+
* @param directoryItem - FileTree directory item to add
|
|
10693
|
+
* @param archivePrefix - Prefix path within the archive
|
|
10694
|
+
* @param onProgress - Optional progress callback
|
|
10695
|
+
* @returns Result indicating success or failure
|
|
10696
|
+
*/
|
|
10697
|
+
private _addDirectoryTreeToZip;
|
|
10698
|
+
private _getInputFileTreeItem;
|
|
10699
|
+
private _getConfigFileTreeItem;
|
|
10700
|
+
}
|
|
10701
|
+
|
|
10702
|
+
/**
|
|
10703
|
+
* Validator for ZIP archive input information
|
|
10704
|
+
* @public
|
|
10705
|
+
*/
|
|
10706
|
+
declare const zipArchiveInputInfo: Validator<Json_2.IZipArchiveInputInfo>;
|
|
10707
|
+
|
|
10708
|
+
/**
|
|
10709
|
+
* Validator for ZIP archive input type
|
|
10710
|
+
* @public
|
|
10711
|
+
*/
|
|
10712
|
+
declare const zipArchiveInputType: Validator<'file' | 'directory'>;
|
|
10713
|
+
|
|
10714
|
+
/**
|
|
10715
|
+
* ZIP archive loader extending ts-extras foundation
|
|
10716
|
+
* @public
|
|
10717
|
+
*/
|
|
10718
|
+
declare class ZipArchiveLoader {
|
|
10719
|
+
/**
|
|
10720
|
+
* Load ZIP archive from File object (Browser)
|
|
10721
|
+
* @param file - File object from file input
|
|
10722
|
+
* @param options - Loading options
|
|
10723
|
+
* @param onProgress - Optional progress callback
|
|
10724
|
+
* @returns Result containing loaded archive data
|
|
10725
|
+
*/
|
|
10726
|
+
loadFromFile(file: File, options?: IZipArchiveLoadOptions, onProgress?: ZipArchiveProgressCallback): Promise<Result<IZipArchiveLoadResult>>;
|
|
10727
|
+
/**
|
|
10728
|
+
* Load ZIP archive from ArrayBuffer (Universal)
|
|
10729
|
+
* @param buffer - ZIP data buffer
|
|
10730
|
+
* @param options - Loading options
|
|
10731
|
+
* @param onProgress - Optional progress callback
|
|
10732
|
+
* @returns Result containing loaded archive data
|
|
10733
|
+
*/
|
|
10734
|
+
loadFromBuffer(buffer: ArrayBuffer, options?: IZipArchiveLoadOptions, onProgress?: ZipArchiveProgressCallback): Promise<Result<IZipArchiveLoadResult>>;
|
|
10735
|
+
/**
|
|
10736
|
+
* Load manifest from ZIP using ZipFileTreeAccessors
|
|
10737
|
+
* @param zipAccessors - ZIP file tree accessors
|
|
10738
|
+
* @returns Result containing parsed manifest
|
|
10739
|
+
*/
|
|
10740
|
+
private _loadManifestFromAccessors;
|
|
10741
|
+
/**
|
|
10742
|
+
* Load configuration from ZIP using ZipFileTreeAccessors
|
|
10743
|
+
* @param zipAccessors - ZIP file tree accessors
|
|
10744
|
+
* @param manifest - Parsed manifest (may be undefined)
|
|
10745
|
+
* @param options - Loading options
|
|
10746
|
+
* @returns Result containing parsed configuration
|
|
10747
|
+
*/
|
|
10748
|
+
private _loadConfigurationFromAccessors;
|
|
10749
|
+
/**
|
|
10750
|
+
* Extract files and directory structure from ZIP
|
|
10751
|
+
* @param zipAccessors - ZIP file tree accessors
|
|
10752
|
+
* @param onProgress - Optional progress callback
|
|
10753
|
+
* @returns Result containing files and directory structure
|
|
10754
|
+
*/
|
|
10755
|
+
private _extractFilesFromAccessors;
|
|
10756
|
+
/**
|
|
10757
|
+
* Recursively process file tree items
|
|
10758
|
+
* @param zipAccessors - ZIP file tree accessors
|
|
10759
|
+
* @param currentPath - Current directory path
|
|
10760
|
+
* @param items - Items to process
|
|
10761
|
+
* @param files - Files collection
|
|
10762
|
+
* @param directories - Directories collection
|
|
10763
|
+
* @param onProgress - Optional progress callback
|
|
10764
|
+
* @param processed - Processing counter
|
|
10765
|
+
*/
|
|
10766
|
+
private _processFileTreeItems;
|
|
10767
|
+
/**
|
|
10768
|
+
* Build directory structure from files
|
|
10769
|
+
* @param files - Extracted files
|
|
10770
|
+
* @param directories - Directories map
|
|
10771
|
+
* @returns Root directory structure or null
|
|
10772
|
+
*/
|
|
10773
|
+
private _buildDirectoryStructure;
|
|
10774
|
+
/**
|
|
10775
|
+
* Get file MIME type based on extension
|
|
10776
|
+
* @param filename - Filename
|
|
10777
|
+
* @returns MIME type
|
|
10778
|
+
*/
|
|
10779
|
+
private _getFileType;
|
|
10780
|
+
}
|
|
10781
|
+
|
|
10782
|
+
/**
|
|
10783
|
+
* Validator for ZIP archive manifest
|
|
10784
|
+
* Compatible with existing tools from ts-res-browser-cli
|
|
10785
|
+
* @public
|
|
10786
|
+
*/
|
|
10787
|
+
declare const zipArchiveManifest: Validator<Json_2.IZipArchiveManifest>;
|
|
10788
|
+
|
|
10789
|
+
/**
|
|
10790
|
+
* Options for creating a ZIP archive buffer
|
|
10791
|
+
* @public
|
|
10792
|
+
*/
|
|
10793
|
+
declare type ZipArchiveOptions = IZipArchivePathOptions | IZipArchiveFileTreeOptions;
|
|
10794
|
+
|
|
10795
|
+
/**
|
|
10796
|
+
* Progress callback for ZIP operations
|
|
10797
|
+
* @public
|
|
10798
|
+
*/
|
|
10799
|
+
declare type ZipArchiveProgressCallback = (stage: 'reading-file' | 'parsing-zip' | 'loading-manifest' | 'loading-config' | 'extracting-files' | 'processing-resources' | 'creating-zip', progress: number, // 0-100
|
|
10800
|
+
details: string) => void;
|
|
10801
|
+
|
|
8813
10802
|
export { }
|