@fgv/ts-res 5.0.0-3 → 5.0.0-31
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/README.md +794 -137
- package/dist/ts-res.d.ts +2671 -355
- package/dist/tsdoc-metadata.json +1 -1
- package/eslint.config.js +16 -0
- package/lib/index.d.ts +11 -2
- package/lib/index.js +25 -2
- package/lib/packlets/bundle/bundleBuilder.d.ts +41 -0
- package/lib/packlets/bundle/bundleBuilder.js +134 -0
- package/lib/packlets/bundle/bundleLoader.d.ts +72 -0
- package/lib/packlets/bundle/bundleLoader.js +105 -0
- package/lib/packlets/bundle/bundleNormalizer.d.ts +73 -0
- package/lib/packlets/bundle/bundleNormalizer.js +142 -0
- package/lib/packlets/bundle/bundleUtils.d.ts +70 -0
- package/lib/packlets/bundle/bundleUtils.js +117 -0
- package/lib/packlets/bundle/convert.d.ts +33 -0
- package/lib/packlets/bundle/convert.js +78 -0
- package/lib/packlets/bundle/index.d.ts +21 -0
- package/lib/packlets/bundle/index.js +83 -0
- package/lib/packlets/bundle/model.d.ts +100 -0
- package/lib/packlets/bundle/model.js +24 -0
- package/lib/packlets/common/convert.d.ts +15 -0
- package/lib/packlets/common/convert.js +16 -1
- package/lib/packlets/common/helpers/context.js +1 -0
- package/lib/packlets/common/helpers/resources.d.ts +7 -0
- package/lib/packlets/common/helpers/resources.js +13 -0
- package/lib/packlets/common/resources.d.ts +48 -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 +14 -5
- package/lib/packlets/resource-types/jsonResourceType.js +8 -4
- package/lib/packlets/resource-types/resourceType.d.ts +115 -14
- 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 +26 -0
- package/lib/packlets/resources/index.d.ts +2 -0
- package/lib/packlets/resources/index.js +2 -0
- package/lib/packlets/resources/resource.d.ts +6 -6
- package/lib/packlets/resources/resource.js +5 -10
- package/lib/packlets/resources/resourceBuilder.d.ts +6 -0
- package/lib/packlets/resources/resourceBuilder.js +4 -1
- package/lib/packlets/resources/resourceCandidate.d.ts +15 -2
- package/lib/packlets/resources/resourceCandidate.js +17 -5
- package/lib/packlets/resources/resourceManagerBuilder.d.ts +189 -11
- package/lib/packlets/resources/resourceManagerBuilder.js +481 -17
- package/lib/packlets/runtime/cacheListener.d.ts +9 -0
- package/lib/packlets/runtime/cacheListener.js +6 -0
- package/lib/packlets/runtime/cacheMetrics.d.ts +6 -0
- package/lib/packlets/runtime/cacheMetrics.js +11 -0
- package/lib/packlets/runtime/compiledResourceCollection.d.ts +23 -11
- package/lib/packlets/runtime/compiledResourceCollection.js +65 -28
- package/lib/packlets/runtime/conditionSetResolutionResult.js +3 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +53 -3
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +82 -37
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +49 -77
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +23 -2
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +53 -31
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +4 -4
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +2 -2
- package/lib/packlets/runtime/iResourceManager.d.ts +13 -5
- package/lib/packlets/runtime/index.d.ts +1 -0
- package/lib/packlets/runtime/index.js +1 -0
- package/lib/packlets/runtime/resource-tree/common.d.ts +1 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +7 -7
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +5 -5
- package/lib/packlets/runtime/resourceResolver.d.ts +60 -1
- package/lib/packlets/runtime/resourceResolver.js +89 -45
- 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 +285 -0
- package/package.json +26 -32
- package/CLAUDE.md +0 -186
- package/EXAMPLE_INIT_PARAMS.md +0 -88
- package/PROGRESS_SUMMARY.md +0 -48
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/packlets/common/conditions.d.ts.map +0 -1
- package/lib/packlets/common/conditions.js.map +0 -1
- package/lib/packlets/common/convert.d.ts.map +0 -1
- package/lib/packlets/common/convert.js.map +0 -1
- package/lib/packlets/common/helpers/conditions.d.ts.map +0 -1
- package/lib/packlets/common/helpers/conditions.js.map +0 -1
- package/lib/packlets/common/helpers/context.d.ts.map +0 -1
- package/lib/packlets/common/helpers/context.js.map +0 -1
- package/lib/packlets/common/helpers/index.d.ts.map +0 -1
- package/lib/packlets/common/helpers/index.js.map +0 -1
- package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +0 -1
- package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +0 -1
- package/lib/packlets/common/helpers/resources.d.ts.map +0 -1
- package/lib/packlets/common/helpers/resources.js.map +0 -1
- package/lib/packlets/common/index.d.ts.map +0 -1
- package/lib/packlets/common/index.js.map +0 -1
- package/lib/packlets/common/resources.d.ts.map +0 -1
- package/lib/packlets/common/resources.js.map +0 -1
- package/lib/packlets/common/validate/conditions.d.ts.map +0 -1
- package/lib/packlets/common/validate/conditions.js.map +0 -1
- package/lib/packlets/common/validate/index.d.ts.map +0 -1
- package/lib/packlets/common/validate/index.js.map +0 -1
- package/lib/packlets/common/validate/regularExpressions.d.ts.map +0 -1
- package/lib/packlets/common/validate/regularExpressions.js.map +0 -1
- package/lib/packlets/common/validate/resources.d.ts.map +0 -1
- package/lib/packlets/common/validate/resources.js.map +0 -1
- package/lib/packlets/conditions/condition.d.ts.map +0 -1
- package/lib/packlets/conditions/condition.js.map +0 -1
- package/lib/packlets/conditions/conditionCollector.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionCollector.js.map +0 -1
- package/lib/packlets/conditions/conditionDecls.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionDecls.js.map +0 -1
- package/lib/packlets/conditions/conditionSet.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionSet.js.map +0 -1
- package/lib/packlets/conditions/conditionSetCollector.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionSetCollector.js.map +0 -1
- package/lib/packlets/conditions/conditionSetDecls.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionSetDecls.js.map +0 -1
- package/lib/packlets/conditions/conditionToken.d.ts.map +0 -1
- package/lib/packlets/conditions/conditionToken.js.map +0 -1
- package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +0 -1
- package/lib/packlets/conditions/convert/conditionSetDecls.js.map +0 -1
- package/lib/packlets/conditions/convert/decls.d.ts.map +0 -1
- package/lib/packlets/conditions/convert/decls.js.map +0 -1
- package/lib/packlets/conditions/convert/index.d.ts.map +0 -1
- package/lib/packlets/conditions/convert/index.js.map +0 -1
- package/lib/packlets/conditions/index.d.ts.map +0 -1
- package/lib/packlets/conditions/index.js.map +0 -1
- package/lib/packlets/config/common.d.ts.map +0 -1
- package/lib/packlets/config/common.js.map +0 -1
- package/lib/packlets/config/convert.d.ts.map +0 -1
- package/lib/packlets/config/convert.js.map +0 -1
- package/lib/packlets/config/index.d.ts.map +0 -1
- package/lib/packlets/config/index.js.map +0 -1
- package/lib/packlets/config/json.d.ts.map +0 -1
- package/lib/packlets/config/json.js.map +0 -1
- package/lib/packlets/config/predefined/default.d.ts.map +0 -1
- package/lib/packlets/config/predefined/default.js.map +0 -1
- package/lib/packlets/config/predefined/extended.d.ts.map +0 -1
- package/lib/packlets/config/predefined/extended.js.map +0 -1
- package/lib/packlets/config/predefined/index.d.ts.map +0 -1
- package/lib/packlets/config/predefined/index.js.map +0 -1
- package/lib/packlets/config/systemConfiguration.d.ts.map +0 -1
- package/lib/packlets/config/systemConfiguration.js.map +0 -1
- package/lib/packlets/context/contextDecls.d.ts.map +0 -1
- package/lib/packlets/context/contextDecls.js.map +0 -1
- package/lib/packlets/context/contextToken.d.ts.map +0 -1
- package/lib/packlets/context/contextToken.js.map +0 -1
- package/lib/packlets/context/convert/decls.d.ts.map +0 -1
- package/lib/packlets/context/convert/decls.js.map +0 -1
- package/lib/packlets/context/convert/index.d.ts.map +0 -1
- package/lib/packlets/context/convert/index.js.map +0 -1
- package/lib/packlets/context/index.d.ts.map +0 -1
- package/lib/packlets/context/index.js.map +0 -1
- package/lib/packlets/decisions/abstractDecision.d.ts.map +0 -1
- package/lib/packlets/decisions/abstractDecision.js.map +0 -1
- package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +0 -1
- package/lib/packlets/decisions/abstractDecisionCollector.js.map +0 -1
- package/lib/packlets/decisions/candidate.d.ts.map +0 -1
- package/lib/packlets/decisions/candidate.js.map +0 -1
- package/lib/packlets/decisions/common.d.ts.map +0 -1
- package/lib/packlets/decisions/common.js.map +0 -1
- package/lib/packlets/decisions/concreteDecision.d.ts.map +0 -1
- package/lib/packlets/decisions/concreteDecision.js.map +0 -1
- package/lib/packlets/decisions/decision.d.ts.map +0 -1
- package/lib/packlets/decisions/decision.js.map +0 -1
- package/lib/packlets/decisions/index.d.ts.map +0 -1
- package/lib/packlets/decisions/index.js.map +0 -1
- package/lib/packlets/import/fsItem.d.ts.map +0 -1
- package/lib/packlets/import/fsItem.js.map +0 -1
- package/lib/packlets/import/importContext.d.ts.map +0 -1
- package/lib/packlets/import/importContext.js.map +0 -1
- package/lib/packlets/import/importManager.d.ts.map +0 -1
- package/lib/packlets/import/importManager.js.map +0 -1
- package/lib/packlets/import/importable.d.ts.map +0 -1
- package/lib/packlets/import/importable.js.map +0 -1
- package/lib/packlets/import/importers/collectionImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/collectionImporter.js.map +0 -1
- package/lib/packlets/import/importers/fsItemImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/fsItemImporter.js.map +0 -1
- package/lib/packlets/import/importers/importer.d.ts.map +0 -1
- package/lib/packlets/import/importers/importer.js.map +0 -1
- package/lib/packlets/import/importers/index.d.ts.map +0 -1
- package/lib/packlets/import/importers/index.js.map +0 -1
- package/lib/packlets/import/importers/jsonImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/jsonImporter.js.map +0 -1
- package/lib/packlets/import/importers/pathImporter.d.ts.map +0 -1
- package/lib/packlets/import/importers/pathImporter.js.map +0 -1
- package/lib/packlets/import/index.d.ts.map +0 -1
- package/lib/packlets/import/index.js.map +0 -1
- package/lib/packlets/qualifier-types/config/convert.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/config/convert.js.map +0 -1
- package/lib/packlets/qualifier-types/config/index.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/config/index.js.map +0 -1
- package/lib/packlets/qualifier-types/config/json.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/config/json.js.map +0 -1
- package/lib/packlets/qualifier-types/convert.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/convert.js.map +0 -1
- package/lib/packlets/qualifier-types/helpers.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/helpers.js.map +0 -1
- package/lib/packlets/qualifier-types/index.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/index.js.map +0 -1
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/languageQualifierType.js.map +0 -1
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/literalQualifierType.js.map +0 -1
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +0 -1
- package/lib/packlets/qualifier-types/qualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/qualifierType.js.map +0 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +0 -1
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +0 -1
- package/lib/packlets/qualifier-types/territoryQualifierType.js.map +0 -1
- package/lib/packlets/qualifiers/convert/decls.d.ts.map +0 -1
- package/lib/packlets/qualifiers/convert/decls.js.map +0 -1
- package/lib/packlets/qualifiers/convert/index.d.ts.map +0 -1
- package/lib/packlets/qualifiers/convert/index.js.map +0 -1
- package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +0 -1
- package/lib/packlets/qualifiers/convert/qualifier.js.map +0 -1
- package/lib/packlets/qualifiers/index.d.ts.map +0 -1
- package/lib/packlets/qualifiers/index.js.map +0 -1
- package/lib/packlets/qualifiers/qualifier.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifier.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierCollector.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierDecl.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +0 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +0 -1
- package/lib/packlets/resource-json/compiled/common.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/common.js.map +0 -1
- package/lib/packlets/resource-json/compiled/convert.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/convert.js.map +0 -1
- package/lib/packlets/resource-json/compiled/index.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/index.js.map +0 -1
- package/lib/packlets/resource-json/compiled/json.d.ts.map +0 -1
- package/lib/packlets/resource-json/compiled/json.js.map +0 -1
- package/lib/packlets/resource-json/convert.d.ts.map +0 -1
- package/lib/packlets/resource-json/convert.js.map +0 -1
- package/lib/packlets/resource-json/helpers.d.ts.map +0 -1
- package/lib/packlets/resource-json/helpers.js.map +0 -1
- package/lib/packlets/resource-json/index.d.ts.map +0 -1
- package/lib/packlets/resource-json/index.js.map +0 -1
- package/lib/packlets/resource-json/json.d.ts.map +0 -1
- package/lib/packlets/resource-json/json.js.map +0 -1
- package/lib/packlets/resource-json/normalized.d.ts.map +0 -1
- package/lib/packlets/resource-json/normalized.js.map +0 -1
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +0 -1
- package/lib/packlets/resource-json/resourceDeclCollection.js.map +0 -1
- package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +0 -1
- package/lib/packlets/resource-json/resourceDeclContainer.js.map +0 -1
- package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +0 -1
- package/lib/packlets/resource-json/resourceDeclTree.js.map +0 -1
- package/lib/packlets/resource-types/config/convert.d.ts.map +0 -1
- package/lib/packlets/resource-types/config/convert.js.map +0 -1
- package/lib/packlets/resource-types/config/index.d.ts.map +0 -1
- package/lib/packlets/resource-types/config/index.js.map +0 -1
- package/lib/packlets/resource-types/config/json.d.ts.map +0 -1
- package/lib/packlets/resource-types/config/json.js.map +0 -1
- package/lib/packlets/resource-types/helpers.d.ts.map +0 -1
- package/lib/packlets/resource-types/helpers.js.map +0 -1
- package/lib/packlets/resource-types/index.d.ts.map +0 -1
- package/lib/packlets/resource-types/index.js.map +0 -1
- package/lib/packlets/resource-types/jsonResourceType.d.ts.map +0 -1
- package/lib/packlets/resource-types/jsonResourceType.js.map +0 -1
- package/lib/packlets/resource-types/resourceType.d.ts.map +0 -1
- package/lib/packlets/resource-types/resourceType.js.map +0 -1
- package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +0 -1
- package/lib/packlets/resource-types/resourceTypeCollector.js.map +0 -1
- package/lib/packlets/resources/candidateReducer.d.ts.map +0 -1
- package/lib/packlets/resources/candidateReducer.js.map +0 -1
- package/lib/packlets/resources/common.d.ts.map +0 -1
- package/lib/packlets/resources/common.js.map +0 -1
- package/lib/packlets/resources/index.d.ts.map +0 -1
- package/lib/packlets/resources/index.js.map +0 -1
- package/lib/packlets/resources/resource.d.ts.map +0 -1
- package/lib/packlets/resources/resource.js.map +0 -1
- package/lib/packlets/resources/resourceBuilder.d.ts.map +0 -1
- package/lib/packlets/resources/resourceBuilder.js.map +0 -1
- package/lib/packlets/resources/resourceCandidate.d.ts.map +0 -1
- package/lib/packlets/resources/resourceCandidate.js.map +0 -1
- package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +0 -1
- package/lib/packlets/resources/resourceManagerBuilder.js.map +0 -1
- package/lib/packlets/runtime/cacheListener.d.ts.map +0 -1
- package/lib/packlets/runtime/cacheListener.js.map +0 -1
- package/lib/packlets/runtime/cacheMetrics.d.ts.map +0 -1
- package/lib/packlets/runtime/cacheMetrics.js.map +0 -1
- package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +0 -1
- package/lib/packlets/runtime/compiledResourceCollection.js.map +0 -1
- package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +0 -1
- package/lib/packlets/runtime/conditionSetResolutionResult.js.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProvider.js.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +0 -1
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +0 -1
- package/lib/packlets/runtime/context/index.d.ts.map +0 -1
- package/lib/packlets/runtime/context/index.js.map +0 -1
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +0 -1
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +0 -1
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +0 -1
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +0 -1
- package/lib/packlets/runtime/iResourceManager.d.ts.map +0 -1
- package/lib/packlets/runtime/iResourceManager.js.map +0 -1
- package/lib/packlets/runtime/index.d.ts.map +0 -1
- package/lib/packlets/runtime/index.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/common.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/common.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/index.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/index.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +0 -1
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +0 -1
- package/lib/packlets/runtime/resourceResolver.d.ts.map +0 -1
- package/lib/packlets/runtime/resourceResolver.js.map +0 -1
- package/lib/packlets/runtime/validate.d.ts.map +0 -1
- package/lib/packlets/runtime/validate.js.map +0 -1
package/dist/ts-res.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Brand } from '@fgv/ts-utils';
|
|
2
2
|
import { Collections } from '@fgv/ts-utils';
|
|
3
3
|
import { Converter } from '@fgv/ts-utils';
|
|
4
|
+
import { Converters } from '@fgv/ts-json-base';
|
|
4
5
|
import { DetailedResult } from '@fgv/ts-utils';
|
|
5
|
-
import { FileTree } from '@fgv/ts-
|
|
6
|
+
import { FileTree } from '@fgv/ts-json-base';
|
|
7
|
+
import { Hash } from '@fgv/ts-utils';
|
|
6
8
|
import { ICollectible } from '@fgv/ts-utils';
|
|
7
9
|
import { IReadOnlyResultMap } from '@fgv/ts-utils';
|
|
10
|
+
import { JsonCompatible } from '@fgv/ts-json-base';
|
|
8
11
|
import { JsonObject } from '@fgv/ts-json-base';
|
|
9
12
|
import { JsonValue } from '@fgv/ts-json-base';
|
|
10
13
|
import { ObjectConverter } from '@fgv/ts-utils';
|
|
@@ -13,6 +16,7 @@ import { ResultMap } from '@fgv/ts-utils';
|
|
|
13
16
|
import { ValidatingCollector } from '@fgv/ts-utils';
|
|
14
17
|
import { ValidatingConvertingCollector } from '@fgv/ts-utils';
|
|
15
18
|
import { ValidatingResultMap } from '@fgv/ts-utils';
|
|
19
|
+
import { Validator } from '@fgv/ts-utils';
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
* An abstract decision represents a class of decisions with candidates
|
|
@@ -130,6 +134,63 @@ declare const allPredefinedSystemConfigurations: ReadonlyArray<PredefinedSystemC
|
|
|
130
134
|
*/
|
|
131
135
|
export declare const allResourceValueMergeMethods: ResourceValueMergeMethod[];
|
|
132
136
|
|
|
137
|
+
/**
|
|
138
|
+
* A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.
|
|
139
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.
|
|
140
|
+
* @public
|
|
141
|
+
*/
|
|
142
|
+
declare const anyQualifierTypeConfig: Converter<Model_2.IAnyQualifierTypeConfig, unknown>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Base implementation class containing shared validation logic for both read-only and mutable validators.
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
declare abstract class BaseContextQualifierProviderValidator<T extends IContextQualifierProvider = IContextQualifierProvider> implements IContextQualifierProviderValidatorBase<T> {
|
|
149
|
+
/**
|
|
150
|
+
* The wrapped context qualifier provider.
|
|
151
|
+
*/
|
|
152
|
+
abstract readonly provider: T;
|
|
153
|
+
/**
|
|
154
|
+
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
155
|
+
*/
|
|
156
|
+
get qualifiers(): IReadOnlyQualifierCollector;
|
|
157
|
+
/**
|
|
158
|
+
* Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
|
|
159
|
+
* @param name - The string name to convert and look up.
|
|
160
|
+
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
161
|
+
* or `Failure` with an error message if not found or an error occurs.
|
|
162
|
+
*/
|
|
163
|
+
get(name: string): Result<QualifierContextValue>;
|
|
164
|
+
/**
|
|
165
|
+
* Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
|
|
166
|
+
* @param index - The number index to convert and look up.
|
|
167
|
+
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
168
|
+
* or `Failure` with an error message if not found or an error occurs.
|
|
169
|
+
*/
|
|
170
|
+
getByIndex(index: number): Result<QualifierContextValue>;
|
|
171
|
+
/**
|
|
172
|
+
* Gets a validated qualifier context value by its string name.
|
|
173
|
+
* @param name - The string name to convert and look up.
|
|
174
|
+
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
175
|
+
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
176
|
+
*/
|
|
177
|
+
getValidated(name: string): Result<QualifierContextValue>;
|
|
178
|
+
/**
|
|
179
|
+
* Gets a validated qualifier context value by its number index.
|
|
180
|
+
* @param index - The number index to convert and look up.
|
|
181
|
+
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
182
|
+
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
183
|
+
*/
|
|
184
|
+
getValidatedByIndex(index: number): Result<QualifierContextValue>;
|
|
185
|
+
/**
|
|
186
|
+
* Checks if a qualifier value exists with the given string name.
|
|
187
|
+
* @param name - The string name to convert and check.
|
|
188
|
+
* @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
|
|
189
|
+
* or `Failure` with an error message if an error occurs during the check.
|
|
190
|
+
*/
|
|
191
|
+
has(name: string): Result<boolean>;
|
|
192
|
+
}
|
|
193
|
+
|
|
133
194
|
/**
|
|
134
195
|
* Converts an array of {@link Helpers.IConditionTokenParts | condition token parts} into an array of
|
|
135
196
|
* syntactically validated {@link ConditionToken | condition tokens}.
|
|
@@ -178,6 +239,283 @@ declare function buildQualifierDefaultValuesToken(parts: ReadonlyArray<IQualifie
|
|
|
178
239
|
*/
|
|
179
240
|
declare function buildQualifierDefaultValueToken({ qualifier, value }: IQualifierDefaultValueTokenParts): Result<QualifierDefaultValueToken>;
|
|
180
241
|
|
|
242
|
+
/**
|
|
243
|
+
* A factory that creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from
|
|
244
|
+
* {@link QualifierTypes.Config.IAnyQualifierTypeConfig | any qualifier type configuration}.
|
|
245
|
+
* @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}
|
|
246
|
+
* if successful, `Failure` with an error message otherwise.
|
|
247
|
+
* @public
|
|
248
|
+
*/
|
|
249
|
+
declare class BuiltInQualifierTypeFactory implements IConfigInitFactory<QualifierTypes.Config.ISystemQualifierTypeConfig, SystemQualifierType> {
|
|
250
|
+
/** {@inheritDoc Config.IConfigInitFactory.create} */
|
|
251
|
+
create(config: QualifierTypes.Config.IAnyQualifierTypeConfig): Result<SystemQualifierType>;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* A factory that creates a {@link ResourceTypes.ResourceType | ResourceType} from a {@link ResourceTypes.Config.IResourceTypeConfig | resource type configuration}.
|
|
256
|
+
* @public
|
|
257
|
+
*/
|
|
258
|
+
declare class BuiltInResourceTypeFactory implements IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> {
|
|
259
|
+
/** {@inheritDoc Config.IConfigInitFactory.create} */
|
|
260
|
+
create(config: ResourceTypes.Config.IResourceTypeConfig): Result<ResourceType>;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
declare namespace Bundle {
|
|
264
|
+
export {
|
|
265
|
+
IBundleMetadata,
|
|
266
|
+
IBundleExportMetadata,
|
|
267
|
+
IBundle,
|
|
268
|
+
IBundleCreateParams,
|
|
269
|
+
BundleBuilder,
|
|
270
|
+
BundleLoader,
|
|
271
|
+
IBundleLoaderCreateParams,
|
|
272
|
+
BundleUtils,
|
|
273
|
+
IBundleComponents,
|
|
274
|
+
Model_4 as Model,
|
|
275
|
+
Convert_10 as Convert,
|
|
276
|
+
BundleNormalizer
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
export { Bundle }
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* `Converter` for a {@link Bundle.IBundle | bundle} object.
|
|
283
|
+
* @public
|
|
284
|
+
*/
|
|
285
|
+
declare const bundle: Converter<IBundle>;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Builder for creating resource bundles from a ResourceManagerBuilder.
|
|
289
|
+
* Handles the compilation, configuration extraction, and integrity verification
|
|
290
|
+
* needed to create a complete, portable bundle.
|
|
291
|
+
* @public
|
|
292
|
+
*/
|
|
293
|
+
export declare class BundleBuilder {
|
|
294
|
+
/**
|
|
295
|
+
* Creates a resource bundle from a ResourceManagerBuilder.
|
|
296
|
+
* @param builder - The ResourceManagerBuilder containing the resources to bundle
|
|
297
|
+
* @param systemConfig - The SystemConfiguration used to create the builder
|
|
298
|
+
* @param params - Optional parameters for bundle creation
|
|
299
|
+
* @returns Success with the created bundle if successful, Failure with error message otherwise
|
|
300
|
+
* @public
|
|
301
|
+
*/
|
|
302
|
+
static create(builder: ResourceManagerBuilder, systemConfig: SystemConfiguration, params?: IBundleCreateParams): Result<IBundle>;
|
|
303
|
+
/**
|
|
304
|
+
* Creates a resource bundle from a ResourceManagerBuilder using a predefined system configuration.
|
|
305
|
+
* This is a convenience method for the common case of using predefined configurations.
|
|
306
|
+
* @param builder - The ResourceManagerBuilder containing the resources to bundle
|
|
307
|
+
* @param configName - The name of the predefined system configuration used
|
|
308
|
+
* @param params - Optional parameters for bundle creation
|
|
309
|
+
* @returns Success with the created bundle if successful, Failure with error message otherwise
|
|
310
|
+
* @public
|
|
311
|
+
*/
|
|
312
|
+
static createFromPredefined(builder: ResourceManagerBuilder, configName: PredefinedSystemConfiguration, params?: IBundleCreateParams): Result<IBundle>;
|
|
313
|
+
/**
|
|
314
|
+
* Generates a hash checksum for the compiled resource collection.
|
|
315
|
+
* The checksum is calculated using the provided hash normalizer.
|
|
316
|
+
* @param compiledCollection - The compiled resource collection to generate checksum for
|
|
317
|
+
* @param hashNormalizer - The hash normalizer to use for checksum generation
|
|
318
|
+
* @returns Success with the checksum string if successful, Failure otherwise
|
|
319
|
+
* @internal
|
|
320
|
+
*/
|
|
321
|
+
private static _generateChecksum;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* `Converter` for {@link Bundle.IBundleCreateParams | bundle creation parameters}.
|
|
326
|
+
* @public
|
|
327
|
+
*/
|
|
328
|
+
declare const bundleCreateParams: Converter<IBundleCreateParams>;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* `Converter` for {@link Bundle.IBundleExportMetadata | bundle export metadata}.
|
|
332
|
+
* @public
|
|
333
|
+
*/
|
|
334
|
+
declare const bundleExportMetadata: Converter<IBundleExportMetadata>;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Loader for creating an IResourceManager from a resource bundle.
|
|
338
|
+
* Handles integrity verification and reconstruction of the runtime resource manager.
|
|
339
|
+
* @public
|
|
340
|
+
*/
|
|
341
|
+
export declare class BundleLoader {
|
|
342
|
+
/**
|
|
343
|
+
* Creates an IResourceManager from a resource bundle.
|
|
344
|
+
* @param params - Parameters for bundle loading including the bundle and options
|
|
345
|
+
* @returns Success with the IResourceManager if successful, Failure with error message otherwise
|
|
346
|
+
* @public
|
|
347
|
+
*/
|
|
348
|
+
static createManagerFromBundle(params: IBundleLoaderCreateParams): Result<IResourceManager>;
|
|
349
|
+
/**
|
|
350
|
+
* Verifies the integrity of a bundle by checking its checksum.
|
|
351
|
+
* @param bundle - The bundle to verify
|
|
352
|
+
* @param skipVerification - Whether to skip verification
|
|
353
|
+
* @param hashNormalizer - The hash normalizer to use for verification
|
|
354
|
+
* @returns Success if verification passes or is skipped, Failure otherwise
|
|
355
|
+
* @internal
|
|
356
|
+
*/
|
|
357
|
+
private static _verifyBundleIntegrity;
|
|
358
|
+
/**
|
|
359
|
+
* Generates a hash checksum for the compiled resource collection.
|
|
360
|
+
* @param compiledCollection - The compiled resource collection to generate checksum for
|
|
361
|
+
* @param hashNormalizer - The hash normalizer to use for checksum generation
|
|
362
|
+
* @returns Success with the checksum string if successful, Failure otherwise
|
|
363
|
+
* @internal
|
|
364
|
+
*/
|
|
365
|
+
private static _generateChecksum;
|
|
366
|
+
/**
|
|
367
|
+
* Creates a SystemConfiguration from the bundle's configuration.
|
|
368
|
+
* @param bundle - The bundle containing the configuration
|
|
369
|
+
* @returns Success with the SystemConfiguration if successful, Failure otherwise
|
|
370
|
+
* @internal
|
|
371
|
+
*/
|
|
372
|
+
private static _createSystemConfiguration;
|
|
373
|
+
/**
|
|
374
|
+
* Creates a CompiledResourceCollection from the bundle.
|
|
375
|
+
* @param bundle - The bundle to load
|
|
376
|
+
* @param qualifierTypes - The qualifier type collector from the system configuration
|
|
377
|
+
* @param resourceTypes - The resource type collector from the system configuration
|
|
378
|
+
* @returns Success with the CompiledResourceCollection if successful, Failure otherwise
|
|
379
|
+
* @internal
|
|
380
|
+
*/
|
|
381
|
+
private static _createCompiledResourceCollection;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* `Converter` for a {@link Bundle.IBundleMetadata | bundle metadata} object.
|
|
386
|
+
* @public
|
|
387
|
+
*/
|
|
388
|
+
declare const bundleMetadata: Converter<IBundleMetadata>;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Normalizes ResourceManagerBuilder instances to ensure consistent ordering
|
|
392
|
+
* of internal entities, enabling order-independent bundle checksums.
|
|
393
|
+
*
|
|
394
|
+
* The normalization process rebuilds the ResourceManagerBuilder from the ground up
|
|
395
|
+
* in a canonical order to ensure identical index assignments regardless of
|
|
396
|
+
* original construction order.
|
|
397
|
+
* @public
|
|
398
|
+
*/
|
|
399
|
+
declare class BundleNormalizer {
|
|
400
|
+
/**
|
|
401
|
+
* Creates a normalized ResourceManagerBuilder from an existing builder.
|
|
402
|
+
* The normalized builder will have identical entities but arranged in
|
|
403
|
+
* canonical order to ensure consistent index assignments.
|
|
404
|
+
*
|
|
405
|
+
* @param originalBuilder - The ResourceManagerBuilder to normalize
|
|
406
|
+
* @param systemConfig - The SystemConfiguration used to create the original builder
|
|
407
|
+
* @returns Success with the normalized ResourceManagerBuilder if successful, Failure otherwise
|
|
408
|
+
*/
|
|
409
|
+
static normalize(originalBuilder: ResourceManagerBuilder, systemConfig: SystemConfiguration): Result<ResourceManagerBuilder>;
|
|
410
|
+
/**
|
|
411
|
+
* Creates a normalized ResourceManagerBuilder using a predefined system configuration.
|
|
412
|
+
* This is a convenience method for the common case of using predefined configurations.
|
|
413
|
+
*
|
|
414
|
+
* @param originalBuilder - The ResourceManagerBuilder to normalize
|
|
415
|
+
* @param configName - The name of the predefined system configuration used
|
|
416
|
+
* @returns Success with the normalized ResourceManagerBuilder if successful, Failure otherwise
|
|
417
|
+
*/
|
|
418
|
+
static normalizeFromPredefined(originalBuilder: ResourceManagerBuilder, configName: PredefinedSystemConfiguration): Result<ResourceManagerBuilder>;
|
|
419
|
+
/**
|
|
420
|
+
* Normalizes all conditions from the original builder by adding them to the
|
|
421
|
+
* normalized builder in sorted order using loose condition declarations.
|
|
422
|
+
*
|
|
423
|
+
* @param originalBuilder - The source ResourceManagerBuilder
|
|
424
|
+
* @param normalizedBuilder - The target normalized ResourceManagerBuilder
|
|
425
|
+
* @returns Success if all conditions were normalized successfully, Failure otherwise
|
|
426
|
+
* @internal
|
|
427
|
+
*/
|
|
428
|
+
private static _normalizeConditions;
|
|
429
|
+
/**
|
|
430
|
+
* Normalizes all condition sets from the original builder by adding them to the
|
|
431
|
+
* normalized builder in sorted order using loose condition set declarations.
|
|
432
|
+
*
|
|
433
|
+
* @param originalBuilder - The source ResourceManagerBuilder
|
|
434
|
+
* @param normalizedBuilder - The target normalized ResourceManagerBuilder
|
|
435
|
+
* @returns Success if all condition sets were normalized successfully, Failure otherwise
|
|
436
|
+
* @internal
|
|
437
|
+
*/
|
|
438
|
+
private static _normalizeConditionSets;
|
|
439
|
+
/**
|
|
440
|
+
* Normalizes all candidates by sorting them first by resource ID, then by condition set.
|
|
441
|
+
*
|
|
442
|
+
* @param originalBuilder - The source ResourceManagerBuilder
|
|
443
|
+
* @param normalizedBuilder - The target normalized ResourceManagerBuilder
|
|
444
|
+
* @returns Success if all candidates were normalized successfully, Failure otherwise
|
|
445
|
+
* @internal
|
|
446
|
+
*/
|
|
447
|
+
private static _normalizeCandidates;
|
|
448
|
+
/**
|
|
449
|
+
* Adds normalized resources to the target builder by first normalizing conditions,
|
|
450
|
+
* then condition sets, then candidates.
|
|
451
|
+
*
|
|
452
|
+
* @param originalBuilder - The source ResourceManagerBuilder
|
|
453
|
+
* @param normalizedBuilder - The target normalized ResourceManagerBuilder
|
|
454
|
+
* @returns Success if all resources were added successfully, Failure otherwise
|
|
455
|
+
* @internal
|
|
456
|
+
*/
|
|
457
|
+
private static _addNormalizedResources;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Lightweight converter for bundle structure validation without full processing.
|
|
462
|
+
* Useful for detecting bundle files without the overhead of full validation.
|
|
463
|
+
* @public
|
|
464
|
+
*/
|
|
465
|
+
declare const bundleStructure: Converter<{
|
|
466
|
+
metadata: IBundleMetadata;
|
|
467
|
+
config: unknown;
|
|
468
|
+
compiledCollection: unknown;
|
|
469
|
+
}>;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Utility functions for working with resource bundles.
|
|
473
|
+
* Provides reusable logic for bundle detection, parsing, and component extraction.
|
|
474
|
+
* @public
|
|
475
|
+
*/
|
|
476
|
+
declare class BundleUtils {
|
|
477
|
+
/**
|
|
478
|
+
* Checks if the given object appears to be a bundle file by examining its structure.
|
|
479
|
+
* This is a lightweight check that doesn't perform full validation.
|
|
480
|
+
* @param data - The data to check
|
|
481
|
+
* @returns True if the data appears to be a bundle structure
|
|
482
|
+
* @public
|
|
483
|
+
*/
|
|
484
|
+
static isBundleFile(data: unknown): boolean;
|
|
485
|
+
/**
|
|
486
|
+
* Extracts and validates components from a bundle for reuse.
|
|
487
|
+
* Performs full validation of the bundle structure and creates typed components.
|
|
488
|
+
* @param bundleData - The raw bundle data to extract components from
|
|
489
|
+
* @returns Success with bundle components if valid, Failure with error message otherwise
|
|
490
|
+
* @public
|
|
491
|
+
*/
|
|
492
|
+
static extractBundleComponents(bundleData: unknown): Result<IBundleComponents>;
|
|
493
|
+
/**
|
|
494
|
+
* Extracts just the metadata from potential bundle data without full validation.
|
|
495
|
+
* Useful for displaying bundle information without processing the entire bundle.
|
|
496
|
+
* @param data - The data to extract metadata from
|
|
497
|
+
* @returns Success with metadata if found and valid, Failure otherwise
|
|
498
|
+
* @public
|
|
499
|
+
*/
|
|
500
|
+
static extractBundleMetadata(data: unknown): Result<IBundleMetadata>;
|
|
501
|
+
/**
|
|
502
|
+
* Parses bundle data from a JSON string.
|
|
503
|
+
* Convenience method that combines JSON parsing with bundle component extraction.
|
|
504
|
+
* @param jsonString - The JSON string containing bundle data
|
|
505
|
+
* @returns Success with bundle components if valid, Failure with error message otherwise
|
|
506
|
+
* @public
|
|
507
|
+
*/
|
|
508
|
+
static parseBundleFromJson(jsonString: string): Result<IBundleComponents>;
|
|
509
|
+
/**
|
|
510
|
+
* Checks if a file name suggests it might be a bundle file.
|
|
511
|
+
* This is a heuristic check based on file naming conventions.
|
|
512
|
+
* @param fileName - The file name to check
|
|
513
|
+
* @returns True if the file name suggests a bundle file
|
|
514
|
+
* @public
|
|
515
|
+
*/
|
|
516
|
+
static isBundleFileName(fileName: string): boolean;
|
|
517
|
+
}
|
|
518
|
+
|
|
181
519
|
/**
|
|
182
520
|
* Simple implementation of {@link Decisions.ICandidate | ICandidate} with
|
|
183
521
|
* helper methods for sorting and presentation.
|
|
@@ -227,6 +565,15 @@ declare class Candidate<TVALUE extends JsonValue = JsonValue> implements ICandid
|
|
|
227
565
|
*/
|
|
228
566
|
declare type CandidateAction = 'unchanged' | 'reduced' | 'suppressed';
|
|
229
567
|
|
|
568
|
+
/**
|
|
569
|
+
* The completeness of a resource candidate value. A full value is one that
|
|
570
|
+
* contains all of the required properties for the resource type. A partial
|
|
571
|
+
* value is one that contains some of the required properties for the resource
|
|
572
|
+
* type.
|
|
573
|
+
* @public
|
|
574
|
+
*/
|
|
575
|
+
export declare type CandidateCompleteness = 'full' | 'partial';
|
|
576
|
+
|
|
230
577
|
/**
|
|
231
578
|
* Manages candidate reduction logic for filtering and qualifier reduction operations.
|
|
232
579
|
* Encapsulates the state and logic needed to consistently process candidates for reduction.
|
|
@@ -292,6 +639,139 @@ declare class CandidateReducer {
|
|
|
292
639
|
reduceCandidate(candidate: ResourceCandidate): Result<IReducedCandidate | undefined>;
|
|
293
640
|
}
|
|
294
641
|
|
|
642
|
+
/**
|
|
643
|
+
* Implementation of a candidate value that stores normalized JSON data.
|
|
644
|
+
* The value is normalized on creation and a hash-based key is generated
|
|
645
|
+
* for efficient deduplication.
|
|
646
|
+
* @public
|
|
647
|
+
*/
|
|
648
|
+
declare class CandidateValue implements ICandidateValue {
|
|
649
|
+
private readonly _collectible;
|
|
650
|
+
private readonly _json;
|
|
651
|
+
/**
|
|
652
|
+
* The unique key for this candidate value.
|
|
653
|
+
*/
|
|
654
|
+
get key(): CandidateValueKey;
|
|
655
|
+
/**
|
|
656
|
+
* The index of this candidate value in the collection.
|
|
657
|
+
*/
|
|
658
|
+
get index(): CandidateValueIndex | undefined;
|
|
659
|
+
/**
|
|
660
|
+
* The normalized JSON value.
|
|
661
|
+
*/
|
|
662
|
+
get json(): JsonValue;
|
|
663
|
+
/**
|
|
664
|
+
* Constructor for a {@link Resources.CandidateValue} object.
|
|
665
|
+
* @param params - Parameters to create the candidate value.
|
|
666
|
+
* @internal
|
|
667
|
+
*/
|
|
668
|
+
protected constructor(params: ICandidateValueCreateParams);
|
|
669
|
+
/**
|
|
670
|
+
* Creates a new {@link Resources.CandidateValue} object.
|
|
671
|
+
* @param params - Parameters to create the candidate value.
|
|
672
|
+
* @returns `Success` with the new candidate value if successful,
|
|
673
|
+
* or `Failure` with an error message if not.
|
|
674
|
+
* @public
|
|
675
|
+
*/
|
|
676
|
+
static create(params: ICandidateValueCreateParams): Result<CandidateValue>;
|
|
677
|
+
/**
|
|
678
|
+
* Sets the index of this candidate value.
|
|
679
|
+
* @param index - The index to set.
|
|
680
|
+
* @returns `Success` with the index if successful, or `Failure` with an error message if not.
|
|
681
|
+
* @public
|
|
682
|
+
*/
|
|
683
|
+
setIndex(index: number): Result<CandidateValueIndex>;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* A `ValidatingCollector` for {@link Resources.CandidateValue | CandidateValues},
|
|
688
|
+
* which collects candidate values supplied as either {@link Resources.CandidateValue | CandidateValue} or
|
|
689
|
+
* `JsonValue`.
|
|
690
|
+
* @public
|
|
691
|
+
*/
|
|
692
|
+
declare class CandidateValueCollector extends ValidatingCollector<CandidateValue> {
|
|
693
|
+
readonly normalizer: Hash.HashingNormalizer;
|
|
694
|
+
/**
|
|
695
|
+
* Constructor for a {@link Resources.CandidateValueCollector} object.
|
|
696
|
+
* @param params - Parameters to create the collector.
|
|
697
|
+
* @internal
|
|
698
|
+
*/
|
|
699
|
+
protected constructor(params?: ICandidateValueCollectorCreateParams);
|
|
700
|
+
/**
|
|
701
|
+
* Creates a new {@link Resources.CandidateValueCollector} object.
|
|
702
|
+
* @param params - Parameters to create the collector.
|
|
703
|
+
* @returns `Success` with the new collector if successful,
|
|
704
|
+
* or `Failure` with an error message if not.
|
|
705
|
+
* @public
|
|
706
|
+
*/
|
|
707
|
+
static create(params?: ICandidateValueCollectorCreateParams): Result<CandidateValueCollector>;
|
|
708
|
+
/**
|
|
709
|
+
* Returns an array of JSON values ordered by their indices.
|
|
710
|
+
* @returns Array of JsonValue objects in index order.
|
|
711
|
+
* @public
|
|
712
|
+
*/
|
|
713
|
+
getValuesByIndex(): JsonValue[];
|
|
714
|
+
/**
|
|
715
|
+
* Converter method to handle CandidateValue | JsonValue.
|
|
716
|
+
* @param from - The value to convert.
|
|
717
|
+
* @returns `Success` with the CandidateValue if successful, or `Failure` with an error message if not.
|
|
718
|
+
* @internal
|
|
719
|
+
*/
|
|
720
|
+
private _toCandidateValue;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Branded number representing a validated candidate value index.
|
|
725
|
+
* Candidate value indices are used to identify candidate values
|
|
726
|
+
* within a resource set and to enable sharing of like values.
|
|
727
|
+
* @public
|
|
728
|
+
*/
|
|
729
|
+
export declare type CandidateValueIndex = Brand<number, 'CandidateValueIndex'>;
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* `Converter` which validates an `unknown` value as a {@link CandidateValueIndex | CandidateValueIndex}.
|
|
733
|
+
* @public
|
|
734
|
+
*/
|
|
735
|
+
declare const candidateValueIndex: Converter<CandidateValueIndex, unknown>;
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Branded string representing a validated candidate value key.
|
|
739
|
+
* Candidate value keys are used to identify candidate values
|
|
740
|
+
* within a resource set and to enable sharing of like values.
|
|
741
|
+
* @public
|
|
742
|
+
*/
|
|
743
|
+
export declare type CandidateValueKey = Brand<string, 'CandidateValueKey'>;
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* `Converter` which validates an `unknown` value as a {@link CandidateValueKey | CandidateValueKey}.
|
|
747
|
+
* @public
|
|
748
|
+
*/
|
|
749
|
+
declare const candidateValueKey: Converter<CandidateValueKey, unknown>;
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* @internal
|
|
753
|
+
*/
|
|
754
|
+
declare const candidateValueKey_2: RegExp;
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* A factory that chains multiple factories together.
|
|
758
|
+
* @public
|
|
759
|
+
*/
|
|
760
|
+
declare class ChainedConfigInitFactory<TConfig, T> implements IConfigInitFactory<TConfig, T> {
|
|
761
|
+
readonly factories: IConfigInitFactory<TConfig, T>[];
|
|
762
|
+
/**
|
|
763
|
+
* Constructor for a chained config init factory.
|
|
764
|
+
* @param factories - The factories to chain.
|
|
765
|
+
*/
|
|
766
|
+
constructor(factories: IConfigInitFactory<TConfig, T>[]);
|
|
767
|
+
/**
|
|
768
|
+
* Creates a new instance of a configuration object.
|
|
769
|
+
* @param config - The configuration object to create.
|
|
770
|
+
* @returns A result containing the new instance of the configuration object.
|
|
771
|
+
*/
|
|
772
|
+
create(config: TConfig): Result<T>;
|
|
773
|
+
}
|
|
774
|
+
|
|
295
775
|
/**
|
|
296
776
|
* `Converter` for a normalized {@link ResourceJson.Json.IChildConditionDecl | child condition declaration}.
|
|
297
777
|
* @public
|
|
@@ -402,13 +882,17 @@ declare namespace Common {
|
|
|
402
882
|
ResourceTypeName,
|
|
403
883
|
ResourceTypeIndex,
|
|
404
884
|
ResourceValueMergeMethod,
|
|
405
|
-
allResourceValueMergeMethods
|
|
885
|
+
allResourceValueMergeMethods,
|
|
886
|
+
CandidateCompleteness,
|
|
887
|
+
CandidateValueIndex,
|
|
888
|
+
CandidateValueKey,
|
|
889
|
+
IResourceResolver
|
|
406
890
|
}
|
|
407
891
|
}
|
|
408
892
|
|
|
409
893
|
declare namespace Compiled {
|
|
410
894
|
export {
|
|
411
|
-
|
|
895
|
+
Convert_6 as Convert,
|
|
412
896
|
ICompiledResourceOptions,
|
|
413
897
|
ICompiledConditionMetadata,
|
|
414
898
|
ICompiledConditionSetMetadata,
|
|
@@ -429,61 +913,61 @@ declare namespace Compiled {
|
|
|
429
913
|
* Converter for a {@link ResourceJson.Compiled.ICompiledAbstractDecision | compiled abstract decision}.
|
|
430
914
|
* @public
|
|
431
915
|
*/
|
|
432
|
-
declare const compiledAbstractDecision: ObjectConverter<
|
|
916
|
+
declare const compiledAbstractDecision: ObjectConverter<Model_3.ICompiledAbstractDecision, unknown>;
|
|
433
917
|
|
|
434
918
|
/**
|
|
435
919
|
* Converter for a {@link ResourceJson.Compiled.ICompiledCandidate | compiled candidate}.
|
|
436
920
|
* @public
|
|
437
921
|
*/
|
|
438
|
-
declare const compiledCandidate: ObjectConverter<
|
|
922
|
+
declare const compiledCandidate: ObjectConverter<Model_3.ICompiledCandidate, unknown>;
|
|
439
923
|
|
|
440
924
|
/**
|
|
441
925
|
* Converter for a {@link ResourceJson.Compiled.ICompiledCondition | compiled condition}.
|
|
442
926
|
* @public
|
|
443
927
|
*/
|
|
444
|
-
declare const compiledCondition: ObjectConverter<
|
|
928
|
+
declare const compiledCondition: ObjectConverter<Model_3.ICompiledCondition, unknown>;
|
|
445
929
|
|
|
446
930
|
/**
|
|
447
931
|
* Converter for a {@link ResourceJson.Compiled.ICompiledConditionMetadata | compiled condition metadata}.
|
|
448
932
|
* @public
|
|
449
933
|
*/
|
|
450
|
-
declare const compiledConditionMetadata: ObjectConverter<
|
|
934
|
+
declare const compiledConditionMetadata: ObjectConverter<Model_3.ICompiledConditionMetadata, unknown>;
|
|
451
935
|
|
|
452
936
|
/**
|
|
453
937
|
* Converter for a {@link ResourceJson.Compiled.ICompiledConditionSet | compiled condition set}.
|
|
454
938
|
* @public
|
|
455
939
|
*/
|
|
456
|
-
declare const compiledConditionSet: ObjectConverter<
|
|
940
|
+
declare const compiledConditionSet: ObjectConverter<Model_3.ICompiledConditionSet, unknown>;
|
|
457
941
|
|
|
458
942
|
/**
|
|
459
943
|
* Converter for a {@link ResourceJson.Compiled.ICompiledConditionSetMetadata | compiled condition set metadata}.
|
|
460
944
|
* @public
|
|
461
945
|
*/
|
|
462
|
-
declare const compiledConditionSetMetadata: ObjectConverter<
|
|
946
|
+
declare const compiledConditionSetMetadata: ObjectConverter<Model_3.ICompiledConditionSetMetadata, unknown>;
|
|
463
947
|
|
|
464
948
|
/**
|
|
465
949
|
* Converter for a {@link ResourceJson.Compiled.ICompiledDecisionMetadata | compiled decision metadata}.
|
|
466
950
|
* @public
|
|
467
951
|
*/
|
|
468
|
-
declare const compiledDecisionMetadata: ObjectConverter<
|
|
952
|
+
declare const compiledDecisionMetadata: ObjectConverter<Model_3.ICompiledDecisionMetadata, unknown>;
|
|
469
953
|
|
|
470
954
|
/**
|
|
471
955
|
* Converter for a {@link ResourceJson.Compiled.ICompiledQualifier | compiled qualifier}.
|
|
472
956
|
* @public
|
|
473
957
|
*/
|
|
474
|
-
declare const compiledQualifier: ObjectConverter<
|
|
958
|
+
declare const compiledQualifier: ObjectConverter<Model_3.ICompiledQualifier, unknown>;
|
|
475
959
|
|
|
476
960
|
/**
|
|
477
961
|
* Converter for a {@link ResourceJson.Compiled.ICompiledQualifierType | compiled qualifier type}.
|
|
478
962
|
* @public
|
|
479
963
|
*/
|
|
480
|
-
declare const compiledQualifierType: ObjectConverter<
|
|
964
|
+
declare const compiledQualifierType: ObjectConverter<Model_3.ICompiledQualifierType, unknown>;
|
|
481
965
|
|
|
482
966
|
/**
|
|
483
967
|
* Converter for a {@link ResourceJson.Compiled.ICompiledResource | compiled resource}.
|
|
484
968
|
* @public
|
|
485
969
|
*/
|
|
486
|
-
declare const compiledResource: ObjectConverter<
|
|
970
|
+
declare const compiledResource: ObjectConverter<Model_3.ICompiledResource, unknown>;
|
|
487
971
|
|
|
488
972
|
/**
|
|
489
973
|
* A compiled resource collection implements {@link Runtime.IResourceManager | IResourceManager}
|
|
@@ -491,30 +975,35 @@ declare const compiledResource: ObjectConverter<Model.ICompiledResource, unknown
|
|
|
491
975
|
* and use pre-compiled resource collections without rebuilding them from scratch.
|
|
492
976
|
* @public
|
|
493
977
|
*/
|
|
494
|
-
declare class CompiledResourceCollection implements IResourceManager {
|
|
978
|
+
declare class CompiledResourceCollection implements IResourceManager<IResource> {
|
|
495
979
|
readonly conditions: ReadOnlyConditionCollector;
|
|
496
980
|
readonly conditionSets: ReadOnlyConditionSetCollector;
|
|
497
981
|
readonly decisions: ReadOnlyAbstractDecisionCollector;
|
|
498
982
|
private readonly _qualifierTypes;
|
|
499
983
|
private readonly _qualifiers;
|
|
500
984
|
private readonly _resourceTypes;
|
|
985
|
+
private readonly _candidateValues;
|
|
501
986
|
private readonly _builtResources;
|
|
502
987
|
private _cachedResourceTree?;
|
|
503
988
|
/**
|
|
504
|
-
* A {@link QualifierTypes.
|
|
989
|
+
* A {@link QualifierTypes.ReadOnlyQualifierTypeCollector | ReadOnlyQualifierTypeCollector} which
|
|
505
990
|
* contains the {@link QualifierTypes.QualifierType | qualifier types} used in this collection.
|
|
506
991
|
*/
|
|
507
|
-
get qualifierTypes():
|
|
992
|
+
get qualifierTypes(): ReadOnlyQualifierTypeCollector;
|
|
508
993
|
/**
|
|
509
|
-
* A {@link Qualifiers.
|
|
994
|
+
* A {@link Qualifiers.IReadOnlyQualifierCollector | ReadOnlyQualifierCollector} which
|
|
510
995
|
* contains the {@link Qualifiers.Qualifier | qualifiers} used in this collection.
|
|
511
996
|
*/
|
|
512
|
-
get qualifiers():
|
|
997
|
+
get qualifiers(): IReadOnlyQualifierCollector;
|
|
513
998
|
/**
|
|
514
999
|
* A {@link ResourceTypes.ResourceTypeCollector | ResourceTypeCollector} which
|
|
515
1000
|
* contains the {@link ResourceTypes.ResourceType | resource types} used in this collection.
|
|
516
1001
|
*/
|
|
517
|
-
get resourceTypes():
|
|
1002
|
+
get resourceTypes(): ReadOnlyResourceTypeCollector;
|
|
1003
|
+
/**
|
|
1004
|
+
* The candidate values in the collection.
|
|
1005
|
+
*/
|
|
1006
|
+
get candidateValues(): ReadonlyArray<JsonValue>;
|
|
518
1007
|
/**
|
|
519
1008
|
* {@inheritdoc Runtime.IResourceManager.builtResources}
|
|
520
1009
|
*/
|
|
@@ -563,7 +1052,7 @@ declare class CompiledResourceCollection implements IResourceManager {
|
|
|
563
1052
|
* @returns Result containing the resource tree root, or failure if tree construction fails
|
|
564
1053
|
* @public
|
|
565
1054
|
*/
|
|
566
|
-
getBuiltResourceTree(): Result<
|
|
1055
|
+
getBuiltResourceTree(): Result<ReadOnlyResourceTreeRoot<IResource>>;
|
|
567
1056
|
/**
|
|
568
1057
|
* Reconstructs a QualifierTypeCollector from compiled data.
|
|
569
1058
|
* @param compiled - The compiled resource collection
|
|
@@ -612,6 +1101,12 @@ declare class CompiledResourceCollection implements IResourceManager {
|
|
|
612
1101
|
* @internal
|
|
613
1102
|
*/
|
|
614
1103
|
private _buildDecisions;
|
|
1104
|
+
/**
|
|
1105
|
+
* Gets a candidate value from the collection.
|
|
1106
|
+
* @param valueIndex - The index of the candidate value to get.
|
|
1107
|
+
* @returns
|
|
1108
|
+
*/
|
|
1109
|
+
private _getCandidateValue;
|
|
615
1110
|
/**
|
|
616
1111
|
* Reconstructs a ValidatingResultMap of resources from compiled data.
|
|
617
1112
|
* @param compiled - The compiled resource collection
|
|
@@ -628,13 +1123,13 @@ declare class CompiledResourceCollection implements IResourceManager {
|
|
|
628
1123
|
* This combines all the individual converters into a single converter for the entire resource collection.
|
|
629
1124
|
* @public
|
|
630
1125
|
*/
|
|
631
|
-
declare const compiledResourceCollection: ObjectConverter<
|
|
1126
|
+
declare const compiledResourceCollection: ObjectConverter<Model_3.ICompiledResourceCollection, unknown>;
|
|
632
1127
|
|
|
633
1128
|
/**
|
|
634
1129
|
* Converter for a {@link ResourceJson.Compiled.ICompiledResourceType | compiled resource type}.
|
|
635
1130
|
* @public
|
|
636
1131
|
*/
|
|
637
|
-
declare const compiledResourceType: ObjectConverter<
|
|
1132
|
+
declare const compiledResourceType: ObjectConverter<Model_3.ICompiledResourceType, unknown>;
|
|
638
1133
|
|
|
639
1134
|
/**
|
|
640
1135
|
* A {@link Decisions.ConcreteDecision | concrete decision} is a {@link Decisions.IDecision | decision}
|
|
@@ -685,7 +1180,7 @@ declare class ConcreteDecision<TVALUE extends JsonValue = JsonValue> implements
|
|
|
685
1180
|
* Represents a single condition applied to some resource instance.
|
|
686
1181
|
* @public
|
|
687
1182
|
*/
|
|
688
|
-
declare class Condition implements IValidatedConditionDecl {
|
|
1183
|
+
export declare class Condition implements IValidatedConditionDecl {
|
|
689
1184
|
/**
|
|
690
1185
|
* The {@link Qualifiers.Qualifier | qualifier} used in this condition.
|
|
691
1186
|
*/
|
|
@@ -932,7 +1427,7 @@ declare const conditionPriority: Converter<ConditionPriority, unknown>;
|
|
|
932
1427
|
|
|
933
1428
|
declare namespace Conditions {
|
|
934
1429
|
export {
|
|
935
|
-
|
|
1430
|
+
Convert_11 as Convert,
|
|
936
1431
|
Condition,
|
|
937
1432
|
IConditionCollectorCreateParams,
|
|
938
1433
|
ConditionCollector,
|
|
@@ -956,7 +1451,7 @@ export { Conditions }
|
|
|
956
1451
|
* context for a resource instance to be valid.
|
|
957
1452
|
* @public
|
|
958
1453
|
*/
|
|
959
|
-
declare class ConditionSet implements IValidatedConditionSetDecl {
|
|
1454
|
+
export declare class ConditionSet implements IValidatedConditionSetDecl {
|
|
960
1455
|
protected readonly _collectible: Collections.Collectible<ConditionSetKey, ConditionSetIndex>;
|
|
961
1456
|
/**
|
|
962
1457
|
* The {@link Conditions.Condition | conditions} that make up this condition
|
|
@@ -1026,6 +1521,14 @@ declare class ConditionSet implements IValidatedConditionSetDecl {
|
|
|
1026
1521
|
* @public
|
|
1027
1522
|
*/
|
|
1028
1523
|
static getKeyForDecl(decl: IValidatedConditionSetDecl): Result<ConditionSetKey>;
|
|
1524
|
+
/**
|
|
1525
|
+
* Gets a condition set key from a loose condition set declaration.
|
|
1526
|
+
* @param conditionSet - The loose condition set declaration to convert.
|
|
1527
|
+
* @param conditionCollector - The condition collector used for validation.
|
|
1528
|
+
* @returns `Success` with the condition set key if successful, `Failure` otherwise.
|
|
1529
|
+
* @public
|
|
1530
|
+
*/
|
|
1531
|
+
static getKeyFromLooseDecl(conditionSet: ResourceJson.Json.ConditionSetDecl | undefined, conditionCollector: ConditionCollector): Result<ConditionSetKey>;
|
|
1029
1532
|
/**
|
|
1030
1533
|
* Gets a {@link ConditionSetToken | condition set token} for this condition set,
|
|
1031
1534
|
* if possible.
|
|
@@ -1120,10 +1623,10 @@ declare class ConditionSetCollector extends ValidatingCollector<ConditionSet> {
|
|
|
1120
1623
|
declare type ConditionSetDecl = ConditionSetDeclAsArray | ConditionSetDeclAsRecord;
|
|
1121
1624
|
|
|
1122
1625
|
/**
|
|
1123
|
-
* Converter
|
|
1626
|
+
* `Converter` for a normalized {@link ResourceJson.Normalized.ConditionSetDecl | condition set declaration}.
|
|
1124
1627
|
* @public
|
|
1125
1628
|
*/
|
|
1126
|
-
declare const conditionSetDecl:
|
|
1629
|
+
declare const conditionSetDecl: Converter<Normalized.ConditionSetDecl>;
|
|
1127
1630
|
|
|
1128
1631
|
/**
|
|
1129
1632
|
* Normalized non-validated declaration of a {@link Conditions.Condition | condition}.
|
|
@@ -1132,10 +1635,10 @@ declare const conditionSetDecl: ObjectConverter<IConditionSetDecl, unknown>;
|
|
|
1132
1635
|
declare type ConditionSetDecl_2 = ReadonlyArray<ILooseConditionDecl>;
|
|
1133
1636
|
|
|
1134
1637
|
/**
|
|
1135
|
-
*
|
|
1638
|
+
* Converter which converts to a {@link Conditions.IConditionSetDecl | condition set declaration}.
|
|
1136
1639
|
* @public
|
|
1137
1640
|
*/
|
|
1138
|
-
declare const conditionSetDecl_2:
|
|
1641
|
+
declare const conditionSetDecl_2: ObjectConverter<IConditionSetDecl, unknown>;
|
|
1139
1642
|
|
|
1140
1643
|
/**
|
|
1141
1644
|
* Non-validated declaration of a {@link Conditions.Condition | condition}.
|
|
@@ -1373,8 +1876,20 @@ declare class ConditionTokens {
|
|
|
1373
1876
|
|
|
1374
1877
|
declare namespace Config {
|
|
1375
1878
|
export {
|
|
1376
|
-
|
|
1377
|
-
|
|
1879
|
+
Model,
|
|
1880
|
+
Convert_9 as Convert,
|
|
1881
|
+
createQualifierTypeFactory,
|
|
1882
|
+
createResourceTypeFactory,
|
|
1883
|
+
QualifierTypeFactoryFunction,
|
|
1884
|
+
ResourceTypeFactoryFunction,
|
|
1885
|
+
IConfigInitFactory,
|
|
1886
|
+
ChainedConfigInitFactory,
|
|
1887
|
+
BuiltInQualifierTypeFactory,
|
|
1888
|
+
QualifierTypeFactory,
|
|
1889
|
+
ValidatingQualifierTypeFactory,
|
|
1890
|
+
BuiltInResourceTypeFactory,
|
|
1891
|
+
ResourceTypeFactory,
|
|
1892
|
+
ValidatingResourceTypeFactory,
|
|
1378
1893
|
updateSystemConfigurationQualifierDefaultValues,
|
|
1379
1894
|
ISystemConfigurationInitParams,
|
|
1380
1895
|
SystemConfiguration,
|
|
@@ -1390,21 +1905,24 @@ export { Config }
|
|
|
1390
1905
|
|
|
1391
1906
|
declare namespace Config_2 {
|
|
1392
1907
|
export {
|
|
1393
|
-
|
|
1908
|
+
Convert_2 as Convert,
|
|
1909
|
+
isSystemQualifierTypeConfig,
|
|
1394
1910
|
IQualifierTypeConfig,
|
|
1395
1911
|
ILanguageQualifierTypeConfig,
|
|
1912
|
+
LiteralValueHierarchyDecl,
|
|
1396
1913
|
ITerritoryQualifierTypeConfig,
|
|
1397
1914
|
ILiteralQualifierTypeConfig,
|
|
1398
1915
|
ISystemLanguageQualifierTypeConfig,
|
|
1399
1916
|
ISystemTerritoryQualifierTypeConfig,
|
|
1400
1917
|
ISystemLiteralQualifierTypeConfig,
|
|
1401
|
-
ISystemQualifierTypeConfig
|
|
1918
|
+
ISystemQualifierTypeConfig,
|
|
1919
|
+
IAnyQualifierTypeConfig
|
|
1402
1920
|
}
|
|
1403
1921
|
}
|
|
1404
1922
|
|
|
1405
1923
|
declare namespace Config_3 {
|
|
1406
1924
|
export {
|
|
1407
|
-
|
|
1925
|
+
Convert_5 as Convert,
|
|
1408
1926
|
IResourceTypeConfig
|
|
1409
1927
|
}
|
|
1410
1928
|
}
|
|
@@ -1417,7 +1935,7 @@ declare const containerContextDecl: Converter<Normalized.IContainerContextDecl>;
|
|
|
1417
1935
|
|
|
1418
1936
|
declare namespace Context {
|
|
1419
1937
|
export {
|
|
1420
|
-
|
|
1938
|
+
Convert_8 as Convert,
|
|
1421
1939
|
IContextMatchOptions,
|
|
1422
1940
|
IContextQualifierValueDecl,
|
|
1423
1941
|
IContextDecl,
|
|
@@ -1430,11 +1948,19 @@ export { Context }
|
|
|
1430
1948
|
|
|
1431
1949
|
declare namespace Context_2 {
|
|
1432
1950
|
export {
|
|
1951
|
+
IContextQualifierProviderBase,
|
|
1952
|
+
IReadOnlyContextQualifierProvider,
|
|
1953
|
+
IMutableContextQualifierProvider,
|
|
1433
1954
|
IContextQualifierProvider,
|
|
1434
1955
|
ContextQualifierProvider,
|
|
1956
|
+
IContextQualifierProviderValidatorBase,
|
|
1435
1957
|
IReadOnlyContextQualifierProviderValidator,
|
|
1958
|
+
IMutableContextQualifierProviderValidator,
|
|
1959
|
+
IReadOnlyContextQualifierProviderValidatorCreateParams,
|
|
1960
|
+
IMutableContextQualifierProviderValidatorCreateParams,
|
|
1436
1961
|
IContextQualifierProviderValidatorCreateParams,
|
|
1437
|
-
|
|
1962
|
+
ReadOnlyContextQualifierProviderValidator,
|
|
1963
|
+
MutableContextQualifierProviderValidator,
|
|
1438
1964
|
ISimpleContextQualifierProviderCreateParams,
|
|
1439
1965
|
SimpleContextQualifierProvider,
|
|
1440
1966
|
IValidatingSimpleContextQualifierProviderCreateParams,
|
|
@@ -1453,7 +1979,7 @@ declare const contextDecl: Converter<Record<string, string>, unknown>;
|
|
|
1453
1979
|
* Provides common functionality and enforces the contract for derived classes.
|
|
1454
1980
|
* @public
|
|
1455
1981
|
*/
|
|
1456
|
-
declare abstract class ContextQualifierProvider implements
|
|
1982
|
+
declare abstract class ContextQualifierProvider implements IContextQualifierProviderBase {
|
|
1457
1983
|
/**
|
|
1458
1984
|
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
1459
1985
|
*/
|
|
@@ -1487,96 +2013,6 @@ declare abstract class ContextQualifierProvider implements IContextQualifierProv
|
|
|
1487
2013
|
abstract getNames(): Result<ReadonlyArray<QualifierName>>;
|
|
1488
2014
|
}
|
|
1489
2015
|
|
|
1490
|
-
/**
|
|
1491
|
-
* A wrapper for {@link Runtime.Context.IContextQualifierProvider | IContextQualifierProvider} that accepts
|
|
1492
|
-
* string inputs and converts them to strongly-typed values before calling the wrapped provider.
|
|
1493
|
-
* This eliminates the need for type casting in consumer code while maintaining type safety.
|
|
1494
|
-
* @public
|
|
1495
|
-
*/
|
|
1496
|
-
declare class ContextQualifierProviderValidator implements IReadOnlyContextQualifierProviderValidator {
|
|
1497
|
-
/**
|
|
1498
|
-
* The wrapped context qualifier provider.
|
|
1499
|
-
*/
|
|
1500
|
-
readonly provider: IContextQualifierProvider;
|
|
1501
|
-
/**
|
|
1502
|
-
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
1503
|
-
*/
|
|
1504
|
-
get qualifiers(): IReadOnlyQualifierCollector;
|
|
1505
|
-
/**
|
|
1506
|
-
* Constructs a new {@link Runtime.Context.ContextQualifierProviderValidator | ContextQualifierProviderValidator}.
|
|
1507
|
-
* @param params - Required parameters for constructing the validator.
|
|
1508
|
-
*/
|
|
1509
|
-
constructor(params: IContextQualifierProviderValidatorCreateParams);
|
|
1510
|
-
/**
|
|
1511
|
-
* Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
|
|
1512
|
-
* @param name - The string name to convert and look up.
|
|
1513
|
-
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
1514
|
-
* or `Failure` with an error message if not found or an error occurs.
|
|
1515
|
-
*/
|
|
1516
|
-
get(name: string): Result<QualifierContextValue>;
|
|
1517
|
-
/**
|
|
1518
|
-
* Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
|
|
1519
|
-
* @param index - The number index to convert and look up.
|
|
1520
|
-
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
1521
|
-
* or `Failure` with an error message if not found or an error occurs.
|
|
1522
|
-
*/
|
|
1523
|
-
getByIndex(index: number): Result<QualifierContextValue>;
|
|
1524
|
-
/**
|
|
1525
|
-
* Gets a validated qualifier context value by its string name.
|
|
1526
|
-
* @param name - The string name to convert and look up.
|
|
1527
|
-
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
1528
|
-
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
1529
|
-
*/
|
|
1530
|
-
getValidated(name: string): Result<QualifierContextValue>;
|
|
1531
|
-
/**
|
|
1532
|
-
* Gets a validated qualifier context value by its number index.
|
|
1533
|
-
* @param index - The number index to convert and look up.
|
|
1534
|
-
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
1535
|
-
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
1536
|
-
*/
|
|
1537
|
-
getValidatedByIndex(index: number): Result<QualifierContextValue>;
|
|
1538
|
-
/**
|
|
1539
|
-
* Checks if a qualifier value exists with the given string name.
|
|
1540
|
-
* @param name - The string name to convert and check.
|
|
1541
|
-
* @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
|
|
1542
|
-
* or `Failure` with an error message if an error occurs during the check.
|
|
1543
|
-
*/
|
|
1544
|
-
has(name: string): Result<boolean>;
|
|
1545
|
-
/**
|
|
1546
|
-
* Sets a qualifier value using string inputs, converting to strongly-typed values.
|
|
1547
|
-
* @param name - The string name to convert.
|
|
1548
|
-
* @param value - The string value to convert.
|
|
1549
|
-
* @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
|
|
1550
|
-
* or `Failure` with an error message if an error occurs.
|
|
1551
|
-
*/
|
|
1552
|
-
set(name: string, value: string): Result<QualifierContextValue>;
|
|
1553
|
-
/**
|
|
1554
|
-
* Removes a qualifier value using string input, converting to strongly-typed QualifierName.
|
|
1555
|
-
* @param name - The string name to convert.
|
|
1556
|
-
* @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
|
|
1557
|
-
* or `Failure` with an error message if an error occurs.
|
|
1558
|
-
*/
|
|
1559
|
-
remove(name: string): Result<QualifierContextValue>;
|
|
1560
|
-
/**
|
|
1561
|
-
* Validates a string as a QualifierName.
|
|
1562
|
-
* @param name - The string to validate.
|
|
1563
|
-
* @returns `Success` with the strongly-typed QualifierName, or `Failure` if invalid.
|
|
1564
|
-
*/
|
|
1565
|
-
private _validateQualifierName;
|
|
1566
|
-
/**
|
|
1567
|
-
* Validates a number as a QualifierIndex.
|
|
1568
|
-
* @param index - The number to validate.
|
|
1569
|
-
* @returns `Success` with the strongly-typed QualifierIndex, or `Failure` if invalid.
|
|
1570
|
-
*/
|
|
1571
|
-
private _validateQualifierIndex;
|
|
1572
|
-
/**
|
|
1573
|
-
* Validates a string as a QualifierContextValue.
|
|
1574
|
-
* @param value - The string to validate.
|
|
1575
|
-
* @returns `Success` with the strongly-typed QualifierContextValue, or `Failure` if invalid.
|
|
1576
|
-
*/
|
|
1577
|
-
private _validateQualifierContextValue;
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
2016
|
/**
|
|
1581
2017
|
* A string representing a validated context qualifier token. Context qualifier tokens are used
|
|
1582
2018
|
* for filtering resources by context criteria. A context qualifier token has the form
|
|
@@ -1732,6 +2168,7 @@ declare namespace Convert {
|
|
|
1732
2168
|
qualifierIndex,
|
|
1733
2169
|
qualifierTypeName,
|
|
1734
2170
|
qualifierTypeIndex,
|
|
2171
|
+
qualifierContextValue,
|
|
1735
2172
|
qualifierMatchScore,
|
|
1736
2173
|
conditionPriority,
|
|
1737
2174
|
conditionOperator,
|
|
@@ -1749,6 +2186,8 @@ declare namespace Convert {
|
|
|
1749
2186
|
resourceIndex,
|
|
1750
2187
|
resourceTypeName,
|
|
1751
2188
|
resourceTypeIndex,
|
|
2189
|
+
candidateValueKey,
|
|
2190
|
+
candidateValueIndex,
|
|
1752
2191
|
resourceValueMergeMethod,
|
|
1753
2192
|
contextQualifierToken,
|
|
1754
2193
|
contextToken,
|
|
@@ -1760,23 +2199,79 @@ export { Convert }
|
|
|
1760
2199
|
|
|
1761
2200
|
declare namespace Convert_10 {
|
|
1762
2201
|
export {
|
|
1763
|
-
|
|
1764
|
-
|
|
2202
|
+
bundleMetadata,
|
|
2203
|
+
bundleExportMetadata,
|
|
2204
|
+
bundle,
|
|
2205
|
+
bundleCreateParams,
|
|
2206
|
+
bundleStructure
|
|
1765
2207
|
}
|
|
1766
2208
|
}
|
|
1767
2209
|
|
|
1768
|
-
declare namespace
|
|
2210
|
+
declare namespace Convert_11 {
|
|
1769
2211
|
export {
|
|
1770
2212
|
conditionDecl,
|
|
1771
2213
|
IConditionDeclConvertContext,
|
|
1772
2214
|
validatedConditionDecl,
|
|
1773
|
-
conditionSetDecl,
|
|
2215
|
+
conditionSetDecl_2 as conditionSetDecl,
|
|
1774
2216
|
IConditionSetDeclConvertContext,
|
|
1775
2217
|
validatedConditionSetDecl
|
|
1776
2218
|
}
|
|
1777
2219
|
}
|
|
1778
2220
|
|
|
2221
|
+
declare namespace Convert_12 {
|
|
2222
|
+
export {
|
|
2223
|
+
zipArchiveInputType,
|
|
2224
|
+
zipArchiveConfigType,
|
|
2225
|
+
zipArchiveInputInfo,
|
|
2226
|
+
zipArchiveConfigInfo,
|
|
2227
|
+
zipArchiveManifest,
|
|
2228
|
+
mimeType,
|
|
2229
|
+
importedFile,
|
|
2230
|
+
importedDirectory,
|
|
2231
|
+
systemConfiguration_2 as systemConfiguration
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
declare namespace Convert_2 {
|
|
2236
|
+
export {
|
|
2237
|
+
qualifierTypeConfig,
|
|
2238
|
+
languageQualifierTypeConfig,
|
|
2239
|
+
territoryQualifierTypeConfig,
|
|
2240
|
+
literalQualifierTypeConfig,
|
|
2241
|
+
systemLanguageQualifierTypeConfig,
|
|
2242
|
+
systemTerritoryQualifierTypeConfig,
|
|
2243
|
+
systemLiteralQualifierTypeConfig,
|
|
2244
|
+
systemQualifierTypeConfig,
|
|
2245
|
+
jsonQualifierTypeConfig,
|
|
2246
|
+
anyQualifierTypeConfig
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
|
|
1779
2250
|
declare namespace Convert_3 {
|
|
2251
|
+
export {
|
|
2252
|
+
literalValueHierarchyCreateParams,
|
|
2253
|
+
IQualifierTypeConvertContext,
|
|
2254
|
+
qualifierType
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
declare namespace Convert_4 {
|
|
2259
|
+
export {
|
|
2260
|
+
qualifierDecl,
|
|
2261
|
+
IQualifierDeclConvertContext,
|
|
2262
|
+
validatedQualifierDecl,
|
|
2263
|
+
IQualifierConvertContext,
|
|
2264
|
+
qualifier
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
declare namespace Convert_5 {
|
|
2269
|
+
export {
|
|
2270
|
+
resourceTypeConfig
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
declare namespace Convert_6 {
|
|
1780
2275
|
export {
|
|
1781
2276
|
compiledConditionMetadata,
|
|
1782
2277
|
compiledConditionSetMetadata,
|
|
@@ -1793,11 +2288,11 @@ declare namespace Convert_3 {
|
|
|
1793
2288
|
}
|
|
1794
2289
|
}
|
|
1795
2290
|
|
|
1796
|
-
declare namespace
|
|
2291
|
+
declare namespace Convert_7 {
|
|
1797
2292
|
export {
|
|
1798
2293
|
looseConditionDecl,
|
|
1799
2294
|
childConditionDecl,
|
|
1800
|
-
|
|
2295
|
+
conditionSetDecl,
|
|
1801
2296
|
looseResourceCandidateDecl,
|
|
1802
2297
|
importerResourceCandidateDecl,
|
|
1803
2298
|
childResourceCandidateDecl,
|
|
@@ -1811,7 +2306,7 @@ declare namespace Convert_4 {
|
|
|
1811
2306
|
}
|
|
1812
2307
|
}
|
|
1813
2308
|
|
|
1814
|
-
declare namespace
|
|
2309
|
+
declare namespace Convert_8 {
|
|
1815
2310
|
export {
|
|
1816
2311
|
contextQualifierValueDecl,
|
|
1817
2312
|
contextDecl,
|
|
@@ -1821,42 +2316,22 @@ declare namespace Convert_5 {
|
|
|
1821
2316
|
}
|
|
1822
2317
|
}
|
|
1823
2318
|
|
|
1824
|
-
declare namespace Convert_6 {
|
|
1825
|
-
export {
|
|
1826
|
-
languageQualifierTypeConfig,
|
|
1827
|
-
territoryQualifierTypeConfig,
|
|
1828
|
-
literalQualifierTypeConfig,
|
|
1829
|
-
systemLanguageQualifierTypeConfig,
|
|
1830
|
-
systemTerritoryQualifierTypeConfig,
|
|
1831
|
-
systemLiteralQualifierTypeConfig,
|
|
1832
|
-
systemQualifierTypeConfig
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
declare namespace Convert_7 {
|
|
1837
|
-
export {
|
|
1838
|
-
literalValueHierarchyCreateParams,
|
|
1839
|
-
IQualifierTypeConvertContext,
|
|
1840
|
-
qualifierType
|
|
1841
|
-
}
|
|
1842
|
-
}
|
|
1843
|
-
|
|
1844
|
-
declare namespace Convert_8 {
|
|
1845
|
-
export {
|
|
1846
|
-
qualifierDecl,
|
|
1847
|
-
IQualifierDeclConvertContext,
|
|
1848
|
-
validatedQualifierDecl,
|
|
1849
|
-
IQualifierConvertContext,
|
|
1850
|
-
qualifier
|
|
1851
|
-
}
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
2319
|
declare namespace Convert_9 {
|
|
1855
2320
|
export {
|
|
1856
|
-
|
|
2321
|
+
validateSystemConfiguration,
|
|
2322
|
+
systemConfiguration,
|
|
2323
|
+
predefinedSystemConfiguration
|
|
1857
2324
|
}
|
|
1858
2325
|
}
|
|
1859
2326
|
|
|
2327
|
+
/**
|
|
2328
|
+
* Creates a {@link Config.IConfigInitFactory | IConfigInitFactory} from a factory function.
|
|
2329
|
+
* @param fn - The factory function to wrap.
|
|
2330
|
+
* @returns An `IConfigInitFactory` instance that delegates to the function.
|
|
2331
|
+
* @public
|
|
2332
|
+
*/
|
|
2333
|
+
declare function createQualifierTypeFactory<T extends QualifierType = QualifierType>(fn: QualifierTypeFactoryFunction<T>): IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T>;
|
|
2334
|
+
|
|
1860
2335
|
/**
|
|
1861
2336
|
* Creates a {@link QualifierTypes.QualifierType | QualifierType} from a configuration object.
|
|
1862
2337
|
* This factory function determines the appropriate qualifier type based on the systemType
|
|
@@ -1867,19 +2342,27 @@ declare namespace Convert_9 {
|
|
|
1867
2342
|
* if successful, `Failure` with an error message otherwise.
|
|
1868
2343
|
* @public
|
|
1869
2344
|
*/
|
|
1870
|
-
declare function createQualifierTypeFromConfig(typeConfig: Config_2.
|
|
2345
|
+
declare function createQualifierTypeFromConfig(typeConfig: Config_2.IAnyQualifierTypeConfig): Result<QualifierType>;
|
|
1871
2346
|
|
|
1872
2347
|
/**
|
|
1873
|
-
* Creates a {@link QualifierTypes.
|
|
2348
|
+
* Creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from a system configuration object.
|
|
1874
2349
|
* This factory function determines the appropriate qualifier type based on the systemType
|
|
1875
2350
|
* and delegates to the appropriate type-specific createFromConfig method.
|
|
1876
2351
|
* @param typeConfig - The {@link QualifierTypes.Config.ISystemQualifierTypeConfig | configuration object}
|
|
1877
2352
|
* containing the name, systemType, and optional type-specific configuration.
|
|
1878
|
-
* @returns `Success` with the new {@link QualifierTypes.
|
|
2353
|
+
* @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}
|
|
1879
2354
|
* if successful, `Failure` with an error message otherwise.
|
|
1880
2355
|
* @public
|
|
1881
2356
|
*/
|
|
1882
|
-
declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISystemQualifierTypeConfig): Result<
|
|
2357
|
+
declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISystemQualifierTypeConfig): Result<SystemQualifierType>;
|
|
2358
|
+
|
|
2359
|
+
/**
|
|
2360
|
+
* Creates a {@link Config.IConfigInitFactory | IConfigInitFactory} from a resource type factory function.
|
|
2361
|
+
* @param fn - The factory function to wrap.
|
|
2362
|
+
* @returns An `IConfigInitFactory` instance that delegates to the function.
|
|
2363
|
+
* @public
|
|
2364
|
+
*/
|
|
2365
|
+
declare function createResourceTypeFactory(fn: ResourceTypeFactoryFunction): IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType>;
|
|
1883
2366
|
|
|
1884
2367
|
/**
|
|
1885
2368
|
* Creates a {@link ResourceTypes.ResourceType | ResourceType} from a configuration object.
|
|
@@ -1891,11 +2374,22 @@ declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISyste
|
|
|
1891
2374
|
*/
|
|
1892
2375
|
declare function createResourceTypeFromConfig(config: IResourceTypeConfig): Result<ResourceType>;
|
|
1893
2376
|
|
|
2377
|
+
/**
|
|
2378
|
+
* Create a ZIP archive manifest object
|
|
2379
|
+
* @param inputType - Type of input (file or directory)
|
|
2380
|
+
* @param originalPath - Original file/directory path
|
|
2381
|
+
* @param archivePath - Path within the archive
|
|
2382
|
+
* @param configPath - Optional configuration file path
|
|
2383
|
+
* @returns ZIP archive manifest
|
|
2384
|
+
* @public
|
|
2385
|
+
*/
|
|
2386
|
+
declare function createZipArchiveManifest(inputType: 'file' | 'directory', originalPath: string, archivePath: string, configPath?: string): Json_2.IZipArchiveManifest;
|
|
2387
|
+
|
|
1894
2388
|
/**
|
|
1895
2389
|
* Simple collectible implementation of {@link Decisions.IDecision | IDecision}.
|
|
1896
2390
|
* @public
|
|
1897
2391
|
*/
|
|
1898
|
-
declare class Decision<TVALUE extends JsonValue = JsonValue> implements IDecision<TVALUE> {
|
|
2392
|
+
export declare class Decision<TVALUE extends JsonValue = JsonValue> implements IDecision<TVALUE> {
|
|
1899
2393
|
/**
|
|
1900
2394
|
* The sorted {@link Conditions.ConditionSet | ConditionSets} that make up this decision.
|
|
1901
2395
|
* @public
|
|
@@ -2058,6 +2552,17 @@ declare const DefaultResourceTypes: ReadonlyArray<ResourceTypes.Config.IResource
|
|
|
2058
2552
|
*/
|
|
2059
2553
|
declare const DefaultSystemConfiguration: ISystemConfiguration;
|
|
2060
2554
|
|
|
2555
|
+
/**
|
|
2556
|
+
* Type for handling empty branch nodes during tree composition.
|
|
2557
|
+
* The handler receives the branch node, names of failed children, and the resolver for recovery attempts.
|
|
2558
|
+
* It can return:
|
|
2559
|
+
* - Success(undefined) to omit the branch from the result
|
|
2560
|
+
* - Success(value) to use an alternate value for the branch
|
|
2561
|
+
* - Failure to propagate the error
|
|
2562
|
+
* @public
|
|
2563
|
+
*/
|
|
2564
|
+
declare type EmptyBranchHandler = (branchNode: IReadOnlyResourceTreeNode<IResource>, failedChildNames: string[], resolver: ResourceResolver) => Result<JsonValue | undefined>;
|
|
2565
|
+
|
|
2061
2566
|
declare namespace Example {
|
|
2062
2567
|
export {
|
|
2063
2568
|
ExtendedQualifierTypes,
|
|
@@ -2203,6 +2708,30 @@ declare class FsItemImporter implements IImporter {
|
|
|
2203
2708
|
*/
|
|
2204
2709
|
declare type FsItemResultDetail = 'failed' | 'skipped' | 'succeeded';
|
|
2205
2710
|
|
|
2711
|
+
/**
|
|
2712
|
+
* Generate a timestamp-based filename for ZIP archives
|
|
2713
|
+
* @param customName - Optional custom name prefix
|
|
2714
|
+
* @returns Generated filename
|
|
2715
|
+
* @public
|
|
2716
|
+
*/
|
|
2717
|
+
declare function generateZipArchiveFilename(customName?: string): string;
|
|
2718
|
+
|
|
2719
|
+
/**
|
|
2720
|
+
* Extract directory name from a file path
|
|
2721
|
+
* @param path - File path
|
|
2722
|
+
* @returns Directory name
|
|
2723
|
+
* @public
|
|
2724
|
+
*/
|
|
2725
|
+
declare function getDirectoryName(path: string): string;
|
|
2726
|
+
|
|
2727
|
+
/**
|
|
2728
|
+
* Gets the name for a resource ID.
|
|
2729
|
+
* @param id - The resource ID to get the name for.
|
|
2730
|
+
* @returns The resource name if found, or undefined if not.
|
|
2731
|
+
* @public
|
|
2732
|
+
*/
|
|
2733
|
+
declare function getNameForResourceId(id: string | undefined): Result<ResourceName>;
|
|
2734
|
+
|
|
2206
2735
|
/**
|
|
2207
2736
|
* Returns the {@link Config.Model.ISystemConfiguration | system configuration} declaration for the
|
|
2208
2737
|
* specified predefined system configuration.
|
|
@@ -2244,43 +2773,191 @@ declare namespace Helpers {
|
|
|
2244
2773
|
IQualifierDefaultValueTokenParts,
|
|
2245
2774
|
splitResourceId,
|
|
2246
2775
|
joinResourceIds,
|
|
2247
|
-
joinOptionalResourceIds
|
|
2776
|
+
joinOptionalResourceIds,
|
|
2777
|
+
getNameForResourceId
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2780
|
+
export { Helpers }
|
|
2781
|
+
|
|
2782
|
+
declare namespace Helpers_2 {
|
|
2783
|
+
export {
|
|
2784
|
+
mergeContextDecl,
|
|
2785
|
+
mergeLooseCandidate,
|
|
2786
|
+
mergeImporterCandidate,
|
|
2787
|
+
mergeChildCandidate,
|
|
2788
|
+
mergeLooseResource,
|
|
2789
|
+
mergeImporterResource,
|
|
2790
|
+
mergeChildResource,
|
|
2791
|
+
IDeclarationOptions
|
|
2248
2792
|
}
|
|
2249
2793
|
}
|
|
2250
|
-
export { Helpers }
|
|
2251
2794
|
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2795
|
+
/**
|
|
2796
|
+
* Parameters for creating a {@link Decisions.AbstractDecisionCollector | AbstractDecisionCollector}.
|
|
2797
|
+
* @public
|
|
2798
|
+
*/
|
|
2799
|
+
declare interface IAbstractDecisionCollectorCreateParams {
|
|
2800
|
+
/**
|
|
2801
|
+
* {@link Conditions.ReadOnlyConditionSetCollector | ConditionSetCollector} used to create conditions
|
|
2802
|
+
* sets for decisions in this collector.
|
|
2803
|
+
*/
|
|
2804
|
+
conditionSets: ReadOnlyConditionSetCollector;
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
/**
|
|
2808
|
+
* Parameters to create an {@link Decisions.AbstractDecision | AbstractDecision}.
|
|
2809
|
+
* @public
|
|
2810
|
+
*/
|
|
2811
|
+
declare interface IAbstractDecisionCreateParams {
|
|
2812
|
+
conditionSets: ConditionSet[];
|
|
2813
|
+
index?: number;
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
/**
|
|
2817
|
+
* A union of all qualifier type configurations.
|
|
2818
|
+
* @public
|
|
2819
|
+
*/
|
|
2820
|
+
declare type IAnyQualifierTypeConfig = IQualifierTypeConfig | ISystemQualifierTypeConfig;
|
|
2821
|
+
|
|
2822
|
+
/**
|
|
2823
|
+
* A complete resource bundle that encapsulates built resources, configuration, and metadata.
|
|
2824
|
+
* Bundles provide a portable, integrity-verified way to distribute pre-compiled resource collections.
|
|
2825
|
+
* @public
|
|
2826
|
+
*/
|
|
2827
|
+
declare interface IBundle {
|
|
2828
|
+
/**
|
|
2829
|
+
* Metadata about the bundle including build date and integrity checksum.
|
|
2830
|
+
*/
|
|
2831
|
+
metadata: IBundleMetadata;
|
|
2832
|
+
/**
|
|
2833
|
+
* The system configuration that was used to build the resources in this bundle.
|
|
2834
|
+
*/
|
|
2835
|
+
config: Model.ISystemConfiguration;
|
|
2836
|
+
/**
|
|
2837
|
+
* The compiled resource collection containing all resources, conditions, and decisions.
|
|
2838
|
+
*/
|
|
2839
|
+
compiledCollection: Compiled.ICompiledResourceCollection;
|
|
2840
|
+
/**
|
|
2841
|
+
* Optional export metadata for tracking when and how the bundle was exported.
|
|
2842
|
+
*/
|
|
2843
|
+
exportMetadata?: IBundleExportMetadata;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
/**
|
|
2847
|
+
* Components extracted from a bundle for reuse in different contexts.
|
|
2848
|
+
* @public
|
|
2849
|
+
*/
|
|
2850
|
+
declare interface IBundleComponents {
|
|
2851
|
+
/**
|
|
2852
|
+
* The system configuration from the bundle.
|
|
2853
|
+
*/
|
|
2854
|
+
systemConfiguration: SystemConfiguration;
|
|
2855
|
+
/**
|
|
2856
|
+
* The compiled resource collection from the bundle.
|
|
2857
|
+
*/
|
|
2858
|
+
compiledCollection: Compiled.ICompiledResourceCollection;
|
|
2859
|
+
/**
|
|
2860
|
+
* The bundle metadata including build information.
|
|
2861
|
+
*/
|
|
2862
|
+
metadata: IBundleMetadata;
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
/**
|
|
2866
|
+
* Optional parameters for bundle creation.
|
|
2867
|
+
* @public
|
|
2868
|
+
*/
|
|
2869
|
+
declare interface IBundleCreateParams {
|
|
2870
|
+
/**
|
|
2871
|
+
* Optional version identifier to include in the bundle metadata.
|
|
2872
|
+
*/
|
|
2873
|
+
version?: string;
|
|
2874
|
+
/**
|
|
2875
|
+
* Optional description to include in the bundle metadata.
|
|
2876
|
+
*/
|
|
2877
|
+
description?: string;
|
|
2878
|
+
/**
|
|
2879
|
+
* Optional custom build date. If not provided, the current date will be used.
|
|
2880
|
+
*/
|
|
2881
|
+
dateBuilt?: string;
|
|
2882
|
+
/**
|
|
2883
|
+
* Optional hash normalizer for generating checksums. If not provided,
|
|
2884
|
+
* a CRC32 normalizer will be used for browser compatibility.
|
|
2885
|
+
*/
|
|
2886
|
+
hashNormalizer?: Hash.HashingNormalizer;
|
|
2887
|
+
/**
|
|
2888
|
+
* Whether to normalize the ResourceManagerBuilder before bundle creation.
|
|
2889
|
+
* When true, the builder is reconstructed in canonical order to ensure
|
|
2890
|
+
* order-independent checksums. Defaults to false for Phase 1 compatibility.
|
|
2891
|
+
*/
|
|
2892
|
+
normalize?: boolean;
|
|
2263
2893
|
}
|
|
2264
2894
|
|
|
2265
2895
|
/**
|
|
2266
|
-
*
|
|
2896
|
+
* Optional export metadata for tracking bundle export information.
|
|
2267
2897
|
* @public
|
|
2268
2898
|
*/
|
|
2269
|
-
declare interface
|
|
2899
|
+
declare interface IBundleExportMetadata {
|
|
2270
2900
|
/**
|
|
2271
|
-
*
|
|
2272
|
-
* sets for decisions in this collector.
|
|
2901
|
+
* ISO timestamp indicating when the bundle was exported.
|
|
2273
2902
|
*/
|
|
2274
|
-
|
|
2903
|
+
exportedAt: string;
|
|
2904
|
+
/**
|
|
2905
|
+
* Tool or application that exported the bundle.
|
|
2906
|
+
*/
|
|
2907
|
+
exportedFrom: string;
|
|
2908
|
+
/**
|
|
2909
|
+
* Type of bundle export (e.g., 'ts-res-bundle', 'ts-res-bundle-filtered').
|
|
2910
|
+
*/
|
|
2911
|
+
type: string;
|
|
2912
|
+
/**
|
|
2913
|
+
* Optional filter context if the bundle represents filtered data.
|
|
2914
|
+
*/
|
|
2915
|
+
filterContext?: Record<string, unknown>;
|
|
2275
2916
|
}
|
|
2276
2917
|
|
|
2277
2918
|
/**
|
|
2278
|
-
* Parameters
|
|
2919
|
+
* Parameters for creating a BundleLoader.
|
|
2279
2920
|
* @public
|
|
2280
2921
|
*/
|
|
2281
|
-
declare interface
|
|
2282
|
-
|
|
2283
|
-
|
|
2922
|
+
declare interface IBundleLoaderCreateParams {
|
|
2923
|
+
/**
|
|
2924
|
+
* The bundle to load.
|
|
2925
|
+
*/
|
|
2926
|
+
bundle: IBundle;
|
|
2927
|
+
/**
|
|
2928
|
+
* Whether to skip checksum verification during loading.
|
|
2929
|
+
* Default is false - checksum verification is performed.
|
|
2930
|
+
*/
|
|
2931
|
+
skipChecksumVerification?: boolean;
|
|
2932
|
+
/**
|
|
2933
|
+
* Optional hash normalizer for verifying checksums. If not provided,
|
|
2934
|
+
* a CRC32 normalizer will be used for browser compatibility.
|
|
2935
|
+
* Must match the normalizer used during bundle creation.
|
|
2936
|
+
*/
|
|
2937
|
+
hashNormalizer?: Hash.HashingNormalizer;
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
/**
|
|
2941
|
+
* Metadata for a resource bundle, including build information and integrity verification.
|
|
2942
|
+
* @public
|
|
2943
|
+
*/
|
|
2944
|
+
declare interface IBundleMetadata {
|
|
2945
|
+
/**
|
|
2946
|
+
* ISO timestamp indicating when the bundle was built.
|
|
2947
|
+
*/
|
|
2948
|
+
dateBuilt: string;
|
|
2949
|
+
/**
|
|
2950
|
+
* SHA-256 checksum of the serialized compiled resource collection for integrity verification.
|
|
2951
|
+
*/
|
|
2952
|
+
checksum: string;
|
|
2953
|
+
/**
|
|
2954
|
+
* Optional version identifier for the bundle.
|
|
2955
|
+
*/
|
|
2956
|
+
version?: string;
|
|
2957
|
+
/**
|
|
2958
|
+
* Optional human-readable description of the bundle.
|
|
2959
|
+
*/
|
|
2960
|
+
description?: string;
|
|
2284
2961
|
}
|
|
2285
2962
|
|
|
2286
2963
|
/**
|
|
@@ -2340,6 +3017,69 @@ declare interface ICandidateInfo {
|
|
|
2340
3017
|
readonly json?: JsonObject;
|
|
2341
3018
|
}
|
|
2342
3019
|
|
|
3020
|
+
/**
|
|
3021
|
+
* Interface for a candidate value that can be collected and indexed.
|
|
3022
|
+
* Candidate values are normalized JSON values that can be shared across
|
|
3023
|
+
* multiple resource candidates to reduce duplication.
|
|
3024
|
+
* @public
|
|
3025
|
+
*/
|
|
3026
|
+
declare interface ICandidateValue extends Collections.ICollectible<CandidateValueKey, CandidateValueIndex> {
|
|
3027
|
+
/**
|
|
3028
|
+
* The unique key for this candidate value, derived from the hash of the normalized JSON.
|
|
3029
|
+
*/
|
|
3030
|
+
readonly key: CandidateValueKey;
|
|
3031
|
+
/**
|
|
3032
|
+
* The index of this candidate value in the collection.
|
|
3033
|
+
*/
|
|
3034
|
+
readonly index: CandidateValueIndex | undefined;
|
|
3035
|
+
/**
|
|
3036
|
+
* The normalized JSON value.
|
|
3037
|
+
*/
|
|
3038
|
+
readonly json: JsonValue;
|
|
3039
|
+
/**
|
|
3040
|
+
* Sets the index of this candidate value.
|
|
3041
|
+
* @param index - The index to set.
|
|
3042
|
+
* @returns `Success` with the index if successful, or `Failure` with an error message if not.
|
|
3043
|
+
*/
|
|
3044
|
+
setIndex(index: number): Result<CandidateValueIndex>;
|
|
3045
|
+
}
|
|
3046
|
+
|
|
3047
|
+
/**
|
|
3048
|
+
* Parameters for creating a {@link Resources.CandidateValueCollector}.
|
|
3049
|
+
* @public
|
|
3050
|
+
*/
|
|
3051
|
+
declare interface ICandidateValueCollectorCreateParams {
|
|
3052
|
+
/**
|
|
3053
|
+
* Optional normalizer to use for normalizing JSON values.
|
|
3054
|
+
* If not provided, a default Crc32Normalizer will be used.
|
|
3055
|
+
*/
|
|
3056
|
+
normalizer?: Hash.HashingNormalizer;
|
|
3057
|
+
/**
|
|
3058
|
+
* Optional initial candidate values to add to the collection.
|
|
3059
|
+
*/
|
|
3060
|
+
candidateValues?: (CandidateValue | JsonValue)[];
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
/**
|
|
3064
|
+
* Parameters for creating a {@link Resources.CandidateValue | CandidateValue}.
|
|
3065
|
+
* @public
|
|
3066
|
+
*/
|
|
3067
|
+
declare interface ICandidateValueCreateParams {
|
|
3068
|
+
/**
|
|
3069
|
+
* The JSON value to store. Will be normalized during creation.
|
|
3070
|
+
*/
|
|
3071
|
+
json: JsonValue;
|
|
3072
|
+
/**
|
|
3073
|
+
* Optional normalizer to use for normalizing the JSON value.
|
|
3074
|
+
* If not provided, a default Crc32Normalizer will be used.
|
|
3075
|
+
*/
|
|
3076
|
+
normalizer?: Hash.Crc32Normalizer;
|
|
3077
|
+
/**
|
|
3078
|
+
* Optional index if the value is already indexed.
|
|
3079
|
+
*/
|
|
3080
|
+
index?: number;
|
|
3081
|
+
}
|
|
3082
|
+
|
|
2343
3083
|
/**
|
|
2344
3084
|
* Non-validated child declaration of a {@link Conditions.Condition | condition}.
|
|
2345
3085
|
* @public
|
|
@@ -2463,9 +3203,9 @@ declare interface ICompiledAbstractDecision {
|
|
|
2463
3203
|
*/
|
|
2464
3204
|
declare interface ICompiledCandidate {
|
|
2465
3205
|
/**
|
|
2466
|
-
* The JSON value of the candidate.
|
|
3206
|
+
* The global index of the JSON value of the candidate.
|
|
2467
3207
|
*/
|
|
2468
|
-
|
|
3208
|
+
valueIndex: Common.CandidateValueIndex;
|
|
2469
3209
|
/**
|
|
2470
3210
|
* Indicates if this is a partial resource that needs to be merged.
|
|
2471
3211
|
*/
|
|
@@ -2638,6 +3378,10 @@ declare interface ICompiledResourceCollection {
|
|
|
2638
3378
|
* Array of all decisions in the collection.
|
|
2639
3379
|
*/
|
|
2640
3380
|
decisions: ReadonlyArray<ICompiledAbstractDecision>;
|
|
3381
|
+
/**
|
|
3382
|
+
* Array of all candidate values in the collection.
|
|
3383
|
+
*/
|
|
3384
|
+
candidateValues: ReadonlyArray<JsonValue>;
|
|
2641
3385
|
/**
|
|
2642
3386
|
* Array of all resources in the collection.
|
|
2643
3387
|
*/
|
|
@@ -2829,6 +3573,19 @@ declare interface IConditionTokenParts {
|
|
|
2829
3573
|
value: string;
|
|
2830
3574
|
}
|
|
2831
3575
|
|
|
3576
|
+
/**
|
|
3577
|
+
* Interface for a factory that creates a new instance of a configuration object.
|
|
3578
|
+
* @public
|
|
3579
|
+
*/
|
|
3580
|
+
declare interface IConfigInitFactory<TConfig, T> {
|
|
3581
|
+
/**
|
|
3582
|
+
* Creates a new instance of a configuration object.
|
|
3583
|
+
* @param config - The configuration object to create.
|
|
3584
|
+
* @returns A result containing the new instance of the configuration object.
|
|
3585
|
+
*/
|
|
3586
|
+
create(config: TConfig): Result<T>;
|
|
3587
|
+
}
|
|
3588
|
+
|
|
2832
3589
|
/**
|
|
2833
3590
|
* Declared context for a resource container.
|
|
2834
3591
|
* @public
|
|
@@ -2886,11 +3643,19 @@ declare interface IContextMatchOptions {
|
|
|
2886
3643
|
}
|
|
2887
3644
|
|
|
2888
3645
|
/**
|
|
2889
|
-
*
|
|
3646
|
+
* Union type for context qualifier providers that can be either read-only or mutable.
|
|
3647
|
+
* Provides compile-time type discrimination via the `mutable` property.
|
|
3648
|
+
* @public
|
|
3649
|
+
*/
|
|
3650
|
+
declare type IContextQualifierProvider = IReadOnlyContextQualifierProvider | IMutableContextQualifierProvider;
|
|
3651
|
+
|
|
3652
|
+
/**
|
|
3653
|
+
* Base interface for providing qualifier values in an optimized runtime context.
|
|
3654
|
+
* Contains common read-only operations shared by both mutable and immutable providers.
|
|
2890
3655
|
* Acts as a property bag using the Result pattern for qualifier value lookups.
|
|
2891
3656
|
* @public
|
|
2892
3657
|
*/
|
|
2893
|
-
declare interface
|
|
3658
|
+
declare interface IContextQualifierProviderBase {
|
|
2894
3659
|
/**
|
|
2895
3660
|
* Gets a qualifier value by its name, index, or qualifier object.
|
|
2896
3661
|
* @param nameOrIndexOrQualifier - The {@link QualifierName | qualifier name}, {@link QualifierIndex | index}, or {@link Qualifiers.Qualifier | qualifier object} to look up.
|
|
@@ -2925,13 +3690,62 @@ declare interface IContextQualifierProvider {
|
|
|
2925
3690
|
}
|
|
2926
3691
|
|
|
2927
3692
|
/**
|
|
2928
|
-
*
|
|
3693
|
+
* Base interface for shared operations between read-only and mutable context qualifier provider validators.
|
|
3694
|
+
* Contains common methods that don't depend on provider mutability.
|
|
2929
3695
|
* @public
|
|
2930
3696
|
*/
|
|
2931
|
-
declare interface
|
|
2932
|
-
|
|
3697
|
+
declare interface IContextQualifierProviderValidatorBase<T extends IContextQualifierProvider = IContextQualifierProvider> {
|
|
3698
|
+
/**
|
|
3699
|
+
* The wrapped context qualifier provider.
|
|
3700
|
+
*/
|
|
3701
|
+
readonly provider: T;
|
|
3702
|
+
/**
|
|
3703
|
+
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
3704
|
+
*/
|
|
3705
|
+
readonly qualifiers: IReadOnlyQualifierCollector;
|
|
3706
|
+
/**
|
|
3707
|
+
* Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
|
|
3708
|
+
* @param name - The string name to convert and look up.
|
|
3709
|
+
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
3710
|
+
* or `Failure` with an error message if not found or an error occurs.
|
|
3711
|
+
*/
|
|
3712
|
+
get(name: string): Result<QualifierContextValue>;
|
|
3713
|
+
/**
|
|
3714
|
+
* Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
|
|
3715
|
+
* @param index - The number index to convert and look up.
|
|
3716
|
+
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
3717
|
+
* or `Failure` with an error message if not found or an error occurs.
|
|
3718
|
+
*/
|
|
3719
|
+
getByIndex(index: number): Result<QualifierContextValue>;
|
|
3720
|
+
/**
|
|
3721
|
+
* Gets a validated qualifier context value by its string name.
|
|
3722
|
+
* @param name - The string name to convert and look up.
|
|
3723
|
+
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
3724
|
+
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
3725
|
+
*/
|
|
3726
|
+
getValidated(name: string): Result<QualifierContextValue>;
|
|
3727
|
+
/**
|
|
3728
|
+
* Gets a validated qualifier context value by its number index.
|
|
3729
|
+
* @param index - The number index to convert and look up.
|
|
3730
|
+
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
3731
|
+
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
3732
|
+
*/
|
|
3733
|
+
getValidatedByIndex(index: number): Result<QualifierContextValue>;
|
|
3734
|
+
/**
|
|
3735
|
+
* Checks if a qualifier value exists with the given string name.
|
|
3736
|
+
* @param name - The string name to convert and check.
|
|
3737
|
+
* @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
|
|
3738
|
+
* or `Failure` with an error message if an error occurs during the check.
|
|
3739
|
+
*/
|
|
3740
|
+
has(name: string): Result<boolean>;
|
|
2933
3741
|
}
|
|
2934
3742
|
|
|
3743
|
+
/**
|
|
3744
|
+
* Union type for validator constructor parameters.
|
|
3745
|
+
* @public
|
|
3746
|
+
*/
|
|
3747
|
+
declare type IContextQualifierProviderValidatorCreateParams = IReadOnlyContextQualifierProviderValidatorCreateParams | IMutableContextQualifierProviderValidatorCreateParams;
|
|
3748
|
+
|
|
2935
3749
|
/**
|
|
2936
3750
|
* Non-validated declaration of a single context qualifier value.
|
|
2937
3751
|
* @public
|
|
@@ -3113,6 +3927,46 @@ declare interface IImportContext {
|
|
|
3113
3927
|
readonly conditions?: ReadonlyArray<IConditionDecl>;
|
|
3114
3928
|
}
|
|
3115
3929
|
|
|
3930
|
+
/**
|
|
3931
|
+
* JSON representation of an imported directory structure
|
|
3932
|
+
* @public
|
|
3933
|
+
*/
|
|
3934
|
+
declare interface IImportedDirectory {
|
|
3935
|
+
/** Directory name */
|
|
3936
|
+
name: string;
|
|
3937
|
+
/** Files in this directory */
|
|
3938
|
+
files: IImportedFile[];
|
|
3939
|
+
/** Subdirectories */
|
|
3940
|
+
subdirectories: IImportedDirectory[];
|
|
3941
|
+
}
|
|
3942
|
+
|
|
3943
|
+
/**
|
|
3944
|
+
* Imported directory structure
|
|
3945
|
+
* @public
|
|
3946
|
+
*/
|
|
3947
|
+
declare type IImportedDirectory_2 = Json_2.IImportedDirectory;
|
|
3948
|
+
|
|
3949
|
+
/**
|
|
3950
|
+
* JSON representation of an imported file
|
|
3951
|
+
* @public
|
|
3952
|
+
*/
|
|
3953
|
+
declare interface IImportedFile {
|
|
3954
|
+
/** File name */
|
|
3955
|
+
name: string;
|
|
3956
|
+
/** Full path within archive */
|
|
3957
|
+
path: string;
|
|
3958
|
+
/** File content as string */
|
|
3959
|
+
content: string;
|
|
3960
|
+
/** MIME type */
|
|
3961
|
+
type: string;
|
|
3962
|
+
}
|
|
3963
|
+
|
|
3964
|
+
/**
|
|
3965
|
+
* Imported file representation
|
|
3966
|
+
* @public
|
|
3967
|
+
*/
|
|
3968
|
+
declare type IImportedFile_2 = Json_2.IImportedFile;
|
|
3969
|
+
|
|
3116
3970
|
/**
|
|
3117
3971
|
* Generic interface for an importer than accepts a typed
|
|
3118
3972
|
* {@link Import.IImportable | importable} item, extracts any resources
|
|
@@ -3246,6 +4100,11 @@ declare interface IJsonResourceTypeCreateParams {
|
|
|
3246
4100
|
* instance.
|
|
3247
4101
|
*/
|
|
3248
4102
|
index?: number;
|
|
4103
|
+
/**
|
|
4104
|
+
* Optional template for new instances of {@link ResourceTypes.JsonResourceType | JsonResourceType}
|
|
4105
|
+
* resources.
|
|
4106
|
+
*/
|
|
4107
|
+
template?: JsonObject;
|
|
3249
4108
|
}
|
|
3250
4109
|
|
|
3251
4110
|
/**
|
|
@@ -3310,10 +4169,10 @@ declare interface ILiteralQualifierTypeCreateParams {
|
|
|
3310
4169
|
*/
|
|
3311
4170
|
enumeratedValues?: ReadonlyArray<string>;
|
|
3312
4171
|
/**
|
|
3313
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
4172
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
3314
4173
|
* of literal values to use for matching. If not provided, no hierarchy will be used.
|
|
3315
4174
|
*/
|
|
3316
|
-
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
4175
|
+
hierarchy?: Config_2.LiteralValueHierarchyDecl<string>;
|
|
3317
4176
|
/**
|
|
3318
4177
|
* Global index for this qualifier type.
|
|
3319
4178
|
*/
|
|
@@ -3337,7 +4196,7 @@ declare interface ILiteralValue<T extends string> {
|
|
|
3337
4196
|
*/
|
|
3338
4197
|
declare interface ILiteralValueHierarchyCreateParams<T extends string = string> {
|
|
3339
4198
|
values: ReadonlyArray<T>;
|
|
3340
|
-
hierarchy?: LiteralValueHierarchyDecl<T
|
|
4199
|
+
hierarchy?: Partial<LiteralValueHierarchyDecl<T>>;
|
|
3341
4200
|
}
|
|
3342
4201
|
|
|
3343
4202
|
/**
|
|
@@ -3569,6 +4428,19 @@ declare class ImportContext implements IValidatedImportContext {
|
|
|
3569
4428
|
static forContainerImport(container?: ResourceJson.Normalized.IContainerContextDecl, importer?: ImportContext): Result<ImportContext | undefined>;
|
|
3570
4429
|
}
|
|
3571
4430
|
|
|
4431
|
+
/**
|
|
4432
|
+
* Converter for imported directory structure (recursive)
|
|
4433
|
+
* Note: Uses Converter pattern because Validators don't support recursion with self parameter
|
|
4434
|
+
* @public
|
|
4435
|
+
*/
|
|
4436
|
+
declare const importedDirectory: Converter<Json_2.IImportedDirectory>;
|
|
4437
|
+
|
|
4438
|
+
/**
|
|
4439
|
+
* Converter for imported file
|
|
4440
|
+
* @public
|
|
4441
|
+
*/
|
|
4442
|
+
declare const importedFile: Converter<Json_2.IImportedFile>;
|
|
4443
|
+
|
|
3572
4444
|
/**
|
|
3573
4445
|
* `Converter` for a normalized {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declaration}.
|
|
3574
4446
|
* @public
|
|
@@ -3665,6 +4537,73 @@ declare class ImportManager {
|
|
|
3665
4537
|
protected _import(): Result<ImportManager>;
|
|
3666
4538
|
}
|
|
3667
4539
|
|
|
4540
|
+
/**
|
|
4541
|
+
* Mutable interface for providing qualifier values in an optimized runtime context.
|
|
4542
|
+
* Extends the base interface with mutation operations and explicit mutability marker.
|
|
4543
|
+
* @public
|
|
4544
|
+
*/
|
|
4545
|
+
declare interface IMutableContextQualifierProvider extends IContextQualifierProviderBase {
|
|
4546
|
+
/**
|
|
4547
|
+
* Explicit mutability marker for compile-time type discrimination.
|
|
4548
|
+
* Always `true` for mutable providers.
|
|
4549
|
+
*/
|
|
4550
|
+
readonly mutable: true;
|
|
4551
|
+
/**
|
|
4552
|
+
* Sets a qualifier value in this provider.
|
|
4553
|
+
* @param name - The {@link QualifierName | qualifier name} to set.
|
|
4554
|
+
* @param value - The {@link QualifierContextValue | qualifier context value} to set.
|
|
4555
|
+
* @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
|
|
4556
|
+
* or `Failure` with an error message if not.
|
|
4557
|
+
*/
|
|
4558
|
+
set(name: QualifierName, value: QualifierContextValue): Result<QualifierContextValue>;
|
|
4559
|
+
/**
|
|
4560
|
+
* Removes a qualifier value from this provider.
|
|
4561
|
+
* @param name - The {@link QualifierName | qualifier name} to remove.
|
|
4562
|
+
* @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
|
|
4563
|
+
* or `Failure` with an error message if not found or an error occurs.
|
|
4564
|
+
*/
|
|
4565
|
+
remove(name: QualifierName): Result<QualifierContextValue>;
|
|
4566
|
+
/**
|
|
4567
|
+
* Clears all qualifier values from this provider.
|
|
4568
|
+
*/
|
|
4569
|
+
clear(): void;
|
|
4570
|
+
}
|
|
4571
|
+
|
|
4572
|
+
/**
|
|
4573
|
+
* A mutable interface for validators wrapping mutable context qualifier providers.
|
|
4574
|
+
* Extends the base interface with mutation operations and provides compile-time type safety.
|
|
4575
|
+
* @public
|
|
4576
|
+
*/
|
|
4577
|
+
declare interface IMutableContextQualifierProviderValidator<T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider> extends IContextQualifierProviderValidatorBase<T> {
|
|
4578
|
+
/**
|
|
4579
|
+
* The wrapped mutable context qualifier provider.
|
|
4580
|
+
*/
|
|
4581
|
+
readonly provider: T;
|
|
4582
|
+
/**
|
|
4583
|
+
* Sets a qualifier value using string inputs, converting to strongly-typed values.
|
|
4584
|
+
* @param name - The string name to convert.
|
|
4585
|
+
* @param value - The string value to convert.
|
|
4586
|
+
* @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
|
|
4587
|
+
* or `Failure` with an error message if an error occurs.
|
|
4588
|
+
*/
|
|
4589
|
+
set(name: string, value: string): Result<QualifierContextValue>;
|
|
4590
|
+
/**
|
|
4591
|
+
* Removes a qualifier value using string input, converting to strongly-typed QualifierName.
|
|
4592
|
+
* @param name - The string name to convert.
|
|
4593
|
+
* @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
|
|
4594
|
+
* or `Failure` with an error message if an error occurs.
|
|
4595
|
+
*/
|
|
4596
|
+
remove(name: string): Result<QualifierContextValue>;
|
|
4597
|
+
}
|
|
4598
|
+
|
|
4599
|
+
/**
|
|
4600
|
+
* Parameters for constructing a mutable context qualifier provider validator.
|
|
4601
|
+
* @public
|
|
4602
|
+
*/
|
|
4603
|
+
declare interface IMutableContextQualifierProviderValidatorCreateParams<T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider> {
|
|
4604
|
+
provider: T;
|
|
4605
|
+
}
|
|
4606
|
+
|
|
3668
4607
|
/**
|
|
3669
4608
|
* Parameters for creating a {@link Import.Importers.PathImporter | PathImporter}.
|
|
3670
4609
|
* @public
|
|
@@ -3754,11 +4693,15 @@ declare interface IQualifierDefaultValueTokenParts {
|
|
|
3754
4693
|
* territories, etc).
|
|
3755
4694
|
* @public
|
|
3756
4695
|
*/
|
|
3757
|
-
declare interface IQualifierType extends ICollectible<QualifierTypeName, QualifierTypeIndex> {
|
|
4696
|
+
declare interface IQualifierType<TCFGJSON extends JsonObject = JsonObject> extends ICollectible<QualifierTypeName, QualifierTypeIndex> {
|
|
3758
4697
|
/**
|
|
3759
4698
|
* The name of the qualifier type.
|
|
3760
4699
|
*/
|
|
3761
4700
|
readonly name: QualifierTypeName;
|
|
4701
|
+
/**
|
|
4702
|
+
* Name of the underlying system type.
|
|
4703
|
+
*/
|
|
4704
|
+
readonly systemTypeName: QualifierTypeName;
|
|
3762
4705
|
/**
|
|
3763
4706
|
* Unique key for this qualifier.
|
|
3764
4707
|
*/
|
|
@@ -3816,11 +4759,22 @@ declare interface IQualifierType extends ICollectible<QualifierTypeName, Qualifi
|
|
|
3816
4759
|
* @returns a {@link QualifierMatchScore | score} indicating the extent to which
|
|
3817
4760
|
* the condition matches the context value.
|
|
3818
4761
|
*/
|
|
3819
|
-
matches(condition: QualifierConditionValue, context: QualifierContextValue, operator: ConditionOperator): QualifierMatchScore;
|
|
4762
|
+
matches(condition: QualifierConditionValue, context: QualifierContextValue, operator: ConditionOperator): QualifierMatchScore;
|
|
4763
|
+
/**
|
|
4764
|
+
* Sets the index for this qualifier type. Once set, index is immutable.
|
|
4765
|
+
*/
|
|
4766
|
+
setIndex(index: number): Result<QualifierTypeIndex>;
|
|
4767
|
+
/**
|
|
4768
|
+
* Gets the configuration for this qualifier type.
|
|
4769
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
4770
|
+
*/
|
|
4771
|
+
getConfigurationJson(): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
|
|
3820
4772
|
/**
|
|
3821
|
-
*
|
|
4773
|
+
* Validates configuration JSON data for this qualifier type.
|
|
4774
|
+
* @param from - The unknown data to validate as configuration JSON.
|
|
4775
|
+
* @returns `Success` with validated JSON configuration if valid, `Failure` with an error message otherwise.
|
|
3822
4776
|
*/
|
|
3823
|
-
|
|
4777
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
|
|
3824
4778
|
}
|
|
3825
4779
|
|
|
3826
4780
|
/**
|
|
@@ -3875,68 +4829,36 @@ declare interface IQualifierTypeCreateParams {
|
|
|
3875
4829
|
}
|
|
3876
4830
|
|
|
3877
4831
|
/**
|
|
3878
|
-
*
|
|
4832
|
+
* Read-only interface for providing qualifier values in an optimized runtime context.
|
|
4833
|
+
* Explicitly marked as immutable with compile-time type discrimination.
|
|
3879
4834
|
* @public
|
|
3880
4835
|
*/
|
|
3881
|
-
declare interface
|
|
3882
|
-
/**
|
|
3883
|
-
* {@inheritdoc Runtime.Context.ContextQualifierProviderValidator.provider}
|
|
3884
|
-
*/
|
|
3885
|
-
readonly provider: IContextQualifierProvider;
|
|
3886
|
-
/**
|
|
3887
|
-
* {@inheritdoc Runtime.Context.ContextQualifierProviderValidator.qualifiers}
|
|
3888
|
-
*/
|
|
3889
|
-
readonly qualifiers: IReadOnlyQualifierCollector;
|
|
3890
|
-
/**
|
|
3891
|
-
* Gets a qualifier value by its string name, converting to strongly-typed QualifierName.
|
|
3892
|
-
* @param name - The string name to convert and look up.
|
|
3893
|
-
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
3894
|
-
* or `Failure` with an error message if not found or an error occurs.
|
|
3895
|
-
*/
|
|
3896
|
-
get(name: string): Result<QualifierContextValue>;
|
|
3897
|
-
/**
|
|
3898
|
-
* Gets a qualifier value by its number index, converting to strongly-typed QualifierIndex.
|
|
3899
|
-
* @param index - The number index to convert and look up.
|
|
3900
|
-
* @returns `Success` with the {@link QualifierContextValue | qualifier context value} if found,
|
|
3901
|
-
* or `Failure` with an error message if not found or an error occurs.
|
|
3902
|
-
*/
|
|
3903
|
-
getByIndex(index: number): Result<QualifierContextValue>;
|
|
3904
|
-
/**
|
|
3905
|
-
* Gets a validated qualifier context value by its string name.
|
|
3906
|
-
* @param name - The string name to convert and look up.
|
|
3907
|
-
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
3908
|
-
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
3909
|
-
*/
|
|
3910
|
-
getValidated(name: string): Result<QualifierContextValue>;
|
|
3911
|
-
/**
|
|
3912
|
-
* Gets a validated qualifier context value by its number index.
|
|
3913
|
-
* @param index - The number index to convert and look up.
|
|
3914
|
-
* @returns `Success` with the validated {@link QualifierContextValue | qualifier context value} if found,
|
|
3915
|
-
* or `Failure` with an error message if not found, invalid, or an error occurs.
|
|
3916
|
-
*/
|
|
3917
|
-
getValidatedByIndex(index: number): Result<QualifierContextValue>;
|
|
3918
|
-
/**
|
|
3919
|
-
* Checks if a qualifier value exists with the given string name.
|
|
3920
|
-
* @param name - The string name to convert and check.
|
|
3921
|
-
* @returns `Success` with `true` if the qualifier value exists, `false` if it doesn't,
|
|
3922
|
-
* or `Failure` with an error message if an error occurs during the check.
|
|
3923
|
-
*/
|
|
3924
|
-
has(name: string): Result<boolean>;
|
|
4836
|
+
declare interface IReadOnlyContextQualifierProvider extends IContextQualifierProviderBase {
|
|
3925
4837
|
/**
|
|
3926
|
-
*
|
|
3927
|
-
*
|
|
3928
|
-
* @param value - The string value to convert.
|
|
3929
|
-
* @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
|
|
3930
|
-
* or `Failure` with an error message if an error occurs.
|
|
4838
|
+
* Explicit mutability marker for compile-time type discrimination.
|
|
4839
|
+
* Always `false` for read-only providers.
|
|
3931
4840
|
*/
|
|
3932
|
-
|
|
4841
|
+
readonly mutable: false;
|
|
4842
|
+
}
|
|
4843
|
+
|
|
4844
|
+
/**
|
|
4845
|
+
* A read-only interface for validators wrapping read-only context qualifier providers.
|
|
4846
|
+
* Only exposes read operations, providing compile-time type safety by excluding mutation methods.
|
|
4847
|
+
* @public
|
|
4848
|
+
*/
|
|
4849
|
+
declare interface IReadOnlyContextQualifierProviderValidator<T extends IReadOnlyContextQualifierProvider = IReadOnlyContextQualifierProvider> {
|
|
3933
4850
|
/**
|
|
3934
|
-
*
|
|
3935
|
-
* @param name - The string name to convert.
|
|
3936
|
-
* @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
|
|
3937
|
-
* or `Failure` with an error message if an error occurs.
|
|
4851
|
+
* The wrapped read-only context qualifier provider.
|
|
3938
4852
|
*/
|
|
3939
|
-
|
|
4853
|
+
readonly provider: T;
|
|
4854
|
+
}
|
|
4855
|
+
|
|
4856
|
+
/**
|
|
4857
|
+
* Parameters for constructing a read-only context qualifier provider validator.
|
|
4858
|
+
* @public
|
|
4859
|
+
*/
|
|
4860
|
+
declare interface IReadOnlyContextQualifierProviderValidatorCreateParams<T extends IReadOnlyContextQualifierProvider = IReadOnlyContextQualifierProvider> {
|
|
4861
|
+
provider: T;
|
|
3940
4862
|
}
|
|
3941
4863
|
|
|
3942
4864
|
/**
|
|
@@ -3981,7 +4903,7 @@ declare interface IReadOnlyResourceTreeBranch<T> {
|
|
|
3981
4903
|
* Interface for a read-only result-based resource tree with navigation methods.
|
|
3982
4904
|
* @public
|
|
3983
4905
|
*/
|
|
3984
|
-
declare interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<
|
|
4906
|
+
declare interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<TNAME, IReadOnlyResourceTreeNode<T>> {
|
|
3985
4907
|
/**
|
|
3986
4908
|
* Gets a tree node by its full ResourceId path.
|
|
3987
4909
|
* @param id - The ResourceId path to look up
|
|
@@ -4068,6 +4990,29 @@ declare interface IReducedCandidate {
|
|
|
4068
4990
|
readonly mergeMethod?: ResourceValueMergeMethod;
|
|
4069
4991
|
}
|
|
4070
4992
|
|
|
4993
|
+
/**
|
|
4994
|
+
* Options for configuring resource tree resolution.
|
|
4995
|
+
* @public
|
|
4996
|
+
*/
|
|
4997
|
+
declare interface IResolveResourceTreeOptions {
|
|
4998
|
+
/**
|
|
4999
|
+
* Controls how errors are handled when resolving individual resources in the tree.
|
|
5000
|
+
* - 'fail': Aggregate all errors and fail if any resource fails to resolve
|
|
5001
|
+
* - 'ignore': Skip failed resources and omit them from the result
|
|
5002
|
+
* - callback: Custom error handler that can provide alternate values or propagate errors
|
|
5003
|
+
* @defaultValue 'fail'
|
|
5004
|
+
*/
|
|
5005
|
+
onResourceError?: 'fail' | 'ignore' | ResourceErrorHandler;
|
|
5006
|
+
/**
|
|
5007
|
+
* Controls how empty branch nodes are handled during tree composition.
|
|
5008
|
+
* - 'allow': Include empty branches as empty objects in the result
|
|
5009
|
+
* - 'omit': Exclude empty branches from the parent object
|
|
5010
|
+
* - callback: Custom handler that can provide alternate values or recovery logic
|
|
5011
|
+
* @defaultValue 'allow'
|
|
5012
|
+
*/
|
|
5013
|
+
onEmptyBranch?: 'allow' | 'omit' | EmptyBranchHandler;
|
|
5014
|
+
}
|
|
5015
|
+
|
|
4071
5016
|
/**
|
|
4072
5017
|
* Interface for a resource that can be used in the runtime layer.
|
|
4073
5018
|
* This provides the minimal properties needed from a resource without requiring
|
|
@@ -4077,8 +5022,10 @@ declare interface IReducedCandidate {
|
|
|
4077
5022
|
declare interface IResource {
|
|
4078
5023
|
/** The resource identifier */
|
|
4079
5024
|
readonly id: string;
|
|
5025
|
+
/** The resource name */
|
|
5026
|
+
readonly name: string;
|
|
4080
5027
|
/** The resource type */
|
|
4081
|
-
readonly resourceType:
|
|
5028
|
+
readonly resourceType: IResourceType;
|
|
4082
5029
|
/** The decision used to select candidates */
|
|
4083
5030
|
readonly decision: ConcreteDecision;
|
|
4084
5031
|
/** The available candidates for this resource */
|
|
@@ -4095,6 +5042,7 @@ declare interface IResourceBuilderCreateParams {
|
|
|
4095
5042
|
conditionSets: ConditionSetCollector;
|
|
4096
5043
|
resourceTypes: ReadOnlyResourceTypeCollector;
|
|
4097
5044
|
decisions: AbstractDecisionCollector;
|
|
5045
|
+
candidateValues: CandidateValueCollector;
|
|
4098
5046
|
}
|
|
4099
5047
|
|
|
4100
5048
|
/**
|
|
@@ -4124,6 +5072,7 @@ declare interface IResourceCandidateCreateParams {
|
|
|
4124
5072
|
resourceType?: ResourceType;
|
|
4125
5073
|
parentConditions?: ReadonlyArray<Condition>;
|
|
4126
5074
|
conditionSets: ConditionSetCollector;
|
|
5075
|
+
candidateValues: CandidateValueCollector;
|
|
4127
5076
|
}
|
|
4128
5077
|
|
|
4129
5078
|
/**
|
|
@@ -4137,10 +5086,10 @@ declare interface IResourceCandidateValidationProperties {
|
|
|
4137
5086
|
*/
|
|
4138
5087
|
id: ResourceId;
|
|
4139
5088
|
/**
|
|
4140
|
-
*
|
|
5089
|
+
* Describes how complete the candidate value is.
|
|
4141
5090
|
* @public
|
|
4142
5091
|
*/
|
|
4143
|
-
|
|
5092
|
+
completeness: CandidateCompleteness;
|
|
4144
5093
|
/**
|
|
4145
5094
|
* {@inheritdoc ResourceJson.Json.ILooseResourceCandidateDecl.json}
|
|
4146
5095
|
* @public
|
|
@@ -4281,7 +5230,7 @@ declare interface IResourceDeclContainer {
|
|
|
4281
5230
|
* implementations without requiring the full ResourceManagerBuilder build mechanics.
|
|
4282
5231
|
* @public
|
|
4283
5232
|
*/
|
|
4284
|
-
declare interface IResourceManager {
|
|
5233
|
+
export declare interface IResourceManager<TR extends IResource = IResource> {
|
|
4285
5234
|
/**
|
|
4286
5235
|
* A {@link Conditions.ReadOnlyConditionCollector | ReadOnlyConditionCollector} which
|
|
4287
5236
|
* contains the {@link Conditions.Condition | conditions} used by resource candidates.
|
|
@@ -4302,12 +5251,17 @@ declare interface IResourceManager {
|
|
|
4302
5251
|
* @param id - The resource identifier
|
|
4303
5252
|
* @returns Success with the runtime resource if found, Failure otherwise
|
|
4304
5253
|
*/
|
|
4305
|
-
getBuiltResource(id: string): Result<
|
|
5254
|
+
getBuiltResource(id: string): Result<TR>;
|
|
5255
|
+
/**
|
|
5256
|
+
* Gets a resource tree built from the resources in this resource manager.
|
|
5257
|
+
* @returns Result containing the resource tree root, or failure if tree construction fails
|
|
5258
|
+
*/
|
|
5259
|
+
getBuiltResourceTree(): Result<IReadOnlyResourceTreeRoot<TR>>;
|
|
4306
5260
|
/**
|
|
4307
5261
|
* A read-only result map of all built resources, keyed by resource ID.
|
|
4308
5262
|
* Resources are built on-demand when accessed and returns Results for error handling.
|
|
4309
5263
|
*/
|
|
4310
|
-
readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId,
|
|
5264
|
+
readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId, TR>;
|
|
4311
5265
|
/**
|
|
4312
5266
|
* The number of resources in this resource manager.
|
|
4313
5267
|
*/
|
|
@@ -4333,6 +5287,56 @@ declare interface IResourceManagerBuilderCreateParams {
|
|
|
4333
5287
|
resourceTypes: ReadOnlyResourceTypeCollector;
|
|
4334
5288
|
}
|
|
4335
5289
|
|
|
5290
|
+
/**
|
|
5291
|
+
* Options for ResourceManagerBuilder clone operations.
|
|
5292
|
+
* Extends IDeclarationOptions to include support for applying edits when cloning.
|
|
5293
|
+
* @public
|
|
5294
|
+
*/
|
|
5295
|
+
declare interface IResourceManagerCloneOptions extends IResourceDeclarationOptions {
|
|
5296
|
+
/**
|
|
5297
|
+
* Optional array of loose condition declarations to be applied as edits during the clone operation.
|
|
5298
|
+
* These conditions can modify or extend the resource candidates in the cloned manager.
|
|
5299
|
+
*/
|
|
5300
|
+
readonly candidates?: ReadonlyArray<ResourceJson.Json.ILooseResourceCandidateDecl>;
|
|
5301
|
+
/**
|
|
5302
|
+
* Optional qualifier collector to use for the cloned manager.
|
|
5303
|
+
* If not provided, uses the same qualifiers as the original manager.
|
|
5304
|
+
* This allows creating clones with different qualifier configurations.
|
|
5305
|
+
*/
|
|
5306
|
+
readonly qualifiers?: IReadOnlyQualifierCollector;
|
|
5307
|
+
/**
|
|
5308
|
+
* Optional resource type collector to use for the cloned manager.
|
|
5309
|
+
* If not provided, uses the same resource types as the original manager.
|
|
5310
|
+
* This allows creating clones with different resource type configurations.
|
|
5311
|
+
*/
|
|
5312
|
+
readonly resourceTypes?: ReadOnlyResourceTypeCollector;
|
|
5313
|
+
}
|
|
5314
|
+
|
|
5315
|
+
/**
|
|
5316
|
+
* Minimal resource resolver
|
|
5317
|
+
* @public
|
|
5318
|
+
*/
|
|
5319
|
+
export declare interface IResourceResolver {
|
|
5320
|
+
/**
|
|
5321
|
+
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
5322
|
+
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
5323
|
+
* priority "partial" candidates into it in ascending order of priority.
|
|
5324
|
+
* @param resource - The string id of the resource to resolve.
|
|
5325
|
+
* @returns `Success` with the composed JsonValue if successful,
|
|
5326
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
5327
|
+
* @public
|
|
5328
|
+
*/
|
|
5329
|
+
resolveComposedResourceValue(resource: string): Result<JsonValue>;
|
|
5330
|
+
/**
|
|
5331
|
+
* Creates a new {@link IResourceResolver | resource resolver} with the given context.
|
|
5332
|
+
* @param context - The context to use for the new resource resolver.
|
|
5333
|
+
* @returns `Success` with the new resource resolver if successful,
|
|
5334
|
+
* or `Failure` with an error message if the context is invalid.
|
|
5335
|
+
* @public
|
|
5336
|
+
*/
|
|
5337
|
+
withContext(context: Record<string, string>): Result<IResourceResolver>;
|
|
5338
|
+
}
|
|
5339
|
+
|
|
4336
5340
|
/**
|
|
4337
5341
|
* A listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.
|
|
4338
5342
|
* @public
|
|
@@ -4356,6 +5360,11 @@ declare interface IResourceResolverCacheListener {
|
|
|
4356
5360
|
* @param index - The index of the cache that had an error.
|
|
4357
5361
|
*/
|
|
4358
5362
|
onCacheError(cache: ResourceResolverCacheType, index: number): void;
|
|
5363
|
+
/**
|
|
5364
|
+
* Called when a context error occurs.
|
|
5365
|
+
* @param error - The error that occurred.
|
|
5366
|
+
*/
|
|
5367
|
+
onContextError(qualifier: string, error: string): void;
|
|
4359
5368
|
/**
|
|
4360
5369
|
* Called when a cache is cleared.
|
|
4361
5370
|
* @param cache - The type of cache that was cleared.
|
|
@@ -4387,6 +5396,24 @@ declare interface IResourceResolverCreateParams {
|
|
|
4387
5396
|
* An optional listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.
|
|
4388
5397
|
*/
|
|
4389
5398
|
listener?: IResourceResolverCacheListener;
|
|
5399
|
+
/**
|
|
5400
|
+
* Optional configuration options for the {@link Runtime.ResourceResolver | ResourceResolver}.
|
|
5401
|
+
*/
|
|
5402
|
+
options?: IResourceResolverOptions;
|
|
5403
|
+
}
|
|
5404
|
+
|
|
5405
|
+
/**
|
|
5406
|
+
* Options for configuring a {@link Runtime.ResourceResolver | ResourceResolver}.
|
|
5407
|
+
* @public
|
|
5408
|
+
*/
|
|
5409
|
+
declare interface IResourceResolverOptions {
|
|
5410
|
+
/**
|
|
5411
|
+
* Controls whether null values in resource composition should suppress properties
|
|
5412
|
+
* instead of setting them to null. When true, properties with null values from
|
|
5413
|
+
* higher-priority partial candidates will be omitted from the final composed resource.
|
|
5414
|
+
* @defaultValue false
|
|
5415
|
+
*/
|
|
5416
|
+
suppressNullAsDelete?: boolean;
|
|
4390
5417
|
}
|
|
4391
5418
|
|
|
4392
5419
|
/**
|
|
@@ -4453,13 +5480,82 @@ declare interface IResourceTreeRootInit<T> {
|
|
|
4453
5480
|
readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;
|
|
4454
5481
|
}
|
|
4455
5482
|
|
|
5483
|
+
/**
|
|
5484
|
+
* Interface for a resource type. Resource types are responsible for
|
|
5485
|
+
* validating and converting JSON values into the appropriate strongly-typed
|
|
5486
|
+
* resource value.
|
|
5487
|
+
* @public
|
|
5488
|
+
*/
|
|
5489
|
+
declare interface IResourceType<T = unknown> extends ICollectible<ResourceTypeName, ResourceTypeIndex> {
|
|
5490
|
+
/**
|
|
5491
|
+
* The key for this resource type.
|
|
5492
|
+
*/
|
|
5493
|
+
readonly key: ResourceTypeName;
|
|
5494
|
+
/**
|
|
5495
|
+
* The index for this resource type.
|
|
5496
|
+
*/
|
|
5497
|
+
readonly index: ResourceTypeIndex | undefined;
|
|
5498
|
+
/**
|
|
5499
|
+
* Validates properties of a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration} for
|
|
5500
|
+
* a resource instance value.
|
|
5501
|
+
* @param props - The {@link ResourceTypes.IResourceCandidateValidationProperties | properties } to validate.
|
|
5502
|
+
* @returns `Success` with the strongly-typed resource value if the JSON and merge method
|
|
5503
|
+
* are valid, `Failure` with an error message otherwise.
|
|
5504
|
+
* @public
|
|
5505
|
+
*/
|
|
5506
|
+
validateDeclaration(props: IResourceCandidateValidationProperties): Result<T | Partial<T>>;
|
|
5507
|
+
/**
|
|
5508
|
+
* Validates a JSON value for use as a partial resource instance value.
|
|
5509
|
+
* @param json - The JSON value to validate.
|
|
5510
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
5511
|
+
* @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
|
|
5512
|
+
* `Failure` with an error message otherwise.
|
|
5513
|
+
* @public
|
|
5514
|
+
*/
|
|
5515
|
+
validate(json: JsonValue, completeness: CandidateCompleteness): Result<Partial<T>>;
|
|
5516
|
+
/**
|
|
5517
|
+
* Validates a JSON value for use as a complete resource instance value.
|
|
5518
|
+
* @param json - The JSON value to validate.
|
|
5519
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
5520
|
+
* @returns `Success` with the strongly-typed resource value if the JSON is valid,
|
|
5521
|
+
* `Failure` with an error message otherwise.
|
|
5522
|
+
* @public
|
|
5523
|
+
*/
|
|
5524
|
+
validate(json: JsonValue, completeness: 'full'): Result<T>;
|
|
5525
|
+
/**
|
|
5526
|
+
* Validates a JSON value for use as a partial resource instance value.
|
|
5527
|
+
* @param json - The JSON value to validate.
|
|
5528
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
5529
|
+
* @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
|
|
5530
|
+
* `Failure` with an error message otherwise.
|
|
5531
|
+
* @public
|
|
5532
|
+
*/
|
|
5533
|
+
validate(json: JsonValue, completeness: 'partial'): Result<Partial<T>>;
|
|
5534
|
+
/**
|
|
5535
|
+
* Sets the index for this resource type. Once set, the index cannot be changed.
|
|
5536
|
+
*/
|
|
5537
|
+
setIndex(index: number): Result<ResourceTypeIndex>;
|
|
5538
|
+
/**
|
|
5539
|
+
* Creates a template for a new resource of this type.
|
|
5540
|
+
* The template provides a default structure for creating new resource instances.
|
|
5541
|
+
* @param resourceId - The id for the new resource.
|
|
5542
|
+
* @param init - An optional initial value for the resource.
|
|
5543
|
+
* @param resolver - An optional resource resolver that can be used to create the template.
|
|
5544
|
+
* @param conditions - An optional set of conditions that must be met for the resource to be selected.
|
|
5545
|
+
* @returns A loose resource declaration with default values for this resource type.
|
|
5546
|
+
* @public
|
|
5547
|
+
*/
|
|
5548
|
+
createTemplate(resourceId: ResourceId, init?: JsonValue, conditions?: ResourceJson.Json.ConditionSetDecl, resolver?: IResourceResolver): Result<ResourceJson.Json.ILooseResourceDecl>;
|
|
5549
|
+
}
|
|
5550
|
+
|
|
4456
5551
|
/**
|
|
4457
5552
|
* Configuration for a {@link ResourceTypes.ResourceType | resource type}.
|
|
4458
5553
|
* @public
|
|
4459
5554
|
*/
|
|
4460
|
-
declare interface IResourceTypeConfig {
|
|
5555
|
+
declare interface IResourceTypeConfig<T extends JsonObject = JsonObject> {
|
|
4461
5556
|
name: string;
|
|
4462
5557
|
typeName: string;
|
|
5558
|
+
template?: T;
|
|
4463
5559
|
}
|
|
4464
5560
|
|
|
4465
5561
|
/**
|
|
@@ -4514,6 +5610,33 @@ declare function isResourceTreeLeafInit<T>(init: ResourceTreeNodeInit<T>): init
|
|
|
4514
5610
|
*/
|
|
4515
5611
|
declare function isResourceTreeRootOrNodeInit<T>(init: ResourceTreeNodeInit<T> | IResourceTreeRootInit<T>): init is IResourceTreeBranchInit<T>;
|
|
4516
5612
|
|
|
5613
|
+
/**
|
|
5614
|
+
* Checks if a {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} is a
|
|
5615
|
+
* {@link QualifierTypes.Config.ISystemQualifierTypeConfig | system qualifier type configuration}.
|
|
5616
|
+
* @param config - The {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} to check.
|
|
5617
|
+
* @returns `true` if the configuration is a system qualifier type configuration, `false` otherwise.
|
|
5618
|
+
* @public
|
|
5619
|
+
*/
|
|
5620
|
+
declare function isSystemQualifierTypeConfig(config: IAnyQualifierTypeConfig): config is ISystemQualifierTypeConfig;
|
|
5621
|
+
|
|
5622
|
+
/**
|
|
5623
|
+
* Checks if the given index is a valid candidate value index.
|
|
5624
|
+
*
|
|
5625
|
+
* @param index - The index to validate.
|
|
5626
|
+
* @returns `true` if the index is a valid candidate value index, otherwise `false`.
|
|
5627
|
+
* @public
|
|
5628
|
+
*/
|
|
5629
|
+
declare function isValidCandidateValueIndex(index: number): index is CandidateValueIndex;
|
|
5630
|
+
|
|
5631
|
+
/**
|
|
5632
|
+
* Checks if the given key is a valid candidate value key.
|
|
5633
|
+
*
|
|
5634
|
+
* @param key - The key to validate.
|
|
5635
|
+
* @returns `true` if the key is a valid candidate value key, otherwise `false`.
|
|
5636
|
+
* @public
|
|
5637
|
+
*/
|
|
5638
|
+
declare function isValidCandidateValueKey(key: string): key is CandidateValueKey;
|
|
5639
|
+
|
|
4517
5640
|
/**
|
|
4518
5641
|
* Determines whether a number is a valid condition index.
|
|
4519
5642
|
* @param index - the number to validate
|
|
@@ -4627,6 +5750,15 @@ declare function isValidDecisionIndex(index: number): index is DecisionIndex;
|
|
|
4627
5750
|
*/
|
|
4628
5751
|
declare function isValidDecisionKey(key: string): key is DecisionKey;
|
|
4629
5752
|
|
|
5753
|
+
/**
|
|
5754
|
+
* Determines whether a string is a valid qualifier context value.
|
|
5755
|
+
* For now, any non-empty string is considered a valid context value.
|
|
5756
|
+
* @param value - the string to validate
|
|
5757
|
+
* @returns true if the string is a valid qualifier context value, false otherwise.
|
|
5758
|
+
* @public
|
|
5759
|
+
*/
|
|
5760
|
+
declare function isValidQualifierContextValue(value: string): value is QualifierContextValue;
|
|
5761
|
+
|
|
4630
5762
|
/**
|
|
4631
5763
|
* Determines whether a string is a valid qualifier default values token.
|
|
4632
5764
|
* Qualifier default values tokens are pipe-separated lists of qualifier default value tokens.
|
|
@@ -4742,7 +5874,7 @@ declare interface ISystemConfiguration {
|
|
|
4742
5874
|
/** Optional description explaining the purpose and use case of the configuration. */
|
|
4743
5875
|
description?: string;
|
|
4744
5876
|
/** Qualifier type configurations that define the available qualifier types in the system. */
|
|
4745
|
-
qualifierTypes: QualifierTypes.Config.
|
|
5877
|
+
qualifierTypes: QualifierTypes.Config.IAnyQualifierTypeConfig[];
|
|
4746
5878
|
/** Qualifier declarations that define the available qualifiers in the system. */
|
|
4747
5879
|
qualifiers: Qualifiers.IQualifierDecl[];
|
|
4748
5880
|
/** Resource type configurations that define the available resource types in the system. */
|
|
@@ -4760,6 +5892,8 @@ declare interface ISystemConfigurationInitParams {
|
|
|
4760
5892
|
* Use `null` as the value to remove an existing default value.
|
|
4761
5893
|
*/
|
|
4762
5894
|
qualifierDefaultValues?: Record<string, string | null>;
|
|
5895
|
+
qualifierTypeFactory?: IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, QualifierType>;
|
|
5896
|
+
resourceTypeFactory?: IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType>;
|
|
4763
5897
|
}
|
|
4764
5898
|
|
|
4765
5899
|
/**
|
|
@@ -4792,6 +5926,14 @@ declare interface ISystemTerritoryQualifierTypeConfig extends IQualifierTypeConf
|
|
|
4792
5926
|
systemType: 'territory';
|
|
4793
5927
|
}
|
|
4794
5928
|
|
|
5929
|
+
/**
|
|
5930
|
+
* Validate ZIP file extension
|
|
5931
|
+
* @param filename - Filename to validate
|
|
5932
|
+
* @returns True if filename has .zip extension
|
|
5933
|
+
* @public
|
|
5934
|
+
*/
|
|
5935
|
+
declare function isZipFile(filename: string): boolean;
|
|
5936
|
+
|
|
4795
5937
|
/**
|
|
4796
5938
|
* Configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.
|
|
4797
5939
|
* @public
|
|
@@ -4801,7 +5943,7 @@ declare interface ITerritoryQualifierTypeConfig {
|
|
|
4801
5943
|
acceptLowercase?: boolean;
|
|
4802
5944
|
allowedTerritories?: string[];
|
|
4803
5945
|
/**
|
|
4804
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
5946
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
4805
5947
|
* of territory values to use for matching. If not provided, no hierarchy will be used.
|
|
4806
5948
|
*/
|
|
4807
5949
|
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
@@ -4834,10 +5976,10 @@ declare interface ITerritoryQualifierTypeCreateParams {
|
|
|
4834
5976
|
*/
|
|
4835
5977
|
acceptLowercase?: boolean;
|
|
4836
5978
|
/**
|
|
4837
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
5979
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
4838
5980
|
* of territory values to use for matching. If not provided, no hierarchy will be used.
|
|
4839
5981
|
*/
|
|
4840
|
-
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
5982
|
+
hierarchy?: Config_2.LiteralValueHierarchyDecl<string>;
|
|
4841
5983
|
}
|
|
4842
5984
|
|
|
4843
5985
|
/**
|
|
@@ -4965,6 +6107,111 @@ declare interface IValidatingSimpleContextQualifierProviderCreateParams {
|
|
|
4965
6107
|
qualifierValues?: Record<string, string>;
|
|
4966
6108
|
}
|
|
4967
6109
|
|
|
6110
|
+
/**
|
|
6111
|
+
* JSON representation of ZIP archive config information
|
|
6112
|
+
* @public
|
|
6113
|
+
*/
|
|
6114
|
+
declare interface IZipArchiveConfigInfo {
|
|
6115
|
+
/** Type of config (always 'file') */
|
|
6116
|
+
type: 'file';
|
|
6117
|
+
/** Original config file path */
|
|
6118
|
+
originalPath: string;
|
|
6119
|
+
/** Path within the archive (e.g., "config.json") */
|
|
6120
|
+
archivePath: string;
|
|
6121
|
+
}
|
|
6122
|
+
|
|
6123
|
+
/**
|
|
6124
|
+
* Options for creating a ZIP archive buffer from a file tree
|
|
6125
|
+
* @public
|
|
6126
|
+
*/
|
|
6127
|
+
declare interface IZipArchiveFileTreeOptions {
|
|
6128
|
+
/** Input file or directory */
|
|
6129
|
+
inputItem?: FileTree.FileTreeItem;
|
|
6130
|
+
/** Optional configuration file */
|
|
6131
|
+
configItem?: FileTree.IFileTreeFileItem;
|
|
6132
|
+
}
|
|
6133
|
+
|
|
6134
|
+
/**
|
|
6135
|
+
* JSON representation of ZIP archive input information
|
|
6136
|
+
* @public
|
|
6137
|
+
*/
|
|
6138
|
+
declare interface IZipArchiveInputInfo {
|
|
6139
|
+
/** Type of input (file or directory) */
|
|
6140
|
+
type: 'file' | 'directory';
|
|
6141
|
+
/** Original file/directory path */
|
|
6142
|
+
originalPath: string;
|
|
6143
|
+
/** Path within the archive (e.g., "input/mydir") */
|
|
6144
|
+
archivePath: string;
|
|
6145
|
+
}
|
|
6146
|
+
|
|
6147
|
+
/**
|
|
6148
|
+
* Options for loading a ZIP archive
|
|
6149
|
+
* @public
|
|
6150
|
+
*/
|
|
6151
|
+
declare interface IZipArchiveLoadOptions {
|
|
6152
|
+
/** Validate manifest strictly */
|
|
6153
|
+
strictManifestValidation?: boolean;
|
|
6154
|
+
}
|
|
6155
|
+
|
|
6156
|
+
/**
|
|
6157
|
+
* Result of ZIP archive loading
|
|
6158
|
+
* @public
|
|
6159
|
+
*/
|
|
6160
|
+
declare interface IZipArchiveLoadResult {
|
|
6161
|
+
/** Parsed archive manifest */
|
|
6162
|
+
manifest: IZipArchiveManifest_2 | undefined;
|
|
6163
|
+
/** Loaded configuration */
|
|
6164
|
+
config: Model.ISystemConfiguration | undefined;
|
|
6165
|
+
/** All files extracted from the archive */
|
|
6166
|
+
files: IImportedFile_2[];
|
|
6167
|
+
/** Directory structure if available */
|
|
6168
|
+
directory: IImportedDirectory_2 | undefined;
|
|
6169
|
+
}
|
|
6170
|
+
|
|
6171
|
+
/**
|
|
6172
|
+
* JSON representation of a ZIP archive manifest
|
|
6173
|
+
* Compatible with existing tools from ts-res-browser-cli
|
|
6174
|
+
* @public
|
|
6175
|
+
*/
|
|
6176
|
+
declare interface IZipArchiveManifest {
|
|
6177
|
+
/** Archive creation timestamp */
|
|
6178
|
+
timestamp: string;
|
|
6179
|
+
/** Optional input source information */
|
|
6180
|
+
input?: IZipArchiveInputInfo;
|
|
6181
|
+
/** Optional configuration file information */
|
|
6182
|
+
config?: IZipArchiveConfigInfo;
|
|
6183
|
+
}
|
|
6184
|
+
|
|
6185
|
+
/**
|
|
6186
|
+
* Standardized ZIP archive manifest format (compatible with existing tools)
|
|
6187
|
+
* @public
|
|
6188
|
+
*/
|
|
6189
|
+
declare type IZipArchiveManifest_2 = Json_2.IZipArchiveManifest;
|
|
6190
|
+
|
|
6191
|
+
/**
|
|
6192
|
+
* Options for creating a ZIP archive buffer
|
|
6193
|
+
* @public
|
|
6194
|
+
*/
|
|
6195
|
+
declare interface IZipArchivePathOptions {
|
|
6196
|
+
/** File or directory path to include in the archive */
|
|
6197
|
+
inputPath?: string;
|
|
6198
|
+
/** Optional configuration file path */
|
|
6199
|
+
configPath?: string;
|
|
6200
|
+
}
|
|
6201
|
+
|
|
6202
|
+
/**
|
|
6203
|
+
* Result of ZIP archive buffer creation
|
|
6204
|
+
* @public
|
|
6205
|
+
*/
|
|
6206
|
+
declare interface IZipArchiveResult {
|
|
6207
|
+
/** Raw ZIP data buffer */
|
|
6208
|
+
zipBuffer: Uint8Array;
|
|
6209
|
+
/** Archive manifest with metadata */
|
|
6210
|
+
manifest: IZipArchiveManifest_2;
|
|
6211
|
+
/** Total ZIP size in bytes */
|
|
6212
|
+
size: number;
|
|
6213
|
+
}
|
|
6214
|
+
|
|
4968
6215
|
/**
|
|
4969
6216
|
* Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with
|
|
4970
6217
|
* to create a new {@link ResourceId | resource ID}. Returns `undefined` if no names are defined.
|
|
@@ -5012,6 +6259,16 @@ declare namespace Json {
|
|
|
5012
6259
|
}
|
|
5013
6260
|
}
|
|
5014
6261
|
|
|
6262
|
+
declare namespace Json_2 {
|
|
6263
|
+
export {
|
|
6264
|
+
IZipArchiveInputInfo,
|
|
6265
|
+
IZipArchiveConfigInfo,
|
|
6266
|
+
IZipArchiveManifest,
|
|
6267
|
+
IImportedFile,
|
|
6268
|
+
IImportedDirectory
|
|
6269
|
+
}
|
|
6270
|
+
}
|
|
6271
|
+
|
|
5015
6272
|
/**
|
|
5016
6273
|
* {@link Import.Importers.IImporter | Importer} implementation which imports resources from a JSON object.
|
|
5017
6274
|
* @public
|
|
@@ -5039,18 +6296,29 @@ declare class JsonImporter implements IImporter {
|
|
|
5039
6296
|
private _tryImportResourceTree;
|
|
5040
6297
|
}
|
|
5041
6298
|
|
|
6299
|
+
/**
|
|
6300
|
+
* A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
6301
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
6302
|
+
* @public
|
|
6303
|
+
*/
|
|
6304
|
+
declare const jsonQualifierTypeConfig: Converter<Model_2.IQualifierTypeConfig<JsonObject>, Converters.IJsonConverterContext>;
|
|
6305
|
+
|
|
5042
6306
|
/**
|
|
5043
6307
|
* Implementation of a {@link ResourceTypes.ResourceType | ResourceType} for JSON values.
|
|
5044
6308
|
* @public
|
|
5045
6309
|
*/
|
|
5046
6310
|
declare class JsonResourceType extends ResourceType<JsonObject> {
|
|
6311
|
+
/**
|
|
6312
|
+
* {@inheritdoc ResourceTypes.ResourceType.systemTypeName}
|
|
6313
|
+
*/
|
|
6314
|
+
readonly systemTypeName: ResourceTypeName;
|
|
5047
6315
|
/**
|
|
5048
6316
|
* Protected {@link ResourceTypes.JsonResourceType | JsonResourceType} constructor for use by subclasses.
|
|
5049
6317
|
* Use {@link ResourceTypes.JsonResourceType.create | JsonResourceType.create} to create a new instance.
|
|
5050
6318
|
* @param key - The key for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
|
|
5051
6319
|
* @param index - Optional index for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
|
|
5052
6320
|
*/
|
|
5053
|
-
protected constructor(key: ResourceTypeName, index?: number);
|
|
6321
|
+
protected constructor(key: ResourceTypeName, index?: number, template?: JsonObject);
|
|
5054
6322
|
/**
|
|
5055
6323
|
* Factory method to create a new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
|
|
5056
6324
|
* @param params - {@link ResourceTypes.IJsonResourceTypeCreateParams | Parameters} to create the new instance.
|
|
@@ -5065,15 +6333,15 @@ declare class JsonResourceType extends ResourceType<JsonObject> {
|
|
|
5065
6333
|
/**
|
|
5066
6334
|
* {@inheritdoc ResourceTypes.ResourceType.(validate:1)}
|
|
5067
6335
|
*/
|
|
5068
|
-
validate(json: JsonObject,
|
|
6336
|
+
validate(json: JsonObject, completeness: CandidateCompleteness): Result<JsonObject>;
|
|
5069
6337
|
/**
|
|
5070
6338
|
* {@inheritdoc ResourceTypes.ResourceType.(validate:2)}
|
|
5071
6339
|
*/
|
|
5072
|
-
validate(json: JsonObject,
|
|
6340
|
+
validate(json: JsonObject, completeness: 'full'): Result<JsonObject>;
|
|
5073
6341
|
/**
|
|
5074
6342
|
* {@inheritdoc ResourceTypes.ResourceType.(validate:3)}
|
|
5075
6343
|
*/
|
|
5076
|
-
validate(json: JsonObject,
|
|
6344
|
+
validate(json: JsonObject, completeness: 'partial'): Result<JsonObject>;
|
|
5077
6345
|
}
|
|
5078
6346
|
|
|
5079
6347
|
/**
|
|
@@ -5100,7 +6368,11 @@ declare const LanguagePrioritySystemConfiguration: ISystemConfiguration;
|
|
|
5100
6368
|
* Accepts a list of language tags in the context by default.
|
|
5101
6369
|
* @public
|
|
5102
6370
|
*/
|
|
5103
|
-
declare class LanguageQualifierType extends QualifierType {
|
|
6371
|
+
declare class LanguageQualifierType extends QualifierType<JsonCompatible<Config_2.ILanguageQualifierTypeConfig>> {
|
|
6372
|
+
/**
|
|
6373
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
6374
|
+
*/
|
|
6375
|
+
readonly systemTypeName: QualifierTypeName;
|
|
5104
6376
|
/**
|
|
5105
6377
|
* Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.
|
|
5106
6378
|
* @param name - Optional name for the qualifier type. Defaults to 'language'.
|
|
@@ -5130,6 +6402,27 @@ declare class LanguageQualifierType extends QualifierType {
|
|
|
5130
6402
|
* {@inheritdoc QualifierTypes.IQualifierType.isValidConditionValue}
|
|
5131
6403
|
*/
|
|
5132
6404
|
isValidConditionValue(value: string): value is QualifierConditionValue;
|
|
6405
|
+
/**
|
|
6406
|
+
* Gets a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
|
|
6407
|
+
* for this qualifier type.
|
|
6408
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
6409
|
+
*/
|
|
6410
|
+
getConfiguration(): Result<Config_2.ISystemLanguageQualifierTypeConfig>;
|
|
6411
|
+
/**
|
|
6412
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
6413
|
+
*/
|
|
6414
|
+
getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemLanguageQualifierTypeConfig>>;
|
|
6415
|
+
/**
|
|
6416
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
6417
|
+
*/
|
|
6418
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemLanguageQualifierTypeConfig>>;
|
|
6419
|
+
/**
|
|
6420
|
+
* Validates a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
|
|
6421
|
+
* for this qualifier type.
|
|
6422
|
+
* @param from - The unknown data to validate as a configuration object.
|
|
6423
|
+
* @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
|
|
6424
|
+
*/
|
|
6425
|
+
validateConfiguration(from: unknown): Result<Config_2.ISystemLanguageQualifierTypeConfig>;
|
|
5133
6426
|
/**
|
|
5134
6427
|
* Matches a single language condition against a single language context value using
|
|
5135
6428
|
* {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.
|
|
@@ -5146,14 +6439,18 @@ declare class LanguageQualifierType extends QualifierType {
|
|
|
5146
6439
|
* @returns A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
|
|
5147
6440
|
* @public
|
|
5148
6441
|
*/
|
|
5149
|
-
declare const languageQualifierTypeConfig: ObjectConverter<
|
|
6442
|
+
declare const languageQualifierTypeConfig: ObjectConverter<Model_2.ILanguageQualifierTypeConfig, unknown>;
|
|
5150
6443
|
|
|
5151
6444
|
/**
|
|
5152
6445
|
* A {@link QualifierTypes.QualifierType | qualifier} that matches a literal value,
|
|
5153
6446
|
* optionally case-sensitive or matching against an ordered list of values at runtime.
|
|
5154
6447
|
* @public
|
|
5155
6448
|
*/
|
|
5156
|
-
declare class LiteralQualifierType extends QualifierType {
|
|
6449
|
+
declare class LiteralQualifierType extends QualifierType<JsonCompatible<Config_2.ILiteralQualifierTypeConfig>> {
|
|
6450
|
+
/**
|
|
6451
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
6452
|
+
*/
|
|
6453
|
+
readonly systemTypeName: QualifierTypeName;
|
|
5157
6454
|
/**
|
|
5158
6455
|
* Indicates whether the qualifier match is case-sensitive.
|
|
5159
6456
|
*/
|
|
@@ -5189,6 +6486,27 @@ declare class LiteralQualifierType extends QualifierType {
|
|
|
5189
6486
|
* {@inheritdoc QualifierTypes.IQualifierType.isPotentialMatch}
|
|
5190
6487
|
*/
|
|
5191
6488
|
isPotentialMatch(conditionValue: string, contextValue: string): boolean;
|
|
6489
|
+
/**
|
|
6490
|
+
* Gets a {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | strongly typed configuration object}
|
|
6491
|
+
* for this qualifier type.
|
|
6492
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
6493
|
+
*/
|
|
6494
|
+
getConfiguration(): Result<Config_2.ISystemLiteralQualifierTypeConfig>;
|
|
6495
|
+
/**
|
|
6496
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
6497
|
+
*/
|
|
6498
|
+
getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemLiteralQualifierTypeConfig>>;
|
|
6499
|
+
/**
|
|
6500
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
6501
|
+
*/
|
|
6502
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemLiteralQualifierTypeConfig>>;
|
|
6503
|
+
/**
|
|
6504
|
+
* Validates a {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | strongly typed configuration object}
|
|
6505
|
+
* for this qualifier type.
|
|
6506
|
+
* @param from - The unknown data to validate as a configuration object.
|
|
6507
|
+
* @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
|
|
6508
|
+
*/
|
|
6509
|
+
validateConfiguration(from: unknown): Result<Config_2.ISystemLiteralQualifierTypeConfig>;
|
|
5192
6510
|
/**
|
|
5193
6511
|
* {@inheritdoc QualifierTypes.QualifierType._matchOne}
|
|
5194
6512
|
*/
|
|
@@ -5234,7 +6552,7 @@ declare class LiteralQualifierType extends QualifierType {
|
|
|
5234
6552
|
* @returns A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.
|
|
5235
6553
|
* @public
|
|
5236
6554
|
*/
|
|
5237
|
-
declare const literalQualifierTypeConfig: ObjectConverter<
|
|
6555
|
+
declare const literalQualifierTypeConfig: ObjectConverter<Model_2.ILiteralQualifierTypeConfig, unknown>;
|
|
5238
6556
|
|
|
5239
6557
|
/**
|
|
5240
6558
|
* A class that implements a hierarchy of literal values. The hierarchy is defined as a
|
|
@@ -5318,6 +6636,11 @@ declare class LiteralValueHierarchy<T extends string = string> {
|
|
|
5318
6636
|
*/
|
|
5319
6637
|
match(condition: QualifierConditionValue, context: QualifierContextValue, __operator?: ConditionOperator): QualifierMatchScore;
|
|
5320
6638
|
protected static _buildValuesFromHierarchy<T extends string>(params: ILiteralValueHierarchyCreateParams<T>): Result<ReadonlyMap<T, ILiteralValue<T>>>;
|
|
6639
|
+
/**
|
|
6640
|
+
* Converts the hierarchy to a record of parent-child relationships.
|
|
6641
|
+
* @returns A record of parent-child relationships.
|
|
6642
|
+
*/
|
|
6643
|
+
asRecord(): Record<string, string>;
|
|
5321
6644
|
}
|
|
5322
6645
|
|
|
5323
6646
|
/**
|
|
@@ -5337,7 +6660,7 @@ declare function literalValueHierarchyCreateParams<T extends string>(valueConver
|
|
|
5337
6660
|
* determine the relationship between values when matching conditions and contexts.
|
|
5338
6661
|
* @public
|
|
5339
6662
|
*/
|
|
5340
|
-
declare type LiteralValueHierarchyDecl<T extends string> =
|
|
6663
|
+
declare type LiteralValueHierarchyDecl<T extends string> = Record<T, T>;
|
|
5341
6664
|
|
|
5342
6665
|
/**
|
|
5343
6666
|
* `Converter` for a normalized {@link ResourceJson.Json.ILooseConditionDecl | loose condition declaration}.
|
|
@@ -5480,6 +6803,12 @@ declare function mergeLooseCandidate(candidate: Normalized.IImporterResourceCand
|
|
|
5480
6803
|
*/
|
|
5481
6804
|
declare function mergeLooseResource(resource: Normalized.IImporterResourceDecl, baseName?: string, baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>): Result<Normalized.ILooseResourceDecl>;
|
|
5482
6805
|
|
|
6806
|
+
/**
|
|
6807
|
+
* Validator for MIME type strings
|
|
6808
|
+
* @public
|
|
6809
|
+
*/
|
|
6810
|
+
declare const mimeType: Validator<string>;
|
|
6811
|
+
|
|
5483
6812
|
/**
|
|
5484
6813
|
* Minimum valid priority for a condition.
|
|
5485
6814
|
* @public
|
|
@@ -5487,6 +6816,28 @@ declare function mergeLooseResource(resource: Normalized.IImporterResourceDecl,
|
|
|
5487
6816
|
export declare const MinConditionPriority: ConditionPriority;
|
|
5488
6817
|
|
|
5489
6818
|
declare namespace Model {
|
|
6819
|
+
export {
|
|
6820
|
+
ISystemConfiguration
|
|
6821
|
+
}
|
|
6822
|
+
}
|
|
6823
|
+
|
|
6824
|
+
declare namespace Model_2 {
|
|
6825
|
+
export {
|
|
6826
|
+
isSystemQualifierTypeConfig,
|
|
6827
|
+
IQualifierTypeConfig,
|
|
6828
|
+
ILanguageQualifierTypeConfig,
|
|
6829
|
+
LiteralValueHierarchyDecl,
|
|
6830
|
+
ITerritoryQualifierTypeConfig,
|
|
6831
|
+
ILiteralQualifierTypeConfig,
|
|
6832
|
+
ISystemLanguageQualifierTypeConfig,
|
|
6833
|
+
ISystemTerritoryQualifierTypeConfig,
|
|
6834
|
+
ISystemLiteralQualifierTypeConfig,
|
|
6835
|
+
ISystemQualifierTypeConfig,
|
|
6836
|
+
IAnyQualifierTypeConfig
|
|
6837
|
+
}
|
|
6838
|
+
}
|
|
6839
|
+
|
|
6840
|
+
declare namespace Model_3 {
|
|
5490
6841
|
export {
|
|
5491
6842
|
ICompiledConditionMetadata,
|
|
5492
6843
|
ICompiledConditionSetMetadata,
|
|
@@ -5503,23 +6854,46 @@ declare namespace Model {
|
|
|
5503
6854
|
}
|
|
5504
6855
|
}
|
|
5505
6856
|
|
|
5506
|
-
declare namespace
|
|
6857
|
+
declare namespace Model_4 {
|
|
5507
6858
|
export {
|
|
5508
|
-
|
|
6859
|
+
IBundleMetadata,
|
|
6860
|
+
IBundleExportMetadata,
|
|
6861
|
+
IBundle,
|
|
6862
|
+
IBundleCreateParams
|
|
5509
6863
|
}
|
|
5510
6864
|
}
|
|
5511
6865
|
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
6866
|
+
/**
|
|
6867
|
+
* A validator for mutable context qualifier providers that accepts string inputs
|
|
6868
|
+
* and converts them to strongly-typed values before calling the wrapped provider.
|
|
6869
|
+
* Provides both read and mutation operations.
|
|
6870
|
+
* @public
|
|
6871
|
+
*/
|
|
6872
|
+
declare class MutableContextQualifierProviderValidator<T extends IMutableContextQualifierProvider = IMutableContextQualifierProvider> extends BaseContextQualifierProviderValidator<T> implements IMutableContextQualifierProviderValidator<T> {
|
|
6873
|
+
/**
|
|
6874
|
+
* The wrapped mutable context qualifier provider.
|
|
6875
|
+
*/
|
|
6876
|
+
readonly provider: T;
|
|
6877
|
+
/**
|
|
6878
|
+
* Constructs a new {@link Runtime.Context.MutableContextQualifierProviderValidator | MutableContextQualifierProviderValidator}.
|
|
6879
|
+
* @param params - Required parameters for constructing the validator.
|
|
6880
|
+
*/
|
|
6881
|
+
constructor(params: IMutableContextQualifierProviderValidatorCreateParams<T>);
|
|
6882
|
+
/**
|
|
6883
|
+
* Sets a qualifier value using string inputs, converting to strongly-typed values.
|
|
6884
|
+
* @param name - The string name to convert.
|
|
6885
|
+
* @param value - The string value to convert.
|
|
6886
|
+
* @returns `Success` with the set {@link QualifierContextValue | qualifier context value} if successful,
|
|
6887
|
+
* or `Failure` with an error message if an error occurs.
|
|
6888
|
+
*/
|
|
6889
|
+
set(name: string, value: string): Result<QualifierContextValue>;
|
|
6890
|
+
/**
|
|
6891
|
+
* Removes a qualifier value using string input, converting to strongly-typed QualifierName.
|
|
6892
|
+
* @param name - The string name to convert.
|
|
6893
|
+
* @returns `Success` with the removed {@link QualifierContextValue | qualifier context value} if successful,
|
|
6894
|
+
* or `Failure` with an error message if an error occurs.
|
|
6895
|
+
*/
|
|
6896
|
+
remove(name: string): Result<QualifierContextValue>;
|
|
5523
6897
|
}
|
|
5524
6898
|
|
|
5525
6899
|
/**
|
|
@@ -5545,6 +6919,10 @@ declare class NoOpResourceResolverCacheListener implements IResourceResolverCach
|
|
|
5545
6919
|
* {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheError}
|
|
5546
6920
|
*/
|
|
5547
6921
|
onCacheError(cache: ResourceResolverCacheType, index: number): void;
|
|
6922
|
+
/**
|
|
6923
|
+
* {@inheritDoc Runtime.IResourceResolverCacheListener.onContextError}
|
|
6924
|
+
*/
|
|
6925
|
+
onContextError(qualifier: string, error: string): void;
|
|
5548
6926
|
/**
|
|
5549
6927
|
* {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheClear}
|
|
5550
6928
|
*/
|
|
@@ -5568,6 +6946,14 @@ declare namespace Normalized {
|
|
|
5568
6946
|
}
|
|
5569
6947
|
}
|
|
5570
6948
|
|
|
6949
|
+
/**
|
|
6950
|
+
* Normalize path separators for cross-platform compatibility
|
|
6951
|
+
* @param path - Path to normalize
|
|
6952
|
+
* @returns Normalized path
|
|
6953
|
+
* @public
|
|
6954
|
+
*/
|
|
6955
|
+
declare function normalizePath(path: string): string;
|
|
6956
|
+
|
|
5571
6957
|
/**
|
|
5572
6958
|
* Overall cache metrics across all cache types.
|
|
5573
6959
|
* @public
|
|
@@ -5622,6 +7008,22 @@ declare function parseQualifierDefaultValuesTokenParts(token: string): Result<IQ
|
|
|
5622
7008
|
*/
|
|
5623
7009
|
declare function parseQualifierDefaultValueTokenParts(token: string): Result<IQualifierDefaultValueTokenParts>;
|
|
5624
7010
|
|
|
7011
|
+
/**
|
|
7012
|
+
* Parse and validate configuration JSON
|
|
7013
|
+
* @param configData - JSON string containing configuration
|
|
7014
|
+
* @returns Result containing validated configuration
|
|
7015
|
+
* @public
|
|
7016
|
+
*/
|
|
7017
|
+
declare function parseZipArchiveConfiguration(configData: string): Result<Model.ISystemConfiguration>;
|
|
7018
|
+
|
|
7019
|
+
/**
|
|
7020
|
+
* Parse and validate a ZIP archive manifest
|
|
7021
|
+
* @param manifestData - JSON string containing manifest data
|
|
7022
|
+
* @returns Result containing validated manifest
|
|
7023
|
+
* @public
|
|
7024
|
+
*/
|
|
7025
|
+
declare function parseZipArchiveManifest(manifestData: string): Result<Json_2.IZipArchiveManifest>;
|
|
7026
|
+
|
|
5625
7027
|
/**
|
|
5626
7028
|
* {@link Import.Importers.IImporter | Importer} implementation which imports resources from a `FileTree`
|
|
5627
7029
|
* given a path.
|
|
@@ -5692,7 +7094,7 @@ declare const predefinedSystemConfiguration: Converter<PredefinedSystemConfigura
|
|
|
5692
7094
|
* which a resource is used.
|
|
5693
7095
|
* @public
|
|
5694
7096
|
*/
|
|
5695
|
-
declare class Qualifier implements IValidatedQualifierDecl, ICollectible<QualifierName, QualifierIndex> {
|
|
7097
|
+
export declare class Qualifier implements IValidatedQualifierDecl, ICollectible<QualifierName, QualifierIndex> {
|
|
5696
7098
|
/**
|
|
5697
7099
|
* The name of the qualifier.
|
|
5698
7100
|
*/
|
|
@@ -5849,6 +7251,12 @@ export declare type QualifierConditionValue = Brand<string, 'QualifierConditionV
|
|
|
5849
7251
|
*/
|
|
5850
7252
|
export declare type QualifierContextValue = Brand<string, 'QualifierContextValue'>;
|
|
5851
7253
|
|
|
7254
|
+
/**
|
|
7255
|
+
* `Converter` which validates an `unknown` value as a {@link QualifierContextValue | QualifierContextValue}.
|
|
7256
|
+
* @public
|
|
7257
|
+
*/
|
|
7258
|
+
declare const qualifierContextValue: Converter<QualifierContextValue, unknown>;
|
|
7259
|
+
|
|
5852
7260
|
/**
|
|
5853
7261
|
* Converter for a {@link Qualifiers.IQualifierDecl | qualifier declaration}.
|
|
5854
7262
|
* @public
|
|
@@ -6031,7 +7439,7 @@ declare const qualifierName: Converter<QualifierName, unknown>;
|
|
|
6031
7439
|
|
|
6032
7440
|
declare namespace Qualifiers {
|
|
6033
7441
|
export {
|
|
6034
|
-
|
|
7442
|
+
Convert_4 as Convert,
|
|
6035
7443
|
Qualifier,
|
|
6036
7444
|
IQualifierDecl,
|
|
6037
7445
|
IValidatedQualifierDecl,
|
|
@@ -6052,11 +7460,15 @@ export { Qualifiers }
|
|
|
6052
7460
|
* the {@link QualifierTypes.IQualifierType | IQualifierType} interface.
|
|
6053
7461
|
* @public
|
|
6054
7462
|
*/
|
|
6055
|
-
declare abstract class QualifierType implements IQualifierType {
|
|
7463
|
+
export declare abstract class QualifierType<TCFGJSON extends JsonObject = JsonObject> implements IQualifierType<TCFGJSON> {
|
|
6056
7464
|
/**
|
|
6057
7465
|
* {@inheritdoc QualifierTypes.IQualifierType.name}
|
|
6058
7466
|
*/
|
|
6059
7467
|
readonly name: QualifierTypeName;
|
|
7468
|
+
/**
|
|
7469
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
7470
|
+
*/
|
|
7471
|
+
abstract readonly systemTypeName: QualifierTypeName;
|
|
6060
7472
|
/**
|
|
6061
7473
|
* {@inheritdoc QualifierTypes.IQualifierType.key}
|
|
6062
7474
|
*/
|
|
@@ -6102,6 +7514,14 @@ declare abstract class QualifierType implements IQualifierType {
|
|
|
6102
7514
|
* {@inheritdoc QualifierTypes.IQualifierType.matches}
|
|
6103
7515
|
*/
|
|
6104
7516
|
matches(condition: QualifierConditionValue, context: QualifierContextValue, operator: ConditionOperator): QualifierMatchScore;
|
|
7517
|
+
/**
|
|
7518
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
7519
|
+
*/
|
|
7520
|
+
abstract getConfigurationJson(): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
|
|
7521
|
+
/**
|
|
7522
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
7523
|
+
*/
|
|
7524
|
+
abstract validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
|
|
6105
7525
|
/**
|
|
6106
7526
|
* {@inheritdoc QualifierTypes.IQualifierType.setIndex}
|
|
6107
7527
|
*/
|
|
@@ -6157,7 +7577,7 @@ declare abstract class QualifierType implements IQualifierType {
|
|
|
6157
7577
|
* index from a supplied {@link QualifierTypes.Convert.IQualifierTypeConvertContext | conversion context}.
|
|
6158
7578
|
* @public
|
|
6159
7579
|
*/
|
|
6160
|
-
declare const qualifierType: Converter<QualifierType
|
|
7580
|
+
declare const qualifierType: Converter<QualifierType<JsonObject>, IQualifierTypeConvertContext>;
|
|
6161
7581
|
|
|
6162
7582
|
/**
|
|
6163
7583
|
* Collector for {@link QualifierTypes.QualifierType | QualifierType} objects.
|
|
@@ -6181,6 +7601,74 @@ declare class QualifierTypeCollector extends ValidatingConvertingCollector<Quali
|
|
|
6181
7601
|
protected static _toQualifierType(from: unknown): Result<QualifierType>;
|
|
6182
7602
|
}
|
|
6183
7603
|
|
|
7604
|
+
/**
|
|
7605
|
+
* A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
7606
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
7607
|
+
* @param config - A `Converter` for the configuration object.
|
|
7608
|
+
* @public
|
|
7609
|
+
*/
|
|
7610
|
+
declare function qualifierTypeConfig<T, TD = unknown>(config: Converter<T, TD>): Converter<Model_2.IQualifierTypeConfig<T>, TD>;
|
|
7611
|
+
|
|
7612
|
+
/**
|
|
7613
|
+
* A factory that creates {@link QualifierTypes.QualifierType | QualifierType} instances from configuration,
|
|
7614
|
+
* supporting both built-in system types and custom external types.
|
|
7615
|
+
*
|
|
7616
|
+
* This factory allows external consumers to extend the qualifier type system with their own custom types
|
|
7617
|
+
* while maintaining support for all built-in types (Language, Territory, Literal).
|
|
7618
|
+
*
|
|
7619
|
+
* @typeParam T - The custom qualifier type(s) to support. Defaults to {@link QualifierTypes.SystemQualifierType | SystemQualifierType}.
|
|
7620
|
+
*
|
|
7621
|
+
* @example Creating a factory with custom qualifier types
|
|
7622
|
+
* ```typescript
|
|
7623
|
+
* // Define a custom qualifier type
|
|
7624
|
+
* class CustomQualifierType extends QualifierType {
|
|
7625
|
+
* // ... implementation
|
|
7626
|
+
* }
|
|
7627
|
+
*
|
|
7628
|
+
* // Define a discriminated union of all types
|
|
7629
|
+
* type AppQualifierType = SystemQualifierType | CustomQualifierType;
|
|
7630
|
+
*
|
|
7631
|
+
* // Create a factory that handles custom types
|
|
7632
|
+
* const customFactory: IConfigInitFactory<IAnyQualifierTypeConfig, CustomQualifierType> = {
|
|
7633
|
+
* create(config) {
|
|
7634
|
+
* // ... handle custom type creation
|
|
7635
|
+
* }
|
|
7636
|
+
* };
|
|
7637
|
+
*
|
|
7638
|
+
* // Create the combined factory
|
|
7639
|
+
* const qualifierTypeFactory = new QualifierTypeFactory<AppQualifierType>([customFactory]);
|
|
7640
|
+
*
|
|
7641
|
+
* // The factory returns T | SystemQualifierType, supporting all types
|
|
7642
|
+
* const result = qualifierTypeFactory.create(config); // Result<AppQualifierType | SystemQualifierType>
|
|
7643
|
+
* ```
|
|
7644
|
+
*
|
|
7645
|
+
* @remarks
|
|
7646
|
+
* - The factory chains custom factories with the built-in factory
|
|
7647
|
+
* - Custom factories are tried first, falling back to built-in types
|
|
7648
|
+
* - The return type is a union of custom types (T) and system types
|
|
7649
|
+
*
|
|
7650
|
+
* @public
|
|
7651
|
+
*/
|
|
7652
|
+
declare class QualifierTypeFactory<T extends QualifierType = SystemQualifierType> extends ChainedConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T | SystemQualifierType> {
|
|
7653
|
+
/**
|
|
7654
|
+
* Constructor for a {@link Config.QualifierTypeFactory | qualifier type factory}.
|
|
7655
|
+
* @param factories - Array of factories for custom qualifier types. Can be:
|
|
7656
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
7657
|
+
* - {@link Config.QualifierTypeFactoryFunction | Factory functions}
|
|
7658
|
+
* - A mix of both
|
|
7659
|
+
* These are tried in order before falling back to built-in types.
|
|
7660
|
+
* @remarks The {@link Config.BuiltInQualifierTypeFactory | built-in factory} is always appended to handle
|
|
7661
|
+
* system qualifier types (Language, Territory, Literal).
|
|
7662
|
+
*/
|
|
7663
|
+
constructor(factories: Array<IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T> | QualifierTypeFactoryFunction<T>>);
|
|
7664
|
+
}
|
|
7665
|
+
|
|
7666
|
+
/**
|
|
7667
|
+
* Function signature for creating a qualifier type from configuration.
|
|
7668
|
+
* @public
|
|
7669
|
+
*/
|
|
7670
|
+
declare type QualifierTypeFactoryFunction<T extends QualifierType = QualifierType> = (config: QualifierTypes.Config.IAnyQualifierTypeConfig) => Result<T>;
|
|
7671
|
+
|
|
6184
7672
|
/**
|
|
6185
7673
|
* Branded number representing a validated qualifier type index.
|
|
6186
7674
|
* @public
|
|
@@ -6208,7 +7696,7 @@ declare const qualifierTypeName: Converter<QualifierTypeName, unknown>;
|
|
|
6208
7696
|
declare namespace QualifierTypes {
|
|
6209
7697
|
export {
|
|
6210
7698
|
Config_2 as Config,
|
|
6211
|
-
|
|
7699
|
+
Convert_3 as Convert,
|
|
6212
7700
|
IQualifierType,
|
|
6213
7701
|
IQualifierTypeCreateParams,
|
|
6214
7702
|
QualifierType,
|
|
@@ -6216,7 +7704,6 @@ declare namespace QualifierTypes {
|
|
|
6216
7704
|
LanguageQualifierType,
|
|
6217
7705
|
ILiteralQualifierTypeCreateParams,
|
|
6218
7706
|
LiteralQualifierType,
|
|
6219
|
-
LiteralValueHierarchyDecl,
|
|
6220
7707
|
ILiteralValue,
|
|
6221
7708
|
ILiteralValueHierarchyCreateParams,
|
|
6222
7709
|
LiteralValueHierarchy,
|
|
@@ -6226,7 +7713,8 @@ declare namespace QualifierTypes {
|
|
|
6226
7713
|
QualifierTypeCollector,
|
|
6227
7714
|
ReadOnlyQualifierTypeCollector,
|
|
6228
7715
|
createQualifierTypeFromConfig,
|
|
6229
|
-
createQualifierTypeFromSystemConfig
|
|
7716
|
+
createQualifierTypeFromSystemConfig,
|
|
7717
|
+
SystemQualifierType
|
|
6230
7718
|
}
|
|
6231
7719
|
}
|
|
6232
7720
|
export { QualifierTypes }
|
|
@@ -6249,6 +7737,24 @@ declare type ReadOnlyConditionCollector = Collections.IReadOnlyValidatingCollect
|
|
|
6249
7737
|
*/
|
|
6250
7738
|
declare type ReadOnlyConditionSetCollector = Collections.IReadOnlyValidatingCollector<ConditionSet>;
|
|
6251
7739
|
|
|
7740
|
+
/**
|
|
7741
|
+
* A validator for read-only context qualifier providers that accepts string inputs
|
|
7742
|
+
* and converts them to strongly-typed values before calling the wrapped provider.
|
|
7743
|
+
* Only provides read operations for compile-time type safety.
|
|
7744
|
+
* @public
|
|
7745
|
+
*/
|
|
7746
|
+
declare class ReadOnlyContextQualifierProviderValidator<T extends IReadOnlyContextQualifierProvider = IReadOnlyContextQualifierProvider> extends BaseContextQualifierProviderValidator<T> implements IReadOnlyContextQualifierProviderValidator<T> {
|
|
7747
|
+
/**
|
|
7748
|
+
* The wrapped read-only context qualifier provider.
|
|
7749
|
+
*/
|
|
7750
|
+
readonly provider: T;
|
|
7751
|
+
/**
|
|
7752
|
+
* Constructs a new {@link Runtime.Context.ReadOnlyContextQualifierProviderValidator | ReadOnlyContextQualifierProviderValidator}.
|
|
7753
|
+
* @param params - Required parameters for constructing the validator.
|
|
7754
|
+
*/
|
|
7755
|
+
constructor(params: IReadOnlyContextQualifierProviderValidatorCreateParams<T>);
|
|
7756
|
+
}
|
|
7757
|
+
|
|
6252
7758
|
/**
|
|
6253
7759
|
* Interface exposing non-mutating members of a
|
|
6254
7760
|
* {@link QualifierTypes.QualifierTypeCollector | QualifierTypeCollector}.
|
|
@@ -6394,6 +7900,7 @@ declare namespace RegularExpressions {
|
|
|
6394
7900
|
contextToken_2 as contextToken,
|
|
6395
7901
|
conditionSetHash_2 as conditionSetHash,
|
|
6396
7902
|
decisionKey_2 as decisionKey,
|
|
7903
|
+
candidateValueKey_2 as candidateValueKey,
|
|
6397
7904
|
qualifierDefaultValueToken_2 as qualifierDefaultValueToken,
|
|
6398
7905
|
qualifierDefaultValuesToken_2 as qualifierDefaultValuesToken,
|
|
6399
7906
|
territoryCode
|
|
@@ -6405,15 +7912,19 @@ declare namespace RegularExpressions {
|
|
|
6405
7912
|
* candidate instances.
|
|
6406
7913
|
* @public
|
|
6407
7914
|
*/
|
|
6408
|
-
declare class Resource implements IResource {
|
|
7915
|
+
export declare class Resource implements IResource {
|
|
6409
7916
|
/**
|
|
6410
7917
|
* The unique {@link ResourceId | id} of the resource.
|
|
6411
7918
|
*/
|
|
6412
7919
|
readonly id: ResourceId;
|
|
7920
|
+
/**
|
|
7921
|
+
* The name of the resource.
|
|
7922
|
+
*/
|
|
7923
|
+
readonly name: ResourceName;
|
|
6413
7924
|
/**
|
|
6414
7925
|
* The {@link ResourceTypes.ResourceType | type} of the resource.
|
|
6415
7926
|
*/
|
|
6416
|
-
readonly
|
|
7927
|
+
readonly resourceType: ResourceType;
|
|
6417
7928
|
/**
|
|
6418
7929
|
* The array of {@link Resources.ResourceCandidate | candidates} for the resource.
|
|
6419
7930
|
*/
|
|
@@ -6422,10 +7933,6 @@ declare class Resource implements IResource {
|
|
|
6422
7933
|
* {@link Decisions.ConcreteDecision | Decision} for optimized resource resolution.
|
|
6423
7934
|
*/
|
|
6424
7935
|
readonly decision: ConcreteDecision;
|
|
6425
|
-
/**
|
|
6426
|
-
* Gets the resource type (implements IResource interface).
|
|
6427
|
-
*/
|
|
6428
|
-
get resourceType(): ResourceType;
|
|
6429
7936
|
/**
|
|
6430
7937
|
* Gets the resource type name as a string.
|
|
6431
7938
|
*/
|
|
@@ -6550,6 +8057,10 @@ declare class ResourceBuilder {
|
|
|
6550
8057
|
* Collector for {@link Decisions.AbstractDecision | abstract decisions}.
|
|
6551
8058
|
*/
|
|
6552
8059
|
protected _decisions: AbstractDecisionCollector;
|
|
8060
|
+
/**
|
|
8061
|
+
* Collector for candidate values.
|
|
8062
|
+
*/
|
|
8063
|
+
protected _candidateValues: CandidateValueCollector;
|
|
6553
8064
|
/**
|
|
6554
8065
|
* Constructor for a {@link Resources.ResourceBuilder | ResourceBuilder} object.
|
|
6555
8066
|
* @param params - Parameters to construct the new {@link Resources.ResourceBuilder | ResourceBuilder}.
|
|
@@ -6621,16 +8132,22 @@ declare type ResourceBuilderResultDetail = Collections.ResultMapResultDetail | '
|
|
|
6621
8132
|
* and instructions on how to merge it with other instances.
|
|
6622
8133
|
* @public
|
|
6623
8134
|
*/
|
|
6624
|
-
declare class ResourceCandidate implements IResourceCandidate {
|
|
8135
|
+
export declare class ResourceCandidate implements IResourceCandidate {
|
|
6625
8136
|
/**
|
|
6626
8137
|
* The unique identifier of the resource for which this candidate
|
|
6627
8138
|
* is a possible instance.
|
|
6628
8139
|
*/
|
|
6629
8140
|
readonly id: ResourceId;
|
|
8141
|
+
/**
|
|
8142
|
+
* The candidate value that contains the JSON representation of the instance data.
|
|
8143
|
+
*/
|
|
8144
|
+
readonly candidateValue: CandidateValue;
|
|
6630
8145
|
/**
|
|
6631
8146
|
* The JSON representation of the instance data to be applied.
|
|
8147
|
+
* @remarks
|
|
8148
|
+
* This property provides access to the JSON data from the underlying candidate value.
|
|
6632
8149
|
*/
|
|
6633
|
-
|
|
8150
|
+
get json(): JsonObject;
|
|
6634
8151
|
/**
|
|
6635
8152
|
* The conditions under which this candidate applies.
|
|
6636
8153
|
*/
|
|
@@ -6648,6 +8165,10 @@ declare class ResourceCandidate implements IResourceCandidate {
|
|
|
6648
8165
|
* this candidate belongs.
|
|
6649
8166
|
*/
|
|
6650
8167
|
readonly resourceType: ResourceType | undefined;
|
|
8168
|
+
/**
|
|
8169
|
+
* The completeness of the candidate value.
|
|
8170
|
+
*/
|
|
8171
|
+
get completeness(): CandidateCompleteness;
|
|
6651
8172
|
/**
|
|
6652
8173
|
* Constructor for a {@link Resources.ResourceCandidate | ResourceCandidate} object.
|
|
6653
8174
|
* @param params - Parameters to create a new {@link Resources.ResourceCandidate | ResourceCandidate}.
|
|
@@ -6820,6 +8341,17 @@ declare class ResourceDeclTree implements IResourceDeclContainer {
|
|
|
6820
8341
|
private _extract;
|
|
6821
8342
|
}
|
|
6822
8343
|
|
|
8344
|
+
/**
|
|
8345
|
+
* Type for handling resource resolution errors during tree traversal.
|
|
8346
|
+
* The handler receives the resource that failed to resolve, the error message, and the resolver for recovery attempts.
|
|
8347
|
+
* It can return:
|
|
8348
|
+
* - Success(undefined) to omit the property from the result
|
|
8349
|
+
* - Success(value) to use an alternate value
|
|
8350
|
+
* - Failure to propagate the error
|
|
8351
|
+
* @public
|
|
8352
|
+
*/
|
|
8353
|
+
declare type ResourceErrorHandler = (resource: IResource, message: string, resolver: ResourceResolver) => Result<JsonValue | undefined>;
|
|
8354
|
+
|
|
6823
8355
|
/**
|
|
6824
8356
|
* Branded string representing a validated resource id. A resource ID
|
|
6825
8357
|
* is a dot-separated sequence of resource names.
|
|
@@ -6848,7 +8380,7 @@ declare const resourceIndex: Converter<ResourceIndex, unknown>;
|
|
|
6848
8380
|
declare namespace ResourceJson {
|
|
6849
8381
|
export {
|
|
6850
8382
|
Compiled,
|
|
6851
|
-
|
|
8383
|
+
Convert_7 as Convert,
|
|
6852
8384
|
Helpers_2 as Helpers,
|
|
6853
8385
|
Json,
|
|
6854
8386
|
Normalized,
|
|
@@ -6866,15 +8398,59 @@ export { ResourceJson }
|
|
|
6866
8398
|
* and builds a collection of {@link Resources.Resource | resources} once all candidates are collected.
|
|
6867
8399
|
* @public
|
|
6868
8400
|
*/
|
|
6869
|
-
declare class ResourceManagerBuilder implements IResourceManager {
|
|
8401
|
+
export declare class ResourceManagerBuilder implements IResourceManager<Resource> {
|
|
8402
|
+
/**
|
|
8403
|
+
* The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used by this resource manager.
|
|
8404
|
+
*/
|
|
6870
8405
|
readonly qualifiers: IReadOnlyQualifierCollector;
|
|
8406
|
+
/**
|
|
8407
|
+
* The {@link ResourceTypes.ReadOnlyResourceTypeCollector | resource types} used by this resource manager.
|
|
8408
|
+
*/
|
|
6871
8409
|
readonly resourceTypes: ReadOnlyResourceTypeCollector;
|
|
8410
|
+
/**
|
|
8411
|
+
* The {@link Conditions.ConditionCollector | condition collector} used by this resource manager.
|
|
8412
|
+
* @internal
|
|
8413
|
+
*/
|
|
6872
8414
|
protected readonly _conditions: ConditionCollector;
|
|
8415
|
+
/**
|
|
8416
|
+
* The {@link Conditions.ConditionSetCollector | condition set collector} used by this resource manager.
|
|
8417
|
+
* @internal
|
|
8418
|
+
*/
|
|
6873
8419
|
protected readonly _conditionSets: ConditionSetCollector;
|
|
8420
|
+
/**
|
|
8421
|
+
* The {@link Decisions.AbstractDecisionCollector | abstract decision collector} used by this resource manager.
|
|
8422
|
+
* @internal
|
|
8423
|
+
*/
|
|
6874
8424
|
protected readonly _decisions: AbstractDecisionCollector;
|
|
8425
|
+
/**
|
|
8426
|
+
* The candidate value collector used by this resource manager.
|
|
8427
|
+
* @internal
|
|
8428
|
+
*/
|
|
8429
|
+
protected readonly _candidateValues: CandidateValueCollector;
|
|
8430
|
+
/**
|
|
8431
|
+
* The {@link Resources.ResourceBuilder | resource builders} used by this resource manager.
|
|
8432
|
+
* @internal
|
|
8433
|
+
*/
|
|
6875
8434
|
protected readonly _resources: ValidatingResultMap<ResourceId, ResourceBuilder>;
|
|
6876
|
-
|
|
8435
|
+
/**
|
|
8436
|
+
* The {@link Resources.Resource | resources} built by this resource manager.
|
|
8437
|
+
* @internal
|
|
8438
|
+
*/
|
|
8439
|
+
protected readonly _builtResources: ValidatingResultMap<ResourceId, Resource>;
|
|
8440
|
+
/**
|
|
8441
|
+
* Whether the resources have been built.
|
|
8442
|
+
* @internal
|
|
8443
|
+
*/
|
|
6877
8444
|
protected _built: boolean;
|
|
8445
|
+
/**
|
|
8446
|
+
* The cached resource tree for this resource manager.
|
|
8447
|
+
* @internal
|
|
8448
|
+
*/
|
|
8449
|
+
protected _cachedResourceTree?: ResourceTree.IReadOnlyResourceTreeRoot<Resource>;
|
|
8450
|
+
/**
|
|
8451
|
+
* The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier types} used by this resource manager.
|
|
8452
|
+
*/
|
|
8453
|
+
get qualifierTypes(): ReadOnlyQualifierTypeCollector;
|
|
6878
8454
|
/**
|
|
6879
8455
|
* A {@link Conditions.ConditionCollector | ConditionCollector} which
|
|
6880
8456
|
* contains the {@link Conditions.Condition | conditions} used so far by
|
|
@@ -6931,6 +8507,26 @@ declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
6931
8507
|
* @public
|
|
6932
8508
|
*/
|
|
6933
8509
|
static create(params: IResourceManagerBuilderCreateParams): Result<ResourceManagerBuilder>;
|
|
8510
|
+
/**
|
|
8511
|
+
* Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object from a predefined system configuration.
|
|
8512
|
+
* @param name - The name of the predefined system configuration to use.
|
|
8513
|
+
* @param qualifierDefaultValues - Optional default values for qualifiers.
|
|
8514
|
+
* @returns `Success` with the new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object if successful,
|
|
8515
|
+
* or `Failure` with an error message if not.
|
|
8516
|
+
* @public
|
|
8517
|
+
*/
|
|
8518
|
+
static createPredefined(name: Config.PredefinedSystemConfiguration, qualifierDefaultValues?: Config.ISystemConfigurationInitParams['qualifierDefaultValues']): Result<ResourceManagerBuilder>;
|
|
8519
|
+
/**
|
|
8520
|
+
* Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} from a
|
|
8521
|
+
* {@link ResourceJson.Compiled.ICompiledResourceCollection | compiled resource collection}.
|
|
8522
|
+
* This method reconstructs an exactly equivalent builder where all qualifier, condition,
|
|
8523
|
+
* condition set, and decision indices match the original compiled collection.
|
|
8524
|
+
* @param compiledCollection - The compiled resource collection to reconstruct from.
|
|
8525
|
+
* @param systemConfig - The system configuration containing qualifiers and resource types.
|
|
8526
|
+
* @returns `Success` with the new manager if successful, or `Failure` with an error message if not.
|
|
8527
|
+
* @public
|
|
8528
|
+
*/
|
|
8529
|
+
static createFromCompiledResourceCollection(compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection, systemConfig: Config.SystemConfiguration): Result<ResourceManagerBuilder>;
|
|
6934
8530
|
/**
|
|
6935
8531
|
* Given a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration}, builds and adds
|
|
6936
8532
|
* a {@link Resources.ResourceCandidate | candidate} to the manager.
|
|
@@ -6940,6 +8536,20 @@ declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
6940
8536
|
*/
|
|
6941
8537
|
addLooseCandidate(decl: ResourceJson.Json.ILooseResourceCandidateDecl): DetailedResult<ResourceCandidate, ResourceBuilderResultDetail>;
|
|
6942
8538
|
addResource(decl: ResourceJson.Json.ILooseResourceDecl): DetailedResult<ResourceBuilder, ResourceBuilderResultDetail>;
|
|
8539
|
+
/**
|
|
8540
|
+
* Adds a condition to the manager.
|
|
8541
|
+
* @param decl - The condition declaration to add.
|
|
8542
|
+
* @returns `Success` with the condition if successful, or `Failure` with an error message if not.
|
|
8543
|
+
* @public
|
|
8544
|
+
*/
|
|
8545
|
+
addCondition(decl: ResourceJson.Json.ILooseConditionDecl): Result<Condition>;
|
|
8546
|
+
/**
|
|
8547
|
+
* Adds a condition set to the manager.
|
|
8548
|
+
* @param decl - The condition set declaration to add.
|
|
8549
|
+
* @returns `Success` with the condition set if successful, or `Failure` with an error message if not.
|
|
8550
|
+
* @public
|
|
8551
|
+
*/
|
|
8552
|
+
addConditionSet(conditions: ResourceJson.Normalized.ConditionSetDecl): Result<ConditionSet>;
|
|
6943
8553
|
/**
|
|
6944
8554
|
* Gets a read-only array of all {@link Resources.ResourceBuilder | resource builders} present in the manager.
|
|
6945
8555
|
* @returns `Success` with the {@link Resources.ResourceBuilder | resource builder} if successful,
|
|
@@ -6970,6 +8580,19 @@ declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
6970
8580
|
* @public
|
|
6971
8581
|
*/
|
|
6972
8582
|
getAllBuiltResources(): Result<ReadonlyArray<Resource>>;
|
|
8583
|
+
/**
|
|
8584
|
+
* Builds and returns a hierarchical tree representation of all resources managed by this builder.
|
|
8585
|
+
* Resources are organized based on their dot-separated resource IDs (e.g., "app.messages.welcome"
|
|
8586
|
+
* becomes a tree with "app" as root, "messages" as branch, and "welcome" as leaf).
|
|
8587
|
+
*
|
|
8588
|
+
* String-based validation is available through the `children.validating` property,
|
|
8589
|
+
* allowing callers to use `tree.children.validating.getById(stringId)` for validated access.
|
|
8590
|
+
*
|
|
8591
|
+
* Uses lazy initialization with caching for performance.
|
|
8592
|
+
* @returns Result containing the resource tree root, or failure if tree construction fails
|
|
8593
|
+
* @public
|
|
8594
|
+
*/
|
|
8595
|
+
getBuiltResourceTree(): Result<ResourceTree.IReadOnlyResourceTreeRoot<Resource>>;
|
|
6973
8596
|
/**
|
|
6974
8597
|
* Gets a read-only array of all {@link Resources.Resource | built resources} in the manager.
|
|
6975
8598
|
* @returns `Success` with an array of resources if successful, or `Failure` with an error message if not.
|
|
@@ -7043,14 +8666,98 @@ declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
7043
8666
|
*/
|
|
7044
8667
|
getResourceCollectionDecl(options?: IResourceDeclarationOptions): Result<ResourceJson.Normalized.IResourceCollectionDecl>;
|
|
7045
8668
|
/**
|
|
7046
|
-
* Creates a
|
|
7047
|
-
* This
|
|
7048
|
-
*
|
|
7049
|
-
*
|
|
7050
|
-
*
|
|
8669
|
+
* Creates a clone of this ResourceManagerBuilder with optional configuration overrides.
|
|
8670
|
+
* This method creates a new ResourceManagerBuilder that can optionally use different
|
|
8671
|
+
* qualifiers and/or resource types than the original. It can also be filtered to include
|
|
8672
|
+
* only candidates that match the provided context and apply candidate edits.
|
|
8673
|
+
*
|
|
8674
|
+
* @param options - Options for the cloning operation:
|
|
8675
|
+
* - `qualifiers`: Optional qualifier collector to use instead of the original
|
|
8676
|
+
* - `resourceTypes`: Optional resource type collector to use instead of the original
|
|
8677
|
+
* - `filterForContext`: Optional context filter for candidates
|
|
8678
|
+
* - `candidates`: Optional candidate edits to apply during cloning
|
|
8679
|
+
* @returns A Result containing the new ResourceManagerBuilder with the specified configuration.
|
|
7051
8680
|
* @public
|
|
7052
8681
|
*/
|
|
7053
|
-
clone(options?:
|
|
8682
|
+
clone(options?: IResourceManagerCloneOptions): Result<ResourceManagerBuilder>;
|
|
8683
|
+
/**
|
|
8684
|
+
* Creates a resource ID keyed map from an array of loose resource candidate declarations.
|
|
8685
|
+
* This enables efficient detection of edit collisions by grouping candidates by their target resource.
|
|
8686
|
+
* @param candidates - Array of loose resource candidate declarations to organize
|
|
8687
|
+
* @returns A Result containing a Map where keys are validated ResourceIds and values are arrays of candidates for that resource
|
|
8688
|
+
* @internal
|
|
8689
|
+
*/
|
|
8690
|
+
private static _createCandidatesByResourceMap;
|
|
8691
|
+
/**
|
|
8692
|
+
* Generates a proper ConditionSet token for collision detection using the existing ConditionSet.getKeyForDecl method.
|
|
8693
|
+
* @param conditionSet - The condition set to generate a token for
|
|
8694
|
+
* @param conditionCollector - The condition collector needed for validation context
|
|
8695
|
+
* @returns A Result containing the ConditionSet token if successful, or failure if validation fails
|
|
8696
|
+
* @internal
|
|
8697
|
+
*/
|
|
8698
|
+
/**
|
|
8699
|
+
* Applies candidate edits to a resource declaration, handling collisions using condition set tokens.
|
|
8700
|
+
* If there's no collision, adds the candidate. If there's a collision, replaces the original candidate with the edit.
|
|
8701
|
+
* @param resourceDecl - The original resource declaration to potentially modify
|
|
8702
|
+
* @param candidatesByResource - Map of resource IDs to arrays of candidate edits
|
|
8703
|
+
* @param conditionCollector - The condition collector needed for generating condition tokens
|
|
8704
|
+
* @returns A Result containing the resource declaration to use (original or modified)
|
|
8705
|
+
* @internal
|
|
8706
|
+
*/
|
|
8707
|
+
private static _applyEditsToResourceDeclaration;
|
|
8708
|
+
/**
|
|
8709
|
+
* Creates a new resource declaration from an array of candidate declarations.
|
|
8710
|
+
* This is used when cloning to create new resources that don't exist in the original manager.
|
|
8711
|
+
* @param resourceId - The validated resource ID for the new resource
|
|
8712
|
+
* @param candidates - Array of loose candidate declarations for the new resource
|
|
8713
|
+
* @param conditionCollector - The condition collector for validation context
|
|
8714
|
+
* @returns A Result containing the new resource declaration if successful, or failure if validation fails
|
|
8715
|
+
* @internal
|
|
8716
|
+
*/
|
|
8717
|
+
private static _createResourceDeclFromCandidates;
|
|
8718
|
+
/**
|
|
8719
|
+
* Reconstructs conditions from a compiled collection and adds them to the builder.
|
|
8720
|
+
* @param builder - The builder to add conditions to.
|
|
8721
|
+
* @param compiledCollection - The compiled collection containing conditions.
|
|
8722
|
+
* @returns `Success` if all conditions were added successfully, `Failure` otherwise.
|
|
8723
|
+
* @internal
|
|
8724
|
+
*/
|
|
8725
|
+
private static _reconstructConditions;
|
|
8726
|
+
/**
|
|
8727
|
+
* Reconstructs condition sets from a compiled collection and adds them to the builder.
|
|
8728
|
+
* @param builder - The builder to add condition sets to.
|
|
8729
|
+
* @param compiledCollection - The compiled collection containing condition sets.
|
|
8730
|
+
* @returns `Success` if all condition sets were added successfully, `Failure` otherwise.
|
|
8731
|
+
* @internal
|
|
8732
|
+
*/
|
|
8733
|
+
private static _reconstructConditionSets;
|
|
8734
|
+
/**
|
|
8735
|
+
* Reconstructs decisions from a compiled collection and adds them to the builder.
|
|
8736
|
+
* @param builder - The builder to add decisions to.
|
|
8737
|
+
* @param compiledCollection - The compiled collection containing decisions.
|
|
8738
|
+
* @returns `Success` if all decisions were added successfully, `Failure` otherwise.
|
|
8739
|
+
* @internal
|
|
8740
|
+
*/
|
|
8741
|
+
private static _reconstructDecisions;
|
|
8742
|
+
/**
|
|
8743
|
+
* Reconstructs resources and their candidates from a compiled collection and adds them to the builder.
|
|
8744
|
+
* @param builder - The builder to add resources to.
|
|
8745
|
+
* @param compiledCollection - The compiled collection containing resources.
|
|
8746
|
+
* @returns `Success` if all resources were added successfully, `Failure` otherwise.
|
|
8747
|
+
* @internal
|
|
8748
|
+
*/
|
|
8749
|
+
private static _reconstructResources;
|
|
8750
|
+
/**
|
|
8751
|
+
* Helper method to create candidates from a decision's condition sets.
|
|
8752
|
+
* @param compiledResource - The compiled resource containing candidates.
|
|
8753
|
+
* @param decision - The decision containing condition sets.
|
|
8754
|
+
* @param resourceType - The resource type for the candidates.
|
|
8755
|
+
* @param builder - The builder to add candidates to.
|
|
8756
|
+
* @param candidateValues - Array of candidate values indexed by valueIndex.
|
|
8757
|
+
* @returns `Success` if all candidates were added successfully, `Failure` otherwise.
|
|
8758
|
+
* @internal
|
|
8759
|
+
*/
|
|
8760
|
+
private static _createCandidatesFromDecision;
|
|
7054
8761
|
}
|
|
7055
8762
|
|
|
7056
8763
|
/**
|
|
@@ -7077,7 +8784,7 @@ declare const resourceName: Converter<ResourceName, unknown>;
|
|
|
7077
8784
|
* and caching results for optimal performance.
|
|
7078
8785
|
* @public
|
|
7079
8786
|
*/
|
|
7080
|
-
declare class ResourceResolver {
|
|
8787
|
+
export declare class ResourceResolver implements IResourceResolver {
|
|
7081
8788
|
/**
|
|
7082
8789
|
* The resource manager that defines available resources and provides condition access.
|
|
7083
8790
|
*/
|
|
@@ -7090,6 +8797,14 @@ declare class ResourceResolver {
|
|
|
7090
8797
|
* The context qualifier provider that resolves qualifier values.
|
|
7091
8798
|
*/
|
|
7092
8799
|
readonly contextQualifierProvider: IContextQualifierProvider;
|
|
8800
|
+
/**
|
|
8801
|
+
* The configuration options for this resource resolver.
|
|
8802
|
+
*/
|
|
8803
|
+
readonly options: IResourceResolverOptions;
|
|
8804
|
+
/**
|
|
8805
|
+
* The readonly qualifier collector that provides qualifier implementations.
|
|
8806
|
+
*/
|
|
8807
|
+
get qualifiers(): IReadOnlyQualifierCollector;
|
|
7093
8808
|
/**
|
|
7094
8809
|
* The cache array for resolved conditions, indexed by condition index for O(1) lookup.
|
|
7095
8810
|
* Each entry stores the resolved {@link Runtime.IConditionMatchResult | condition match result} for
|
|
@@ -7173,16 +8888,34 @@ declare class ResourceResolver {
|
|
|
7173
8888
|
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
7174
8889
|
* @public
|
|
7175
8890
|
*/
|
|
7176
|
-
resolveResource(resource: IResource): Result<IResourceCandidate>;
|
|
8891
|
+
resolveResource(resource: IResource): Result<IResourceCandidate>;
|
|
8892
|
+
/**
|
|
8893
|
+
* Resolves a resource by finding the best matching candidate.
|
|
8894
|
+
* Uses the resource's associated decision to determine the best match based on the current context.
|
|
8895
|
+
* @param resource - The string id of the resource to resolve.
|
|
8896
|
+
* @returns `Success` with the best matching candidate if successful,
|
|
8897
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
8898
|
+
* @public
|
|
8899
|
+
*/
|
|
8900
|
+
resolveResource(resource: string): Result<IResourceCandidate>;
|
|
8901
|
+
/**
|
|
8902
|
+
* Resolves all matching resource candidates in priority order.
|
|
8903
|
+
* Uses the resource's associated decision to determine all matching candidates based on the current context.
|
|
8904
|
+
* @param resource - The {@link Resources.Resource | resource} to resolve.
|
|
8905
|
+
* @returns `Success` with an array of all matching candidates in priority order if successful,
|
|
8906
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
8907
|
+
* @public
|
|
8908
|
+
*/
|
|
8909
|
+
resolveAllResourceCandidates(resource: IResource): Result<ReadonlyArray<IResourceCandidate>>;
|
|
7177
8910
|
/**
|
|
7178
8911
|
* Resolves all matching resource candidates in priority order.
|
|
7179
8912
|
* Uses the resource's associated decision to determine all matching candidates based on the current context.
|
|
7180
|
-
* @param resource - The
|
|
8913
|
+
* @param resource - The string id of the resource to resolve.
|
|
7181
8914
|
* @returns `Success` with an array of all matching candidates in priority order if successful,
|
|
7182
8915
|
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
7183
8916
|
* @public
|
|
7184
8917
|
*/
|
|
7185
|
-
resolveAllResourceCandidates(resource:
|
|
8918
|
+
resolveAllResourceCandidates(resource: string): Result<ReadonlyArray<IResourceCandidate>>;
|
|
7186
8919
|
/**
|
|
7187
8920
|
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
7188
8921
|
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
@@ -7193,6 +8926,20 @@ declare class ResourceResolver {
|
|
|
7193
8926
|
* @public
|
|
7194
8927
|
*/
|
|
7195
8928
|
resolveComposedResourceValue(resource: IResource): Result<JsonValue>;
|
|
8929
|
+
/**
|
|
8930
|
+
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
8931
|
+
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
8932
|
+
* priority "partial" candidates into it in ascending order of priority.
|
|
8933
|
+
* @param resource - The string id of the resource to resolve.
|
|
8934
|
+
* @returns `Success` with the composed JsonValue if successful,
|
|
8935
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
8936
|
+
* @public
|
|
8937
|
+
*/
|
|
8938
|
+
resolveComposedResourceValue(resource: string): Result<JsonValue>;
|
|
8939
|
+
/**
|
|
8940
|
+
* {@inheritDoc IResourceResolver.withContext}
|
|
8941
|
+
*/
|
|
8942
|
+
withContext(context: Record<string, string>): Result<ResourceResolver>;
|
|
7196
8943
|
/**
|
|
7197
8944
|
* Clears all caches (condition, condition set, and decision), forcing all cached items
|
|
7198
8945
|
* to be re-evaluated on next access. This should be called when the context changes and cached
|
|
@@ -7233,6 +8980,8 @@ declare type ResourceResolverCacheActivity = 'hit' | 'miss' | 'error' | 'clear';
|
|
|
7233
8980
|
*/
|
|
7234
8981
|
declare class ResourceResolverCacheMetricsListener<TM extends ICacheMetrics> implements IResourceResolverCacheListener {
|
|
7235
8982
|
private readonly _metrics;
|
|
8983
|
+
private _contextErrors;
|
|
8984
|
+
get numContextErrors(): number;
|
|
7236
8985
|
constructor(factory: () => TM);
|
|
7237
8986
|
constructor(metrics: OverallCacheMetrics<TM>);
|
|
7238
8987
|
/**
|
|
@@ -7252,6 +9001,10 @@ declare class ResourceResolverCacheMetricsListener<TM extends ICacheMetrics> imp
|
|
|
7252
9001
|
* {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheError}
|
|
7253
9002
|
*/
|
|
7254
9003
|
onCacheError(cache: ResourceResolverCacheType, index: number): void;
|
|
9004
|
+
/**
|
|
9005
|
+
* {@inheritDoc Runtime.IResourceResolverCacheListener.onContextError}
|
|
9006
|
+
*/
|
|
9007
|
+
onContextError(qualifier: string, error: string): void;
|
|
7255
9008
|
/**
|
|
7256
9009
|
* {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheClear}
|
|
7257
9010
|
*/
|
|
@@ -7274,6 +9027,11 @@ declare namespace Resources {
|
|
|
7274
9027
|
ICandidateInfo,
|
|
7275
9028
|
IReducedCandidate,
|
|
7276
9029
|
CandidateReducer,
|
|
9030
|
+
ICandidateValue,
|
|
9031
|
+
ICandidateValueCreateParams,
|
|
9032
|
+
CandidateValue,
|
|
9033
|
+
ICandidateValueCollectorCreateParams,
|
|
9034
|
+
CandidateValueCollector,
|
|
7277
9035
|
IResourceCandidateCreateParams,
|
|
7278
9036
|
ICandidateDeclOptions,
|
|
7279
9037
|
ResourceCandidate,
|
|
@@ -7286,7 +9044,8 @@ declare namespace Resources {
|
|
|
7286
9044
|
ResourceManagerBuilderResultDetail,
|
|
7287
9045
|
ResourceManagerBuilder,
|
|
7288
9046
|
IResourceDeclarationOptions,
|
|
7289
|
-
ICompiledResourceOptionsWithFilter
|
|
9047
|
+
ICompiledResourceOptionsWithFilter,
|
|
9048
|
+
IResourceManagerCloneOptions
|
|
7290
9049
|
}
|
|
7291
9050
|
}
|
|
7292
9051
|
export { Resources }
|
|
@@ -7333,7 +9092,7 @@ declare const resourceTreeChildNodeDecl: Converter<Normalized.IResourceTreeChild
|
|
|
7333
9092
|
* strongly-typed internal tree operations, ensuring type safety and consistent
|
|
7334
9093
|
* error handling throughout the resource tree navigation.
|
|
7335
9094
|
*
|
|
7336
|
-
* @
|
|
9095
|
+
* @public
|
|
7337
9096
|
*/
|
|
7338
9097
|
declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeChildren<T, string, string> {
|
|
7339
9098
|
private readonly _inner;
|
|
@@ -7388,17 +9147,17 @@ declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeC
|
|
|
7388
9147
|
*/
|
|
7389
9148
|
forEach(cb: (value: unknown, key: string, map: IReadOnlyResultMap<string, unknown>, thisArg?: unknown) => void, arg?: unknown): void;
|
|
7390
9149
|
/**
|
|
7391
|
-
* Gets a child node by its
|
|
7392
|
-
* @param key - The
|
|
9150
|
+
* Gets a child node by its string key with detailed error information.
|
|
9151
|
+
* @param key - The string key to look up
|
|
7393
9152
|
* @returns DetailedResult containing the node if found, or failure with details
|
|
7394
9153
|
*/
|
|
7395
|
-
get(key:
|
|
9154
|
+
get(key: string): DetailedResult<IReadOnlyResourceTreeNode<T>, Collections.ResultMapResultDetail>;
|
|
7396
9155
|
/**
|
|
7397
|
-
* Checks if a child node exists at the given
|
|
7398
|
-
* @param key - The
|
|
9156
|
+
* Checks if a child node exists at the given string key.
|
|
9157
|
+
* @param key - The string key to check
|
|
7399
9158
|
* @returns True if a child node exists at the key, false otherwise
|
|
7400
9159
|
*/
|
|
7401
|
-
has(key:
|
|
9160
|
+
has(key: string): boolean;
|
|
7402
9161
|
/**
|
|
7403
9162
|
* Returns an iterator of ResourceName keys for all child nodes.
|
|
7404
9163
|
* @returns Map iterator for all child node keys
|
|
@@ -7422,6 +9181,111 @@ declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeC
|
|
|
7422
9181
|
*/
|
|
7423
9182
|
declare type ResourceTreeNodeInit<T> = IResourceTreeLeafInit<T> | IResourceTreeBranchInit<T>;
|
|
7424
9183
|
|
|
9184
|
+
/**
|
|
9185
|
+
* Specialized resolver for resource tree operations, providing enhanced APIs for
|
|
9186
|
+
* resolving entire resource trees from either resource IDs or pre-built tree nodes.
|
|
9187
|
+
*
|
|
9188
|
+
* This class provides a clean separation between individual resource resolution
|
|
9189
|
+
* (handled by ResourceResolver) and tree-based operations, with support for
|
|
9190
|
+
* lazy tree construction and enhanced error handling.
|
|
9191
|
+
*
|
|
9192
|
+
* @public
|
|
9193
|
+
*/
|
|
9194
|
+
declare class ResourceTreeResolver {
|
|
9195
|
+
/**
|
|
9196
|
+
* The {@link Runtime.ResourceResolver | ResourceResolver} to use for individual resource resolution
|
|
9197
|
+
*/
|
|
9198
|
+
readonly resolver: ResourceResolver;
|
|
9199
|
+
/**
|
|
9200
|
+
* The {@link Runtime.IResourceManager | IResourceManager} to use for lazy tree construction.
|
|
9201
|
+
* @internal
|
|
9202
|
+
*/
|
|
9203
|
+
private readonly _resourceManager;
|
|
9204
|
+
/**
|
|
9205
|
+
* The built resource tree, lazily built on first access.
|
|
9206
|
+
* @internal
|
|
9207
|
+
*/
|
|
9208
|
+
private _tree?;
|
|
9209
|
+
/**
|
|
9210
|
+
* Creates a {@link Runtime.ResourceTreeResolver | ResourceTreeResolver} instance.
|
|
9211
|
+
* @param resolver - The ResourceResolver to use for individual resource resolution
|
|
9212
|
+
*/
|
|
9213
|
+
constructor(resolver: ResourceResolver);
|
|
9214
|
+
/**
|
|
9215
|
+
* Creates a {@link Runtime.ResourceTreeResolver | ResourceTreeResolver} instance.
|
|
9216
|
+
* @param resolver - The ResourceResolver to use for individual resource resolution
|
|
9217
|
+
*/
|
|
9218
|
+
static create(resolver: ResourceResolver): Result<ResourceTreeResolver>;
|
|
9219
|
+
/**
|
|
9220
|
+
* Gets the built resource tree, building it lazily on first access.
|
|
9221
|
+
* @returns The resource tree root
|
|
9222
|
+
* @throws Error if no resource manager was provided or tree building fails
|
|
9223
|
+
* @public
|
|
9224
|
+
*/
|
|
9225
|
+
get tree(): IReadOnlyResourceTreeRoot<IResource>;
|
|
9226
|
+
/**
|
|
9227
|
+
* Resolves a resource tree from a resource ID, building the tree lazily from the resource manager.
|
|
9228
|
+
* @param resourceId - The ID of the root resource to resolve
|
|
9229
|
+
* @param options - Optional configuration for error handling during resolution
|
|
9230
|
+
* @returns Success with the composed JsonObject or undefined, or Failure with error message
|
|
9231
|
+
* @public
|
|
9232
|
+
*/
|
|
9233
|
+
resolveComposedResourceTree(resourceId: string, options?: IResolveResourceTreeOptions): Result<JsonObject | undefined>;
|
|
9234
|
+
/**
|
|
9235
|
+
* Resolves a pre-built resource tree node.
|
|
9236
|
+
* @param node - The resource tree node to resolve
|
|
9237
|
+
* @param options - Optional configuration for error handling during resolution
|
|
9238
|
+
* @returns Success with the composed JsonObject or undefined, or Failure with error message
|
|
9239
|
+
* @public
|
|
9240
|
+
*/
|
|
9241
|
+
resolveComposedResourceTree(node: IReadOnlyResourceTreeNode<IResource>, options?: IResolveResourceTreeOptions): Result<JsonObject | undefined>;
|
|
9242
|
+
private _getTree;
|
|
9243
|
+
/**
|
|
9244
|
+
* Resolves a tree from a resource ID by first building the tree from the resource manager.
|
|
9245
|
+
* @internal
|
|
9246
|
+
*/
|
|
9247
|
+
private _resolveFromResourceId;
|
|
9248
|
+
/**
|
|
9249
|
+
* Resolves a pre-built tree node using the extracted tree resolution logic.
|
|
9250
|
+
* @internal
|
|
9251
|
+
*/
|
|
9252
|
+
private _resolveFromTreeNode;
|
|
9253
|
+
/**
|
|
9254
|
+
* Handles resource resolution errors according to the specified mode.
|
|
9255
|
+
* @param resource - The resource that failed to resolve
|
|
9256
|
+
* @param message - The error message from the failed resolution
|
|
9257
|
+
* @param mode - The error handling mode
|
|
9258
|
+
* @param path - The path to the resource in the tree (for error context)
|
|
9259
|
+
* @internal
|
|
9260
|
+
*/
|
|
9261
|
+
private _handleResourceError;
|
|
9262
|
+
/**
|
|
9263
|
+
* Handles empty branch nodes according to the specified mode.
|
|
9264
|
+
* @param node - The empty branch node
|
|
9265
|
+
* @param failedChildren - Names of children that failed to resolve
|
|
9266
|
+
* @param mode - The empty branch handling mode
|
|
9267
|
+
* @param path - The path to the branch in the tree (for error context)
|
|
9268
|
+
* @internal
|
|
9269
|
+
*/
|
|
9270
|
+
private _handleEmptyBranch;
|
|
9271
|
+
/**
|
|
9272
|
+
* Processes a leaf node by resolving its resource value.
|
|
9273
|
+
* @param node - The leaf node to process (must be a leaf node)
|
|
9274
|
+
* @param path - The path to the node in the tree
|
|
9275
|
+
* @param resourceErrorMode - How to handle resource resolution errors
|
|
9276
|
+
* @internal
|
|
9277
|
+
*/
|
|
9278
|
+
private _processLeafNode;
|
|
9279
|
+
/**
|
|
9280
|
+
* Processes a branch node by recursively resolving all its children.
|
|
9281
|
+
* @param node - The branch node to process (must be a branch node)
|
|
9282
|
+
* @param path - The path to the node in the tree
|
|
9283
|
+
* @param options - Resolution options
|
|
9284
|
+
* @internal
|
|
9285
|
+
*/
|
|
9286
|
+
private _processBranchNode;
|
|
9287
|
+
}
|
|
9288
|
+
|
|
7425
9289
|
/**
|
|
7426
9290
|
* `Converter` for a normalized {@link ResourceJson.Normalized.IResourceTreeRootDecl | resource tree root declaration}.
|
|
7427
9291
|
* @public
|
|
@@ -7434,17 +9298,22 @@ declare const resourceTreeRootDecl: Converter<Normalized.IResourceTreeRootDecl>;
|
|
|
7434
9298
|
* resource value.
|
|
7435
9299
|
* @public
|
|
7436
9300
|
*/
|
|
7437
|
-
declare abstract class ResourceType<T = unknown> implements
|
|
9301
|
+
export declare abstract class ResourceType<T = unknown> implements IResourceType<T> {
|
|
7438
9302
|
private _collectible;
|
|
9303
|
+
private _template;
|
|
7439
9304
|
/**
|
|
7440
|
-
*
|
|
9305
|
+
* {@inheritdoc ResourceTypes.IResourceType.key}
|
|
7441
9306
|
*/
|
|
7442
9307
|
get key(): ResourceTypeName;
|
|
7443
9308
|
/**
|
|
7444
|
-
*
|
|
9309
|
+
* Name of the underlying system type.
|
|
9310
|
+
*/
|
|
9311
|
+
abstract readonly systemTypeName: ResourceTypeName;
|
|
9312
|
+
/**
|
|
9313
|
+
* {@inheritdoc ResourceTypes.IResourceType.index}
|
|
7445
9314
|
*/
|
|
7446
9315
|
get index(): ResourceTypeIndex | undefined;
|
|
7447
|
-
protected constructor(key: ResourceTypeName, index?: number);
|
|
9316
|
+
protected constructor(key: ResourceTypeName, index?: number, template?: JsonObject);
|
|
7448
9317
|
/**
|
|
7449
9318
|
* Validates properties of a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration} for
|
|
7450
9319
|
* a resource instance value.
|
|
@@ -7457,34 +9326,62 @@ declare abstract class ResourceType<T = unknown> implements ICollectible<Resourc
|
|
|
7457
9326
|
/**
|
|
7458
9327
|
* Validates a JSON value for use as a partial resource instance value.
|
|
7459
9328
|
* @param json - The JSON value to validate.
|
|
7460
|
-
* @param
|
|
9329
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
7461
9330
|
* @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
|
|
7462
9331
|
* `Failure` with an error message otherwise.
|
|
7463
9332
|
* @public
|
|
7464
9333
|
*/
|
|
7465
|
-
abstract validate(json: JsonValue,
|
|
9334
|
+
abstract validate(json: JsonValue, completeness: CandidateCompleteness): Result<Partial<T>>;
|
|
7466
9335
|
/**
|
|
7467
9336
|
* Validates a JSON value for use as a complete resource instance value.
|
|
7468
9337
|
* @param json - The JSON value to validate.
|
|
7469
|
-
* @param
|
|
9338
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
7470
9339
|
* @returns `Success` with the strongly-typed resource value if the JSON is valid,
|
|
7471
9340
|
* `Failure` with an error message otherwise.
|
|
7472
9341
|
* @public
|
|
7473
9342
|
*/
|
|
7474
|
-
abstract validate(json: JsonValue,
|
|
9343
|
+
abstract validate(json: JsonValue, completeness: 'full'): Result<T>;
|
|
9344
|
+
/**
|
|
9345
|
+
* Validates a JSON value for use as a partial resource instance value.
|
|
9346
|
+
* @param json - The JSON value to validate.
|
|
9347
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
9348
|
+
* @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
|
|
9349
|
+
* `Failure` with an error message otherwise.
|
|
9350
|
+
* @public
|
|
9351
|
+
*/
|
|
9352
|
+
abstract validate(json: JsonValue, completeness: 'partial'): Result<Partial<T>>;
|
|
7475
9353
|
/**
|
|
7476
9354
|
* Validates a JSON value for use as a full or partial resource instance value.
|
|
7477
9355
|
* @param json - The JSON value to validate.
|
|
7478
|
-
* @param
|
|
9356
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
7479
9357
|
* @returns `Success` with the strongly-typed full or partial resource value if
|
|
7480
9358
|
* the JSON is valid, `Failure` with an error message otherwise.
|
|
7481
9359
|
* @public
|
|
7482
9360
|
*/
|
|
7483
|
-
abstract validate(json: JsonValue,
|
|
9361
|
+
abstract validate(json: JsonValue, completeness?: CandidateCompleteness): Result<T | Partial<T>>;
|
|
7484
9362
|
/**
|
|
7485
9363
|
* Sets the index for this resource type. Once set, the index cannot be changed.
|
|
7486
9364
|
*/
|
|
7487
9365
|
setIndex(index: number): Result<ResourceTypeIndex>;
|
|
9366
|
+
/**
|
|
9367
|
+
* Creates a template for a new resource of this type.
|
|
9368
|
+
* Default implementation provides a basic template.
|
|
9369
|
+
* Subclasses can override to provide type-specific templates.
|
|
9370
|
+
* @param resourceId - The id for the new resource
|
|
9371
|
+
* @param init - An optional initial value for the resource.
|
|
9372
|
+
* @param conditions - An optional set of conditions that must be met for the resource to be selected.
|
|
9373
|
+
* @param resolver - An optional resource resolver that can be used to create the template.
|
|
9374
|
+
* @returns A loose resource declaration with default values for this resource type
|
|
9375
|
+
* @public
|
|
9376
|
+
*/
|
|
9377
|
+
createTemplate(resourceId: ResourceId, init?: JsonValue, conditions?: ResourceJson.Json.ConditionSetDecl, resolver?: IResourceResolver): Result<ResourceJson.Json.ILooseResourceDecl>;
|
|
9378
|
+
/**
|
|
9379
|
+
* Gets the default template value for this resource type.
|
|
9380
|
+
* Subclasses should override this to provide type-specific default values.
|
|
9381
|
+
* @returns The default JSON value for a new resource of this type
|
|
9382
|
+
* @public
|
|
9383
|
+
*/
|
|
9384
|
+
getDefaultTemplateCandidate(json?: JsonValue, conditions?: ResourceJson.Json.ConditionSetDecl, __resolver?: IResourceResolver): Result<ResourceJson.Json.IChildResourceCandidateDecl>;
|
|
7488
9385
|
}
|
|
7489
9386
|
|
|
7490
9387
|
/**
|
|
@@ -7508,7 +9405,30 @@ declare class ResourceTypeCollector extends ValidatingCollector<ResourceType> {
|
|
|
7508
9405
|
* @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
|
|
7509
9406
|
* @public
|
|
7510
9407
|
*/
|
|
7511
|
-
declare const resourceTypeConfig: ObjectConverter<IResourceTypeConfig
|
|
9408
|
+
declare const resourceTypeConfig: ObjectConverter<IResourceTypeConfig<JsonObject>, unknown>;
|
|
9409
|
+
|
|
9410
|
+
/**
|
|
9411
|
+
* A factory that creates a {@link ResourceTypes.ResourceType | ResourceType} from a {@link ResourceTypes.Config.IResourceTypeConfig | resource type configuration}
|
|
9412
|
+
* by chaining a supplied factory with a {@link Config.BuiltInResourceTypeFactory | built-in factory} that handles built-in resource types.
|
|
9413
|
+
* @public
|
|
9414
|
+
*/
|
|
9415
|
+
declare class ResourceTypeFactory extends ChainedConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> {
|
|
9416
|
+
/**
|
|
9417
|
+
* Constructor for a resource type factory.
|
|
9418
|
+
* @param factories - Array of factories for resource types. Can be:
|
|
9419
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
9420
|
+
* - {@link Config.ResourceTypeFactoryFunction | Factory functions}
|
|
9421
|
+
* - A mix of both
|
|
9422
|
+
* @remarks The {@link Config.BuiltInResourceTypeFactory | built-in factory} is always added to the end of the chain.
|
|
9423
|
+
*/
|
|
9424
|
+
constructor(factories: Array<IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> | ResourceTypeFactoryFunction>);
|
|
9425
|
+
}
|
|
9426
|
+
|
|
9427
|
+
/**
|
|
9428
|
+
* Function signature for creating a resource type from configuration.
|
|
9429
|
+
* @public
|
|
9430
|
+
*/
|
|
9431
|
+
declare type ResourceTypeFactoryFunction = (config: ResourceTypes.Config.IResourceTypeConfig) => Result<ResourceType>;
|
|
7512
9432
|
|
|
7513
9433
|
/**
|
|
7514
9434
|
* Branded number representing a validated resource type index.
|
|
@@ -7538,6 +9458,7 @@ declare namespace ResourceTypes {
|
|
|
7538
9458
|
export {
|
|
7539
9459
|
Config_3 as Config,
|
|
7540
9460
|
IResourceCandidateValidationProperties,
|
|
9461
|
+
IResourceType,
|
|
7541
9462
|
ResourceType,
|
|
7542
9463
|
IResourceCollectorCreateParams,
|
|
7543
9464
|
ResourceTypeCollector,
|
|
@@ -7578,8 +9499,13 @@ declare namespace Runtime {
|
|
|
7578
9499
|
IValidatingSimpleContextQualifierProviderCreateParams,
|
|
7579
9500
|
ValidatingSimpleContextQualifierProvider,
|
|
7580
9501
|
DecisionResolutionResult,
|
|
9502
|
+
IResourceResolverOptions,
|
|
7581
9503
|
IResourceResolverCreateParams,
|
|
7582
9504
|
ResourceResolver,
|
|
9505
|
+
ResourceErrorHandler,
|
|
9506
|
+
EmptyBranchHandler,
|
|
9507
|
+
IResolveResourceTreeOptions,
|
|
9508
|
+
ResourceTreeResolver,
|
|
7583
9509
|
ConditionMatchType,
|
|
7584
9510
|
IConditionMatchResult,
|
|
7585
9511
|
ConditionSetResolutionResult,
|
|
@@ -7595,6 +9521,14 @@ declare namespace Runtime {
|
|
|
7595
9521
|
}
|
|
7596
9522
|
export { Runtime }
|
|
7597
9523
|
|
|
9524
|
+
/**
|
|
9525
|
+
* Create a safe filename by removing invalid characters
|
|
9526
|
+
* @param filename - Original filename
|
|
9527
|
+
* @returns Sanitized filename
|
|
9528
|
+
* @public
|
|
9529
|
+
*/
|
|
9530
|
+
declare function sanitizeFilename(filename: string): string;
|
|
9531
|
+
|
|
7598
9532
|
/**
|
|
7599
9533
|
* @internal
|
|
7600
9534
|
*/
|
|
@@ -7605,7 +9539,12 @@ declare const segmentedIdentifier: RegExp;
|
|
|
7605
9539
|
* using a `ResultMap` for qualifier value storage.
|
|
7606
9540
|
* @public
|
|
7607
9541
|
*/
|
|
7608
|
-
declare class SimpleContextQualifierProvider extends ContextQualifierProvider {
|
|
9542
|
+
declare class SimpleContextQualifierProvider extends ContextQualifierProvider implements IMutableContextQualifierProvider {
|
|
9543
|
+
/**
|
|
9544
|
+
* Explicit mutability marker for compile-time type discrimination.
|
|
9545
|
+
* Always `true` for mutable providers.
|
|
9546
|
+
*/
|
|
9547
|
+
readonly mutable: true;
|
|
7609
9548
|
/**
|
|
7610
9549
|
* The readonly qualifier collector that defines and validates the qualifiers for this context.
|
|
7611
9550
|
*/
|
|
@@ -7683,6 +9622,14 @@ declare class SimpleContextQualifierProvider extends ContextQualifierProvider {
|
|
|
7683
9622
|
* @public
|
|
7684
9623
|
*/
|
|
7685
9624
|
clear(): void;
|
|
9625
|
+
/**
|
|
9626
|
+
* Resolves a qualifier from a name, index, or qualifier object.
|
|
9627
|
+
* @param nameOrIndexOrQualifier - The input to resolve.
|
|
9628
|
+
* @returns `Success` with the {@link Qualifier | qualifier} if successful,
|
|
9629
|
+
* or `Failure` with an error message if not found or invalid.
|
|
9630
|
+
* @internal
|
|
9631
|
+
*/
|
|
9632
|
+
private _resolveQualifier;
|
|
7686
9633
|
/**
|
|
7687
9634
|
* Resolves a qualifier name from a name, index, or qualifier object.
|
|
7688
9635
|
* @param nameOrIndexOrQualifier - The input to resolve.
|
|
@@ -7691,6 +9638,14 @@ declare class SimpleContextQualifierProvider extends ContextQualifierProvider {
|
|
|
7691
9638
|
* @internal
|
|
7692
9639
|
*/
|
|
7693
9640
|
private _resolveQualifierName;
|
|
9641
|
+
/**
|
|
9642
|
+
* Resolves a qualifier name from a qualifier-like object.
|
|
9643
|
+
* @param nameOrIndexOrQualifier - The input to resolve.
|
|
9644
|
+
* @returns `Success` with the {@link QualifierName | qualifier name} if successful,
|
|
9645
|
+
* or `Failure` with an error message if not found or invalid.
|
|
9646
|
+
* @internal
|
|
9647
|
+
*/
|
|
9648
|
+
private static _qualifierNameFromQualifierLike;
|
|
7694
9649
|
}
|
|
7695
9650
|
|
|
7696
9651
|
/**
|
|
@@ -7736,7 +9691,7 @@ declare class SystemConfiguration {
|
|
|
7736
9691
|
* @param config - The {@link Config.Model.ISystemConfiguration | system configuration} to use.
|
|
7737
9692
|
* @public
|
|
7738
9693
|
*/
|
|
7739
|
-
protected constructor(config: ISystemConfiguration);
|
|
9694
|
+
protected constructor(config: ISystemConfiguration, initParams?: ISystemConfigurationInitParams);
|
|
7740
9695
|
/**
|
|
7741
9696
|
* Creates a new {@link Config.SystemConfiguration | SystemConfiguration} from the supplied
|
|
7742
9697
|
* {@link Config.Model.ISystemConfiguration | system configuration}.
|
|
@@ -7747,6 +9702,14 @@ declare class SystemConfiguration {
|
|
|
7747
9702
|
* @public
|
|
7748
9703
|
*/
|
|
7749
9704
|
static create(config: ISystemConfiguration, initParams?: ISystemConfigurationInitParams): Result<SystemConfiguration>;
|
|
9705
|
+
/**
|
|
9706
|
+
* Loads a {@link Config.SystemConfiguration | SystemConfiguration} from a file.
|
|
9707
|
+
* @param path - The path to the file to load.
|
|
9708
|
+
* @returns `Success` with the {@link Config.SystemConfiguration | SystemConfiguration}
|
|
9709
|
+
* if successful, `Failure` with an error message otherwise.
|
|
9710
|
+
* @public
|
|
9711
|
+
*/
|
|
9712
|
+
static loadFromFile(path: string, initParams?: ISystemConfigurationInitParams): Result<SystemConfiguration>;
|
|
7750
9713
|
/**
|
|
7751
9714
|
* Returns the {@link Config.Model.ISystemConfiguration | system configuration} that this
|
|
7752
9715
|
* {@link Config.SystemConfiguration | SystemConfiguration} was created from.
|
|
@@ -7764,33 +9727,48 @@ declare class SystemConfiguration {
|
|
|
7764
9727
|
*/
|
|
7765
9728
|
declare const systemConfiguration: ObjectConverter<ISystemConfiguration, unknown>;
|
|
7766
9729
|
|
|
9730
|
+
/**
|
|
9731
|
+
* Validator for system configuration (delegates to config packlet)
|
|
9732
|
+
* This validates that the parsed JSON conforms to the system configuration schema
|
|
9733
|
+
* @public
|
|
9734
|
+
*/
|
|
9735
|
+
declare const systemConfiguration_2: Validator<Model.ISystemConfiguration>;
|
|
9736
|
+
|
|
7767
9737
|
/**
|
|
7768
9738
|
* A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
|
|
7769
9739
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
|
|
7770
9740
|
* @public
|
|
7771
9741
|
*/
|
|
7772
|
-
declare const systemLanguageQualifierTypeConfig: ObjectConverter<
|
|
9742
|
+
declare const systemLanguageQualifierTypeConfig: ObjectConverter<Model_2.ISystemLanguageQualifierTypeConfig, unknown>;
|
|
7773
9743
|
|
|
7774
9744
|
/**
|
|
7775
9745
|
* A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
|
|
7776
9746
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
|
|
7777
9747
|
* @public
|
|
7778
9748
|
*/
|
|
7779
|
-
declare const systemLiteralQualifierTypeConfig: ObjectConverter<
|
|
9749
|
+
declare const systemLiteralQualifierTypeConfig: ObjectConverter<Model_2.ISystemLiteralQualifierTypeConfig, unknown>;
|
|
9750
|
+
|
|
9751
|
+
/**
|
|
9752
|
+
* A discriminated union of all system qualifier types.
|
|
9753
|
+
* This allows TypeScript to properly discriminate between specific qualifier type implementations
|
|
9754
|
+
* and access their specific methods like getConfiguration().
|
|
9755
|
+
* @public
|
|
9756
|
+
*/
|
|
9757
|
+
declare type SystemQualifierType = LanguageQualifierType | TerritoryQualifierType | LiteralQualifierType;
|
|
7780
9758
|
|
|
7781
9759
|
/**
|
|
7782
9760
|
* A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
|
|
7783
9761
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
|
|
7784
9762
|
* @public
|
|
7785
9763
|
*/
|
|
7786
|
-
declare const systemQualifierTypeConfig: Converter<
|
|
9764
|
+
declare const systemQualifierTypeConfig: Converter<Model_2.ISystemQualifierTypeConfig, unknown>;
|
|
7787
9765
|
|
|
7788
9766
|
/**
|
|
7789
9767
|
* A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
|
|
7790
9768
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
|
|
7791
9769
|
* @public
|
|
7792
9770
|
*/
|
|
7793
|
-
declare const systemTerritoryQualifierTypeConfig: ObjectConverter<
|
|
9771
|
+
declare const systemTerritoryQualifierTypeConfig: ObjectConverter<Model_2.ISystemTerritoryQualifierTypeConfig, unknown>;
|
|
7794
9772
|
|
|
7795
9773
|
/**
|
|
7796
9774
|
* @internal
|
|
@@ -7821,7 +9799,11 @@ declare const TerritoryPrioritySystemConfiguration: ISystemConfiguration;
|
|
|
7821
9799
|
* implementation handles incorrect casing.
|
|
7822
9800
|
* @public
|
|
7823
9801
|
*/
|
|
7824
|
-
declare class TerritoryQualifierType extends QualifierType {
|
|
9802
|
+
declare class TerritoryQualifierType extends QualifierType<JsonCompatible<Config_2.ITerritoryQualifierTypeConfig>> {
|
|
9803
|
+
/**
|
|
9804
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
9805
|
+
*/
|
|
9806
|
+
readonly systemTypeName: QualifierTypeName;
|
|
7825
9807
|
/**
|
|
7826
9808
|
* Optional array enumerating allowed territories to further constrain the type.
|
|
7827
9809
|
*/
|
|
@@ -7863,6 +9845,27 @@ declare class TerritoryQualifierType extends QualifierType {
|
|
|
7863
9845
|
* @public
|
|
7864
9846
|
*/
|
|
7865
9847
|
static createFromConfig(config: Config_2.IQualifierTypeConfig<Config_2.ITerritoryQualifierTypeConfig>): Result<TerritoryQualifierType>;
|
|
9848
|
+
/**
|
|
9849
|
+
* Gets the {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | strongly typed configuration}
|
|
9850
|
+
* for this qualifier type.
|
|
9851
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
9852
|
+
*/
|
|
9853
|
+
getConfiguration(): Result<Config_2.ISystemTerritoryQualifierTypeConfig>;
|
|
9854
|
+
/**
|
|
9855
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
9856
|
+
*/
|
|
9857
|
+
getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemTerritoryQualifierTypeConfig>>;
|
|
9858
|
+
/**
|
|
9859
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
9860
|
+
*/
|
|
9861
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemTerritoryQualifierTypeConfig>>;
|
|
9862
|
+
/**
|
|
9863
|
+
* Validates a {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | strongly typed configuration object}
|
|
9864
|
+
* for this qualifier type.
|
|
9865
|
+
* @param from - The unknown data to validate as a configuration object.
|
|
9866
|
+
* @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
|
|
9867
|
+
*/
|
|
9868
|
+
validateConfiguration(from: unknown): Result<Config_2.ISystemTerritoryQualifierTypeConfig>;
|
|
7866
9869
|
/**
|
|
7867
9870
|
* {@inheritdoc QualifierTypes.QualifierType._matchOne}
|
|
7868
9871
|
*/
|
|
@@ -7893,7 +9896,27 @@ declare class TerritoryQualifierType extends QualifierType {
|
|
|
7893
9896
|
* @returns A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.
|
|
7894
9897
|
* @public
|
|
7895
9898
|
*/
|
|
7896
|
-
declare const territoryQualifierTypeConfig: ObjectConverter<
|
|
9899
|
+
declare const territoryQualifierTypeConfig: ObjectConverter<Model_2.ITerritoryQualifierTypeConfig, unknown>;
|
|
9900
|
+
|
|
9901
|
+
/**
|
|
9902
|
+
* Converts a number to a {@link CandidateValueIndex | candidate value index}.
|
|
9903
|
+
*
|
|
9904
|
+
* @param index - The number to convert.
|
|
9905
|
+
* @returns `Success` with the converted index if valid, or `Failure` with an error message
|
|
9906
|
+
* if not.
|
|
9907
|
+
* @public
|
|
9908
|
+
*/
|
|
9909
|
+
declare function toCandidateValueIndex(index: number): Result<CandidateValueIndex>;
|
|
9910
|
+
|
|
9911
|
+
/**
|
|
9912
|
+
* Converts a string to a {@link CandidateValueKey | candidate value key}.
|
|
9913
|
+
*
|
|
9914
|
+
* @param key - The key to convert.
|
|
9915
|
+
* @returns `Success` with the converted key if valid, or `Failure` with an error message
|
|
9916
|
+
* if not.
|
|
9917
|
+
* @public
|
|
9918
|
+
*/
|
|
9919
|
+
declare function toCandidateValueKey(key: string): Result<CandidateValueKey>;
|
|
7897
9920
|
|
|
7898
9921
|
/**
|
|
7899
9922
|
* Converts a number to a {@link ConditionIndex} if it is a valid condition index.
|
|
@@ -8022,6 +10045,15 @@ declare function toDecisionKey(key: string): Result<DecisionKey>;
|
|
|
8022
10045
|
*/
|
|
8023
10046
|
declare function toOptionalResourceId(id?: string): Result<ResourceId | undefined>;
|
|
8024
10047
|
|
|
10048
|
+
/**
|
|
10049
|
+
* Converts a string to a {@link QualifierContextValue} if it is a valid qualifier context value.
|
|
10050
|
+
* @param value - the string to convert
|
|
10051
|
+
* @returns `Success` with the converted {@link QualifierContextValue} if successful, or `Failure` with an
|
|
10052
|
+
* error message if not.
|
|
10053
|
+
* @public
|
|
10054
|
+
*/
|
|
10055
|
+
declare function toQualifierContextValue(value: string): Result<QualifierContextValue>;
|
|
10056
|
+
|
|
8025
10057
|
/**
|
|
8026
10058
|
* Converts a string to a {@link QualifierDefaultValuesToken} if it is a valid qualifier default values token.
|
|
8027
10059
|
* @param token - the string to convert
|
|
@@ -8165,7 +10197,9 @@ declare namespace Validate {
|
|
|
8165
10197
|
isValidConditionSetHash,
|
|
8166
10198
|
isValidDecisionKey,
|
|
8167
10199
|
isValidDecisionIndex,
|
|
10200
|
+
isValidQualifierContextValue,
|
|
8168
10201
|
toQualifierName,
|
|
10202
|
+
toQualifierContextValue,
|
|
8169
10203
|
toQualifierIndex,
|
|
8170
10204
|
toQualifierTypeName,
|
|
8171
10205
|
toQualifierTypeIndex,
|
|
@@ -8194,12 +10228,16 @@ declare namespace Validate {
|
|
|
8194
10228
|
isValidResourceIndex,
|
|
8195
10229
|
isValidResourceTypeName,
|
|
8196
10230
|
isValidResourceTypeIndex,
|
|
10231
|
+
isValidCandidateValueIndex,
|
|
10232
|
+
isValidCandidateValueKey,
|
|
8197
10233
|
toResourceName,
|
|
8198
10234
|
toResourceId,
|
|
8199
10235
|
toOptionalResourceId,
|
|
8200
10236
|
toResourceIndex,
|
|
8201
10237
|
toResourceTypeName,
|
|
8202
|
-
toResourceTypeIndex
|
|
10238
|
+
toResourceTypeIndex,
|
|
10239
|
+
toCandidateValueKey,
|
|
10240
|
+
toCandidateValueIndex
|
|
8203
10241
|
}
|
|
8204
10242
|
}
|
|
8205
10243
|
export { Validate }
|
|
@@ -8244,19 +10282,107 @@ declare const validatedContextQualifierValueDecl: Converter<IValidatedContextQua
|
|
|
8244
10282
|
*/
|
|
8245
10283
|
declare const validatedQualifierDecl: Converter<IValidatedQualifierDecl, IQualifierDeclConvertContext>;
|
|
8246
10284
|
|
|
10285
|
+
/**
|
|
10286
|
+
* Validate a {@link Config.Model.ISystemConfiguration | ISystemConfiguration} object.
|
|
10287
|
+
* @param config - The system configuration to validate
|
|
10288
|
+
* @returns `Success` with the validated system configuration if successful,
|
|
10289
|
+
* or `Failure` with an error message if validation fails.
|
|
10290
|
+
* @public
|
|
10291
|
+
*/
|
|
10292
|
+
declare function validateSystemConfiguration(config: unknown): Result<ISystemConfiguration>;
|
|
10293
|
+
|
|
10294
|
+
/**
|
|
10295
|
+
* Validate a ZIP archive manifest object
|
|
10296
|
+
* @param manifest - Object to validate as manifest
|
|
10297
|
+
* @returns Result containing validated manifest
|
|
10298
|
+
* @public
|
|
10299
|
+
*/
|
|
10300
|
+
declare function validateZipArchiveManifest(manifest: unknown): Result<Json_2.IZipArchiveManifest>;
|
|
10301
|
+
|
|
10302
|
+
/**
|
|
10303
|
+
* A factory that validates and creates {@link QualifierTypes.QualifierType | QualifierType} instances
|
|
10304
|
+
* from weakly-typed configuration objects. This factory accepts configurations with unvalidated
|
|
10305
|
+
* string properties and validates them before delegating to the underlying factory chain.
|
|
10306
|
+
*
|
|
10307
|
+
* This pattern is useful at package boundaries where type identity issues may occur with
|
|
10308
|
+
* branded types across different package instances.
|
|
10309
|
+
*
|
|
10310
|
+
* @example
|
|
10311
|
+
* ```typescript
|
|
10312
|
+
* // Accept weakly-typed config from external source
|
|
10313
|
+
* const validatingFactory = new ValidatingQualifierTypeFactory([customFactory]);
|
|
10314
|
+
*
|
|
10315
|
+
* // Config can have plain string types instead of branded types
|
|
10316
|
+
* const config = {
|
|
10317
|
+
* name: 'my-qualifier', // plain string, not QualifierTypeName
|
|
10318
|
+
* systemType: 'custom', // plain string
|
|
10319
|
+
* configuration: { ... }
|
|
10320
|
+
* };
|
|
10321
|
+
*
|
|
10322
|
+
* const result = validatingFactory.create(config); // Validates and converts internally
|
|
10323
|
+
* ```
|
|
10324
|
+
*
|
|
10325
|
+
* @public
|
|
10326
|
+
*/
|
|
10327
|
+
declare class ValidatingQualifierTypeFactory<T extends QualifierType = SystemQualifierType> implements IConfigInitFactory<unknown, T | SystemQualifierType> {
|
|
10328
|
+
private readonly _innerFactory;
|
|
10329
|
+
/**
|
|
10330
|
+
* Constructor for a validating qualifier type factory.
|
|
10331
|
+
* @param factories - Array of factories for custom qualifier types. Can be:
|
|
10332
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
10333
|
+
* - {@link Config.QualifierTypeFactoryFunction | Factory functions}
|
|
10334
|
+
* - A mix of both
|
|
10335
|
+
*/
|
|
10336
|
+
constructor(factories: Array<IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T> | QualifierTypeFactoryFunction<T>>);
|
|
10337
|
+
/**
|
|
10338
|
+
* Creates a qualifier type from a weakly-typed configuration object.
|
|
10339
|
+
* @param config - The configuration object to validate and use for creation.
|
|
10340
|
+
* @returns A result containing the new qualifier type if successful.
|
|
10341
|
+
*/
|
|
10342
|
+
create(config: unknown): Result<T | SystemQualifierType>;
|
|
10343
|
+
}
|
|
10344
|
+
|
|
10345
|
+
/**
|
|
10346
|
+
* A factory that validates and creates {@link ResourceTypes.ResourceType | ResourceType} instances
|
|
10347
|
+
* from weakly-typed configuration objects. This factory accepts configurations with unvalidated
|
|
10348
|
+
* string properties and validates them before delegating to the underlying factory chain.
|
|
10349
|
+
*
|
|
10350
|
+
* This pattern is useful at package boundaries where type identity issues may occur with
|
|
10351
|
+
* branded types across different package instances.
|
|
10352
|
+
*
|
|
10353
|
+
* @public
|
|
10354
|
+
*/
|
|
10355
|
+
declare class ValidatingResourceTypeFactory implements IConfigInitFactory<unknown, ResourceType> {
|
|
10356
|
+
private readonly _innerFactory;
|
|
10357
|
+
/**
|
|
10358
|
+
* Constructor for a validating resource type factory.
|
|
10359
|
+
* @param factories - Array of factories for resource types. Can be:
|
|
10360
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
10361
|
+
* - {@link Config.ResourceTypeFactoryFunction | Factory functions}
|
|
10362
|
+
* - A mix of both
|
|
10363
|
+
*/
|
|
10364
|
+
constructor(factories: Array<IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> | ResourceTypeFactoryFunction>);
|
|
10365
|
+
/**
|
|
10366
|
+
* Creates a resource type from a weakly-typed configuration object.
|
|
10367
|
+
* @param config - The configuration object to validate and use for creation.
|
|
10368
|
+
* @returns A result containing the new resource type if successful.
|
|
10369
|
+
*/
|
|
10370
|
+
create(config: unknown): Result<ResourceType>;
|
|
10371
|
+
}
|
|
10372
|
+
|
|
8247
10373
|
/**
|
|
8248
10374
|
* A {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider} with a
|
|
8249
|
-
* {@link Runtime.Context.
|
|
10375
|
+
* {@link Runtime.Context.MutableContextQualifierProviderValidator | validator} property that enables
|
|
8250
10376
|
* validated use of the underlying provider with string keys and values.
|
|
8251
10377
|
* This eliminates the need for type casting in consumer code.
|
|
8252
10378
|
* @public
|
|
8253
10379
|
*/
|
|
8254
10380
|
declare class ValidatingSimpleContextQualifierProvider extends SimpleContextQualifierProvider {
|
|
8255
10381
|
/**
|
|
8256
|
-
* A {@link Runtime.Context.
|
|
10382
|
+
* A {@link Runtime.Context.MutableContextQualifierProviderValidator | MutableContextQualifierProviderValidator} which validates
|
|
8257
10383
|
* string inputs before passing them to this provider.
|
|
8258
10384
|
*/
|
|
8259
|
-
readonly validating:
|
|
10385
|
+
readonly validating: IMutableContextQualifierProviderValidator;
|
|
8260
10386
|
/**
|
|
8261
10387
|
* Constructor for a {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider} object.
|
|
8262
10388
|
* @param params - {@link Runtime.IValidatingSimpleContextQualifierProviderCreateParams | Parameters} used to create the provider.
|
|
@@ -8272,4 +10398,194 @@ declare class ValidatingSimpleContextQualifierProvider extends SimpleContextQual
|
|
|
8272
10398
|
static create(params: IValidatingSimpleContextQualifierProviderCreateParams): Result<ValidatingSimpleContextQualifierProvider>;
|
|
8273
10399
|
}
|
|
8274
10400
|
|
|
10401
|
+
declare namespace ZipArchive {
|
|
10402
|
+
export {
|
|
10403
|
+
Json_2 as Json,
|
|
10404
|
+
Convert_12 as Convert,
|
|
10405
|
+
ZipArchiveCreator,
|
|
10406
|
+
ZipArchiveLoader,
|
|
10407
|
+
IZipArchivePathOptions,
|
|
10408
|
+
IZipArchiveFileTreeOptions,
|
|
10409
|
+
ZipArchiveOptions,
|
|
10410
|
+
IZipArchiveResult,
|
|
10411
|
+
IZipArchiveManifest_2 as IZipArchiveManifest,
|
|
10412
|
+
IZipArchiveLoadOptions,
|
|
10413
|
+
IZipArchiveLoadResult,
|
|
10414
|
+
IImportedFile_2 as IImportedFile,
|
|
10415
|
+
IImportedDirectory_2 as IImportedDirectory,
|
|
10416
|
+
ZipArchiveProgressCallback,
|
|
10417
|
+
createZipArchiveManifest,
|
|
10418
|
+
parseZipArchiveManifest,
|
|
10419
|
+
validateZipArchiveManifest,
|
|
10420
|
+
parseZipArchiveConfiguration,
|
|
10421
|
+
generateZipArchiveFilename,
|
|
10422
|
+
normalizePath,
|
|
10423
|
+
getDirectoryName,
|
|
10424
|
+
sanitizeFilename,
|
|
10425
|
+
isZipFile,
|
|
10426
|
+
ZipArchiveConstants
|
|
10427
|
+
}
|
|
10428
|
+
}
|
|
10429
|
+
export { ZipArchive }
|
|
10430
|
+
|
|
10431
|
+
/**
|
|
10432
|
+
* Validator for ZIP archive config information
|
|
10433
|
+
* @public
|
|
10434
|
+
*/
|
|
10435
|
+
declare const zipArchiveConfigInfo: Validator<Json_2.IZipArchiveConfigInfo>;
|
|
10436
|
+
|
|
10437
|
+
/**
|
|
10438
|
+
* Validator for ZIP archive config type
|
|
10439
|
+
* @public
|
|
10440
|
+
*/
|
|
10441
|
+
declare const zipArchiveConfigType: Validator<'file'>;
|
|
10442
|
+
|
|
10443
|
+
/**
|
|
10444
|
+
* Constants for ZIP archive structure
|
|
10445
|
+
* @public
|
|
10446
|
+
*/
|
|
10447
|
+
declare const ZipArchiveConstants: {
|
|
10448
|
+
/** Manifest file name */
|
|
10449
|
+
readonly MANIFEST_FILE: "manifest.json";
|
|
10450
|
+
/** Configuration file name */
|
|
10451
|
+
readonly CONFIG_FILE: "config.json";
|
|
10452
|
+
/** Input files directory */
|
|
10453
|
+
readonly INPUT_DIR: "input";
|
|
10454
|
+
/** Configuration files directory */
|
|
10455
|
+
readonly CONFIG_DIR: "config";
|
|
10456
|
+
};
|
|
10457
|
+
|
|
10458
|
+
/**
|
|
10459
|
+
* ZIP archive creator using fflate for universal compatibility
|
|
10460
|
+
* @public
|
|
10461
|
+
*/
|
|
10462
|
+
declare class ZipArchiveCreator {
|
|
10463
|
+
/**
|
|
10464
|
+
* Create a ZIP archive buffer from a supplied buffer
|
|
10465
|
+
* @param options - Input paths and configuration
|
|
10466
|
+
* @param onProgress - Optional progress callback
|
|
10467
|
+
* @returns Result containing ZIP buffer and manifest
|
|
10468
|
+
*/
|
|
10469
|
+
createFromBuffer(options: ZipArchiveOptions, onProgress?: ZipArchiveProgressCallback): Promise<Result<IZipArchiveResult>>;
|
|
10470
|
+
/**
|
|
10471
|
+
* Add a single FileTree item to the ZIP archive
|
|
10472
|
+
* @param files - ZIP files collection
|
|
10473
|
+
* @param fileItem - FileTree file item to add
|
|
10474
|
+
* @param archivePath - Path within the archive
|
|
10475
|
+
* @returns Result indicating success or failure
|
|
10476
|
+
*/
|
|
10477
|
+
private _addFileTreeItemToZip;
|
|
10478
|
+
/**
|
|
10479
|
+
* Add a directory recursively to the ZIP archive using FileTree
|
|
10480
|
+
* @param files - ZIP files collection
|
|
10481
|
+
* @param directoryItem - FileTree directory item to add
|
|
10482
|
+
* @param archivePrefix - Prefix path within the archive
|
|
10483
|
+
* @param onProgress - Optional progress callback
|
|
10484
|
+
* @returns Result indicating success or failure
|
|
10485
|
+
*/
|
|
10486
|
+
private _addDirectoryTreeToZip;
|
|
10487
|
+
private _getInputFileTreeItem;
|
|
10488
|
+
private _getConfigFileTreeItem;
|
|
10489
|
+
}
|
|
10490
|
+
|
|
10491
|
+
/**
|
|
10492
|
+
* Validator for ZIP archive input information
|
|
10493
|
+
* @public
|
|
10494
|
+
*/
|
|
10495
|
+
declare const zipArchiveInputInfo: Validator<Json_2.IZipArchiveInputInfo>;
|
|
10496
|
+
|
|
10497
|
+
/**
|
|
10498
|
+
* Validator for ZIP archive input type
|
|
10499
|
+
* @public
|
|
10500
|
+
*/
|
|
10501
|
+
declare const zipArchiveInputType: Validator<'file' | 'directory'>;
|
|
10502
|
+
|
|
10503
|
+
/**
|
|
10504
|
+
* ZIP archive loader extending ts-extras foundation
|
|
10505
|
+
* @public
|
|
10506
|
+
*/
|
|
10507
|
+
declare class ZipArchiveLoader {
|
|
10508
|
+
/**
|
|
10509
|
+
* Load ZIP archive from File object (Browser)
|
|
10510
|
+
* @param file - File object from file input
|
|
10511
|
+
* @param options - Loading options
|
|
10512
|
+
* @param onProgress - Optional progress callback
|
|
10513
|
+
* @returns Result containing loaded archive data
|
|
10514
|
+
*/
|
|
10515
|
+
loadFromFile(file: File, options?: IZipArchiveLoadOptions, onProgress?: ZipArchiveProgressCallback): Promise<Result<IZipArchiveLoadResult>>;
|
|
10516
|
+
/**
|
|
10517
|
+
* Load ZIP archive from ArrayBuffer (Universal)
|
|
10518
|
+
* @param buffer - ZIP data buffer
|
|
10519
|
+
* @param options - Loading options
|
|
10520
|
+
* @param onProgress - Optional progress callback
|
|
10521
|
+
* @returns Result containing loaded archive data
|
|
10522
|
+
*/
|
|
10523
|
+
loadFromBuffer(buffer: ArrayBuffer, options?: IZipArchiveLoadOptions, onProgress?: ZipArchiveProgressCallback): Promise<Result<IZipArchiveLoadResult>>;
|
|
10524
|
+
/**
|
|
10525
|
+
* Load manifest from ZIP using ZipFileTreeAccessors
|
|
10526
|
+
* @param zipAccessors - ZIP file tree accessors
|
|
10527
|
+
* @returns Result containing parsed manifest
|
|
10528
|
+
*/
|
|
10529
|
+
private _loadManifestFromAccessors;
|
|
10530
|
+
/**
|
|
10531
|
+
* Load configuration from ZIP using ZipFileTreeAccessors
|
|
10532
|
+
* @param zipAccessors - ZIP file tree accessors
|
|
10533
|
+
* @param manifest - Parsed manifest (may be undefined)
|
|
10534
|
+
* @param options - Loading options
|
|
10535
|
+
* @returns Result containing parsed configuration
|
|
10536
|
+
*/
|
|
10537
|
+
private _loadConfigurationFromAccessors;
|
|
10538
|
+
/**
|
|
10539
|
+
* Extract files and directory structure from ZIP
|
|
10540
|
+
* @param zipAccessors - ZIP file tree accessors
|
|
10541
|
+
* @param onProgress - Optional progress callback
|
|
10542
|
+
* @returns Result containing files and directory structure
|
|
10543
|
+
*/
|
|
10544
|
+
private _extractFilesFromAccessors;
|
|
10545
|
+
/**
|
|
10546
|
+
* Recursively process file tree items
|
|
10547
|
+
* @param zipAccessors - ZIP file tree accessors
|
|
10548
|
+
* @param currentPath - Current directory path
|
|
10549
|
+
* @param items - Items to process
|
|
10550
|
+
* @param files - Files collection
|
|
10551
|
+
* @param directories - Directories collection
|
|
10552
|
+
* @param onProgress - Optional progress callback
|
|
10553
|
+
* @param processed - Processing counter
|
|
10554
|
+
*/
|
|
10555
|
+
private _processFileTreeItems;
|
|
10556
|
+
/**
|
|
10557
|
+
* Build directory structure from files
|
|
10558
|
+
* @param files - Extracted files
|
|
10559
|
+
* @param directories - Directories map
|
|
10560
|
+
* @returns Root directory structure or null
|
|
10561
|
+
*/
|
|
10562
|
+
private _buildDirectoryStructure;
|
|
10563
|
+
/**
|
|
10564
|
+
* Get file MIME type based on extension
|
|
10565
|
+
* @param filename - Filename
|
|
10566
|
+
* @returns MIME type
|
|
10567
|
+
*/
|
|
10568
|
+
private _getFileType;
|
|
10569
|
+
}
|
|
10570
|
+
|
|
10571
|
+
/**
|
|
10572
|
+
* Validator for ZIP archive manifest
|
|
10573
|
+
* Compatible with existing tools from ts-res-browser-cli
|
|
10574
|
+
* @public
|
|
10575
|
+
*/
|
|
10576
|
+
declare const zipArchiveManifest: Validator<Json_2.IZipArchiveManifest>;
|
|
10577
|
+
|
|
10578
|
+
/**
|
|
10579
|
+
* Options for creating a ZIP archive buffer
|
|
10580
|
+
* @public
|
|
10581
|
+
*/
|
|
10582
|
+
declare type ZipArchiveOptions = IZipArchivePathOptions | IZipArchiveFileTreeOptions;
|
|
10583
|
+
|
|
10584
|
+
/**
|
|
10585
|
+
* Progress callback for ZIP operations
|
|
10586
|
+
* @public
|
|
10587
|
+
*/
|
|
10588
|
+
declare type ZipArchiveProgressCallback = (stage: 'reading-file' | 'parsing-zip' | 'loading-manifest' | 'loading-config' | 'extracting-files' | 'processing-resources' | 'creating-zip', progress: number, // 0-100
|
|
10589
|
+
details: string) => void;
|
|
10590
|
+
|
|
8275
10591
|
export { }
|