@axe-core/puppeteer 4.8.2-e7606a0.0 → 4.8.2-e8094c1.0

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.
@@ -0,0 +1,48 @@
1
+ import * as Axe from 'axe-core';
2
+ import { SerialFrameSelector, RunOptions, Spec, AxeResults } from 'axe-core';
3
+ import { Page, Frame, Browser } from 'puppeteer';
4
+
5
+ type AnalyzeCB = (err: Error | null, result?: Axe.AxeResults) => void;
6
+ interface IPageOptions {
7
+ opts?: any;
8
+ source?: string;
9
+ }
10
+
11
+ declare class AxePuppeteer {
12
+ private frame;
13
+ private axeSource?;
14
+ private includes;
15
+ private excludes;
16
+ private axeOptions;
17
+ private config;
18
+ private disabledFrameSelectors;
19
+ private page;
20
+ private legacyMode;
21
+ private errorUrl;
22
+ constructor(pageFrame: Page | Frame, source?: string);
23
+ include(selector: SerialFrameSelector): this;
24
+ exclude(selector: SerialFrameSelector): this;
25
+ options(options: RunOptions): this;
26
+ withRules(rules: string | string[]): this;
27
+ withTags(tags: string | string[]): this;
28
+ disableRules(rules: string | string[]): this;
29
+ configure(config: Spec): this;
30
+ disableFrame(selector: string): this;
31
+ setLegacyMode(legacyMode?: boolean): this;
32
+ analyze(): Promise<AxeResults>;
33
+ analyze<T extends AnalyzeCB>(callback?: T): Promise<AxeResults | null>;
34
+ private analyzePromise;
35
+ private runPartialRecursive;
36
+ private finishRun;
37
+ private runLegacy;
38
+ }
39
+
40
+ declare function loadPage(browser: Browser, url: string, pageOpts?: IPageOptions): Promise<OwningAxePuppeteer>;
41
+ declare class OwningAxePuppeteer extends AxePuppeteer {
42
+ private newPage;
43
+ constructor(page: Page, source?: string);
44
+ analyze(): Promise<Axe.AxeResults>;
45
+ analyze<T extends AnalyzeCB>(callback?: T): Promise<Axe.AxeResults | null>;
46
+ }
47
+
48
+ export { AnalyzeCB, AxePuppeteer, IPageOptions, AxePuppeteer as default, loadPage };
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
3
3
  }) : x)(function(x) {
4
4
  if (typeof require !== "undefined")
5
5
  return require.apply(this, arguments);
6
- throw new Error('Dynamic require of "' + x + '" is not supported');
6
+ throw Error('Dynamic require of "' + x + '" is not supported');
7
7
  });
8
8
 
9
9
  // src/axePuppeteer.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axe-core/puppeteer",
3
- "version": "4.8.2-e7606a0.0+e7606a0",
3
+ "version": "4.8.2-e8094c1.0+e8094c1",
4
4
  "description": "Provides a chainable axe API for Puppeteer and automatically injects into all frames",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,7 +35,7 @@
35
35
  "@types/chai": "^4.3.3",
36
36
  "@types/express": "^4.17.14",
37
37
  "@types/mocha": "^10.0.0",
38
- "@types/node": "^18.8.3",
38
+ "@types/node": "^20.8.10",
39
39
  "@types/sinon": "^10.0.13",
40
40
  "@types/test-listen": "^1.1.0",
41
41
  "axe-test-fixtures": "github:dequelabs/axe-test-fixtures#v1",
@@ -49,7 +49,7 @@
49
49
  "source-map-support": "^0.5.21",
50
50
  "test-listen": "^1.1.0",
51
51
  "ts-node": "^10.9.1",
52
- "tsup": "^6.7.0",
52
+ "tsup": "^7.2.0",
53
53
  "typescript": "^4.8.4"
54
54
  },
55
55
  "dependencies": {
@@ -88,5 +88,5 @@
88
88
  "functions": 85,
89
89
  "lines": 85
90
90
  },
91
- "gitHead": "e7606a04705dc077d4adaae0a4ee2a02decc8500"
91
+ "gitHead": "e8094c18cde388c7c4b7218e1daa22151b8054f0"
92
92
  }