diff --git a/axe.d.ts b/axe.d.ts index c373d6ece5..eb285d9c2c 100644 --- a/axe.d.ts +++ b/axe.d.ts @@ -13,14 +13,14 @@ declare namespace axe { type resultGroups = 'inapplicable' | 'passes' | 'incomplete' | 'violations'; - type RunOnlyObject = { + type ContextObject = { include?: string[] | string[][]; exclude?: string[] | string[][]; }; type RunCallback = (error: Error, results: AxeResults) => void; - type ElementContext = Node | string | RunOnlyObject; + type ElementContext = Node | string | ContextObject; interface TestEngine { name: string; @@ -38,7 +38,7 @@ declare namespace axe { } interface RunOnly { type: RunOnlyType; - values?: TagValue[] | string[] | RunOnlyObject; + values: TagValue[] | string[]; } interface RunOptions { runOnly?: RunOnly; diff --git a/doc/API.md b/doc/API.md index 62a8727b78..dd0e60ccf7 100644 --- a/doc/API.md +++ b/doc/API.md @@ -102,8 +102,8 @@ The current set of tags supported are listed in the following table: | Tag Name | Accessibility Standard/Purpose | | --------------- | :-----------------------------------------: | -| `wcag2a` | WCAG 2.0 & WCAG 2.1 Level A | -| `wcag2aa` | WCAG 2.0 & WCAG 2.1 Level AA | +| `wcag2a` | WCAG 2.0 & WCAG 2.1 Level A | +| `wcag2aa` | WCAG 2.0 & WCAG 2.1 Level AA | | `wcag21a` | WCAG 2.1 Level A | | `wcag21aa` | WCAG 2.1 Level AA | | `section508` | Section 508 | @@ -397,7 +397,7 @@ Additionally, there are a number or properties that allow configuration of diffe | `elementRef` | `false` | Return element references in addition to the target | | `restoreScroll` | `false` | Scrolls elements back to before axe started | | `frameWaitTime` | `60000` | How long (in milliseconds) axe waits for a response from embedded frames before timing out | -| `preload` | `true` | Any additional assets (eg: cssom) to preload before running rules. [See here for configuration details](#preload-configuration-details) | +| `preload` | `true` | Any additional assets (eg: cssom) to preload before running rules. [See here for configuration details](#preload-configuration-details) | | `performanceTimer` | `false` | Log rule performance metrics to the console | ###### Options Parameter Examples @@ -519,29 +519,6 @@ axe.run( This example includes all level A rules except for valid-lang, and in addition will include the level AA color-contrast rule. -5. Run only some tags, but exclude others - -Similar to scope, the runOnly option can accept an object with an 'include' and 'exclude' property. Only those checks that match an included tag will run, except those that share a tag from the exclude list. - -```js -axe.run( - { - runOnly: { - type: 'tags', - values: { - include: ['wcag2a', 'wcag2aa'], - exclude: ['experimental'] - } - } - }, - (err, results) => { - // ... - } -); -``` - -This example first includes all `wcag2a` and `wcag2aa` rules. All rules that are tagged as `experimental` are than removed from the list of rules to run. - 6. Only process certain types of results The `resultTypes` option can be used to limit the number of nodes for a rule to a maximum of one. This can be useful for improving performance on very large or complicated pages when you are only interested in certain types of results. diff --git a/typings/axe-core/axe-core-tests.ts b/typings/axe-core/axe-core-tests.ts index f30d830a98..09866773aa 100644 --- a/typings/axe-core/axe-core-tests.ts +++ b/typings/axe-core/axe-core-tests.ts @@ -57,21 +57,6 @@ var tagConfig = { axe.run(context, tagConfig, (error: Error, results: axe.AxeResults) => { console.log(error || results); }); -axe.run( - context, - { - runOnly: { - type: 'tags', - values: { - include: ['wcag2a', 'wcag2aa'], - exclude: ['experimental'] - } - } - }, - (error: Error, results: axe.AxeResults) => { - console.log(error || results); - } -); axe.run( context, {