@fgv/ts-res 4.5.0-2 → 5.0.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +26 -0
- package/CHANGELOG.md +14 -0
- package/CLAUDE.md +186 -0
- package/EXAMPLE_INIT_PARAMS.md +88 -0
- package/PROGRESS_SUMMARY.md +48 -0
- package/README.md +535 -14
- package/dist/ts-res.d.ts +4225 -324
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/packlets/common/conditions.d.ts +30 -0
- package/lib/packlets/common/conditions.d.ts.map +1 -1
- package/lib/packlets/common/conditions.js.map +1 -1
- package/lib/packlets/common/convert.d.ts +22 -2
- package/lib/packlets/common/convert.d.ts.map +1 -1
- package/lib/packlets/common/convert.js +21 -1
- package/lib/packlets/common/convert.js.map +1 -1
- package/lib/packlets/common/helpers/context.d.ts +39 -0
- package/lib/packlets/common/helpers/context.d.ts.map +1 -0
- package/lib/packlets/common/helpers/context.js +108 -0
- package/lib/packlets/common/helpers/context.js.map +1 -0
- package/lib/packlets/common/helpers/index.d.ts +2 -0
- package/lib/packlets/common/helpers/index.d.ts.map +1 -1
- package/lib/packlets/common/helpers/index.js +2 -0
- package/lib/packlets/common/helpers/index.js.map +1 -1
- package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts +39 -0
- package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
- package/lib/packlets/common/helpers/qualifierDefaultValues.js +105 -0
- package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
- package/lib/packlets/common/helpers/resources.d.ts.map +1 -1
- package/lib/packlets/common/helpers/resources.js +6 -2
- package/lib/packlets/common/helpers/resources.js.map +1 -1
- package/lib/packlets/common/validate/conditions.d.ts +69 -1
- package/lib/packlets/common/validate/conditions.d.ts.map +1 -1
- package/lib/packlets/common/validate/conditions.js +126 -0
- package/lib/packlets/common/validate/conditions.js.map +1 -1
- package/lib/packlets/common/validate/regularExpressions.d.ts +20 -0
- package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -1
- package/lib/packlets/common/validate/regularExpressions.js +21 -1
- package/lib/packlets/common/validate/regularExpressions.js.map +1 -1
- package/lib/packlets/conditions/condition.d.ts +37 -0
- package/lib/packlets/conditions/condition.d.ts.map +1 -1
- package/lib/packlets/conditions/condition.js +67 -1
- package/lib/packlets/conditions/condition.js.map +1 -1
- package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -1
- package/lib/packlets/conditions/conditionCollector.js +1 -0
- package/lib/packlets/conditions/conditionCollector.js.map +1 -1
- package/lib/packlets/conditions/conditionSet.d.ts +34 -3
- package/lib/packlets/conditions/conditionSet.d.ts.map +1 -1
- package/lib/packlets/conditions/conditionSet.js +31 -3
- package/lib/packlets/conditions/conditionSet.js.map +1 -1
- package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -1
- package/lib/packlets/conditions/conditionSetCollector.js +3 -0
- package/lib/packlets/conditions/conditionSetCollector.js.map +1 -1
- package/lib/packlets/conditions/conditionToken.d.ts.map +1 -1
- package/lib/packlets/conditions/conditionToken.js +2 -1
- package/lib/packlets/conditions/conditionToken.js.map +1 -1
- package/lib/packlets/conditions/convert/decls.js +1 -1
- package/lib/packlets/conditions/convert/decls.js.map +1 -1
- package/lib/packlets/config/common.d.ts +35 -0
- package/lib/packlets/config/common.d.ts.map +1 -0
- package/lib/packlets/config/common.js +96 -0
- package/lib/packlets/config/common.js.map +1 -0
- package/lib/packlets/config/convert.d.ts +14 -0
- package/lib/packlets/config/convert.d.ts.map +1 -0
- package/lib/packlets/config/convert.js +82 -0
- package/lib/packlets/config/convert.js.map +1 -0
- package/lib/packlets/config/index.d.ts +6 -0
- package/lib/packlets/config/index.d.ts.map +1 -0
- package/lib/packlets/config/index.js +67 -0
- package/lib/packlets/config/index.js.map +1 -0
- package/lib/packlets/config/json.d.ts +20 -0
- package/lib/packlets/config/json.d.ts.map +1 -0
- package/lib/packlets/config/json.js +24 -0
- package/lib/packlets/config/json.js.map +1 -0
- package/lib/packlets/config/predefined/default.d.ts +57 -0
- package/lib/packlets/config/predefined/default.d.ts.map +1 -0
- package/lib/packlets/config/predefined/default.js +141 -0
- package/lib/packlets/config/predefined/default.js.map +1 -0
- package/lib/packlets/config/predefined/extended.d.ts +25 -0
- package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
- package/lib/packlets/config/predefined/extended.js +193 -0
- package/lib/packlets/config/predefined/extended.js.map +1 -0
- package/lib/packlets/config/predefined/index.d.ts +4 -0
- package/lib/packlets/config/predefined/index.d.ts.map +1 -0
- package/lib/packlets/config/predefined/index.js +62 -0
- package/lib/packlets/config/predefined/index.js.map +1 -0
- package/lib/packlets/config/systemConfiguration.d.ts +81 -0
- package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
- package/lib/packlets/config/systemConfiguration.js +172 -0
- package/lib/packlets/config/systemConfiguration.js.map +1 -0
- package/lib/packlets/context/contextDecls.d.ts +49 -0
- package/lib/packlets/context/contextDecls.d.ts.map +1 -0
- package/lib/packlets/context/contextDecls.js +24 -0
- package/lib/packlets/context/contextDecls.js.map +1 -0
- package/lib/packlets/context/contextToken.d.ts +111 -0
- package/lib/packlets/context/contextToken.d.ts.map +1 -0
- package/lib/packlets/context/contextToken.js +206 -0
- package/lib/packlets/context/contextToken.js.map +1 -0
- package/lib/packlets/context/convert/decls.d.ts +37 -0
- package/lib/packlets/context/convert/decls.d.ts.map +1 -0
- package/lib/packlets/context/convert/decls.js +94 -0
- package/lib/packlets/context/convert/decls.js.map +1 -0
- package/lib/packlets/context/convert/index.d.ts +2 -0
- package/lib/packlets/context/convert/index.d.ts.map +1 -0
- package/lib/packlets/context/convert/index.js +39 -0
- package/lib/packlets/context/convert/index.js.map +1 -0
- package/lib/packlets/context/index.d.ts +5 -0
- package/lib/packlets/context/index.d.ts.map +1 -0
- package/lib/packlets/context/index.js +65 -0
- package/lib/packlets/context/index.js.map +1 -0
- package/lib/packlets/decisions/abstractDecision.d.ts +8 -0
- package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -1
- package/lib/packlets/decisions/abstractDecision.js +9 -0
- package/lib/packlets/decisions/abstractDecision.js.map +1 -1
- package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -1
- package/lib/packlets/decisions/abstractDecisionCollector.js +2 -0
- package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -1
- package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -1
- package/lib/packlets/decisions/concreteDecision.js +3 -2
- package/lib/packlets/decisions/concreteDecision.js.map +1 -1
- package/lib/packlets/decisions/decision.d.ts.map +1 -1
- package/lib/packlets/decisions/decision.js +4 -0
- package/lib/packlets/decisions/decision.js.map +1 -1
- package/lib/packlets/import/fsItem.d.ts.map +1 -1
- package/lib/packlets/import/fsItem.js +1 -0
- package/lib/packlets/import/fsItem.js.map +1 -1
- package/lib/packlets/import/importContext.d.ts +19 -0
- package/lib/packlets/import/importContext.d.ts.map +1 -1
- package/lib/packlets/import/importContext.js +39 -0
- package/lib/packlets/import/importContext.js.map +1 -1
- package/lib/packlets/import/importManager.d.ts +5 -5
- package/lib/packlets/import/importManager.d.ts.map +1 -1
- package/lib/packlets/import/importManager.js.map +1 -1
- package/lib/packlets/import/importers/collectionImporter.d.ts +11 -13
- package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -1
- package/lib/packlets/import/importers/collectionImporter.js +29 -20
- package/lib/packlets/import/importers/collectionImporter.js.map +1 -1
- package/lib/packlets/import/importers/fsItemImporter.d.ts +2 -2
- package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -1
- package/lib/packlets/import/importers/fsItemImporter.js +2 -2
- package/lib/packlets/import/importers/fsItemImporter.js.map +1 -1
- package/lib/packlets/import/importers/importer.d.ts +3 -3
- package/lib/packlets/import/importers/importer.d.ts.map +1 -1
- package/lib/packlets/import/importers/importer.js.map +1 -1
- package/lib/packlets/import/importers/jsonImporter.d.ts +2 -3
- package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -1
- package/lib/packlets/import/importers/jsonImporter.js +10 -20
- package/lib/packlets/import/importers/jsonImporter.js.map +1 -1
- package/lib/packlets/import/importers/pathImporter.d.ts +2 -2
- package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -1
- package/lib/packlets/import/importers/pathImporter.js.map +1 -1
- package/lib/packlets/qualifier-types/config/convert.d.ts +44 -0
- package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/convert.js +96 -0
- package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
- package/lib/packlets/qualifier-types/config/index.d.ts +4 -0
- package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/index.js +64 -0
- package/lib/packlets/qualifier-types/config/index.js.map +1 -0
- package/lib/packlets/qualifier-types/config/json.d.ts +69 -0
- package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/config/json.js +24 -0
- package/lib/packlets/qualifier-types/config/json.js.map +1 -0
- package/lib/packlets/qualifier-types/convert.d.ts +10 -2
- package/lib/packlets/qualifier-types/convert.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/convert.js +15 -0
- package/lib/packlets/qualifier-types/convert.js.map +1 -1
- package/lib/packlets/qualifier-types/helpers.d.ts +27 -0
- package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/helpers.js +118 -0
- package/lib/packlets/qualifier-types/helpers.js.map +1 -0
- package/lib/packlets/qualifier-types/index.d.ts +4 -1
- package/lib/packlets/qualifier-types/index.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/index.js +5 -1
- package/lib/packlets/qualifier-types/index.js.map +1 -1
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts +19 -8
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/languageQualifierType.js +28 -9
- package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -1
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts +38 -13
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/literalQualifierType.js +44 -10
- package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -1
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +107 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.js +215 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
- package/lib/packlets/qualifier-types/qualifierType.d.ts +22 -18
- package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/qualifierType.js +9 -4
- package/lib/packlets/qualifier-types/qualifierType.js.map +1 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts +4 -2
- package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.js +2 -1
- package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -1
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +47 -11
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/territoryQualifierType.js +61 -17
- package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -1
- package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -1
- package/lib/packlets/qualifiers/convert/decls.js +17 -15
- package/lib/packlets/qualifiers/convert/decls.js.map +1 -1
- package/lib/packlets/qualifiers/index.d.ts +2 -0
- package/lib/packlets/qualifiers/index.d.ts.map +1 -1
- package/lib/packlets/qualifiers/index.js +2 -0
- package/lib/packlets/qualifiers/index.js.map +1 -1
- package/lib/packlets/qualifiers/qualifier.d.ts +22 -2
- package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -1
- package/lib/packlets/qualifiers/qualifier.js +26 -1
- package/lib/packlets/qualifiers/qualifier.js.map +1 -1
- package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -1
- package/lib/packlets/qualifiers/qualifierCollector.js +4 -0
- package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -1
- package/lib/packlets/qualifiers/qualifierDecl.d.ts +6 -1
- package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -1
- package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -1
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts +32 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js +24 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts +96 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.js +179 -0
- package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
- package/lib/packlets/resource-json/compiled/common.d.ts +14 -0
- package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/common.js +24 -0
- package/lib/packlets/resource-json/compiled/common.js.map +1 -0
- package/lib/packlets/resource-json/compiled/convert.d.ts +63 -0
- package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/convert.js +167 -0
- package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
- package/lib/packlets/resource-json/compiled/index.d.ts +5 -0
- package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/index.js +65 -0
- package/lib/packlets/resource-json/compiled/index.js.map +1 -0
- package/lib/packlets/resource-json/compiled/json.d.ts +204 -0
- package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
- package/lib/packlets/resource-json/compiled/json.js +3 -0
- package/lib/packlets/resource-json/compiled/json.js.map +1 -0
- package/lib/packlets/resource-json/convert.d.ts +16 -0
- package/lib/packlets/resource-json/convert.d.ts.map +1 -1
- package/lib/packlets/resource-json/convert.js +41 -6
- package/lib/packlets/resource-json/convert.js.map +1 -1
- package/lib/packlets/resource-json/helpers.d.ts +82 -3
- package/lib/packlets/resource-json/helpers.d.ts.map +1 -1
- package/lib/packlets/resource-json/helpers.js +185 -2
- package/lib/packlets/resource-json/helpers.js.map +1 -1
- package/lib/packlets/resource-json/index.d.ts +2 -1
- package/lib/packlets/resource-json/index.d.ts.map +1 -1
- package/lib/packlets/resource-json/index.js +3 -1
- package/lib/packlets/resource-json/index.js.map +1 -1
- package/lib/packlets/resource-json/json.d.ts +55 -3
- package/lib/packlets/resource-json/json.d.ts.map +1 -1
- package/lib/packlets/resource-json/json.js +16 -0
- package/lib/packlets/resource-json/json.js.map +1 -1
- package/lib/packlets/resource-json/normalized.d.ts +46 -3
- package/lib/packlets/resource-json/normalized.d.ts.map +1 -1
- package/lib/packlets/resource-json/normalized.js.map +1 -1
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts +14 -10
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -1
- package/lib/packlets/resource-json/resourceDeclCollection.js +18 -14
- package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -1
- package/lib/packlets/resource-json/resourceDeclContainer.d.ts +15 -2
- package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -1
- package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -1
- package/lib/packlets/resource-json/resourceDeclTree.d.ts +6 -2
- package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -1
- package/lib/packlets/resource-json/resourceDeclTree.js +12 -3
- package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -1
- package/lib/packlets/resource-types/config/convert.d.ts +8 -0
- package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
- package/lib/packlets/resource-types/config/convert.js +36 -0
- package/lib/packlets/resource-types/config/convert.js.map +1 -0
- package/lib/packlets/resource-types/config/index.d.ts +4 -0
- package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
- package/lib/packlets/resource-types/config/index.js +64 -0
- package/lib/packlets/resource-types/config/index.js.map +1 -0
- package/lib/packlets/resource-types/config/json.d.ts +9 -0
- package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
- package/lib/packlets/resource-types/config/json.js +24 -0
- package/lib/packlets/resource-types/config/json.js.map +1 -0
- package/lib/packlets/resource-types/helpers.d.ts +13 -0
- package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
- package/lib/packlets/resource-types/helpers.js +44 -0
- package/lib/packlets/resource-types/helpers.js.map +1 -0
- package/lib/packlets/resource-types/index.d.ts +3 -0
- package/lib/packlets/resource-types/index.d.ts.map +1 -1
- package/lib/packlets/resource-types/index.js +26 -0
- package/lib/packlets/resource-types/index.js.map +1 -1
- package/lib/packlets/resource-types/jsonResourceType.d.ts +5 -13
- package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -1
- package/lib/packlets/resource-types/jsonResourceType.js +5 -2
- package/lib/packlets/resource-types/jsonResourceType.js.map +1 -1
- package/lib/packlets/resource-types/resourceType.d.ts +33 -32
- package/lib/packlets/resource-types/resourceType.d.ts.map +1 -1
- package/lib/packlets/resource-types/resourceType.js.map +1 -1
- package/lib/packlets/resources/candidateReducer.d.ts +98 -0
- package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
- package/lib/packlets/resources/candidateReducer.js +247 -0
- package/lib/packlets/resources/candidateReducer.js.map +1 -0
- package/lib/packlets/resources/common.d.ts +60 -0
- package/lib/packlets/resources/common.d.ts.map +1 -0
- package/lib/packlets/resources/common.js +24 -0
- package/lib/packlets/resources/common.js.map +1 -0
- package/lib/packlets/resources/index.d.ts +3 -1
- package/lib/packlets/resources/index.d.ts.map +1 -1
- package/lib/packlets/resources/index.js +3 -1
- package/lib/packlets/resources/index.js.map +1 -1
- package/lib/packlets/resources/resource.d.ts +57 -5
- package/lib/packlets/resources/resource.d.ts.map +1 -1
- package/lib/packlets/resources/resource.js +96 -6
- package/lib/packlets/resources/resource.js.map +1 -1
- package/lib/packlets/resources/resourceBuilder.d.ts +14 -0
- package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -1
- package/lib/packlets/resources/resourceBuilder.js +19 -1
- package/lib/packlets/resources/resourceBuilder.js.map +1 -1
- package/lib/packlets/resources/resourceCandidate.d.ts +42 -6
- package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -1
- package/lib/packlets/resources/resourceCandidate.js +40 -1
- package/lib/packlets/resources/resourceCandidate.js.map +1 -1
- package/lib/packlets/resources/resourceManagerBuilder.d.ts +220 -0
- package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
- package/lib/packlets/resources/resourceManagerBuilder.js +451 -0
- package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
- package/lib/packlets/runtime/cacheListener.d.ts +62 -0
- package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
- package/lib/packlets/runtime/cacheListener.js +56 -0
- package/lib/packlets/runtime/cacheListener.js.map +1 -0
- package/lib/packlets/runtime/cacheMetrics.d.ts +82 -0
- package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
- package/lib/packlets/runtime/cacheMetrics.js +143 -0
- package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
- package/lib/packlets/runtime/compiledResourceCollection.d.ts +167 -0
- package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
- package/lib/packlets/runtime/compiledResourceCollection.js +466 -0
- package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
- package/lib/packlets/runtime/conditionSetResolutionResult.d.ts +70 -0
- package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
- package/lib/packlets/runtime/conditionSetResolutionResult.js +135 -0
- package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +80 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.js +33 -0
- package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +165 -0
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +179 -0
- package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
- package/lib/packlets/runtime/context/index.d.ts +5 -0
- package/lib/packlets/runtime/context/index.d.ts.map +1 -0
- package/lib/packlets/runtime/context/index.js +42 -0
- package/lib/packlets/runtime/context/index.js.map +1 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +111 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +177 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +47 -0
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +64 -0
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
- package/lib/packlets/runtime/iResourceManager.d.ts +88 -0
- package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
- package/lib/packlets/runtime/iResourceManager.js +24 -0
- package/lib/packlets/runtime/iResourceManager.js.map +1 -0
- package/lib/packlets/runtime/index.d.ts +12 -0
- package/lib/packlets/runtime/index.d.ts.map +1 -0
- package/lib/packlets/runtime/index.js +73 -0
- package/lib/packlets/runtime/index.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/common.d.ts +91 -0
- package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/common.js +24 -0
- package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/index.d.ts +5 -0
- package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/index.js +42 -0
- package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts +141 -0
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js +224 -0
- package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts +24 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js +98 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +99 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +165 -0
- package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
- package/lib/packlets/runtime/resourceResolver.d.ts +196 -0
- package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
- package/lib/packlets/runtime/resourceResolver.js +437 -0
- package/lib/packlets/runtime/resourceResolver.js.map +1 -0
- package/lib/packlets/runtime/validate.d.ts +13 -0
- package/lib/packlets/runtime/validate.d.ts.map +1 -0
- package/lib/packlets/runtime/validate.js +49 -0
- package/lib/packlets/runtime/validate.js.map +1 -0
- package/package.json +76 -75
- package/lib/packlets/resources/resourceManager.d.ts +0 -104
- package/lib/packlets/resources/resourceManager.d.ts.map +0 -1
- package/lib/packlets/resources/resourceManager.js +0 -201
- package/lib/packlets/resources/resourceManager.js.map +0 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.ResourceTreeChildrenValidator = void 0;
|
|
25
|
+
const common_1 = require("../../common");
|
|
26
|
+
const ts_utils_1 = require("@fgv/ts-utils");
|
|
27
|
+
/**
|
|
28
|
+
* A validator wrapper for resource tree children that validates string inputs before
|
|
29
|
+
* delegating to the underlying tree children collection.
|
|
30
|
+
*
|
|
31
|
+
* This class implements {@link Runtime.ResourceTree.IReadOnlyValidatingResourceTreeChildren | IReadOnlyValidatingResourceTreeChildren}
|
|
32
|
+
* by wrapping an {@link Runtime.ResourceTree.IReadOnlyResourceTreeChildren | IReadOnlyResourceTreeChildren} instance and
|
|
33
|
+
* providing string-based access to all tree operations. All string inputs are validated using the library's
|
|
34
|
+
* validation utilities before being passed to the underlying collection.
|
|
35
|
+
*
|
|
36
|
+
* The validator acts as a bridge between string-based external APIs and the
|
|
37
|
+
* strongly-typed internal tree operations, ensuring type safety and consistent
|
|
38
|
+
* error handling throughout the resource tree navigation.
|
|
39
|
+
*
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
class ResourceTreeChildrenValidator {
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new validator wrapper for resource tree children.
|
|
45
|
+
* @param inner - The underlying resource tree children collection to wrap with validation
|
|
46
|
+
*/
|
|
47
|
+
constructor(inner) {
|
|
48
|
+
this._inner = inner;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Gets a tree node by its string ResourceId path, validating the input.
|
|
52
|
+
* @param id - The string ResourceId path to validate and look up
|
|
53
|
+
* @returns Result containing the node if found, or failure if validation fails or not found
|
|
54
|
+
*/
|
|
55
|
+
getById(id) {
|
|
56
|
+
return common_1.Validate.toResourceId(id).onSuccess((resourceId) => {
|
|
57
|
+
return this._inner.getById(resourceId);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Gets a resource node by its string name (single component), validating the input.
|
|
62
|
+
* @param name - The string ResourceName to validate and look up
|
|
63
|
+
* @returns Result containing the node if it's a resource, or failure if validation fails or not found
|
|
64
|
+
*/
|
|
65
|
+
getResource(name) {
|
|
66
|
+
return common_1.Validate.toResourceName(name).onSuccess((resourceName) => {
|
|
67
|
+
return this._inner.getResource(resourceName);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Gets a branch node by its string name (single component), validating the input.
|
|
72
|
+
* @param name - The string ResourceName to validate and look up
|
|
73
|
+
* @returns Result containing the node if it's a branch, or failure if validation fails or not found
|
|
74
|
+
*/
|
|
75
|
+
getBranch(name) {
|
|
76
|
+
return common_1.Validate.toResourceName(name).onSuccess((resourceName) => {
|
|
77
|
+
return this._inner.getBranch(resourceName);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Gets a resource leaf node by its string ResourceId path, validating the input.
|
|
82
|
+
* @param id - The string ResourceId path to validate and look up
|
|
83
|
+
* @returns Result containing the leaf if found and is a resource, or failure otherwise
|
|
84
|
+
*/
|
|
85
|
+
getResourceById(id) {
|
|
86
|
+
return common_1.Validate.toResourceId(id).onSuccess((resourceId) => {
|
|
87
|
+
return this._inner.getResourceById(resourceId);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Gets a branch node by its string ResourceId path, validating the input.
|
|
92
|
+
* @param id - The string ResourceId path to validate and look up
|
|
93
|
+
* @returns Result containing the branch if found and has children, or failure otherwise
|
|
94
|
+
*/
|
|
95
|
+
getBranchById(id) {
|
|
96
|
+
return common_1.Validate.toResourceId(id).onSuccess((resourceId) => {
|
|
97
|
+
return this._inner.getBranchById(resourceId);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The number of direct child nodes in this collection.
|
|
102
|
+
*/
|
|
103
|
+
get size() {
|
|
104
|
+
return this._inner.size;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Returns an iterator of [ResourceName, node] pairs for all child nodes.
|
|
108
|
+
* @returns Map iterator for all child nodes
|
|
109
|
+
*/
|
|
110
|
+
entries() {
|
|
111
|
+
return this._inner.entries();
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Executes a callback function for each child node in the collection.
|
|
115
|
+
* @param cb - The callback function to execute for each child node
|
|
116
|
+
* @param arg - Optional argument to pass to the callback
|
|
117
|
+
*/
|
|
118
|
+
forEach(cb, arg) {
|
|
119
|
+
for (const [key, value] of this._inner.entries()) {
|
|
120
|
+
cb(value, key, this, arg);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Gets a child node by its ResourceName key with detailed error information.
|
|
125
|
+
* @param key - The ResourceName key to look up
|
|
126
|
+
* @returns DetailedResult containing the node if found, or failure with details
|
|
127
|
+
*/
|
|
128
|
+
get(key) {
|
|
129
|
+
if (common_1.Validate.isValidResourceName(key)) {
|
|
130
|
+
return this._inner.get(key);
|
|
131
|
+
}
|
|
132
|
+
return (0, ts_utils_1.failWithDetail)(`${key}: invalid resource name.`, 'invalid-key');
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Checks if a child node exists at the given ResourceName key.
|
|
136
|
+
* @param key - The ResourceName key to check
|
|
137
|
+
* @returns True if a child node exists at the key, false otherwise
|
|
138
|
+
*/
|
|
139
|
+
has(key) {
|
|
140
|
+
return this._inner.has(key);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Returns an iterator of ResourceName keys for all child nodes.
|
|
144
|
+
* @returns Map iterator for all child node keys
|
|
145
|
+
*/
|
|
146
|
+
keys() {
|
|
147
|
+
return this._inner.keys();
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Returns an iterator of child node values.
|
|
151
|
+
* @returns Map iterator for all child node values
|
|
152
|
+
*/
|
|
153
|
+
values() {
|
|
154
|
+
return this._inner.values();
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Returns an iterator for [ResourceName, node] pairs, enabling for...of iteration.
|
|
158
|
+
* @returns Iterable iterator for all child nodes
|
|
159
|
+
*/
|
|
160
|
+
[Symbol.iterator]() {
|
|
161
|
+
return this._inner[Symbol.iterator]();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
exports.ResourceTreeChildrenValidator = ResourceTreeChildrenValidator;
|
|
165
|
+
//# sourceMappingURL=resourceTreeChildrenValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceTreeChildrenValidator.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/resourceTreeChildrenValidator.ts"],"names":[],"mappings":"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","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Validate } from '../../common';\nimport { Result, IReadOnlyResultMap, DetailedResult, Collections, failWithDetail } from '@fgv/ts-utils';\nimport { ResourceName } from '../../common';\nimport {\n IReadOnlyResourceTreeBranch,\n IReadOnlyResourceTreeChildren,\n IReadOnlyResourceTreeLeaf,\n IReadOnlyResourceTreeNode\n} from './common';\n\n/**\n * A validator wrapper for resource tree children that validates string inputs before\n * delegating to the underlying tree children collection.\n *\n * This class implements {@link Runtime.ResourceTree.IReadOnlyValidatingResourceTreeChildren | IReadOnlyValidatingResourceTreeChildren}\n * by wrapping an {@link Runtime.ResourceTree.IReadOnlyResourceTreeChildren | IReadOnlyResourceTreeChildren} instance and\n * providing string-based access to all tree operations. All string inputs are validated using the library's\n * validation utilities before being passed to the underlying collection.\n *\n * The validator acts as a bridge between string-based external APIs and the\n * strongly-typed internal tree operations, ensuring type safety and consistent\n * error handling throughout the resource tree navigation.\n *\n * @internal\n */\nexport class ResourceTreeChildrenValidator<T> implements IReadOnlyResourceTreeChildren<T, string, string> {\n private readonly _inner: IReadOnlyResourceTreeChildren<T>;\n\n /**\n * Creates a new validator wrapper for resource tree children.\n * @param inner - The underlying resource tree children collection to wrap with validation\n */\n public constructor(inner: IReadOnlyResourceTreeChildren<T>) {\n this._inner = inner;\n }\n\n /**\n * Gets a tree node by its string ResourceId path, validating the input.\n * @param id - The string ResourceId path to validate and look up\n * @returns Result containing the node if found, or failure if validation fails or not found\n */\n public getById(id: string): Result<IReadOnlyResourceTreeNode<T>> {\n return Validate.toResourceId(id).onSuccess((resourceId) => {\n return this._inner.getById(resourceId);\n });\n }\n\n /**\n * Gets a resource node by its string name (single component), validating the input.\n * @param name - The string ResourceName to validate and look up\n * @returns Result containing the node if it's a resource, or failure if validation fails or not found\n */\n public getResource(name: string): Result<IReadOnlyResourceTreeNode<T>> {\n return Validate.toResourceName(name).onSuccess((resourceName) => {\n return this._inner.getResource(resourceName);\n });\n }\n\n /**\n * Gets a branch node by its string name (single component), validating the input.\n * @param name - The string ResourceName to validate and look up\n * @returns Result containing the node if it's a branch, or failure if validation fails or not found\n */\n public getBranch(name: string): Result<IReadOnlyResourceTreeNode<T>> {\n return Validate.toResourceName(name).onSuccess((resourceName) => {\n return this._inner.getBranch(resourceName);\n });\n }\n\n /**\n * Gets a resource leaf node by its string ResourceId path, validating the input.\n * @param id - The string ResourceId path to validate and look up\n * @returns Result containing the leaf if found and is a resource, or failure otherwise\n */\n public getResourceById(id: string): Result<IReadOnlyResourceTreeLeaf<T>> {\n return Validate.toResourceId(id).onSuccess((resourceId) => {\n return this._inner.getResourceById(resourceId);\n });\n }\n\n /**\n * Gets a branch node by its string ResourceId path, validating the input.\n * @param id - The string ResourceId path to validate and look up\n * @returns Result containing the branch if found and has children, or failure otherwise\n */\n public getBranchById(id: string): Result<IReadOnlyResourceTreeBranch<T>> {\n return Validate.toResourceId(id).onSuccess((resourceId) => {\n return this._inner.getBranchById(resourceId);\n });\n }\n\n /**\n * The number of direct child nodes in this collection.\n */\n public get size(): number {\n return this._inner.size;\n }\n\n /**\n * Returns an iterator of [ResourceName, node] pairs for all child nodes.\n * @returns Map iterator for all child nodes\n */\n public entries(): IterableIterator<[ResourceName, IReadOnlyResourceTreeNode<T>]> {\n return this._inner.entries();\n }\n\n /**\n * Executes a callback function for each child node in the collection.\n * @param cb - The callback function to execute for each child node\n * @param arg - Optional argument to pass to the callback\n */\n public forEach(\n cb: (value: unknown, key: string, map: IReadOnlyResultMap<string, unknown>, thisArg?: unknown) => void,\n arg?: unknown\n ): void {\n for (const [key, value] of this._inner.entries()) {\n cb(value, key as ResourceName, this, arg);\n }\n }\n\n /**\n * Gets a child node by its ResourceName key with detailed error information.\n * @param key - The ResourceName key to look up\n * @returns DetailedResult containing the node if found, or failure with details\n */\n public get(\n key: ResourceName\n ): DetailedResult<IReadOnlyResourceTreeNode<T>, Collections.ResultMapResultDetail> {\n if (Validate.isValidResourceName(key)) {\n return this._inner.get(key);\n }\n return failWithDetail(`${key}: invalid resource name.`, 'invalid-key');\n }\n\n /**\n * Checks if a child node exists at the given ResourceName key.\n * @param key - The ResourceName key to check\n * @returns True if a child node exists at the key, false otherwise\n */\n public has(key: ResourceName): boolean {\n return this._inner.has(key as ResourceName);\n }\n\n /**\n * Returns an iterator of ResourceName keys for all child nodes.\n * @returns Map iterator for all child node keys\n */\n public keys(): IterableIterator<ResourceName> {\n return this._inner.keys();\n }\n\n /**\n * Returns an iterator of child node values.\n * @returns Map iterator for all child node values\n */\n public values(): IterableIterator<IReadOnlyResourceTreeNode<T>> {\n return this._inner.values();\n }\n\n /**\n * Returns an iterator for [ResourceName, node] pairs, enabling for...of iteration.\n * @returns Iterable iterator for all child nodes\n */\n public [Symbol.iterator](): IterableIterator<[ResourceName, IReadOnlyResourceTreeNode<T>]> {\n return this._inner[Symbol.iterator]();\n }\n}\n"]}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { Result } from '@fgv/ts-utils';
|
|
2
|
+
import { JsonValue } from '@fgv/ts-json-base';
|
|
3
|
+
import { Condition, ConditionSet } from '../conditions';
|
|
4
|
+
import { AbstractDecision } from '../decisions';
|
|
5
|
+
import { ReadOnlyQualifierTypeCollector } from '../qualifier-types';
|
|
6
|
+
import { IContextQualifierProvider } from './context';
|
|
7
|
+
import { IResourceManager, IResource, IResourceCandidate } from './iResourceManager';
|
|
8
|
+
import { ConditionSetResolutionResult, IConditionMatchResult } from './conditionSetResolutionResult';
|
|
9
|
+
import { IResourceResolverCacheListener } from './cacheListener';
|
|
10
|
+
/**
|
|
11
|
+
* Represents the cached result of resolving a decision.
|
|
12
|
+
* Contains either a failure indicator or a list of instance indices for matching condition sets,
|
|
13
|
+
* ordered by condition set priority.
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export type DecisionResolutionResult = {
|
|
17
|
+
success: false;
|
|
18
|
+
} | {
|
|
19
|
+
success: true;
|
|
20
|
+
instanceIndices: ReadonlyArray<number>;
|
|
21
|
+
defaultInstanceIndices: ReadonlyArray<number>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Parameters for creating a {@link Runtime.ResourceResolver | ResourceResolver}.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export interface IResourceResolverCreateParams {
|
|
28
|
+
/**
|
|
29
|
+
* The {@link Runtime.IResourceManager | resource manager} that defines the resources available
|
|
30
|
+
* and provides access to qualifiers and conditions.
|
|
31
|
+
*/
|
|
32
|
+
resourceManager: IResourceManager;
|
|
33
|
+
/**
|
|
34
|
+
* The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | readonly qualifier type collector}
|
|
35
|
+
* that provides qualifier implementations for condition evaluation.
|
|
36
|
+
*/
|
|
37
|
+
qualifierTypes: ReadOnlyQualifierTypeCollector;
|
|
38
|
+
/**
|
|
39
|
+
* The {@link Runtime.Context.IContextQualifierProvider | context qualifier provider} that resolves
|
|
40
|
+
* qualifier values for the current context.
|
|
41
|
+
*/
|
|
42
|
+
contextQualifierProvider: IContextQualifierProvider;
|
|
43
|
+
/**
|
|
44
|
+
* An optional listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.
|
|
45
|
+
*/
|
|
46
|
+
listener?: IResourceResolverCacheListener;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* High-performance runtime resource resolver with O(1) condition caching.
|
|
50
|
+
* Resolves resources for a given context by evaluating conditions against qualifier values
|
|
51
|
+
* and caching results for optimal performance.
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
export declare class ResourceResolver {
|
|
55
|
+
/**
|
|
56
|
+
* The resource manager that defines available resources and provides condition access.
|
|
57
|
+
*/
|
|
58
|
+
readonly resourceManager: IResourceManager;
|
|
59
|
+
/**
|
|
60
|
+
* The readonly qualifier type collector that provides qualifier implementations.
|
|
61
|
+
*/
|
|
62
|
+
readonly qualifierTypes: ReadOnlyQualifierTypeCollector;
|
|
63
|
+
/**
|
|
64
|
+
* The context qualifier provider that resolves qualifier values.
|
|
65
|
+
*/
|
|
66
|
+
readonly contextQualifierProvider: IContextQualifierProvider;
|
|
67
|
+
/**
|
|
68
|
+
* The cache array for resolved conditions, indexed by condition index for O(1) lookup.
|
|
69
|
+
* Each entry stores the resolved {@link Runtime.IConditionMatchResult | condition match result} for
|
|
70
|
+
* the corresponding condition.
|
|
71
|
+
*/
|
|
72
|
+
get conditionCache(): ReadonlyArray<IConditionMatchResult | undefined>;
|
|
73
|
+
/**
|
|
74
|
+
* The cache array for resolved condition sets, indexed by condition set index for O(1) lookup.
|
|
75
|
+
* Each entry stores the resolved ConditionSetResolutionResult for the corresponding condition set.
|
|
76
|
+
*/
|
|
77
|
+
get conditionSetCache(): ReadonlyArray<ConditionSetResolutionResult | undefined>;
|
|
78
|
+
/**
|
|
79
|
+
* The cache array for resolved decisions, indexed by decision index for O(1) lookup.
|
|
80
|
+
* Each entry stores the resolved DecisionResolutionResult for the corresponding decision.
|
|
81
|
+
*/
|
|
82
|
+
get decisionCache(): ReadonlyArray<DecisionResolutionResult | undefined>;
|
|
83
|
+
/**
|
|
84
|
+
* Cache array for resolved conditions, indexed by condition index for O(1) lookup.
|
|
85
|
+
* Each entry stores the resolved QualifierMatchScore for the corresponding condition.
|
|
86
|
+
*/
|
|
87
|
+
private readonly _conditionCache;
|
|
88
|
+
/**
|
|
89
|
+
* Cache array for resolved condition sets, indexed by condition set index for O(1) lookup.
|
|
90
|
+
* Each entry stores the resolved ConditionSetResolutionResult for the corresponding condition set.
|
|
91
|
+
*/
|
|
92
|
+
private readonly _conditionSetCache;
|
|
93
|
+
/**
|
|
94
|
+
* Cache array for resolved decisions, indexed by decision index for O(1) lookup.
|
|
95
|
+
* Each entry stores the resolved DecisionResolutionResult for the corresponding decision.
|
|
96
|
+
*/
|
|
97
|
+
private readonly _decisionCache;
|
|
98
|
+
/**
|
|
99
|
+
* The listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.
|
|
100
|
+
*/
|
|
101
|
+
private readonly _listener?;
|
|
102
|
+
/**
|
|
103
|
+
* Constructor for a {@link Runtime.ResourceResolver | ResourceResolver} object.
|
|
104
|
+
* @param params - {@link Runtime.IResourceResolverCreateParams | Parameters} used to create the resolver.
|
|
105
|
+
*/
|
|
106
|
+
protected constructor(params: IResourceResolverCreateParams);
|
|
107
|
+
/**
|
|
108
|
+
* Creates a new {@link Runtime.ResourceResolver | ResourceResolver} object.
|
|
109
|
+
* @param params - {@link Runtime.IResourceResolverCreateParams | Parameters} used to create the resolver.
|
|
110
|
+
* @returns `Success` with the new {@link Runtime.ResourceResolver | ResourceResolver} object if successful,
|
|
111
|
+
* or `Failure` with an error message if not.
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
static create(params: IResourceResolverCreateParams): Result<ResourceResolver>;
|
|
115
|
+
/**
|
|
116
|
+
* Resolves a condition by evaluating it against the current context.
|
|
117
|
+
* Uses O(1) caching based on the condition's globally unique sequential index.
|
|
118
|
+
* @param condition - The {@link Conditions.Condition | condition} to resolve.
|
|
119
|
+
* @returns `Success` with the {@link QualifierMatchScore | match score} if successful,
|
|
120
|
+
* or `Failure` with an error message if the condition cannot be resolved.
|
|
121
|
+
* @public
|
|
122
|
+
*/
|
|
123
|
+
resolveCondition(condition: Condition): Result<IConditionMatchResult>;
|
|
124
|
+
/**
|
|
125
|
+
* Resolves a condition set by evaluating all its constituent conditions against the current context.
|
|
126
|
+
* Uses O(1) caching based on the condition set's globally unique sequential index.
|
|
127
|
+
* @param conditionSet - The {@link Conditions.ConditionSet | condition set} to resolve.
|
|
128
|
+
* @returns `Success` with the {@link Runtime.ConditionSetResolutionResult | resolution result} if successful,
|
|
129
|
+
* or `Failure` with an error message if the condition set cannot be resolved.
|
|
130
|
+
* @public
|
|
131
|
+
*/
|
|
132
|
+
resolveConditionSet(conditionSet: ConditionSet): Result<ConditionSetResolutionResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Resolves a decision by evaluating all its constituent condition sets against the current context.
|
|
135
|
+
* Uses O(1) caching based on the decision's globally unique sequential index.
|
|
136
|
+
* @param decision - The {@link Decisions.AbstractDecision | abstract decision} to resolve.
|
|
137
|
+
* @returns `Success` with the {@link Runtime.DecisionResolutionResult | resolution result} if successful,
|
|
138
|
+
* or `Failure` with an error message if the decision cannot be resolved.
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
resolveDecision(decision: AbstractDecision): Result<DecisionResolutionResult>;
|
|
142
|
+
/**
|
|
143
|
+
* Resolves a resource by finding the best matching candidate.
|
|
144
|
+
* Uses the resource's associated decision to determine the best match based on the current context.
|
|
145
|
+
* @param resource - The {@link Resources.Resource | resource} to resolve.
|
|
146
|
+
* @returns `Success` with the best matching candidate if successful,
|
|
147
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
148
|
+
* @public
|
|
149
|
+
*/
|
|
150
|
+
resolveResource(resource: IResource): Result<IResourceCandidate>;
|
|
151
|
+
/**
|
|
152
|
+
* Resolves all matching resource candidates in priority order.
|
|
153
|
+
* Uses the resource's associated decision to determine all matching candidates based on the current context.
|
|
154
|
+
* @param resource - The {@link Resources.Resource | resource} to resolve.
|
|
155
|
+
* @returns `Success` with an array of all matching candidates in priority order if successful,
|
|
156
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
157
|
+
* @public
|
|
158
|
+
*/
|
|
159
|
+
resolveAllResourceCandidates(resource: IResource): Result<ReadonlyArray<IResourceCandidate>>;
|
|
160
|
+
/**
|
|
161
|
+
* Resolves a resource to a composed value by merging matching candidates according to their merge methods.
|
|
162
|
+
* Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
|
|
163
|
+
* priority "partial" candidates into it in ascending order of priority.
|
|
164
|
+
* @param resource - The {@link Resources.Resource | resource} to resolve.
|
|
165
|
+
* @returns `Success` with the composed JsonValue if successful,
|
|
166
|
+
* or `Failure` with an error message if no candidates match or resolution fails.
|
|
167
|
+
* @public
|
|
168
|
+
*/
|
|
169
|
+
resolveComposedResourceValue(resource: IResource): Result<JsonValue>;
|
|
170
|
+
/**
|
|
171
|
+
* Clears all caches (condition, condition set, and decision), forcing all cached items
|
|
172
|
+
* to be re-evaluated on next access. This should be called when the context changes and cached
|
|
173
|
+
* results are no longer valid.
|
|
174
|
+
* @public
|
|
175
|
+
*/
|
|
176
|
+
clearConditionCache(): void;
|
|
177
|
+
/**
|
|
178
|
+
* Gets the current size of the condition cache array.
|
|
179
|
+
* @returns The size of the condition cache array.
|
|
180
|
+
* @public
|
|
181
|
+
*/
|
|
182
|
+
get conditionCacheSize(): number;
|
|
183
|
+
/**
|
|
184
|
+
* Gets the current size of the condition set cache array.
|
|
185
|
+
* @returns The size of the condition set cache array.
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
get conditionSetCacheSize(): number;
|
|
189
|
+
/**
|
|
190
|
+
* Gets the current size of the decision cache array.
|
|
191
|
+
* @returns The size of the decision cache array.
|
|
192
|
+
* @public
|
|
193
|
+
*/
|
|
194
|
+
get decisionCacheSize(): number;
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=resourceResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceResolver.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/resourceResolver.ts"],"names":[],"mappings":"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"}
|