@boundaries/elements 1.2.0 → 2.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,14 @@
2
2
  * Type representing a micromatch pattern, which can be a string or an array of strings.
3
3
  */
4
4
  type MicromatchPattern = string | string[];
5
+ /**
6
+ * Type representing a micromatch pattern supporting null values
7
+ */
8
+ type MicromatchPatternNullable = string | null | (string | null)[];
9
+ /**
10
+ * Type representing values that can be matched against micromatch patterns.
11
+ */
12
+ type MicromatchMatchableValue = string | string[] | null | undefined | boolean;
5
13
  /**
6
14
  * Configuration options for categorizing dependencies as external or local.
7
15
  */
@@ -150,14 +158,17 @@ type ElementDescriptor = ElementDescriptorWithType | ElementDescriptorWithCatego
150
158
  * Array of element descriptors.
151
159
  */
152
160
  type ElementDescriptors = ElementDescriptor[];
161
+ type ElementDescriptionWithSource = ElementDescription & {
162
+ module?: string | null;
163
+ };
153
164
  /**
154
165
  * Serialized cache of element descriptions.
155
166
  */
156
- type DescriptionsSerializedCache = Record<string, ElementDescription>;
167
+ type DescriptionsSerializedCache = Record<string, ElementDescription | ElementDescriptionWithSource>;
157
168
  /**
158
169
  * Serialized cache of file elements.
159
170
  */
160
- type FileElementsSerializedCache = Record<string, FileElement>;
171
+ type FileElementsSerializedCache = Record<string, ElementDescription>;
161
172
  /**
162
173
  * Serialized cache for ElementsDescriptor class.
163
174
  */
@@ -189,17 +200,13 @@ type ElementOrigin = (typeof ELEMENT_ORIGINS_MAP)[keyof typeof ELEMENT_ORIGINS_M
189
200
  /**
190
201
  * Base element properties related to captured values
191
202
  */
192
- type BaseElement = {
203
+ type BaseElementDescription = {
193
204
  /** Absolute path of the file. It might be null when a dependency path can't be resolved */
194
205
  path: string | null;
195
206
  /** Path of the file relative to the element, or null if the element is ignored or unknown */
196
207
  elementPath: string | null;
197
208
  /** Internal path of the file relative to the elementPath, or null if the element is ignored or unknown */
198
209
  internalPath: string | null;
199
- /** Source of the element when it is a dependency, or null if the element is not a dependency, or it is ignored or unknown */
200
- source: string | null;
201
- /** Base source of the element when it is an external or core dependency, null otherwise */
202
- baseSource: string | null;
203
210
  /** Type of the element, or null if the element is ignored or unknown */
204
211
  type: string | null;
205
212
  /** Category of the element, or null if the element is ignored or unknown */
@@ -231,7 +238,7 @@ type ElementParent = {
231
238
  /**
232
239
  * Description of an ignored element
233
240
  */
234
- type IgnoredElement = BaseElement & {
241
+ type IgnoredElement = BaseElementDescription & {
235
242
  /** Type of the element */
236
243
  type: null;
237
244
  /** Category of the element */
@@ -248,7 +255,7 @@ type IgnoredElement = BaseElement & {
248
255
  /**
249
256
  * Description of an unknown local element
250
257
  */
251
- type LocalElementUnknown = BaseElement & {
258
+ type LocalElementUnknown = BaseElementDescription & {
252
259
  /** Type of the element */
253
260
  type: null;
254
261
  /** Category of the element */
@@ -265,7 +272,7 @@ type LocalElementUnknown = BaseElement & {
265
272
  /**
266
273
  * Description of a local element (file)
267
274
  */
268
- type LocalElementKnown = BaseElement & {
275
+ type LocalElementKnown = BaseElementDescription & {
269
276
  /** Path of the element */
270
277
  path: string;
271
278
  /** Captured values from the parent element */
@@ -284,65 +291,23 @@ type LocalElementKnown = BaseElement & {
284
291
  isUnknown: false;
285
292
  };
286
293
  /**
287
- * Base description of a dependency
288
- */
289
- type BaseDependencyElement = BaseElement & {
290
- /** Dependency source */
291
- source: string;
292
- /** Indicates that dependencies are not ignored */
293
- isIgnored: false;
294
- };
295
- /**
296
- * Description of a local dependency (known)
297
- */
298
- type LocalDependencyElementKnown = LocalElementKnown & BaseDependencyElement;
299
- /**
300
- * Description of a local dependency (unknown)
294
+ * Description of an unknown external element.
301
295
  */
302
- type LocalDependencyElementUnknown = LocalElementUnknown & BaseDependencyElement;
303
- /**
304
- * Description of a local dependency
305
- */
306
- type LocalDependencyElement = LocalDependencyElementKnown | LocalDependencyElementUnknown;
307
- /**
308
- * Description of an external dependency
309
- */
310
- type ExternalDependencyElement = BaseDependencyElement & {
311
- /** Path of the dependency relative to the base module */
312
- internalPath: string;
313
- /** Base module of the external dependency */
314
- baseSource: string;
315
- /** Indicates that the dependency is external */
296
+ type ExternalElementDescription = BaseElementDescription & {
316
297
  origin: typeof ELEMENT_ORIGINS_MAP.EXTERNAL;
298
+ isIgnored: false;
317
299
  };
318
300
  /**
319
- * Description of a core dependency
301
+ * Description of an unknown core element.
320
302
  */
321
- type CoreDependencyElement = BaseDependencyElement & {
322
- /** Base module of the core dependency */
323
- baseSource: string;
324
- /** Indicates that the dependency is core */
303
+ type CoreElementDescription = BaseElementDescription & {
325
304
  origin: typeof ELEMENT_ORIGINS_MAP.CORE;
305
+ isIgnored: false;
326
306
  };
327
- /**
328
- * Description of an ignored dependency element
329
- */
330
- type IgnoredDependencyElement = IgnoredElement & {
331
- /** The source of the dependency */
332
- source: string;
333
- };
334
- /**
335
- * Description of a file
336
- */
337
- type FileElement = IgnoredElement | LocalElementKnown | LocalElementUnknown;
338
- /**
339
- * Description of a dependency
340
- */
341
- type DependencyElementDescription = IgnoredDependencyElement | CoreDependencyElement | LocalDependencyElement | ExternalDependencyElement;
342
307
  /**
343
308
  * Description of an element, either local or dependency
344
309
  */
345
- type ElementDescription = FileElement | DependencyElementDescription;
310
+ type ElementDescription = LocalElementKnown | LocalElementUnknown | IgnoredElement | ExternalElementDescription | CoreElementDescription;
346
311
 
347
312
  /**
348
313
  * Determines if the given value is a valid element descriptor mode.
@@ -385,7 +350,7 @@ declare function isElementDescriptor(value: unknown): value is ElementDescriptor
385
350
  * @param value The value to check
386
351
  * @returns True if the value is a valid BaseElement, false otherwise
387
352
  */
388
- declare function isBaseElement(value: unknown): value is BaseElement;
353
+ declare function isBaseElement(value: unknown): value is BaseElementDescription;
389
354
  /**
390
355
  * Determines if the given value is an ignored element.
391
356
  * @param value The element to check.
@@ -410,36 +375,30 @@ declare function isUnknownLocalElement(value: unknown): value is LocalElementUnk
410
375
  * @returns True if the element is an unknown element, false otherwise.
411
376
  */
412
377
  declare function isKnownLocalElement(value: unknown): value is LocalElementKnown;
413
- /**
414
- * Determines if the given value is a dependency element.
415
- * @param value The element to check.
416
- * @returns True if the element is a dependency element, false otherwise.
417
- */
418
- declare function isDependencyElementDescription(value: unknown): value is DependencyElementDescription;
419
- /**
420
- * Determines if the given value is an element (local or dependency).
421
- * @param value The value to check.
422
- * @returns True if the value is an element, false otherwise.
423
- */
424
- declare function isElementDescription(value: unknown): value is ElementDescription;
425
378
  /**
426
379
  * Determines if the given value is a local dependency element.
427
380
  * @param value The value to check.
428
381
  * @returns True if the element is a local dependency element, false otherwise.
429
382
  */
430
- declare function isLocalDependencyElement(value: unknown): value is LocalDependencyElement;
383
+ declare function isLocalDependencyElement(value: unknown): value is LocalElementKnown | LocalElementUnknown;
431
384
  /**
432
385
  * Determines if the given value is an external element.
433
386
  * @param value The value to check.
434
387
  * @returns True if the element is an external dependency element, false otherwise.
435
388
  */
436
- declare function isExternalDependencyElement(value: unknown): value is ExternalDependencyElement;
389
+ declare function isExternalDependencyElement(value: unknown): value is ElementDescription;
437
390
  /**
438
391
  * Determines if the given value is a core element.
439
392
  * @param value The value to check.
440
393
  * @returns True if the element is a core dependency element, false otherwise.
441
394
  */
442
- declare function isCoreDependencyElement(value: unknown): value is CoreDependencyElement;
395
+ declare function isCoreDependencyElement(value: unknown): value is ElementDescription;
396
+ /**
397
+ * Determines if the given value is an element (local or dependency).
398
+ * @param value The value to check.
399
+ * @returns True if the value is an element, false otherwise.
400
+ */
401
+ declare function isElementDescription(value: unknown): value is ElementDescription;
443
402
 
444
403
  declare const DEPENDENCY_KIND_TYPE: "type";
445
404
  declare const DEPENDENCY_KIND_VALUE: "value";
@@ -488,6 +447,10 @@ declare const DEPENDENCY_RELATIONSHIPS_INVERTED_MAP: {
488
447
  type DependencyRelationship = (typeof DEPENDENCY_RELATIONSHIPS_MAP)[keyof typeof DEPENDENCY_RELATIONSHIPS_MAP];
489
448
  /** Information about a dependency between two elements */
490
449
  type ElementsDependencyInfo = {
450
+ /** Source of the dependency (import/export path) */
451
+ source: string;
452
+ /** Base source of the dependency for external/core modules */
453
+ module: string | null;
491
454
  /** Kind of the dependency */
492
455
  kind: DependencyKind;
493
456
  /** Type of the node creating the dependency in the dependent element */
@@ -507,9 +470,9 @@ type ElementsDependencyInfo = {
507
470
  */
508
471
  type DependencyDescription = {
509
472
  /** Source element of the dependency */
510
- from: FileElement;
473
+ from: ElementDescription;
511
474
  /** Target element of the dependency */
512
- to: DependencyElementDescription;
475
+ to: ElementDescription;
513
476
  /** Information about the dependency */
514
477
  dependency: ElementsDependencyInfo;
515
478
  };
@@ -585,16 +548,18 @@ type DescriptorsSerializedCache = {
585
548
  */
586
549
  type DependencyMatchResult = {
587
550
  /** The selector matching result for the 'from' element. */
588
- from: ElementSelectorData | null;
551
+ from: BaseElementSelectorData | null;
589
552
  /** The selector matching result for the 'to' element. */
590
- to: ElementSelectorData | null;
553
+ to: BaseElementSelectorData | null;
554
+ /** The selector matching result for the dependency metadata. */
555
+ dependency: DependencyDataSelectorData | null;
591
556
  /** Whether the dependency matches all the selector properties provided */
592
557
  isMatch: boolean;
593
558
  };
594
559
  /**
595
560
  * Serialized cache of elements matcher.
596
561
  */
597
- type ElementsMatcherSerializedCache = Record<string, ElementSelectorData | null>;
562
+ type ElementsMatcherSerializedCache = Record<string, BaseElementSelectorData | null>;
598
563
  /**
599
564
  * Serialized cache of dependencies matcher.
600
565
  */
@@ -615,34 +580,36 @@ type MicromatchSerializedCache = {
615
580
  /**
616
581
  * Elements that can return a match when using an element selector.
617
582
  */
618
- type SelectableElement = IgnoredElement | LocalElementKnown | LocalElementUnknown | CoreDependencyElement | ExternalDependencyElement | LocalDependencyElementKnown;
583
+ type SelectableElement = ElementDescription;
619
584
  /**
620
585
  * Selector for matching captured values in element selectors.
621
586
  * It is a record where the keys are the names of the captured values and the values are the patterns to match on those captured values.
587
+ * When provided as an array, each element in the array represents an alternative (OR logic) - the selector matches if any of the array elements matches.
622
588
  */
623
- type CapturedValuesSelector = Record<string, MicromatchPattern>;
589
+ type CapturedValuesSelector = Record<string, MicromatchPatternNullable> | Array<Record<string, MicromatchPatternNullable>>;
624
590
  /**
625
- * Data to pass to selector templates when they are rendered before matching.
591
+ * Selector for matching the first parent element.
626
592
  */
627
- type TemplateData = Record<string, unknown>;
593
+ type ParentElementSelectorData = {
594
+ /** Type of the first parent element */
595
+ type?: MicromatchPatternNullable;
596
+ /** Category of the first parent element */
597
+ category?: MicromatchPatternNullable;
598
+ /** Path of the first parent element */
599
+ elementPath?: MicromatchPatternNullable;
600
+ /** Captured values from the first parent element */
601
+ captured?: CapturedValuesSelector;
602
+ };
628
603
  /**
629
- * Options for elements and dependencies matchers.
604
+ * Data to pass to selector templates when they are rendered before matching.
630
605
  */
631
- type MatcherOptionsDependencySelectorsGlobals = {
632
- /** The kind of the dependency */
633
- kind?: MicromatchPattern;
634
- };
606
+ type TemplateData = Record<string, unknown>;
635
607
  /**
636
608
  * Options for elements and dependencies matchers.
637
609
  */
638
610
  type MatcherOptions = {
639
611
  /** Extra data to pass to captured values templates. By default, data from the element and dependency being matched is passed as to/from. */
640
612
  extraTemplateData?: TemplateData;
641
- /**
642
- * Properties to add to all dependency selectors used in the matcher. Added for backwards compatibility, because eslint-plugin rules defined importKind at the top level of the rule options.
643
- * @deprecated Use 'kind' property directly in the dependency element selectors instead.
644
- **/
645
- dependencySelectorsGlobals?: MatcherOptionsDependencySelectorsGlobals;
646
613
  };
647
614
  /**
648
615
  * Simple element selector by type, represented as a string matching the element type.
@@ -654,40 +621,47 @@ type SimpleElementSelectorByType = string;
654
621
  */
655
622
  type BaseElementSelectorData = {
656
623
  /** Micromatch pattern(s) to match the path of the element */
657
- path?: MicromatchPattern;
624
+ path?: MicromatchPatternNullable;
658
625
  /** Micromatch pattern(s) to match the path of the element containing the file */
659
- elementPath?: MicromatchPattern;
626
+ elementPath?: MicromatchPatternNullable;
660
627
  /** Micromatch pattern(s) to match internal paths within the file or dependency, relative to the element path */
661
- internalPath?: MicromatchPattern;
628
+ internalPath?: MicromatchPatternNullable;
662
629
  /** Type of the element */
663
- type?: MicromatchPattern;
630
+ type?: MicromatchPatternNullable;
664
631
  /** Category of the element */
665
- category?: MicromatchPattern;
632
+ category?: MicromatchPatternNullable;
666
633
  /** Captured values selector for dynamic matching */
667
634
  captured?: CapturedValuesSelector;
635
+ /** Selector for matching the first parent element */
636
+ parent?: ParentElementSelectorData | null;
668
637
  /** Origin of the element */
669
- origin?: MicromatchPattern;
670
- /** Micromatch pattern(s) to match the source of the dependency */
671
- source?: MicromatchPattern;
672
- /** Base source of the element, e.g., the import path of a dependency */
673
- baseSource?: MicromatchPattern;
638
+ origin?: MicromatchPatternNullable;
674
639
  /** Whether the element is ignored */
675
640
  isIgnored?: boolean;
676
641
  /** Whether the element is unknown */
677
642
  isUnknown?: boolean;
678
643
  };
679
644
  /**
680
- * Selector for dependency elements, including kind, specifier, and node kind filters.
645
+ * Selector for dependency metadata.
681
646
  */
682
- type DependencyElementSelectorData = BaseElementSelectorData & {
683
- /** Relationship of the file element with the dependency declared in it */
684
- relationship?: MicromatchPattern;
647
+ type DependencyDataSelectorData = {
648
+ /** Relationship between both elements, from both perspectives */
649
+ relationship?: {
650
+ /** Relationship from dependant element perspective */
651
+ from?: MicromatchPatternNullable;
652
+ /** Relationship from dependency element perspective */
653
+ to?: MicromatchPatternNullable;
654
+ };
685
655
  /** Dependency kind to filter elements */
686
- kind?: MicromatchPattern;
656
+ kind?: MicromatchPatternNullable;
687
657
  /** Micromatch pattern(s) to match only specific imports/exports */
688
- specifiers?: MicromatchPattern;
658
+ specifiers?: MicromatchPatternNullable;
689
659
  /** Node kind to filter elements */
690
- nodeKind?: MicromatchPattern;
660
+ nodeKind?: MicromatchPatternNullable;
661
+ /** Dependency source used in import/export statements */
662
+ source?: MicromatchPatternNullable;
663
+ /** Base source of the dependency for external/core modules */
664
+ module?: MicromatchPatternNullable;
691
665
  };
692
666
  /**
693
667
  * File Element selector with options, including captured values for dynamic matching.
@@ -699,32 +673,16 @@ type BaseElementSelectorWithOptions = [
699
673
  SimpleElementSelectorByType,
700
674
  CapturedValuesSelector
701
675
  ];
702
- /**
703
- * Dependency Element selector with options, including captured values for dynamic matching.
704
- * It is represented as a tuple where the first element is the element type (string)
705
- * and the second element is an object containing a selector for captured values.
706
- * @deprecated Use DependencyElementSelectorData defining an object with type and/or category and the rest of properties directly instead.
707
- */
708
- type DependencyElementSelectorWithOptions = [
709
- SimpleElementSelectorByType,
710
- CapturedValuesSelector
711
- ];
712
676
  /**
713
677
  * Base Element selector, which can be a simple string, object with type and/or category, or a base element selector with options.
714
678
  */
715
679
  type BaseElementSelector = SimpleElementSelectorByType | BaseElementSelectorData | BaseElementSelectorWithOptions;
716
680
  /**
717
- * Dependency Element selector, which can be a simple string, object with type and/or category, or a dependency element selector with options.
681
+ * Base elements selector, which can be a single base element selector or an array of base element selectors.
718
682
  */
719
- type DependencyElementSelector = SimpleElementSelectorByType | DependencyElementSelectorData | DependencyElementSelectorWithOptions;
720
- /** Base elements selector, which can be a single base element selector or an array of base element selectors. */
721
683
  type BaseElementsSelector = BaseElementSelector | BaseElementSelector[];
722
- /** Dependency elements selector, which can be a single dependency element selector or an array of dependency element selectors. */
723
- type DependencyElementsSelector = DependencyElementSelector | DependencyElementSelector[];
724
- /**
725
- * Element selector data, which may be a base element selector or a dependency element selector.
726
- */
727
- type ElementSelectorData = BaseElementSelectorData | DependencyElementSelectorData;
684
+ /** Dependency metadata selector, which can be a single selector or an array of selectors. */
685
+ type DependencyDataSelector = DependencyDataSelectorData | DependencyDataSelectorData[];
728
686
  /**
729
687
  * Generic Element selector with options, including captured values for dynamic matching.
730
688
  * It is represented as a tuple where the first element is the element type (string)
@@ -738,11 +696,11 @@ type ElementSelectorWithOptions = [
738
696
  /**
739
697
  * Element selector, which can be a simple string, object with type and/or category, or an element selector with options.
740
698
  */
741
- type ElementSelector = SimpleElementSelectorByType | ElementSelectorData | ElementSelectorWithOptions;
699
+ type ElementSelector = SimpleElementSelectorByType | BaseElementSelectorData | ElementSelectorWithOptions;
742
700
  /**
743
701
  * Elements selector, which can be a single element selector or an array of element selectors.
744
702
  */
745
- type ElementsSelector = BaseElementsSelector | DependencyElementsSelector;
703
+ type ElementsSelector = BaseElementsSelector;
746
704
  /**
747
705
  * Element selectors, which can be a single element selector or an array of element selectors.
748
706
  * @deprecated Use ElementsSelector instead.
@@ -755,7 +713,9 @@ type DependencySelector = {
755
713
  /** Selector for the dependant elements. The file originating the dependency */
756
714
  from?: BaseElementsSelector;
757
715
  /** Selector for the dependency elements. The element being imported/exported */
758
- to?: DependencyElementsSelector;
716
+ to?: BaseElementsSelector;
717
+ /** Selector for dependency metadata */
718
+ dependency?: DependencyDataSelector;
759
719
  };
760
720
  /**
761
721
  * Normalized dependency selector, where 'from' and 'to' are always arrays or null.
@@ -764,40 +724,14 @@ type DependencySelectorNormalized = {
764
724
  /** Selector for the dependant elements. The file originating the dependency */
765
725
  from: BaseElementSelectorData[] | null;
766
726
  /** Selector for the dependency elements. The element being imported/exported */
767
- to: DependencyElementSelectorData[] | null;
727
+ to: BaseElementSelectorData[] | null;
728
+ /** Selector for dependency metadata */
729
+ dependency: DependencyDataSelectorData[] | null;
768
730
  };
769
731
  /**
770
- * Options for selecting external libraries, including path patterns and optional specifiers.
771
- * If specifiers are provided, they will be used to match specific imports from the external library.
732
+ * @deprecated Use DependencySelectorDependencyData instead.
772
733
  */
773
- type ExternalLibrarySelectorOptions = {
774
- /**
775
- * Micromatch pattern(s) to match only one or more specific subpaths of the external library.
776
- */
777
- path?: MicromatchPattern;
778
- /** Micromatch pattern(s) to match only specific imports/exports */
779
- specifiers?: string[];
780
- };
781
- /**
782
- * External library selector with options, represented as a tuple where the first element is the import path of the external library, and the second element is an object containing options for selecting only specific paths or specifiers from that library.
783
- */
784
- type ExternalLibrarySelectorWithOptions = [
785
- SimpleElementSelectorByType,
786
- ExternalLibrarySelectorOptions
787
- ];
788
- /**
789
- * External library selector, which can be a simple string (the import path) or an external library selector with options.
790
- */
791
- type ExternalLibrarySelector = SimpleElementSelectorByType | ExternalLibrarySelectorWithOptions;
792
- /**
793
- * External library selectors, which can be a single external library selector or an array of external library selectors.
794
- * @deprecated Use ExternalLibrariesSelector instead.
795
- */
796
- type ExternalLibrarySelectors = ExternalLibrariesSelector;
797
- /**
798
- * External libraries selector, which can be a single external library selector or an array of external library selectors.
799
- */
800
- type ExternalLibrariesSelector = ExternalLibrarySelector | ExternalLibrarySelector[];
734
+ type DependencyElementSelectorData = DependencyDataSelectorData;
801
735
 
802
736
  /**
803
737
  * Micromatch wrapper class with caching capabilities.
@@ -856,13 +790,6 @@ declare class Micromatch {
856
790
  makeRe(pattern: string): RegExp;
857
791
  }
858
792
 
859
- /**
860
- * Normalizes an ElementsSelector into an array of ElementSelectorData.
861
- * @param elementsSelector The elements selector, in any supported format.
862
- * @returns The normalized array of selector data.
863
- */
864
- declare function normalizeElementsSelector(elementsSelector: BaseElementsSelector): BaseElementSelectorData[];
865
- declare function normalizeElementsSelector(elementsSelector: DependencyElementsSelector): DependencyElementSelectorData[];
866
793
  /**
867
794
  * Base matcher class to determine if elements or dependencies match a given selector.
868
795
  */
@@ -907,7 +834,13 @@ declare class BaseElementsMatcher {
907
834
  * @param extraTemplateData The data to use for replace in the templates.
908
835
  * @returns The rendered templates.
909
836
  */
910
- protected getRenderedTemplates(template: MicromatchPattern, templateData: TemplateData): MicromatchPattern;
837
+ protected getRenderedTemplates(template: MicromatchPatternNullable, templateData: TemplateData): MicromatchPatternNullable;
838
+ /**
839
+ * Cleans a micromatch pattern by removing falsy values from arrays.
840
+ * @param pattern The micromatch pattern(s) to clean.
841
+ * @returns The cleaned pattern. If an array is provided, falsy entries are removed and the resulting array may be empty. If null is provided, null is returned unchanged.
842
+ */
843
+ protected cleanMicromatchPattern(pattern: MicromatchPatternNullable): string | string[] | null;
911
844
  /**
912
845
  * Returns whether the given value matches the micromatch pattern, converting non-string values to strings.
913
846
  * Optimized version with caching for better performance.
@@ -915,7 +848,7 @@ declare class BaseElementsMatcher {
915
848
  * @param pattern The micromatch pattern to match against.
916
849
  * @returns Whether the value matches the pattern.
917
850
  */
918
- protected isMicromatchMatch(value: unknown, pattern: MicromatchPattern): boolean;
851
+ protected isMicromatchMatch(value: string | null | undefined | boolean, pattern: MicromatchPatternNullable): boolean;
919
852
  /**
920
853
  * Returns whether the given value matches the micromatch pattern after rendering it as a template.
921
854
  * @param pattern The micromatch pattern to render and match against.
@@ -923,13 +856,13 @@ declare class BaseElementsMatcher {
923
856
  * @param value The value to check.
924
857
  * @returns Whether the value matches the rendered pattern.
925
858
  */
926
- protected isTemplateMicromatchMatch(pattern: MicromatchPattern, templateData: TemplateData, value?: unknown): boolean;
859
+ protected isTemplateMicromatchMatch(pattern: MicromatchPatternNullable, templateData: TemplateData, value: MicromatchMatchableValue): boolean;
927
860
  /**
928
861
  * Whether the given element key matches the selector key as booleans.
929
862
  * @param param0 The parameters object.
930
863
  * @returns Whether the element key matches the selector key.
931
864
  */
932
- protected isElementKeyBooleanMatch<T extends BaseElement, S extends BaseElementSelectorData>({
865
+ protected isElementKeyBooleanMatch<T extends BaseElementDescription, S extends BaseElementSelectorData>({
933
866
  /** The element to check. */
934
867
  element,
935
868
  /** The selector to check against. */
@@ -952,17 +885,17 @@ declare class BaseElementsMatcher {
952
885
  * @param param0 The parameters object.
953
886
  * @returns Whether the element key matches the selector key.
954
887
  */
955
- protected isElementKeyMicromatchMatch<T extends SelectableElement, S extends BaseElementSelectorData | DependencyElementSelectorData>({ element, selector, elementKey, selectorKey, selectorValue, templateData, }: {
888
+ protected isElementKeyMicromatchMatch<T extends SelectableElement, S extends BaseElementSelectorData, K extends keyof T>({ element, selector, elementKey, selectorKey, selectorValue, templateData, }: {
956
889
  /** The element to check. */
957
- element: T;
890
+ element: T & Record<K, MicromatchMatchableValue>;
958
891
  /** The selector to check against. */
959
892
  selector: S;
960
893
  /** The key of the element to check. */
961
- elementKey: T extends LocalElementKnown ? keyof LocalElementKnown : T extends CoreDependencyElement ? keyof CoreDependencyElement : T extends ExternalDependencyElement ? keyof ExternalDependencyElement : T extends IgnoredElement ? keyof IgnoredElement : keyof LocalDependencyElementKnown;
894
+ elementKey: K;
962
895
  /** The key of the selector to check against. */
963
- selectorKey: S extends DependencyElementSelectorData ? keyof DependencyElementSelectorData : keyof BaseElementSelectorData;
896
+ selectorKey: keyof BaseElementSelectorData;
964
897
  /** The value of the selector key to check against. */
965
- selectorValue?: MicromatchPattern;
898
+ selectorValue?: MicromatchPatternNullable;
966
899
  /** Data to pass when the selector value is rendered as a template */
967
900
  templateData: TemplateData;
968
901
  }): boolean;
@@ -972,8 +905,6 @@ declare class BaseElementsMatcher {
972
905
  * Matcher class to determine if elements match a given selector.
973
906
  */
974
907
  declare class ElementsMatcher extends BaseElementsMatcher {
975
- /** Whether the cache is enabled or not */
976
- private readonly _cacheIsEnabled;
977
908
  /**
978
909
  * Creates a new ElementsSelectorMatcher.
979
910
  * @param config Configuration options for the matcher.
@@ -1030,29 +961,38 @@ declare class ElementsMatcher extends BaseElementsMatcher {
1030
961
  */
1031
962
  private _isOriginMatch;
1032
963
  /**
1033
- * Whether the given element baseSource matches the selector baseSource
1034
- * @param element The element to check.
1035
- * @param selector The selector to check against.
1036
- * @param templateData The data to use for replace in selector value
1037
- * @returns Whether the element baseSource matches the selector baseSource.
1038
- */
1039
- private _isBaseSourceMatch;
1040
- /**
1041
- * Whether the given element source matches the selector source
1042
- * @param element The element to check.
1043
- * @param selector The selector to check against.
1044
- * @param templateData The data to use for replace in selector value
1045
- * @returns Whether the element source matches the selector source.
964
+ * Checks if a single captured values object matches the element.
965
+ * @param capturedValues The captured values to check.
966
+ * @param capturedSelector The captured values selector object to check against
967
+ * @param templateData The data to use for replace in selector values
968
+ * @returns True if all captured values in the selector match those in the element, false otherwise.
1046
969
  */
1047
- private _isSourceMatch;
970
+ private _checkCapturedValuesObject;
1048
971
  /**
1049
972
  * Determines if the captured values of the element match those in the selector.
973
+ * When the selector is an array, the element matches if it matches any of the array elements (OR logic).
1050
974
  * @param element The element to check.
1051
975
  * @param selector The selector to check against
1052
976
  * @param templateData The data to use for replace in selector values
1053
977
  * @returns True if the captured values match, false otherwise.
1054
978
  */
1055
979
  private _isCapturedValuesMatch;
980
+ /**
981
+ * Determines if the parent captured values match the selector.
982
+ * @param parentSelector The parent selector to match.
983
+ * @param parentCaptured The captured values from first parent.
984
+ * @param templateData The data to use for replace in selector values
985
+ * @returns True if the captured values match, false otherwise.
986
+ */
987
+ private _isParentCapturedValuesMatch;
988
+ /**
989
+ * Whether the given element first parent matches the selector parent.
990
+ * @param element The element to check.
991
+ * @param selector The selector to check against.
992
+ * @param templateData The data to use for replace in selector values
993
+ * @returns Whether the first parent matches the selector parent.
994
+ */
995
+ private _isParentMatch;
1056
996
  /**
1057
997
  * Determines if the isIgnored property of the element matches that in the selector.
1058
998
  * @param element The element to check.
@@ -1080,16 +1020,16 @@ declare class ElementsMatcher extends BaseElementsMatcher {
1080
1020
  * It omits checks in keys applying only to dependency between elements, such as relationship.
1081
1021
  * @param element The element to check.
1082
1022
  * @param selector The selector to check against.
1083
- * @param options Extra options for matching, such as templates data, globals for dependency selectors, etc.
1023
+ * @param options Extra options for matching, such as templates data, etc.
1084
1024
  * @returns The selector matching result for the given element, or null if none matches.
1085
1025
  */
1086
- getSelectorMatching(element: ElementDescription, selector: BaseElementsSelector, { extraTemplateData }?: MatcherOptions): ElementSelectorData | null;
1026
+ getSelectorMatching(element: ElementDescription, selector: BaseElementsSelector, { extraTemplateData }?: MatcherOptions): BaseElementSelectorData | null;
1087
1027
  /**
1088
1028
  * Returns whether the given element matches the selector.
1089
1029
  * It omits checks in keys applying only to dependency between elements, such as relationship.
1090
1030
  * @param element The element to check.
1091
1031
  * @param selector The selector to check against.
1092
- * @param options Extra options for matching, such as templates data, globals for dependency selectors, etc.
1032
+ * @param options Extra options for matching, such as templates data, etc.
1093
1033
  * @returns Whether the element matches the selector properties applying to elements.
1094
1034
  */
1095
1035
  isElementMatch(element: ElementDescription, selector: BaseElementsSelector, options?: MatcherOptions): boolean;
@@ -1117,12 +1057,6 @@ declare class DependenciesMatcher extends BaseElementsMatcher {
1117
1057
  * @returns The normalized dependency selector.
1118
1058
  */
1119
1059
  private _normalizeDependencySelector;
1120
- /**
1121
- * Converts a DependencyElementSelectorData to a BaseElementSelectorData, by removing dependency-specific properties.
1122
- * @param selector The dependency element selector data.
1123
- * @returns The base element selector data.
1124
- */
1125
- private _convertDependencyElementSelectorDataToBaseElementSelectorData;
1126
1060
  /**
1127
1061
  * Returns the selectors matching result for the given dependency.
1128
1062
  * @param dependency The dependency description.
@@ -1130,14 +1064,22 @@ declare class DependenciesMatcher extends BaseElementsMatcher {
1130
1064
  * @param extraTemplateData The extra template data for selector values.
1131
1065
  * @returns The selectors matching result for the given dependency.
1132
1066
  */
1133
- private _getSelectorMatching;
1067
+ private _getSelectorsMatching;
1134
1068
  /**
1135
1069
  * Determines if the dependency relationship matches the selector.
1136
1070
  * @param dependency The dependency description.
1137
1071
  * @param selector The data of an element selector.
1138
1072
  * @returns Whether the dependency relationship matches the selector.
1139
1073
  */
1140
- private _relationshipMatches;
1074
+ private _relationshipFromMatches;
1075
+ /**
1076
+ * Determines if the dependency origin relationship matches the selector.
1077
+ * @param selector The dependency selector data.
1078
+ * @param relationship The relationship from origin element to target element.
1079
+ * @param templateData The template data for rendering selector values.
1080
+ * @returns Whether the dependency origin relationship matches.
1081
+ */
1082
+ private _relationshipToMatches;
1141
1083
  /**
1142
1084
  * Determines if the selector matches an specific kind
1143
1085
  * @param selector The dependency selector data
@@ -1163,34 +1105,42 @@ declare class DependenciesMatcher extends BaseElementsMatcher {
1163
1105
  */
1164
1106
  private _nodeKindMatches;
1165
1107
  /**
1166
- * Determines if the dependency description matches the selector for 'from'.
1108
+ * Determines if the dependency description matches the selector for 'to'.
1167
1109
  * @param dependency The dependency description.
1168
- * @param fromSelector The selector for 'from' elements.
1110
+ * @param toSelector The selector for 'to' elements.
1169
1111
  * @param templateData The template data for rendering selector values
1170
- * @returns Whether the dependency properties match the selector for 'from'.
1112
+ * @returns Whether the dependency properties match the selector for 'to'.
1171
1113
  */
1172
- private _dependencyFromPropertiesMatch;
1114
+ private _sourceMatches;
1173
1115
  /**
1174
- * Determines if the dependency description matches the selector for 'to'.
1116
+ * Determines if the selector matches the module
1117
+ * @param selector The dependency selector data
1118
+ * @param module The module to check
1119
+ * @param templateData The template data for rendering selector values
1120
+ * @returns Whether the selector matches the module
1121
+ */
1122
+ private _moduleMatches;
1123
+ /**
1124
+ * Determines if the dependency description matches the selector for dependency metadata.
1175
1125
  * @param dependency The dependency description.
1176
- * @param toSelector The selector for 'to' elements.
1126
+ * @param selectorData The selector for dependency metadata.
1177
1127
  * @param templateData The template data for rendering selector values
1178
- * @returns Whether the dependency properties match the selector for 'to'.
1128
+ * @returns Whether the dependency properties match the selector.
1179
1129
  */
1180
- private _dependencyToPropertiesMatch;
1130
+ private _dependencyPropertiesMatch;
1181
1131
  /**
1182
1132
  * Returns the selectors matching result for the given dependency.
1183
1133
  * @param dependency The dependency to check.
1184
1134
  * @param selector The selector to check against.
1185
- * @param options Extra options for matching, such as templates data, globals for dependency selectors, etc.
1135
+ * @param options Extra options for matching, such as templates data, etc.
1186
1136
  * @returns The matching result for the dependency against the selector.
1187
1137
  */
1188
- getSelectorsMatching(dependency: DependencyDescription, selector: DependencySelector, { extraTemplateData, dependencySelectorsGlobals, }?: MatcherOptions): DependencyMatchResult;
1138
+ getSelectorsMatching(dependency: DependencyDescription, selector: DependencySelector, { extraTemplateData }?: MatcherOptions): DependencyMatchResult;
1189
1139
  /**
1190
1140
  * Returns whether the given dependency matches the selector.
1191
1141
  * @param dependency The dependency to check.
1192
1142
  * @param selector The selector to check against.
1193
- * @param options Extra options for matching, such as templates data, globals for dependency selectors, etc.
1143
+ * @param options Extra options for matching, such as templates data, etc.
1194
1144
  * @returns Whether the dependency matches the selector properties.
1195
1145
  */
1196
1146
  isDependencyMatch(dependency: DependencyDescription, selector: DependencySelector, options?: MatcherOptions): boolean;
@@ -1213,13 +1163,13 @@ declare function isSimpleElementSelectorByType(value: unknown): value is SimpleE
1213
1163
  * @param value The value to check.
1214
1164
  * @returns True if the selector is a base element selector
1215
1165
  */
1216
- declare function isBaseElementSelectorData(value: unknown): value is ElementSelectorData;
1166
+ declare function isBaseElementSelectorData(value: unknown): value is BaseElementSelectorData;
1217
1167
  /**
1218
1168
  * Determines if the given selector is an element or dependency element selector data.
1219
1169
  * @param value The value to check.
1220
1170
  * @returns True if the selector is an element or dependency element selector data, false otherwise.
1221
1171
  */
1222
- declare function isElementSelectorData(value: unknown): value is ElementSelectorData;
1172
+ declare function isElementSelectorData(value: unknown): value is BaseElementSelectorData;
1223
1173
  /**
1224
1174
  * Determines if the given selector is an element selector with options.
1225
1175
  * @param value The value to check.
@@ -1239,51 +1189,35 @@ declare function isElementSelector(value: unknown): value is ElementSelector;
1239
1189
  */
1240
1190
  declare function isElementsSelector(value: unknown): value is ElementSelectors;
1241
1191
  /**
1242
- * Determines if the given value is a dependency selector.
1243
- * @param value The value to check
1244
- * @returns True if the value is a dependency selector, false otherwise.
1245
- */
1246
- declare function isDependencySelector(value: unknown): value is DependencySelector;
1247
- /**
1248
- * Determines if the given value is external library selector options with a path.
1249
- * @param value The value to check.
1250
- * @returns True if the value is external library selector options with a path, false otherwise.
1192
+ * Normalizes a selector into ElementSelectorData format.
1193
+ * @param selector The selector to normalize.
1194
+ * @returns The normalized selector data.
1251
1195
  */
1252
- declare function isExternalLibrarySelectorOptionsWithPath(value: unknown): value is ExternalLibrarySelectorOptions & {
1253
- path: string | string[];
1254
- };
1196
+ declare function normalizeElementSelector(selector: BaseElementSelector): BaseElementSelectorData;
1255
1197
  /**
1256
- * Determines if the given value is external library selector options with specifiers.
1257
- * @param value The value to check.
1258
- * @returns True if the value is external library selector options with specifiers, false otherwise.
1259
- */
1260
- declare function isExternalLibrarySelectorOptionsWithSpecifiers(value: unknown): value is ExternalLibrarySelectorOptions & {
1261
- specifiers: string[];
1262
- };
1263
- /**
1264
- * Determines if the given value is external library selector options.
1265
- * @param value The value to check.
1266
- * @returns True if the value is external library selector options, false otherwise.
1198
+ * Normalizes an ElementsSelector into an array of ElementSelectorData.
1199
+ * @param elementsSelector The elements selector, in any supported format.
1200
+ * @returns The normalized array of selector data.
1267
1201
  */
1268
- declare function isExternalLibrarySelectorOptions(value: unknown): value is ExternalLibrarySelectorOptions;
1202
+ declare function normalizeElementsSelector(elementsSelector: BaseElementsSelector): BaseElementSelectorData[];
1269
1203
  /**
1270
- * Determines if the given value is an external library selector with options.
1271
- * @param value The value to check.
1272
- * @returns True if the value is an external library selector with options, false otherwise.
1204
+ * Determines if the given value is a dependency selector.
1205
+ * @param value The value to check
1206
+ * @returns True if the value is a dependency selector, false otherwise.
1273
1207
  */
1274
- declare function isExternalLibrarySelectorWithOptions(value: unknown): value is ExternalLibrarySelectorWithOptions;
1208
+ declare function isDependencySelector(value: unknown): value is DependencySelector;
1275
1209
  /**
1276
- * Determines if the given value is an external library selector.
1210
+ * Determines if the given value is dependency metadata selector data.
1277
1211
  * @param value The value to check.
1278
- * @returns True if the value is an external library selector, false otherwise.
1212
+ * @returns True if the value is dependency metadata selector data, false otherwise.
1279
1213
  */
1280
- declare function isExternalLibrarySelector(value: unknown): value is ExternalLibrarySelector;
1214
+ declare function isDependencyDataSelectorData(value: unknown): value is DependencyDataSelectorData;
1281
1215
  /**
1282
- * Determines if the given value is an external libraries selector.
1216
+ * Determines if the given value is dependency metadata selector(s).
1283
1217
  * @param value The value to check.
1284
- * @returns True if the value is an external libraries selector, false otherwise.
1218
+ * @returns True if the value is dependency metadata selector(s), false otherwise.
1285
1219
  */
1286
- declare function isExternalLibrariesSelector(value: unknown): value is ExternalLibrariesSelector;
1220
+ declare function isDependencyDataSelector(value: unknown): value is DependencyDataSelector;
1287
1221
 
1288
1222
  /**
1289
1223
  * Matcher class to evaluate if elements or dependencies match given selectors.
@@ -1301,6 +1235,18 @@ declare class Matcher {
1301
1235
  * @param globalCache Global cache instance.
1302
1236
  */
1303
1237
  constructor(descriptors: ElementDescriptors, elementsMatcher: ElementsMatcher, dependenciesMatcher: DependenciesMatcher, config: DescriptorOptionsNormalized, micromatch: Micromatch);
1238
+ /**
1239
+ * Describes an element given its file path.
1240
+ * @param filePath The path of the file to describe.
1241
+ * @returns The description of the element.
1242
+ */
1243
+ describeElement(filePath: string): ElementDescription;
1244
+ /**
1245
+ * Describes elements in a dependency relationship, and provides additional information about the dependency itself.
1246
+ * @param options The options for describing the elements and the dependency details.
1247
+ * @returns The description of the dependency between the elements.
1248
+ */
1249
+ describeDependency(options: DescribeDependencyOptions): DependencyDescription;
1304
1250
  /**
1305
1251
  * Determines if an element matches a given selector.
1306
1252
  * @param filePath The file path of the element
@@ -1308,7 +1254,7 @@ declare class Matcher {
1308
1254
  * @param options Extra matcher options
1309
1255
  * @returns True if the element matches the selector, false otherwise
1310
1256
  */
1311
- private _isElementMatch;
1257
+ isElementMatch(filePath: string, selector: ElementsSelector, options?: MatcherOptions): boolean;
1312
1258
  /**
1313
1259
  * Determines if a dependency matches a given selector.
1314
1260
  * @param dependencyData The data describing the dependency
@@ -1316,15 +1262,7 @@ declare class Matcher {
1316
1262
  * @param options Extra matcher options
1317
1263
  * @returns True if the dependency matches the selector, false otherwise
1318
1264
  */
1319
- private _isDependencyMatch;
1320
- /**
1321
- * Determines if the given element or dependency matches the provided selector.
1322
- * @param descriptorOptions The file path or dependency options to describe the element or dependency
1323
- * @param selector The selector to match against
1324
- * @param options Extra matcher options
1325
- */
1326
- isMatch(descriptorOptions: string, selector: ElementsSelector, options?: MatcherOptions): boolean;
1327
- isMatch(descriptorOptions: DescribeDependencyOptions, selector: DependencySelector, options?: MatcherOptions): boolean;
1265
+ isDependencyMatch(dependencyData: DescribeDependencyOptions, selector: DependencySelector, options?: MatcherOptions): boolean;
1328
1266
  /**
1329
1267
  * Determines the selector matching for an element.
1330
1268
  * @param filePath The file path of the element
@@ -1332,7 +1270,7 @@ declare class Matcher {
1332
1270
  * @param options Extra options for matching
1333
1271
  * @returns The matching selector data or null if no match is found
1334
1272
  */
1335
- private _getElementSelectorMatching;
1273
+ getElementSelectorMatching(filePath: string, selector: ElementsSelector, options?: MatcherOptions): BaseElementSelectorData | null;
1336
1274
  /**
1337
1275
  * Determines the selector matching for a dependency.
1338
1276
  * @param dependencyData The data describing the dependency
@@ -1340,44 +1278,23 @@ declare class Matcher {
1340
1278
  * @param options Extra options for matching
1341
1279
  * @returns The matching dependency result or null if no match is found
1342
1280
  */
1343
- private _getDependencySelectorMatching;
1344
- /**
1345
- * Determines the selector matching for a dependency or element.
1346
- * @param descriptorOptions The file path or dependency options to describe the element or dependency
1347
- * @param selector The selectors to match against
1348
- * @param options Extra options for matching
1349
- * @returns The matching dependency result or element selector data, or null if no match is found
1350
- */
1351
- getSelectorMatching(descriptorOptions: string, selector: ElementsSelector, options?: MatcherOptions): ElementSelectorData | null;
1352
- getSelectorMatching(descriptorOptions: DescribeDependencyOptions, selector: DependencySelector, options?: MatcherOptions): DependencyMatchResult | null;
1281
+ getDependencySelectorMatching(dependencyData: DescribeDependencyOptions, selector: DependencySelector, options?: MatcherOptions): DependencyMatchResult;
1353
1282
  /**
1354
1283
  * Returns the selectors matching result for the given element or dependency description.
1355
1284
  * @param description The element or dependency description to check.
1356
1285
  * @param selector The selector to check against.
1357
- * @param options Extra options for matching, such as templates data, globals for dependency selectors, etc.
1286
+ * @param options Extra options for matching, such as templates data, etc.
1358
1287
  * @returns The selectors matching result for the given description, and whether it matches or not.
1359
1288
  */
1360
- getSelectorMatchingDescription(description: DependencyDescription, selector: DependencySelector, options?: MatcherOptions): DependencyMatchResult;
1361
- getSelectorMatchingDescription(description: ElementDescription, selector: ElementsSelector, options?: MatcherOptions): ElementSelectorData;
1362
- /**
1363
- * Describes an element given its file path.
1364
- * @param filePath The path of the file to describe.
1365
- * @returns The description of the element.
1366
- */
1367
- describeElement(filePath: string): FileElement;
1368
- /**
1369
- * Describes a dependency element given its dependency source and file path.
1370
- * @param dependencySource The source of the dependency.
1371
- * @param filePath The path of the file being the dependency, if known.
1372
- * @returns The description of the dependency element.
1373
- */
1374
- describeDependencyElement(dependencySource: string, filePath?: string): DependencyElementDescription;
1289
+ getDependencySelectorMatchingDescription(description: DependencyDescription, selector: DependencySelector, options?: MatcherOptions): DependencyMatchResult;
1375
1290
  /**
1376
- * Describes elements in a dependency relationship, and provides additional information about the dependency itself.
1377
- * @param options The options for describing the elements and the dependency details.
1378
- * @returns The description of the dependency between the elements.
1291
+ * Returns the first element selector matching result for the given element description.
1292
+ * @param description The element description to check.
1293
+ * @param selector The selector to check against.
1294
+ * @param options Extra options for matching, such as templates data, etc.
1295
+ * @returns The first matching selector result for the given description, or null if no match is found.
1379
1296
  */
1380
- describeDependency(options: DescribeDependencyOptions): DependencyDescription;
1297
+ getElementSelectorMatchingDescription(description: ElementDescription, selector: ElementsSelector, options?: MatcherOptions): BaseElementSelectorData | null;
1381
1298
  /**
1382
1299
  * Clears all caches.
1383
1300
  */
@@ -1427,14 +1344,7 @@ declare class Descriptors {
1427
1344
  * @param filePath The path of the file to describe.
1428
1345
  * @returns The description of the element.
1429
1346
  */
1430
- describeElement(filePath?: string): FileElement;
1431
- /**
1432
- * Describes a dependency element given its dependency source and file path.
1433
- * @param dependencySource The source of the dependency.
1434
- * @param filePath The path of the file being the dependency, if known.
1435
- * @returns The description of the dependency element.
1436
- */
1437
- describeDependencyElement(dependencySource: string, filePath?: string): DependencyElementDescription;
1347
+ describeElement(filePath?: string): ElementDescription;
1438
1348
  /**
1439
1349
  * Describes elements in a dependency relationship, and provides additional information about the dependency itself.
1440
1350
  * @param options The options for describing the elements and the dependency details.
@@ -1574,7 +1484,7 @@ declare class ElementsDescriptor {
1574
1484
  * @param dependencySource The source of the dependency to check.
1575
1485
  * @returns The base source of the external module. (e.g., for "@scope/package/submodule", it returns "@scope/package")
1576
1486
  */
1577
- private _getExternalOrCoreModuleBaseSource;
1487
+ private _getExternalOrCoreModuleModule;
1578
1488
  /**
1579
1489
  * Determines if a file path is outside the configured root path.
1580
1490
  * @param filePath The file path to check.
@@ -1670,14 +1580,14 @@ declare class ElementsDescriptor {
1670
1580
  * @param filePath The path of the file to describe. Can be absolute if rootPath is configured, or relative if not.
1671
1581
  * @returns The description of the element.
1672
1582
  */
1673
- describeElement(filePath?: string): FileElement;
1583
+ describeElement(filePath?: string): ElementDescription;
1674
1584
  /**
1675
- * Describes a dependency element given its dependency source and file path.
1585
+ * Describes a dependency target element given dependency source and target file path.
1586
+ * @param filePath The path of the dependency target file, if known. Can be absolute if rootPath is configured, or relative if not.
1676
1587
  * @param dependencySource The source of the dependency.
1677
- * @param filePath The path of the file being the dependency, if known. Can be absolute if rootPath is configured, or relative if not.
1678
1588
  * @returns The description of the dependency element.
1679
1589
  */
1680
- describeDependencyElement(dependencySource: string, filePath?: string): DependencyElementDescription;
1590
+ describeElement(filePath: string | undefined, dependencySource: string): ElementDescriptionWithSource;
1681
1591
  }
1682
1592
 
1683
1593
  /**
@@ -1846,4 +1756,4 @@ declare class CacheManager<CacheKey extends NotUndefined, CachedValue> {
1846
1756
  setFromSerialized(serializedCache: Record<string, CachedValue>): void;
1847
1757
  }
1848
1758
 
1849
- export { type BaseDependencyElement, type BaseElement, type BaseElementDescriptor, type BaseElementSelector, type BaseElementSelectorData, type BaseElementSelectorWithOptions, type BaseElementsSelector, CacheManager, type CapturedValues, type CapturedValuesSelector, type ConfigOptions, type ConfigOptionsNormalized, type CoreDependencyElement, DEPENDENCY_KINDS_MAP, DEPENDENCY_KIND_TYPE, DEPENDENCY_KIND_TYPEOF, DEPENDENCY_KIND_VALUE, DEPENDENCY_RELATIONSHIPS_INVERTED_MAP, DEPENDENCY_RELATIONSHIPS_MAP, DependenciesDescriptor, type DependenciesDescriptorSerializedCache, DependenciesMatcher, type DependenciesMatcherSerializedCache, type DependencyDescription, type DependencyElementDescription, type DependencyElementSelector, type DependencyElementSelectorData, type DependencyElementSelectorWithOptions, type DependencyElementsSelector, type DependencyKind, type DependencyMatchResult, type DependencyRelationship, type DependencySelector, type DependencySelectorNormalized, type DescribeDependencyOptions, type DescriptionsSerializedCache, type DescriptorOptionsNormalized, Descriptors, type DescriptorsSerializedCache, ELEMENT_DESCRIPTOR_MODES_MAP, ELEMENT_ORIGINS_MAP, type ElementDescription, type ElementDescriptor, type ElementDescriptorMode, type ElementDescriptorPattern, type ElementDescriptorWithCategory, type ElementDescriptorWithType, type ElementDescriptorWithTypeAndCategory, type ElementDescriptors, type ElementOrigin, type ElementParent, type ElementSelector, type ElementSelectorData, type ElementSelectorWithOptions, type ElementSelectors, Elements, type ElementsDependencyInfo, ElementsDescriptor, type ElementsDescriptorSerializedCache, ElementsMatcher, type ElementsMatcherSerializedCache, type ElementsSelector, type ElementsSerializedCache, type ExternalDependencyElement, type ExternalLibrariesSelector, type ExternalLibrarySelector, type ExternalLibrarySelectorOptions, type ExternalLibrarySelectorWithOptions, type ExternalLibrarySelectors, type FileElement, type FileElementsSerializedCache, type FlagAsExternalOptions, type FlagAsExternalOptionsNormalized, type IgnoredDependencyElement, type IgnoredElement, type LocalDependencyElement, type LocalDependencyElementKnown, type LocalDependencyElementUnknown, type LocalElementKnown, type LocalElementUnknown, Matcher, type MatcherOptions, type MatcherOptionsDependencySelectorsGlobals, type MatcherSerializedCache, type MatchersOptionsNormalized, type MicromatchPattern, type MicromatchSerializedCache, type NotUndefined, type ObjectCacheKey, type SelectableElement, type SimpleElementSelectorByType, type TemplateData, isBaseElement, isBaseElementDescriptor, isBaseElementSelectorData, isCapturedValuesSelector, isCoreDependencyElement, isDependencyDescription, isDependencyElementDescription, isDependencyKind, isDependencyRelationship, isDependencyRelationshipDescription, isDependencySelector, isElementDescription, isElementDescriptor, isElementDescriptorMode, isElementDescriptorPattern, isElementDescriptorWithCategory, isElementDescriptorWithType, isElementSelector, isElementSelectorData, isElementSelectorWithLegacyOptions, isElementsDependencyInfo, isElementsSelector, isExternalDependencyElement, isExternalLibrariesSelector, isExternalLibrarySelector, isExternalLibrarySelectorOptions, isExternalLibrarySelectorOptionsWithPath, isExternalLibrarySelectorOptionsWithSpecifiers, isExternalLibrarySelectorWithOptions, isIgnoredElement, isInternalDependency, isKnownLocalElement, isLocalDependencyElement, isLocalElement, isSimpleElementSelectorByType, isUnknownLocalElement, normalizeElementsSelector };
1759
+ export { type BaseElementDescription, type BaseElementDescriptor, type BaseElementSelector, type BaseElementSelectorData, type BaseElementSelectorWithOptions, type BaseElementsSelector, CacheManager, type CapturedValues, type CapturedValuesSelector, type ConfigOptions, type ConfigOptionsNormalized, type CoreElementDescription, DEPENDENCY_KINDS_MAP, DEPENDENCY_KIND_TYPE, DEPENDENCY_KIND_TYPEOF, DEPENDENCY_KIND_VALUE, DEPENDENCY_RELATIONSHIPS_INVERTED_MAP, DEPENDENCY_RELATIONSHIPS_MAP, DependenciesDescriptor, type DependenciesDescriptorSerializedCache, DependenciesMatcher, type DependenciesMatcherSerializedCache, type DependencyDataSelector, type DependencyDataSelectorData, type DependencyDescription, type DependencyElementSelectorData, type DependencyKind, type DependencyMatchResult, type DependencyRelationship, type DependencySelector, type DependencySelectorNormalized, type DescribeDependencyOptions, type DescriptionsSerializedCache, type DescriptorOptionsNormalized, Descriptors, type DescriptorsSerializedCache, ELEMENT_DESCRIPTOR_MODES_MAP, ELEMENT_ORIGINS_MAP, type ElementDescription, type ElementDescriptionWithSource, type ElementDescriptor, type ElementDescriptorMode, type ElementDescriptorPattern, type ElementDescriptorWithCategory, type ElementDescriptorWithType, type ElementDescriptorWithTypeAndCategory, type ElementDescriptors, type ElementOrigin, type ElementParent, type ElementSelector, type ElementSelectorWithOptions, type ElementSelectors, Elements, type ElementsDependencyInfo, ElementsDescriptor, type ElementsDescriptorSerializedCache, ElementsMatcher, type ElementsMatcherSerializedCache, type ElementsSelector, type ElementsSerializedCache, type ExternalElementDescription, type FileElementsSerializedCache, type FlagAsExternalOptions, type FlagAsExternalOptionsNormalized, type IgnoredElement, type LocalElementKnown, type LocalElementUnknown, Matcher, type MatcherOptions, type MatcherSerializedCache, type MatchersOptionsNormalized, type MicromatchMatchableValue, type MicromatchPattern, type MicromatchPatternNullable, type MicromatchSerializedCache, type NotUndefined, type ObjectCacheKey, type ParentElementSelectorData, type SelectableElement, type SimpleElementSelectorByType, type TemplateData, isBaseElement, isBaseElementDescriptor, isBaseElementSelectorData, isCapturedValuesSelector, isCoreDependencyElement, isDependencyDataSelector, isDependencyDataSelectorData, isDependencyDescription, isDependencyKind, isDependencyRelationship, isDependencyRelationshipDescription, isDependencySelector, isElementDescription, isElementDescriptor, isElementDescriptorMode, isElementDescriptorPattern, isElementDescriptorWithCategory, isElementDescriptorWithType, isElementSelector, isElementSelectorData, isElementSelectorWithLegacyOptions, isElementsDependencyInfo, isElementsSelector, isExternalDependencyElement, isIgnoredElement, isInternalDependency, isKnownLocalElement, isLocalDependencyElement, isLocalElement, isSimpleElementSelectorByType, isUnknownLocalElement, normalizeElementSelector, normalizeElementsSelector };