@boundaries/elements 2.0.0-beta.1 → 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.
@@ -6,6 +6,10 @@ type MicromatchPattern = string | string[];
6
6
  * Type representing a micromatch pattern supporting null values
7
7
  */
8
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;
9
13
  /**
10
14
  * Configuration options for categorizing dependencies as external or local.
11
15
  */
@@ -844,7 +848,7 @@ declare class BaseElementsMatcher {
844
848
  * @param pattern The micromatch pattern to match against.
845
849
  * @returns Whether the value matches the pattern.
846
850
  */
847
- protected isMicromatchMatch(value: unknown, pattern: MicromatchPatternNullable): boolean;
851
+ protected isMicromatchMatch(value: string | null | undefined | boolean, pattern: MicromatchPatternNullable): boolean;
848
852
  /**
849
853
  * Returns whether the given value matches the micromatch pattern after rendering it as a template.
850
854
  * @param pattern The micromatch pattern to render and match against.
@@ -852,7 +856,7 @@ declare class BaseElementsMatcher {
852
856
  * @param value The value to check.
853
857
  * @returns Whether the value matches the rendered pattern.
854
858
  */
855
- protected isTemplateMicromatchMatch(pattern: MicromatchPatternNullable, templateData: TemplateData, value?: unknown): boolean;
859
+ protected isTemplateMicromatchMatch(pattern: MicromatchPatternNullable, templateData: TemplateData, value: MicromatchMatchableValue): boolean;
856
860
  /**
857
861
  * Whether the given element key matches the selector key as booleans.
858
862
  * @param param0 The parameters object.
@@ -881,13 +885,13 @@ declare class BaseElementsMatcher {
881
885
  * @param param0 The parameters object.
882
886
  * @returns Whether the element key matches the selector key.
883
887
  */
884
- protected isElementKeyMicromatchMatch<T extends SelectableElement, S extends BaseElementSelectorData>({ 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, }: {
885
889
  /** The element to check. */
886
- element: T;
890
+ element: T & Record<K, MicromatchMatchableValue>;
887
891
  /** The selector to check against. */
888
892
  selector: S;
889
893
  /** The key of the element to check. */
890
- elementKey: keyof T;
894
+ elementKey: K;
891
895
  /** The key of the selector to check against. */
892
896
  selectorKey: keyof BaseElementSelectorData;
893
897
  /** The value of the selector key to check against. */
@@ -1752,4 +1756,4 @@ declare class CacheManager<CacheKey extends NotUndefined, CachedValue> {
1752
1756
  setFromSerialized(serializedCache: Record<string, CachedValue>): void;
1753
1757
  }
1754
1758
 
1755
- 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 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 };
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 };
@@ -6,6 +6,10 @@ type MicromatchPattern = string | string[];
6
6
  * Type representing a micromatch pattern supporting null values
7
7
  */
8
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;
9
13
  /**
10
14
  * Configuration options for categorizing dependencies as external or local.
11
15
  */
@@ -844,7 +848,7 @@ declare class BaseElementsMatcher {
844
848
  * @param pattern The micromatch pattern to match against.
845
849
  * @returns Whether the value matches the pattern.
846
850
  */
847
- protected isMicromatchMatch(value: unknown, pattern: MicromatchPatternNullable): boolean;
851
+ protected isMicromatchMatch(value: string | null | undefined | boolean, pattern: MicromatchPatternNullable): boolean;
848
852
  /**
849
853
  * Returns whether the given value matches the micromatch pattern after rendering it as a template.
850
854
  * @param pattern The micromatch pattern to render and match against.
@@ -852,7 +856,7 @@ declare class BaseElementsMatcher {
852
856
  * @param value The value to check.
853
857
  * @returns Whether the value matches the rendered pattern.
854
858
  */
855
- protected isTemplateMicromatchMatch(pattern: MicromatchPatternNullable, templateData: TemplateData, value?: unknown): boolean;
859
+ protected isTemplateMicromatchMatch(pattern: MicromatchPatternNullable, templateData: TemplateData, value: MicromatchMatchableValue): boolean;
856
860
  /**
857
861
  * Whether the given element key matches the selector key as booleans.
858
862
  * @param param0 The parameters object.
@@ -881,13 +885,13 @@ declare class BaseElementsMatcher {
881
885
  * @param param0 The parameters object.
882
886
  * @returns Whether the element key matches the selector key.
883
887
  */
884
- protected isElementKeyMicromatchMatch<T extends SelectableElement, S extends BaseElementSelectorData>({ 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, }: {
885
889
  /** The element to check. */
886
- element: T;
890
+ element: T & Record<K, MicromatchMatchableValue>;
887
891
  /** The selector to check against. */
888
892
  selector: S;
889
893
  /** The key of the element to check. */
890
- elementKey: keyof T;
894
+ elementKey: K;
891
895
  /** The key of the selector to check against. */
892
896
  selectorKey: keyof BaseElementSelectorData;
893
897
  /** The value of the selector key to check against. */
@@ -1752,4 +1756,4 @@ declare class CacheManager<CacheKey extends NotUndefined, CachedValue> {
1752
1756
  setFromSerialized(serializedCache: Record<string, CachedValue>): void;
1753
1757
  }
1754
1758
 
1755
- 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 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 };
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 };
@@ -363,7 +363,7 @@ var BaseElementsMatcher = class {
363
363
  if (isUndefined(selectorValue) || !isObjectWithProperty(element, String(elementKey))) {
364
364
  return false;
365
365
  }
366
- const elementValue = element[String(elementKey)];
366
+ const elementValue = element[elementKey];
367
367
  return this.isTemplateMicromatchMatch(
368
368
  selectorValue,
369
369
  templateData,