axe-core 4.7.1 → 4.7.2-canary.049522e

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
@@ -157,6 +157,10 @@ Axe-core has a new minor release every 3 to 5 months, which usually introduces n
157
157
  - See [release and support](doc/release-and-support.md) for details on the frequency of releases, long-term support and recommendations on upgrading axe-core.
158
158
  - See [backward compatibility](doc/backwards-compatibility-doc.md) for details on the types of changes different releases may introduce.
159
159
 
160
+ ## Deque Trademarks Policy
161
+
162
+ DEQUE, DEQUELABS, AXE®, and AXE-CORE® are trademarks of Deque Systems, Inc. Use of the Deque trademarks must be in accordance with [Deque's trademark policy](https://www.deque.com/legal/trademarks/).
163
+
160
164
  ## Supported ARIA Roles and Attributes.
161
165
 
162
166
  Refer [axe-core ARIA support](./doc/aria-supported.md) for a complete list of ARIA supported roles and attributes by axe.
package/axe.d.ts CHANGED
@@ -164,9 +164,9 @@ declare namespace axe {
164
164
  interface NodeResult {
165
165
  html: string;
166
166
  impact?: ImpactValue;
167
- target: string[];
167
+ target: UnlabelledFrameSelector;
168
168
  xpath?: string[];
169
- ancestry?: string[];
169
+ ancestry?: UnlabelledFrameSelector;
170
170
  any: CheckResult[];
171
171
  all: CheckResult[];
172
172
  none: CheckResult[];
@@ -181,8 +181,11 @@ declare namespace axe {
181
181
  relatedNodes?: RelatedNode[];
182
182
  }
183
183
  interface RelatedNode {
184
- target: string[];
185
184
  html: string;
185
+ target: UnlabelledFrameSelector;
186
+ xpath?: string[];
187
+ ancestry?: UnlabelledFrameSelector;
188
+ element?: HTMLElement;
186
189
  }
187
190
  interface RuleLocale {
188
191
  [key: string]: {
@@ -193,7 +196,7 @@ declare namespace axe {
193
196
  interface CheckMessages {
194
197
  pass: string | { [key: string]: string };
195
198
  fail: string | { [key: string]: string };
196
- incomplete: string | { [key: string]: string };
199
+ incomplete?: string | { [key: string]: string };
197
200
  }
198
201
  interface CheckLocale {
199
202
  [key: string]: CheckMessages;
@@ -257,10 +260,31 @@ declare namespace axe {
257
260
  brand?: string;
258
261
  application?: string;
259
262
  }
263
+ interface CheckHelper {
264
+ async: () => (result: boolean | undefined | Error) => void;
265
+ data: (data: unknown) => void;
266
+ relatedNodes: (nodes: Element[]) => void;
267
+ }
268
+ interface AfterResult {
269
+ id: string;
270
+ data?: unknown;
271
+ relatedNodes: SerialDqElement[];
272
+ result: boolean | undefined;
273
+ node: SerialDqElement;
274
+ }
260
275
  interface Check {
261
276
  id: string;
262
- evaluate?: Function | string;
263
- after?: Function | string;
277
+ evaluate?:
278
+ | string
279
+ | ((
280
+ this: CheckHelper,
281
+ node: Element,
282
+ options: unknown,
283
+ virtualNode: VirtualNode
284
+ ) => boolean | undefined | void);
285
+ after?:
286
+ | string
287
+ | ((results: AfterResult[], options: unknown) => AfterResult[]);
264
288
  options?: any;
265
289
  matches?: string;
266
290
  enabled?: boolean;
@@ -280,9 +304,10 @@ declare namespace axe {
280
304
  all?: string[];
281
305
  none?: string[];
282
306
  tags?: string[];
283
- matches?: string;
307
+ matches?: string | ((node: Element, virtualNode: VirtualNode) => boolean);
284
308
  reviewOnFail?: boolean;
285
- metadata?: Omit<RuleMetadata, 'ruleId'>;
309
+ actIds?: string[];
310
+ metadata?: Omit<RuleMetadata, 'ruleId' | 'tags' | 'actIds'>;
286
311
  }
287
312
  interface AxePlugin {
288
313
  id: string;
@@ -367,6 +392,42 @@ declare namespace axe {
367
392
  shadowSelect: (selector: CrossTreeSelector) => Element | null;
368
393
  shadowSelectAll: (selector: CrossTreeSelector) => Element[];
369
394
  getStandards(): Required<Standards>;
395
+ DqElement: new (
396
+ elm: Element,
397
+ options?: { absolutePaths?: boolean }
398
+ ) => SerialDqElement;
399
+ uuid: (
400
+ options?: { random?: Uint8Array | Array<number> },
401
+ buf?: Uint8Array | Array<number>,
402
+ offset?: number
403
+ ) => string | Uint8Array | Array<number>;
404
+ }
405
+
406
+ interface Aria {
407
+ getRoleType: (role: string | Element | VirtualNode | null) => string | null;
408
+ }
409
+
410
+ interface Dom {
411
+ isFocusable: (node: Element | VirtualNode) => boolean;
412
+ isNativelyFocusable: (node: Element | VirtualNode) => boolean;
413
+ }
414
+
415
+ type AccessibleTextOptions = {
416
+ inControlContext?: boolean;
417
+ inLabelledByContext?: boolean;
418
+ };
419
+
420
+ interface Text {
421
+ accessibleText: (
422
+ element: Element,
423
+ options?: AccessibleTextOptions
424
+ ) => string;
425
+ }
426
+
427
+ interface Commons {
428
+ aria: Aria;
429
+ dom: Dom;
430
+ text: Text;
370
431
  }
371
432
 
372
433
  interface EnvironmentData {
@@ -380,6 +441,7 @@ declare namespace axe {
380
441
  let version: string;
381
442
  let plugins: any;
382
443
  let utils: Utils;
444
+ let commons: Commons;
383
445
 
384
446
  /**
385
447
  * Source string to use as an injected script in Selenium