axe-core 4.9.1 → 4.10.0-canary.cfd2974

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/axe.d.ts CHANGED
@@ -70,16 +70,19 @@ declare namespace axe {
70
70
  | LabelledShadowDomSelector
71
71
  | LabelledFramesSelector;
72
72
  type SelectorList = Array<Selector | FramesSelector> | NodeList;
73
+ type ContextProp = Selector | SelectorList;
73
74
  type ContextObject =
74
75
  | {
75
- include: Selector | SelectorList;
76
- exclude?: Selector | SelectorList;
76
+ include: ContextProp;
77
+ exclude?: ContextProp;
77
78
  }
78
79
  | {
79
- exclude: Selector | SelectorList;
80
- include?: Selector | SelectorList;
80
+ exclude: ContextProp;
81
+ include?: ContextProp;
81
82
  };
82
- type ElementContext = Selector | SelectorList | ContextObject;
83
+ type ContextSpec = ContextProp | ContextObject;
84
+ /** Synonym to ContextSpec */
85
+ type ElementContext = ContextSpec;
83
86
 
84
87
  type SerialSelector =
85
88
  | BaseSelector
@@ -140,10 +143,14 @@ declare namespace axe {
140
143
  iframes?: boolean;
141
144
  elementRef?: boolean;
142
145
  frameWaitTime?: number;
143
- preload?: boolean;
146
+ preload?: boolean | PreloadOptions;
144
147
  performanceTimer?: boolean;
145
148
  pingWaitTime?: number;
146
149
  }
150
+ interface PreloadOptions {
151
+ assets: string[];
152
+ timeout?: number;
153
+ }
147
154
  interface AxeResults extends EnvironmentData {
148
155
  toolOptions: RunOptions;
149
156
  passes: Result[];
@@ -406,6 +413,16 @@ declare namespace axe {
406
413
  shadowSelect: (selector: CrossTreeSelector) => Element | null;
407
414
  shadowSelectAll: (selector: CrossTreeSelector) => Element[];
408
415
  getStandards(): Required<Standards>;
416
+ isContextSpec: (context: unknown) => context is ContextSpec;
417
+ isContextObject: (context: unknown) => context is ContextObject;
418
+ isContextProp: (context: unknown) => context is ContextProp;
419
+ isLabelledFramesSelector: (
420
+ selector: unknown
421
+ ) => selector is LabelledFramesSelector;
422
+ isLabelledShadowDomSelector: (
423
+ selector: unknown
424
+ ) => selector is LabelledShadowDomSelector;
425
+
409
426
  DqElement: new (
410
427
  elm: Element,
411
428
  options?: { absolutePaths?: boolean }