@fgv/ts-res 5.0.0-3 → 5.0.0-30
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 +2344 -187
- 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 +10 -0
- package/lib/packlets/common/convert.js +11 -1
- package/lib/packlets/common/helpers/resources.d.ts +7 -0
- package/lib/packlets/common/helpers/resources.js +12 -0
- package/lib/packlets/common/resources.d.ts +48 -1
- 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 +54 -0
- package/lib/packlets/conditions/conditionSet.d.ts +9 -0
- package/lib/packlets/conditions/conditionSet.js +74 -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.js +8 -13
- package/lib/packlets/import/importers/jsonImporter.js +1 -0
- 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 +11 -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 +77 -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/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 +3 -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 +478 -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 +32 -4
- 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 +84 -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 +194 -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
6
|
import { FileTree } from '@fgv/ts-utils';
|
|
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,13 @@ 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
|
+
|
|
133
144
|
/**
|
|
134
145
|
* Converts an array of {@link Helpers.IConditionTokenParts | condition token parts} into an array of
|
|
135
146
|
* syntactically validated {@link ConditionToken | condition tokens}.
|
|
@@ -178,6 +189,283 @@ declare function buildQualifierDefaultValuesToken(parts: ReadonlyArray<IQualifie
|
|
|
178
189
|
*/
|
|
179
190
|
declare function buildQualifierDefaultValueToken({ qualifier, value }: IQualifierDefaultValueTokenParts): Result<QualifierDefaultValueToken>;
|
|
180
191
|
|
|
192
|
+
/**
|
|
193
|
+
* A factory that creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from
|
|
194
|
+
* {@link QualifierTypes.Config.IAnyQualifierTypeConfig | any qualifier type configuration}.
|
|
195
|
+
* @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}
|
|
196
|
+
* if successful, `Failure` with an error message otherwise.
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
199
|
+
declare class BuiltInQualifierTypeFactory implements IConfigInitFactory<QualifierTypes.Config.ISystemQualifierTypeConfig, SystemQualifierType> {
|
|
200
|
+
/** {@inheritDoc Config.IConfigInitFactory.create} */
|
|
201
|
+
create(config: QualifierTypes.Config.IAnyQualifierTypeConfig): Result<SystemQualifierType>;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* A factory that creates a {@link ResourceTypes.ResourceType | ResourceType} from a {@link ResourceTypes.Config.IResourceTypeConfig | resource type configuration}.
|
|
206
|
+
* @public
|
|
207
|
+
*/
|
|
208
|
+
declare class BuiltInResourceTypeFactory implements IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> {
|
|
209
|
+
/** {@inheritDoc Config.IConfigInitFactory.create} */
|
|
210
|
+
create(config: ResourceTypes.Config.IResourceTypeConfig): Result<ResourceType>;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
declare namespace Bundle {
|
|
214
|
+
export {
|
|
215
|
+
IBundleMetadata,
|
|
216
|
+
IBundleExportMetadata,
|
|
217
|
+
IBundle,
|
|
218
|
+
IBundleCreateParams,
|
|
219
|
+
BundleBuilder,
|
|
220
|
+
BundleLoader,
|
|
221
|
+
IBundleLoaderCreateParams,
|
|
222
|
+
BundleUtils,
|
|
223
|
+
IBundleComponents,
|
|
224
|
+
Model_4 as Model,
|
|
225
|
+
Convert_10 as Convert,
|
|
226
|
+
BundleNormalizer
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
export { Bundle }
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* `Converter` for a {@link Bundle.IBundle | bundle} object.
|
|
233
|
+
* @public
|
|
234
|
+
*/
|
|
235
|
+
declare const bundle: Converter<IBundle>;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Builder for creating resource bundles from a ResourceManagerBuilder.
|
|
239
|
+
* Handles the compilation, configuration extraction, and integrity verification
|
|
240
|
+
* needed to create a complete, portable bundle.
|
|
241
|
+
* @public
|
|
242
|
+
*/
|
|
243
|
+
export declare class BundleBuilder {
|
|
244
|
+
/**
|
|
245
|
+
* Creates a resource bundle from a ResourceManagerBuilder.
|
|
246
|
+
* @param builder - The ResourceManagerBuilder containing the resources to bundle
|
|
247
|
+
* @param systemConfig - The SystemConfiguration used to create the builder
|
|
248
|
+
* @param params - Optional parameters for bundle creation
|
|
249
|
+
* @returns Success with the created bundle if successful, Failure with error message otherwise
|
|
250
|
+
* @public
|
|
251
|
+
*/
|
|
252
|
+
static create(builder: ResourceManagerBuilder, systemConfig: SystemConfiguration, params?: IBundleCreateParams): Result<IBundle>;
|
|
253
|
+
/**
|
|
254
|
+
* Creates a resource bundle from a ResourceManagerBuilder using a predefined system configuration.
|
|
255
|
+
* This is a convenience method for the common case of using predefined configurations.
|
|
256
|
+
* @param builder - The ResourceManagerBuilder containing the resources to bundle
|
|
257
|
+
* @param configName - The name of the predefined system configuration used
|
|
258
|
+
* @param params - Optional parameters for bundle creation
|
|
259
|
+
* @returns Success with the created bundle if successful, Failure with error message otherwise
|
|
260
|
+
* @public
|
|
261
|
+
*/
|
|
262
|
+
static createFromPredefined(builder: ResourceManagerBuilder, configName: PredefinedSystemConfiguration, params?: IBundleCreateParams): Result<IBundle>;
|
|
263
|
+
/**
|
|
264
|
+
* Generates a hash checksum for the compiled resource collection.
|
|
265
|
+
* The checksum is calculated using the provided hash normalizer.
|
|
266
|
+
* @param compiledCollection - The compiled resource collection to generate checksum for
|
|
267
|
+
* @param hashNormalizer - The hash normalizer to use for checksum generation
|
|
268
|
+
* @returns Success with the checksum string if successful, Failure otherwise
|
|
269
|
+
* @internal
|
|
270
|
+
*/
|
|
271
|
+
private static _generateChecksum;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* `Converter` for {@link Bundle.IBundleCreateParams | bundle creation parameters}.
|
|
276
|
+
* @public
|
|
277
|
+
*/
|
|
278
|
+
declare const bundleCreateParams: Converter<IBundleCreateParams>;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* `Converter` for {@link Bundle.IBundleExportMetadata | bundle export metadata}.
|
|
282
|
+
* @public
|
|
283
|
+
*/
|
|
284
|
+
declare const bundleExportMetadata: Converter<IBundleExportMetadata>;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Loader for creating an IResourceManager from a resource bundle.
|
|
288
|
+
* Handles integrity verification and reconstruction of the runtime resource manager.
|
|
289
|
+
* @public
|
|
290
|
+
*/
|
|
291
|
+
export declare class BundleLoader {
|
|
292
|
+
/**
|
|
293
|
+
* Creates an IResourceManager from a resource bundle.
|
|
294
|
+
* @param params - Parameters for bundle loading including the bundle and options
|
|
295
|
+
* @returns Success with the IResourceManager if successful, Failure with error message otherwise
|
|
296
|
+
* @public
|
|
297
|
+
*/
|
|
298
|
+
static createManagerFromBundle(params: IBundleLoaderCreateParams): Result<IResourceManager>;
|
|
299
|
+
/**
|
|
300
|
+
* Verifies the integrity of a bundle by checking its checksum.
|
|
301
|
+
* @param bundle - The bundle to verify
|
|
302
|
+
* @param skipVerification - Whether to skip verification
|
|
303
|
+
* @param hashNormalizer - The hash normalizer to use for verification
|
|
304
|
+
* @returns Success if verification passes or is skipped, Failure otherwise
|
|
305
|
+
* @internal
|
|
306
|
+
*/
|
|
307
|
+
private static _verifyBundleIntegrity;
|
|
308
|
+
/**
|
|
309
|
+
* Generates a hash checksum for the compiled resource collection.
|
|
310
|
+
* @param compiledCollection - The compiled resource collection to generate checksum for
|
|
311
|
+
* @param hashNormalizer - The hash normalizer to use for checksum generation
|
|
312
|
+
* @returns Success with the checksum string if successful, Failure otherwise
|
|
313
|
+
* @internal
|
|
314
|
+
*/
|
|
315
|
+
private static _generateChecksum;
|
|
316
|
+
/**
|
|
317
|
+
* Creates a SystemConfiguration from the bundle's configuration.
|
|
318
|
+
* @param bundle - The bundle containing the configuration
|
|
319
|
+
* @returns Success with the SystemConfiguration if successful, Failure otherwise
|
|
320
|
+
* @internal
|
|
321
|
+
*/
|
|
322
|
+
private static _createSystemConfiguration;
|
|
323
|
+
/**
|
|
324
|
+
* Creates a CompiledResourceCollection from the bundle.
|
|
325
|
+
* @param bundle - The bundle to load
|
|
326
|
+
* @param qualifierTypes - The qualifier type collector from the system configuration
|
|
327
|
+
* @param resourceTypes - The resource type collector from the system configuration
|
|
328
|
+
* @returns Success with the CompiledResourceCollection if successful, Failure otherwise
|
|
329
|
+
* @internal
|
|
330
|
+
*/
|
|
331
|
+
private static _createCompiledResourceCollection;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* `Converter` for a {@link Bundle.IBundleMetadata | bundle metadata} object.
|
|
336
|
+
* @public
|
|
337
|
+
*/
|
|
338
|
+
declare const bundleMetadata: Converter<IBundleMetadata>;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Normalizes ResourceManagerBuilder instances to ensure consistent ordering
|
|
342
|
+
* of internal entities, enabling order-independent bundle checksums.
|
|
343
|
+
*
|
|
344
|
+
* The normalization process rebuilds the ResourceManagerBuilder from the ground up
|
|
345
|
+
* in a canonical order to ensure identical index assignments regardless of
|
|
346
|
+
* original construction order.
|
|
347
|
+
* @public
|
|
348
|
+
*/
|
|
349
|
+
declare class BundleNormalizer {
|
|
350
|
+
/**
|
|
351
|
+
* Creates a normalized ResourceManagerBuilder from an existing builder.
|
|
352
|
+
* The normalized builder will have identical entities but arranged in
|
|
353
|
+
* canonical order to ensure consistent index assignments.
|
|
354
|
+
*
|
|
355
|
+
* @param originalBuilder - The ResourceManagerBuilder to normalize
|
|
356
|
+
* @param systemConfig - The SystemConfiguration used to create the original builder
|
|
357
|
+
* @returns Success with the normalized ResourceManagerBuilder if successful, Failure otherwise
|
|
358
|
+
*/
|
|
359
|
+
static normalize(originalBuilder: ResourceManagerBuilder, systemConfig: SystemConfiguration): Result<ResourceManagerBuilder>;
|
|
360
|
+
/**
|
|
361
|
+
* Creates a normalized ResourceManagerBuilder using a predefined system configuration.
|
|
362
|
+
* This is a convenience method for the common case of using predefined configurations.
|
|
363
|
+
*
|
|
364
|
+
* @param originalBuilder - The ResourceManagerBuilder to normalize
|
|
365
|
+
* @param configName - The name of the predefined system configuration used
|
|
366
|
+
* @returns Success with the normalized ResourceManagerBuilder if successful, Failure otherwise
|
|
367
|
+
*/
|
|
368
|
+
static normalizeFromPredefined(originalBuilder: ResourceManagerBuilder, configName: PredefinedSystemConfiguration): Result<ResourceManagerBuilder>;
|
|
369
|
+
/**
|
|
370
|
+
* Normalizes all conditions from the original builder by adding them to the
|
|
371
|
+
* normalized builder in sorted order using loose condition declarations.
|
|
372
|
+
*
|
|
373
|
+
* @param originalBuilder - The source ResourceManagerBuilder
|
|
374
|
+
* @param normalizedBuilder - The target normalized ResourceManagerBuilder
|
|
375
|
+
* @returns Success if all conditions were normalized successfully, Failure otherwise
|
|
376
|
+
* @internal
|
|
377
|
+
*/
|
|
378
|
+
private static _normalizeConditions;
|
|
379
|
+
/**
|
|
380
|
+
* Normalizes all condition sets from the original builder by adding them to the
|
|
381
|
+
* normalized builder in sorted order using loose condition set declarations.
|
|
382
|
+
*
|
|
383
|
+
* @param originalBuilder - The source ResourceManagerBuilder
|
|
384
|
+
* @param normalizedBuilder - The target normalized ResourceManagerBuilder
|
|
385
|
+
* @returns Success if all condition sets were normalized successfully, Failure otherwise
|
|
386
|
+
* @internal
|
|
387
|
+
*/
|
|
388
|
+
private static _normalizeConditionSets;
|
|
389
|
+
/**
|
|
390
|
+
* Normalizes all candidates by sorting them first by resource ID, then by condition set.
|
|
391
|
+
*
|
|
392
|
+
* @param originalBuilder - The source ResourceManagerBuilder
|
|
393
|
+
* @param normalizedBuilder - The target normalized ResourceManagerBuilder
|
|
394
|
+
* @returns Success if all candidates were normalized successfully, Failure otherwise
|
|
395
|
+
* @internal
|
|
396
|
+
*/
|
|
397
|
+
private static _normalizeCandidates;
|
|
398
|
+
/**
|
|
399
|
+
* Adds normalized resources to the target builder by first normalizing conditions,
|
|
400
|
+
* then condition sets, then candidates.
|
|
401
|
+
*
|
|
402
|
+
* @param originalBuilder - The source ResourceManagerBuilder
|
|
403
|
+
* @param normalizedBuilder - The target normalized ResourceManagerBuilder
|
|
404
|
+
* @returns Success if all resources were added successfully, Failure otherwise
|
|
405
|
+
* @internal
|
|
406
|
+
*/
|
|
407
|
+
private static _addNormalizedResources;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Lightweight converter for bundle structure validation without full processing.
|
|
412
|
+
* Useful for detecting bundle files without the overhead of full validation.
|
|
413
|
+
* @public
|
|
414
|
+
*/
|
|
415
|
+
declare const bundleStructure: Converter<{
|
|
416
|
+
metadata: IBundleMetadata;
|
|
417
|
+
config: unknown;
|
|
418
|
+
compiledCollection: unknown;
|
|
419
|
+
}>;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Utility functions for working with resource bundles.
|
|
423
|
+
* Provides reusable logic for bundle detection, parsing, and component extraction.
|
|
424
|
+
* @public
|
|
425
|
+
*/
|
|
426
|
+
declare class BundleUtils {
|
|
427
|
+
/**
|
|
428
|
+
* Checks if the given object appears to be a bundle file by examining its structure.
|
|
429
|
+
* This is a lightweight check that doesn't perform full validation.
|
|
430
|
+
* @param data - The data to check
|
|
431
|
+
* @returns True if the data appears to be a bundle structure
|
|
432
|
+
* @public
|
|
433
|
+
*/
|
|
434
|
+
static isBundleFile(data: unknown): boolean;
|
|
435
|
+
/**
|
|
436
|
+
* Extracts and validates components from a bundle for reuse.
|
|
437
|
+
* Performs full validation of the bundle structure and creates typed components.
|
|
438
|
+
* @param bundleData - The raw bundle data to extract components from
|
|
439
|
+
* @returns Success with bundle components if valid, Failure with error message otherwise
|
|
440
|
+
* @public
|
|
441
|
+
*/
|
|
442
|
+
static extractBundleComponents(bundleData: unknown): Result<IBundleComponents>;
|
|
443
|
+
/**
|
|
444
|
+
* Extracts just the metadata from potential bundle data without full validation.
|
|
445
|
+
* Useful for displaying bundle information without processing the entire bundle.
|
|
446
|
+
* @param data - The data to extract metadata from
|
|
447
|
+
* @returns Success with metadata if found and valid, Failure otherwise
|
|
448
|
+
* @public
|
|
449
|
+
*/
|
|
450
|
+
static extractBundleMetadata(data: unknown): Result<IBundleMetadata>;
|
|
451
|
+
/**
|
|
452
|
+
* Parses bundle data from a JSON string.
|
|
453
|
+
* Convenience method that combines JSON parsing with bundle component extraction.
|
|
454
|
+
* @param jsonString - The JSON string containing bundle data
|
|
455
|
+
* @returns Success with bundle components if valid, Failure with error message otherwise
|
|
456
|
+
* @public
|
|
457
|
+
*/
|
|
458
|
+
static parseBundleFromJson(jsonString: string): Result<IBundleComponents>;
|
|
459
|
+
/**
|
|
460
|
+
* Checks if a file name suggests it might be a bundle file.
|
|
461
|
+
* This is a heuristic check based on file naming conventions.
|
|
462
|
+
* @param fileName - The file name to check
|
|
463
|
+
* @returns True if the file name suggests a bundle file
|
|
464
|
+
* @public
|
|
465
|
+
*/
|
|
466
|
+
static isBundleFileName(fileName: string): boolean;
|
|
467
|
+
}
|
|
468
|
+
|
|
181
469
|
/**
|
|
182
470
|
* Simple implementation of {@link Decisions.ICandidate | ICandidate} with
|
|
183
471
|
* helper methods for sorting and presentation.
|
|
@@ -227,6 +515,15 @@ declare class Candidate<TVALUE extends JsonValue = JsonValue> implements ICandid
|
|
|
227
515
|
*/
|
|
228
516
|
declare type CandidateAction = 'unchanged' | 'reduced' | 'suppressed';
|
|
229
517
|
|
|
518
|
+
/**
|
|
519
|
+
* The completeness of a resource candidate value. A full value is one that
|
|
520
|
+
* contains all of the required properties for the resource type. A partial
|
|
521
|
+
* value is one that contains some of the required properties for the resource
|
|
522
|
+
* type.
|
|
523
|
+
* @public
|
|
524
|
+
*/
|
|
525
|
+
export declare type CandidateCompleteness = 'full' | 'partial';
|
|
526
|
+
|
|
230
527
|
/**
|
|
231
528
|
* Manages candidate reduction logic for filtering and qualifier reduction operations.
|
|
232
529
|
* Encapsulates the state and logic needed to consistently process candidates for reduction.
|
|
@@ -292,6 +589,139 @@ declare class CandidateReducer {
|
|
|
292
589
|
reduceCandidate(candidate: ResourceCandidate): Result<IReducedCandidate | undefined>;
|
|
293
590
|
}
|
|
294
591
|
|
|
592
|
+
/**
|
|
593
|
+
* Implementation of a candidate value that stores normalized JSON data.
|
|
594
|
+
* The value is normalized on creation and a hash-based key is generated
|
|
595
|
+
* for efficient deduplication.
|
|
596
|
+
* @public
|
|
597
|
+
*/
|
|
598
|
+
declare class CandidateValue implements ICandidateValue {
|
|
599
|
+
private readonly _collectible;
|
|
600
|
+
private readonly _json;
|
|
601
|
+
/**
|
|
602
|
+
* The unique key for this candidate value.
|
|
603
|
+
*/
|
|
604
|
+
get key(): CandidateValueKey;
|
|
605
|
+
/**
|
|
606
|
+
* The index of this candidate value in the collection.
|
|
607
|
+
*/
|
|
608
|
+
get index(): CandidateValueIndex | undefined;
|
|
609
|
+
/**
|
|
610
|
+
* The normalized JSON value.
|
|
611
|
+
*/
|
|
612
|
+
get json(): JsonValue;
|
|
613
|
+
/**
|
|
614
|
+
* Constructor for a {@link Resources.CandidateValue} object.
|
|
615
|
+
* @param params - Parameters to create the candidate value.
|
|
616
|
+
* @internal
|
|
617
|
+
*/
|
|
618
|
+
protected constructor(params: ICandidateValueCreateParams);
|
|
619
|
+
/**
|
|
620
|
+
* Creates a new {@link Resources.CandidateValue} object.
|
|
621
|
+
* @param params - Parameters to create the candidate value.
|
|
622
|
+
* @returns `Success` with the new candidate value if successful,
|
|
623
|
+
* or `Failure` with an error message if not.
|
|
624
|
+
* @public
|
|
625
|
+
*/
|
|
626
|
+
static create(params: ICandidateValueCreateParams): Result<CandidateValue>;
|
|
627
|
+
/**
|
|
628
|
+
* Sets the index of this candidate value.
|
|
629
|
+
* @param index - The index to set.
|
|
630
|
+
* @returns `Success` with the index if successful, or `Failure` with an error message if not.
|
|
631
|
+
* @public
|
|
632
|
+
*/
|
|
633
|
+
setIndex(index: number): Result<CandidateValueIndex>;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* A `ValidatingCollector` for {@link Resources.CandidateValue | CandidateValues},
|
|
638
|
+
* which collects candidate values supplied as either {@link Resources.CandidateValue | CandidateValue} or
|
|
639
|
+
* `JsonValue`.
|
|
640
|
+
* @public
|
|
641
|
+
*/
|
|
642
|
+
declare class CandidateValueCollector extends ValidatingCollector<CandidateValue> {
|
|
643
|
+
readonly normalizer: Hash.HashingNormalizer;
|
|
644
|
+
/**
|
|
645
|
+
* Constructor for a {@link Resources.CandidateValueCollector} object.
|
|
646
|
+
* @param params - Parameters to create the collector.
|
|
647
|
+
* @internal
|
|
648
|
+
*/
|
|
649
|
+
protected constructor(params?: ICandidateValueCollectorCreateParams);
|
|
650
|
+
/**
|
|
651
|
+
* Creates a new {@link Resources.CandidateValueCollector} object.
|
|
652
|
+
* @param params - Parameters to create the collector.
|
|
653
|
+
* @returns `Success` with the new collector if successful,
|
|
654
|
+
* or `Failure` with an error message if not.
|
|
655
|
+
* @public
|
|
656
|
+
*/
|
|
657
|
+
static create(params?: ICandidateValueCollectorCreateParams): Result<CandidateValueCollector>;
|
|
658
|
+
/**
|
|
659
|
+
* Returns an array of JSON values ordered by their indices.
|
|
660
|
+
* @returns Array of JsonValue objects in index order.
|
|
661
|
+
* @public
|
|
662
|
+
*/
|
|
663
|
+
getValuesByIndex(): JsonValue[];
|
|
664
|
+
/**
|
|
665
|
+
* Converter method to handle CandidateValue | JsonValue.
|
|
666
|
+
* @param from - The value to convert.
|
|
667
|
+
* @returns `Success` with the CandidateValue if successful, or `Failure` with an error message if not.
|
|
668
|
+
* @internal
|
|
669
|
+
*/
|
|
670
|
+
private _toCandidateValue;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Branded number representing a validated candidate value index.
|
|
675
|
+
* Candidate value indices are used to identify candidate values
|
|
676
|
+
* within a resource set and to enable sharing of like values.
|
|
677
|
+
* @public
|
|
678
|
+
*/
|
|
679
|
+
export declare type CandidateValueIndex = Brand<number, 'CandidateValueIndex'>;
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* `Converter` which validates an `unknown` value as a {@link CandidateValueIndex | CandidateValueIndex}.
|
|
683
|
+
* @public
|
|
684
|
+
*/
|
|
685
|
+
declare const candidateValueIndex: Converter<CandidateValueIndex, unknown>;
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Branded string representing a validated candidate value key.
|
|
689
|
+
* Candidate value keys are used to identify candidate values
|
|
690
|
+
* within a resource set and to enable sharing of like values.
|
|
691
|
+
* @public
|
|
692
|
+
*/
|
|
693
|
+
export declare type CandidateValueKey = Brand<string, 'CandidateValueKey'>;
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* `Converter` which validates an `unknown` value as a {@link CandidateValueKey | CandidateValueKey}.
|
|
697
|
+
* @public
|
|
698
|
+
*/
|
|
699
|
+
declare const candidateValueKey: Converter<CandidateValueKey, unknown>;
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* @internal
|
|
703
|
+
*/
|
|
704
|
+
declare const candidateValueKey_2: RegExp;
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* A factory that chains multiple factories together.
|
|
708
|
+
* @public
|
|
709
|
+
*/
|
|
710
|
+
declare class ChainedConfigInitFactory<TConfig, T> implements IConfigInitFactory<TConfig, T> {
|
|
711
|
+
readonly factories: IConfigInitFactory<TConfig, T>[];
|
|
712
|
+
/**
|
|
713
|
+
* Constructor for a chained config init factory.
|
|
714
|
+
* @param factories - The factories to chain.
|
|
715
|
+
*/
|
|
716
|
+
constructor(factories: IConfigInitFactory<TConfig, T>[]);
|
|
717
|
+
/**
|
|
718
|
+
* Creates a new instance of a configuration object.
|
|
719
|
+
* @param config - The configuration object to create.
|
|
720
|
+
* @returns A result containing the new instance of the configuration object.
|
|
721
|
+
*/
|
|
722
|
+
create(config: TConfig): Result<T>;
|
|
723
|
+
}
|
|
724
|
+
|
|
295
725
|
/**
|
|
296
726
|
* `Converter` for a normalized {@link ResourceJson.Json.IChildConditionDecl | child condition declaration}.
|
|
297
727
|
* @public
|
|
@@ -402,13 +832,17 @@ declare namespace Common {
|
|
|
402
832
|
ResourceTypeName,
|
|
403
833
|
ResourceTypeIndex,
|
|
404
834
|
ResourceValueMergeMethod,
|
|
405
|
-
allResourceValueMergeMethods
|
|
835
|
+
allResourceValueMergeMethods,
|
|
836
|
+
CandidateCompleteness,
|
|
837
|
+
CandidateValueIndex,
|
|
838
|
+
CandidateValueKey,
|
|
839
|
+
IResourceResolver
|
|
406
840
|
}
|
|
407
841
|
}
|
|
408
842
|
|
|
409
843
|
declare namespace Compiled {
|
|
410
844
|
export {
|
|
411
|
-
|
|
845
|
+
Convert_6 as Convert,
|
|
412
846
|
ICompiledResourceOptions,
|
|
413
847
|
ICompiledConditionMetadata,
|
|
414
848
|
ICompiledConditionSetMetadata,
|
|
@@ -429,61 +863,61 @@ declare namespace Compiled {
|
|
|
429
863
|
* Converter for a {@link ResourceJson.Compiled.ICompiledAbstractDecision | compiled abstract decision}.
|
|
430
864
|
* @public
|
|
431
865
|
*/
|
|
432
|
-
declare const compiledAbstractDecision: ObjectConverter<
|
|
866
|
+
declare const compiledAbstractDecision: ObjectConverter<Model_3.ICompiledAbstractDecision, unknown>;
|
|
433
867
|
|
|
434
868
|
/**
|
|
435
869
|
* Converter for a {@link ResourceJson.Compiled.ICompiledCandidate | compiled candidate}.
|
|
436
870
|
* @public
|
|
437
871
|
*/
|
|
438
|
-
declare const compiledCandidate: ObjectConverter<
|
|
872
|
+
declare const compiledCandidate: ObjectConverter<Model_3.ICompiledCandidate, unknown>;
|
|
439
873
|
|
|
440
874
|
/**
|
|
441
875
|
* Converter for a {@link ResourceJson.Compiled.ICompiledCondition | compiled condition}.
|
|
442
876
|
* @public
|
|
443
877
|
*/
|
|
444
|
-
declare const compiledCondition: ObjectConverter<
|
|
878
|
+
declare const compiledCondition: ObjectConverter<Model_3.ICompiledCondition, unknown>;
|
|
445
879
|
|
|
446
880
|
/**
|
|
447
881
|
* Converter for a {@link ResourceJson.Compiled.ICompiledConditionMetadata | compiled condition metadata}.
|
|
448
882
|
* @public
|
|
449
883
|
*/
|
|
450
|
-
declare const compiledConditionMetadata: ObjectConverter<
|
|
884
|
+
declare const compiledConditionMetadata: ObjectConverter<Model_3.ICompiledConditionMetadata, unknown>;
|
|
451
885
|
|
|
452
886
|
/**
|
|
453
887
|
* Converter for a {@link ResourceJson.Compiled.ICompiledConditionSet | compiled condition set}.
|
|
454
888
|
* @public
|
|
455
889
|
*/
|
|
456
|
-
declare const compiledConditionSet: ObjectConverter<
|
|
890
|
+
declare const compiledConditionSet: ObjectConverter<Model_3.ICompiledConditionSet, unknown>;
|
|
457
891
|
|
|
458
892
|
/**
|
|
459
893
|
* Converter for a {@link ResourceJson.Compiled.ICompiledConditionSetMetadata | compiled condition set metadata}.
|
|
460
894
|
* @public
|
|
461
895
|
*/
|
|
462
|
-
declare const compiledConditionSetMetadata: ObjectConverter<
|
|
896
|
+
declare const compiledConditionSetMetadata: ObjectConverter<Model_3.ICompiledConditionSetMetadata, unknown>;
|
|
463
897
|
|
|
464
898
|
/**
|
|
465
899
|
* Converter for a {@link ResourceJson.Compiled.ICompiledDecisionMetadata | compiled decision metadata}.
|
|
466
900
|
* @public
|
|
467
901
|
*/
|
|
468
|
-
declare const compiledDecisionMetadata: ObjectConverter<
|
|
902
|
+
declare const compiledDecisionMetadata: ObjectConverter<Model_3.ICompiledDecisionMetadata, unknown>;
|
|
469
903
|
|
|
470
904
|
/**
|
|
471
905
|
* Converter for a {@link ResourceJson.Compiled.ICompiledQualifier | compiled qualifier}.
|
|
472
906
|
* @public
|
|
473
907
|
*/
|
|
474
|
-
declare const compiledQualifier: ObjectConverter<
|
|
908
|
+
declare const compiledQualifier: ObjectConverter<Model_3.ICompiledQualifier, unknown>;
|
|
475
909
|
|
|
476
910
|
/**
|
|
477
911
|
* Converter for a {@link ResourceJson.Compiled.ICompiledQualifierType | compiled qualifier type}.
|
|
478
912
|
* @public
|
|
479
913
|
*/
|
|
480
|
-
declare const compiledQualifierType: ObjectConverter<
|
|
914
|
+
declare const compiledQualifierType: ObjectConverter<Model_3.ICompiledQualifierType, unknown>;
|
|
481
915
|
|
|
482
916
|
/**
|
|
483
917
|
* Converter for a {@link ResourceJson.Compiled.ICompiledResource | compiled resource}.
|
|
484
918
|
* @public
|
|
485
919
|
*/
|
|
486
|
-
declare const compiledResource: ObjectConverter<
|
|
920
|
+
declare const compiledResource: ObjectConverter<Model_3.ICompiledResource, unknown>;
|
|
487
921
|
|
|
488
922
|
/**
|
|
489
923
|
* A compiled resource collection implements {@link Runtime.IResourceManager | IResourceManager}
|
|
@@ -491,30 +925,35 @@ declare const compiledResource: ObjectConverter<Model.ICompiledResource, unknown
|
|
|
491
925
|
* and use pre-compiled resource collections without rebuilding them from scratch.
|
|
492
926
|
* @public
|
|
493
927
|
*/
|
|
494
|
-
declare class CompiledResourceCollection implements IResourceManager {
|
|
928
|
+
declare class CompiledResourceCollection implements IResourceManager<IResource> {
|
|
495
929
|
readonly conditions: ReadOnlyConditionCollector;
|
|
496
930
|
readonly conditionSets: ReadOnlyConditionSetCollector;
|
|
497
931
|
readonly decisions: ReadOnlyAbstractDecisionCollector;
|
|
498
932
|
private readonly _qualifierTypes;
|
|
499
933
|
private readonly _qualifiers;
|
|
500
934
|
private readonly _resourceTypes;
|
|
935
|
+
private readonly _candidateValues;
|
|
501
936
|
private readonly _builtResources;
|
|
502
937
|
private _cachedResourceTree?;
|
|
503
938
|
/**
|
|
504
|
-
* A {@link QualifierTypes.
|
|
939
|
+
* A {@link QualifierTypes.ReadOnlyQualifierTypeCollector | ReadOnlyQualifierTypeCollector} which
|
|
505
940
|
* contains the {@link QualifierTypes.QualifierType | qualifier types} used in this collection.
|
|
506
941
|
*/
|
|
507
|
-
get qualifierTypes():
|
|
942
|
+
get qualifierTypes(): ReadOnlyQualifierTypeCollector;
|
|
508
943
|
/**
|
|
509
|
-
* A {@link Qualifiers.
|
|
944
|
+
* A {@link Qualifiers.IReadOnlyQualifierCollector | ReadOnlyQualifierCollector} which
|
|
510
945
|
* contains the {@link Qualifiers.Qualifier | qualifiers} used in this collection.
|
|
511
946
|
*/
|
|
512
|
-
get qualifiers():
|
|
947
|
+
get qualifiers(): IReadOnlyQualifierCollector;
|
|
513
948
|
/**
|
|
514
949
|
* A {@link ResourceTypes.ResourceTypeCollector | ResourceTypeCollector} which
|
|
515
950
|
* contains the {@link ResourceTypes.ResourceType | resource types} used in this collection.
|
|
516
951
|
*/
|
|
517
|
-
get resourceTypes():
|
|
952
|
+
get resourceTypes(): ReadOnlyResourceTypeCollector;
|
|
953
|
+
/**
|
|
954
|
+
* The candidate values in the collection.
|
|
955
|
+
*/
|
|
956
|
+
get candidateValues(): ReadonlyArray<JsonValue>;
|
|
518
957
|
/**
|
|
519
958
|
* {@inheritdoc Runtime.IResourceManager.builtResources}
|
|
520
959
|
*/
|
|
@@ -563,7 +1002,7 @@ declare class CompiledResourceCollection implements IResourceManager {
|
|
|
563
1002
|
* @returns Result containing the resource tree root, or failure if tree construction fails
|
|
564
1003
|
* @public
|
|
565
1004
|
*/
|
|
566
|
-
getBuiltResourceTree(): Result<
|
|
1005
|
+
getBuiltResourceTree(): Result<ReadOnlyResourceTreeRoot<IResource>>;
|
|
567
1006
|
/**
|
|
568
1007
|
* Reconstructs a QualifierTypeCollector from compiled data.
|
|
569
1008
|
* @param compiled - The compiled resource collection
|
|
@@ -612,6 +1051,12 @@ declare class CompiledResourceCollection implements IResourceManager {
|
|
|
612
1051
|
* @internal
|
|
613
1052
|
*/
|
|
614
1053
|
private _buildDecisions;
|
|
1054
|
+
/**
|
|
1055
|
+
* Gets a candidate value from the collection.
|
|
1056
|
+
* @param valueIndex - The index of the candidate value to get.
|
|
1057
|
+
* @returns
|
|
1058
|
+
*/
|
|
1059
|
+
private _getCandidateValue;
|
|
615
1060
|
/**
|
|
616
1061
|
* Reconstructs a ValidatingResultMap of resources from compiled data.
|
|
617
1062
|
* @param compiled - The compiled resource collection
|
|
@@ -628,13 +1073,13 @@ declare class CompiledResourceCollection implements IResourceManager {
|
|
|
628
1073
|
* This combines all the individual converters into a single converter for the entire resource collection.
|
|
629
1074
|
* @public
|
|
630
1075
|
*/
|
|
631
|
-
declare const compiledResourceCollection: ObjectConverter<
|
|
1076
|
+
declare const compiledResourceCollection: ObjectConverter<Model_3.ICompiledResourceCollection, unknown>;
|
|
632
1077
|
|
|
633
1078
|
/**
|
|
634
1079
|
* Converter for a {@link ResourceJson.Compiled.ICompiledResourceType | compiled resource type}.
|
|
635
1080
|
* @public
|
|
636
1081
|
*/
|
|
637
|
-
declare const compiledResourceType: ObjectConverter<
|
|
1082
|
+
declare const compiledResourceType: ObjectConverter<Model_3.ICompiledResourceType, unknown>;
|
|
638
1083
|
|
|
639
1084
|
/**
|
|
640
1085
|
* A {@link Decisions.ConcreteDecision | concrete decision} is a {@link Decisions.IDecision | decision}
|
|
@@ -685,7 +1130,7 @@ declare class ConcreteDecision<TVALUE extends JsonValue = JsonValue> implements
|
|
|
685
1130
|
* Represents a single condition applied to some resource instance.
|
|
686
1131
|
* @public
|
|
687
1132
|
*/
|
|
688
|
-
declare class Condition implements IValidatedConditionDecl {
|
|
1133
|
+
export declare class Condition implements IValidatedConditionDecl {
|
|
689
1134
|
/**
|
|
690
1135
|
* The {@link Qualifiers.Qualifier | qualifier} used in this condition.
|
|
691
1136
|
*/
|
|
@@ -932,7 +1377,7 @@ declare const conditionPriority: Converter<ConditionPriority, unknown>;
|
|
|
932
1377
|
|
|
933
1378
|
declare namespace Conditions {
|
|
934
1379
|
export {
|
|
935
|
-
|
|
1380
|
+
Convert_11 as Convert,
|
|
936
1381
|
Condition,
|
|
937
1382
|
IConditionCollectorCreateParams,
|
|
938
1383
|
ConditionCollector,
|
|
@@ -956,7 +1401,7 @@ export { Conditions }
|
|
|
956
1401
|
* context for a resource instance to be valid.
|
|
957
1402
|
* @public
|
|
958
1403
|
*/
|
|
959
|
-
declare class ConditionSet implements IValidatedConditionSetDecl {
|
|
1404
|
+
export declare class ConditionSet implements IValidatedConditionSetDecl {
|
|
960
1405
|
protected readonly _collectible: Collections.Collectible<ConditionSetKey, ConditionSetIndex>;
|
|
961
1406
|
/**
|
|
962
1407
|
* The {@link Conditions.Condition | conditions} that make up this condition
|
|
@@ -1026,6 +1471,14 @@ declare class ConditionSet implements IValidatedConditionSetDecl {
|
|
|
1026
1471
|
* @public
|
|
1027
1472
|
*/
|
|
1028
1473
|
static getKeyForDecl(decl: IValidatedConditionSetDecl): Result<ConditionSetKey>;
|
|
1474
|
+
/**
|
|
1475
|
+
* Gets a condition set key from a loose condition set declaration.
|
|
1476
|
+
* @param conditionSet - The loose condition set declaration to convert.
|
|
1477
|
+
* @param conditionCollector - The condition collector used for validation.
|
|
1478
|
+
* @returns `Success` with the condition set key if successful, `Failure` otherwise.
|
|
1479
|
+
* @public
|
|
1480
|
+
*/
|
|
1481
|
+
static getKeyFromLooseDecl(conditionSet: ResourceJson.Json.ConditionSetDecl | undefined, conditionCollector: ConditionCollector): Result<ConditionSetKey>;
|
|
1029
1482
|
/**
|
|
1030
1483
|
* Gets a {@link ConditionSetToken | condition set token} for this condition set,
|
|
1031
1484
|
* if possible.
|
|
@@ -1120,10 +1573,10 @@ declare class ConditionSetCollector extends ValidatingCollector<ConditionSet> {
|
|
|
1120
1573
|
declare type ConditionSetDecl = ConditionSetDeclAsArray | ConditionSetDeclAsRecord;
|
|
1121
1574
|
|
|
1122
1575
|
/**
|
|
1123
|
-
* Converter
|
|
1576
|
+
* `Converter` for a normalized {@link ResourceJson.Normalized.ConditionSetDecl | condition set declaration}.
|
|
1124
1577
|
* @public
|
|
1125
1578
|
*/
|
|
1126
|
-
declare const conditionSetDecl:
|
|
1579
|
+
declare const conditionSetDecl: Converter<Normalized.ConditionSetDecl>;
|
|
1127
1580
|
|
|
1128
1581
|
/**
|
|
1129
1582
|
* Normalized non-validated declaration of a {@link Conditions.Condition | condition}.
|
|
@@ -1132,10 +1585,10 @@ declare const conditionSetDecl: ObjectConverter<IConditionSetDecl, unknown>;
|
|
|
1132
1585
|
declare type ConditionSetDecl_2 = ReadonlyArray<ILooseConditionDecl>;
|
|
1133
1586
|
|
|
1134
1587
|
/**
|
|
1135
|
-
*
|
|
1588
|
+
* Converter which converts to a {@link Conditions.IConditionSetDecl | condition set declaration}.
|
|
1136
1589
|
* @public
|
|
1137
1590
|
*/
|
|
1138
|
-
declare const conditionSetDecl_2:
|
|
1591
|
+
declare const conditionSetDecl_2: ObjectConverter<IConditionSetDecl, unknown>;
|
|
1139
1592
|
|
|
1140
1593
|
/**
|
|
1141
1594
|
* Non-validated declaration of a {@link Conditions.Condition | condition}.
|
|
@@ -1373,8 +1826,20 @@ declare class ConditionTokens {
|
|
|
1373
1826
|
|
|
1374
1827
|
declare namespace Config {
|
|
1375
1828
|
export {
|
|
1376
|
-
|
|
1377
|
-
|
|
1829
|
+
Model,
|
|
1830
|
+
Convert_9 as Convert,
|
|
1831
|
+
createQualifierTypeFactory,
|
|
1832
|
+
createResourceTypeFactory,
|
|
1833
|
+
QualifierTypeFactoryFunction,
|
|
1834
|
+
ResourceTypeFactoryFunction,
|
|
1835
|
+
IConfigInitFactory,
|
|
1836
|
+
ChainedConfigInitFactory,
|
|
1837
|
+
BuiltInQualifierTypeFactory,
|
|
1838
|
+
QualifierTypeFactory,
|
|
1839
|
+
ValidatingQualifierTypeFactory,
|
|
1840
|
+
BuiltInResourceTypeFactory,
|
|
1841
|
+
ResourceTypeFactory,
|
|
1842
|
+
ValidatingResourceTypeFactory,
|
|
1378
1843
|
updateSystemConfigurationQualifierDefaultValues,
|
|
1379
1844
|
ISystemConfigurationInitParams,
|
|
1380
1845
|
SystemConfiguration,
|
|
@@ -1390,21 +1855,24 @@ export { Config }
|
|
|
1390
1855
|
|
|
1391
1856
|
declare namespace Config_2 {
|
|
1392
1857
|
export {
|
|
1393
|
-
|
|
1858
|
+
Convert_2 as Convert,
|
|
1859
|
+
isSystemQualifierTypeConfig,
|
|
1394
1860
|
IQualifierTypeConfig,
|
|
1395
1861
|
ILanguageQualifierTypeConfig,
|
|
1862
|
+
LiteralValueHierarchyDecl,
|
|
1396
1863
|
ITerritoryQualifierTypeConfig,
|
|
1397
1864
|
ILiteralQualifierTypeConfig,
|
|
1398
1865
|
ISystemLanguageQualifierTypeConfig,
|
|
1399
1866
|
ISystemTerritoryQualifierTypeConfig,
|
|
1400
1867
|
ISystemLiteralQualifierTypeConfig,
|
|
1401
|
-
ISystemQualifierTypeConfig
|
|
1868
|
+
ISystemQualifierTypeConfig,
|
|
1869
|
+
IAnyQualifierTypeConfig
|
|
1402
1870
|
}
|
|
1403
1871
|
}
|
|
1404
1872
|
|
|
1405
1873
|
declare namespace Config_3 {
|
|
1406
1874
|
export {
|
|
1407
|
-
|
|
1875
|
+
Convert_5 as Convert,
|
|
1408
1876
|
IResourceTypeConfig
|
|
1409
1877
|
}
|
|
1410
1878
|
}
|
|
@@ -1417,7 +1885,7 @@ declare const containerContextDecl: Converter<Normalized.IContainerContextDecl>;
|
|
|
1417
1885
|
|
|
1418
1886
|
declare namespace Context {
|
|
1419
1887
|
export {
|
|
1420
|
-
|
|
1888
|
+
Convert_8 as Convert,
|
|
1421
1889
|
IContextMatchOptions,
|
|
1422
1890
|
IContextQualifierValueDecl,
|
|
1423
1891
|
IContextDecl,
|
|
@@ -1749,6 +2217,8 @@ declare namespace Convert {
|
|
|
1749
2217
|
resourceIndex,
|
|
1750
2218
|
resourceTypeName,
|
|
1751
2219
|
resourceTypeIndex,
|
|
2220
|
+
candidateValueKey,
|
|
2221
|
+
candidateValueIndex,
|
|
1752
2222
|
resourceValueMergeMethod,
|
|
1753
2223
|
contextQualifierToken,
|
|
1754
2224
|
contextToken,
|
|
@@ -1760,44 +2230,100 @@ export { Convert }
|
|
|
1760
2230
|
|
|
1761
2231
|
declare namespace Convert_10 {
|
|
1762
2232
|
export {
|
|
1763
|
-
|
|
1764
|
-
|
|
2233
|
+
bundleMetadata,
|
|
2234
|
+
bundleExportMetadata,
|
|
2235
|
+
bundle,
|
|
2236
|
+
bundleCreateParams,
|
|
2237
|
+
bundleStructure
|
|
1765
2238
|
}
|
|
1766
2239
|
}
|
|
1767
2240
|
|
|
1768
|
-
declare namespace
|
|
2241
|
+
declare namespace Convert_11 {
|
|
1769
2242
|
export {
|
|
1770
2243
|
conditionDecl,
|
|
1771
2244
|
IConditionDeclConvertContext,
|
|
1772
2245
|
validatedConditionDecl,
|
|
1773
|
-
conditionSetDecl,
|
|
2246
|
+
conditionSetDecl_2 as conditionSetDecl,
|
|
1774
2247
|
IConditionSetDeclConvertContext,
|
|
1775
2248
|
validatedConditionSetDecl
|
|
1776
2249
|
}
|
|
1777
2250
|
}
|
|
1778
2251
|
|
|
2252
|
+
declare namespace Convert_12 {
|
|
2253
|
+
export {
|
|
2254
|
+
zipArchiveInputType,
|
|
2255
|
+
zipArchiveConfigType,
|
|
2256
|
+
zipArchiveInputInfo,
|
|
2257
|
+
zipArchiveConfigInfo,
|
|
2258
|
+
zipArchiveManifest,
|
|
2259
|
+
mimeType,
|
|
2260
|
+
importedFile,
|
|
2261
|
+
importedDirectory,
|
|
2262
|
+
systemConfiguration_2 as systemConfiguration
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
declare namespace Convert_2 {
|
|
2267
|
+
export {
|
|
2268
|
+
qualifierTypeConfig,
|
|
2269
|
+
languageQualifierTypeConfig,
|
|
2270
|
+
territoryQualifierTypeConfig,
|
|
2271
|
+
literalQualifierTypeConfig,
|
|
2272
|
+
systemLanguageQualifierTypeConfig,
|
|
2273
|
+
systemTerritoryQualifierTypeConfig,
|
|
2274
|
+
systemLiteralQualifierTypeConfig,
|
|
2275
|
+
systemQualifierTypeConfig,
|
|
2276
|
+
jsonQualifierTypeConfig,
|
|
2277
|
+
anyQualifierTypeConfig
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
|
|
1779
2281
|
declare namespace Convert_3 {
|
|
1780
2282
|
export {
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
compiledQualifierType,
|
|
1785
|
-
compiledQualifier,
|
|
1786
|
-
compiledResourceType,
|
|
1787
|
-
compiledCondition,
|
|
1788
|
-
compiledConditionSet,
|
|
1789
|
-
compiledAbstractDecision,
|
|
1790
|
-
compiledCandidate,
|
|
1791
|
-
compiledResource,
|
|
1792
|
-
compiledResourceCollection
|
|
2283
|
+
literalValueHierarchyCreateParams,
|
|
2284
|
+
IQualifierTypeConvertContext,
|
|
2285
|
+
qualifierType
|
|
1793
2286
|
}
|
|
1794
2287
|
}
|
|
1795
2288
|
|
|
1796
2289
|
declare namespace Convert_4 {
|
|
2290
|
+
export {
|
|
2291
|
+
qualifierDecl,
|
|
2292
|
+
IQualifierDeclConvertContext,
|
|
2293
|
+
validatedQualifierDecl,
|
|
2294
|
+
IQualifierConvertContext,
|
|
2295
|
+
qualifier
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
declare namespace Convert_5 {
|
|
2300
|
+
export {
|
|
2301
|
+
resourceTypeConfig
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
declare namespace Convert_6 {
|
|
2306
|
+
export {
|
|
2307
|
+
compiledConditionMetadata,
|
|
2308
|
+
compiledConditionSetMetadata,
|
|
2309
|
+
compiledDecisionMetadata,
|
|
2310
|
+
compiledQualifierType,
|
|
2311
|
+
compiledQualifier,
|
|
2312
|
+
compiledResourceType,
|
|
2313
|
+
compiledCondition,
|
|
2314
|
+
compiledConditionSet,
|
|
2315
|
+
compiledAbstractDecision,
|
|
2316
|
+
compiledCandidate,
|
|
2317
|
+
compiledResource,
|
|
2318
|
+
compiledResourceCollection
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
declare namespace Convert_7 {
|
|
1797
2323
|
export {
|
|
1798
2324
|
looseConditionDecl,
|
|
1799
2325
|
childConditionDecl,
|
|
1800
|
-
|
|
2326
|
+
conditionSetDecl,
|
|
1801
2327
|
looseResourceCandidateDecl,
|
|
1802
2328
|
importerResourceCandidateDecl,
|
|
1803
2329
|
childResourceCandidateDecl,
|
|
@@ -1811,7 +2337,7 @@ declare namespace Convert_4 {
|
|
|
1811
2337
|
}
|
|
1812
2338
|
}
|
|
1813
2339
|
|
|
1814
|
-
declare namespace
|
|
2340
|
+
declare namespace Convert_8 {
|
|
1815
2341
|
export {
|
|
1816
2342
|
contextQualifierValueDecl,
|
|
1817
2343
|
contextDecl,
|
|
@@ -1821,42 +2347,22 @@ declare namespace Convert_5 {
|
|
|
1821
2347
|
}
|
|
1822
2348
|
}
|
|
1823
2349
|
|
|
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
2350
|
declare namespace Convert_9 {
|
|
1855
2351
|
export {
|
|
1856
|
-
|
|
2352
|
+
validateSystemConfiguration,
|
|
2353
|
+
systemConfiguration,
|
|
2354
|
+
predefinedSystemConfiguration
|
|
1857
2355
|
}
|
|
1858
2356
|
}
|
|
1859
2357
|
|
|
2358
|
+
/**
|
|
2359
|
+
* Creates a {@link Config.IConfigInitFactory | IConfigInitFactory} from a factory function.
|
|
2360
|
+
* @param fn - The factory function to wrap.
|
|
2361
|
+
* @returns An `IConfigInitFactory` instance that delegates to the function.
|
|
2362
|
+
* @public
|
|
2363
|
+
*/
|
|
2364
|
+
declare function createQualifierTypeFactory<T extends QualifierType = QualifierType>(fn: QualifierTypeFactoryFunction<T>): IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T>;
|
|
2365
|
+
|
|
1860
2366
|
/**
|
|
1861
2367
|
* Creates a {@link QualifierTypes.QualifierType | QualifierType} from a configuration object.
|
|
1862
2368
|
* This factory function determines the appropriate qualifier type based on the systemType
|
|
@@ -1867,19 +2373,27 @@ declare namespace Convert_9 {
|
|
|
1867
2373
|
* if successful, `Failure` with an error message otherwise.
|
|
1868
2374
|
* @public
|
|
1869
2375
|
*/
|
|
1870
|
-
declare function createQualifierTypeFromConfig(typeConfig: Config_2.
|
|
2376
|
+
declare function createQualifierTypeFromConfig(typeConfig: Config_2.IAnyQualifierTypeConfig): Result<QualifierType>;
|
|
1871
2377
|
|
|
1872
2378
|
/**
|
|
1873
|
-
* Creates a {@link QualifierTypes.
|
|
2379
|
+
* Creates a {@link QualifierTypes.SystemQualifierType | SystemQualifierType} from a system configuration object.
|
|
1874
2380
|
* This factory function determines the appropriate qualifier type based on the systemType
|
|
1875
2381
|
* and delegates to the appropriate type-specific createFromConfig method.
|
|
1876
2382
|
* @param typeConfig - The {@link QualifierTypes.Config.ISystemQualifierTypeConfig | configuration object}
|
|
1877
2383
|
* containing the name, systemType, and optional type-specific configuration.
|
|
1878
|
-
* @returns `Success` with the new {@link QualifierTypes.
|
|
2384
|
+
* @returns `Success` with the new {@link QualifierTypes.SystemQualifierType | SystemQualifierType}
|
|
1879
2385
|
* if successful, `Failure` with an error message otherwise.
|
|
1880
2386
|
* @public
|
|
1881
2387
|
*/
|
|
1882
|
-
declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISystemQualifierTypeConfig): Result<
|
|
2388
|
+
declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISystemQualifierTypeConfig): Result<SystemQualifierType>;
|
|
2389
|
+
|
|
2390
|
+
/**
|
|
2391
|
+
* Creates a {@link Config.IConfigInitFactory | IConfigInitFactory} from a resource type factory function.
|
|
2392
|
+
* @param fn - The factory function to wrap.
|
|
2393
|
+
* @returns An `IConfigInitFactory` instance that delegates to the function.
|
|
2394
|
+
* @public
|
|
2395
|
+
*/
|
|
2396
|
+
declare function createResourceTypeFactory(fn: ResourceTypeFactoryFunction): IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType>;
|
|
1883
2397
|
|
|
1884
2398
|
/**
|
|
1885
2399
|
* Creates a {@link ResourceTypes.ResourceType | ResourceType} from a configuration object.
|
|
@@ -1891,11 +2405,22 @@ declare function createQualifierTypeFromSystemConfig(typeConfig: Config_2.ISyste
|
|
|
1891
2405
|
*/
|
|
1892
2406
|
declare function createResourceTypeFromConfig(config: IResourceTypeConfig): Result<ResourceType>;
|
|
1893
2407
|
|
|
2408
|
+
/**
|
|
2409
|
+
* Create a ZIP archive manifest object
|
|
2410
|
+
* @param inputType - Type of input (file or directory)
|
|
2411
|
+
* @param originalPath - Original file/directory path
|
|
2412
|
+
* @param archivePath - Path within the archive
|
|
2413
|
+
* @param configPath - Optional configuration file path
|
|
2414
|
+
* @returns ZIP archive manifest
|
|
2415
|
+
* @public
|
|
2416
|
+
*/
|
|
2417
|
+
declare function createZipArchiveManifest(inputType: 'file' | 'directory', originalPath: string, archivePath: string, configPath?: string): Json_2.IZipArchiveManifest;
|
|
2418
|
+
|
|
1894
2419
|
/**
|
|
1895
2420
|
* Simple collectible implementation of {@link Decisions.IDecision | IDecision}.
|
|
1896
2421
|
* @public
|
|
1897
2422
|
*/
|
|
1898
|
-
declare class Decision<TVALUE extends JsonValue = JsonValue> implements IDecision<TVALUE> {
|
|
2423
|
+
export declare class Decision<TVALUE extends JsonValue = JsonValue> implements IDecision<TVALUE> {
|
|
1899
2424
|
/**
|
|
1900
2425
|
* The sorted {@link Conditions.ConditionSet | ConditionSets} that make up this decision.
|
|
1901
2426
|
* @public
|
|
@@ -2058,6 +2583,17 @@ declare const DefaultResourceTypes: ReadonlyArray<ResourceTypes.Config.IResource
|
|
|
2058
2583
|
*/
|
|
2059
2584
|
declare const DefaultSystemConfiguration: ISystemConfiguration;
|
|
2060
2585
|
|
|
2586
|
+
/**
|
|
2587
|
+
* Type for handling empty branch nodes during tree composition.
|
|
2588
|
+
* The handler receives the branch node, names of failed children, and the resolver for recovery attempts.
|
|
2589
|
+
* It can return:
|
|
2590
|
+
* - Success(undefined) to omit the branch from the result
|
|
2591
|
+
* - Success(value) to use an alternate value for the branch
|
|
2592
|
+
* - Failure to propagate the error
|
|
2593
|
+
* @public
|
|
2594
|
+
*/
|
|
2595
|
+
declare type EmptyBranchHandler = (branchNode: IReadOnlyResourceTreeNode<IResource>, failedChildNames: string[], resolver: ResourceResolver) => Result<JsonValue | undefined>;
|
|
2596
|
+
|
|
2061
2597
|
declare namespace Example {
|
|
2062
2598
|
export {
|
|
2063
2599
|
ExtendedQualifierTypes,
|
|
@@ -2203,6 +2739,30 @@ declare class FsItemImporter implements IImporter {
|
|
|
2203
2739
|
*/
|
|
2204
2740
|
declare type FsItemResultDetail = 'failed' | 'skipped' | 'succeeded';
|
|
2205
2741
|
|
|
2742
|
+
/**
|
|
2743
|
+
* Generate a timestamp-based filename for ZIP archives
|
|
2744
|
+
* @param customName - Optional custom name prefix
|
|
2745
|
+
* @returns Generated filename
|
|
2746
|
+
* @public
|
|
2747
|
+
*/
|
|
2748
|
+
declare function generateZipArchiveFilename(customName?: string): string;
|
|
2749
|
+
|
|
2750
|
+
/**
|
|
2751
|
+
* Extract directory name from a file path
|
|
2752
|
+
* @param path - File path
|
|
2753
|
+
* @returns Directory name
|
|
2754
|
+
* @public
|
|
2755
|
+
*/
|
|
2756
|
+
declare function getDirectoryName(path: string): string;
|
|
2757
|
+
|
|
2758
|
+
/**
|
|
2759
|
+
* Gets the name for a resource ID.
|
|
2760
|
+
* @param id - The resource ID to get the name for.
|
|
2761
|
+
* @returns The resource name if found, or undefined if not.
|
|
2762
|
+
* @public
|
|
2763
|
+
*/
|
|
2764
|
+
declare function getNameForResourceId(id: string | undefined): Result<ResourceName>;
|
|
2765
|
+
|
|
2206
2766
|
/**
|
|
2207
2767
|
* Returns the {@link Config.Model.ISystemConfiguration | system configuration} declaration for the
|
|
2208
2768
|
* specified predefined system configuration.
|
|
@@ -2244,7 +2804,8 @@ declare namespace Helpers {
|
|
|
2244
2804
|
IQualifierDefaultValueTokenParts,
|
|
2245
2805
|
splitResourceId,
|
|
2246
2806
|
joinResourceIds,
|
|
2247
|
-
joinOptionalResourceIds
|
|
2807
|
+
joinOptionalResourceIds,
|
|
2808
|
+
getNameForResourceId
|
|
2248
2809
|
}
|
|
2249
2810
|
}
|
|
2250
2811
|
export { Helpers }
|
|
@@ -2283,6 +2844,153 @@ declare interface IAbstractDecisionCreateParams {
|
|
|
2283
2844
|
index?: number;
|
|
2284
2845
|
}
|
|
2285
2846
|
|
|
2847
|
+
/**
|
|
2848
|
+
* A union of all qualifier type configurations.
|
|
2849
|
+
* @public
|
|
2850
|
+
*/
|
|
2851
|
+
declare type IAnyQualifierTypeConfig = IQualifierTypeConfig | ISystemQualifierTypeConfig;
|
|
2852
|
+
|
|
2853
|
+
/**
|
|
2854
|
+
* A complete resource bundle that encapsulates built resources, configuration, and metadata.
|
|
2855
|
+
* Bundles provide a portable, integrity-verified way to distribute pre-compiled resource collections.
|
|
2856
|
+
* @public
|
|
2857
|
+
*/
|
|
2858
|
+
declare interface IBundle {
|
|
2859
|
+
/**
|
|
2860
|
+
* Metadata about the bundle including build date and integrity checksum.
|
|
2861
|
+
*/
|
|
2862
|
+
metadata: IBundleMetadata;
|
|
2863
|
+
/**
|
|
2864
|
+
* The system configuration that was used to build the resources in this bundle.
|
|
2865
|
+
*/
|
|
2866
|
+
config: Model.ISystemConfiguration;
|
|
2867
|
+
/**
|
|
2868
|
+
* The compiled resource collection containing all resources, conditions, and decisions.
|
|
2869
|
+
*/
|
|
2870
|
+
compiledCollection: Compiled.ICompiledResourceCollection;
|
|
2871
|
+
/**
|
|
2872
|
+
* Optional export metadata for tracking when and how the bundle was exported.
|
|
2873
|
+
*/
|
|
2874
|
+
exportMetadata?: IBundleExportMetadata;
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
/**
|
|
2878
|
+
* Components extracted from a bundle for reuse in different contexts.
|
|
2879
|
+
* @public
|
|
2880
|
+
*/
|
|
2881
|
+
declare interface IBundleComponents {
|
|
2882
|
+
/**
|
|
2883
|
+
* The system configuration from the bundle.
|
|
2884
|
+
*/
|
|
2885
|
+
systemConfiguration: SystemConfiguration;
|
|
2886
|
+
/**
|
|
2887
|
+
* The compiled resource collection from the bundle.
|
|
2888
|
+
*/
|
|
2889
|
+
compiledCollection: Compiled.ICompiledResourceCollection;
|
|
2890
|
+
/**
|
|
2891
|
+
* The bundle metadata including build information.
|
|
2892
|
+
*/
|
|
2893
|
+
metadata: IBundleMetadata;
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
/**
|
|
2897
|
+
* Optional parameters for bundle creation.
|
|
2898
|
+
* @public
|
|
2899
|
+
*/
|
|
2900
|
+
declare interface IBundleCreateParams {
|
|
2901
|
+
/**
|
|
2902
|
+
* Optional version identifier to include in the bundle metadata.
|
|
2903
|
+
*/
|
|
2904
|
+
version?: string;
|
|
2905
|
+
/**
|
|
2906
|
+
* Optional description to include in the bundle metadata.
|
|
2907
|
+
*/
|
|
2908
|
+
description?: string;
|
|
2909
|
+
/**
|
|
2910
|
+
* Optional custom build date. If not provided, the current date will be used.
|
|
2911
|
+
*/
|
|
2912
|
+
dateBuilt?: string;
|
|
2913
|
+
/**
|
|
2914
|
+
* Optional hash normalizer for generating checksums. If not provided,
|
|
2915
|
+
* a CRC32 normalizer will be used for browser compatibility.
|
|
2916
|
+
*/
|
|
2917
|
+
hashNormalizer?: Hash.HashingNormalizer;
|
|
2918
|
+
/**
|
|
2919
|
+
* Whether to normalize the ResourceManagerBuilder before bundle creation.
|
|
2920
|
+
* When true, the builder is reconstructed in canonical order to ensure
|
|
2921
|
+
* order-independent checksums. Defaults to false for Phase 1 compatibility.
|
|
2922
|
+
*/
|
|
2923
|
+
normalize?: boolean;
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2926
|
+
/**
|
|
2927
|
+
* Optional export metadata for tracking bundle export information.
|
|
2928
|
+
* @public
|
|
2929
|
+
*/
|
|
2930
|
+
declare interface IBundleExportMetadata {
|
|
2931
|
+
/**
|
|
2932
|
+
* ISO timestamp indicating when the bundle was exported.
|
|
2933
|
+
*/
|
|
2934
|
+
exportedAt: string;
|
|
2935
|
+
/**
|
|
2936
|
+
* Tool or application that exported the bundle.
|
|
2937
|
+
*/
|
|
2938
|
+
exportedFrom: string;
|
|
2939
|
+
/**
|
|
2940
|
+
* Type of bundle export (e.g., 'ts-res-bundle', 'ts-res-bundle-filtered').
|
|
2941
|
+
*/
|
|
2942
|
+
type: string;
|
|
2943
|
+
/**
|
|
2944
|
+
* Optional filter context if the bundle represents filtered data.
|
|
2945
|
+
*/
|
|
2946
|
+
filterContext?: Record<string, unknown>;
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
/**
|
|
2950
|
+
* Parameters for creating a BundleLoader.
|
|
2951
|
+
* @public
|
|
2952
|
+
*/
|
|
2953
|
+
declare interface IBundleLoaderCreateParams {
|
|
2954
|
+
/**
|
|
2955
|
+
* The bundle to load.
|
|
2956
|
+
*/
|
|
2957
|
+
bundle: IBundle;
|
|
2958
|
+
/**
|
|
2959
|
+
* Whether to skip checksum verification during loading.
|
|
2960
|
+
* Default is false - checksum verification is performed.
|
|
2961
|
+
*/
|
|
2962
|
+
skipChecksumVerification?: boolean;
|
|
2963
|
+
/**
|
|
2964
|
+
* Optional hash normalizer for verifying checksums. If not provided,
|
|
2965
|
+
* a CRC32 normalizer will be used for browser compatibility.
|
|
2966
|
+
* Must match the normalizer used during bundle creation.
|
|
2967
|
+
*/
|
|
2968
|
+
hashNormalizer?: Hash.HashingNormalizer;
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
/**
|
|
2972
|
+
* Metadata for a resource bundle, including build information and integrity verification.
|
|
2973
|
+
* @public
|
|
2974
|
+
*/
|
|
2975
|
+
declare interface IBundleMetadata {
|
|
2976
|
+
/**
|
|
2977
|
+
* ISO timestamp indicating when the bundle was built.
|
|
2978
|
+
*/
|
|
2979
|
+
dateBuilt: string;
|
|
2980
|
+
/**
|
|
2981
|
+
* SHA-256 checksum of the serialized compiled resource collection for integrity verification.
|
|
2982
|
+
*/
|
|
2983
|
+
checksum: string;
|
|
2984
|
+
/**
|
|
2985
|
+
* Optional version identifier for the bundle.
|
|
2986
|
+
*/
|
|
2987
|
+
version?: string;
|
|
2988
|
+
/**
|
|
2989
|
+
* Optional human-readable description of the bundle.
|
|
2990
|
+
*/
|
|
2991
|
+
description?: string;
|
|
2992
|
+
}
|
|
2993
|
+
|
|
2286
2994
|
/**
|
|
2287
2995
|
* Cache metrics interface for tracking cache performance.
|
|
2288
2996
|
* @public
|
|
@@ -2340,6 +3048,69 @@ declare interface ICandidateInfo {
|
|
|
2340
3048
|
readonly json?: JsonObject;
|
|
2341
3049
|
}
|
|
2342
3050
|
|
|
3051
|
+
/**
|
|
3052
|
+
* Interface for a candidate value that can be collected and indexed.
|
|
3053
|
+
* Candidate values are normalized JSON values that can be shared across
|
|
3054
|
+
* multiple resource candidates to reduce duplication.
|
|
3055
|
+
* @public
|
|
3056
|
+
*/
|
|
3057
|
+
declare interface ICandidateValue extends Collections.ICollectible<CandidateValueKey, CandidateValueIndex> {
|
|
3058
|
+
/**
|
|
3059
|
+
* The unique key for this candidate value, derived from the hash of the normalized JSON.
|
|
3060
|
+
*/
|
|
3061
|
+
readonly key: CandidateValueKey;
|
|
3062
|
+
/**
|
|
3063
|
+
* The index of this candidate value in the collection.
|
|
3064
|
+
*/
|
|
3065
|
+
readonly index: CandidateValueIndex | undefined;
|
|
3066
|
+
/**
|
|
3067
|
+
* The normalized JSON value.
|
|
3068
|
+
*/
|
|
3069
|
+
readonly json: JsonValue;
|
|
3070
|
+
/**
|
|
3071
|
+
* Sets the index of this candidate value.
|
|
3072
|
+
* @param index - The index to set.
|
|
3073
|
+
* @returns `Success` with the index if successful, or `Failure` with an error message if not.
|
|
3074
|
+
*/
|
|
3075
|
+
setIndex(index: number): Result<CandidateValueIndex>;
|
|
3076
|
+
}
|
|
3077
|
+
|
|
3078
|
+
/**
|
|
3079
|
+
* Parameters for creating a {@link Resources.CandidateValueCollector}.
|
|
3080
|
+
* @public
|
|
3081
|
+
*/
|
|
3082
|
+
declare interface ICandidateValueCollectorCreateParams {
|
|
3083
|
+
/**
|
|
3084
|
+
* Optional normalizer to use for normalizing JSON values.
|
|
3085
|
+
* If not provided, a default Crc32Normalizer will be used.
|
|
3086
|
+
*/
|
|
3087
|
+
normalizer?: Hash.HashingNormalizer;
|
|
3088
|
+
/**
|
|
3089
|
+
* Optional initial candidate values to add to the collection.
|
|
3090
|
+
*/
|
|
3091
|
+
candidateValues?: (CandidateValue | JsonValue)[];
|
|
3092
|
+
}
|
|
3093
|
+
|
|
3094
|
+
/**
|
|
3095
|
+
* Parameters for creating a {@link Resources.CandidateValue | CandidateValue}.
|
|
3096
|
+
* @public
|
|
3097
|
+
*/
|
|
3098
|
+
declare interface ICandidateValueCreateParams {
|
|
3099
|
+
/**
|
|
3100
|
+
* The JSON value to store. Will be normalized during creation.
|
|
3101
|
+
*/
|
|
3102
|
+
json: JsonValue;
|
|
3103
|
+
/**
|
|
3104
|
+
* Optional normalizer to use for normalizing the JSON value.
|
|
3105
|
+
* If not provided, a default Crc32Normalizer will be used.
|
|
3106
|
+
*/
|
|
3107
|
+
normalizer?: Hash.Crc32Normalizer;
|
|
3108
|
+
/**
|
|
3109
|
+
* Optional index if the value is already indexed.
|
|
3110
|
+
*/
|
|
3111
|
+
index?: number;
|
|
3112
|
+
}
|
|
3113
|
+
|
|
2343
3114
|
/**
|
|
2344
3115
|
* Non-validated child declaration of a {@link Conditions.Condition | condition}.
|
|
2345
3116
|
* @public
|
|
@@ -2463,9 +3234,9 @@ declare interface ICompiledAbstractDecision {
|
|
|
2463
3234
|
*/
|
|
2464
3235
|
declare interface ICompiledCandidate {
|
|
2465
3236
|
/**
|
|
2466
|
-
* The JSON value of the candidate.
|
|
3237
|
+
* The global index of the JSON value of the candidate.
|
|
2467
3238
|
*/
|
|
2468
|
-
|
|
3239
|
+
valueIndex: Common.CandidateValueIndex;
|
|
2469
3240
|
/**
|
|
2470
3241
|
* Indicates if this is a partial resource that needs to be merged.
|
|
2471
3242
|
*/
|
|
@@ -2638,6 +3409,10 @@ declare interface ICompiledResourceCollection {
|
|
|
2638
3409
|
* Array of all decisions in the collection.
|
|
2639
3410
|
*/
|
|
2640
3411
|
decisions: ReadonlyArray<ICompiledAbstractDecision>;
|
|
3412
|
+
/**
|
|
3413
|
+
* Array of all candidate values in the collection.
|
|
3414
|
+
*/
|
|
3415
|
+
candidateValues: ReadonlyArray<JsonValue>;
|
|
2641
3416
|
/**
|
|
2642
3417
|
* Array of all resources in the collection.
|
|
2643
3418
|
*/
|
|
@@ -2829,6 +3604,19 @@ declare interface IConditionTokenParts {
|
|
|
2829
3604
|
value: string;
|
|
2830
3605
|
}
|
|
2831
3606
|
|
|
3607
|
+
/**
|
|
3608
|
+
* Interface for a factory that creates a new instance of a configuration object.
|
|
3609
|
+
* @public
|
|
3610
|
+
*/
|
|
3611
|
+
declare interface IConfigInitFactory<TConfig, T> {
|
|
3612
|
+
/**
|
|
3613
|
+
* Creates a new instance of a configuration object.
|
|
3614
|
+
* @param config - The configuration object to create.
|
|
3615
|
+
* @returns A result containing the new instance of the configuration object.
|
|
3616
|
+
*/
|
|
3617
|
+
create(config: TConfig): Result<T>;
|
|
3618
|
+
}
|
|
3619
|
+
|
|
2832
3620
|
/**
|
|
2833
3621
|
* Declared context for a resource container.
|
|
2834
3622
|
* @public
|
|
@@ -3113,6 +3901,46 @@ declare interface IImportContext {
|
|
|
3113
3901
|
readonly conditions?: ReadonlyArray<IConditionDecl>;
|
|
3114
3902
|
}
|
|
3115
3903
|
|
|
3904
|
+
/**
|
|
3905
|
+
* JSON representation of an imported directory structure
|
|
3906
|
+
* @public
|
|
3907
|
+
*/
|
|
3908
|
+
declare interface IImportedDirectory {
|
|
3909
|
+
/** Directory name */
|
|
3910
|
+
name: string;
|
|
3911
|
+
/** Files in this directory */
|
|
3912
|
+
files: IImportedFile[];
|
|
3913
|
+
/** Subdirectories */
|
|
3914
|
+
subdirectories: IImportedDirectory[];
|
|
3915
|
+
}
|
|
3916
|
+
|
|
3917
|
+
/**
|
|
3918
|
+
* Imported directory structure
|
|
3919
|
+
* @public
|
|
3920
|
+
*/
|
|
3921
|
+
declare type IImportedDirectory_2 = Json_2.IImportedDirectory;
|
|
3922
|
+
|
|
3923
|
+
/**
|
|
3924
|
+
* JSON representation of an imported file
|
|
3925
|
+
* @public
|
|
3926
|
+
*/
|
|
3927
|
+
declare interface IImportedFile {
|
|
3928
|
+
/** File name */
|
|
3929
|
+
name: string;
|
|
3930
|
+
/** Full path within archive */
|
|
3931
|
+
path: string;
|
|
3932
|
+
/** File content as string */
|
|
3933
|
+
content: string;
|
|
3934
|
+
/** MIME type */
|
|
3935
|
+
type: string;
|
|
3936
|
+
}
|
|
3937
|
+
|
|
3938
|
+
/**
|
|
3939
|
+
* Imported file representation
|
|
3940
|
+
* @public
|
|
3941
|
+
*/
|
|
3942
|
+
declare type IImportedFile_2 = Json_2.IImportedFile;
|
|
3943
|
+
|
|
3116
3944
|
/**
|
|
3117
3945
|
* Generic interface for an importer than accepts a typed
|
|
3118
3946
|
* {@link Import.IImportable | importable} item, extracts any resources
|
|
@@ -3246,6 +4074,11 @@ declare interface IJsonResourceTypeCreateParams {
|
|
|
3246
4074
|
* instance.
|
|
3247
4075
|
*/
|
|
3248
4076
|
index?: number;
|
|
4077
|
+
/**
|
|
4078
|
+
* Optional template for new instances of {@link ResourceTypes.JsonResourceType | JsonResourceType}
|
|
4079
|
+
* resources.
|
|
4080
|
+
*/
|
|
4081
|
+
template?: JsonObject;
|
|
3249
4082
|
}
|
|
3250
4083
|
|
|
3251
4084
|
/**
|
|
@@ -3310,10 +4143,10 @@ declare interface ILiteralQualifierTypeCreateParams {
|
|
|
3310
4143
|
*/
|
|
3311
4144
|
enumeratedValues?: ReadonlyArray<string>;
|
|
3312
4145
|
/**
|
|
3313
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
4146
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
3314
4147
|
* of literal values to use for matching. If not provided, no hierarchy will be used.
|
|
3315
4148
|
*/
|
|
3316
|
-
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
4149
|
+
hierarchy?: Config_2.LiteralValueHierarchyDecl<string>;
|
|
3317
4150
|
/**
|
|
3318
4151
|
* Global index for this qualifier type.
|
|
3319
4152
|
*/
|
|
@@ -3337,7 +4170,7 @@ declare interface ILiteralValue<T extends string> {
|
|
|
3337
4170
|
*/
|
|
3338
4171
|
declare interface ILiteralValueHierarchyCreateParams<T extends string = string> {
|
|
3339
4172
|
values: ReadonlyArray<T>;
|
|
3340
|
-
hierarchy?: LiteralValueHierarchyDecl<T
|
|
4173
|
+
hierarchy?: Partial<LiteralValueHierarchyDecl<T>>;
|
|
3341
4174
|
}
|
|
3342
4175
|
|
|
3343
4176
|
/**
|
|
@@ -3570,14 +4403,27 @@ declare class ImportContext implements IValidatedImportContext {
|
|
|
3570
4403
|
}
|
|
3571
4404
|
|
|
3572
4405
|
/**
|
|
3573
|
-
*
|
|
4406
|
+
* Converter for imported directory structure (recursive)
|
|
4407
|
+
* Note: Uses Converter pattern because Validators don't support recursion with self parameter
|
|
3574
4408
|
* @public
|
|
3575
4409
|
*/
|
|
3576
|
-
declare const
|
|
4410
|
+
declare const importedDirectory: Converter<Json_2.IImportedDirectory>;
|
|
3577
4411
|
|
|
3578
4412
|
/**
|
|
3579
|
-
*
|
|
3580
|
-
*
|
|
4413
|
+
* Converter for imported file
|
|
4414
|
+
* @public
|
|
4415
|
+
*/
|
|
4416
|
+
declare const importedFile: Converter<Json_2.IImportedFile>;
|
|
4417
|
+
|
|
4418
|
+
/**
|
|
4419
|
+
* `Converter` for a normalized {@link ResourceJson.Normalized.IImporterResourceCandidateDecl | importer resource candidate declaration}.
|
|
4420
|
+
* @public
|
|
4421
|
+
*/
|
|
4422
|
+
declare const importerResourceCandidateDecl: Converter<Normalized.IImporterResourceCandidateDecl>;
|
|
4423
|
+
|
|
4424
|
+
/**
|
|
4425
|
+
* `Converter` for a normalized {@link ResourceJson.Normalized.IImporterResourceCollectionDecl | importer resource collection declaration}.
|
|
4426
|
+
* This allows for a mix of loose and child resource declarations.
|
|
3581
4427
|
* @public
|
|
3582
4428
|
*/
|
|
3583
4429
|
declare const importerResourceCollectionDecl: Converter<Normalized.IImporterResourceCollectionDecl>;
|
|
@@ -3754,11 +4600,15 @@ declare interface IQualifierDefaultValueTokenParts {
|
|
|
3754
4600
|
* territories, etc).
|
|
3755
4601
|
* @public
|
|
3756
4602
|
*/
|
|
3757
|
-
declare interface IQualifierType extends ICollectible<QualifierTypeName, QualifierTypeIndex> {
|
|
4603
|
+
declare interface IQualifierType<TCFGJSON extends JsonObject = JsonObject> extends ICollectible<QualifierTypeName, QualifierTypeIndex> {
|
|
3758
4604
|
/**
|
|
3759
4605
|
* The name of the qualifier type.
|
|
3760
4606
|
*/
|
|
3761
4607
|
readonly name: QualifierTypeName;
|
|
4608
|
+
/**
|
|
4609
|
+
* Name of the underlying system type.
|
|
4610
|
+
*/
|
|
4611
|
+
readonly systemTypeName: QualifierTypeName;
|
|
3762
4612
|
/**
|
|
3763
4613
|
* Unique key for this qualifier.
|
|
3764
4614
|
*/
|
|
@@ -3821,6 +4671,17 @@ declare interface IQualifierType extends ICollectible<QualifierTypeName, Qualifi
|
|
|
3821
4671
|
* Sets the index for this qualifier type. Once set, index is immutable.
|
|
3822
4672
|
*/
|
|
3823
4673
|
setIndex(index: number): Result<QualifierTypeIndex>;
|
|
4674
|
+
/**
|
|
4675
|
+
* Gets the configuration for this qualifier type.
|
|
4676
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
4677
|
+
*/
|
|
4678
|
+
getConfigurationJson(): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
|
|
4679
|
+
/**
|
|
4680
|
+
* Validates configuration JSON data for this qualifier type.
|
|
4681
|
+
* @param from - The unknown data to validate as configuration JSON.
|
|
4682
|
+
* @returns `Success` with validated JSON configuration if valid, `Failure` with an error message otherwise.
|
|
4683
|
+
*/
|
|
4684
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
|
|
3824
4685
|
}
|
|
3825
4686
|
|
|
3826
4687
|
/**
|
|
@@ -3981,7 +4842,7 @@ declare interface IReadOnlyResourceTreeBranch<T> {
|
|
|
3981
4842
|
* Interface for a read-only result-based resource tree with navigation methods.
|
|
3982
4843
|
* @public
|
|
3983
4844
|
*/
|
|
3984
|
-
declare interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<
|
|
4845
|
+
declare interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<TNAME, IReadOnlyResourceTreeNode<T>> {
|
|
3985
4846
|
/**
|
|
3986
4847
|
* Gets a tree node by its full ResourceId path.
|
|
3987
4848
|
* @param id - The ResourceId path to look up
|
|
@@ -4068,6 +4929,29 @@ declare interface IReducedCandidate {
|
|
|
4068
4929
|
readonly mergeMethod?: ResourceValueMergeMethod;
|
|
4069
4930
|
}
|
|
4070
4931
|
|
|
4932
|
+
/**
|
|
4933
|
+
* Options for configuring resource tree resolution.
|
|
4934
|
+
* @public
|
|
4935
|
+
*/
|
|
4936
|
+
declare interface IResolveResourceTreeOptions {
|
|
4937
|
+
/**
|
|
4938
|
+
* Controls how errors are handled when resolving individual resources in the tree.
|
|
4939
|
+
* - 'fail': Aggregate all errors and fail if any resource fails to resolve
|
|
4940
|
+
* - 'ignore': Skip failed resources and omit them from the result
|
|
4941
|
+
* - callback: Custom error handler that can provide alternate values or propagate errors
|
|
4942
|
+
* @defaultValue 'fail'
|
|
4943
|
+
*/
|
|
4944
|
+
onResourceError?: 'fail' | 'ignore' | ResourceErrorHandler;
|
|
4945
|
+
/**
|
|
4946
|
+
* Controls how empty branch nodes are handled during tree composition.
|
|
4947
|
+
* - 'allow': Include empty branches as empty objects in the result
|
|
4948
|
+
* - 'omit': Exclude empty branches from the parent object
|
|
4949
|
+
* - callback: Custom handler that can provide alternate values or recovery logic
|
|
4950
|
+
* @defaultValue 'allow'
|
|
4951
|
+
*/
|
|
4952
|
+
onEmptyBranch?: 'allow' | 'omit' | EmptyBranchHandler;
|
|
4953
|
+
}
|
|
4954
|
+
|
|
4071
4955
|
/**
|
|
4072
4956
|
* Interface for a resource that can be used in the runtime layer.
|
|
4073
4957
|
* This provides the minimal properties needed from a resource without requiring
|
|
@@ -4077,8 +4961,10 @@ declare interface IReducedCandidate {
|
|
|
4077
4961
|
declare interface IResource {
|
|
4078
4962
|
/** The resource identifier */
|
|
4079
4963
|
readonly id: string;
|
|
4964
|
+
/** The resource name */
|
|
4965
|
+
readonly name: string;
|
|
4080
4966
|
/** The resource type */
|
|
4081
|
-
readonly resourceType:
|
|
4967
|
+
readonly resourceType: IResourceType;
|
|
4082
4968
|
/** The decision used to select candidates */
|
|
4083
4969
|
readonly decision: ConcreteDecision;
|
|
4084
4970
|
/** The available candidates for this resource */
|
|
@@ -4095,6 +4981,7 @@ declare interface IResourceBuilderCreateParams {
|
|
|
4095
4981
|
conditionSets: ConditionSetCollector;
|
|
4096
4982
|
resourceTypes: ReadOnlyResourceTypeCollector;
|
|
4097
4983
|
decisions: AbstractDecisionCollector;
|
|
4984
|
+
candidateValues: CandidateValueCollector;
|
|
4098
4985
|
}
|
|
4099
4986
|
|
|
4100
4987
|
/**
|
|
@@ -4124,6 +5011,7 @@ declare interface IResourceCandidateCreateParams {
|
|
|
4124
5011
|
resourceType?: ResourceType;
|
|
4125
5012
|
parentConditions?: ReadonlyArray<Condition>;
|
|
4126
5013
|
conditionSets: ConditionSetCollector;
|
|
5014
|
+
candidateValues: CandidateValueCollector;
|
|
4127
5015
|
}
|
|
4128
5016
|
|
|
4129
5017
|
/**
|
|
@@ -4137,10 +5025,10 @@ declare interface IResourceCandidateValidationProperties {
|
|
|
4137
5025
|
*/
|
|
4138
5026
|
id: ResourceId;
|
|
4139
5027
|
/**
|
|
4140
|
-
*
|
|
5028
|
+
* Describes how complete the candidate value is.
|
|
4141
5029
|
* @public
|
|
4142
5030
|
*/
|
|
4143
|
-
|
|
5031
|
+
completeness: CandidateCompleteness;
|
|
4144
5032
|
/**
|
|
4145
5033
|
* {@inheritdoc ResourceJson.Json.ILooseResourceCandidateDecl.json}
|
|
4146
5034
|
* @public
|
|
@@ -4281,7 +5169,7 @@ declare interface IResourceDeclContainer {
|
|
|
4281
5169
|
* implementations without requiring the full ResourceManagerBuilder build mechanics.
|
|
4282
5170
|
* @public
|
|
4283
5171
|
*/
|
|
4284
|
-
declare interface IResourceManager {
|
|
5172
|
+
export declare interface IResourceManager<TR extends IResource = IResource> {
|
|
4285
5173
|
/**
|
|
4286
5174
|
* A {@link Conditions.ReadOnlyConditionCollector | ReadOnlyConditionCollector} which
|
|
4287
5175
|
* contains the {@link Conditions.Condition | conditions} used by resource candidates.
|
|
@@ -4302,12 +5190,17 @@ declare interface IResourceManager {
|
|
|
4302
5190
|
* @param id - The resource identifier
|
|
4303
5191
|
* @returns Success with the runtime resource if found, Failure otherwise
|
|
4304
5192
|
*/
|
|
4305
|
-
getBuiltResource(id: string): Result<
|
|
5193
|
+
getBuiltResource(id: string): Result<TR>;
|
|
5194
|
+
/**
|
|
5195
|
+
* Gets a resource tree built from the resources in this resource manager.
|
|
5196
|
+
* @returns Result containing the resource tree root, or failure if tree construction fails
|
|
5197
|
+
*/
|
|
5198
|
+
getBuiltResourceTree(): Result<IReadOnlyResourceTreeRoot<TR>>;
|
|
4306
5199
|
/**
|
|
4307
5200
|
* A read-only result map of all built resources, keyed by resource ID.
|
|
4308
5201
|
* Resources are built on-demand when accessed and returns Results for error handling.
|
|
4309
5202
|
*/
|
|
4310
|
-
readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId,
|
|
5203
|
+
readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId, TR>;
|
|
4311
5204
|
/**
|
|
4312
5205
|
* The number of resources in this resource manager.
|
|
4313
5206
|
*/
|
|
@@ -4333,6 +5226,56 @@ declare interface IResourceManagerBuilderCreateParams {
|
|
|
4333
5226
|
resourceTypes: ReadOnlyResourceTypeCollector;
|
|
4334
5227
|
}
|
|
4335
5228
|
|
|
5229
|
+
/**
|
|
5230
|
+
* Options for ResourceManagerBuilder clone operations.
|
|
5231
|
+
* Extends IDeclarationOptions to include support for applying edits when cloning.
|
|
5232
|
+
* @public
|
|
5233
|
+
*/
|
|
5234
|
+
declare interface IResourceManagerCloneOptions extends IResourceDeclarationOptions {
|
|
5235
|
+
/**
|
|
5236
|
+
* Optional array of loose condition declarations to be applied as edits during the clone operation.
|
|
5237
|
+
* These conditions can modify or extend the resource candidates in the cloned manager.
|
|
5238
|
+
*/
|
|
5239
|
+
readonly candidates?: ReadonlyArray<ResourceJson.Json.ILooseResourceCandidateDecl>;
|
|
5240
|
+
/**
|
|
5241
|
+
* Optional qualifier collector to use for the cloned manager.
|
|
5242
|
+
* If not provided, uses the same qualifiers as the original manager.
|
|
5243
|
+
* This allows creating clones with different qualifier configurations.
|
|
5244
|
+
*/
|
|
5245
|
+
readonly qualifiers?: IReadOnlyQualifierCollector;
|
|
5246
|
+
/**
|
|
5247
|
+
* Optional resource type collector to use for the cloned manager.
|
|
5248
|
+
* If not provided, uses the same resource types as the original manager.
|
|
5249
|
+
* This allows creating clones with different resource type configurations.
|
|
5250
|
+
*/
|
|
5251
|
+
readonly resourceTypes?: ReadOnlyResourceTypeCollector;
|
|
5252
|
+
}
|
|
5253
|
+
|
|
5254
|
+
/**
|
|
5255
|
+
* Minimal resource resolver
|
|
5256
|
+
* @public
|
|
5257
|
+
*/
|
|
5258
|
+
export declare interface IResourceResolver {
|
|
5259
|
+
/**
|
|
5260
|
+
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
5261
|
+
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
5262
|
+
* priority "partial" candidates into it in ascending order of priority.
|
|
5263
|
+
* @param resource - The string id of the resource to resolve.
|
|
5264
|
+
* @returns `Success` with the composed JsonValue if successful,
|
|
5265
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
5266
|
+
* @public
|
|
5267
|
+
*/
|
|
5268
|
+
resolveComposedResourceValue(resource: string): Result<JsonValue>;
|
|
5269
|
+
/**
|
|
5270
|
+
* Creates a new {@link IResourceResolver | resource resolver} with the given context.
|
|
5271
|
+
* @param context - The context to use for the new resource resolver.
|
|
5272
|
+
* @returns `Success` with the new resource resolver if successful,
|
|
5273
|
+
* or `Failure` with an error message if the context is invalid.
|
|
5274
|
+
* @public
|
|
5275
|
+
*/
|
|
5276
|
+
withContext(context: Record<string, string>): Result<IResourceResolver>;
|
|
5277
|
+
}
|
|
5278
|
+
|
|
4336
5279
|
/**
|
|
4337
5280
|
* A listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.
|
|
4338
5281
|
* @public
|
|
@@ -4356,6 +5299,11 @@ declare interface IResourceResolverCacheListener {
|
|
|
4356
5299
|
* @param index - The index of the cache that had an error.
|
|
4357
5300
|
*/
|
|
4358
5301
|
onCacheError(cache: ResourceResolverCacheType, index: number): void;
|
|
5302
|
+
/**
|
|
5303
|
+
* Called when a context error occurs.
|
|
5304
|
+
* @param error - The error that occurred.
|
|
5305
|
+
*/
|
|
5306
|
+
onContextError(qualifier: string, error: string): void;
|
|
4359
5307
|
/**
|
|
4360
5308
|
* Called when a cache is cleared.
|
|
4361
5309
|
* @param cache - The type of cache that was cleared.
|
|
@@ -4387,6 +5335,24 @@ declare interface IResourceResolverCreateParams {
|
|
|
4387
5335
|
* An optional listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.
|
|
4388
5336
|
*/
|
|
4389
5337
|
listener?: IResourceResolverCacheListener;
|
|
5338
|
+
/**
|
|
5339
|
+
* Optional configuration options for the {@link Runtime.ResourceResolver | ResourceResolver}.
|
|
5340
|
+
*/
|
|
5341
|
+
options?: IResourceResolverOptions;
|
|
5342
|
+
}
|
|
5343
|
+
|
|
5344
|
+
/**
|
|
5345
|
+
* Options for configuring a {@link Runtime.ResourceResolver | ResourceResolver}.
|
|
5346
|
+
* @public
|
|
5347
|
+
*/
|
|
5348
|
+
declare interface IResourceResolverOptions {
|
|
5349
|
+
/**
|
|
5350
|
+
* Controls whether null values in resource composition should suppress properties
|
|
5351
|
+
* instead of setting them to null. When true, properties with null values from
|
|
5352
|
+
* higher-priority partial candidates will be omitted from the final composed resource.
|
|
5353
|
+
* @defaultValue false
|
|
5354
|
+
*/
|
|
5355
|
+
suppressNullAsDelete?: boolean;
|
|
4390
5356
|
}
|
|
4391
5357
|
|
|
4392
5358
|
/**
|
|
@@ -4453,13 +5419,82 @@ declare interface IResourceTreeRootInit<T> {
|
|
|
4453
5419
|
readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;
|
|
4454
5420
|
}
|
|
4455
5421
|
|
|
5422
|
+
/**
|
|
5423
|
+
* Interface for a resource type. Resource types are responsible for
|
|
5424
|
+
* validating and converting JSON values into the appropriate strongly-typed
|
|
5425
|
+
* resource value.
|
|
5426
|
+
* @public
|
|
5427
|
+
*/
|
|
5428
|
+
declare interface IResourceType<T = unknown> extends ICollectible<ResourceTypeName, ResourceTypeIndex> {
|
|
5429
|
+
/**
|
|
5430
|
+
* The key for this resource type.
|
|
5431
|
+
*/
|
|
5432
|
+
readonly key: ResourceTypeName;
|
|
5433
|
+
/**
|
|
5434
|
+
* The index for this resource type.
|
|
5435
|
+
*/
|
|
5436
|
+
readonly index: ResourceTypeIndex | undefined;
|
|
5437
|
+
/**
|
|
5438
|
+
* Validates properties of a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration} for
|
|
5439
|
+
* a resource instance value.
|
|
5440
|
+
* @param props - The {@link ResourceTypes.IResourceCandidateValidationProperties | properties } to validate.
|
|
5441
|
+
* @returns `Success` with the strongly-typed resource value if the JSON and merge method
|
|
5442
|
+
* are valid, `Failure` with an error message otherwise.
|
|
5443
|
+
* @public
|
|
5444
|
+
*/
|
|
5445
|
+
validateDeclaration(props: IResourceCandidateValidationProperties): Result<T | Partial<T>>;
|
|
5446
|
+
/**
|
|
5447
|
+
* Validates a JSON value for use as a partial resource instance value.
|
|
5448
|
+
* @param json - The JSON value to validate.
|
|
5449
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
5450
|
+
* @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
|
|
5451
|
+
* `Failure` with an error message otherwise.
|
|
5452
|
+
* @public
|
|
5453
|
+
*/
|
|
5454
|
+
validate(json: JsonValue, completeness: CandidateCompleteness): Result<Partial<T>>;
|
|
5455
|
+
/**
|
|
5456
|
+
* Validates a JSON value for use as a complete resource instance value.
|
|
5457
|
+
* @param json - The JSON value to validate.
|
|
5458
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
5459
|
+
* @returns `Success` with the strongly-typed resource value if the JSON is valid,
|
|
5460
|
+
* `Failure` with an error message otherwise.
|
|
5461
|
+
* @public
|
|
5462
|
+
*/
|
|
5463
|
+
validate(json: JsonValue, completeness: 'full'): Result<T>;
|
|
5464
|
+
/**
|
|
5465
|
+
* Validates a JSON value for use as a partial resource instance value.
|
|
5466
|
+
* @param json - The JSON value to validate.
|
|
5467
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
5468
|
+
* @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
|
|
5469
|
+
* `Failure` with an error message otherwise.
|
|
5470
|
+
* @public
|
|
5471
|
+
*/
|
|
5472
|
+
validate(json: JsonValue, completeness: 'partial'): Result<Partial<T>>;
|
|
5473
|
+
/**
|
|
5474
|
+
* Sets the index for this resource type. Once set, the index cannot be changed.
|
|
5475
|
+
*/
|
|
5476
|
+
setIndex(index: number): Result<ResourceTypeIndex>;
|
|
5477
|
+
/**
|
|
5478
|
+
* Creates a template for a new resource of this type.
|
|
5479
|
+
* The template provides a default structure for creating new resource instances.
|
|
5480
|
+
* @param resourceId - The id for the new resource.
|
|
5481
|
+
* @param init - An optional initial value for the resource.
|
|
5482
|
+
* @param resolver - An optional resource resolver that can be used to create the template.
|
|
5483
|
+
* @param conditions - An optional set of conditions that must be met for the resource to be selected.
|
|
5484
|
+
* @returns A loose resource declaration with default values for this resource type.
|
|
5485
|
+
* @public
|
|
5486
|
+
*/
|
|
5487
|
+
createTemplate(resourceId: ResourceId, init?: JsonValue, conditions?: ResourceJson.Json.ConditionSetDecl, resolver?: IResourceResolver): Result<ResourceJson.Json.ILooseResourceDecl>;
|
|
5488
|
+
}
|
|
5489
|
+
|
|
4456
5490
|
/**
|
|
4457
5491
|
* Configuration for a {@link ResourceTypes.ResourceType | resource type}.
|
|
4458
5492
|
* @public
|
|
4459
5493
|
*/
|
|
4460
|
-
declare interface IResourceTypeConfig {
|
|
5494
|
+
declare interface IResourceTypeConfig<T extends JsonObject = JsonObject> {
|
|
4461
5495
|
name: string;
|
|
4462
5496
|
typeName: string;
|
|
5497
|
+
template?: T;
|
|
4463
5498
|
}
|
|
4464
5499
|
|
|
4465
5500
|
/**
|
|
@@ -4514,6 +5549,33 @@ declare function isResourceTreeLeafInit<T>(init: ResourceTreeNodeInit<T>): init
|
|
|
4514
5549
|
*/
|
|
4515
5550
|
declare function isResourceTreeRootOrNodeInit<T>(init: ResourceTreeNodeInit<T> | IResourceTreeRootInit<T>): init is IResourceTreeBranchInit<T>;
|
|
4516
5551
|
|
|
5552
|
+
/**
|
|
5553
|
+
* Checks if a {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} is a
|
|
5554
|
+
* {@link QualifierTypes.Config.ISystemQualifierTypeConfig | system qualifier type configuration}.
|
|
5555
|
+
* @param config - The {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} to check.
|
|
5556
|
+
* @returns `true` if the configuration is a system qualifier type configuration, `false` otherwise.
|
|
5557
|
+
* @public
|
|
5558
|
+
*/
|
|
5559
|
+
declare function isSystemQualifierTypeConfig(config: IAnyQualifierTypeConfig): config is ISystemQualifierTypeConfig;
|
|
5560
|
+
|
|
5561
|
+
/**
|
|
5562
|
+
* Checks if the given index is a valid candidate value index.
|
|
5563
|
+
*
|
|
5564
|
+
* @param index - The index to validate.
|
|
5565
|
+
* @returns `true` if the index is a valid candidate value index, otherwise `false`.
|
|
5566
|
+
* @public
|
|
5567
|
+
*/
|
|
5568
|
+
declare function isValidCandidateValueIndex(index: number): index is CandidateValueIndex;
|
|
5569
|
+
|
|
5570
|
+
/**
|
|
5571
|
+
* Checks if the given key is a valid candidate value key.
|
|
5572
|
+
*
|
|
5573
|
+
* @param key - The key to validate.
|
|
5574
|
+
* @returns `true` if the key is a valid candidate value key, otherwise `false`.
|
|
5575
|
+
* @public
|
|
5576
|
+
*/
|
|
5577
|
+
declare function isValidCandidateValueKey(key: string): key is CandidateValueKey;
|
|
5578
|
+
|
|
4517
5579
|
/**
|
|
4518
5580
|
* Determines whether a number is a valid condition index.
|
|
4519
5581
|
* @param index - the number to validate
|
|
@@ -4742,7 +5804,7 @@ declare interface ISystemConfiguration {
|
|
|
4742
5804
|
/** Optional description explaining the purpose and use case of the configuration. */
|
|
4743
5805
|
description?: string;
|
|
4744
5806
|
/** Qualifier type configurations that define the available qualifier types in the system. */
|
|
4745
|
-
qualifierTypes: QualifierTypes.Config.
|
|
5807
|
+
qualifierTypes: QualifierTypes.Config.IAnyQualifierTypeConfig[];
|
|
4746
5808
|
/** Qualifier declarations that define the available qualifiers in the system. */
|
|
4747
5809
|
qualifiers: Qualifiers.IQualifierDecl[];
|
|
4748
5810
|
/** Resource type configurations that define the available resource types in the system. */
|
|
@@ -4760,6 +5822,8 @@ declare interface ISystemConfigurationInitParams {
|
|
|
4760
5822
|
* Use `null` as the value to remove an existing default value.
|
|
4761
5823
|
*/
|
|
4762
5824
|
qualifierDefaultValues?: Record<string, string | null>;
|
|
5825
|
+
qualifierTypeFactory?: IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, QualifierType>;
|
|
5826
|
+
resourceTypeFactory?: IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType>;
|
|
4763
5827
|
}
|
|
4764
5828
|
|
|
4765
5829
|
/**
|
|
@@ -4792,6 +5856,14 @@ declare interface ISystemTerritoryQualifierTypeConfig extends IQualifierTypeConf
|
|
|
4792
5856
|
systemType: 'territory';
|
|
4793
5857
|
}
|
|
4794
5858
|
|
|
5859
|
+
/**
|
|
5860
|
+
* Validate ZIP file extension
|
|
5861
|
+
* @param filename - Filename to validate
|
|
5862
|
+
* @returns True if filename has .zip extension
|
|
5863
|
+
* @public
|
|
5864
|
+
*/
|
|
5865
|
+
declare function isZipFile(filename: string): boolean;
|
|
5866
|
+
|
|
4795
5867
|
/**
|
|
4796
5868
|
* Configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.
|
|
4797
5869
|
* @public
|
|
@@ -4801,7 +5873,7 @@ declare interface ITerritoryQualifierTypeConfig {
|
|
|
4801
5873
|
acceptLowercase?: boolean;
|
|
4802
5874
|
allowedTerritories?: string[];
|
|
4803
5875
|
/**
|
|
4804
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
5876
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
4805
5877
|
* of territory values to use for matching. If not provided, no hierarchy will be used.
|
|
4806
5878
|
*/
|
|
4807
5879
|
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
@@ -4834,10 +5906,10 @@ declare interface ITerritoryQualifierTypeCreateParams {
|
|
|
4834
5906
|
*/
|
|
4835
5907
|
acceptLowercase?: boolean;
|
|
4836
5908
|
/**
|
|
4837
|
-
* Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
5909
|
+
* Optional {@link QualifierTypes.Config.LiteralValueHierarchyDecl | hierarchy declaration}
|
|
4838
5910
|
* of territory values to use for matching. If not provided, no hierarchy will be used.
|
|
4839
5911
|
*/
|
|
4840
|
-
hierarchy?: LiteralValueHierarchyDecl<string>;
|
|
5912
|
+
hierarchy?: Config_2.LiteralValueHierarchyDecl<string>;
|
|
4841
5913
|
}
|
|
4842
5914
|
|
|
4843
5915
|
/**
|
|
@@ -4965,6 +6037,111 @@ declare interface IValidatingSimpleContextQualifierProviderCreateParams {
|
|
|
4965
6037
|
qualifierValues?: Record<string, string>;
|
|
4966
6038
|
}
|
|
4967
6039
|
|
|
6040
|
+
/**
|
|
6041
|
+
* JSON representation of ZIP archive config information
|
|
6042
|
+
* @public
|
|
6043
|
+
*/
|
|
6044
|
+
declare interface IZipArchiveConfigInfo {
|
|
6045
|
+
/** Type of config (always 'file') */
|
|
6046
|
+
type: 'file';
|
|
6047
|
+
/** Original config file path */
|
|
6048
|
+
originalPath: string;
|
|
6049
|
+
/** Path within the archive (e.g., "config.json") */
|
|
6050
|
+
archivePath: string;
|
|
6051
|
+
}
|
|
6052
|
+
|
|
6053
|
+
/**
|
|
6054
|
+
* Options for creating a ZIP archive buffer from a file tree
|
|
6055
|
+
* @public
|
|
6056
|
+
*/
|
|
6057
|
+
declare interface IZipArchiveFileTreeOptions {
|
|
6058
|
+
/** Input file or directory */
|
|
6059
|
+
inputItem?: FileTree.FileTreeItem;
|
|
6060
|
+
/** Optional configuration file */
|
|
6061
|
+
configItem?: FileTree.IFileTreeFileItem;
|
|
6062
|
+
}
|
|
6063
|
+
|
|
6064
|
+
/**
|
|
6065
|
+
* JSON representation of ZIP archive input information
|
|
6066
|
+
* @public
|
|
6067
|
+
*/
|
|
6068
|
+
declare interface IZipArchiveInputInfo {
|
|
6069
|
+
/** Type of input (file or directory) */
|
|
6070
|
+
type: 'file' | 'directory';
|
|
6071
|
+
/** Original file/directory path */
|
|
6072
|
+
originalPath: string;
|
|
6073
|
+
/** Path within the archive (e.g., "input/mydir") */
|
|
6074
|
+
archivePath: string;
|
|
6075
|
+
}
|
|
6076
|
+
|
|
6077
|
+
/**
|
|
6078
|
+
* Options for loading a ZIP archive
|
|
6079
|
+
* @public
|
|
6080
|
+
*/
|
|
6081
|
+
declare interface IZipArchiveLoadOptions {
|
|
6082
|
+
/** Validate manifest strictly */
|
|
6083
|
+
strictManifestValidation?: boolean;
|
|
6084
|
+
}
|
|
6085
|
+
|
|
6086
|
+
/**
|
|
6087
|
+
* Result of ZIP archive loading
|
|
6088
|
+
* @public
|
|
6089
|
+
*/
|
|
6090
|
+
declare interface IZipArchiveLoadResult {
|
|
6091
|
+
/** Parsed archive manifest */
|
|
6092
|
+
manifest: IZipArchiveManifest_2 | undefined;
|
|
6093
|
+
/** Loaded configuration */
|
|
6094
|
+
config: Model.ISystemConfiguration | undefined;
|
|
6095
|
+
/** All files extracted from the archive */
|
|
6096
|
+
files: IImportedFile_2[];
|
|
6097
|
+
/** Directory structure if available */
|
|
6098
|
+
directory: IImportedDirectory_2 | undefined;
|
|
6099
|
+
}
|
|
6100
|
+
|
|
6101
|
+
/**
|
|
6102
|
+
* JSON representation of a ZIP archive manifest
|
|
6103
|
+
* Compatible with existing tools from ts-res-browser-cli
|
|
6104
|
+
* @public
|
|
6105
|
+
*/
|
|
6106
|
+
declare interface IZipArchiveManifest {
|
|
6107
|
+
/** Archive creation timestamp */
|
|
6108
|
+
timestamp: string;
|
|
6109
|
+
/** Optional input source information */
|
|
6110
|
+
input?: IZipArchiveInputInfo;
|
|
6111
|
+
/** Optional configuration file information */
|
|
6112
|
+
config?: IZipArchiveConfigInfo;
|
|
6113
|
+
}
|
|
6114
|
+
|
|
6115
|
+
/**
|
|
6116
|
+
* Standardized ZIP archive manifest format (compatible with existing tools)
|
|
6117
|
+
* @public
|
|
6118
|
+
*/
|
|
6119
|
+
declare type IZipArchiveManifest_2 = Json_2.IZipArchiveManifest;
|
|
6120
|
+
|
|
6121
|
+
/**
|
|
6122
|
+
* Options for creating a ZIP archive buffer
|
|
6123
|
+
* @public
|
|
6124
|
+
*/
|
|
6125
|
+
declare interface IZipArchivePathOptions {
|
|
6126
|
+
/** File or directory path to include in the archive */
|
|
6127
|
+
inputPath?: string;
|
|
6128
|
+
/** Optional configuration file path */
|
|
6129
|
+
configPath?: string;
|
|
6130
|
+
}
|
|
6131
|
+
|
|
6132
|
+
/**
|
|
6133
|
+
* Result of ZIP archive buffer creation
|
|
6134
|
+
* @public
|
|
6135
|
+
*/
|
|
6136
|
+
declare interface IZipArchiveResult {
|
|
6137
|
+
/** Raw ZIP data buffer */
|
|
6138
|
+
zipBuffer: Uint8Array;
|
|
6139
|
+
/** Archive manifest with metadata */
|
|
6140
|
+
manifest: IZipArchiveManifest_2;
|
|
6141
|
+
/** Total ZIP size in bytes */
|
|
6142
|
+
size: number;
|
|
6143
|
+
}
|
|
6144
|
+
|
|
4968
6145
|
/**
|
|
4969
6146
|
* Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with
|
|
4970
6147
|
* to create a new {@link ResourceId | resource ID}. Returns `undefined` if no names are defined.
|
|
@@ -5012,6 +6189,16 @@ declare namespace Json {
|
|
|
5012
6189
|
}
|
|
5013
6190
|
}
|
|
5014
6191
|
|
|
6192
|
+
declare namespace Json_2 {
|
|
6193
|
+
export {
|
|
6194
|
+
IZipArchiveInputInfo,
|
|
6195
|
+
IZipArchiveConfigInfo,
|
|
6196
|
+
IZipArchiveManifest,
|
|
6197
|
+
IImportedFile,
|
|
6198
|
+
IImportedDirectory
|
|
6199
|
+
}
|
|
6200
|
+
}
|
|
6201
|
+
|
|
5015
6202
|
/**
|
|
5016
6203
|
* {@link Import.Importers.IImporter | Importer} implementation which imports resources from a JSON object.
|
|
5017
6204
|
* @public
|
|
@@ -5039,18 +6226,29 @@ declare class JsonImporter implements IImporter {
|
|
|
5039
6226
|
private _tryImportResourceTree;
|
|
5040
6227
|
}
|
|
5041
6228
|
|
|
6229
|
+
/**
|
|
6230
|
+
* A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
6231
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
6232
|
+
* @public
|
|
6233
|
+
*/
|
|
6234
|
+
declare const jsonQualifierTypeConfig: Converter<Model_2.IQualifierTypeConfig<JsonObject>, Converters.IJsonConverterContext>;
|
|
6235
|
+
|
|
5042
6236
|
/**
|
|
5043
6237
|
* Implementation of a {@link ResourceTypes.ResourceType | ResourceType} for JSON values.
|
|
5044
6238
|
* @public
|
|
5045
6239
|
*/
|
|
5046
6240
|
declare class JsonResourceType extends ResourceType<JsonObject> {
|
|
6241
|
+
/**
|
|
6242
|
+
* {@inheritdoc ResourceTypes.ResourceType.systemTypeName}
|
|
6243
|
+
*/
|
|
6244
|
+
readonly systemTypeName: ResourceTypeName;
|
|
5047
6245
|
/**
|
|
5048
6246
|
* Protected {@link ResourceTypes.JsonResourceType | JsonResourceType} constructor for use by subclasses.
|
|
5049
6247
|
* Use {@link ResourceTypes.JsonResourceType.create | JsonResourceType.create} to create a new instance.
|
|
5050
6248
|
* @param key - The key for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
|
|
5051
6249
|
* @param index - Optional index for the new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
|
|
5052
6250
|
*/
|
|
5053
|
-
protected constructor(key: ResourceTypeName, index?: number);
|
|
6251
|
+
protected constructor(key: ResourceTypeName, index?: number, template?: JsonObject);
|
|
5054
6252
|
/**
|
|
5055
6253
|
* Factory method to create a new {@link ResourceTypes.JsonResourceType | JsonResourceType} instance.
|
|
5056
6254
|
* @param params - {@link ResourceTypes.IJsonResourceTypeCreateParams | Parameters} to create the new instance.
|
|
@@ -5065,15 +6263,15 @@ declare class JsonResourceType extends ResourceType<JsonObject> {
|
|
|
5065
6263
|
/**
|
|
5066
6264
|
* {@inheritdoc ResourceTypes.ResourceType.(validate:1)}
|
|
5067
6265
|
*/
|
|
5068
|
-
validate(json: JsonObject,
|
|
6266
|
+
validate(json: JsonObject, completeness: CandidateCompleteness): Result<JsonObject>;
|
|
5069
6267
|
/**
|
|
5070
6268
|
* {@inheritdoc ResourceTypes.ResourceType.(validate:2)}
|
|
5071
6269
|
*/
|
|
5072
|
-
validate(json: JsonObject,
|
|
6270
|
+
validate(json: JsonObject, completeness: 'full'): Result<JsonObject>;
|
|
5073
6271
|
/**
|
|
5074
6272
|
* {@inheritdoc ResourceTypes.ResourceType.(validate:3)}
|
|
5075
6273
|
*/
|
|
5076
|
-
validate(json: JsonObject,
|
|
6274
|
+
validate(json: JsonObject, completeness: 'partial'): Result<JsonObject>;
|
|
5077
6275
|
}
|
|
5078
6276
|
|
|
5079
6277
|
/**
|
|
@@ -5100,7 +6298,11 @@ declare const LanguagePrioritySystemConfiguration: ISystemConfiguration;
|
|
|
5100
6298
|
* Accepts a list of language tags in the context by default.
|
|
5101
6299
|
* @public
|
|
5102
6300
|
*/
|
|
5103
|
-
declare class LanguageQualifierType extends QualifierType {
|
|
6301
|
+
declare class LanguageQualifierType extends QualifierType<JsonCompatible<Config_2.ILanguageQualifierTypeConfig>> {
|
|
6302
|
+
/**
|
|
6303
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
6304
|
+
*/
|
|
6305
|
+
readonly systemTypeName: QualifierTypeName;
|
|
5104
6306
|
/**
|
|
5105
6307
|
* Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.
|
|
5106
6308
|
* @param name - Optional name for the qualifier type. Defaults to 'language'.
|
|
@@ -5130,6 +6332,27 @@ declare class LanguageQualifierType extends QualifierType {
|
|
|
5130
6332
|
* {@inheritdoc QualifierTypes.IQualifierType.isValidConditionValue}
|
|
5131
6333
|
*/
|
|
5132
6334
|
isValidConditionValue(value: string): value is QualifierConditionValue;
|
|
6335
|
+
/**
|
|
6336
|
+
* Gets a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
|
|
6337
|
+
* for this qualifier type.
|
|
6338
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
6339
|
+
*/
|
|
6340
|
+
getConfiguration(): Result<Config_2.ISystemLanguageQualifierTypeConfig>;
|
|
6341
|
+
/**
|
|
6342
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
6343
|
+
*/
|
|
6344
|
+
getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemLanguageQualifierTypeConfig>>;
|
|
6345
|
+
/**
|
|
6346
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
6347
|
+
*/
|
|
6348
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemLanguageQualifierTypeConfig>>;
|
|
6349
|
+
/**
|
|
6350
|
+
* Validates a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
|
|
6351
|
+
* for this qualifier type.
|
|
6352
|
+
* @param from - The unknown data to validate as a configuration object.
|
|
6353
|
+
* @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
|
|
6354
|
+
*/
|
|
6355
|
+
validateConfiguration(from: unknown): Result<Config_2.ISystemLanguageQualifierTypeConfig>;
|
|
5133
6356
|
/**
|
|
5134
6357
|
* Matches a single language condition against a single language context value using
|
|
5135
6358
|
* {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.
|
|
@@ -5146,14 +6369,18 @@ declare class LanguageQualifierType extends QualifierType {
|
|
|
5146
6369
|
* @returns A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
|
|
5147
6370
|
* @public
|
|
5148
6371
|
*/
|
|
5149
|
-
declare const languageQualifierTypeConfig: ObjectConverter<
|
|
6372
|
+
declare const languageQualifierTypeConfig: ObjectConverter<Model_2.ILanguageQualifierTypeConfig, unknown>;
|
|
5150
6373
|
|
|
5151
6374
|
/**
|
|
5152
6375
|
* A {@link QualifierTypes.QualifierType | qualifier} that matches a literal value,
|
|
5153
6376
|
* optionally case-sensitive or matching against an ordered list of values at runtime.
|
|
5154
6377
|
* @public
|
|
5155
6378
|
*/
|
|
5156
|
-
declare class LiteralQualifierType extends QualifierType {
|
|
6379
|
+
declare class LiteralQualifierType extends QualifierType<JsonCompatible<Config_2.ILiteralQualifierTypeConfig>> {
|
|
6380
|
+
/**
|
|
6381
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
6382
|
+
*/
|
|
6383
|
+
readonly systemTypeName: QualifierTypeName;
|
|
5157
6384
|
/**
|
|
5158
6385
|
* Indicates whether the qualifier match is case-sensitive.
|
|
5159
6386
|
*/
|
|
@@ -5189,6 +6416,27 @@ declare class LiteralQualifierType extends QualifierType {
|
|
|
5189
6416
|
* {@inheritdoc QualifierTypes.IQualifierType.isPotentialMatch}
|
|
5190
6417
|
*/
|
|
5191
6418
|
isPotentialMatch(conditionValue: string, contextValue: string): boolean;
|
|
6419
|
+
/**
|
|
6420
|
+
* Gets a {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | strongly typed configuration object}
|
|
6421
|
+
* for this qualifier type.
|
|
6422
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
6423
|
+
*/
|
|
6424
|
+
getConfiguration(): Result<Config_2.ISystemLiteralQualifierTypeConfig>;
|
|
6425
|
+
/**
|
|
6426
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
6427
|
+
*/
|
|
6428
|
+
getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemLiteralQualifierTypeConfig>>;
|
|
6429
|
+
/**
|
|
6430
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
6431
|
+
*/
|
|
6432
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemLiteralQualifierTypeConfig>>;
|
|
6433
|
+
/**
|
|
6434
|
+
* Validates a {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | strongly typed configuration object}
|
|
6435
|
+
* for this qualifier type.
|
|
6436
|
+
* @param from - The unknown data to validate as a configuration object.
|
|
6437
|
+
* @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
|
|
6438
|
+
*/
|
|
6439
|
+
validateConfiguration(from: unknown): Result<Config_2.ISystemLiteralQualifierTypeConfig>;
|
|
5192
6440
|
/**
|
|
5193
6441
|
* {@inheritdoc QualifierTypes.QualifierType._matchOne}
|
|
5194
6442
|
*/
|
|
@@ -5234,7 +6482,7 @@ declare class LiteralQualifierType extends QualifierType {
|
|
|
5234
6482
|
* @returns A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.
|
|
5235
6483
|
* @public
|
|
5236
6484
|
*/
|
|
5237
|
-
declare const literalQualifierTypeConfig: ObjectConverter<
|
|
6485
|
+
declare const literalQualifierTypeConfig: ObjectConverter<Model_2.ILiteralQualifierTypeConfig, unknown>;
|
|
5238
6486
|
|
|
5239
6487
|
/**
|
|
5240
6488
|
* A class that implements a hierarchy of literal values. The hierarchy is defined as a
|
|
@@ -5318,6 +6566,11 @@ declare class LiteralValueHierarchy<T extends string = string> {
|
|
|
5318
6566
|
*/
|
|
5319
6567
|
match(condition: QualifierConditionValue, context: QualifierContextValue, __operator?: ConditionOperator): QualifierMatchScore;
|
|
5320
6568
|
protected static _buildValuesFromHierarchy<T extends string>(params: ILiteralValueHierarchyCreateParams<T>): Result<ReadonlyMap<T, ILiteralValue<T>>>;
|
|
6569
|
+
/**
|
|
6570
|
+
* Converts the hierarchy to a record of parent-child relationships.
|
|
6571
|
+
* @returns A record of parent-child relationships.
|
|
6572
|
+
*/
|
|
6573
|
+
asRecord(): Record<string, string>;
|
|
5321
6574
|
}
|
|
5322
6575
|
|
|
5323
6576
|
/**
|
|
@@ -5337,7 +6590,7 @@ declare function literalValueHierarchyCreateParams<T extends string>(valueConver
|
|
|
5337
6590
|
* determine the relationship between values when matching conditions and contexts.
|
|
5338
6591
|
* @public
|
|
5339
6592
|
*/
|
|
5340
|
-
declare type LiteralValueHierarchyDecl<T extends string> =
|
|
6593
|
+
declare type LiteralValueHierarchyDecl<T extends string> = Record<T, T>;
|
|
5341
6594
|
|
|
5342
6595
|
/**
|
|
5343
6596
|
* `Converter` for a normalized {@link ResourceJson.Json.ILooseConditionDecl | loose condition declaration}.
|
|
@@ -5480,6 +6733,12 @@ declare function mergeLooseCandidate(candidate: Normalized.IImporterResourceCand
|
|
|
5480
6733
|
*/
|
|
5481
6734
|
declare function mergeLooseResource(resource: Normalized.IImporterResourceDecl, baseName?: string, baseConditions?: ReadonlyArray<Json.ILooseConditionDecl>): Result<Normalized.ILooseResourceDecl>;
|
|
5482
6735
|
|
|
6736
|
+
/**
|
|
6737
|
+
* Validator for MIME type strings
|
|
6738
|
+
* @public
|
|
6739
|
+
*/
|
|
6740
|
+
declare const mimeType: Validator<string>;
|
|
6741
|
+
|
|
5483
6742
|
/**
|
|
5484
6743
|
* Minimum valid priority for a condition.
|
|
5485
6744
|
* @public
|
|
@@ -5487,6 +6746,28 @@ declare function mergeLooseResource(resource: Normalized.IImporterResourceDecl,
|
|
|
5487
6746
|
export declare const MinConditionPriority: ConditionPriority;
|
|
5488
6747
|
|
|
5489
6748
|
declare namespace Model {
|
|
6749
|
+
export {
|
|
6750
|
+
ISystemConfiguration
|
|
6751
|
+
}
|
|
6752
|
+
}
|
|
6753
|
+
|
|
6754
|
+
declare namespace Model_2 {
|
|
6755
|
+
export {
|
|
6756
|
+
isSystemQualifierTypeConfig,
|
|
6757
|
+
IQualifierTypeConfig,
|
|
6758
|
+
ILanguageQualifierTypeConfig,
|
|
6759
|
+
LiteralValueHierarchyDecl,
|
|
6760
|
+
ITerritoryQualifierTypeConfig,
|
|
6761
|
+
ILiteralQualifierTypeConfig,
|
|
6762
|
+
ISystemLanguageQualifierTypeConfig,
|
|
6763
|
+
ISystemTerritoryQualifierTypeConfig,
|
|
6764
|
+
ISystemLiteralQualifierTypeConfig,
|
|
6765
|
+
ISystemQualifierTypeConfig,
|
|
6766
|
+
IAnyQualifierTypeConfig
|
|
6767
|
+
}
|
|
6768
|
+
}
|
|
6769
|
+
|
|
6770
|
+
declare namespace Model_3 {
|
|
5490
6771
|
export {
|
|
5491
6772
|
ICompiledConditionMetadata,
|
|
5492
6773
|
ICompiledConditionSetMetadata,
|
|
@@ -5503,22 +6784,12 @@ declare namespace Model {
|
|
|
5503
6784
|
}
|
|
5504
6785
|
}
|
|
5505
6786
|
|
|
5506
|
-
declare namespace
|
|
5507
|
-
export {
|
|
5508
|
-
ISystemConfiguration
|
|
5509
|
-
}
|
|
5510
|
-
}
|
|
5511
|
-
|
|
5512
|
-
declare namespace Model_3 {
|
|
6787
|
+
declare namespace Model_4 {
|
|
5513
6788
|
export {
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
ISystemLanguageQualifierTypeConfig,
|
|
5519
|
-
ISystemTerritoryQualifierTypeConfig,
|
|
5520
|
-
ISystemLiteralQualifierTypeConfig,
|
|
5521
|
-
ISystemQualifierTypeConfig
|
|
6789
|
+
IBundleMetadata,
|
|
6790
|
+
IBundleExportMetadata,
|
|
6791
|
+
IBundle,
|
|
6792
|
+
IBundleCreateParams
|
|
5522
6793
|
}
|
|
5523
6794
|
}
|
|
5524
6795
|
|
|
@@ -5545,6 +6816,10 @@ declare class NoOpResourceResolverCacheListener implements IResourceResolverCach
|
|
|
5545
6816
|
* {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheError}
|
|
5546
6817
|
*/
|
|
5547
6818
|
onCacheError(cache: ResourceResolverCacheType, index: number): void;
|
|
6819
|
+
/**
|
|
6820
|
+
* {@inheritDoc Runtime.IResourceResolverCacheListener.onContextError}
|
|
6821
|
+
*/
|
|
6822
|
+
onContextError(qualifier: string, error: string): void;
|
|
5548
6823
|
/**
|
|
5549
6824
|
* {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheClear}
|
|
5550
6825
|
*/
|
|
@@ -5568,6 +6843,14 @@ declare namespace Normalized {
|
|
|
5568
6843
|
}
|
|
5569
6844
|
}
|
|
5570
6845
|
|
|
6846
|
+
/**
|
|
6847
|
+
* Normalize path separators for cross-platform compatibility
|
|
6848
|
+
* @param path - Path to normalize
|
|
6849
|
+
* @returns Normalized path
|
|
6850
|
+
* @public
|
|
6851
|
+
*/
|
|
6852
|
+
declare function normalizePath(path: string): string;
|
|
6853
|
+
|
|
5571
6854
|
/**
|
|
5572
6855
|
* Overall cache metrics across all cache types.
|
|
5573
6856
|
* @public
|
|
@@ -5622,6 +6905,22 @@ declare function parseQualifierDefaultValuesTokenParts(token: string): Result<IQ
|
|
|
5622
6905
|
*/
|
|
5623
6906
|
declare function parseQualifierDefaultValueTokenParts(token: string): Result<IQualifierDefaultValueTokenParts>;
|
|
5624
6907
|
|
|
6908
|
+
/**
|
|
6909
|
+
* Parse and validate configuration JSON
|
|
6910
|
+
* @param configData - JSON string containing configuration
|
|
6911
|
+
* @returns Result containing validated configuration
|
|
6912
|
+
* @public
|
|
6913
|
+
*/
|
|
6914
|
+
declare function parseZipArchiveConfiguration(configData: string): Result<Model.ISystemConfiguration>;
|
|
6915
|
+
|
|
6916
|
+
/**
|
|
6917
|
+
* Parse and validate a ZIP archive manifest
|
|
6918
|
+
* @param manifestData - JSON string containing manifest data
|
|
6919
|
+
* @returns Result containing validated manifest
|
|
6920
|
+
* @public
|
|
6921
|
+
*/
|
|
6922
|
+
declare function parseZipArchiveManifest(manifestData: string): Result<Json_2.IZipArchiveManifest>;
|
|
6923
|
+
|
|
5625
6924
|
/**
|
|
5626
6925
|
* {@link Import.Importers.IImporter | Importer} implementation which imports resources from a `FileTree`
|
|
5627
6926
|
* given a path.
|
|
@@ -5692,7 +6991,7 @@ declare const predefinedSystemConfiguration: Converter<PredefinedSystemConfigura
|
|
|
5692
6991
|
* which a resource is used.
|
|
5693
6992
|
* @public
|
|
5694
6993
|
*/
|
|
5695
|
-
declare class Qualifier implements IValidatedQualifierDecl, ICollectible<QualifierName, QualifierIndex> {
|
|
6994
|
+
export declare class Qualifier implements IValidatedQualifierDecl, ICollectible<QualifierName, QualifierIndex> {
|
|
5696
6995
|
/**
|
|
5697
6996
|
* The name of the qualifier.
|
|
5698
6997
|
*/
|
|
@@ -6031,7 +7330,7 @@ declare const qualifierName: Converter<QualifierName, unknown>;
|
|
|
6031
7330
|
|
|
6032
7331
|
declare namespace Qualifiers {
|
|
6033
7332
|
export {
|
|
6034
|
-
|
|
7333
|
+
Convert_4 as Convert,
|
|
6035
7334
|
Qualifier,
|
|
6036
7335
|
IQualifierDecl,
|
|
6037
7336
|
IValidatedQualifierDecl,
|
|
@@ -6052,11 +7351,15 @@ export { Qualifiers }
|
|
|
6052
7351
|
* the {@link QualifierTypes.IQualifierType | IQualifierType} interface.
|
|
6053
7352
|
* @public
|
|
6054
7353
|
*/
|
|
6055
|
-
declare abstract class QualifierType implements IQualifierType {
|
|
7354
|
+
export declare abstract class QualifierType<TCFGJSON extends JsonObject = JsonObject> implements IQualifierType<TCFGJSON> {
|
|
6056
7355
|
/**
|
|
6057
7356
|
* {@inheritdoc QualifierTypes.IQualifierType.name}
|
|
6058
7357
|
*/
|
|
6059
7358
|
readonly name: QualifierTypeName;
|
|
7359
|
+
/**
|
|
7360
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
7361
|
+
*/
|
|
7362
|
+
abstract readonly systemTypeName: QualifierTypeName;
|
|
6060
7363
|
/**
|
|
6061
7364
|
* {@inheritdoc QualifierTypes.IQualifierType.key}
|
|
6062
7365
|
*/
|
|
@@ -6102,6 +7405,14 @@ declare abstract class QualifierType implements IQualifierType {
|
|
|
6102
7405
|
* {@inheritdoc QualifierTypes.IQualifierType.matches}
|
|
6103
7406
|
*/
|
|
6104
7407
|
matches(condition: QualifierConditionValue, context: QualifierContextValue, operator: ConditionOperator): QualifierMatchScore;
|
|
7408
|
+
/**
|
|
7409
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
7410
|
+
*/
|
|
7411
|
+
abstract getConfigurationJson(): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
|
|
7412
|
+
/**
|
|
7413
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
7414
|
+
*/
|
|
7415
|
+
abstract validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
|
|
6105
7416
|
/**
|
|
6106
7417
|
* {@inheritdoc QualifierTypes.IQualifierType.setIndex}
|
|
6107
7418
|
*/
|
|
@@ -6157,7 +7468,7 @@ declare abstract class QualifierType implements IQualifierType {
|
|
|
6157
7468
|
* index from a supplied {@link QualifierTypes.Convert.IQualifierTypeConvertContext | conversion context}.
|
|
6158
7469
|
* @public
|
|
6159
7470
|
*/
|
|
6160
|
-
declare const qualifierType: Converter<QualifierType
|
|
7471
|
+
declare const qualifierType: Converter<QualifierType<JsonObject>, IQualifierTypeConvertContext>;
|
|
6161
7472
|
|
|
6162
7473
|
/**
|
|
6163
7474
|
* Collector for {@link QualifierTypes.QualifierType | QualifierType} objects.
|
|
@@ -6181,6 +7492,74 @@ declare class QualifierTypeCollector extends ValidatingConvertingCollector<Quali
|
|
|
6181
7492
|
protected static _toQualifierType(from: unknown): Result<QualifierType>;
|
|
6182
7493
|
}
|
|
6183
7494
|
|
|
7495
|
+
/**
|
|
7496
|
+
* A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
7497
|
+
* @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
|
|
7498
|
+
* @param config - A `Converter` for the configuration object.
|
|
7499
|
+
* @public
|
|
7500
|
+
*/
|
|
7501
|
+
declare function qualifierTypeConfig<T, TD = unknown>(config: Converter<T, TD>): Converter<Model_2.IQualifierTypeConfig<T>, TD>;
|
|
7502
|
+
|
|
7503
|
+
/**
|
|
7504
|
+
* A factory that creates {@link QualifierTypes.QualifierType | QualifierType} instances from configuration,
|
|
7505
|
+
* supporting both built-in system types and custom external types.
|
|
7506
|
+
*
|
|
7507
|
+
* This factory allows external consumers to extend the qualifier type system with their own custom types
|
|
7508
|
+
* while maintaining support for all built-in types (Language, Territory, Literal).
|
|
7509
|
+
*
|
|
7510
|
+
* @typeParam T - The custom qualifier type(s) to support. Defaults to {@link QualifierTypes.SystemQualifierType | SystemQualifierType}.
|
|
7511
|
+
*
|
|
7512
|
+
* @example Creating a factory with custom qualifier types
|
|
7513
|
+
* ```typescript
|
|
7514
|
+
* // Define a custom qualifier type
|
|
7515
|
+
* class CustomQualifierType extends QualifierType {
|
|
7516
|
+
* // ... implementation
|
|
7517
|
+
* }
|
|
7518
|
+
*
|
|
7519
|
+
* // Define a discriminated union of all types
|
|
7520
|
+
* type AppQualifierType = SystemQualifierType | CustomQualifierType;
|
|
7521
|
+
*
|
|
7522
|
+
* // Create a factory that handles custom types
|
|
7523
|
+
* const customFactory: IConfigInitFactory<IAnyQualifierTypeConfig, CustomQualifierType> = {
|
|
7524
|
+
* create(config) {
|
|
7525
|
+
* // ... handle custom type creation
|
|
7526
|
+
* }
|
|
7527
|
+
* };
|
|
7528
|
+
*
|
|
7529
|
+
* // Create the combined factory
|
|
7530
|
+
* const qualifierTypeFactory = new QualifierTypeFactory<AppQualifierType>([customFactory]);
|
|
7531
|
+
*
|
|
7532
|
+
* // The factory returns T | SystemQualifierType, supporting all types
|
|
7533
|
+
* const result = qualifierTypeFactory.create(config); // Result<AppQualifierType | SystemQualifierType>
|
|
7534
|
+
* ```
|
|
7535
|
+
*
|
|
7536
|
+
* @remarks
|
|
7537
|
+
* - The factory chains custom factories with the built-in factory
|
|
7538
|
+
* - Custom factories are tried first, falling back to built-in types
|
|
7539
|
+
* - The return type is a union of custom types (T) and system types
|
|
7540
|
+
*
|
|
7541
|
+
* @public
|
|
7542
|
+
*/
|
|
7543
|
+
declare class QualifierTypeFactory<T extends QualifierType = SystemQualifierType> extends ChainedConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T | SystemQualifierType> {
|
|
7544
|
+
/**
|
|
7545
|
+
* Constructor for a {@link Config.QualifierTypeFactory | qualifier type factory}.
|
|
7546
|
+
* @param factories - Array of factories for custom qualifier types. Can be:
|
|
7547
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
7548
|
+
* - {@link Config.QualifierTypeFactoryFunction | Factory functions}
|
|
7549
|
+
* - A mix of both
|
|
7550
|
+
* These are tried in order before falling back to built-in types.
|
|
7551
|
+
* @remarks The {@link Config.BuiltInQualifierTypeFactory | built-in factory} is always appended to handle
|
|
7552
|
+
* system qualifier types (Language, Territory, Literal).
|
|
7553
|
+
*/
|
|
7554
|
+
constructor(factories: Array<IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T> | QualifierTypeFactoryFunction<T>>);
|
|
7555
|
+
}
|
|
7556
|
+
|
|
7557
|
+
/**
|
|
7558
|
+
* Function signature for creating a qualifier type from configuration.
|
|
7559
|
+
* @public
|
|
7560
|
+
*/
|
|
7561
|
+
declare type QualifierTypeFactoryFunction<T extends QualifierType = QualifierType> = (config: QualifierTypes.Config.IAnyQualifierTypeConfig) => Result<T>;
|
|
7562
|
+
|
|
6184
7563
|
/**
|
|
6185
7564
|
* Branded number representing a validated qualifier type index.
|
|
6186
7565
|
* @public
|
|
@@ -6208,7 +7587,7 @@ declare const qualifierTypeName: Converter<QualifierTypeName, unknown>;
|
|
|
6208
7587
|
declare namespace QualifierTypes {
|
|
6209
7588
|
export {
|
|
6210
7589
|
Config_2 as Config,
|
|
6211
|
-
|
|
7590
|
+
Convert_3 as Convert,
|
|
6212
7591
|
IQualifierType,
|
|
6213
7592
|
IQualifierTypeCreateParams,
|
|
6214
7593
|
QualifierType,
|
|
@@ -6216,7 +7595,6 @@ declare namespace QualifierTypes {
|
|
|
6216
7595
|
LanguageQualifierType,
|
|
6217
7596
|
ILiteralQualifierTypeCreateParams,
|
|
6218
7597
|
LiteralQualifierType,
|
|
6219
|
-
LiteralValueHierarchyDecl,
|
|
6220
7598
|
ILiteralValue,
|
|
6221
7599
|
ILiteralValueHierarchyCreateParams,
|
|
6222
7600
|
LiteralValueHierarchy,
|
|
@@ -6226,7 +7604,8 @@ declare namespace QualifierTypes {
|
|
|
6226
7604
|
QualifierTypeCollector,
|
|
6227
7605
|
ReadOnlyQualifierTypeCollector,
|
|
6228
7606
|
createQualifierTypeFromConfig,
|
|
6229
|
-
createQualifierTypeFromSystemConfig
|
|
7607
|
+
createQualifierTypeFromSystemConfig,
|
|
7608
|
+
SystemQualifierType
|
|
6230
7609
|
}
|
|
6231
7610
|
}
|
|
6232
7611
|
export { QualifierTypes }
|
|
@@ -6394,6 +7773,7 @@ declare namespace RegularExpressions {
|
|
|
6394
7773
|
contextToken_2 as contextToken,
|
|
6395
7774
|
conditionSetHash_2 as conditionSetHash,
|
|
6396
7775
|
decisionKey_2 as decisionKey,
|
|
7776
|
+
candidateValueKey_2 as candidateValueKey,
|
|
6397
7777
|
qualifierDefaultValueToken_2 as qualifierDefaultValueToken,
|
|
6398
7778
|
qualifierDefaultValuesToken_2 as qualifierDefaultValuesToken,
|
|
6399
7779
|
territoryCode
|
|
@@ -6405,15 +7785,19 @@ declare namespace RegularExpressions {
|
|
|
6405
7785
|
* candidate instances.
|
|
6406
7786
|
* @public
|
|
6407
7787
|
*/
|
|
6408
|
-
declare class Resource implements IResource {
|
|
7788
|
+
export declare class Resource implements IResource {
|
|
6409
7789
|
/**
|
|
6410
7790
|
* The unique {@link ResourceId | id} of the resource.
|
|
6411
7791
|
*/
|
|
6412
7792
|
readonly id: ResourceId;
|
|
7793
|
+
/**
|
|
7794
|
+
* The name of the resource.
|
|
7795
|
+
*/
|
|
7796
|
+
readonly name: ResourceName;
|
|
6413
7797
|
/**
|
|
6414
7798
|
* The {@link ResourceTypes.ResourceType | type} of the resource.
|
|
6415
7799
|
*/
|
|
6416
|
-
readonly
|
|
7800
|
+
readonly resourceType: ResourceType;
|
|
6417
7801
|
/**
|
|
6418
7802
|
* The array of {@link Resources.ResourceCandidate | candidates} for the resource.
|
|
6419
7803
|
*/
|
|
@@ -6422,10 +7806,6 @@ declare class Resource implements IResource {
|
|
|
6422
7806
|
* {@link Decisions.ConcreteDecision | Decision} for optimized resource resolution.
|
|
6423
7807
|
*/
|
|
6424
7808
|
readonly decision: ConcreteDecision;
|
|
6425
|
-
/**
|
|
6426
|
-
* Gets the resource type (implements IResource interface).
|
|
6427
|
-
*/
|
|
6428
|
-
get resourceType(): ResourceType;
|
|
6429
7809
|
/**
|
|
6430
7810
|
* Gets the resource type name as a string.
|
|
6431
7811
|
*/
|
|
@@ -6550,6 +7930,10 @@ declare class ResourceBuilder {
|
|
|
6550
7930
|
* Collector for {@link Decisions.AbstractDecision | abstract decisions}.
|
|
6551
7931
|
*/
|
|
6552
7932
|
protected _decisions: AbstractDecisionCollector;
|
|
7933
|
+
/**
|
|
7934
|
+
* Collector for candidate values.
|
|
7935
|
+
*/
|
|
7936
|
+
protected _candidateValues: CandidateValueCollector;
|
|
6553
7937
|
/**
|
|
6554
7938
|
* Constructor for a {@link Resources.ResourceBuilder | ResourceBuilder} object.
|
|
6555
7939
|
* @param params - Parameters to construct the new {@link Resources.ResourceBuilder | ResourceBuilder}.
|
|
@@ -6621,16 +8005,22 @@ declare type ResourceBuilderResultDetail = Collections.ResultMapResultDetail | '
|
|
|
6621
8005
|
* and instructions on how to merge it with other instances.
|
|
6622
8006
|
* @public
|
|
6623
8007
|
*/
|
|
6624
|
-
declare class ResourceCandidate implements IResourceCandidate {
|
|
8008
|
+
export declare class ResourceCandidate implements IResourceCandidate {
|
|
6625
8009
|
/**
|
|
6626
8010
|
* The unique identifier of the resource for which this candidate
|
|
6627
8011
|
* is a possible instance.
|
|
6628
8012
|
*/
|
|
6629
8013
|
readonly id: ResourceId;
|
|
8014
|
+
/**
|
|
8015
|
+
* The candidate value that contains the JSON representation of the instance data.
|
|
8016
|
+
*/
|
|
8017
|
+
readonly candidateValue: CandidateValue;
|
|
6630
8018
|
/**
|
|
6631
8019
|
* The JSON representation of the instance data to be applied.
|
|
8020
|
+
* @remarks
|
|
8021
|
+
* This property provides access to the JSON data from the underlying candidate value.
|
|
6632
8022
|
*/
|
|
6633
|
-
|
|
8023
|
+
get json(): JsonObject;
|
|
6634
8024
|
/**
|
|
6635
8025
|
* The conditions under which this candidate applies.
|
|
6636
8026
|
*/
|
|
@@ -6648,6 +8038,10 @@ declare class ResourceCandidate implements IResourceCandidate {
|
|
|
6648
8038
|
* this candidate belongs.
|
|
6649
8039
|
*/
|
|
6650
8040
|
readonly resourceType: ResourceType | undefined;
|
|
8041
|
+
/**
|
|
8042
|
+
* The completeness of the candidate value.
|
|
8043
|
+
*/
|
|
8044
|
+
get completeness(): CandidateCompleteness;
|
|
6651
8045
|
/**
|
|
6652
8046
|
* Constructor for a {@link Resources.ResourceCandidate | ResourceCandidate} object.
|
|
6653
8047
|
* @param params - Parameters to create a new {@link Resources.ResourceCandidate | ResourceCandidate}.
|
|
@@ -6820,6 +8214,17 @@ declare class ResourceDeclTree implements IResourceDeclContainer {
|
|
|
6820
8214
|
private _extract;
|
|
6821
8215
|
}
|
|
6822
8216
|
|
|
8217
|
+
/**
|
|
8218
|
+
* Type for handling resource resolution errors during tree traversal.
|
|
8219
|
+
* The handler receives the resource that failed to resolve, the error message, and the resolver for recovery attempts.
|
|
8220
|
+
* It can return:
|
|
8221
|
+
* - Success(undefined) to omit the property from the result
|
|
8222
|
+
* - Success(value) to use an alternate value
|
|
8223
|
+
* - Failure to propagate the error
|
|
8224
|
+
* @public
|
|
8225
|
+
*/
|
|
8226
|
+
declare type ResourceErrorHandler = (resource: IResource, message: string, resolver: ResourceResolver) => Result<JsonValue | undefined>;
|
|
8227
|
+
|
|
6823
8228
|
/**
|
|
6824
8229
|
* Branded string representing a validated resource id. A resource ID
|
|
6825
8230
|
* is a dot-separated sequence of resource names.
|
|
@@ -6848,7 +8253,7 @@ declare const resourceIndex: Converter<ResourceIndex, unknown>;
|
|
|
6848
8253
|
declare namespace ResourceJson {
|
|
6849
8254
|
export {
|
|
6850
8255
|
Compiled,
|
|
6851
|
-
|
|
8256
|
+
Convert_7 as Convert,
|
|
6852
8257
|
Helpers_2 as Helpers,
|
|
6853
8258
|
Json,
|
|
6854
8259
|
Normalized,
|
|
@@ -6866,15 +8271,59 @@ export { ResourceJson }
|
|
|
6866
8271
|
* and builds a collection of {@link Resources.Resource | resources} once all candidates are collected.
|
|
6867
8272
|
* @public
|
|
6868
8273
|
*/
|
|
6869
|
-
declare class ResourceManagerBuilder implements IResourceManager {
|
|
8274
|
+
export declare class ResourceManagerBuilder implements IResourceManager<Resource> {
|
|
8275
|
+
/**
|
|
8276
|
+
* The {@link Qualifiers.IReadOnlyQualifierCollector | qualifiers} used by this resource manager.
|
|
8277
|
+
*/
|
|
6870
8278
|
readonly qualifiers: IReadOnlyQualifierCollector;
|
|
8279
|
+
/**
|
|
8280
|
+
* The {@link ResourceTypes.ReadOnlyResourceTypeCollector | resource types} used by this resource manager.
|
|
8281
|
+
*/
|
|
6871
8282
|
readonly resourceTypes: ReadOnlyResourceTypeCollector;
|
|
8283
|
+
/**
|
|
8284
|
+
* The {@link Conditions.ConditionCollector | condition collector} used by this resource manager.
|
|
8285
|
+
* @internal
|
|
8286
|
+
*/
|
|
6872
8287
|
protected readonly _conditions: ConditionCollector;
|
|
8288
|
+
/**
|
|
8289
|
+
* The {@link Conditions.ConditionSetCollector | condition set collector} used by this resource manager.
|
|
8290
|
+
* @internal
|
|
8291
|
+
*/
|
|
6873
8292
|
protected readonly _conditionSets: ConditionSetCollector;
|
|
8293
|
+
/**
|
|
8294
|
+
* The {@link Decisions.AbstractDecisionCollector | abstract decision collector} used by this resource manager.
|
|
8295
|
+
* @internal
|
|
8296
|
+
*/
|
|
6874
8297
|
protected readonly _decisions: AbstractDecisionCollector;
|
|
8298
|
+
/**
|
|
8299
|
+
* The candidate value collector used by this resource manager.
|
|
8300
|
+
* @internal
|
|
8301
|
+
*/
|
|
8302
|
+
protected readonly _candidateValues: CandidateValueCollector;
|
|
8303
|
+
/**
|
|
8304
|
+
* The {@link Resources.ResourceBuilder | resource builders} used by this resource manager.
|
|
8305
|
+
* @internal
|
|
8306
|
+
*/
|
|
6875
8307
|
protected readonly _resources: ValidatingResultMap<ResourceId, ResourceBuilder>;
|
|
6876
|
-
|
|
8308
|
+
/**
|
|
8309
|
+
* The {@link Resources.Resource | resources} built by this resource manager.
|
|
8310
|
+
* @internal
|
|
8311
|
+
*/
|
|
8312
|
+
protected readonly _builtResources: ValidatingResultMap<ResourceId, Resource>;
|
|
8313
|
+
/**
|
|
8314
|
+
* Whether the resources have been built.
|
|
8315
|
+
* @internal
|
|
8316
|
+
*/
|
|
6877
8317
|
protected _built: boolean;
|
|
8318
|
+
/**
|
|
8319
|
+
* The cached resource tree for this resource manager.
|
|
8320
|
+
* @internal
|
|
8321
|
+
*/
|
|
8322
|
+
protected _cachedResourceTree?: ResourceTree.IReadOnlyResourceTreeRoot<Resource>;
|
|
8323
|
+
/**
|
|
8324
|
+
* The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier types} used by this resource manager.
|
|
8325
|
+
*/
|
|
8326
|
+
get qualifierTypes(): ReadOnlyQualifierTypeCollector;
|
|
6878
8327
|
/**
|
|
6879
8328
|
* A {@link Conditions.ConditionCollector | ConditionCollector} which
|
|
6880
8329
|
* contains the {@link Conditions.Condition | conditions} used so far by
|
|
@@ -6931,6 +8380,26 @@ declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
6931
8380
|
* @public
|
|
6932
8381
|
*/
|
|
6933
8382
|
static create(params: IResourceManagerBuilderCreateParams): Result<ResourceManagerBuilder>;
|
|
8383
|
+
/**
|
|
8384
|
+
* Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object from a predefined system configuration.
|
|
8385
|
+
* @param name - The name of the predefined system configuration to use.
|
|
8386
|
+
* @param qualifierDefaultValues - Optional default values for qualifiers.
|
|
8387
|
+
* @returns `Success` with the new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object if successful,
|
|
8388
|
+
* or `Failure` with an error message if not.
|
|
8389
|
+
* @public
|
|
8390
|
+
*/
|
|
8391
|
+
static createPredefined(name: Config.PredefinedSystemConfiguration, qualifierDefaultValues?: Config.ISystemConfigurationInitParams['qualifierDefaultValues']): Result<ResourceManagerBuilder>;
|
|
8392
|
+
/**
|
|
8393
|
+
* Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} from a
|
|
8394
|
+
* {@link ResourceJson.Compiled.ICompiledResourceCollection | compiled resource collection}.
|
|
8395
|
+
* This method reconstructs an exactly equivalent builder where all qualifier, condition,
|
|
8396
|
+
* condition set, and decision indices match the original compiled collection.
|
|
8397
|
+
* @param compiledCollection - The compiled resource collection to reconstruct from.
|
|
8398
|
+
* @param systemConfig - The system configuration containing qualifiers and resource types.
|
|
8399
|
+
* @returns `Success` with the new manager if successful, or `Failure` with an error message if not.
|
|
8400
|
+
* @public
|
|
8401
|
+
*/
|
|
8402
|
+
static createFromCompiledResourceCollection(compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection, systemConfig: Config.SystemConfiguration): Result<ResourceManagerBuilder>;
|
|
6934
8403
|
/**
|
|
6935
8404
|
* Given a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration}, builds and adds
|
|
6936
8405
|
* a {@link Resources.ResourceCandidate | candidate} to the manager.
|
|
@@ -6940,6 +8409,20 @@ declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
6940
8409
|
*/
|
|
6941
8410
|
addLooseCandidate(decl: ResourceJson.Json.ILooseResourceCandidateDecl): DetailedResult<ResourceCandidate, ResourceBuilderResultDetail>;
|
|
6942
8411
|
addResource(decl: ResourceJson.Json.ILooseResourceDecl): DetailedResult<ResourceBuilder, ResourceBuilderResultDetail>;
|
|
8412
|
+
/**
|
|
8413
|
+
* Adds a condition to the manager.
|
|
8414
|
+
* @param decl - The condition declaration to add.
|
|
8415
|
+
* @returns `Success` with the condition if successful, or `Failure` with an error message if not.
|
|
8416
|
+
* @public
|
|
8417
|
+
*/
|
|
8418
|
+
addCondition(decl: ResourceJson.Json.ILooseConditionDecl): Result<Condition>;
|
|
8419
|
+
/**
|
|
8420
|
+
* Adds a condition set to the manager.
|
|
8421
|
+
* @param decl - The condition set declaration to add.
|
|
8422
|
+
* @returns `Success` with the condition set if successful, or `Failure` with an error message if not.
|
|
8423
|
+
* @public
|
|
8424
|
+
*/
|
|
8425
|
+
addConditionSet(conditions: ResourceJson.Normalized.ConditionSetDecl): Result<ConditionSet>;
|
|
6943
8426
|
/**
|
|
6944
8427
|
* Gets a read-only array of all {@link Resources.ResourceBuilder | resource builders} present in the manager.
|
|
6945
8428
|
* @returns `Success` with the {@link Resources.ResourceBuilder | resource builder} if successful,
|
|
@@ -6970,6 +8453,19 @@ declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
6970
8453
|
* @public
|
|
6971
8454
|
*/
|
|
6972
8455
|
getAllBuiltResources(): Result<ReadonlyArray<Resource>>;
|
|
8456
|
+
/**
|
|
8457
|
+
* Builds and returns a hierarchical tree representation of all resources managed by this builder.
|
|
8458
|
+
* Resources are organized based on their dot-separated resource IDs (e.g., "app.messages.welcome"
|
|
8459
|
+
* becomes a tree with "app" as root, "messages" as branch, and "welcome" as leaf).
|
|
8460
|
+
*
|
|
8461
|
+
* String-based validation is available through the `children.validating` property,
|
|
8462
|
+
* allowing callers to use `tree.children.validating.getById(stringId)` for validated access.
|
|
8463
|
+
*
|
|
8464
|
+
* Uses lazy initialization with caching for performance.
|
|
8465
|
+
* @returns Result containing the resource tree root, or failure if tree construction fails
|
|
8466
|
+
* @public
|
|
8467
|
+
*/
|
|
8468
|
+
getBuiltResourceTree(): Result<ResourceTree.IReadOnlyResourceTreeRoot<Resource>>;
|
|
6973
8469
|
/**
|
|
6974
8470
|
* Gets a read-only array of all {@link Resources.Resource | built resources} in the manager.
|
|
6975
8471
|
* @returns `Success` with an array of resources if successful, or `Failure` with an error message if not.
|
|
@@ -7043,14 +8539,98 @@ declare class ResourceManagerBuilder implements IResourceManager {
|
|
|
7043
8539
|
*/
|
|
7044
8540
|
getResourceCollectionDecl(options?: IResourceDeclarationOptions): Result<ResourceJson.Normalized.IResourceCollectionDecl>;
|
|
7045
8541
|
/**
|
|
7046
|
-
* Creates a
|
|
7047
|
-
* This
|
|
7048
|
-
*
|
|
7049
|
-
*
|
|
7050
|
-
*
|
|
8542
|
+
* Creates a clone of this ResourceManagerBuilder with optional configuration overrides.
|
|
8543
|
+
* This method creates a new ResourceManagerBuilder that can optionally use different
|
|
8544
|
+
* qualifiers and/or resource types than the original. It can also be filtered to include
|
|
8545
|
+
* only candidates that match the provided context and apply candidate edits.
|
|
8546
|
+
*
|
|
8547
|
+
* @param options - Options for the cloning operation:
|
|
8548
|
+
* - `qualifiers`: Optional qualifier collector to use instead of the original
|
|
8549
|
+
* - `resourceTypes`: Optional resource type collector to use instead of the original
|
|
8550
|
+
* - `filterForContext`: Optional context filter for candidates
|
|
8551
|
+
* - `candidates`: Optional candidate edits to apply during cloning
|
|
8552
|
+
* @returns A Result containing the new ResourceManagerBuilder with the specified configuration.
|
|
7051
8553
|
* @public
|
|
7052
8554
|
*/
|
|
7053
|
-
clone(options?:
|
|
8555
|
+
clone(options?: IResourceManagerCloneOptions): Result<ResourceManagerBuilder>;
|
|
8556
|
+
/**
|
|
8557
|
+
* Creates a resource ID keyed map from an array of loose resource candidate declarations.
|
|
8558
|
+
* This enables efficient detection of edit collisions by grouping candidates by their target resource.
|
|
8559
|
+
* @param candidates - Array of loose resource candidate declarations to organize
|
|
8560
|
+
* @returns A Result containing a Map where keys are validated ResourceIds and values are arrays of candidates for that resource
|
|
8561
|
+
* @internal
|
|
8562
|
+
*/
|
|
8563
|
+
private static _createCandidatesByResourceMap;
|
|
8564
|
+
/**
|
|
8565
|
+
* Generates a proper ConditionSet token for collision detection using the existing ConditionSet.getKeyForDecl method.
|
|
8566
|
+
* @param conditionSet - The condition set to generate a token for
|
|
8567
|
+
* @param conditionCollector - The condition collector needed for validation context
|
|
8568
|
+
* @returns A Result containing the ConditionSet token if successful, or failure if validation fails
|
|
8569
|
+
* @internal
|
|
8570
|
+
*/
|
|
8571
|
+
/**
|
|
8572
|
+
* Applies candidate edits to a resource declaration, handling collisions using condition set tokens.
|
|
8573
|
+
* If there's no collision, adds the candidate. If there's a collision, replaces the original candidate with the edit.
|
|
8574
|
+
* @param resourceDecl - The original resource declaration to potentially modify
|
|
8575
|
+
* @param candidatesByResource - Map of resource IDs to arrays of candidate edits
|
|
8576
|
+
* @param conditionCollector - The condition collector needed for generating condition tokens
|
|
8577
|
+
* @returns A Result containing the resource declaration to use (original or modified)
|
|
8578
|
+
* @internal
|
|
8579
|
+
*/
|
|
8580
|
+
private static _applyEditsToResourceDeclaration;
|
|
8581
|
+
/**
|
|
8582
|
+
* Creates a new resource declaration from an array of candidate declarations.
|
|
8583
|
+
* This is used when cloning to create new resources that don't exist in the original manager.
|
|
8584
|
+
* @param resourceId - The validated resource ID for the new resource
|
|
8585
|
+
* @param candidates - Array of loose candidate declarations for the new resource
|
|
8586
|
+
* @param conditionCollector - The condition collector for validation context
|
|
8587
|
+
* @returns A Result containing the new resource declaration if successful, or failure if validation fails
|
|
8588
|
+
* @internal
|
|
8589
|
+
*/
|
|
8590
|
+
private static _createResourceDeclFromCandidates;
|
|
8591
|
+
/**
|
|
8592
|
+
* Reconstructs conditions from a compiled collection and adds them to the builder.
|
|
8593
|
+
* @param builder - The builder to add conditions to.
|
|
8594
|
+
* @param compiledCollection - The compiled collection containing conditions.
|
|
8595
|
+
* @returns `Success` if all conditions were added successfully, `Failure` otherwise.
|
|
8596
|
+
* @internal
|
|
8597
|
+
*/
|
|
8598
|
+
private static _reconstructConditions;
|
|
8599
|
+
/**
|
|
8600
|
+
* Reconstructs condition sets from a compiled collection and adds them to the builder.
|
|
8601
|
+
* @param builder - The builder to add condition sets to.
|
|
8602
|
+
* @param compiledCollection - The compiled collection containing condition sets.
|
|
8603
|
+
* @returns `Success` if all condition sets were added successfully, `Failure` otherwise.
|
|
8604
|
+
* @internal
|
|
8605
|
+
*/
|
|
8606
|
+
private static _reconstructConditionSets;
|
|
8607
|
+
/**
|
|
8608
|
+
* Reconstructs decisions from a compiled collection and adds them to the builder.
|
|
8609
|
+
* @param builder - The builder to add decisions to.
|
|
8610
|
+
* @param compiledCollection - The compiled collection containing decisions.
|
|
8611
|
+
* @returns `Success` if all decisions were added successfully, `Failure` otherwise.
|
|
8612
|
+
* @internal
|
|
8613
|
+
*/
|
|
8614
|
+
private static _reconstructDecisions;
|
|
8615
|
+
/**
|
|
8616
|
+
* Reconstructs resources and their candidates from a compiled collection and adds them to the builder.
|
|
8617
|
+
* @param builder - The builder to add resources to.
|
|
8618
|
+
* @param compiledCollection - The compiled collection containing resources.
|
|
8619
|
+
* @returns `Success` if all resources were added successfully, `Failure` otherwise.
|
|
8620
|
+
* @internal
|
|
8621
|
+
*/
|
|
8622
|
+
private static _reconstructResources;
|
|
8623
|
+
/**
|
|
8624
|
+
* Helper method to create candidates from a decision's condition sets.
|
|
8625
|
+
* @param compiledResource - The compiled resource containing candidates.
|
|
8626
|
+
* @param decision - The decision containing condition sets.
|
|
8627
|
+
* @param resourceType - The resource type for the candidates.
|
|
8628
|
+
* @param builder - The builder to add candidates to.
|
|
8629
|
+
* @param candidateValues - Array of candidate values indexed by valueIndex.
|
|
8630
|
+
* @returns `Success` if all candidates were added successfully, `Failure` otherwise.
|
|
8631
|
+
* @internal
|
|
8632
|
+
*/
|
|
8633
|
+
private static _createCandidatesFromDecision;
|
|
7054
8634
|
}
|
|
7055
8635
|
|
|
7056
8636
|
/**
|
|
@@ -7077,7 +8657,7 @@ declare const resourceName: Converter<ResourceName, unknown>;
|
|
|
7077
8657
|
* and caching results for optimal performance.
|
|
7078
8658
|
* @public
|
|
7079
8659
|
*/
|
|
7080
|
-
declare class ResourceResolver {
|
|
8660
|
+
export declare class ResourceResolver implements IResourceResolver {
|
|
7081
8661
|
/**
|
|
7082
8662
|
* The resource manager that defines available resources and provides condition access.
|
|
7083
8663
|
*/
|
|
@@ -7090,6 +8670,14 @@ declare class ResourceResolver {
|
|
|
7090
8670
|
* The context qualifier provider that resolves qualifier values.
|
|
7091
8671
|
*/
|
|
7092
8672
|
readonly contextQualifierProvider: IContextQualifierProvider;
|
|
8673
|
+
/**
|
|
8674
|
+
* The configuration options for this resource resolver.
|
|
8675
|
+
*/
|
|
8676
|
+
readonly options: IResourceResolverOptions;
|
|
8677
|
+
/**
|
|
8678
|
+
* The readonly qualifier collector that provides qualifier implementations.
|
|
8679
|
+
*/
|
|
8680
|
+
get qualifiers(): IReadOnlyQualifierCollector;
|
|
7093
8681
|
/**
|
|
7094
8682
|
* The cache array for resolved conditions, indexed by condition index for O(1) lookup.
|
|
7095
8683
|
* Each entry stores the resolved {@link Runtime.IConditionMatchResult | condition match result} for
|
|
@@ -7174,6 +8762,15 @@ declare class ResourceResolver {
|
|
|
7174
8762
|
* @public
|
|
7175
8763
|
*/
|
|
7176
8764
|
resolveResource(resource: IResource): Result<IResourceCandidate>;
|
|
8765
|
+
/**
|
|
8766
|
+
* Resolves a resource by finding the best matching candidate.
|
|
8767
|
+
* Uses the resource's associated decision to determine the best match based on the current context.
|
|
8768
|
+
* @param resource - The string id of the resource to resolve.
|
|
8769
|
+
* @returns `Success` with the best matching candidate if successful,
|
|
8770
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
8771
|
+
* @public
|
|
8772
|
+
*/
|
|
8773
|
+
resolveResource(resource: string): Result<IResourceCandidate>;
|
|
7177
8774
|
/**
|
|
7178
8775
|
* Resolves all matching resource candidates in priority order.
|
|
7179
8776
|
* Uses the resource's associated decision to determine all matching candidates based on the current context.
|
|
@@ -7183,6 +8780,15 @@ declare class ResourceResolver {
|
|
|
7183
8780
|
* @public
|
|
7184
8781
|
*/
|
|
7185
8782
|
resolveAllResourceCandidates(resource: IResource): Result<ReadonlyArray<IResourceCandidate>>;
|
|
8783
|
+
/**
|
|
8784
|
+
* Resolves all matching resource candidates in priority order.
|
|
8785
|
+
* Uses the resource's associated decision to determine all matching candidates based on the current context.
|
|
8786
|
+
* @param resource - The string id of the resource to resolve.
|
|
8787
|
+
* @returns `Success` with an array of all matching candidates in priority order if successful,
|
|
8788
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
8789
|
+
* @public
|
|
8790
|
+
*/
|
|
8791
|
+
resolveAllResourceCandidates(resource: string): Result<ReadonlyArray<IResourceCandidate>>;
|
|
7186
8792
|
/**
|
|
7187
8793
|
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
7188
8794
|
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
@@ -7193,6 +8799,20 @@ declare class ResourceResolver {
|
|
|
7193
8799
|
* @public
|
|
7194
8800
|
*/
|
|
7195
8801
|
resolveComposedResourceValue(resource: IResource): Result<JsonValue>;
|
|
8802
|
+
/**
|
|
8803
|
+
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
8804
|
+
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
8805
|
+
* priority "partial" candidates into it in ascending order of priority.
|
|
8806
|
+
* @param resource - The string id of the resource to resolve.
|
|
8807
|
+
* @returns `Success` with the composed JsonValue if successful,
|
|
8808
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
8809
|
+
* @public
|
|
8810
|
+
*/
|
|
8811
|
+
resolveComposedResourceValue(resource: string): Result<JsonValue>;
|
|
8812
|
+
/**
|
|
8813
|
+
* {@inheritDoc IResourceResolver.withContext}
|
|
8814
|
+
*/
|
|
8815
|
+
withContext(context: Record<string, string>): Result<ResourceResolver>;
|
|
7196
8816
|
/**
|
|
7197
8817
|
* Clears all caches (condition, condition set, and decision), forcing all cached items
|
|
7198
8818
|
* to be re-evaluated on next access. This should be called when the context changes and cached
|
|
@@ -7233,6 +8853,8 @@ declare type ResourceResolverCacheActivity = 'hit' | 'miss' | 'error' | 'clear';
|
|
|
7233
8853
|
*/
|
|
7234
8854
|
declare class ResourceResolverCacheMetricsListener<TM extends ICacheMetrics> implements IResourceResolverCacheListener {
|
|
7235
8855
|
private readonly _metrics;
|
|
8856
|
+
private _contextErrors;
|
|
8857
|
+
get numContextErrors(): number;
|
|
7236
8858
|
constructor(factory: () => TM);
|
|
7237
8859
|
constructor(metrics: OverallCacheMetrics<TM>);
|
|
7238
8860
|
/**
|
|
@@ -7252,6 +8874,10 @@ declare class ResourceResolverCacheMetricsListener<TM extends ICacheMetrics> imp
|
|
|
7252
8874
|
* {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheError}
|
|
7253
8875
|
*/
|
|
7254
8876
|
onCacheError(cache: ResourceResolverCacheType, index: number): void;
|
|
8877
|
+
/**
|
|
8878
|
+
* {@inheritDoc Runtime.IResourceResolverCacheListener.onContextError}
|
|
8879
|
+
*/
|
|
8880
|
+
onContextError(qualifier: string, error: string): void;
|
|
7255
8881
|
/**
|
|
7256
8882
|
* {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheClear}
|
|
7257
8883
|
*/
|
|
@@ -7274,6 +8900,11 @@ declare namespace Resources {
|
|
|
7274
8900
|
ICandidateInfo,
|
|
7275
8901
|
IReducedCandidate,
|
|
7276
8902
|
CandidateReducer,
|
|
8903
|
+
ICandidateValue,
|
|
8904
|
+
ICandidateValueCreateParams,
|
|
8905
|
+
CandidateValue,
|
|
8906
|
+
ICandidateValueCollectorCreateParams,
|
|
8907
|
+
CandidateValueCollector,
|
|
7277
8908
|
IResourceCandidateCreateParams,
|
|
7278
8909
|
ICandidateDeclOptions,
|
|
7279
8910
|
ResourceCandidate,
|
|
@@ -7286,7 +8917,8 @@ declare namespace Resources {
|
|
|
7286
8917
|
ResourceManagerBuilderResultDetail,
|
|
7287
8918
|
ResourceManagerBuilder,
|
|
7288
8919
|
IResourceDeclarationOptions,
|
|
7289
|
-
ICompiledResourceOptionsWithFilter
|
|
8920
|
+
ICompiledResourceOptionsWithFilter,
|
|
8921
|
+
IResourceManagerCloneOptions
|
|
7290
8922
|
}
|
|
7291
8923
|
}
|
|
7292
8924
|
export { Resources }
|
|
@@ -7333,7 +8965,7 @@ declare const resourceTreeChildNodeDecl: Converter<Normalized.IResourceTreeChild
|
|
|
7333
8965
|
* strongly-typed internal tree operations, ensuring type safety and consistent
|
|
7334
8966
|
* error handling throughout the resource tree navigation.
|
|
7335
8967
|
*
|
|
7336
|
-
* @
|
|
8968
|
+
* @public
|
|
7337
8969
|
*/
|
|
7338
8970
|
declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeChildren<T, string, string> {
|
|
7339
8971
|
private readonly _inner;
|
|
@@ -7388,17 +9020,17 @@ declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeC
|
|
|
7388
9020
|
*/
|
|
7389
9021
|
forEach(cb: (value: unknown, key: string, map: IReadOnlyResultMap<string, unknown>, thisArg?: unknown) => void, arg?: unknown): void;
|
|
7390
9022
|
/**
|
|
7391
|
-
* Gets a child node by its
|
|
7392
|
-
* @param key - The
|
|
9023
|
+
* Gets a child node by its string key with detailed error information.
|
|
9024
|
+
* @param key - The string key to look up
|
|
7393
9025
|
* @returns DetailedResult containing the node if found, or failure with details
|
|
7394
9026
|
*/
|
|
7395
|
-
get(key:
|
|
9027
|
+
get(key: string): DetailedResult<IReadOnlyResourceTreeNode<T>, Collections.ResultMapResultDetail>;
|
|
7396
9028
|
/**
|
|
7397
|
-
* Checks if a child node exists at the given
|
|
7398
|
-
* @param key - The
|
|
9029
|
+
* Checks if a child node exists at the given string key.
|
|
9030
|
+
* @param key - The string key to check
|
|
7399
9031
|
* @returns True if a child node exists at the key, false otherwise
|
|
7400
9032
|
*/
|
|
7401
|
-
has(key:
|
|
9033
|
+
has(key: string): boolean;
|
|
7402
9034
|
/**
|
|
7403
9035
|
* Returns an iterator of ResourceName keys for all child nodes.
|
|
7404
9036
|
* @returns Map iterator for all child node keys
|
|
@@ -7422,6 +9054,111 @@ declare class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeC
|
|
|
7422
9054
|
*/
|
|
7423
9055
|
declare type ResourceTreeNodeInit<T> = IResourceTreeLeafInit<T> | IResourceTreeBranchInit<T>;
|
|
7424
9056
|
|
|
9057
|
+
/**
|
|
9058
|
+
* Specialized resolver for resource tree operations, providing enhanced APIs for
|
|
9059
|
+
* resolving entire resource trees from either resource IDs or pre-built tree nodes.
|
|
9060
|
+
*
|
|
9061
|
+
* This class provides a clean separation between individual resource resolution
|
|
9062
|
+
* (handled by ResourceResolver) and tree-based operations, with support for
|
|
9063
|
+
* lazy tree construction and enhanced error handling.
|
|
9064
|
+
*
|
|
9065
|
+
* @public
|
|
9066
|
+
*/
|
|
9067
|
+
declare class ResourceTreeResolver {
|
|
9068
|
+
/**
|
|
9069
|
+
* The {@link Runtime.ResourceResolver | ResourceResolver} to use for individual resource resolution
|
|
9070
|
+
*/
|
|
9071
|
+
readonly resolver: ResourceResolver;
|
|
9072
|
+
/**
|
|
9073
|
+
* The {@link Runtime.IResourceManager | IResourceManager} to use for lazy tree construction.
|
|
9074
|
+
* @internal
|
|
9075
|
+
*/
|
|
9076
|
+
private readonly _resourceManager;
|
|
9077
|
+
/**
|
|
9078
|
+
* The built resource tree, lazily built on first access.
|
|
9079
|
+
* @internal
|
|
9080
|
+
*/
|
|
9081
|
+
private _tree?;
|
|
9082
|
+
/**
|
|
9083
|
+
* Creates a {@link Runtime.ResourceTreeResolver | ResourceTreeResolver} instance.
|
|
9084
|
+
* @param resolver - The ResourceResolver to use for individual resource resolution
|
|
9085
|
+
*/
|
|
9086
|
+
constructor(resolver: ResourceResolver);
|
|
9087
|
+
/**
|
|
9088
|
+
* Creates a {@link Runtime.ResourceTreeResolver | ResourceTreeResolver} instance.
|
|
9089
|
+
* @param resolver - The ResourceResolver to use for individual resource resolution
|
|
9090
|
+
*/
|
|
9091
|
+
static create(resolver: ResourceResolver): Result<ResourceTreeResolver>;
|
|
9092
|
+
/**
|
|
9093
|
+
* Gets the built resource tree, building it lazily on first access.
|
|
9094
|
+
* @returns The resource tree root
|
|
9095
|
+
* @throws Error if no resource manager was provided or tree building fails
|
|
9096
|
+
* @public
|
|
9097
|
+
*/
|
|
9098
|
+
get tree(): IReadOnlyResourceTreeRoot<IResource>;
|
|
9099
|
+
/**
|
|
9100
|
+
* Resolves a resource tree from a resource ID, building the tree lazily from the resource manager.
|
|
9101
|
+
* @param resourceId - The ID of the root resource to resolve
|
|
9102
|
+
* @param options - Optional configuration for error handling during resolution
|
|
9103
|
+
* @returns Success with the composed JsonObject or undefined, or Failure with error message
|
|
9104
|
+
* @public
|
|
9105
|
+
*/
|
|
9106
|
+
resolveComposedResourceTree(resourceId: string, options?: IResolveResourceTreeOptions): Result<JsonObject | undefined>;
|
|
9107
|
+
/**
|
|
9108
|
+
* Resolves a pre-built resource tree node.
|
|
9109
|
+
* @param node - The resource tree node to resolve
|
|
9110
|
+
* @param options - Optional configuration for error handling during resolution
|
|
9111
|
+
* @returns Success with the composed JsonObject or undefined, or Failure with error message
|
|
9112
|
+
* @public
|
|
9113
|
+
*/
|
|
9114
|
+
resolveComposedResourceTree(node: IReadOnlyResourceTreeNode<IResource>, options?: IResolveResourceTreeOptions): Result<JsonObject | undefined>;
|
|
9115
|
+
private _getTree;
|
|
9116
|
+
/**
|
|
9117
|
+
* Resolves a tree from a resource ID by first building the tree from the resource manager.
|
|
9118
|
+
* @internal
|
|
9119
|
+
*/
|
|
9120
|
+
private _resolveFromResourceId;
|
|
9121
|
+
/**
|
|
9122
|
+
* Resolves a pre-built tree node using the extracted tree resolution logic.
|
|
9123
|
+
* @internal
|
|
9124
|
+
*/
|
|
9125
|
+
private _resolveFromTreeNode;
|
|
9126
|
+
/**
|
|
9127
|
+
* Handles resource resolution errors according to the specified mode.
|
|
9128
|
+
* @param resource - The resource that failed to resolve
|
|
9129
|
+
* @param message - The error message from the failed resolution
|
|
9130
|
+
* @param mode - The error handling mode
|
|
9131
|
+
* @param path - The path to the resource in the tree (for error context)
|
|
9132
|
+
* @internal
|
|
9133
|
+
*/
|
|
9134
|
+
private _handleResourceError;
|
|
9135
|
+
/**
|
|
9136
|
+
* Handles empty branch nodes according to the specified mode.
|
|
9137
|
+
* @param node - The empty branch node
|
|
9138
|
+
* @param failedChildren - Names of children that failed to resolve
|
|
9139
|
+
* @param mode - The empty branch handling mode
|
|
9140
|
+
* @param path - The path to the branch in the tree (for error context)
|
|
9141
|
+
* @internal
|
|
9142
|
+
*/
|
|
9143
|
+
private _handleEmptyBranch;
|
|
9144
|
+
/**
|
|
9145
|
+
* Processes a leaf node by resolving its resource value.
|
|
9146
|
+
* @param node - The leaf node to process (must be a leaf node)
|
|
9147
|
+
* @param path - The path to the node in the tree
|
|
9148
|
+
* @param resourceErrorMode - How to handle resource resolution errors
|
|
9149
|
+
* @internal
|
|
9150
|
+
*/
|
|
9151
|
+
private _processLeafNode;
|
|
9152
|
+
/**
|
|
9153
|
+
* Processes a branch node by recursively resolving all its children.
|
|
9154
|
+
* @param node - The branch node to process (must be a branch node)
|
|
9155
|
+
* @param path - The path to the node in the tree
|
|
9156
|
+
* @param options - Resolution options
|
|
9157
|
+
* @internal
|
|
9158
|
+
*/
|
|
9159
|
+
private _processBranchNode;
|
|
9160
|
+
}
|
|
9161
|
+
|
|
7425
9162
|
/**
|
|
7426
9163
|
* `Converter` for a normalized {@link ResourceJson.Normalized.IResourceTreeRootDecl | resource tree root declaration}.
|
|
7427
9164
|
* @public
|
|
@@ -7434,17 +9171,22 @@ declare const resourceTreeRootDecl: Converter<Normalized.IResourceTreeRootDecl>;
|
|
|
7434
9171
|
* resource value.
|
|
7435
9172
|
* @public
|
|
7436
9173
|
*/
|
|
7437
|
-
declare abstract class ResourceType<T = unknown> implements
|
|
9174
|
+
export declare abstract class ResourceType<T = unknown> implements IResourceType<T> {
|
|
7438
9175
|
private _collectible;
|
|
9176
|
+
private _template;
|
|
7439
9177
|
/**
|
|
7440
|
-
*
|
|
9178
|
+
* {@inheritdoc ResourceTypes.IResourceType.key}
|
|
7441
9179
|
*/
|
|
7442
9180
|
get key(): ResourceTypeName;
|
|
7443
9181
|
/**
|
|
7444
|
-
*
|
|
9182
|
+
* Name of the underlying system type.
|
|
9183
|
+
*/
|
|
9184
|
+
abstract readonly systemTypeName: ResourceTypeName;
|
|
9185
|
+
/**
|
|
9186
|
+
* {@inheritdoc ResourceTypes.IResourceType.index}
|
|
7445
9187
|
*/
|
|
7446
9188
|
get index(): ResourceTypeIndex | undefined;
|
|
7447
|
-
protected constructor(key: ResourceTypeName, index?: number);
|
|
9189
|
+
protected constructor(key: ResourceTypeName, index?: number, template?: JsonObject);
|
|
7448
9190
|
/**
|
|
7449
9191
|
* Validates properties of a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration} for
|
|
7450
9192
|
* a resource instance value.
|
|
@@ -7457,34 +9199,62 @@ declare abstract class ResourceType<T = unknown> implements ICollectible<Resourc
|
|
|
7457
9199
|
/**
|
|
7458
9200
|
* Validates a JSON value for use as a partial resource instance value.
|
|
7459
9201
|
* @param json - The JSON value to validate.
|
|
7460
|
-
* @param
|
|
9202
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
7461
9203
|
* @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
|
|
7462
9204
|
* `Failure` with an error message otherwise.
|
|
7463
9205
|
* @public
|
|
7464
9206
|
*/
|
|
7465
|
-
abstract validate(json: JsonValue,
|
|
9207
|
+
abstract validate(json: JsonValue, completeness: CandidateCompleteness): Result<Partial<T>>;
|
|
7466
9208
|
/**
|
|
7467
9209
|
* Validates a JSON value for use as a complete resource instance value.
|
|
7468
9210
|
* @param json - The JSON value to validate.
|
|
7469
|
-
* @param
|
|
9211
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
7470
9212
|
* @returns `Success` with the strongly-typed resource value if the JSON is valid,
|
|
7471
9213
|
* `Failure` with an error message otherwise.
|
|
7472
9214
|
* @public
|
|
7473
9215
|
*/
|
|
7474
|
-
abstract validate(json: JsonValue,
|
|
9216
|
+
abstract validate(json: JsonValue, completeness: 'full'): Result<T>;
|
|
9217
|
+
/**
|
|
9218
|
+
* Validates a JSON value for use as a partial resource instance value.
|
|
9219
|
+
* @param json - The JSON value to validate.
|
|
9220
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
9221
|
+
* @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
|
|
9222
|
+
* `Failure` with an error message otherwise.
|
|
9223
|
+
* @public
|
|
9224
|
+
*/
|
|
9225
|
+
abstract validate(json: JsonValue, completeness: 'partial'): Result<Partial<T>>;
|
|
7475
9226
|
/**
|
|
7476
9227
|
* Validates a JSON value for use as a full or partial resource instance value.
|
|
7477
9228
|
* @param json - The JSON value to validate.
|
|
7478
|
-
* @param
|
|
9229
|
+
* @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
|
|
7479
9230
|
* @returns `Success` with the strongly-typed full or partial resource value if
|
|
7480
9231
|
* the JSON is valid, `Failure` with an error message otherwise.
|
|
7481
9232
|
* @public
|
|
7482
9233
|
*/
|
|
7483
|
-
abstract validate(json: JsonValue,
|
|
9234
|
+
abstract validate(json: JsonValue, completeness?: CandidateCompleteness): Result<T | Partial<T>>;
|
|
7484
9235
|
/**
|
|
7485
9236
|
* Sets the index for this resource type. Once set, the index cannot be changed.
|
|
7486
9237
|
*/
|
|
7487
9238
|
setIndex(index: number): Result<ResourceTypeIndex>;
|
|
9239
|
+
/**
|
|
9240
|
+
* Creates a template for a new resource of this type.
|
|
9241
|
+
* Default implementation provides a basic template.
|
|
9242
|
+
* Subclasses can override to provide type-specific templates.
|
|
9243
|
+
* @param resourceId - The id for the new resource
|
|
9244
|
+
* @param init - An optional initial value for the resource.
|
|
9245
|
+
* @param conditions - An optional set of conditions that must be met for the resource to be selected.
|
|
9246
|
+
* @param resolver - An optional resource resolver that can be used to create the template.
|
|
9247
|
+
* @returns A loose resource declaration with default values for this resource type
|
|
9248
|
+
* @public
|
|
9249
|
+
*/
|
|
9250
|
+
createTemplate(resourceId: ResourceId, init?: JsonValue, conditions?: ResourceJson.Json.ConditionSetDecl, resolver?: IResourceResolver): Result<ResourceJson.Json.ILooseResourceDecl>;
|
|
9251
|
+
/**
|
|
9252
|
+
* Gets the default template value for this resource type.
|
|
9253
|
+
* Subclasses should override this to provide type-specific default values.
|
|
9254
|
+
* @returns The default JSON value for a new resource of this type
|
|
9255
|
+
* @public
|
|
9256
|
+
*/
|
|
9257
|
+
getDefaultTemplateCandidate(json?: JsonValue, conditions?: ResourceJson.Json.ConditionSetDecl, __resolver?: IResourceResolver): Result<ResourceJson.Json.IChildResourceCandidateDecl>;
|
|
7488
9258
|
}
|
|
7489
9259
|
|
|
7490
9260
|
/**
|
|
@@ -7508,7 +9278,30 @@ declare class ResourceTypeCollector extends ValidatingCollector<ResourceType> {
|
|
|
7508
9278
|
* @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
|
|
7509
9279
|
* @public
|
|
7510
9280
|
*/
|
|
7511
|
-
declare const resourceTypeConfig: ObjectConverter<IResourceTypeConfig
|
|
9281
|
+
declare const resourceTypeConfig: ObjectConverter<IResourceTypeConfig<JsonObject>, unknown>;
|
|
9282
|
+
|
|
9283
|
+
/**
|
|
9284
|
+
* A factory that creates a {@link ResourceTypes.ResourceType | ResourceType} from a {@link ResourceTypes.Config.IResourceTypeConfig | resource type configuration}
|
|
9285
|
+
* by chaining a supplied factory with a {@link Config.BuiltInResourceTypeFactory | built-in factory} that handles built-in resource types.
|
|
9286
|
+
* @public
|
|
9287
|
+
*/
|
|
9288
|
+
declare class ResourceTypeFactory extends ChainedConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> {
|
|
9289
|
+
/**
|
|
9290
|
+
* Constructor for a resource type factory.
|
|
9291
|
+
* @param factories - Array of factories for resource types. Can be:
|
|
9292
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
9293
|
+
* - {@link Config.ResourceTypeFactoryFunction | Factory functions}
|
|
9294
|
+
* - A mix of both
|
|
9295
|
+
* @remarks The {@link Config.BuiltInResourceTypeFactory | built-in factory} is always added to the end of the chain.
|
|
9296
|
+
*/
|
|
9297
|
+
constructor(factories: Array<IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> | ResourceTypeFactoryFunction>);
|
|
9298
|
+
}
|
|
9299
|
+
|
|
9300
|
+
/**
|
|
9301
|
+
* Function signature for creating a resource type from configuration.
|
|
9302
|
+
* @public
|
|
9303
|
+
*/
|
|
9304
|
+
declare type ResourceTypeFactoryFunction = (config: ResourceTypes.Config.IResourceTypeConfig) => Result<ResourceType>;
|
|
7512
9305
|
|
|
7513
9306
|
/**
|
|
7514
9307
|
* Branded number representing a validated resource type index.
|
|
@@ -7538,6 +9331,7 @@ declare namespace ResourceTypes {
|
|
|
7538
9331
|
export {
|
|
7539
9332
|
Config_3 as Config,
|
|
7540
9333
|
IResourceCandidateValidationProperties,
|
|
9334
|
+
IResourceType,
|
|
7541
9335
|
ResourceType,
|
|
7542
9336
|
IResourceCollectorCreateParams,
|
|
7543
9337
|
ResourceTypeCollector,
|
|
@@ -7578,8 +9372,13 @@ declare namespace Runtime {
|
|
|
7578
9372
|
IValidatingSimpleContextQualifierProviderCreateParams,
|
|
7579
9373
|
ValidatingSimpleContextQualifierProvider,
|
|
7580
9374
|
DecisionResolutionResult,
|
|
9375
|
+
IResourceResolverOptions,
|
|
7581
9376
|
IResourceResolverCreateParams,
|
|
7582
9377
|
ResourceResolver,
|
|
9378
|
+
ResourceErrorHandler,
|
|
9379
|
+
EmptyBranchHandler,
|
|
9380
|
+
IResolveResourceTreeOptions,
|
|
9381
|
+
ResourceTreeResolver,
|
|
7583
9382
|
ConditionMatchType,
|
|
7584
9383
|
IConditionMatchResult,
|
|
7585
9384
|
ConditionSetResolutionResult,
|
|
@@ -7595,6 +9394,14 @@ declare namespace Runtime {
|
|
|
7595
9394
|
}
|
|
7596
9395
|
export { Runtime }
|
|
7597
9396
|
|
|
9397
|
+
/**
|
|
9398
|
+
* Create a safe filename by removing invalid characters
|
|
9399
|
+
* @param filename - Original filename
|
|
9400
|
+
* @returns Sanitized filename
|
|
9401
|
+
* @public
|
|
9402
|
+
*/
|
|
9403
|
+
declare function sanitizeFilename(filename: string): string;
|
|
9404
|
+
|
|
7598
9405
|
/**
|
|
7599
9406
|
* @internal
|
|
7600
9407
|
*/
|
|
@@ -7736,7 +9543,7 @@ declare class SystemConfiguration {
|
|
|
7736
9543
|
* @param config - The {@link Config.Model.ISystemConfiguration | system configuration} to use.
|
|
7737
9544
|
* @public
|
|
7738
9545
|
*/
|
|
7739
|
-
protected constructor(config: ISystemConfiguration);
|
|
9546
|
+
protected constructor(config: ISystemConfiguration, initParams?: ISystemConfigurationInitParams);
|
|
7740
9547
|
/**
|
|
7741
9548
|
* Creates a new {@link Config.SystemConfiguration | SystemConfiguration} from the supplied
|
|
7742
9549
|
* {@link Config.Model.ISystemConfiguration | system configuration}.
|
|
@@ -7747,6 +9554,14 @@ declare class SystemConfiguration {
|
|
|
7747
9554
|
* @public
|
|
7748
9555
|
*/
|
|
7749
9556
|
static create(config: ISystemConfiguration, initParams?: ISystemConfigurationInitParams): Result<SystemConfiguration>;
|
|
9557
|
+
/**
|
|
9558
|
+
* Loads a {@link Config.SystemConfiguration | SystemConfiguration} from a file.
|
|
9559
|
+
* @param path - The path to the file to load.
|
|
9560
|
+
* @returns `Success` with the {@link Config.SystemConfiguration | SystemConfiguration}
|
|
9561
|
+
* if successful, `Failure` with an error message otherwise.
|
|
9562
|
+
* @public
|
|
9563
|
+
*/
|
|
9564
|
+
static loadFromFile(path: string, initParams?: ISystemConfigurationInitParams): Result<SystemConfiguration>;
|
|
7750
9565
|
/**
|
|
7751
9566
|
* Returns the {@link Config.Model.ISystemConfiguration | system configuration} that this
|
|
7752
9567
|
* {@link Config.SystemConfiguration | SystemConfiguration} was created from.
|
|
@@ -7764,33 +9579,48 @@ declare class SystemConfiguration {
|
|
|
7764
9579
|
*/
|
|
7765
9580
|
declare const systemConfiguration: ObjectConverter<ISystemConfiguration, unknown>;
|
|
7766
9581
|
|
|
9582
|
+
/**
|
|
9583
|
+
* Validator for system configuration (delegates to config packlet)
|
|
9584
|
+
* This validates that the parsed JSON conforms to the system configuration schema
|
|
9585
|
+
* @public
|
|
9586
|
+
*/
|
|
9587
|
+
declare const systemConfiguration_2: Validator<Model.ISystemConfiguration>;
|
|
9588
|
+
|
|
7767
9589
|
/**
|
|
7768
9590
|
* A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
|
|
7769
9591
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
|
|
7770
9592
|
* @public
|
|
7771
9593
|
*/
|
|
7772
|
-
declare const systemLanguageQualifierTypeConfig: ObjectConverter<
|
|
9594
|
+
declare const systemLanguageQualifierTypeConfig: ObjectConverter<Model_2.ISystemLanguageQualifierTypeConfig, unknown>;
|
|
7773
9595
|
|
|
7774
9596
|
/**
|
|
7775
9597
|
* A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
|
|
7776
9598
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
|
|
7777
9599
|
* @public
|
|
7778
9600
|
*/
|
|
7779
|
-
declare const systemLiteralQualifierTypeConfig: ObjectConverter<
|
|
9601
|
+
declare const systemLiteralQualifierTypeConfig: ObjectConverter<Model_2.ISystemLiteralQualifierTypeConfig, unknown>;
|
|
9602
|
+
|
|
9603
|
+
/**
|
|
9604
|
+
* A discriminated union of all system qualifier types.
|
|
9605
|
+
* This allows TypeScript to properly discriminate between specific qualifier type implementations
|
|
9606
|
+
* and access their specific methods like getConfiguration().
|
|
9607
|
+
* @public
|
|
9608
|
+
*/
|
|
9609
|
+
declare type SystemQualifierType = LanguageQualifierType | TerritoryQualifierType | LiteralQualifierType;
|
|
7780
9610
|
|
|
7781
9611
|
/**
|
|
7782
9612
|
* A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
|
|
7783
9613
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
|
|
7784
9614
|
* @public
|
|
7785
9615
|
*/
|
|
7786
|
-
declare const systemQualifierTypeConfig: Converter<
|
|
9616
|
+
declare const systemQualifierTypeConfig: Converter<Model_2.ISystemQualifierTypeConfig, unknown>;
|
|
7787
9617
|
|
|
7788
9618
|
/**
|
|
7789
9619
|
* A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
|
|
7790
9620
|
* @returns A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
|
|
7791
9621
|
* @public
|
|
7792
9622
|
*/
|
|
7793
|
-
declare const systemTerritoryQualifierTypeConfig: ObjectConverter<
|
|
9623
|
+
declare const systemTerritoryQualifierTypeConfig: ObjectConverter<Model_2.ISystemTerritoryQualifierTypeConfig, unknown>;
|
|
7794
9624
|
|
|
7795
9625
|
/**
|
|
7796
9626
|
* @internal
|
|
@@ -7821,7 +9651,11 @@ declare const TerritoryPrioritySystemConfiguration: ISystemConfiguration;
|
|
|
7821
9651
|
* implementation handles incorrect casing.
|
|
7822
9652
|
* @public
|
|
7823
9653
|
*/
|
|
7824
|
-
declare class TerritoryQualifierType extends QualifierType {
|
|
9654
|
+
declare class TerritoryQualifierType extends QualifierType<JsonCompatible<Config_2.ITerritoryQualifierTypeConfig>> {
|
|
9655
|
+
/**
|
|
9656
|
+
* {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
|
|
9657
|
+
*/
|
|
9658
|
+
readonly systemTypeName: QualifierTypeName;
|
|
7825
9659
|
/**
|
|
7826
9660
|
* Optional array enumerating allowed territories to further constrain the type.
|
|
7827
9661
|
*/
|
|
@@ -7863,6 +9697,27 @@ declare class TerritoryQualifierType extends QualifierType {
|
|
|
7863
9697
|
* @public
|
|
7864
9698
|
*/
|
|
7865
9699
|
static createFromConfig(config: Config_2.IQualifierTypeConfig<Config_2.ITerritoryQualifierTypeConfig>): Result<TerritoryQualifierType>;
|
|
9700
|
+
/**
|
|
9701
|
+
* Gets the {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | strongly typed configuration}
|
|
9702
|
+
* for this qualifier type.
|
|
9703
|
+
* @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
|
|
9704
|
+
*/
|
|
9705
|
+
getConfiguration(): Result<Config_2.ISystemTerritoryQualifierTypeConfig>;
|
|
9706
|
+
/**
|
|
9707
|
+
* {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
|
|
9708
|
+
*/
|
|
9709
|
+
getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemTerritoryQualifierTypeConfig>>;
|
|
9710
|
+
/**
|
|
9711
|
+
* {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
|
|
9712
|
+
*/
|
|
9713
|
+
validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemTerritoryQualifierTypeConfig>>;
|
|
9714
|
+
/**
|
|
9715
|
+
* Validates a {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | strongly typed configuration object}
|
|
9716
|
+
* for this qualifier type.
|
|
9717
|
+
* @param from - The unknown data to validate as a configuration object.
|
|
9718
|
+
* @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.
|
|
9719
|
+
*/
|
|
9720
|
+
validateConfiguration(from: unknown): Result<Config_2.ISystemTerritoryQualifierTypeConfig>;
|
|
7866
9721
|
/**
|
|
7867
9722
|
* {@inheritdoc QualifierTypes.QualifierType._matchOne}
|
|
7868
9723
|
*/
|
|
@@ -7893,7 +9748,27 @@ declare class TerritoryQualifierType extends QualifierType {
|
|
|
7893
9748
|
* @returns A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.
|
|
7894
9749
|
* @public
|
|
7895
9750
|
*/
|
|
7896
|
-
declare const territoryQualifierTypeConfig: ObjectConverter<
|
|
9751
|
+
declare const territoryQualifierTypeConfig: ObjectConverter<Model_2.ITerritoryQualifierTypeConfig, unknown>;
|
|
9752
|
+
|
|
9753
|
+
/**
|
|
9754
|
+
* Converts a number to a {@link CandidateValueIndex | candidate value index}.
|
|
9755
|
+
*
|
|
9756
|
+
* @param index - The number to convert.
|
|
9757
|
+
* @returns `Success` with the converted index if valid, or `Failure` with an error message
|
|
9758
|
+
* if not.
|
|
9759
|
+
* @public
|
|
9760
|
+
*/
|
|
9761
|
+
declare function toCandidateValueIndex(index: number): Result<CandidateValueIndex>;
|
|
9762
|
+
|
|
9763
|
+
/**
|
|
9764
|
+
* Converts a string to a {@link CandidateValueKey | candidate value key}.
|
|
9765
|
+
*
|
|
9766
|
+
* @param key - The key to convert.
|
|
9767
|
+
* @returns `Success` with the converted key if valid, or `Failure` with an error message
|
|
9768
|
+
* if not.
|
|
9769
|
+
* @public
|
|
9770
|
+
*/
|
|
9771
|
+
declare function toCandidateValueKey(key: string): Result<CandidateValueKey>;
|
|
7897
9772
|
|
|
7898
9773
|
/**
|
|
7899
9774
|
* Converts a number to a {@link ConditionIndex} if it is a valid condition index.
|
|
@@ -8194,12 +10069,16 @@ declare namespace Validate {
|
|
|
8194
10069
|
isValidResourceIndex,
|
|
8195
10070
|
isValidResourceTypeName,
|
|
8196
10071
|
isValidResourceTypeIndex,
|
|
10072
|
+
isValidCandidateValueIndex,
|
|
10073
|
+
isValidCandidateValueKey,
|
|
8197
10074
|
toResourceName,
|
|
8198
10075
|
toResourceId,
|
|
8199
10076
|
toOptionalResourceId,
|
|
8200
10077
|
toResourceIndex,
|
|
8201
10078
|
toResourceTypeName,
|
|
8202
|
-
toResourceTypeIndex
|
|
10079
|
+
toResourceTypeIndex,
|
|
10080
|
+
toCandidateValueKey,
|
|
10081
|
+
toCandidateValueIndex
|
|
8203
10082
|
}
|
|
8204
10083
|
}
|
|
8205
10084
|
export { Validate }
|
|
@@ -8244,6 +10123,94 @@ declare const validatedContextQualifierValueDecl: Converter<IValidatedContextQua
|
|
|
8244
10123
|
*/
|
|
8245
10124
|
declare const validatedQualifierDecl: Converter<IValidatedQualifierDecl, IQualifierDeclConvertContext>;
|
|
8246
10125
|
|
|
10126
|
+
/**
|
|
10127
|
+
* Validate a {@link Config.Model.ISystemConfiguration | ISystemConfiguration} object.
|
|
10128
|
+
* @param config - The system configuration to validate
|
|
10129
|
+
* @returns `Success` with the validated system configuration if successful,
|
|
10130
|
+
* or `Failure` with an error message if validation fails.
|
|
10131
|
+
* @public
|
|
10132
|
+
*/
|
|
10133
|
+
declare function validateSystemConfiguration(config: unknown): Result<ISystemConfiguration>;
|
|
10134
|
+
|
|
10135
|
+
/**
|
|
10136
|
+
* Validate a ZIP archive manifest object
|
|
10137
|
+
* @param manifest - Object to validate as manifest
|
|
10138
|
+
* @returns Result containing validated manifest
|
|
10139
|
+
* @public
|
|
10140
|
+
*/
|
|
10141
|
+
declare function validateZipArchiveManifest(manifest: unknown): Result<Json_2.IZipArchiveManifest>;
|
|
10142
|
+
|
|
10143
|
+
/**
|
|
10144
|
+
* A factory that validates and creates {@link QualifierTypes.QualifierType | QualifierType} instances
|
|
10145
|
+
* from weakly-typed configuration objects. This factory accepts configurations with unvalidated
|
|
10146
|
+
* string properties and validates them before delegating to the underlying factory chain.
|
|
10147
|
+
*
|
|
10148
|
+
* This pattern is useful at package boundaries where type identity issues may occur with
|
|
10149
|
+
* branded types across different package instances.
|
|
10150
|
+
*
|
|
10151
|
+
* @example
|
|
10152
|
+
* ```typescript
|
|
10153
|
+
* // Accept weakly-typed config from external source
|
|
10154
|
+
* const validatingFactory = new ValidatingQualifierTypeFactory([customFactory]);
|
|
10155
|
+
*
|
|
10156
|
+
* // Config can have plain string types instead of branded types
|
|
10157
|
+
* const config = {
|
|
10158
|
+
* name: 'my-qualifier', // plain string, not QualifierTypeName
|
|
10159
|
+
* systemType: 'custom', // plain string
|
|
10160
|
+
* configuration: { ... }
|
|
10161
|
+
* };
|
|
10162
|
+
*
|
|
10163
|
+
* const result = validatingFactory.create(config); // Validates and converts internally
|
|
10164
|
+
* ```
|
|
10165
|
+
*
|
|
10166
|
+
* @public
|
|
10167
|
+
*/
|
|
10168
|
+
declare class ValidatingQualifierTypeFactory<T extends QualifierType = SystemQualifierType> implements IConfigInitFactory<unknown, T | SystemQualifierType> {
|
|
10169
|
+
private readonly _innerFactory;
|
|
10170
|
+
/**
|
|
10171
|
+
* Constructor for a validating qualifier type factory.
|
|
10172
|
+
* @param factories - Array of factories for custom qualifier types. Can be:
|
|
10173
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
10174
|
+
* - {@link Config.QualifierTypeFactoryFunction | Factory functions}
|
|
10175
|
+
* - A mix of both
|
|
10176
|
+
*/
|
|
10177
|
+
constructor(factories: Array<IConfigInitFactory<QualifierTypes.Config.IAnyQualifierTypeConfig, T> | QualifierTypeFactoryFunction<T>>);
|
|
10178
|
+
/**
|
|
10179
|
+
* Creates a qualifier type from a weakly-typed configuration object.
|
|
10180
|
+
* @param config - The configuration object to validate and use for creation.
|
|
10181
|
+
* @returns A result containing the new qualifier type if successful.
|
|
10182
|
+
*/
|
|
10183
|
+
create(config: unknown): Result<T | SystemQualifierType>;
|
|
10184
|
+
}
|
|
10185
|
+
|
|
10186
|
+
/**
|
|
10187
|
+
* A factory that validates and creates {@link ResourceTypes.ResourceType | ResourceType} instances
|
|
10188
|
+
* from weakly-typed configuration objects. This factory accepts configurations with unvalidated
|
|
10189
|
+
* string properties and validates them before delegating to the underlying factory chain.
|
|
10190
|
+
*
|
|
10191
|
+
* This pattern is useful at package boundaries where type identity issues may occur with
|
|
10192
|
+
* branded types across different package instances.
|
|
10193
|
+
*
|
|
10194
|
+
* @public
|
|
10195
|
+
*/
|
|
10196
|
+
declare class ValidatingResourceTypeFactory implements IConfigInitFactory<unknown, ResourceType> {
|
|
10197
|
+
private readonly _innerFactory;
|
|
10198
|
+
/**
|
|
10199
|
+
* Constructor for a validating resource type factory.
|
|
10200
|
+
* @param factories - Array of factories for resource types. Can be:
|
|
10201
|
+
* - {@link Config.IConfigInitFactory | IConfigInitFactory} instances
|
|
10202
|
+
* - {@link Config.ResourceTypeFactoryFunction | Factory functions}
|
|
10203
|
+
* - A mix of both
|
|
10204
|
+
*/
|
|
10205
|
+
constructor(factories: Array<IConfigInitFactory<ResourceTypes.Config.IResourceTypeConfig, ResourceType> | ResourceTypeFactoryFunction>);
|
|
10206
|
+
/**
|
|
10207
|
+
* Creates a resource type from a weakly-typed configuration object.
|
|
10208
|
+
* @param config - The configuration object to validate and use for creation.
|
|
10209
|
+
* @returns A result containing the new resource type if successful.
|
|
10210
|
+
*/
|
|
10211
|
+
create(config: unknown): Result<ResourceType>;
|
|
10212
|
+
}
|
|
10213
|
+
|
|
8247
10214
|
/**
|
|
8248
10215
|
* A {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider} with a
|
|
8249
10216
|
* {@link Runtime.Context.ContextQualifierProviderValidator | validator} property that enables
|
|
@@ -8272,4 +10239,194 @@ declare class ValidatingSimpleContextQualifierProvider extends SimpleContextQual
|
|
|
8272
10239
|
static create(params: IValidatingSimpleContextQualifierProviderCreateParams): Result<ValidatingSimpleContextQualifierProvider>;
|
|
8273
10240
|
}
|
|
8274
10241
|
|
|
10242
|
+
declare namespace ZipArchive {
|
|
10243
|
+
export {
|
|
10244
|
+
Json_2 as Json,
|
|
10245
|
+
Convert_12 as Convert,
|
|
10246
|
+
ZipArchiveCreator,
|
|
10247
|
+
ZipArchiveLoader,
|
|
10248
|
+
IZipArchivePathOptions,
|
|
10249
|
+
IZipArchiveFileTreeOptions,
|
|
10250
|
+
ZipArchiveOptions,
|
|
10251
|
+
IZipArchiveResult,
|
|
10252
|
+
IZipArchiveManifest_2 as IZipArchiveManifest,
|
|
10253
|
+
IZipArchiveLoadOptions,
|
|
10254
|
+
IZipArchiveLoadResult,
|
|
10255
|
+
IImportedFile_2 as IImportedFile,
|
|
10256
|
+
IImportedDirectory_2 as IImportedDirectory,
|
|
10257
|
+
ZipArchiveProgressCallback,
|
|
10258
|
+
createZipArchiveManifest,
|
|
10259
|
+
parseZipArchiveManifest,
|
|
10260
|
+
validateZipArchiveManifest,
|
|
10261
|
+
parseZipArchiveConfiguration,
|
|
10262
|
+
generateZipArchiveFilename,
|
|
10263
|
+
normalizePath,
|
|
10264
|
+
getDirectoryName,
|
|
10265
|
+
sanitizeFilename,
|
|
10266
|
+
isZipFile,
|
|
10267
|
+
ZipArchiveConstants
|
|
10268
|
+
}
|
|
10269
|
+
}
|
|
10270
|
+
export { ZipArchive }
|
|
10271
|
+
|
|
10272
|
+
/**
|
|
10273
|
+
* Validator for ZIP archive config information
|
|
10274
|
+
* @public
|
|
10275
|
+
*/
|
|
10276
|
+
declare const zipArchiveConfigInfo: Validator<Json_2.IZipArchiveConfigInfo>;
|
|
10277
|
+
|
|
10278
|
+
/**
|
|
10279
|
+
* Validator for ZIP archive config type
|
|
10280
|
+
* @public
|
|
10281
|
+
*/
|
|
10282
|
+
declare const zipArchiveConfigType: Validator<'file'>;
|
|
10283
|
+
|
|
10284
|
+
/**
|
|
10285
|
+
* Constants for ZIP archive structure
|
|
10286
|
+
* @public
|
|
10287
|
+
*/
|
|
10288
|
+
declare const ZipArchiveConstants: {
|
|
10289
|
+
/** Manifest file name */
|
|
10290
|
+
readonly MANIFEST_FILE: "manifest.json";
|
|
10291
|
+
/** Configuration file name */
|
|
10292
|
+
readonly CONFIG_FILE: "config.json";
|
|
10293
|
+
/** Input files directory */
|
|
10294
|
+
readonly INPUT_DIR: "input";
|
|
10295
|
+
/** Configuration files directory */
|
|
10296
|
+
readonly CONFIG_DIR: "config";
|
|
10297
|
+
};
|
|
10298
|
+
|
|
10299
|
+
/**
|
|
10300
|
+
* ZIP archive creator using fflate for universal compatibility
|
|
10301
|
+
* @public
|
|
10302
|
+
*/
|
|
10303
|
+
declare class ZipArchiveCreator {
|
|
10304
|
+
/**
|
|
10305
|
+
* Create a ZIP archive buffer from a supplied buffer
|
|
10306
|
+
* @param options - Input paths and configuration
|
|
10307
|
+
* @param onProgress - Optional progress callback
|
|
10308
|
+
* @returns Result containing ZIP buffer and manifest
|
|
10309
|
+
*/
|
|
10310
|
+
createFromBuffer(options: ZipArchiveOptions, onProgress?: ZipArchiveProgressCallback): Promise<Result<IZipArchiveResult>>;
|
|
10311
|
+
/**
|
|
10312
|
+
* Add a single FileTree item to the ZIP archive
|
|
10313
|
+
* @param files - ZIP files collection
|
|
10314
|
+
* @param fileItem - FileTree file item to add
|
|
10315
|
+
* @param archivePath - Path within the archive
|
|
10316
|
+
* @returns Result indicating success or failure
|
|
10317
|
+
*/
|
|
10318
|
+
private _addFileTreeItemToZip;
|
|
10319
|
+
/**
|
|
10320
|
+
* Add a directory recursively to the ZIP archive using FileTree
|
|
10321
|
+
* @param files - ZIP files collection
|
|
10322
|
+
* @param directoryItem - FileTree directory item to add
|
|
10323
|
+
* @param archivePrefix - Prefix path within the archive
|
|
10324
|
+
* @param onProgress - Optional progress callback
|
|
10325
|
+
* @returns Result indicating success or failure
|
|
10326
|
+
*/
|
|
10327
|
+
private _addDirectoryTreeToZip;
|
|
10328
|
+
private _getInputFileTreeItem;
|
|
10329
|
+
private _getConfigFileTreeItem;
|
|
10330
|
+
}
|
|
10331
|
+
|
|
10332
|
+
/**
|
|
10333
|
+
* Validator for ZIP archive input information
|
|
10334
|
+
* @public
|
|
10335
|
+
*/
|
|
10336
|
+
declare const zipArchiveInputInfo: Validator<Json_2.IZipArchiveInputInfo>;
|
|
10337
|
+
|
|
10338
|
+
/**
|
|
10339
|
+
* Validator for ZIP archive input type
|
|
10340
|
+
* @public
|
|
10341
|
+
*/
|
|
10342
|
+
declare const zipArchiveInputType: Validator<'file' | 'directory'>;
|
|
10343
|
+
|
|
10344
|
+
/**
|
|
10345
|
+
* ZIP archive loader extending ts-extras foundation
|
|
10346
|
+
* @public
|
|
10347
|
+
*/
|
|
10348
|
+
declare class ZipArchiveLoader {
|
|
10349
|
+
/**
|
|
10350
|
+
* Load ZIP archive from File object (Browser)
|
|
10351
|
+
* @param file - File object from file input
|
|
10352
|
+
* @param options - Loading options
|
|
10353
|
+
* @param onProgress - Optional progress callback
|
|
10354
|
+
* @returns Result containing loaded archive data
|
|
10355
|
+
*/
|
|
10356
|
+
loadFromFile(file: File, options?: IZipArchiveLoadOptions, onProgress?: ZipArchiveProgressCallback): Promise<Result<IZipArchiveLoadResult>>;
|
|
10357
|
+
/**
|
|
10358
|
+
* Load ZIP archive from ArrayBuffer (Universal)
|
|
10359
|
+
* @param buffer - ZIP data buffer
|
|
10360
|
+
* @param options - Loading options
|
|
10361
|
+
* @param onProgress - Optional progress callback
|
|
10362
|
+
* @returns Result containing loaded archive data
|
|
10363
|
+
*/
|
|
10364
|
+
loadFromBuffer(buffer: ArrayBuffer, options?: IZipArchiveLoadOptions, onProgress?: ZipArchiveProgressCallback): Promise<Result<IZipArchiveLoadResult>>;
|
|
10365
|
+
/**
|
|
10366
|
+
* Load manifest from ZIP using ZipFileTreeAccessors
|
|
10367
|
+
* @param zipAccessors - ZIP file tree accessors
|
|
10368
|
+
* @returns Result containing parsed manifest
|
|
10369
|
+
*/
|
|
10370
|
+
private _loadManifestFromAccessors;
|
|
10371
|
+
/**
|
|
10372
|
+
* Load configuration from ZIP using ZipFileTreeAccessors
|
|
10373
|
+
* @param zipAccessors - ZIP file tree accessors
|
|
10374
|
+
* @param manifest - Parsed manifest (may be undefined)
|
|
10375
|
+
* @param options - Loading options
|
|
10376
|
+
* @returns Result containing parsed configuration
|
|
10377
|
+
*/
|
|
10378
|
+
private _loadConfigurationFromAccessors;
|
|
10379
|
+
/**
|
|
10380
|
+
* Extract files and directory structure from ZIP
|
|
10381
|
+
* @param zipAccessors - ZIP file tree accessors
|
|
10382
|
+
* @param onProgress - Optional progress callback
|
|
10383
|
+
* @returns Result containing files and directory structure
|
|
10384
|
+
*/
|
|
10385
|
+
private _extractFilesFromAccessors;
|
|
10386
|
+
/**
|
|
10387
|
+
* Recursively process file tree items
|
|
10388
|
+
* @param zipAccessors - ZIP file tree accessors
|
|
10389
|
+
* @param currentPath - Current directory path
|
|
10390
|
+
* @param items - Items to process
|
|
10391
|
+
* @param files - Files collection
|
|
10392
|
+
* @param directories - Directories collection
|
|
10393
|
+
* @param onProgress - Optional progress callback
|
|
10394
|
+
* @param processed - Processing counter
|
|
10395
|
+
*/
|
|
10396
|
+
private _processFileTreeItems;
|
|
10397
|
+
/**
|
|
10398
|
+
* Build directory structure from files
|
|
10399
|
+
* @param files - Extracted files
|
|
10400
|
+
* @param directories - Directories map
|
|
10401
|
+
* @returns Root directory structure or null
|
|
10402
|
+
*/
|
|
10403
|
+
private _buildDirectoryStructure;
|
|
10404
|
+
/**
|
|
10405
|
+
* Get file MIME type based on extension
|
|
10406
|
+
* @param filename - Filename
|
|
10407
|
+
* @returns MIME type
|
|
10408
|
+
*/
|
|
10409
|
+
private _getFileType;
|
|
10410
|
+
}
|
|
10411
|
+
|
|
10412
|
+
/**
|
|
10413
|
+
* Validator for ZIP archive manifest
|
|
10414
|
+
* Compatible with existing tools from ts-res-browser-cli
|
|
10415
|
+
* @public
|
|
10416
|
+
*/
|
|
10417
|
+
declare const zipArchiveManifest: Validator<Json_2.IZipArchiveManifest>;
|
|
10418
|
+
|
|
10419
|
+
/**
|
|
10420
|
+
* Options for creating a ZIP archive buffer
|
|
10421
|
+
* @public
|
|
10422
|
+
*/
|
|
10423
|
+
declare type ZipArchiveOptions = IZipArchivePathOptions | IZipArchiveFileTreeOptions;
|
|
10424
|
+
|
|
10425
|
+
/**
|
|
10426
|
+
* Progress callback for ZIP operations
|
|
10427
|
+
* @public
|
|
10428
|
+
*/
|
|
10429
|
+
declare type ZipArchiveProgressCallback = (stage: 'reading-file' | 'parsing-zip' | 'loading-manifest' | 'loading-config' | 'extracting-files' | 'processing-resources' | 'creating-zip', progress: number, // 0-100
|
|
10430
|
+
details: string) => void;
|
|
10431
|
+
|
|
8275
10432
|
export { }
|