UNPKG

1.39 kBTypeScriptView Raw
1import { RunOptions, ElementContext } from 'axe-core';
2declare type MaybeElementContext = ElementContext | RunOptions | undefined;
3/**
4 * Validation function used to determine if we have the shape of an {ElementContext} object.
5 *
6 * Function mirrors what axe-core uses for internal param validation.
7 * https://github.com/dequelabs/axe-core/blob/d5b6931cba857a5c787d912ee56bdd973e3742d4/lib/core/public/run.js#L4
8 *
9 * @param potential
10 */
11export declare function _isContext(potential: MaybeElementContext): boolean;
12/**
13 * Normalize the optional params of axe.run()
14 *
15 * Influenced by https://github.com/dequelabs/axe-core/blob/d5b6931cba857a5c787d912ee56bdd973e3742d4/lib/core/public/run.js#L35
16 *
17 * @param elementContext
18 * @param runOptions
19 */
20export declare function _normalizeRunParams(elementContext?: MaybeElementContext, runOptions?: RunOptions | undefined): [ElementContext, RunOptions];
21/**
22 * Runs the axe a11y audit with the given context selector and options.
23 *
24 * @function a11yAudit
25 * @public
26 * @param contextSelector A DOM node specifying the context to run the audit in. Defaults to '#ember-testing-container' if not specified.
27 * @param axeOptions options to provide to the axe audit. Defaults axe-core defaults.
28 */
29export default function a11yAudit(contextSelector?: MaybeElementContext, axeOptions?: RunOptions | undefined): PromiseLike<void>;
30export {};