@sa11y/assert
Version:
Provides assertAccessible API to check DOM for accessibility issues
31 lines • 1.86 kB
TypeScript
import { A11yConfig, AxeResults } from '@sa11y/common';
/**
* Context that can be checked for accessibility: Document, Node or CSS selector.
* Limiting to subset of options supported by axe for ease of use and maintenance.
*/
export type A11yCheckableContext = Document | Node | string;
export declare function getA11yResultsJSDOM(context?: A11yCheckableContext, rules?: A11yConfig, enableIncompleteResults?: boolean): Promise<AxeResults>;
/**
* Get list of a11y issues incomplete for given element and ruleset
* @param context - DOM or HTML Node to be tested for accessibility
* @param rules - A11yConfig preset rule to use, defaults to `base` ruleset
* @param reportType - Type of report ('violations' or 'incomplete')
* @returns {@link AxeResults} - list of accessibility issues found
*/
export declare function getIncompleteJSDOM(context?: A11yCheckableContext, rules?: A11yConfig): Promise<AxeResults>;
/**
* Get list of a11y issues violations for given element and ruleset
* @param context - DOM or HTML Node to be tested for accessibility
* @param rules - A11yConfig preset rule to use, defaults to `base` ruleset
* @param reportType - Type of report ('violations' or 'incomplete')
* @returns {@link AxeResults} - list of accessibility issues found
*/
export declare function getViolationsJSDOM(context?: A11yCheckableContext, rules?: A11yConfig): Promise<AxeResults>;
/**
* Checks DOM for accessibility issues and throws an error if violations are found.
* @param context - DOM or HTML Node to be tested for accessibility
* @param rules - A11yConfig preset rule to use, defaults to `base` ruleset
* @throws error - with the accessibility issues found, does not return any value
* */
export declare function assertAccessible(context?: A11yCheckableContext, rules?: A11yConfig): Promise<void>;
//# sourceMappingURL=assert.d.ts.map