axe-core 4.8.2 → 4.8.3-canary.b63cd83

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/README.md CHANGED
@@ -93,7 +93,7 @@ The [axe-core API](doc/API.md) package consists of:
93
93
 
94
94
  ## Localization
95
95
 
96
- Axe can be built using your local language. To do so, a localization file must be added to the `./locales` directory. This file must have be named in the following manner: `<langcode>.json`. To build axe using this locale, instead of the default, run axe with the `--lang` flag, like so:
96
+ Axe can be built using your local language. To do so, a localization file must be added to the `./locales` directory. This file must be named in the following manner: `<langcode>.json`. To build axe using this locale, instead of the default, run axe with the `--lang` flag, like so:
97
97
 
98
98
  `grunt build --lang=nl`
99
99
 
@@ -101,7 +101,7 @@ or equivalently:
101
101
 
102
102
  `npm run build -- --lang=nl`
103
103
 
104
- This will create a new build for axe, called `axe.<lang>.js` and `axe.<lang>.min.js`. If you want to build localized versions, simply pass in `--all-lang` instead. If you want to build multiple localized versions (but not all of them), you can pass in a comma-separated list of languages to the `--lang` flag, like `--lang=nl,ja`.
104
+ This will create a new build for axe, called `axe.<lang>.js` and `axe.<lang>.min.js`. If you want to build all localized versions, simply pass in `--all-lang` instead. If you want to build multiple localized versions (but not all of them), you can pass in a comma-separated list of languages to the `--lang` flag, like `--lang=nl,ja`.
105
105
 
106
106
  To create a new translation for axe, start by running `grunt translate --lang=<langcode>`. This will create a json file fin the `./locales` directory, with the default English text in it for you to translate. Alternatively, you could copy `./locales/_template.json`. We welcome any localization for axe-core. For details on how to contribute, see the Contributing section below. For details on the message syntax, see [Check Message Template](/docs/check-message-template.md).
107
107
 
package/axe.d.ts CHANGED
@@ -1,13 +1,12 @@
1
1
  // Type definitions for axe-core
2
2
  // Project: https://github.com/dequelabs/axe-core
3
- // Definitions by: Marcy Sutton <https://github.com/marcysutton>
4
3
 
5
4
  declare namespace axe {
6
5
  type ImpactValue = 'minor' | 'moderate' | 'serious' | 'critical' | null;
7
6
 
8
7
  type TagValue = string;
9
8
 
10
- type ReporterVersion = 'v1' | 'v2' | 'raw' | 'raw-env' | 'no-passes';
9
+ type ReporterVersion = 'v1' | 'v2' | 'raw' | 'rawEnv' | 'no-passes';
11
10
 
12
11
  type RunOnlyType = 'rule' | 'rules' | 'tag' | 'tags';
13
12
 
@@ -132,7 +131,7 @@ declare namespace axe {
132
131
  interface RunOptions {
133
132
  runOnly?: RunOnly | TagValue[] | string[] | string;
134
133
  rules?: RuleObject;
135
- reporter?: ReporterVersion;
134
+ reporter?: ReporterVersion | string;
136
135
  resultTypes?: resultGroups[];
137
136
  selectors?: boolean;
138
137
  ancestry?: boolean;
@@ -333,6 +332,14 @@ declare namespace axe {
333
332
  xpath: string[];
334
333
  ancestry: UnlabelledFrameSelector;
335
334
  }
335
+ interface DqElement extends SerialDqElement {
336
+ element: Element;
337
+ toJSON(): SerialDqElement;
338
+ mergeSpecs(
339
+ childSpec: SerialDqElement,
340
+ parentSpec: SerialDqElement
341
+ ): SerialDqElement;
342
+ }
336
343
  interface PartialRuleResult {
337
344
  id: string;
338
345
  result: 'inapplicable';
@@ -351,16 +358,21 @@ declare namespace axe {
351
358
  frameContext: FrameContextObject;
352
359
  }
353
360
 
361
+ interface RawCheckResult extends Omit<CheckResult, 'relatedNodes'> {
362
+ relatedNodes?: Array<SerialDqElement | DqElement>;
363
+ }
364
+
354
365
  interface RawNodeResult<T extends 'passed' | 'failed' | 'incomplete'> {
355
- any: CheckResult[];
356
- all: CheckResult[];
357
- none: CheckResult[];
366
+ node: SerialDqElement | DqElement;
367
+ any: RawCheckResult[];
368
+ all: RawCheckResult[];
369
+ none: RawCheckResult[];
358
370
  impact: ImpactValue | null;
359
371
  result: T;
360
372
  }
361
373
 
362
374
  interface RawResult extends Omit<Result, 'nodes'> {
363
- inapplicable: [];
375
+ inapplicable: Array<never>;
364
376
  passes: RawNodeResult<'passed'>[];
365
377
  incomplete: RawNodeResult<'incomplete'>[];
366
378
  violations: RawNodeResult<'failed'>[];
@@ -383,6 +395,7 @@ declare namespace axe {
383
395
  attr(attr: string): string | null;
384
396
  hasAttr(attr: string): boolean;
385
397
  props: { [key: string]: unknown };
398
+ boundingClientRect: DOMRect;
386
399
  }
387
400
 
388
401
  interface Utils {
@@ -396,7 +409,7 @@ declare namespace axe {
396
409
  DqElement: new (
397
410
  elm: Element,
398
411
  options?: { absolutePaths?: boolean }
399
- ) => SerialDqElement;
412
+ ) => DqElement;
400
413
  uuid: (
401
414
  options?: { random?: Uint8Array | Array<number> },
402
415
  buf?: Uint8Array | Array<number>,