Skip to content

Commit e699939

Browse files
fix(axe.d.ts): allow Node for include/exclude object (dequelabs#3338)
* fix(axe.d.ts): allow Node for include/exclude object * typo * Update typings/axe-core/axe-core-tests.ts Co-authored-by: Stephen Mathieson <[email protected]> * use Array instead NodeList Co-authored-by: Stephen Mathieson <[email protected]>
1 parent f6d7b14 commit e699939

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

axe.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ declare namespace axe {
5050
type CrossFrameSelector = CrossTreeSelector[];
5151

5252
type ContextObject = {
53-
include?: BaseSelector | Array<BaseSelector | BaseSelector[]>;
54-
exclude?: BaseSelector | Array<BaseSelector | BaseSelector[]>;
53+
include?: Node | BaseSelector | Array<Node | BaseSelector | BaseSelector[]>;
54+
exclude?: Node | BaseSelector | Array<Node | BaseSelector | BaseSelector[]>;
5555
};
5656

5757
type RunCallback = (error: Error, results: AxeResults) => void;

doc/API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ By default, `axe.run` will test the entire document. The context object is an op
327327
The include exclude object is a JSON object with two attributes: include and exclude. Either include or exclude is required. If only `exclude` is specified; include will default to the entire `document`.
328328

329329
- A node, or
330-
- An array of arrays of [CSS selectors](./developer-guide.md#supported-css-selectors)
330+
- An array of Nodes or an array of arrays of [CSS selectors](./developer-guide.md#supported-css-selectors)
331331
- If the nested array contains a single string, that string is the CSS selector
332332
- If the nested array contains multiple strings
333333
- The last string is the final CSS selector

typings/axe-core/axe-core-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as axe from '../../axe';
22

33
var context: any = document;
4-
var $fixture: any = {};
4+
var $fixture = [document];
55
var options = { iframes: false, selectors: false, elementRef: false };
66

77
axe.run(context, {}, (error: Error, results: axe.AxeResults) => {

0 commit comments

Comments
 (0)