@fgv/ts-res 5.0.1-0 → 5.0.1-10

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.
Files changed (204) hide show
  1. package/dist/index.browser.js +53 -0
  2. package/dist/index.js +45 -0
  3. package/dist/packlets/bundle/bundleBuilder.js +130 -0
  4. package/dist/packlets/bundle/bundleLoader.js +101 -0
  5. package/dist/packlets/bundle/bundleNormalizer.js +138 -0
  6. package/dist/packlets/bundle/bundleUtils.js +113 -0
  7. package/dist/packlets/bundle/convert.js +75 -0
  8. package/dist/packlets/bundle/index.js +42 -0
  9. package/dist/packlets/bundle/model.js +23 -0
  10. package/dist/packlets/common/conditions.js +47 -0
  11. package/dist/packlets/common/convert.js +172 -0
  12. package/dist/packlets/common/helpers/conditions.js +66 -0
  13. package/dist/packlets/common/helpers/context.js +70 -0
  14. package/dist/packlets/common/helpers/index.js +26 -0
  15. package/dist/packlets/common/helpers/qualifierDefaultValues.js +66 -0
  16. package/dist/packlets/common/helpers/resources.js +93 -0
  17. package/dist/packlets/common/index.js +28 -0
  18. package/dist/packlets/common/resources.js +27 -0
  19. package/dist/packlets/common/validate/conditions.js +544 -0
  20. package/dist/packlets/common/validate/index.js +26 -0
  21. package/dist/packlets/common/validate/regularExpressions.js +84 -0
  22. package/dist/packlets/common/validate/resources.js +209 -0
  23. package/dist/packlets/conditions/condition.js +252 -0
  24. package/dist/packlets/conditions/conditionCollector.js +69 -0
  25. package/dist/packlets/conditions/conditionDecls.js +23 -0
  26. package/dist/packlets/conditions/conditionSet.js +247 -0
  27. package/dist/packlets/conditions/conditionSetCollector.js +89 -0
  28. package/dist/packlets/conditions/conditionSetDecls.js +23 -0
  29. package/dist/packlets/conditions/conditionToken.js +147 -0
  30. package/dist/packlets/conditions/convert/conditionSetDecls.js +51 -0
  31. package/dist/packlets/conditions/convert/decls.js +75 -0
  32. package/dist/packlets/conditions/convert/index.js +24 -0
  33. package/dist/packlets/conditions/index.js +31 -0
  34. package/dist/packlets/config/common.js +78 -0
  35. package/dist/packlets/config/configInitFactory.js +258 -0
  36. package/dist/packlets/config/convert.js +56 -0
  37. package/dist/packlets/config/index.browser.js +34 -0
  38. package/dist/packlets/config/index.js +28 -0
  39. package/dist/packlets/config/json.js +23 -0
  40. package/dist/packlets/config/predefined/default.js +138 -0
  41. package/dist/packlets/config/predefined/extended.js +190 -0
  42. package/dist/packlets/config/predefined/index.js +25 -0
  43. package/dist/packlets/config/systemConfiguration.js +147 -0
  44. package/dist/packlets/context/contextDecls.js +23 -0
  45. package/dist/packlets/context/contextToken.js +202 -0
  46. package/dist/packlets/context/convert/decls.js +91 -0
  47. package/dist/packlets/context/convert/index.js +23 -0
  48. package/dist/packlets/context/index.js +26 -0
  49. package/dist/packlets/decisions/abstractDecision.js +68 -0
  50. package/dist/packlets/decisions/abstractDecisionCollector.js +90 -0
  51. package/dist/packlets/decisions/candidate.js +76 -0
  52. package/dist/packlets/decisions/common.js +23 -0
  53. package/dist/packlets/decisions/concreteDecision.js +111 -0
  54. package/dist/packlets/decisions/decision.js +126 -0
  55. package/dist/packlets/decisions/index.js +28 -0
  56. package/dist/packlets/import/fsItem.js +134 -0
  57. package/dist/packlets/import/importContext.js +129 -0
  58. package/dist/packlets/import/importManager.js +129 -0
  59. package/dist/packlets/import/importable.js +32 -0
  60. package/dist/packlets/import/importers/collectionImporter.js +118 -0
  61. package/dist/packlets/import/importers/fsItemImporter.js +116 -0
  62. package/dist/packlets/import/importers/importer.js +23 -0
  63. package/dist/packlets/import/importers/index.browser.js +29 -0
  64. package/dist/packlets/import/importers/index.js +27 -0
  65. package/dist/packlets/import/importers/jsonImporter.js +94 -0
  66. package/dist/packlets/import/importers/pathImporter.js +84 -0
  67. package/dist/packlets/import/index.browser.js +34 -0
  68. package/dist/packlets/import/index.js +28 -0
  69. package/dist/packlets/qualifier-types/config/convert.js +124 -0
  70. package/dist/packlets/qualifier-types/config/index.js +25 -0
  71. package/dist/packlets/qualifier-types/config/json.js +32 -0
  72. package/dist/packlets/qualifier-types/convert.js +56 -0
  73. package/dist/packlets/qualifier-types/helpers.js +82 -0
  74. package/dist/packlets/qualifier-types/index.js +32 -0
  75. package/dist/packlets/qualifier-types/languageQualifierType.js +142 -0
  76. package/dist/packlets/qualifier-types/literalQualifierType.js +200 -0
  77. package/dist/packlets/qualifier-types/literalValueHierarchy.js +236 -0
  78. package/dist/packlets/qualifier-types/qualifierType.js +184 -0
  79. package/dist/packlets/qualifier-types/qualifierTypeCollector.js +66 -0
  80. package/dist/packlets/qualifier-types/territoryQualifierType.js +200 -0
  81. package/dist/packlets/qualifiers/convert/decls.js +70 -0
  82. package/dist/packlets/qualifiers/convert/index.js +24 -0
  83. package/dist/packlets/qualifiers/convert/qualifier.js +40 -0
  84. package/dist/packlets/qualifiers/index.js +29 -0
  85. package/dist/packlets/qualifiers/qualifier.js +108 -0
  86. package/dist/packlets/qualifiers/qualifierCollector.js +123 -0
  87. package/dist/packlets/qualifiers/qualifierDecl.js +23 -0
  88. package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js +23 -0
  89. package/dist/packlets/qualifiers/qualifierDefaultValueToken.js +175 -0
  90. package/dist/packlets/resource-json/compiled/common.js +23 -0
  91. package/dist/packlets/resource-json/compiled/convert.js +132 -0
  92. package/dist/packlets/resource-json/compiled/index.js +26 -0
  93. package/dist/packlets/resource-json/compiled/json.js +2 -0
  94. package/dist/packlets/resource-json/convert.js +171 -0
  95. package/dist/packlets/resource-json/helpers.js +241 -0
  96. package/dist/packlets/resource-json/index.js +31 -0
  97. package/dist/packlets/resource-json/json.js +36 -0
  98. package/dist/packlets/resource-json/normalized.js +23 -0
  99. package/dist/packlets/resource-json/resourceDeclCollection.js +88 -0
  100. package/dist/packlets/resource-json/resourceDeclContainer.js +23 -0
  101. package/dist/packlets/resource-json/resourceDeclTree.js +94 -0
  102. package/dist/packlets/resource-types/config/convert.js +35 -0
  103. package/dist/packlets/resource-types/config/index.js +25 -0
  104. package/dist/packlets/resource-types/config/json.js +23 -0
  105. package/dist/packlets/resource-types/helpers.js +42 -0
  106. package/dist/packlets/resource-types/index.js +28 -0
  107. package/dist/packlets/resource-types/jsonResourceType.js +66 -0
  108. package/dist/packlets/resource-types/resourceType.js +95 -0
  109. package/dist/packlets/resource-types/resourceTypeCollector.js +61 -0
  110. package/dist/packlets/resources/candidateReducer.js +246 -0
  111. package/dist/packlets/resources/candidateValue.js +92 -0
  112. package/dist/packlets/resources/candidateValueCollector.js +94 -0
  113. package/dist/packlets/resources/common.js +23 -0
  114. package/dist/packlets/resources/deltaGenerator.js +338 -0
  115. package/dist/packlets/resources/index.js +31 -0
  116. package/dist/packlets/resources/resource.js +207 -0
  117. package/dist/packlets/resources/resourceBuilder.js +183 -0
  118. package/dist/packlets/resources/resourceCandidate.js +216 -0
  119. package/dist/packlets/resources/resourceManagerBuilder.js +890 -0
  120. package/dist/packlets/runtime/cacheListener.js +58 -0
  121. package/dist/packlets/runtime/cacheMetrics.js +149 -0
  122. package/dist/packlets/runtime/compiledResourceCollection.js +473 -0
  123. package/dist/packlets/runtime/conditionSetResolutionResult.js +134 -0
  124. package/dist/packlets/runtime/context/contextQualifierProvider.js +29 -0
  125. package/dist/packlets/runtime/context/contextQualifierProviderValidator.js +146 -0
  126. package/dist/packlets/runtime/context/index.js +26 -0
  127. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js +196 -0
  128. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +60 -0
  129. package/dist/packlets/runtime/iResourceManager.js +23 -0
  130. package/dist/packlets/runtime/index.js +34 -0
  131. package/dist/packlets/runtime/resource-tree/common.js +23 -0
  132. package/dist/packlets/runtime/resource-tree/index.js +26 -0
  133. package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js +216 -0
  134. package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js +97 -0
  135. package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +161 -0
  136. package/dist/packlets/runtime/resourceResolver.js +481 -0
  137. package/dist/packlets/runtime/resourceTreeResolver.js +220 -0
  138. package/dist/packlets/runtime/validate.js +47 -0
  139. package/dist/packlets/zip-archive/convert.js +100 -0
  140. package/dist/packlets/zip-archive/index.browser.js +54 -0
  141. package/dist/packlets/zip-archive/index.js +47 -0
  142. package/dist/packlets/zip-archive/json.js +23 -0
  143. package/dist/packlets/zip-archive/types.js +36 -0
  144. package/dist/packlets/zip-archive/zipArchiveCreator.js +191 -0
  145. package/dist/packlets/zip-archive/zipArchiveFormat.js +140 -0
  146. package/dist/packlets/zip-archive/zipArchiveLoader.js +282 -0
  147. package/dist/test/data/sample.json +32 -0
  148. package/dist/test/unit/qualifier-types/testQualifierType.js +76 -0
  149. package/dist/test/unit/resource-types/testDerivedResourceType.js +109 -0
  150. package/dist/test/unit/resources/deltaGenerator.helpers.js +282 -0
  151. package/dist/ts-res.d.ts +226 -15
  152. package/dist/tsdoc-metadata.json +1 -1
  153. package/lib/index.browser.d.ts +24 -0
  154. package/lib/index.browser.js +116 -0
  155. package/lib/packlets/common/helpers/resources.d.ts +1 -1
  156. package/lib/packlets/common/helpers/resources.js +3 -2
  157. package/lib/packlets/common/resources.d.ts +4 -0
  158. package/lib/packlets/common/validate/conditions.js +14 -14
  159. package/lib/packlets/common/validate/resources.js +7 -7
  160. package/lib/packlets/conditions/conditionSet.js +1 -1
  161. package/lib/packlets/config/common.js +1 -0
  162. package/lib/packlets/config/configInitFactory.js +1 -0
  163. package/lib/packlets/config/index.browser.d.ts +7 -0
  164. package/lib/packlets/config/index.browser.js +74 -0
  165. package/lib/packlets/config/systemConfiguration.js +1 -0
  166. package/lib/packlets/context/convert/decls.js +1 -1
  167. package/lib/packlets/import/importers/collectionImporter.js +1 -1
  168. package/lib/packlets/import/importers/index.browser.d.ts +4 -0
  169. package/lib/packlets/import/importers/index.browser.js +45 -0
  170. package/lib/packlets/import/importers/jsonImporter.js +1 -1
  171. package/lib/packlets/import/index.browser.d.ts +7 -0
  172. package/lib/packlets/import/index.browser.js +74 -0
  173. package/lib/packlets/qualifier-types/helpers.js +5 -4
  174. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +4 -4
  175. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +4 -4
  176. package/lib/packlets/qualifier-types/literalQualifierType.js +1 -1
  177. package/lib/packlets/qualifier-types/literalValueHierarchy.js +7 -6
  178. package/lib/packlets/qualifier-types/qualifierType.d.ts +5 -5
  179. package/lib/packlets/qualifier-types/qualifierType.js +1 -0
  180. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +4 -4
  181. package/lib/packlets/qualifier-types/territoryQualifierType.js +1 -1
  182. package/lib/packlets/resource-json/helpers.js +4 -0
  183. package/lib/packlets/resource-types/helpers.js +1 -0
  184. package/lib/packlets/resource-types/resourceType.js +1 -0
  185. package/lib/packlets/resources/candidateValue.js +1 -0
  186. package/lib/packlets/resources/candidateValueCollector.js +4 -2
  187. package/lib/packlets/resources/deltaGenerator.d.ts +189 -0
  188. package/lib/packlets/resources/deltaGenerator.js +342 -0
  189. package/lib/packlets/resources/index.d.ts +1 -0
  190. package/lib/packlets/resources/index.js +1 -0
  191. package/lib/packlets/resources/resourceBuilder.js +4 -0
  192. package/lib/packlets/resources/resourceManagerBuilder.d.ts +4 -0
  193. package/lib/packlets/resources/resourceManagerBuilder.js +12 -0
  194. package/lib/packlets/runtime/compiledResourceCollection.d.ts +4 -0
  195. package/lib/packlets/runtime/compiledResourceCollection.js +7 -0
  196. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +4 -3
  197. package/lib/packlets/runtime/iResourceManager.d.ts +4 -0
  198. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js +3 -0
  199. package/lib/packlets/runtime/resourceResolver.d.ts +5 -1
  200. package/lib/packlets/runtime/resourceResolver.js +8 -4
  201. package/lib/packlets/runtime/resourceTreeResolver.js +2 -0
  202. package/lib/packlets/zip-archive/index.browser.d.ts +27 -0
  203. package/lib/packlets/zip-archive/index.browser.js +102 -0
  204. package/package.json +34 -20
package/dist/ts-res.d.ts CHANGED
@@ -7,9 +7,10 @@ import { FileTree } from '@fgv/ts-json-base';
7
7
  import { Hash } from '@fgv/ts-utils';
8
8
  import { ICollectible } from '@fgv/ts-utils';
9
9
  import { IReadOnlyResultMap } from '@fgv/ts-utils';
10
- import { JsonCompatible } from '@fgv/ts-json-base';
10
+ import { JsonCompatibleType } from '@fgv/ts-json-base';
11
11
  import { JsonObject } from '@fgv/ts-json-base';
12
12
  import { JsonValue } from '@fgv/ts-json-base';
13
+ import { Logging } from '@fgv/ts-utils';
13
14
  import { ObjectConverter } from '@fgv/ts-utils';
14
15
  import { Result } from '@fgv/ts-utils';
15
16
  import { ResultMap } from '@fgv/ts-utils';
@@ -995,6 +996,10 @@ declare class CompiledResourceCollection implements IResourceManager<IResource>
995
996
  * contains the {@link Qualifiers.Qualifier | qualifiers} used in this collection.
996
997
  */
997
998
  get qualifiers(): IReadOnlyQualifierCollector;
999
+ /**
1000
+ * The resource IDs contained in this compiled resource collection.
1001
+ */
1002
+ get resourceIds(): ReadonlyArray<ResourceId>;
998
1003
  /**
999
1004
  * A {@link ResourceTypes.ResourceTypeCollector | ResourceTypeCollector} which
1000
1005
  * contains the {@link ResourceTypes.ResourceType | resource types} used in this collection.
@@ -2552,6 +2557,150 @@ declare const DefaultResourceTypes: ReadonlyArray<ResourceTypes.Config.IResource
2552
2557
  */
2553
2558
  declare const DefaultSystemConfiguration: ISystemConfiguration;
2554
2559
 
2560
+ /**
2561
+ * Class for generating resource deltas between baseline and delta resolvers.
2562
+ * Creates partial/augment candidates for updated resources and full/replace candidates for new resources.
2563
+ * Uses Diff.jsonThreeWayDiff for efficient delta computation.
2564
+ * @public
2565
+ */
2566
+ declare class DeltaGenerator {
2567
+ /**
2568
+ * The baseline resource resolver to compare against.
2569
+ * @internal
2570
+ */
2571
+ private readonly _baselineResolver;
2572
+ /**
2573
+ * The delta resource resolver containing changes.
2574
+ * @internal
2575
+ */
2576
+ private readonly _deltaResolver;
2577
+ /**
2578
+ * The resource manager to clone and update.
2579
+ * @internal
2580
+ */
2581
+ private readonly _resourceManager;
2582
+ /**
2583
+ * Logger for status and error reporting.
2584
+ * @internal
2585
+ */
2586
+ private readonly _logger;
2587
+ /**
2588
+ * Constructor for a {@link Resources.DeltaGenerator | DeltaGenerator} object.
2589
+ * @param params - Parameters to create a new {@link Resources.DeltaGenerator | DeltaGenerator}.
2590
+ * @internal
2591
+ */
2592
+ protected constructor(params: IDeltaGeneratorParams);
2593
+ /**
2594
+ * Creates a new {@link Resources.DeltaGenerator | DeltaGenerator} object.
2595
+ * @param params - Parameters to create a new {@link Resources.DeltaGenerator | DeltaGenerator}.
2596
+ * @returns `Success` with the new {@link Resources.DeltaGenerator | DeltaGenerator} object if successful,
2597
+ * or `Failure` with an error message if not.
2598
+ * @public
2599
+ */
2600
+ static create(params: IDeltaGeneratorParams): Result<DeltaGenerator>;
2601
+ /**
2602
+ * Generates deltas between baseline and delta resolvers.
2603
+ * Creates a cloned resource manager with partial/augment candidates for updates
2604
+ * and full/replace candidates for new resources.
2605
+ *
2606
+ * @param options - Options controlling delta generation behavior.
2607
+ * @returns `Success` with the updated resource manager if successful,
2608
+ * or `Failure` with an error message if not.
2609
+ * @public
2610
+ */
2611
+ generate(options?: IDeltaGeneratorOptions): Result<ResourceManagerBuilder>;
2612
+ /**
2613
+ * Validates the provided context declaration.
2614
+ * @param context - The context declaration to validate.
2615
+ * @returns `Success` with the validated context if successful, `Failure` otherwise.
2616
+ * @internal
2617
+ */
2618
+ private _validateContext;
2619
+ /**
2620
+ * Enumerates target resource IDs for delta generation.
2621
+ * If specific resource IDs are provided, uses those. Otherwise, discovers all resources
2622
+ * from both the baseline resource manager and the delta resolver to ensure comprehensive
2623
+ * coverage of all potential resources.
2624
+ *
2625
+ * @param requestedIds - Optional array of specific resource IDs to target.
2626
+ * @param context - The validated context to use for resource discovery.
2627
+ * @returns `Success` with array of resource IDs if successful, `Failure` otherwise.
2628
+ * @internal
2629
+ */
2630
+ private _enumerateTargetResources;
2631
+ /**
2632
+ * Discovers all unique resource IDs from both baseline and delta resolvers.
2633
+ * Creates a union of resource IDs from the baseline resource manager and delta resolver
2634
+ * to ensure comprehensive coverage of all resources.
2635
+ *
2636
+ * @returns `Success` with array of unique resource IDs if successful, `Failure` otherwise.
2637
+ * @internal
2638
+ */
2639
+ private _discoverAllResourceIds;
2640
+ /**
2641
+ * Creates a clone of the resource manager for delta operations.
2642
+ * @returns `Success` with the cloned resource manager if successful, `Failure` otherwise.
2643
+ * @internal
2644
+ */
2645
+ private _cloneResourceManager;
2646
+ /**
2647
+ * Generates deltas for the specified resources and adds them to the cloned manager.
2648
+ *
2649
+ * @param clonedManager - The cloned resource manager to update.
2650
+ * @param resourceIds - Array of resource IDs to process.
2651
+ * @param context - The context to use for resource resolution.
2652
+ * @param skipUnchanged - Whether to skip resources that haven't changed.
2653
+ * @returns `Success` with the updated manager if successful, `Failure` otherwise.
2654
+ * @internal
2655
+ */
2656
+ private _generateDeltas;
2657
+ /**
2658
+ * Generates a delta for a single resource and adds appropriate candidates to the manager.
2659
+ *
2660
+ * @param manager - The resource manager to update.
2661
+ * @param resourceId - The resource ID to process.
2662
+ * @param context - The context to use for resource resolution.
2663
+ * @param skipUnchanged - Whether to skip resources that haven't changed.
2664
+ * @returns `Success` with the resource delta result if successful, `Failure` otherwise.
2665
+ * @internal
2666
+ */
2667
+ private _generateResourceDelta;
2668
+ /**
2669
+ * Checks if two JSON values are identical.
2670
+ * @param value1 - First value to compare.
2671
+ * @param value2 - Second value to compare.
2672
+ * @returns True if values are identical, false otherwise.
2673
+ * @internal
2674
+ */
2675
+ private _areValuesIdentical;
2676
+ /**
2677
+ * Creates a new resource candidate for a newly discovered resource.
2678
+ * Uses full/replace merge method since this is a completely new resource.
2679
+ *
2680
+ * @param manager - The resource manager to update.
2681
+ * @param resourceId - The resource ID for the new resource.
2682
+ * @param value - The resolved value for the new resource.
2683
+ * @param context - The context used for resolution.
2684
+ * @returns `Success` if the candidate was added successfully, `Failure` otherwise.
2685
+ * @internal
2686
+ */
2687
+ private _createNewResourceCandidate;
2688
+ /**
2689
+ * Creates a delta candidate for an updated resource.
2690
+ * Computes the difference between baseline and delta values and creates
2691
+ * a partial/augment candidate with only the changed properties.
2692
+ *
2693
+ * @param manager - The resource manager to update.
2694
+ * @param resourceId - The resource ID for the updated resource.
2695
+ * @param baselineValue - The baseline resolved value.
2696
+ * @param deltaValue - The delta resolved value.
2697
+ * @param context - The context used for resolution.
2698
+ * @returns `Success` if the candidate was added successfully, `Failure` otherwise.
2699
+ * @internal
2700
+ */
2701
+ private _createDeltaCandidate;
2702
+ }
2703
+
2555
2704
  /**
2556
2705
  * Type for handling empty branch nodes during tree composition.
2557
2706
  * The handler receives the branch node, names of failed children, and the resolver for recovery attempts.
@@ -2727,7 +2876,7 @@ declare function getDirectoryName(path: string): string;
2727
2876
  /**
2728
2877
  * Gets the name for a resource ID.
2729
2878
  * @param id - The resource ID to get the name for.
2730
- * @returns The resource name if found, or undefined if not.
2879
+ * @returns `Success` with the resource name if found, or `Failure` with an error message if not.
2731
2880
  * @public
2732
2881
  */
2733
2882
  declare function getNameForResourceId(id: string | undefined): Result<ResourceName>;
@@ -3813,6 +3962,49 @@ declare interface IDeclarationOptions {
3813
3962
  normalized?: boolean;
3814
3963
  }
3815
3964
 
3965
+ /**
3966
+ * Interface for options controlling delta generation behavior.
3967
+ * @public
3968
+ */
3969
+ declare interface IDeltaGeneratorOptions {
3970
+ /**
3971
+ * Context to use when resolving resources. If not provided, uses empty context.
3972
+ */
3973
+ context?: Context.IContextDecl;
3974
+ /**
3975
+ * Array of specific resource IDs to include in delta generation.
3976
+ * If not provided, generates deltas for all resources in the delta resolver.
3977
+ */
3978
+ resourceIds?: ReadonlyArray<string>;
3979
+ /**
3980
+ * Whether to skip resources that haven't changed. Default: true.
3981
+ */
3982
+ skipUnchanged?: boolean;
3983
+ }
3984
+
3985
+ /**
3986
+ * Interface for parameters to create a {@link Resources.DeltaGenerator | DeltaGenerator}.
3987
+ * @public
3988
+ */
3989
+ declare interface IDeltaGeneratorParams {
3990
+ /**
3991
+ * The baseline resource resolver to compare against.
3992
+ */
3993
+ baselineResolver: IResourceResolver;
3994
+ /**
3995
+ * The delta resource resolver containing changes.
3996
+ */
3997
+ deltaResolver: IResourceResolver;
3998
+ /**
3999
+ * The resource manager to clone and update.
4000
+ */
4001
+ resourceManager: ResourceManagerBuilder;
4002
+ /**
4003
+ * Optional logger for status and error reporting.
4004
+ */
4005
+ logger?: Logging.ILogger;
4006
+ }
4007
+
3816
4008
  /**
3817
4009
  * @internal
3818
4010
  */
@@ -4768,13 +4960,13 @@ declare interface IQualifierType<TCFGJSON extends JsonObject = JsonObject> exten
4768
4960
  * Gets the configuration for this qualifier type.
4769
4961
  * @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.
4770
4962
  */
4771
- getConfigurationJson(): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
4963
+ getConfigurationJson(): Result<JsonCompatibleType<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
4772
4964
  /**
4773
4965
  * Validates configuration JSON data for this qualifier type.
4774
4966
  * @param from - The unknown data to validate as configuration JSON.
4775
4967
  * @returns `Success` with validated JSON configuration if valid, `Failure` with an error message otherwise.
4776
4968
  */
4777
- validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
4969
+ validateConfigurationJson(from: unknown): Result<JsonCompatibleType<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
4778
4970
  }
4779
4971
 
4780
4972
  /**
@@ -5266,6 +5458,10 @@ export declare interface IResourceManager<TR extends IResource = IResource> {
5266
5458
  * The number of resources in this resource manager.
5267
5459
  */
5268
5460
  readonly numResources: number;
5461
+ /**
5462
+ * The resource IDs that this resource manager can resolve.
5463
+ */
5464
+ readonly resourceIds: ReadonlyArray<ResourceId>;
5269
5465
  /**
5270
5466
  * The number of candidates in this resource manager.
5271
5467
  */
@@ -5317,6 +5513,10 @@ declare interface IResourceManagerCloneOptions extends IResourceDeclarationOptio
5317
5513
  * @public
5318
5514
  */
5319
5515
  export declare interface IResourceResolver {
5516
+ /**
5517
+ * The resource IDs that this resolver can resolve.
5518
+ */
5519
+ readonly resourceIds: ReadonlyArray<ResourceId>;
5320
5520
  /**
5321
5521
  * Resolves a resource to a composed value by merging matching candidates according to their merge methods.
5322
5522
  * Starting from the highest priority candidates, finds the first "full" candidate and merges all higher
@@ -6368,7 +6568,7 @@ declare const LanguagePrioritySystemConfiguration: ISystemConfiguration;
6368
6568
  * Accepts a list of language tags in the context by default.
6369
6569
  * @public
6370
6570
  */
6371
- declare class LanguageQualifierType extends QualifierType<JsonCompatible<Config_2.ILanguageQualifierTypeConfig>> {
6571
+ declare class LanguageQualifierType extends QualifierType<JsonCompatibleType<Config_2.ILanguageQualifierTypeConfig>> {
6372
6572
  /**
6373
6573
  * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
6374
6574
  */
@@ -6411,11 +6611,11 @@ declare class LanguageQualifierType extends QualifierType<JsonCompatible<Config_
6411
6611
  /**
6412
6612
  * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
6413
6613
  */
6414
- getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemLanguageQualifierTypeConfig>>;
6614
+ getConfigurationJson(): Result<JsonCompatibleType<Config_2.ISystemLanguageQualifierTypeConfig>>;
6415
6615
  /**
6416
6616
  * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
6417
6617
  */
6418
- validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemLanguageQualifierTypeConfig>>;
6618
+ validateConfigurationJson(from: unknown): Result<JsonCompatibleType<Config_2.ISystemLanguageQualifierTypeConfig>>;
6419
6619
  /**
6420
6620
  * Validates a {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | strongly typed configuration object}
6421
6621
  * for this qualifier type.
@@ -6446,7 +6646,7 @@ declare const languageQualifierTypeConfig: ObjectConverter<Model_2.ILanguageQual
6446
6646
  * optionally case-sensitive or matching against an ordered list of values at runtime.
6447
6647
  * @public
6448
6648
  */
6449
- declare class LiteralQualifierType extends QualifierType<JsonCompatible<Config_2.ILiteralQualifierTypeConfig>> {
6649
+ declare class LiteralQualifierType extends QualifierType<JsonCompatibleType<Config_2.ILiteralQualifierTypeConfig>> {
6450
6650
  /**
6451
6651
  * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
6452
6652
  */
@@ -6495,11 +6695,11 @@ declare class LiteralQualifierType extends QualifierType<JsonCompatible<Config_2
6495
6695
  /**
6496
6696
  * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
6497
6697
  */
6498
- getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemLiteralQualifierTypeConfig>>;
6698
+ getConfigurationJson(): Result<JsonCompatibleType<Config_2.ISystemLiteralQualifierTypeConfig>>;
6499
6699
  /**
6500
6700
  * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
6501
6701
  */
6502
- validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemLiteralQualifierTypeConfig>>;
6702
+ validateConfigurationJson(from: unknown): Result<JsonCompatibleType<Config_2.ISystemLiteralQualifierTypeConfig>>;
6503
6703
  /**
6504
6704
  * Validates a {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | strongly typed configuration object}
6505
6705
  * for this qualifier type.
@@ -7517,11 +7717,11 @@ export declare abstract class QualifierType<TCFGJSON extends JsonObject = JsonOb
7517
7717
  /**
7518
7718
  * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
7519
7719
  */
7520
- abstract getConfigurationJson(): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
7720
+ abstract getConfigurationJson(): Result<JsonCompatibleType<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
7521
7721
  /**
7522
7722
  * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
7523
7723
  */
7524
- abstract validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
7724
+ abstract validateConfigurationJson(from: unknown): Result<JsonCompatibleType<Config_2.IQualifierTypeConfig<TCFGJSON>>>;
7525
7725
  /**
7526
7726
  * {@inheritdoc QualifierTypes.IQualifierType.setIndex}
7527
7727
  */
@@ -8457,6 +8657,10 @@ export declare class ResourceManagerBuilder implements IResourceManager<Resource
8457
8657
  * the {@link Resources.ResourceCandidate | resource candidates} in this manager.
8458
8658
  */
8459
8659
  get conditions(): ReadOnlyConditionCollector;
8660
+ /**
8661
+ * The resource IDs that this resource manager can resolve.
8662
+ */
8663
+ get resourceIds(): ReadonlyArray<ResourceId>;
8460
8664
  /**
8461
8665
  * A {@link Conditions.ConditionSetCollector | ConditionSetCollector} which
8462
8666
  * contains the {@link Conditions.ConditionSet | condition sets} used so far by
@@ -8805,6 +9009,10 @@ export declare class ResourceResolver implements IResourceResolver {
8805
9009
  * The readonly qualifier collector that provides qualifier implementations.
8806
9010
  */
8807
9011
  get qualifiers(): IReadOnlyQualifierCollector;
9012
+ /**
9013
+ * The resource IDs that this resolver can resolve.
9014
+ */
9015
+ get resourceIds(): ReadonlyArray<ResourceId>;
8808
9016
  /**
8809
9017
  * The cache array for resolved conditions, indexed by condition index for O(1) lookup.
8810
9018
  * Each entry stores the resolved {@link Runtime.IConditionMatchResult | condition match result} for
@@ -9032,6 +9240,9 @@ declare namespace Resources {
9032
9240
  CandidateValue,
9033
9241
  ICandidateValueCollectorCreateParams,
9034
9242
  CandidateValueCollector,
9243
+ IDeltaGeneratorParams,
9244
+ IDeltaGeneratorOptions,
9245
+ DeltaGenerator,
9035
9246
  IResourceCandidateCreateParams,
9036
9247
  ICandidateDeclOptions,
9037
9248
  ResourceCandidate,
@@ -9799,7 +10010,7 @@ declare const TerritoryPrioritySystemConfiguration: ISystemConfiguration;
9799
10010
  * implementation handles incorrect casing.
9800
10011
  * @public
9801
10012
  */
9802
- declare class TerritoryQualifierType extends QualifierType<JsonCompatible<Config_2.ITerritoryQualifierTypeConfig>> {
10013
+ declare class TerritoryQualifierType extends QualifierType<JsonCompatibleType<Config_2.ITerritoryQualifierTypeConfig>> {
9803
10014
  /**
9804
10015
  * {@inheritdoc QualifierTypes.IQualifierType.systemTypeName}
9805
10016
  */
@@ -9854,11 +10065,11 @@ declare class TerritoryQualifierType extends QualifierType<JsonCompatible<Config
9854
10065
  /**
9855
10066
  * {@inheritdoc QualifierTypes.IQualifierType.getConfigurationJson}
9856
10067
  */
9857
- getConfigurationJson(): Result<JsonCompatible<Config_2.ISystemTerritoryQualifierTypeConfig>>;
10068
+ getConfigurationJson(): Result<JsonCompatibleType<Config_2.ISystemTerritoryQualifierTypeConfig>>;
9858
10069
  /**
9859
10070
  * {@inheritdoc QualifierTypes.IQualifierType.validateConfigurationJson}
9860
10071
  */
9861
- validateConfigurationJson(from: unknown): Result<JsonCompatible<Config_2.ISystemTerritoryQualifierTypeConfig>>;
10072
+ validateConfigurationJson(from: unknown): Result<JsonCompatibleType<Config_2.ISystemTerritoryQualifierTypeConfig>>;
9862
10073
  /**
9863
10074
  * Validates a {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | strongly typed configuration object}
9864
10075
  * for this qualifier type.
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.52.12"
8
+ "packageVersion": "7.54.0"
9
9
  }
10
10
  ]
11
11
  }
@@ -0,0 +1,24 @@
1
+ import * as Bundle from './packlets/bundle';
2
+ import * as QualifierTypes from './packlets/qualifier-types';
3
+ import * as Qualifiers from './packlets/qualifiers';
4
+ import * as Conditions from './packlets/conditions';
5
+ import * as Config from './packlets/config/index.browser';
6
+ import * as Context from './packlets/context';
7
+ import * as Decisions from './packlets/decisions';
8
+ import * as ResourceJson from './packlets/resource-json';
9
+ import * as Resources from './packlets/resources';
10
+ import * as ResourceTypes from './packlets/resource-types';
11
+ import * as Import from './packlets/import/index.browser';
12
+ import * as Runtime from './packlets/runtime';
13
+ import * as ZipArchive from './packlets/zip-archive/index.browser';
14
+ export * from './packlets/common';
15
+ import { Condition, ConditionSet } from './packlets/conditions';
16
+ import { Decision } from './packlets/decisions';
17
+ import { QualifierType } from './packlets/qualifier-types';
18
+ import { Qualifier } from './packlets/qualifiers';
19
+ import { ResourceType } from './packlets/resource-types';
20
+ import { Resource, ResourceCandidate, ResourceManagerBuilder } from './packlets/resources';
21
+ import { IResourceManager, ResourceResolver } from './packlets/runtime';
22
+ import { BundleBuilder, BundleLoader } from './packlets/bundle';
23
+ export { Bundle, BundleBuilder, BundleLoader, Condition, Conditions, ConditionSet, Config, Context, Decision, Decisions, Import, IResourceManager, Qualifier, QualifierType, QualifierTypes, Qualifiers, Resource, ResourceCandidate, ResourceJson, ResourceResolver, ResourceManagerBuilder, ResourceType, ResourceTypes, Resources, Runtime, ZipArchive };
24
+ //# sourceMappingURL=index.browser.d.ts.map
@@ -0,0 +1,116 @@
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 __importStar = (this && this.__importStar) || (function () {
40
+ var ownKeys = function(o) {
41
+ ownKeys = Object.getOwnPropertyNames || function (o) {
42
+ var ar = [];
43
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
44
+ return ar;
45
+ };
46
+ return ownKeys(o);
47
+ };
48
+ return function (mod) {
49
+ if (mod && mod.__esModule) return mod;
50
+ var result = {};
51
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
52
+ __setModuleDefault(result, mod);
53
+ return result;
54
+ };
55
+ })();
56
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
57
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
58
+ };
59
+ Object.defineProperty(exports, "__esModule", { value: true });
60
+ exports.ZipArchive = exports.Runtime = exports.Resources = exports.ResourceTypes = exports.ResourceType = exports.ResourceManagerBuilder = exports.ResourceResolver = exports.ResourceJson = exports.ResourceCandidate = exports.Resource = exports.Qualifiers = exports.QualifierTypes = exports.QualifierType = exports.Qualifier = exports.Import = exports.Decisions = exports.Decision = exports.Context = exports.Config = exports.ConditionSet = exports.Conditions = exports.Condition = exports.BundleLoader = exports.BundleBuilder = exports.Bundle = void 0;
61
+ // Browser entry point - excludes Node.js filesystem dependencies
62
+ const Bundle = __importStar(require("./packlets/bundle"));
63
+ exports.Bundle = Bundle;
64
+ const QualifierTypes = __importStar(require("./packlets/qualifier-types"));
65
+ exports.QualifierTypes = QualifierTypes;
66
+ const Qualifiers = __importStar(require("./packlets/qualifiers"));
67
+ exports.Qualifiers = Qualifiers;
68
+ const Conditions = __importStar(require("./packlets/conditions"));
69
+ exports.Conditions = Conditions;
70
+ // eslint-disable-next-line @rushstack/packlets/mechanics -- browser-specific entry point excludes Node.js fs dependencies
71
+ const Config = __importStar(require("./packlets/config/index.browser"));
72
+ exports.Config = Config;
73
+ const Context = __importStar(require("./packlets/context"));
74
+ exports.Context = Context;
75
+ const Decisions = __importStar(require("./packlets/decisions"));
76
+ exports.Decisions = Decisions;
77
+ const ResourceJson = __importStar(require("./packlets/resource-json"));
78
+ exports.ResourceJson = ResourceJson;
79
+ const Resources = __importStar(require("./packlets/resources"));
80
+ exports.Resources = Resources;
81
+ const ResourceTypes = __importStar(require("./packlets/resource-types"));
82
+ exports.ResourceTypes = ResourceTypes;
83
+ // eslint-disable-next-line @rushstack/packlets/mechanics -- browser-specific entry point excludes Node.js fs dependencies
84
+ const Import = __importStar(require("./packlets/import/index.browser"));
85
+ exports.Import = Import;
86
+ const Runtime = __importStar(require("./packlets/runtime"));
87
+ exports.Runtime = Runtime;
88
+ // eslint-disable-next-line @rushstack/packlets/mechanics -- browser-specific entry point excludes Node.js fs dependencies
89
+ const ZipArchive = __importStar(require("./packlets/zip-archive/index.browser"));
90
+ exports.ZipArchive = ZipArchive;
91
+ __exportStar(require("./packlets/common"), exports);
92
+ const conditions_1 = require("./packlets/conditions");
93
+ Object.defineProperty(exports, "Condition", { enumerable: true, get: function () { return conditions_1.Condition; } });
94
+ Object.defineProperty(exports, "ConditionSet", { enumerable: true, get: function () { return conditions_1.ConditionSet; } });
95
+ const decisions_1 = require("./packlets/decisions");
96
+ Object.defineProperty(exports, "Decision", { enumerable: true, get: function () { return decisions_1.Decision; } });
97
+ const qualifier_types_1 = require("./packlets/qualifier-types");
98
+ Object.defineProperty(exports, "QualifierType", { enumerable: true, get: function () { return qualifier_types_1.QualifierType; } });
99
+ const qualifiers_1 = require("./packlets/qualifiers");
100
+ Object.defineProperty(exports, "Qualifier", { enumerable: true, get: function () { return qualifiers_1.Qualifier; } });
101
+ const resource_types_1 = require("./packlets/resource-types");
102
+ Object.defineProperty(exports, "ResourceType", { enumerable: true, get: function () { return resource_types_1.ResourceType; } });
103
+ const resources_1 = require("./packlets/resources");
104
+ Object.defineProperty(exports, "Resource", { enumerable: true, get: function () { return resources_1.Resource; } });
105
+ Object.defineProperty(exports, "ResourceCandidate", { enumerable: true, get: function () { return resources_1.ResourceCandidate; } });
106
+ Object.defineProperty(exports, "ResourceManagerBuilder", { enumerable: true, get: function () { return resources_1.ResourceManagerBuilder; } });
107
+ const runtime_1 = require("./packlets/runtime");
108
+ Object.defineProperty(exports, "ResourceResolver", { enumerable: true, get: function () { return runtime_1.ResourceResolver; } });
109
+ const bundle_1 = require("./packlets/bundle");
110
+ Object.defineProperty(exports, "BundleBuilder", { enumerable: true, get: function () { return bundle_1.BundleBuilder; } });
111
+ Object.defineProperty(exports, "BundleLoader", { enumerable: true, get: function () { return bundle_1.BundleLoader; } });
112
+ // Excluded from browser:
113
+ // - Config: SystemConfiguration.loadFromFile() (requires Node.js fs via JsonFile)
114
+ // - Import: PathImporter, FsItemImporter, FsItem.createForPath() (require Node.js fs)
115
+ // - ZipArchive: ZipArchiveCreator methods using file paths (require Node.js fs)
116
+ //# sourceMappingURL=index.browser.js.map
@@ -34,7 +34,7 @@ export declare function joinOptionalResourceIds(...ids: (string | undefined)[]):
34
34
  /**
35
35
  * Gets the name for a resource ID.
36
36
  * @param id - The resource ID to get the name for.
37
- * @returns The resource name if found, or undefined if not.
37
+ * @returns `Success` with the resource name if found, or `Failure` with an error message if not.
38
38
  * @public
39
39
  */
40
40
  export declare function getNameForResourceId(id: string | undefined): Result<ResourceName>;
@@ -87,12 +87,13 @@ function joinOptionalResourceIds(...ids) {
87
87
  /**
88
88
  * Gets the name for a resource ID.
89
89
  * @param id - The resource ID to get the name for.
90
- * @returns The resource name if found, or undefined if not.
90
+ * @returns `Success` with the resource name if found, or `Failure` with an error message if not.
91
91
  * @public
92
92
  */
93
93
  function getNameForResourceId(id) {
94
94
  return splitResourceId(id).onSuccess((parts) => {
95
- return parts.length > 0 ? (0, ts_utils_1.succeed)(parts[parts.length - 1]) : fail('Empty id has no name');
95
+ /* c8 ignore next 1 - tested but coverage having issues */
96
+ return parts.length > 0 ? (0, ts_utils_1.succeed)(parts[parts.length - 1]) : fail(`${id}: invalid resource id`);
96
97
  });
97
98
  }
98
99
  //# sourceMappingURL=resources.js.map
@@ -66,6 +66,10 @@ export type CandidateValueKey = Brand<string, 'CandidateValueKey'>;
66
66
  * @public
67
67
  */
68
68
  export interface IResourceResolver {
69
+ /**
70
+ * The resource IDs that this resolver can resolve.
71
+ */
72
+ readonly resourceIds: ReadonlyArray<ResourceId>;
69
73
  /**
70
74
  * Resolves a resource to a composed value by merging matching candidates according to their merge methods.
71
75
  * Starting from the highest priority candidates, finds the first "full" candidate and merges all higher