@fgv/ts-res 5.0.0-0 → 5.0.0-11

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 (112) hide show
  1. package/dist/ts-res.d.ts +793 -125
  2. package/lib/index.d.ts +10 -2
  3. package/lib/index.d.ts.map +1 -1
  4. package/lib/index.js +23 -2
  5. package/lib/index.js.map +1 -1
  6. package/lib/packlets/bundle/bundleBuilder.d.ts +41 -0
  7. package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
  8. package/lib/packlets/bundle/bundleBuilder.js +134 -0
  9. package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
  10. package/lib/packlets/bundle/bundleLoader.d.ts +72 -0
  11. package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
  12. package/lib/packlets/bundle/bundleLoader.js +105 -0
  13. package/lib/packlets/bundle/bundleLoader.js.map +1 -0
  14. package/lib/packlets/bundle/bundleNormalizer.d.ts +73 -0
  15. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
  16. package/lib/packlets/bundle/bundleNormalizer.js +142 -0
  17. package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
  18. package/lib/packlets/bundle/bundleUtils.d.ts +70 -0
  19. package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
  20. package/lib/packlets/bundle/bundleUtils.js +117 -0
  21. package/lib/packlets/bundle/bundleUtils.js.map +1 -0
  22. package/lib/packlets/bundle/convert.d.ts +33 -0
  23. package/lib/packlets/bundle/convert.d.ts.map +1 -0
  24. package/lib/packlets/bundle/convert.js +78 -0
  25. package/lib/packlets/bundle/convert.js.map +1 -0
  26. package/lib/packlets/bundle/index.d.ts +21 -0
  27. package/lib/packlets/bundle/index.d.ts.map +1 -0
  28. package/lib/packlets/bundle/index.js +83 -0
  29. package/lib/packlets/bundle/index.js.map +1 -0
  30. package/lib/packlets/bundle/model.d.ts +100 -0
  31. package/lib/packlets/bundle/model.d.ts.map +1 -0
  32. package/lib/packlets/bundle/model.js +24 -0
  33. package/lib/packlets/bundle/model.js.map +1 -0
  34. package/lib/packlets/common/helpers/resources.d.ts +7 -0
  35. package/lib/packlets/common/helpers/resources.d.ts.map +1 -1
  36. package/lib/packlets/common/helpers/resources.js +12 -0
  37. package/lib/packlets/common/helpers/resources.js.map +1 -1
  38. package/lib/packlets/common/resources.d.ts +8 -0
  39. package/lib/packlets/common/resources.d.ts.map +1 -1
  40. package/lib/packlets/common/resources.js.map +1 -1
  41. package/lib/packlets/conditions/condition.js +1 -1
  42. package/lib/packlets/conditions/condition.js.map +1 -1
  43. package/lib/packlets/conditions/conditionSet.d.ts +9 -0
  44. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -1
  45. package/lib/packlets/conditions/conditionSet.js +74 -1
  46. package/lib/packlets/conditions/conditionSet.js.map +1 -1
  47. package/lib/packlets/import/fsItem.d.ts.map +1 -1
  48. package/lib/packlets/import/fsItem.js +8 -13
  49. package/lib/packlets/import/fsItem.js.map +1 -1
  50. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -1
  51. package/lib/packlets/import/importers/jsonImporter.js +1 -0
  52. package/lib/packlets/import/importers/jsonImporter.js.map +1 -1
  53. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +4 -0
  54. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -1
  55. package/lib/packlets/qualifier-types/literalQualifierType.js +14 -0
  56. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -1
  57. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +7 -0
  58. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -1
  59. package/lib/packlets/qualifier-types/literalValueHierarchy.js +14 -1
  60. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -1
  61. package/lib/packlets/qualifier-types/qualifierType.d.ts +11 -0
  62. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -1
  63. package/lib/packlets/qualifier-types/qualifierType.js +9 -0
  64. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -1
  65. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -1
  66. package/lib/packlets/qualifiers/qualifierCollector.js +1 -2
  67. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -1
  68. package/lib/packlets/resource-types/jsonResourceType.d.ts +4 -4
  69. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -1
  70. package/lib/packlets/resource-types/jsonResourceType.js +1 -1
  71. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -1
  72. package/lib/packlets/resource-types/resourceType.d.ts +18 -9
  73. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -1
  74. package/lib/packlets/resource-types/resourceType.js.map +1 -1
  75. package/lib/packlets/resources/common.d.ts +12 -0
  76. package/lib/packlets/resources/common.d.ts.map +1 -1
  77. package/lib/packlets/resources/common.js.map +1 -1
  78. package/lib/packlets/resources/resource.d.ts +5 -1
  79. package/lib/packlets/resources/resource.d.ts.map +1 -1
  80. package/lib/packlets/resources/resource.js +1 -0
  81. package/lib/packlets/resources/resource.js.map +1 -1
  82. package/lib/packlets/resources/resourceCandidate.d.ts +5 -1
  83. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -1
  84. package/lib/packlets/resources/resourceCandidate.js +6 -0
  85. package/lib/packlets/resources/resourceCandidate.js.map +1 -1
  86. package/lib/packlets/resources/resourceManagerBuilder.d.ts +133 -6
  87. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -1
  88. package/lib/packlets/resources/resourceManagerBuilder.js +451 -9
  89. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -1
  90. package/lib/packlets/runtime/cacheListener.d.ts +9 -0
  91. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -1
  92. package/lib/packlets/runtime/cacheListener.js +6 -0
  93. package/lib/packlets/runtime/cacheListener.js.map +1 -1
  94. package/lib/packlets/runtime/cacheMetrics.d.ts +6 -0
  95. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -1
  96. package/lib/packlets/runtime/cacheMetrics.js +11 -0
  97. package/lib/packlets/runtime/cacheMetrics.js.map +1 -1
  98. package/lib/packlets/runtime/compiledResourceCollection.d.ts +1 -1
  99. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -1
  100. package/lib/packlets/runtime/compiledResourceCollection.js +7 -0
  101. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -1
  102. package/lib/packlets/runtime/iResourceManager.d.ts +11 -3
  103. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -1
  104. package/lib/packlets/runtime/iResourceManager.js.map +1 -1
  105. package/lib/packlets/runtime/resourceResolver.d.ts +21 -0
  106. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -1
  107. package/lib/packlets/runtime/resourceResolver.js +39 -17
  108. package/lib/packlets/runtime/resourceResolver.js.map +1 -1
  109. package/lib/packlets/runtime/validate.d.ts.map +1 -1
  110. package/lib/packlets/runtime/validate.js +1 -0
  111. package/lib/packlets/runtime/validate.js.map +1 -1
  112. package/package.json +12 -12
package/dist/ts-res.d.ts CHANGED
@@ -3,6 +3,7 @@ import { Collections } from '@fgv/ts-utils';
3
3
  import { Converter } from '@fgv/ts-utils';
4
4
  import { DetailedResult } from '@fgv/ts-utils';
5
5
  import { FileTree } from '@fgv/ts-utils';
6
+ import { Hash } from '@fgv/ts-utils';
6
7
  import { ICollectible } from '@fgv/ts-utils';
7
8
  import { IReadOnlyResultMap } from '@fgv/ts-utils';
8
9
  import { JsonObject } from '@fgv/ts-json-base';
@@ -178,6 +179,262 @@ declare function buildQualifierDefaultValuesToken(parts: ReadonlyArray<IQualifie
178
179
  */
179
180
  declare function buildQualifierDefaultValueToken({ qualifier, value }: IQualifierDefaultValueTokenParts): Result<QualifierDefaultValueToken>;
180
181
 
182
+ declare namespace Bundle {
183
+ export {
184
+ IBundleMetadata,
185
+ IBundleExportMetadata,
186
+ IBundle,
187
+ IBundleCreateParams,
188
+ BundleBuilder,
189
+ BundleLoader,
190
+ IBundleLoaderCreateParams,
191
+ BundleUtils,
192
+ IBundleComponents,
193
+ Model_4 as Model,
194
+ Convert_10 as Convert,
195
+ BundleNormalizer
196
+ }
197
+ }
198
+ export { Bundle }
199
+
200
+ /**
201
+ * `Converter` for a {@link Bundle.IBundle | bundle} object.
202
+ * @public
203
+ */
204
+ declare const bundle: Converter<IBundle>;
205
+
206
+ /**
207
+ * Builder for creating resource bundles from a ResourceManagerBuilder.
208
+ * Handles the compilation, configuration extraction, and integrity verification
209
+ * needed to create a complete, portable bundle.
210
+ * @public
211
+ */
212
+ export declare class BundleBuilder {
213
+ /**
214
+ * Creates a resource bundle from a ResourceManagerBuilder.
215
+ * @param builder - The ResourceManagerBuilder containing the resources to bundle
216
+ * @param systemConfig - The SystemConfiguration used to create the builder
217
+ * @param params - Optional parameters for bundle creation
218
+ * @returns Success with the created bundle if successful, Failure with error message otherwise
219
+ * @public
220
+ */
221
+ static create(builder: ResourceManagerBuilder, systemConfig: SystemConfiguration, params?: IBundleCreateParams): Result<IBundle>;
222
+ /**
223
+ * Creates a resource bundle from a ResourceManagerBuilder using a predefined system configuration.
224
+ * This is a convenience method for the common case of using predefined configurations.
225
+ * @param builder - The ResourceManagerBuilder containing the resources to bundle
226
+ * @param configName - The name of the predefined system configuration used
227
+ * @param params - Optional parameters for bundle creation
228
+ * @returns Success with the created bundle if successful, Failure with error message otherwise
229
+ * @public
230
+ */
231
+ static createFromPredefined(builder: ResourceManagerBuilder, configName: PredefinedSystemConfiguration, params?: IBundleCreateParams): Result<IBundle>;
232
+ /**
233
+ * Generates a hash checksum for the compiled resource collection.
234
+ * The checksum is calculated using the provided hash normalizer.
235
+ * @param compiledCollection - The compiled resource collection to generate checksum for
236
+ * @param hashNormalizer - The hash normalizer to use for checksum generation
237
+ * @returns Success with the checksum string if successful, Failure otherwise
238
+ * @internal
239
+ */
240
+ private static _generateChecksum;
241
+ }
242
+
243
+ /**
244
+ * `Converter` for {@link Bundle.IBundleCreateParams | bundle creation parameters}.
245
+ * @public
246
+ */
247
+ declare const bundleCreateParams: Converter<IBundleCreateParams>;
248
+
249
+ /**
250
+ * `Converter` for {@link Bundle.IBundleExportMetadata | bundle export metadata}.
251
+ * @public
252
+ */
253
+ declare const bundleExportMetadata: Converter<IBundleExportMetadata>;
254
+
255
+ /**
256
+ * Loader for creating an IResourceManager from a resource bundle.
257
+ * Handles integrity verification and reconstruction of the runtime resource manager.
258
+ * @public
259
+ */
260
+ export declare class BundleLoader {
261
+ /**
262
+ * Creates an IResourceManager from a resource bundle.
263
+ * @param params - Parameters for bundle loading including the bundle and options
264
+ * @returns Success with the IResourceManager if successful, Failure with error message otherwise
265
+ * @public
266
+ */
267
+ static createManagerFromBundle(params: IBundleLoaderCreateParams): Result<IResourceManager>;
268
+ /**
269
+ * Verifies the integrity of a bundle by checking its checksum.
270
+ * @param bundle - The bundle to verify
271
+ * @param skipVerification - Whether to skip verification
272
+ * @param hashNormalizer - The hash normalizer to use for verification
273
+ * @returns Success if verification passes or is skipped, Failure otherwise
274
+ * @internal
275
+ */
276
+ private static _verifyBundleIntegrity;
277
+ /**
278
+ * Generates a hash checksum for the compiled resource collection.
279
+ * @param compiledCollection - The compiled resource collection to generate checksum for
280
+ * @param hashNormalizer - The hash normalizer to use for checksum generation
281
+ * @returns Success with the checksum string if successful, Failure otherwise
282
+ * @internal
283
+ */
284
+ private static _generateChecksum;
285
+ /**
286
+ * Creates a SystemConfiguration from the bundle's configuration.
287
+ * @param bundle - The bundle containing the configuration
288
+ * @returns Success with the SystemConfiguration if successful, Failure otherwise
289
+ * @internal
290
+ */
291
+ private static _createSystemConfiguration;
292
+ /**
293
+ * Creates a CompiledResourceCollection from the bundle.
294
+ * @param bundle - The bundle to load
295
+ * @param qualifierTypes - The qualifier type collector from the system configuration
296
+ * @param resourceTypes - The resource type collector from the system configuration
297
+ * @returns Success with the CompiledResourceCollection if successful, Failure otherwise
298
+ * @internal
299
+ */
300
+ private static _createCompiledResourceCollection;
301
+ }
302
+
303
+ /**
304
+ * `Converter` for a {@link Bundle.IBundleMetadata | bundle metadata} object.
305
+ * @public
306
+ */
307
+ declare const bundleMetadata: Converter<IBundleMetadata>;
308
+
309
+ /**
310
+ * Normalizes ResourceManagerBuilder instances to ensure consistent ordering
311
+ * of internal entities, enabling order-independent bundle checksums.
312
+ *
313
+ * The normalization process rebuilds the ResourceManagerBuilder from the ground up
314
+ * in a canonical order to ensure identical index assignments regardless of
315
+ * original construction order.
316
+ * @public
317
+ */
318
+ declare class BundleNormalizer {
319
+ /**
320
+ * Creates a normalized ResourceManagerBuilder from an existing builder.
321
+ * The normalized builder will have identical entities but arranged in
322
+ * canonical order to ensure consistent index assignments.
323
+ *
324
+ * @param originalBuilder - The ResourceManagerBuilder to normalize
325
+ * @param systemConfig - The SystemConfiguration used to create the original builder
326
+ * @returns Success with the normalized ResourceManagerBuilder if successful, Failure otherwise
327
+ */
328
+ static normalize(originalBuilder: ResourceManagerBuilder, systemConfig: SystemConfiguration): Result<ResourceManagerBuilder>;
329
+ /**
330
+ * Creates a normalized ResourceManagerBuilder using a predefined system configuration.
331
+ * This is a convenience method for the common case of using predefined configurations.
332
+ *
333
+ * @param originalBuilder - The ResourceManagerBuilder to normalize
334
+ * @param configName - The name of the predefined system configuration used
335
+ * @returns Success with the normalized ResourceManagerBuilder if successful, Failure otherwise
336
+ */
337
+ static normalizeFromPredefined(originalBuilder: ResourceManagerBuilder, configName: PredefinedSystemConfiguration): Result<ResourceManagerBuilder>;
338
+ /**
339
+ * Normalizes all conditions from the original builder by adding them to the
340
+ * normalized builder in sorted order using loose condition declarations.
341
+ *
342
+ * @param originalBuilder - The source ResourceManagerBuilder
343
+ * @param normalizedBuilder - The target normalized ResourceManagerBuilder
344
+ * @returns Success if all conditions were normalized successfully, Failure otherwise
345
+ * @internal
346
+ */
347
+ private static _normalizeConditions;
348
+ /**
349
+ * Normalizes all condition sets from the original builder by adding them to the
350
+ * normalized builder in sorted order using loose condition set declarations.
351
+ *
352
+ * @param originalBuilder - The source ResourceManagerBuilder
353
+ * @param normalizedBuilder - The target normalized ResourceManagerBuilder
354
+ * @returns Success if all condition sets were normalized successfully, Failure otherwise
355
+ * @internal
356
+ */
357
+ private static _normalizeConditionSets;
358
+ /**
359
+ * Normalizes all candidates by sorting them first by resource ID, then by condition set.
360
+ *
361
+ * @param originalBuilder - The source ResourceManagerBuilder
362
+ * @param normalizedBuilder - The target normalized ResourceManagerBuilder
363
+ * @returns Success if all candidates were normalized successfully, Failure otherwise
364
+ * @internal
365
+ */
366
+ private static _normalizeCandidates;
367
+ /**
368
+ * Adds normalized resources to the target builder by first normalizing conditions,
369
+ * then condition sets, then candidates.
370
+ *
371
+ * @param originalBuilder - The source ResourceManagerBuilder
372
+ * @param normalizedBuilder - The target normalized ResourceManagerBuilder
373
+ * @returns Success if all resources were added successfully, Failure otherwise
374
+ * @internal
375
+ */
376
+ private static _addNormalizedResources;
377
+ }
378
+
379
+ /**
380
+ * Lightweight converter for bundle structure validation without full processing.
381
+ * Useful for detecting bundle files without the overhead of full validation.
382
+ * @public
383
+ */
384
+ declare const bundleStructure: Converter<{
385
+ metadata: IBundleMetadata;
386
+ config: unknown;
387
+ compiledCollection: unknown;
388
+ }>;
389
+
390
+ /**
391
+ * Utility functions for working with resource bundles.
392
+ * Provides reusable logic for bundle detection, parsing, and component extraction.
393
+ * @public
394
+ */
395
+ declare class BundleUtils {
396
+ /**
397
+ * Checks if the given object appears to be a bundle file by examining its structure.
398
+ * This is a lightweight check that doesn't perform full validation.
399
+ * @param data - The data to check
400
+ * @returns True if the data appears to be a bundle structure
401
+ * @public
402
+ */
403
+ static isBundleFile(data: unknown): boolean;
404
+ /**
405
+ * Extracts and validates components from a bundle for reuse.
406
+ * Performs full validation of the bundle structure and creates typed components.
407
+ * @param bundleData - The raw bundle data to extract components from
408
+ * @returns Success with bundle components if valid, Failure with error message otherwise
409
+ * @public
410
+ */
411
+ static extractBundleComponents(bundleData: unknown): Result<IBundleComponents>;
412
+ /**
413
+ * Extracts just the metadata from potential bundle data without full validation.
414
+ * Useful for displaying bundle information without processing the entire bundle.
415
+ * @param data - The data to extract metadata from
416
+ * @returns Success with metadata if found and valid, Failure otherwise
417
+ * @public
418
+ */
419
+ static extractBundleMetadata(data: unknown): Result<IBundleMetadata>;
420
+ /**
421
+ * Parses bundle data from a JSON string.
422
+ * Convenience method that combines JSON parsing with bundle component extraction.
423
+ * @param jsonString - The JSON string containing bundle data
424
+ * @returns Success with bundle components if valid, Failure with error message otherwise
425
+ * @public
426
+ */
427
+ static parseBundleFromJson(jsonString: string): Result<IBundleComponents>;
428
+ /**
429
+ * Checks if a file name suggests it might be a bundle file.
430
+ * This is a heuristic check based on file naming conventions.
431
+ * @param fileName - The file name to check
432
+ * @returns True if the file name suggests a bundle file
433
+ * @public
434
+ */
435
+ static isBundleFileName(fileName: string): boolean;
436
+ }
437
+
181
438
  /**
182
439
  * Simple implementation of {@link Decisions.ICandidate | ICandidate} with
183
440
  * helper methods for sorting and presentation.
@@ -227,6 +484,15 @@ declare class Candidate<TVALUE extends JsonValue = JsonValue> implements ICandid
227
484
  */
228
485
  declare type CandidateAction = 'unchanged' | 'reduced' | 'suppressed';
229
486
 
487
+ /**
488
+ * The completeness of a resource candidate value. A full value is one that
489
+ * contains all of the required properties for the resource type. A partial
490
+ * value is one that contains some of the required properties for the resource
491
+ * type.
492
+ * @public
493
+ */
494
+ export declare type CandidateCompleteness = 'full' | 'partial';
495
+
230
496
  /**
231
497
  * Manages candidate reduction logic for filtering and qualifier reduction operations.
232
498
  * Encapsulates the state and logic needed to consistently process candidates for reduction.
@@ -402,13 +668,14 @@ declare namespace Common {
402
668
  ResourceTypeName,
403
669
  ResourceTypeIndex,
404
670
  ResourceValueMergeMethod,
405
- allResourceValueMergeMethods
671
+ allResourceValueMergeMethods,
672
+ CandidateCompleteness
406
673
  }
407
674
  }
408
675
 
409
676
  declare namespace Compiled {
410
677
  export {
411
- Convert_3 as Convert,
678
+ Convert_6 as Convert,
412
679
  ICompiledResourceOptions,
413
680
  ICompiledConditionMetadata,
414
681
  ICompiledConditionSetMetadata,
@@ -429,61 +696,61 @@ declare namespace Compiled {
429
696
  * Converter for a {@link ResourceJson.Compiled.ICompiledAbstractDecision | compiled abstract decision}.
430
697
  * @public
431
698
  */
432
- declare const compiledAbstractDecision: ObjectConverter<Model.ICompiledAbstractDecision, unknown>;
699
+ declare const compiledAbstractDecision: ObjectConverter<Model_3.ICompiledAbstractDecision, unknown>;
433
700
 
434
701
  /**
435
702
  * Converter for a {@link ResourceJson.Compiled.ICompiledCandidate | compiled candidate}.
436
703
  * @public
437
704
  */
438
- declare const compiledCandidate: ObjectConverter<Model.ICompiledCandidate, unknown>;
705
+ declare const compiledCandidate: ObjectConverter<Model_3.ICompiledCandidate, unknown>;
439
706
 
440
707
  /**
441
708
  * Converter for a {@link ResourceJson.Compiled.ICompiledCondition | compiled condition}.
442
709
  * @public
443
710
  */
444
- declare const compiledCondition: ObjectConverter<Model.ICompiledCondition, unknown>;
711
+ declare const compiledCondition: ObjectConverter<Model_3.ICompiledCondition, unknown>;
445
712
 
446
713
  /**
447
714
  * Converter for a {@link ResourceJson.Compiled.ICompiledConditionMetadata | compiled condition metadata}.
448
715
  * @public
449
716
  */
450
- declare const compiledConditionMetadata: ObjectConverter<Model.ICompiledConditionMetadata, unknown>;
717
+ declare const compiledConditionMetadata: ObjectConverter<Model_3.ICompiledConditionMetadata, unknown>;
451
718
 
452
719
  /**
453
720
  * Converter for a {@link ResourceJson.Compiled.ICompiledConditionSet | compiled condition set}.
454
721
  * @public
455
722
  */
456
- declare const compiledConditionSet: ObjectConverter<Model.ICompiledConditionSet, unknown>;
723
+ declare const compiledConditionSet: ObjectConverter<Model_3.ICompiledConditionSet, unknown>;
457
724
 
458
725
  /**
459
726
  * Converter for a {@link ResourceJson.Compiled.ICompiledConditionSetMetadata | compiled condition set metadata}.
460
727
  * @public
461
728
  */
462
- declare const compiledConditionSetMetadata: ObjectConverter<Model.ICompiledConditionSetMetadata, unknown>;
729
+ declare const compiledConditionSetMetadata: ObjectConverter<Model_3.ICompiledConditionSetMetadata, unknown>;
463
730
 
464
731
  /**
465
732
  * Converter for a {@link ResourceJson.Compiled.ICompiledDecisionMetadata | compiled decision metadata}.
466
733
  * @public
467
734
  */
468
- declare const compiledDecisionMetadata: ObjectConverter<Model.ICompiledDecisionMetadata, unknown>;
735
+ declare const compiledDecisionMetadata: ObjectConverter<Model_3.ICompiledDecisionMetadata, unknown>;
469
736
 
470
737
  /**
471
738
  * Converter for a {@link ResourceJson.Compiled.ICompiledQualifier | compiled qualifier}.
472
739
  * @public
473
740
  */
474
- declare const compiledQualifier: ObjectConverter<Model.ICompiledQualifier, unknown>;
741
+ declare const compiledQualifier: ObjectConverter<Model_3.ICompiledQualifier, unknown>;
475
742
 
476
743
  /**
477
744
  * Converter for a {@link ResourceJson.Compiled.ICompiledQualifierType | compiled qualifier type}.
478
745
  * @public
479
746
  */
480
- declare const compiledQualifierType: ObjectConverter<Model.ICompiledQualifierType, unknown>;
747
+ declare const compiledQualifierType: ObjectConverter<Model_3.ICompiledQualifierType, unknown>;
481
748
 
482
749
  /**
483
750
  * Converter for a {@link ResourceJson.Compiled.ICompiledResource | compiled resource}.
484
751
  * @public
485
752
  */
486
- declare const compiledResource: ObjectConverter<Model.ICompiledResource, unknown>;
753
+ declare const compiledResource: ObjectConverter<Model_3.ICompiledResource, unknown>;
487
754
 
488
755
  /**
489
756
  * A compiled resource collection implements {@link Runtime.IResourceManager | IResourceManager}
@@ -491,7 +758,7 @@ declare const compiledResource: ObjectConverter<Model.ICompiledResource, unknown
491
758
  * and use pre-compiled resource collections without rebuilding them from scratch.
492
759
  * @public
493
760
  */
494
- declare class CompiledResourceCollection implements IResourceManager {
761
+ declare class CompiledResourceCollection implements IResourceManager<IResource> {
495
762
  readonly conditions: ReadOnlyConditionCollector;
496
763
  readonly conditionSets: ReadOnlyConditionSetCollector;
497
764
  readonly decisions: ReadOnlyAbstractDecisionCollector;
@@ -628,13 +895,13 @@ declare class CompiledResourceCollection implements IResourceManager {
628
895
  * This combines all the individual converters into a single converter for the entire resource collection.
629
896
  * @public
630
897
  */
631
- declare const compiledResourceCollection: ObjectConverter<Model.ICompiledResourceCollection, unknown>;
898
+ declare const compiledResourceCollection: ObjectConverter<Model_3.ICompiledResourceCollection, unknown>;
632
899
 
633
900
  /**
634
901
  * Converter for a {@link ResourceJson.Compiled.ICompiledResourceType | compiled resource type}.
635
902
  * @public
636
903
  */
637
- declare const compiledResourceType: ObjectConverter<Model.ICompiledResourceType, unknown>;
904
+ declare const compiledResourceType: ObjectConverter<Model_3.ICompiledResourceType, unknown>;
638
905
 
639
906
  /**
640
907
  * A {@link Decisions.ConcreteDecision | concrete decision} is a {@link Decisions.IDecision | decision}
@@ -685,7 +952,7 @@ declare class ConcreteDecision<TVALUE extends JsonValue = JsonValue> implements
685
952
  * Represents a single condition applied to some resource instance.
686
953
  * @public
687
954
  */
688
- declare class Condition implements IValidatedConditionDecl {
955
+ export declare class Condition implements IValidatedConditionDecl {
689
956
  /**
690
957
  * The {@link Qualifiers.Qualifier | qualifier} used in this condition.
691
958
  */
@@ -932,7 +1199,7 @@ declare const conditionPriority: Converter<ConditionPriority, unknown>;
932
1199
 
933
1200
  declare namespace Conditions {
934
1201
  export {
935
- Convert_2 as Convert,
1202
+ Convert_11 as Convert,
936
1203
  Condition,
937
1204
  IConditionCollectorCreateParams,
938
1205
  ConditionCollector,
@@ -956,7 +1223,7 @@ export { Conditions }
956
1223
  * context for a resource instance to be valid.
957
1224
  * @public
958
1225
  */
959
- declare class ConditionSet implements IValidatedConditionSetDecl {
1226
+ export declare class ConditionSet implements IValidatedConditionSetDecl {
960
1227
  protected readonly _collectible: Collections.Collectible<ConditionSetKey, ConditionSetIndex>;
961
1228
  /**
962
1229
  * The {@link Conditions.Condition | conditions} that make up this condition
@@ -1026,6 +1293,14 @@ declare class ConditionSet implements IValidatedConditionSetDecl {
1026
1293
  * @public
1027
1294
  */
1028
1295
  static getKeyForDecl(decl: IValidatedConditionSetDecl): Result<ConditionSetKey>;
1296
+ /**
1297
+ * Gets a condition set key from a loose condition set declaration.
1298
+ * @param conditionSet - The loose condition set declaration to convert.
1299
+ * @param conditionCollector - The condition collector used for validation.
1300
+ * @returns `Success` with the condition set key if successful, `Failure` otherwise.
1301
+ * @public
1302
+ */
1303
+ static getKeyFromLooseDecl(conditionSet: ResourceJson.Json.ConditionSetDecl | undefined, conditionCollector: ConditionCollector): Result<ConditionSetKey>;
1029
1304
  /**
1030
1305
  * Gets a {@link ConditionSetToken | condition set token} for this condition set,
1031
1306
  * if possible.
@@ -1120,10 +1395,10 @@ declare class ConditionSetCollector extends ValidatingCollector<ConditionSet> {
1120
1395
  declare type ConditionSetDecl = ConditionSetDeclAsArray | ConditionSetDeclAsRecord;
1121
1396
 
1122
1397
  /**
1123
- * Converter which converts to a {@link Conditions.IConditionSetDecl | condition set declaration}.
1398
+ * `Converter` for a normalized {@link ResourceJson.Normalized.ConditionSetDecl | condition set declaration}.
1124
1399
  * @public
1125
1400
  */
1126
- declare const conditionSetDecl: ObjectConverter<IConditionSetDecl, unknown>;
1401
+ declare const conditionSetDecl: Converter<Normalized.ConditionSetDecl>;
1127
1402
 
1128
1403
  /**
1129
1404
  * Normalized non-validated declaration of a {@link Conditions.Condition | condition}.
@@ -1132,10 +1407,10 @@ declare const conditionSetDecl: ObjectConverter<IConditionSetDecl, unknown>;
1132
1407
  declare type ConditionSetDecl_2 = ReadonlyArray<ILooseConditionDecl>;
1133
1408
 
1134
1409
  /**
1135
- * `Converter` for a normalized {@link ResourceJson.Normalized.ConditionSetDecl | condition set declaration}.
1410
+ * Converter which converts to a {@link Conditions.IConditionSetDecl | condition set declaration}.
1136
1411
  * @public
1137
1412
  */
1138
- declare const conditionSetDecl_2: Converter<Normalized.ConditionSetDecl>;
1413
+ declare const conditionSetDecl_2: ObjectConverter<IConditionSetDecl, unknown>;
1139
1414
 
1140
1415
  /**
1141
1416
  * Non-validated declaration of a {@link Conditions.Condition | condition}.
@@ -1373,8 +1648,8 @@ declare class ConditionTokens {
1373
1648
 
1374
1649
  declare namespace Config {
1375
1650
  export {
1376
- Model_2 as Model,
1377
- Convert_10 as Convert,
1651
+ Model,
1652
+ Convert_9 as Convert,
1378
1653
  updateSystemConfigurationQualifierDefaultValues,
1379
1654
  ISystemConfigurationInitParams,
1380
1655
  SystemConfiguration,
@@ -1390,7 +1665,7 @@ export { Config }
1390
1665
 
1391
1666
  declare namespace Config_2 {
1392
1667
  export {
1393
- Convert_6 as Convert,
1668
+ Convert_2 as Convert,
1394
1669
  IQualifierTypeConfig,
1395
1670
  ILanguageQualifierTypeConfig,
1396
1671
  ITerritoryQualifierTypeConfig,
@@ -1404,7 +1679,7 @@ declare namespace Config_2 {
1404
1679
 
1405
1680
  declare namespace Config_3 {
1406
1681
  export {
1407
- Convert_9 as Convert,
1682
+ Convert_5 as Convert,
1408
1683
  IResourceTypeConfig
1409
1684
  }
1410
1685
  }
@@ -1417,7 +1692,7 @@ declare const containerContextDecl: Converter<Normalized.IContainerContextDecl>;
1417
1692
 
1418
1693
  declare namespace Context {
1419
1694
  export {
1420
- Convert_5 as Convert,
1695
+ Convert_7 as Convert,
1421
1696
  IContextMatchOptions,
1422
1697
  IContextQualifierValueDecl,
1423
1698
  IContextDecl,
@@ -1760,23 +2035,62 @@ export { Convert }
1760
2035
 
1761
2036
  declare namespace Convert_10 {
1762
2037
  export {
1763
- systemConfiguration,
1764
- predefinedSystemConfiguration
2038
+ bundleMetadata,
2039
+ bundleExportMetadata,
2040
+ bundle,
2041
+ bundleCreateParams,
2042
+ bundleStructure
1765
2043
  }
1766
2044
  }
1767
2045
 
1768
- declare namespace Convert_2 {
2046
+ declare namespace Convert_11 {
1769
2047
  export {
1770
2048
  conditionDecl,
1771
2049
  IConditionDeclConvertContext,
1772
2050
  validatedConditionDecl,
1773
- conditionSetDecl,
2051
+ conditionSetDecl_2 as conditionSetDecl,
1774
2052
  IConditionSetDeclConvertContext,
1775
2053
  validatedConditionSetDecl
1776
2054
  }
1777
2055
  }
1778
2056
 
2057
+ declare namespace Convert_2 {
2058
+ export {
2059
+ languageQualifierTypeConfig,
2060
+ territoryQualifierTypeConfig,
2061
+ literalQualifierTypeConfig,
2062
+ systemLanguageQualifierTypeConfig,
2063
+ systemTerritoryQualifierTypeConfig,
2064
+ systemLiteralQualifierTypeConfig,
2065
+ systemQualifierTypeConfig
2066
+ }
2067
+ }
2068
+
1779
2069
  declare namespace Convert_3 {
2070
+ export {
2071
+ literalValueHierarchyCreateParams,
2072
+ IQualifierTypeConvertContext,
2073
+ qualifierType
2074
+ }
2075
+ }
2076
+
2077
+ declare namespace Convert_4 {
2078
+ export {
2079
+ qualifierDecl,
2080
+ IQualifierDeclConvertContext,
2081
+ validatedQualifierDecl,
2082
+ IQualifierConvertContext,
2083
+ qualifier
2084
+ }
2085
+ }
2086
+
2087
+ declare namespace Convert_5 {
2088
+ export {
2089
+ resourceTypeConfig
2090
+ }
2091
+ }
2092
+
2093
+ declare namespace Convert_6 {
1780
2094
  export {
1781
2095
  compiledConditionMetadata,
1782
2096
  compiledConditionSetMetadata,
@@ -1793,11 +2107,21 @@ declare namespace Convert_3 {
1793
2107
  }
1794
2108
  }
1795
2109
 
1796
- declare namespace Convert_4 {
2110
+ declare namespace Convert_7 {
2111
+ export {
2112
+ contextQualifierValueDecl,
2113
+ contextDecl,
2114
+ IContextDeclConvertContext,
2115
+ validatedContextQualifierValueDecl,
2116
+ validatedContextDecl
2117
+ }
2118
+ }
2119
+
2120
+ declare namespace Convert_8 {
1797
2121
  export {
1798
2122
  looseConditionDecl,
1799
2123
  childConditionDecl,
1800
- conditionSetDecl_2 as conditionSetDecl,
2124
+ conditionSetDecl,
1801
2125
  looseResourceCandidateDecl,
1802
2126
  importerResourceCandidateDecl,
1803
2127
  childResourceCandidateDecl,
@@ -1811,49 +2135,10 @@ declare namespace Convert_4 {
1811
2135
  }
1812
2136
  }
1813
2137
 
1814
- declare namespace Convert_5 {
1815
- export {
1816
- contextQualifierValueDecl,
1817
- contextDecl,
1818
- IContextDeclConvertContext,
1819
- validatedContextQualifierValueDecl,
1820
- validatedContextDecl
1821
- }
1822
- }
1823
-
1824
- declare namespace Convert_6 {
1825
- export {
1826
- languageQualifierTypeConfig,
1827
- territoryQualifierTypeConfig,
1828
- literalQualifierTypeConfig,
1829
- systemLanguageQualifierTypeConfig,
1830
- systemTerritoryQualifierTypeConfig,
1831
- systemLiteralQualifierTypeConfig,
1832
- systemQualifierTypeConfig
1833
- }
1834
- }
1835
-
1836
- declare namespace Convert_7 {
1837
- export {
1838
- literalValueHierarchyCreateParams,
1839
- IQualifierTypeConvertContext,
1840
- qualifierType
1841
- }
1842
- }
1843
-
1844
- declare namespace Convert_8 {
1845
- export {
1846
- qualifierDecl,
1847
- IQualifierDeclConvertContext,
1848
- validatedQualifierDecl,
1849
- IQualifierConvertContext,
1850
- qualifier
1851
- }
1852
- }
1853
-
1854
2138
  declare namespace Convert_9 {
1855
2139
  export {
1856
- resourceTypeConfig
2140
+ systemConfiguration,
2141
+ predefinedSystemConfiguration
1857
2142
  }
1858
2143
  }
1859
2144
 
@@ -1895,7 +2180,7 @@ declare function createResourceTypeFromConfig(config: IResourceTypeConfig): Resu
1895
2180
  * Simple collectible implementation of {@link Decisions.IDecision | IDecision}.
1896
2181
  * @public
1897
2182
  */
1898
- declare class Decision<TVALUE extends JsonValue = JsonValue> implements IDecision<TVALUE> {
2183
+ export declare class Decision<TVALUE extends JsonValue = JsonValue> implements IDecision<TVALUE> {
1899
2184
  /**
1900
2185
  * The sorted {@link Conditions.ConditionSet | ConditionSets} that make up this decision.
1901
2186
  * @public
@@ -2203,6 +2488,14 @@ declare class FsItemImporter implements IImporter {
2203
2488
  */
2204
2489
  declare type FsItemResultDetail = 'failed' | 'skipped' | 'succeeded';
2205
2490
 
2491
+ /**
2492
+ * Gets the name for a resource ID.
2493
+ * @param id - The resource ID to get the name for.
2494
+ * @returns The resource name if found, or undefined if not.
2495
+ * @public
2496
+ */
2497
+ declare function getNameForResourceId(id: string | undefined): Result<ResourceName>;
2498
+
2206
2499
  /**
2207
2500
  * Returns the {@link Config.Model.ISystemConfiguration | system configuration} declaration for the
2208
2501
  * specified predefined system configuration.
@@ -2244,7 +2537,8 @@ declare namespace Helpers {
2244
2537
  IQualifierDefaultValueTokenParts,
2245
2538
  splitResourceId,
2246
2539
  joinResourceIds,
2247
- joinOptionalResourceIds
2540
+ joinOptionalResourceIds,
2541
+ getNameForResourceId
2248
2542
  }
2249
2543
  }
2250
2544
  export { Helpers }
@@ -2283,6 +2577,147 @@ declare interface IAbstractDecisionCreateParams {
2283
2577
  index?: number;
2284
2578
  }
2285
2579
 
2580
+ /**
2581
+ * A complete resource bundle that encapsulates built resources, configuration, and metadata.
2582
+ * Bundles provide a portable, integrity-verified way to distribute pre-compiled resource collections.
2583
+ * @public
2584
+ */
2585
+ declare interface IBundle {
2586
+ /**
2587
+ * Metadata about the bundle including build date and integrity checksum.
2588
+ */
2589
+ metadata: IBundleMetadata;
2590
+ /**
2591
+ * The system configuration that was used to build the resources in this bundle.
2592
+ */
2593
+ config: Model.ISystemConfiguration;
2594
+ /**
2595
+ * The compiled resource collection containing all resources, conditions, and decisions.
2596
+ */
2597
+ compiledCollection: Compiled.ICompiledResourceCollection;
2598
+ /**
2599
+ * Optional export metadata for tracking when and how the bundle was exported.
2600
+ */
2601
+ exportMetadata?: IBundleExportMetadata;
2602
+ }
2603
+
2604
+ /**
2605
+ * Components extracted from a bundle for reuse in different contexts.
2606
+ * @public
2607
+ */
2608
+ declare interface IBundleComponents {
2609
+ /**
2610
+ * The system configuration from the bundle.
2611
+ */
2612
+ systemConfiguration: SystemConfiguration;
2613
+ /**
2614
+ * The compiled resource collection from the bundle.
2615
+ */
2616
+ compiledCollection: Compiled.ICompiledResourceCollection;
2617
+ /**
2618
+ * The bundle metadata including build information.
2619
+ */
2620
+ metadata: IBundleMetadata;
2621
+ }
2622
+
2623
+ /**
2624
+ * Optional parameters for bundle creation.
2625
+ * @public
2626
+ */
2627
+ declare interface IBundleCreateParams {
2628
+ /**
2629
+ * Optional version identifier to include in the bundle metadata.
2630
+ */
2631
+ version?: string;
2632
+ /**
2633
+ * Optional description to include in the bundle metadata.
2634
+ */
2635
+ description?: string;
2636
+ /**
2637
+ * Optional custom build date. If not provided, the current date will be used.
2638
+ */
2639
+ dateBuilt?: string;
2640
+ /**
2641
+ * Optional hash normalizer for generating checksums. If not provided,
2642
+ * a CRC32 normalizer will be used for browser compatibility.
2643
+ */
2644
+ hashNormalizer?: Hash.HashingNormalizer;
2645
+ /**
2646
+ * Whether to normalize the ResourceManagerBuilder before bundle creation.
2647
+ * When true, the builder is reconstructed in canonical order to ensure
2648
+ * order-independent checksums. Defaults to false for Phase 1 compatibility.
2649
+ */
2650
+ normalize?: boolean;
2651
+ }
2652
+
2653
+ /**
2654
+ * Optional export metadata for tracking bundle export information.
2655
+ * @public
2656
+ */
2657
+ declare interface IBundleExportMetadata {
2658
+ /**
2659
+ * ISO timestamp indicating when the bundle was exported.
2660
+ */
2661
+ exportedAt: string;
2662
+ /**
2663
+ * Tool or application that exported the bundle.
2664
+ */
2665
+ exportedFrom: string;
2666
+ /**
2667
+ * Type of bundle export (e.g., 'ts-res-bundle', 'ts-res-bundle-filtered').
2668
+ */
2669
+ type: string;
2670
+ /**
2671
+ * Optional filter context if the bundle represents filtered data.
2672
+ */
2673
+ filterContext?: Record<string, unknown>;
2674
+ }
2675
+
2676
+ /**
2677
+ * Parameters for creating a BundleLoader.
2678
+ * @public
2679
+ */
2680
+ declare interface IBundleLoaderCreateParams {
2681
+ /**
2682
+ * The bundle to load.
2683
+ */
2684
+ bundle: IBundle;
2685
+ /**
2686
+ * Whether to skip checksum verification during loading.
2687
+ * Default is false - checksum verification is performed.
2688
+ */
2689
+ skipChecksumVerification?: boolean;
2690
+ /**
2691
+ * Optional hash normalizer for verifying checksums. If not provided,
2692
+ * a CRC32 normalizer will be used for browser compatibility.
2693
+ * Must match the normalizer used during bundle creation.
2694
+ */
2695
+ hashNormalizer?: Hash.HashingNormalizer;
2696
+ }
2697
+
2698
+ /**
2699
+ * Metadata for a resource bundle, including build information and integrity verification.
2700
+ * @public
2701
+ */
2702
+ declare interface IBundleMetadata {
2703
+ /**
2704
+ * ISO timestamp indicating when the bundle was built.
2705
+ */
2706
+ dateBuilt: string;
2707
+ /**
2708
+ * SHA-256 checksum of the serialized compiled resource collection for integrity verification.
2709
+ */
2710
+ checksum: string;
2711
+ /**
2712
+ * Optional version identifier for the bundle.
2713
+ */
2714
+ version?: string;
2715
+ /**
2716
+ * Optional human-readable description of the bundle.
2717
+ */
2718
+ description?: string;
2719
+ }
2720
+
2286
2721
  /**
2287
2722
  * Cache metrics interface for tracking cache performance.
2288
2723
  * @public
@@ -3784,6 +4219,13 @@ declare interface IQualifierType extends ICollectible<QualifierTypeName, Qualifi
3784
4219
  * details otherwise.
3785
4220
  */
3786
4221
  isValidContextValue(value: string): value is QualifierContextValue;
4222
+ /**
4223
+ * Determines if a supplied condition value is a potential match for a possible context value.
4224
+ * @param conditionValue - The condition value.
4225
+ * @param contextValue - The context value.
4226
+ * @returns `true` if the condition value is a potential match for the context value, `false` otherwise.
4227
+ */
4228
+ isPotentialMatch(conditionValue: string, contextValue: string): boolean;
3787
4229
  /**
3788
4230
  * Validates that a value and optional operator are valid for use in a condition
3789
4231
  * for qualifiers of this type.
@@ -4070,6 +4512,8 @@ declare interface IReducedCandidate {
4070
4512
  declare interface IResource {
4071
4513
  /** The resource identifier */
4072
4514
  readonly id: string;
4515
+ /** The resource name */
4516
+ readonly name: string;
4073
4517
  /** The resource type */
4074
4518
  readonly resourceType: ResourceType;
4075
4519
  /** The decision used to select candidates */
@@ -4130,10 +4574,10 @@ declare interface IResourceCandidateValidationProperties {
4130
4574
  */
4131
4575
  id: ResourceId;
4132
4576
  /**
4133
- * {@inheritdoc ResourceJson.Json.ILooseResourceCandidateDecl.isPartial}
4577
+ * Describes how complete the candidate value is.
4134
4578
  * @public
4135
4579
  */
4136
- isPartial: boolean;
4580
+ completeness: CandidateCompleteness;
4137
4581
  /**
4138
4582
  * {@inheritdoc ResourceJson.Json.ILooseResourceCandidateDecl.json}
4139
4583
  * @public
@@ -4274,7 +4718,7 @@ declare interface IResourceDeclContainer {
4274
4718
  * implementations without requiring the full ResourceManagerBuilder build mechanics.
4275
4719
  * @public
4276
4720
  */
4277
- declare interface IResourceManager {
4721
+ export declare interface IResourceManager<TR extends IResource = IResource> {
4278
4722
  /**
4279
4723
  * A {@link Conditions.ReadOnlyConditionCollector | ReadOnlyConditionCollector} which
4280
4724
  * contains the {@link Conditions.Condition | conditions} used by resource candidates.
@@ -4295,12 +4739,17 @@ declare interface IResourceManager {
4295
4739
  * @param id - The resource identifier
4296
4740
  * @returns Success with the runtime resource if found, Failure otherwise
4297
4741
  */
4298
- getBuiltResource(id: string): Result<IResource>;
4742
+ getBuiltResource(id: string): Result<TR>;
4743
+ /**
4744
+ * Gets a resource tree built from the resources in this resource manager.
4745
+ * @returns Result containing the resource tree root, or failure if tree construction fails
4746
+ */
4747
+ getBuiltResourceTree(): Result<IReadOnlyResourceTreeRoot<TR>>;
4299
4748
  /**
4300
4749
  * A read-only result map of all built resources, keyed by resource ID.
4301
4750
  * Resources are built on-demand when accessed and returns Results for error handling.
4302
4751
  */
4303
- readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId, IResource>;
4752
+ readonly builtResources: Collections.IReadOnlyValidatingResultMap<ResourceId, TR>;
4304
4753
  /**
4305
4754
  * The number of resources in this resource manager.
4306
4755
  */
@@ -4326,6 +4775,19 @@ declare interface IResourceManagerBuilderCreateParams {
4326
4775
  resourceTypes: ReadOnlyResourceTypeCollector;
4327
4776
  }
4328
4777
 
4778
+ /**
4779
+ * Options for ResourceManagerBuilder clone operations.
4780
+ * Extends IDeclarationOptions to include support for applying edits when cloning.
4781
+ * @public
4782
+ */
4783
+ declare interface IResourceManagerCloneOptions extends IResourceDeclarationOptions {
4784
+ /**
4785
+ * Optional array of loose condition declarations to be applied as edits during the clone operation.
4786
+ * These conditions can modify or extend the resource candidates in the cloned manager.
4787
+ */
4788
+ readonly candidates?: ReadonlyArray<ResourceJson.Json.ILooseResourceCandidateDecl>;
4789
+ }
4790
+
4329
4791
  /**
4330
4792
  * A listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.
4331
4793
  * @public
@@ -4349,6 +4811,11 @@ declare interface IResourceResolverCacheListener {
4349
4811
  * @param index - The index of the cache that had an error.
4350
4812
  */
4351
4813
  onCacheError(cache: ResourceResolverCacheType, index: number): void;
4814
+ /**
4815
+ * Called when a context error occurs.
4816
+ * @param error - The error that occurred.
4817
+ */
4818
+ onContextError(qualifier: string, error: string): void;
4352
4819
  /**
4353
4820
  * Called when a cache is cleared.
4354
4821
  * @param cache - The type of cache that was cleared.
@@ -4380,6 +4847,24 @@ declare interface IResourceResolverCreateParams {
4380
4847
  * An optional listener for {@link Runtime.ResourceResolver | ResourceResolver} cache activity.
4381
4848
  */
4382
4849
  listener?: IResourceResolverCacheListener;
4850
+ /**
4851
+ * Optional configuration options for the {@link Runtime.ResourceResolver | ResourceResolver}.
4852
+ */
4853
+ options?: IResourceResolverOptions;
4854
+ }
4855
+
4856
+ /**
4857
+ * Options for configuring a {@link Runtime.ResourceResolver | ResourceResolver}.
4858
+ * @public
4859
+ */
4860
+ declare interface IResourceResolverOptions {
4861
+ /**
4862
+ * Controls whether null values in resource composition should suppress properties
4863
+ * instead of setting them to null. When true, properties with null values from
4864
+ * higher-priority partial candidates will be omitted from the final composed resource.
4865
+ * @defaultValue false
4866
+ */
4867
+ suppressNullAsDelete?: boolean;
4383
4868
  }
4384
4869
 
4385
4870
  /**
@@ -5058,15 +5543,15 @@ declare class JsonResourceType extends ResourceType<JsonObject> {
5058
5543
  /**
5059
5544
  * {@inheritdoc ResourceTypes.ResourceType.(validate:1)}
5060
5545
  */
5061
- validate(json: JsonObject, isPartial: true): Result<JsonObject>;
5546
+ validate(json: JsonObject, completeness: CandidateCompleteness): Result<JsonObject>;
5062
5547
  /**
5063
5548
  * {@inheritdoc ResourceTypes.ResourceType.(validate:2)}
5064
5549
  */
5065
- validate(json: JsonObject, isPartial: false): Result<JsonObject>;
5550
+ validate(json: JsonObject, completeness: 'full'): Result<JsonObject>;
5066
5551
  /**
5067
5552
  * {@inheritdoc ResourceTypes.ResourceType.(validate:3)}
5068
5553
  */
5069
- validate(json: JsonObject, isPartial: boolean): Result<JsonObject>;
5554
+ validate(json: JsonObject, completeness: 'partial'): Result<JsonObject>;
5070
5555
  }
5071
5556
 
5072
5557
  /**
@@ -5139,7 +5624,7 @@ declare class LanguageQualifierType extends QualifierType {
5139
5624
  * @returns A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
5140
5625
  * @public
5141
5626
  */
5142
- declare const languageQualifierTypeConfig: ObjectConverter<Model_3.ILanguageQualifierTypeConfig, unknown>;
5627
+ declare const languageQualifierTypeConfig: ObjectConverter<Model_2.ILanguageQualifierTypeConfig, unknown>;
5143
5628
 
5144
5629
  /**
5145
5630
  * A {@link QualifierTypes.QualifierType | qualifier} that matches a literal value,
@@ -5178,6 +5663,10 @@ declare class LiteralQualifierType extends QualifierType {
5178
5663
  * @returns `true` if the value is a valid condition value, `false` otherwise.
5179
5664
  */
5180
5665
  isValidConditionValue(value: string): value is QualifierConditionValue;
5666
+ /**
5667
+ * {@inheritdoc QualifierTypes.IQualifierType.isPotentialMatch}
5668
+ */
5669
+ isPotentialMatch(conditionValue: string, contextValue: string): boolean;
5181
5670
  /**
5182
5671
  * {@inheritdoc QualifierTypes.QualifierType._matchOne}
5183
5672
  */
@@ -5223,7 +5712,7 @@ declare class LiteralQualifierType extends QualifierType {
5223
5712
  * @returns A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.
5224
5713
  * @public
5225
5714
  */
5226
- declare const literalQualifierTypeConfig: ObjectConverter<Model_3.ILiteralQualifierTypeConfig, unknown>;
5715
+ declare const literalQualifierTypeConfig: ObjectConverter<Model_2.ILiteralQualifierTypeConfig, unknown>;
5227
5716
 
5228
5717
  /**
5229
5718
  * A class that implements a hierarchy of literal values. The hierarchy is defined as a
@@ -5277,6 +5766,13 @@ declare class LiteralValueHierarchy<T extends string = string> {
5277
5766
  * to root, or `Failure` if the value is not in the hierarchy.
5278
5767
  */
5279
5768
  getAncestors(value: T): Result<T[]>;
5769
+ /**
5770
+ * Determines if a value is an ancestor of a possible ancestor value.
5771
+ * @param value - The value to check.
5772
+ * @param possibleAncestor - The possible ancestor value.
5773
+ * @returns `true` if the value is an ancestor of the possible ancestor, `false` otherwise.
5774
+ */
5775
+ isAncestor(value: T, possibleAncestor: T): boolean;
5280
5776
  /**
5281
5777
  * Gets all descendants of a value in the hierarchy.
5282
5778
  * @param value - The value to get descendants for.
@@ -5469,6 +5965,25 @@ declare function mergeLooseResource(resource: Normalized.IImporterResourceDecl,
5469
5965
  export declare const MinConditionPriority: ConditionPriority;
5470
5966
 
5471
5967
  declare namespace Model {
5968
+ export {
5969
+ ISystemConfiguration
5970
+ }
5971
+ }
5972
+
5973
+ declare namespace Model_2 {
5974
+ export {
5975
+ IQualifierTypeConfig,
5976
+ ILanguageQualifierTypeConfig,
5977
+ ITerritoryQualifierTypeConfig,
5978
+ ILiteralQualifierTypeConfig,
5979
+ ISystemLanguageQualifierTypeConfig,
5980
+ ISystemTerritoryQualifierTypeConfig,
5981
+ ISystemLiteralQualifierTypeConfig,
5982
+ ISystemQualifierTypeConfig
5983
+ }
5984
+ }
5985
+
5986
+ declare namespace Model_3 {
5472
5987
  export {
5473
5988
  ICompiledConditionMetadata,
5474
5989
  ICompiledConditionSetMetadata,
@@ -5485,22 +6000,12 @@ declare namespace Model {
5485
6000
  }
5486
6001
  }
5487
6002
 
5488
- declare namespace Model_2 {
6003
+ declare namespace Model_4 {
5489
6004
  export {
5490
- ISystemConfiguration
5491
- }
5492
- }
5493
-
5494
- declare namespace Model_3 {
5495
- export {
5496
- IQualifierTypeConfig,
5497
- ILanguageQualifierTypeConfig,
5498
- ITerritoryQualifierTypeConfig,
5499
- ILiteralQualifierTypeConfig,
5500
- ISystemLanguageQualifierTypeConfig,
5501
- ISystemTerritoryQualifierTypeConfig,
5502
- ISystemLiteralQualifierTypeConfig,
5503
- ISystemQualifierTypeConfig
6005
+ IBundleMetadata,
6006
+ IBundleExportMetadata,
6007
+ IBundle,
6008
+ IBundleCreateParams
5504
6009
  }
5505
6010
  }
5506
6011
 
@@ -5527,6 +6032,10 @@ declare class NoOpResourceResolverCacheListener implements IResourceResolverCach
5527
6032
  * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheError}
5528
6033
  */
5529
6034
  onCacheError(cache: ResourceResolverCacheType, index: number): void;
6035
+ /**
6036
+ * {@inheritDoc Runtime.IResourceResolverCacheListener.onContextError}
6037
+ */
6038
+ onContextError(qualifier: string, error: string): void;
5530
6039
  /**
5531
6040
  * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheClear}
5532
6041
  */
@@ -5674,7 +6183,7 @@ declare const predefinedSystemConfiguration: Converter<PredefinedSystemConfigura
5674
6183
  * which a resource is used.
5675
6184
  * @public
5676
6185
  */
5677
- declare class Qualifier implements IValidatedQualifierDecl, ICollectible<QualifierName, QualifierIndex> {
6186
+ export declare class Qualifier implements IValidatedQualifierDecl, ICollectible<QualifierName, QualifierIndex> {
5678
6187
  /**
5679
6188
  * The name of the qualifier.
5680
6189
  */
@@ -6013,7 +6522,7 @@ declare const qualifierName: Converter<QualifierName, unknown>;
6013
6522
 
6014
6523
  declare namespace Qualifiers {
6015
6524
  export {
6016
- Convert_8 as Convert,
6525
+ Convert_4 as Convert,
6017
6526
  Qualifier,
6018
6527
  IQualifierDecl,
6019
6528
  IValidatedQualifierDecl,
@@ -6034,7 +6543,7 @@ export { Qualifiers }
6034
6543
  * the {@link QualifierTypes.IQualifierType | IQualifierType} interface.
6035
6544
  * @public
6036
6545
  */
6037
- declare abstract class QualifierType implements IQualifierType {
6546
+ export declare abstract class QualifierType implements IQualifierType {
6038
6547
  /**
6039
6548
  * {@inheritdoc QualifierTypes.IQualifierType.name}
6040
6549
  */
@@ -6068,6 +6577,10 @@ declare abstract class QualifierType implements IQualifierType {
6068
6577
  * {@inheritdoc QualifierTypes.IQualifierType.isValidContextValue}
6069
6578
  */
6070
6579
  isValidContextValue(value: string): value is QualifierContextValue;
6580
+ /**
6581
+ * {@inheritdoc QualifierTypes.IQualifierType.isPotentialMatch}
6582
+ */
6583
+ isPotentialMatch(conditionValue: string, contextValue: string): boolean;
6071
6584
  /**
6072
6585
  * {@inheritdoc QualifierTypes.IQualifierType.validateCondition}
6073
6586
  */
@@ -6186,7 +6699,7 @@ declare const qualifierTypeName: Converter<QualifierTypeName, unknown>;
6186
6699
  declare namespace QualifierTypes {
6187
6700
  export {
6188
6701
  Config_2 as Config,
6189
- Convert_7 as Convert,
6702
+ Convert_3 as Convert,
6190
6703
  IQualifierType,
6191
6704
  IQualifierTypeCreateParams,
6192
6705
  QualifierType,
@@ -6383,11 +6896,15 @@ declare namespace RegularExpressions {
6383
6896
  * candidate instances.
6384
6897
  * @public
6385
6898
  */
6386
- declare class Resource implements IResource {
6899
+ export declare class Resource implements IResource {
6387
6900
  /**
6388
6901
  * The unique {@link ResourceId | id} of the resource.
6389
6902
  */
6390
6903
  readonly id: ResourceId;
6904
+ /**
6905
+ * The name of the resource.
6906
+ */
6907
+ readonly name: ResourceName;
6391
6908
  /**
6392
6909
  * The {@link ResourceTypes.ResourceType | type} of the resource.
6393
6910
  */
@@ -6599,7 +7116,7 @@ declare type ResourceBuilderResultDetail = Collections.ResultMapResultDetail | '
6599
7116
  * and instructions on how to merge it with other instances.
6600
7117
  * @public
6601
7118
  */
6602
- declare class ResourceCandidate implements IResourceCandidate {
7119
+ export declare class ResourceCandidate implements IResourceCandidate {
6603
7120
  /**
6604
7121
  * The unique identifier of the resource for which this candidate
6605
7122
  * is a possible instance.
@@ -6626,6 +7143,10 @@ declare class ResourceCandidate implements IResourceCandidate {
6626
7143
  * this candidate belongs.
6627
7144
  */
6628
7145
  readonly resourceType: ResourceType | undefined;
7146
+ /**
7147
+ * The completeness of the candidate value.
7148
+ */
7149
+ get completeness(): CandidateCompleteness;
6629
7150
  /**
6630
7151
  * Constructor for a {@link Resources.ResourceCandidate | ResourceCandidate} object.
6631
7152
  * @param params - Parameters to create a new {@link Resources.ResourceCandidate | ResourceCandidate}.
@@ -6826,7 +7347,7 @@ declare const resourceIndex: Converter<ResourceIndex, unknown>;
6826
7347
  declare namespace ResourceJson {
6827
7348
  export {
6828
7349
  Compiled,
6829
- Convert_4 as Convert,
7350
+ Convert_8 as Convert,
6830
7351
  Helpers_2 as Helpers,
6831
7352
  Json,
6832
7353
  Normalized,
@@ -6844,7 +7365,7 @@ export { ResourceJson }
6844
7365
  * and builds a collection of {@link Resources.Resource | resources} once all candidates are collected.
6845
7366
  * @public
6846
7367
  */
6847
- declare class ResourceManagerBuilder implements IResourceManager {
7368
+ export declare class ResourceManagerBuilder implements IResourceManager<Resource> {
6848
7369
  readonly qualifiers: IReadOnlyQualifierCollector;
6849
7370
  readonly resourceTypes: ReadOnlyResourceTypeCollector;
6850
7371
  protected readonly _conditions: ConditionCollector;
@@ -6853,6 +7374,7 @@ declare class ResourceManagerBuilder implements IResourceManager {
6853
7374
  protected readonly _resources: ValidatingResultMap<ResourceId, ResourceBuilder>;
6854
7375
  readonly _builtResources: ValidatingResultMap<ResourceId, Resource>;
6855
7376
  protected _built: boolean;
7377
+ protected _cachedResourceTree?: ResourceTree.IReadOnlyResourceTreeRoot<Resource>;
6856
7378
  /**
6857
7379
  * A {@link Conditions.ConditionCollector | ConditionCollector} which
6858
7380
  * contains the {@link Conditions.Condition | conditions} used so far by
@@ -6909,6 +7431,26 @@ declare class ResourceManagerBuilder implements IResourceManager {
6909
7431
  * @public
6910
7432
  */
6911
7433
  static create(params: IResourceManagerBuilderCreateParams): Result<ResourceManagerBuilder>;
7434
+ /**
7435
+ * Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object from a predefined system configuration.
7436
+ * @param name - The name of the predefined system configuration to use.
7437
+ * @param qualifierDefaultValues - Optional default values for qualifiers.
7438
+ * @returns `Success` with the new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} object if successful,
7439
+ * or `Failure` with an error message if not.
7440
+ * @public
7441
+ */
7442
+ static createPredefined(name: Config.PredefinedSystemConfiguration, qualifierDefaultValues?: Config.ISystemConfigurationInitParams['qualifierDefaultValues']): Result<ResourceManagerBuilder>;
7443
+ /**
7444
+ * Creates a new {@link Resources.ResourceManagerBuilder | ResourceManagerBuilder} from a
7445
+ * {@link ResourceJson.Compiled.ICompiledResourceCollection | compiled resource collection}.
7446
+ * This method reconstructs an exactly equivalent builder where all qualifier, condition,
7447
+ * condition set, and decision indices match the original compiled collection.
7448
+ * @param compiledCollection - The compiled resource collection to reconstruct from.
7449
+ * @param systemConfig - The system configuration containing qualifiers and resource types.
7450
+ * @returns `Success` with the new manager if successful, or `Failure` with an error message if not.
7451
+ * @public
7452
+ */
7453
+ static createFromCompiledResourceCollection(compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection, systemConfig: Config.SystemConfiguration): Result<ResourceManagerBuilder>;
6912
7454
  /**
6913
7455
  * Given a {@link ResourceJson.Json.ILooseResourceCandidateDecl | resource candidate declaration}, builds and adds
6914
7456
  * a {@link Resources.ResourceCandidate | candidate} to the manager.
@@ -6918,6 +7460,20 @@ declare class ResourceManagerBuilder implements IResourceManager {
6918
7460
  */
6919
7461
  addLooseCandidate(decl: ResourceJson.Json.ILooseResourceCandidateDecl): DetailedResult<ResourceCandidate, ResourceBuilderResultDetail>;
6920
7462
  addResource(decl: ResourceJson.Json.ILooseResourceDecl): DetailedResult<ResourceBuilder, ResourceBuilderResultDetail>;
7463
+ /**
7464
+ * Adds a condition to the manager.
7465
+ * @param decl - The condition declaration to add.
7466
+ * @returns `Success` with the condition if successful, or `Failure` with an error message if not.
7467
+ * @public
7468
+ */
7469
+ addCondition(decl: ResourceJson.Json.ILooseConditionDecl): Result<Condition>;
7470
+ /**
7471
+ * Adds a condition set to the manager.
7472
+ * @param decl - The condition set declaration to add.
7473
+ * @returns `Success` with the condition set if successful, or `Failure` with an error message if not.
7474
+ * @public
7475
+ */
7476
+ addConditionSet(conditions: ResourceJson.Normalized.ConditionSetDecl): Result<ConditionSet>;
6921
7477
  /**
6922
7478
  * Gets a read-only array of all {@link Resources.ResourceBuilder | resource builders} present in the manager.
6923
7479
  * @returns `Success` with the {@link Resources.ResourceBuilder | resource builder} if successful,
@@ -6948,6 +7504,19 @@ declare class ResourceManagerBuilder implements IResourceManager {
6948
7504
  * @public
6949
7505
  */
6950
7506
  getAllBuiltResources(): Result<ReadonlyArray<Resource>>;
7507
+ /**
7508
+ * Builds and returns a hierarchical tree representation of all resources managed by this builder.
7509
+ * Resources are organized based on their dot-separated resource IDs (e.g., "app.messages.welcome"
7510
+ * becomes a tree with "app" as root, "messages" as branch, and "welcome" as leaf).
7511
+ *
7512
+ * String-based validation is available through the `children.validating` property,
7513
+ * allowing callers to use `tree.children.validating.getById(stringId)` for validated access.
7514
+ *
7515
+ * Uses lazy initialization with caching for performance.
7516
+ * @returns Result containing the resource tree root, or failure if tree construction fails
7517
+ * @public
7518
+ */
7519
+ getBuiltResourceTree(): Result<ResourceTree.IReadOnlyResourceTreeRoot<Resource>>;
6951
7520
  /**
6952
7521
  * Gets a read-only array of all {@link Resources.Resource | built resources} in the manager.
6953
7522
  * @returns `Success` with an array of resources if successful, or `Failure` with an error message if not.
@@ -7024,11 +7593,89 @@ declare class ResourceManagerBuilder implements IResourceManager {
7024
7593
  * Creates a filtered clone of this ResourceManagerBuilder using the specified context.
7025
7594
  * This is a convenience method that creates a new ResourceManagerBuilder with the same
7026
7595
  * configuration but filtered to include only candidates that match the provided context.
7027
- * @param options - Options for the cloning operation, including the strongly-typed filterForContext property.
7596
+ * If candidates are provided for editing, they will be applied with collision detection.
7597
+ * @param options - Options for the cloning operation, including the strongly-typed filterForContext property and optional candidates for edits.
7028
7598
  * @returns A Result containing the new filtered ResourceManagerBuilder.
7029
7599
  * @public
7030
7600
  */
7031
- clone(options?: IResourceDeclarationOptions): Result<ResourceManagerBuilder>;
7601
+ clone(options?: IResourceManagerCloneOptions): Result<ResourceManagerBuilder>;
7602
+ /**
7603
+ * Creates a resource ID keyed map from an array of loose resource candidate declarations.
7604
+ * This enables efficient detection of edit collisions by grouping candidates by their target resource.
7605
+ * @param candidates - Array of loose resource candidate declarations to organize
7606
+ * @returns A Result containing a Map where keys are validated ResourceIds and values are arrays of candidates for that resource
7607
+ * @internal
7608
+ */
7609
+ private static _createCandidatesByResourceMap;
7610
+ /**
7611
+ * Generates a proper ConditionSet token for collision detection using the existing ConditionSet.getKeyForDecl method.
7612
+ * @param conditionSet - The condition set to generate a token for
7613
+ * @param conditionCollector - The condition collector needed for validation context
7614
+ * @returns A Result containing the ConditionSet token if successful, or failure if validation fails
7615
+ * @internal
7616
+ */
7617
+ /**
7618
+ * Applies candidate edits to a resource declaration, handling collisions using condition set tokens.
7619
+ * If there's no collision, adds the candidate. If there's a collision, replaces the original candidate with the edit.
7620
+ * @param resourceDecl - The original resource declaration to potentially modify
7621
+ * @param candidatesByResource - Map of resource IDs to arrays of candidate edits
7622
+ * @param conditionCollector - The condition collector needed for generating condition tokens
7623
+ * @returns A Result containing the resource declaration to use (original or modified)
7624
+ * @internal
7625
+ */
7626
+ private static _applyEditsToResourceDeclaration;
7627
+ /**
7628
+ * Creates a new resource declaration from an array of candidate declarations.
7629
+ * This is used when cloning to create new resources that don't exist in the original manager.
7630
+ * @param resourceId - The validated resource ID for the new resource
7631
+ * @param candidates - Array of loose candidate declarations for the new resource
7632
+ * @param conditionCollector - The condition collector for validation context
7633
+ * @returns A Result containing the new resource declaration if successful, or failure if validation fails
7634
+ * @internal
7635
+ */
7636
+ private static _createResourceDeclFromCandidates;
7637
+ /**
7638
+ * Reconstructs conditions from a compiled collection and adds them to the builder.
7639
+ * @param builder - The builder to add conditions to.
7640
+ * @param compiledCollection - The compiled collection containing conditions.
7641
+ * @returns `Success` if all conditions were added successfully, `Failure` otherwise.
7642
+ * @internal
7643
+ */
7644
+ private static _reconstructConditions;
7645
+ /**
7646
+ * Reconstructs condition sets from a compiled collection and adds them to the builder.
7647
+ * @param builder - The builder to add condition sets to.
7648
+ * @param compiledCollection - The compiled collection containing condition sets.
7649
+ * @returns `Success` if all condition sets were added successfully, `Failure` otherwise.
7650
+ * @internal
7651
+ */
7652
+ private static _reconstructConditionSets;
7653
+ /**
7654
+ * Reconstructs decisions from a compiled collection and adds them to the builder.
7655
+ * @param builder - The builder to add decisions to.
7656
+ * @param compiledCollection - The compiled collection containing decisions.
7657
+ * @returns `Success` if all decisions were added successfully, `Failure` otherwise.
7658
+ * @internal
7659
+ */
7660
+ private static _reconstructDecisions;
7661
+ /**
7662
+ * Reconstructs resources and their candidates from a compiled collection and adds them to the builder.
7663
+ * @param builder - The builder to add resources to.
7664
+ * @param compiledCollection - The compiled collection containing resources.
7665
+ * @returns `Success` if all resources were added successfully, `Failure` otherwise.
7666
+ * @internal
7667
+ */
7668
+ private static _reconstructResources;
7669
+ /**
7670
+ * Helper method to create candidates from a decision's condition sets.
7671
+ * @param compiledResource - The compiled resource containing candidates.
7672
+ * @param decision - The decision containing condition sets.
7673
+ * @param resourceType - The resource type for the candidates.
7674
+ * @param builder - The builder to add candidates to.
7675
+ * @returns `Success` if all candidates were added successfully, `Failure` otherwise.
7676
+ * @internal
7677
+ */
7678
+ private static _createCandidatesFromDecision;
7032
7679
  }
7033
7680
 
7034
7681
  /**
@@ -7055,7 +7702,7 @@ declare const resourceName: Converter<ResourceName, unknown>;
7055
7702
  * and caching results for optimal performance.
7056
7703
  * @public
7057
7704
  */
7058
- declare class ResourceResolver {
7705
+ export declare class ResourceResolver {
7059
7706
  /**
7060
7707
  * The resource manager that defines available resources and provides condition access.
7061
7708
  */
@@ -7068,6 +7715,10 @@ declare class ResourceResolver {
7068
7715
  * The context qualifier provider that resolves qualifier values.
7069
7716
  */
7070
7717
  readonly contextQualifierProvider: IContextQualifierProvider;
7718
+ /**
7719
+ * The configuration options for this resource resolver.
7720
+ */
7721
+ readonly options: IResourceResolverOptions;
7071
7722
  /**
7072
7723
  * The cache array for resolved conditions, indexed by condition index for O(1) lookup.
7073
7724
  * Each entry stores the resolved {@link Runtime.IConditionMatchResult | condition match result} for
@@ -7211,6 +7862,8 @@ declare type ResourceResolverCacheActivity = 'hit' | 'miss' | 'error' | 'clear';
7211
7862
  */
7212
7863
  declare class ResourceResolverCacheMetricsListener<TM extends ICacheMetrics> implements IResourceResolverCacheListener {
7213
7864
  private readonly _metrics;
7865
+ private _contextErrors;
7866
+ get numContextErrors(): number;
7214
7867
  constructor(factory: () => TM);
7215
7868
  constructor(metrics: OverallCacheMetrics<TM>);
7216
7869
  /**
@@ -7230,6 +7883,10 @@ declare class ResourceResolverCacheMetricsListener<TM extends ICacheMetrics> imp
7230
7883
  * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheError}
7231
7884
  */
7232
7885
  onCacheError(cache: ResourceResolverCacheType, index: number): void;
7886
+ /**
7887
+ * {@inheritDoc Runtime.IResourceResolverCacheListener.onContextError}
7888
+ */
7889
+ onContextError(qualifier: string, error: string): void;
7233
7890
  /**
7234
7891
  * {@inheritDoc Runtime.IResourceResolverCacheListener.onCacheClear}
7235
7892
  */
@@ -7264,7 +7921,8 @@ declare namespace Resources {
7264
7921
  ResourceManagerBuilderResultDetail,
7265
7922
  ResourceManagerBuilder,
7266
7923
  IResourceDeclarationOptions,
7267
- ICompiledResourceOptionsWithFilter
7924
+ ICompiledResourceOptionsWithFilter,
7925
+ IResourceManagerCloneOptions
7268
7926
  }
7269
7927
  }
7270
7928
  export { Resources }
@@ -7412,7 +8070,7 @@ declare const resourceTreeRootDecl: Converter<Normalized.IResourceTreeRootDecl>;
7412
8070
  * resource value.
7413
8071
  * @public
7414
8072
  */
7415
- declare abstract class ResourceType<T = unknown> implements ICollectible<ResourceTypeName, ResourceTypeIndex> {
8073
+ export declare abstract class ResourceType<T = unknown> implements ICollectible<ResourceTypeName, ResourceTypeIndex> {
7416
8074
  private _collectible;
7417
8075
  /**
7418
8076
  * The key for this resource type.
@@ -7435,30 +8093,39 @@ declare abstract class ResourceType<T = unknown> implements ICollectible<Resourc
7435
8093
  /**
7436
8094
  * Validates a JSON value for use as a partial resource instance value.
7437
8095
  * @param json - The JSON value to validate.
7438
- * @param isPartial - `true` indicates that the value is expected to be partial.
8096
+ * @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
7439
8097
  * @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
7440
8098
  * `Failure` with an error message otherwise.
7441
8099
  * @public
7442
8100
  */
7443
- abstract validate(json: JsonValue, isPartial: true): Result<Partial<T>>;
8101
+ abstract validate(json: JsonValue, completeness: CandidateCompleteness): Result<Partial<T>>;
7444
8102
  /**
7445
8103
  * Validates a JSON value for use as a complete resource instance value.
7446
8104
  * @param json - The JSON value to validate.
7447
- * @param isPartial - `false` indicates that the value is expected to be complete.
8105
+ * @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
7448
8106
  * @returns `Success` with the strongly-typed resource value if the JSON is valid,
7449
8107
  * `Failure` with an error message otherwise.
7450
8108
  * @public
7451
8109
  */
7452
- abstract validate(json: JsonValue, isPartial: false): Result<T>;
8110
+ abstract validate(json: JsonValue, completeness: 'full'): Result<T>;
8111
+ /**
8112
+ * Validates a JSON value for use as a partial resource instance value.
8113
+ * @param json - The JSON value to validate.
8114
+ * @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
8115
+ * @returns `Success` with the strongly-typed partial resource value if the JSON is valid,
8116
+ * `Failure` with an error message otherwise.
8117
+ * @public
8118
+ */
8119
+ abstract validate(json: JsonValue, completeness: 'partial'): Result<Partial<T>>;
7453
8120
  /**
7454
8121
  * Validates a JSON value for use as a full or partial resource instance value.
7455
8122
  * @param json - The JSON value to validate.
7456
- * @param isPartial - Indicates whether the value is expected to be partial.
8123
+ * @param completeness - Describes {@link CandidateCompleteness | how complete} the candidate value is.
7457
8124
  * @returns `Success` with the strongly-typed full or partial resource value if
7458
8125
  * the JSON is valid, `Failure` with an error message otherwise.
7459
8126
  * @public
7460
8127
  */
7461
- abstract validate(json: JsonValue, isPartial?: boolean): Result<T | Partial<T>>;
8128
+ abstract validate(json: JsonValue, completeness?: CandidateCompleteness): Result<T | Partial<T>>;
7462
8129
  /**
7463
8130
  * Sets the index for this resource type. Once set, the index cannot be changed.
7464
8131
  */
@@ -7556,6 +8223,7 @@ declare namespace Runtime {
7556
8223
  IValidatingSimpleContextQualifierProviderCreateParams,
7557
8224
  ValidatingSimpleContextQualifierProvider,
7558
8225
  DecisionResolutionResult,
8226
+ IResourceResolverOptions,
7559
8227
  IResourceResolverCreateParams,
7560
8228
  ResourceResolver,
7561
8229
  ConditionMatchType,
@@ -7747,28 +8415,28 @@ declare const systemConfiguration: ObjectConverter<ISystemConfiguration, unknown
7747
8415
  * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
7748
8416
  * @public
7749
8417
  */
7750
- declare const systemLanguageQualifierTypeConfig: ObjectConverter<Model_3.ISystemLanguageQualifierTypeConfig, unknown>;
8418
+ declare const systemLanguageQualifierTypeConfig: ObjectConverter<Model_2.ISystemLanguageQualifierTypeConfig, unknown>;
7751
8419
 
7752
8420
  /**
7753
8421
  * A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
7754
8422
  * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
7755
8423
  * @public
7756
8424
  */
7757
- declare const systemLiteralQualifierTypeConfig: ObjectConverter<Model_3.ISystemLiteralQualifierTypeConfig, unknown>;
8425
+ declare const systemLiteralQualifierTypeConfig: ObjectConverter<Model_2.ISystemLiteralQualifierTypeConfig, unknown>;
7758
8426
 
7759
8427
  /**
7760
8428
  * A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
7761
8429
  * @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
7762
8430
  * @public
7763
8431
  */
7764
- declare const systemQualifierTypeConfig: Converter<Model_3.ISystemQualifierTypeConfig, unknown>;
8432
+ declare const systemQualifierTypeConfig: Converter<Model_2.ISystemQualifierTypeConfig, unknown>;
7765
8433
 
7766
8434
  /**
7767
8435
  * A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
7768
8436
  * @returns A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
7769
8437
  * @public
7770
8438
  */
7771
- declare const systemTerritoryQualifierTypeConfig: ObjectConverter<Model_3.ISystemTerritoryQualifierTypeConfig, unknown>;
8439
+ declare const systemTerritoryQualifierTypeConfig: ObjectConverter<Model_2.ISystemTerritoryQualifierTypeConfig, unknown>;
7772
8440
 
7773
8441
  /**
7774
8442
  * @internal
@@ -7871,7 +8539,7 @@ declare class TerritoryQualifierType extends QualifierType {
7871
8539
  * @returns A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.
7872
8540
  * @public
7873
8541
  */
7874
- declare const territoryQualifierTypeConfig: ObjectConverter<Model_3.ITerritoryQualifierTypeConfig, unknown>;
8542
+ declare const territoryQualifierTypeConfig: ObjectConverter<Model_2.ITerritoryQualifierTypeConfig, unknown>;
7875
8543
 
7876
8544
  /**
7877
8545
  * Converts a number to a {@link ConditionIndex} if it is a valid condition index.