@fgv/ts-res 4.5.0-3 → 5.0.0-2
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 +4241 -318
- 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 +1 -0
- 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 +42 -13
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/literalQualifierType.js +58 -10
- package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -1
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +114 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.js +228 -0
- package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
- package/lib/packlets/qualifier-types/qualifierType.d.ts +33 -18
- package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -1
- package/lib/packlets/qualifier-types/qualifierType.js +18 -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 +31 -30
- 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,88 @@
|
|
|
1
|
+
import { Result, Collections } from '@fgv/ts-utils';
|
|
2
|
+
import { JsonObject } from '@fgv/ts-json-base';
|
|
3
|
+
import { ReadOnlyConditionCollector, ReadOnlyConditionSetCollector } from '../conditions';
|
|
4
|
+
import { ReadOnlyAbstractDecisionCollector, ConcreteDecision } from '../decisions';
|
|
5
|
+
import { ResourceId, ResourceValueMergeMethod } from '../common';
|
|
6
|
+
import { ResourceType } from '../resource-types';
|
|
7
|
+
import { IContextDecl, IValidatedContextDecl } from '../context';
|
|
8
|
+
/**
|
|
9
|
+
* Runtime representation of a resource candidate with the minimal data needed for resolution.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface IResourceCandidate {
|
|
13
|
+
/** The JSON value for this candidate */
|
|
14
|
+
readonly json: JsonObject;
|
|
15
|
+
/**
|
|
16
|
+
* Indicates if this candidate is a partial resource.
|
|
17
|
+
*/
|
|
18
|
+
readonly isPartial: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Specifies the resource type of this candidate.
|
|
21
|
+
*/
|
|
22
|
+
readonly mergeMethod: ResourceValueMergeMethod;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Interface for a resource that can be used in the runtime layer.
|
|
26
|
+
* This provides the minimal properties needed from a resource without requiring
|
|
27
|
+
* the full Resources layer dependencies.
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export interface IResource {
|
|
31
|
+
/** The resource identifier */
|
|
32
|
+
readonly id: string;
|
|
33
|
+
/** The resource type */
|
|
34
|
+
readonly resourceType: ResourceType;
|
|
35
|
+
/** The decision used to select candidates */
|
|
36
|
+
readonly decision: ConcreteDecision;
|
|
37
|
+
/** The available candidates for this resource */
|
|
38
|
+
readonly candidates: ReadonlyArray<IResourceCandidate>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Interface defining the read-only properties that the runtime resource resolver needs
|
|
42
|
+
* from a resource manager. This abstraction allows the runtime to work with different
|
|
43
|
+
* implementations without requiring the full ResourceManagerBuilder build mechanics.
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
export interface IResourceManager {
|
|
47
|
+
/**
|
|
48
|
+
* A {@link Conditions.ReadOnlyConditionCollector | ReadOnlyConditionCollector} which
|
|
49
|
+
* contains the {@link Conditions.Condition | conditions} used by resource candidates.
|
|
50
|
+
*/
|
|
51
|
+
readonly conditions: ReadOnlyConditionCollector;
|
|
52
|
+
/**
|
|
53
|
+
* A {@link Conditions.ReadOnlyConditionSetCollector | ReadOnlyConditionSetCollector} which
|
|
54
|
+
* contains the {@link Conditions.ConditionSet | condition sets} used by resource candidates.
|
|
55
|
+
*/
|
|
56
|
+
readonly conditionSets: ReadOnlyConditionSetCollector;
|
|
57
|
+
/**
|
|
58
|
+
* A {@link Decisions.ReadOnlyAbstractDecisionCollector | ReadOnlyAbstractDecisionCollector} which
|
|
59
|
+
* contains the {@link Decisions.Decision | abstract decisions} used by resource candidates.
|
|
60
|
+
*/
|
|
61
|
+
readonly decisions: ReadOnlyAbstractDecisionCollector;
|
|
62
|
+
/**
|
|
63
|
+
* Gets a built resource by ID for runtime resolution.
|
|
64
|
+
* @param id - The resource identifier
|
|
65
|
+
* @returns Success with the runtime resource if found, Failure otherwise
|
|
66
|
+
*/
|
|
67
|
+
getBuiltResource(id: string): Result<IResource>;
|
|
68
|
+
/**
|
|
69
|
+
* A read-only result map of all built resources, keyed by resource ID.
|
|
70
|
+
* Resources are built on-demand when accessed and returns Results for error handling.
|
|
71
|
+
*/
|
|
72
|
+
readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId, IResource>;
|
|
73
|
+
/**
|
|
74
|
+
* The number of resources in this resource manager.
|
|
75
|
+
*/
|
|
76
|
+
readonly numResources: number;
|
|
77
|
+
/**
|
|
78
|
+
* The number of candidates in this resource manager.
|
|
79
|
+
*/
|
|
80
|
+
readonly numCandidates: number;
|
|
81
|
+
/**
|
|
82
|
+
* Validates a context declaration against the qualifiers managed by this resource manager.
|
|
83
|
+
* @param context - The context declaration to validate
|
|
84
|
+
* @returns Success with the validated context if successful, Failure otherwise
|
|
85
|
+
*/
|
|
86
|
+
validateContext(context: IContextDecl): Result<IValidatedContextDecl>;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=iResourceManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iResourceManager.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/iResourceManager.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,iCAAiC,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEjE;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,wBAAwB,CAAC;CAChD;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,wBAAwB;IACxB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACxD;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,0BAA0B,CAAC;IAEhD;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,6BAA6B,CAAC;IAEtD;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,iCAAiC,CAAC;IAEtD;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAEhD;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,4BAA4B,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAEzF;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;CACvE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
//# sourceMappingURL=iResourceManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iResourceManager.js","sourceRoot":"","sources":["../../../src/packlets/runtime/iResourceManager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","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 { Result, Collections } from '@fgv/ts-utils';\nimport { JsonObject } from '@fgv/ts-json-base';\nimport { ReadOnlyConditionCollector, ReadOnlyConditionSetCollector } from '../conditions';\nimport { ReadOnlyAbstractDecisionCollector, ConcreteDecision } from '../decisions';\nimport { ResourceId, ResourceValueMergeMethod } from '../common';\nimport { ResourceType } from '../resource-types';\nimport { IContextDecl, IValidatedContextDecl } from '../context';\n\n/**\n * Runtime representation of a resource candidate with the minimal data needed for resolution.\n * @public\n */\nexport interface IResourceCandidate {\n /** The JSON value for this candidate */\n readonly json: JsonObject;\n\n /**\n * Indicates if this candidate is a partial resource.\n */\n readonly isPartial: boolean;\n\n /**\n * Specifies the resource type of this candidate.\n */\n readonly mergeMethod: ResourceValueMergeMethod;\n}\n\n/**\n * Interface for a resource that can be used in the runtime layer.\n * This provides the minimal properties needed from a resource without requiring\n * the full Resources layer dependencies.\n * @public\n */\nexport interface IResource {\n /** The resource identifier */\n readonly id: string;\n /** The resource type */\n readonly resourceType: ResourceType;\n /** The decision used to select candidates */\n readonly decision: ConcreteDecision;\n /** The available candidates for this resource */\n readonly candidates: ReadonlyArray<IResourceCandidate>;\n}\n\n/**\n * Interface defining the read-only properties that the runtime resource resolver needs\n * from a resource manager. This abstraction allows the runtime to work with different\n * implementations without requiring the full ResourceManagerBuilder build mechanics.\n * @public\n */\nexport interface IResourceManager {\n /**\n * A {@link Conditions.ReadOnlyConditionCollector | ReadOnlyConditionCollector} which\n * contains the {@link Conditions.Condition | conditions} used by resource candidates.\n */\n readonly conditions: ReadOnlyConditionCollector;\n\n /**\n * A {@link Conditions.ReadOnlyConditionSetCollector | ReadOnlyConditionSetCollector} which\n * contains the {@link Conditions.ConditionSet | condition sets} used by resource candidates.\n */\n readonly conditionSets: ReadOnlyConditionSetCollector;\n\n /**\n * A {@link Decisions.ReadOnlyAbstractDecisionCollector | ReadOnlyAbstractDecisionCollector} which\n * contains the {@link Decisions.Decision | abstract decisions} used by resource candidates.\n */\n readonly decisions: ReadOnlyAbstractDecisionCollector;\n\n /**\n * Gets a built resource by ID for runtime resolution.\n * @param id - The resource identifier\n * @returns Success with the runtime resource if found, Failure otherwise\n */\n getBuiltResource(id: string): Result<IResource>;\n\n /**\n * A read-only result map of all built resources, keyed by resource ID.\n * Resources are built on-demand when accessed and returns Results for error handling.\n */\n readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId, IResource>;\n\n /**\n * The number of resources in this resource manager.\n */\n readonly numResources: number;\n\n /**\n * The number of candidates in this resource manager.\n */\n readonly numCandidates: number;\n\n /**\n * Validates a context declaration against the qualifiers managed by this resource manager.\n * @param context - The context declaration to validate\n * @returns Success with the validated context if successful, Failure otherwise\n */\n validateContext(context: IContextDecl): Result<IValidatedContextDecl>;\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './compiledResourceCollection';
|
|
2
|
+
export * from './iResourceManager';
|
|
3
|
+
export * from './context/simpleContextQualifierProvider';
|
|
4
|
+
export * from './context/validatingSimpleContextQualifierProvider';
|
|
5
|
+
export * from './resourceResolver';
|
|
6
|
+
export * from './conditionSetResolutionResult';
|
|
7
|
+
export * from './cacheListener';
|
|
8
|
+
export * from './cacheMetrics';
|
|
9
|
+
import * as Context from './context';
|
|
10
|
+
import * as ResourceTree from './resource-tree';
|
|
11
|
+
export { Context, ResourceTree };
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/runtime/index.ts"],"names":[],"mappings":"AAsBA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,0CAA0C,CAAC;AACzD,cAAc,oDAAoD,CAAC;AACnE,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}) : function(o, v) {
|
|
37
|
+
o["default"] = v;
|
|
38
|
+
});
|
|
39
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
40
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
41
|
+
};
|
|
42
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
43
|
+
var ownKeys = function(o) {
|
|
44
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
45
|
+
var ar = [];
|
|
46
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
47
|
+
return ar;
|
|
48
|
+
};
|
|
49
|
+
return ownKeys(o);
|
|
50
|
+
};
|
|
51
|
+
return function (mod) {
|
|
52
|
+
if (mod && mod.__esModule) return mod;
|
|
53
|
+
var result = {};
|
|
54
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
55
|
+
__setModuleDefault(result, mod);
|
|
56
|
+
return result;
|
|
57
|
+
};
|
|
58
|
+
})();
|
|
59
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
+
exports.ResourceTree = exports.Context = void 0;
|
|
61
|
+
__exportStar(require("./compiledResourceCollection"), exports);
|
|
62
|
+
__exportStar(require("./iResourceManager"), exports);
|
|
63
|
+
__exportStar(require("./context/simpleContextQualifierProvider"), exports);
|
|
64
|
+
__exportStar(require("./context/validatingSimpleContextQualifierProvider"), exports);
|
|
65
|
+
__exportStar(require("./resourceResolver"), exports);
|
|
66
|
+
__exportStar(require("./conditionSetResolutionResult"), exports);
|
|
67
|
+
__exportStar(require("./cacheListener"), exports);
|
|
68
|
+
__exportStar(require("./cacheMetrics"), exports);
|
|
69
|
+
const Context = __importStar(require("./context"));
|
|
70
|
+
exports.Context = Context;
|
|
71
|
+
const ResourceTree = __importStar(require("./resource-tree"));
|
|
72
|
+
exports.ResourceTree = ResourceTree;
|
|
73
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/runtime/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+DAA6C;AAC7C,qDAAmC;AACnC,2EAAyD;AACzD,qFAAmE;AACnE,qDAAmC;AACnC,iEAA+C;AAC/C,kDAAgC;AAChC,iDAA+B;AAE/B,mDAAqC;AAG5B,0BAAO;AAFhB,8DAAgD;AAE9B,oCAAY","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\nexport * from './compiledResourceCollection';\nexport * from './iResourceManager';\nexport * from './context/simpleContextQualifierProvider';\nexport * from './context/validatingSimpleContextQualifierProvider';\nexport * from './resourceResolver';\nexport * from './conditionSetResolutionResult';\nexport * from './cacheListener';\nexport * from './cacheMetrics';\n\nimport * as Context from './context';\nimport * as ResourceTree from './resource-tree';\n\nexport { Context, ResourceTree };\n"]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { IReadOnlyResultMap, Result } from '@fgv/ts-utils';
|
|
2
|
+
import { ResourceId, ResourceName } from '../../common';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for leaf nodes in a resource tree.
|
|
5
|
+
* Leaf nodes contain resource values and cannot have child nodes.
|
|
6
|
+
* In a valid resource tree, if a path has child resources (e.g., 'app.messages.welcome'),
|
|
7
|
+
* then that path cannot itself be a resource (i.e., 'app' cannot be both a resource and have children).
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export interface IReadOnlyResourceTreeLeaf<T> {
|
|
11
|
+
readonly id: ResourceId;
|
|
12
|
+
readonly name: ResourceName;
|
|
13
|
+
readonly resource: T;
|
|
14
|
+
readonly isLeaf: true;
|
|
15
|
+
readonly isBranch: false;
|
|
16
|
+
readonly isRoot: false;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Interface for branch nodes in a resource tree that contain child nodes.
|
|
20
|
+
* Branch nodes organize the tree structure and cannot have resource values.
|
|
21
|
+
* If a path has child resources, it must be a branch and cannot itself be a resource.
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export interface IReadOnlyResourceTreeBranch<T> {
|
|
25
|
+
readonly id: ResourceId;
|
|
26
|
+
readonly name: ResourceName;
|
|
27
|
+
readonly children: IReadOnlyValidatingResourceTreeChildren<T>;
|
|
28
|
+
readonly isLeaf: false;
|
|
29
|
+
readonly isBranch: true;
|
|
30
|
+
readonly isRoot: false;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Interface for the root node of a resource tree.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export interface IReadOnlyResourceTreeRoot<T> {
|
|
37
|
+
readonly children: IReadOnlyValidatingResourceTreeChildren<T>;
|
|
38
|
+
readonly isRoot: true;
|
|
39
|
+
readonly isLeaf: false;
|
|
40
|
+
readonly isBranch: false;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Union type representing any node in the resource tree, which can be a leaf or a branch.
|
|
44
|
+
* This allows for flexible handling of different node types in the tree structure.
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
export type IReadOnlyResourceTreeNode<T> = IReadOnlyResourceTreeLeaf<T> | IReadOnlyResourceTreeBranch<T>;
|
|
48
|
+
/**
|
|
49
|
+
* Interface for a read-only result-based resource tree with navigation methods.
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export interface IReadOnlyResourceTreeChildren<T, TID extends string = ResourceId, TNAME extends string = ResourceName> extends IReadOnlyResultMap<ResourceName, IReadOnlyResourceTreeNode<T>> {
|
|
53
|
+
/**
|
|
54
|
+
* Gets a tree node by its full ResourceId path.
|
|
55
|
+
* @param id - The ResourceId path to look up
|
|
56
|
+
* @returns Result containing the node if found, or failure if not found
|
|
57
|
+
*/
|
|
58
|
+
getById(id: TID): Result<IReadOnlyResourceTreeNode<T>>;
|
|
59
|
+
/**
|
|
60
|
+
* Gets a resource node by its direct name (single component).
|
|
61
|
+
* @param name - The ResourceName to look up
|
|
62
|
+
* @returns Result containing the node if it's a resource, or failure if not found or not a resource
|
|
63
|
+
*/
|
|
64
|
+
getResource(name: TNAME): Result<IReadOnlyResourceTreeNode<T>>;
|
|
65
|
+
/**
|
|
66
|
+
* Gets a branch node by its direct name (single component).
|
|
67
|
+
* @param name - The ResourceName to look up
|
|
68
|
+
* @returns Result containing the node if it's a branch, or failure if not found or not a branch
|
|
69
|
+
*/
|
|
70
|
+
getBranch(name: TNAME): Result<IReadOnlyResourceTreeNode<T>>;
|
|
71
|
+
/**
|
|
72
|
+
* Gets a resource leaf node by its full ResourceId path.
|
|
73
|
+
* @param id - The ResourceId path to look up
|
|
74
|
+
* @returns Result containing the leaf if found and is a resource, or failure otherwise
|
|
75
|
+
*/
|
|
76
|
+
getResourceById(id: TID): Result<IReadOnlyResourceTreeLeaf<T>>;
|
|
77
|
+
/**
|
|
78
|
+
* Gets a branch node by its full ResourceId path.
|
|
79
|
+
* @param id - The ResourceId path to look up
|
|
80
|
+
* @returns Result containing the branch if found and has children, or failure otherwise
|
|
81
|
+
*/
|
|
82
|
+
getBranchById(id: TID): Result<IReadOnlyResourceTreeBranch<T>>;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A read-only interface for accessing resource tree children using weakly-typed string keys.
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
export interface IReadOnlyValidatingResourceTreeChildren<T> extends IReadOnlyResourceTreeChildren<T> {
|
|
89
|
+
readonly validating: IReadOnlyResourceTreeChildren<T, string, string>;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/common.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,uCAAuC,CAAC,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,uCAAuC,CAAC,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI,yBAAyB,CAAC,CAAC,CAAC,GAAG,2BAA2B,CAAC,CAAC,CAAC,CAAC;AAEzG;;;GAGG;AACH,MAAM,WAAW,6BAA6B,CAC5C,CAAC,EACD,GAAG,SAAS,MAAM,GAAG,UAAU,EAC/B,KAAK,SAAS,MAAM,GAAG,YAAY,CACnC,SAAQ,kBAAkB,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;IACtE;;;;OAIG;IACH,OAAO,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvD;;;;OAIG;IACH,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/D;;;;OAIG;IACH,SAAS,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;IAE7D;;;;OAIG;IACH,eAAe,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/D;;;;OAIG;IACH,aAAa,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC;CAChE;AAED;;;GAGG;AACH,MAAM,WAAW,uCAAuC,CAAC,CAAC,CAAE,SAAQ,6BAA6B,CAAC,CAAC,CAAC;IAClG,QAAQ,CAAC,UAAU,EAAE,6BAA6B,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACvE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","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 { IReadOnlyResultMap, Result } from '@fgv/ts-utils';\nimport { ResourceId, ResourceName } from '../../common';\n\n/**\n * Interface for leaf nodes in a resource tree.\n * Leaf nodes contain resource values and cannot have child nodes.\n * In a valid resource tree, if a path has child resources (e.g., 'app.messages.welcome'),\n * then that path cannot itself be a resource (i.e., 'app' cannot be both a resource and have children).\n * @public\n */\nexport interface IReadOnlyResourceTreeLeaf<T> {\n readonly id: ResourceId;\n readonly name: ResourceName;\n readonly resource: T;\n readonly isLeaf: true;\n readonly isBranch: false;\n readonly isRoot: false;\n}\n\n/**\n * Interface for branch nodes in a resource tree that contain child nodes.\n * Branch nodes organize the tree structure and cannot have resource values.\n * If a path has child resources, it must be a branch and cannot itself be a resource.\n * @public\n */\nexport interface IReadOnlyResourceTreeBranch<T> {\n readonly id: ResourceId;\n readonly name: ResourceName;\n readonly children: IReadOnlyValidatingResourceTreeChildren<T>;\n readonly isLeaf: false;\n readonly isBranch: true;\n readonly isRoot: false;\n}\n\n/**\n * Interface for the root node of a resource tree.\n * @public\n */\nexport interface IReadOnlyResourceTreeRoot<T> {\n readonly children: IReadOnlyValidatingResourceTreeChildren<T>;\n readonly isRoot: true;\n readonly isLeaf: false;\n readonly isBranch: false;\n}\n\n/**\n * Union type representing any node in the resource tree, which can be a leaf or a branch.\n * This allows for flexible handling of different node types in the tree structure.\n * @public\n */\nexport type IReadOnlyResourceTreeNode<T> = IReadOnlyResourceTreeLeaf<T> | IReadOnlyResourceTreeBranch<T>;\n\n/**\n * Interface for a read-only result-based resource tree with navigation methods.\n * @public\n */\nexport interface IReadOnlyResourceTreeChildren<\n T,\n TID extends string = ResourceId,\n TNAME extends string = ResourceName\n> extends IReadOnlyResultMap<ResourceName, IReadOnlyResourceTreeNode<T>> {\n /**\n * Gets a tree node by its full ResourceId path.\n * @param id - The ResourceId path to look up\n * @returns Result containing the node if found, or failure if not found\n */\n getById(id: TID): Result<IReadOnlyResourceTreeNode<T>>;\n\n /**\n * Gets a resource node by its direct name (single component).\n * @param name - The ResourceName to look up\n * @returns Result containing the node if it's a resource, or failure if not found or not a resource\n */\n getResource(name: TNAME): Result<IReadOnlyResourceTreeNode<T>>;\n\n /**\n * Gets a branch node by its direct name (single component).\n * @param name - The ResourceName to look up\n * @returns Result containing the node if it's a branch, or failure if not found or not a branch\n */\n getBranch(name: TNAME): Result<IReadOnlyResourceTreeNode<T>>;\n\n /**\n * Gets a resource leaf node by its full ResourceId path.\n * @param id - The ResourceId path to look up\n * @returns Result containing the leaf if found and is a resource, or failure otherwise\n */\n getResourceById(id: TID): Result<IReadOnlyResourceTreeLeaf<T>>;\n\n /**\n * Gets a branch node by its full ResourceId path.\n * @param id - The ResourceId path to look up\n * @returns Result containing the branch if found and has children, or failure otherwise\n */\n getBranchById(id: TID): Result<IReadOnlyResourceTreeBranch<T>>;\n}\n\n/**\n * A read-only interface for accessing resource tree children using weakly-typed string keys.\n * @public\n */\nexport interface IReadOnlyValidatingResourceTreeChildren<T> extends IReadOnlyResourceTreeChildren<T> {\n readonly validating: IReadOnlyResourceTreeChildren<T, string, string>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/index.ts"],"names":[],"mappings":"AAsBA,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
35
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
__exportStar(require("./common"), exports);
|
|
39
|
+
__exportStar(require("./resourceTreeChildren"), exports);
|
|
40
|
+
__exportStar(require("./resourceTreeChildrenValidator"), exports);
|
|
41
|
+
__exportStar(require("./readOnlyResourceTree"), exports);
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,yDAAuC;AACvC,kEAAgD;AAChD,yDAAuC","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\nexport * from './common';\nexport * from './resourceTreeChildren';\nexport * from './resourceTreeChildrenValidator';\nexport * from './readOnlyResourceTree';\n"]}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Result } from '@fgv/ts-utils';
|
|
2
|
+
import { ResourceId, ResourceName } from '../../common';
|
|
3
|
+
import { IReadOnlyResourceTreeLeaf, IReadOnlyResourceTreeBranch, IReadOnlyResourceTreeRoot, IReadOnlyValidatingResourceTreeChildren } from './common';
|
|
4
|
+
/**
|
|
5
|
+
* Interface for initializing a resource tree root with child nodes.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface IResourceTreeRootInit<T> {
|
|
9
|
+
readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Interface for initializing a leaf node with a resource value.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export interface IResourceTreeLeafInit<T> {
|
|
16
|
+
readonly resource: T;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Interface for initializing a branch node with child nodes.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export interface IResourceTreeBranchInit<T> {
|
|
23
|
+
readonly children: Record<ResourceName, ResourceTreeNodeInit<T>>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Union type for tree node initialization data.
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export type ResourceTreeNodeInit<T> = IResourceTreeLeafInit<T> | IResourceTreeBranchInit<T>;
|
|
30
|
+
/**
|
|
31
|
+
* Type guard to determine if an init object represents a branch or root with children.
|
|
32
|
+
* @param init - The initialization object to test
|
|
33
|
+
* @returns True if the init object has children property
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export declare function isResourceTreeRootOrNodeInit<T>(init: ResourceTreeNodeInit<T> | IResourceTreeRootInit<T>): init is IResourceTreeBranchInit<T>;
|
|
37
|
+
/**
|
|
38
|
+
* Type guard to determine if an init object represents a leaf node with a resource.
|
|
39
|
+
* @param init - The initialization object to test
|
|
40
|
+
* @returns True if the init object has a resource but no children
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
export declare function isResourceTreeLeafInit<T>(init: ResourceTreeNodeInit<T>): init is IResourceTreeLeafInit<T>;
|
|
44
|
+
/**
|
|
45
|
+
* Implementation of a read-only resource tree leaf node that contains a resource value.
|
|
46
|
+
* Leaf nodes represent the actual resources in the tree and cannot have children.
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export declare class ReadOnlyResourceTreeLeaf<T> implements IReadOnlyResourceTreeLeaf<T> {
|
|
50
|
+
readonly name: ResourceName;
|
|
51
|
+
readonly id: ResourceId;
|
|
52
|
+
readonly resource: T;
|
|
53
|
+
get isRoot(): false;
|
|
54
|
+
get isBranch(): false;
|
|
55
|
+
get isLeaf(): true;
|
|
56
|
+
/**
|
|
57
|
+
* Creates a new leaf node. Use the static create method instead.
|
|
58
|
+
* @param name - The name of this node (last segment of the path)
|
|
59
|
+
* @param parentPath - The path to the parent node (undefined for root-level nodes)
|
|
60
|
+
* @param resource - The resource value stored in this leaf
|
|
61
|
+
*/
|
|
62
|
+
protected constructor(name: ResourceName, parentPath: ResourceId | undefined, resource: T);
|
|
63
|
+
/**
|
|
64
|
+
* Creates a new ReadOnlyResourceTreeLeaf instance.
|
|
65
|
+
* @param name - The name of this node (last segment of the path)
|
|
66
|
+
* @param parentPath - The path to the parent node (undefined for root-level nodes)
|
|
67
|
+
* @param resource - The resource value to store in this leaf
|
|
68
|
+
* @returns Result containing the new leaf node or failure if construction fails
|
|
69
|
+
*/
|
|
70
|
+
static create<T>(name: ResourceName, parentPath: ResourceId | undefined, resource: T): Result<ReadOnlyResourceTreeLeaf<T>>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Implementation of a read-only resource tree branch node that contains child nodes.
|
|
74
|
+
* Branch nodes organize other nodes in a hierarchical structure and may optionally contain a resource value.
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
export declare class ReadOnlyResourceTreeBranch<T> implements IReadOnlyResourceTreeBranch<T> {
|
|
78
|
+
readonly children: IReadOnlyValidatingResourceTreeChildren<T>;
|
|
79
|
+
readonly name: ResourceName;
|
|
80
|
+
readonly id: ResourceId;
|
|
81
|
+
get isRoot(): false;
|
|
82
|
+
get isBranch(): true;
|
|
83
|
+
get isLeaf(): false;
|
|
84
|
+
/**
|
|
85
|
+
* Creates a new branch node. Use the static create method instead.
|
|
86
|
+
* @param name - The name of this node (last segment of the path)
|
|
87
|
+
* @param parentPath - The path to the parent node (undefined for root-level nodes)
|
|
88
|
+
* @param init - Initialization data containing child nodes
|
|
89
|
+
*/
|
|
90
|
+
private constructor();
|
|
91
|
+
/**
|
|
92
|
+
* Creates a new ReadOnlyResourceTreeBranch instance.
|
|
93
|
+
* @param childName - The name of this node (last segment of the path)
|
|
94
|
+
* @param path - The path to the parent node (undefined for root-level nodes)
|
|
95
|
+
* @param childInit - Initialization data containing child nodes
|
|
96
|
+
* @returns Result containing the new branch node or failure if construction fails
|
|
97
|
+
*/
|
|
98
|
+
static create<T>(childName: ResourceName, path: ResourceId | undefined, childInit: IResourceTreeBranchInit<T>): Result<ReadOnlyResourceTreeBranch<T>>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Union type representing any node in a read-only resource tree.
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
export type ReadOnlyResourceTreeNode<T> = ReadOnlyResourceTreeBranch<T> | ReadOnlyResourceTreeLeaf<T>;
|
|
105
|
+
/**
|
|
106
|
+
* Implementation of a read-only resource tree root that organizes resources hierarchically.
|
|
107
|
+
* The root provides the entry point for tree navigation and resource access by ResourceId paths.
|
|
108
|
+
* @public
|
|
109
|
+
*/
|
|
110
|
+
export declare class ReadOnlyResourceTreeRoot<T> implements IReadOnlyResourceTreeRoot<T> {
|
|
111
|
+
readonly children: IReadOnlyValidatingResourceTreeChildren<T>;
|
|
112
|
+
get isRoot(): true;
|
|
113
|
+
get isBranch(): false;
|
|
114
|
+
get isLeaf(): false;
|
|
115
|
+
/**
|
|
116
|
+
* Creates a new root node. Use the static create method instead.
|
|
117
|
+
* @param init - Initialization data containing child nodes
|
|
118
|
+
*/
|
|
119
|
+
protected constructor(init: IResourceTreeRootInit<T>);
|
|
120
|
+
/**
|
|
121
|
+
* Creates a new ReadOnlyResourceTreeRoot from an array of resources.
|
|
122
|
+
* @param resources - Array of [ResourceId, resource] pairs to build the tree from
|
|
123
|
+
* @returns Result containing the new root or failure if construction fails
|
|
124
|
+
*/
|
|
125
|
+
static create<T>(resources: [ResourceId, T][]): Result<ReadOnlyResourceTreeRoot<T>>;
|
|
126
|
+
/**
|
|
127
|
+
* Creates a new ReadOnlyResourceTreeRoot from initialization data.
|
|
128
|
+
* @param init - Tree initialization structure
|
|
129
|
+
* @returns Result containing the new root or failure if construction fails
|
|
130
|
+
*/
|
|
131
|
+
static create<T>(init: IResourceTreeRootInit<T>): Result<ReadOnlyResourceTreeRoot<T>>;
|
|
132
|
+
/**
|
|
133
|
+
* Converts an array of resources into tree initialization data.
|
|
134
|
+
* Validates that resource paths do not conflict - if a path has child resources,
|
|
135
|
+
* it cannot itself be a resource (e.g., if 'app.messages.welcome' exists, then 'app' cannot be a resource).
|
|
136
|
+
* @param resources - Array of [ResourceId, resource] pairs to convert
|
|
137
|
+
* @returns Result containing the initialization structure or failure if validation fails
|
|
138
|
+
*/
|
|
139
|
+
static createResourceTreeInit<T>(resources: [ResourceId, T][]): Result<IResourceTreeRootInit<T>>;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=readOnlyResourceTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readOnlyResourceTree.d.ts","sourceRoot":"","sources":["../../../../src/packlets/runtime/resource-tree/readOnlyResourceTree.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAqB,MAAM,EAAsC,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAE,YAAY,EAAW,MAAM,cAAc,CAAC;AACjE,OAAO,EAEL,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,EACzB,uCAAuC,EACxC,MAAM,UAAU,CAAC;AAGlB;;;GAGG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;CAClE;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;CAClE;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC;AAG5F;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAC5C,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,GACvD,IAAI,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAEpC;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAEzG;AAED;;;;GAIG;AACH,qBAAa,wBAAwB,CAAC,CAAC,CAAE,YAAW,yBAAyB,CAAC,CAAC,CAAC;IAC9E,SAAgB,IAAI,EAAE,YAAY,CAAC;IACnC,SAAgB,EAAE,EAAE,UAAU,CAAC;IAC/B,SAAgB,QAAQ,EAAE,CAAC,CAAC;IAE5B,IAAW,MAAM,IAAI,KAAK,CAEzB;IAED,IAAW,QAAQ,IAAI,KAAK,CAE3B;IAED,IAAW,MAAM,IAAI,IAAI,CAExB;IAED;;;;;OAKG;IACH,SAAS,aAAa,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,GAAG,SAAS,EAAE,QAAQ,EAAE,CAAC;IAMzF;;;;;;OAMG;WACW,MAAM,CAAC,CAAC,EACpB,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,UAAU,GAAG,SAAS,EAClC,QAAQ,EAAE,CAAC,GACV,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;CAGvC;AAED;;;;GAIG;AACH,qBAAa,0BAA0B,CAAC,CAAC,CAAE,YAAW,2BAA2B,CAAC,CAAC,CAAC;IAClF,SAAgB,QAAQ,EAAE,uCAAuC,CAAC,CAAC,CAAC,CAAC;IACrE,SAAgB,IAAI,EAAE,YAAY,CAAC;IACnC,SAAgB,EAAE,EAAE,UAAU,CAAC;IAE/B,IAAW,MAAM,IAAI,KAAK,CAEzB;IAED,IAAW,QAAQ,IAAI,IAAI,CAE1B;IAED,IAAW,MAAM,IAAI,KAAK,CAEzB;IAED;;;;;OAKG;IACH,OAAO;IA4BP;;;;;;OAMG;WACW,MAAM,CAAC,CAAC,EACpB,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,UAAU,GAAG,SAAS,EAC5B,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GACpC,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;CAGzC;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI,0BAA0B,CAAC,CAAC,CAAC,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAC;AAEtG;;;;GAIG;AACH,qBAAa,wBAAwB,CAAC,CAAC,CAAE,YAAW,yBAAyB,CAAC,CAAC,CAAC;IAC9E,SAAgB,QAAQ,EAAE,uCAAuC,CAAC,CAAC,CAAC,CAAC;IAErE,IAAW,MAAM,IAAI,IAAI,CAExB;IAED,IAAW,QAAQ,IAAI,KAAK,CAE3B;IAED,IAAW,MAAM,IAAI,KAAK,CAEzB;IAED;;;OAGG;IACH,SAAS,aAAa,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAqBpD;;;;OAIG;WACW,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;IAE1F;;;;OAIG;WACW,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;IAkB5F;;;;;;OAMG;WACW,sBAAsB,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;CA6CxG"}
|