import { AxeResults } from '@sa11y/common'; import { A11yResult } from './result'; /** * Custom formatter to format a11y violations found by axe * Use `JSON.stringify` to return violations without formatting */ export interface Formatter { (violations: AxeResults): string; } /** * Highlights the import part of the error message */ export interface Highlighter { (text: string): string; } /** * Optional parameters used while formatting a11y issues */ export interface Options { a11yViolationIndicator: string; helpUrlIndicator: string; formatter?: Formatter; highlighter: Highlighter; deduplicate: boolean; renderedDOMSavedFileName?: string; } /** * Custom error object to represent a11y violations */ export declare class A11yError extends Error { readonly violations: AxeResults; readonly a11yResults: A11yResult[]; renderedDOMSavedFileName: string; /** * Throw error with formatted a11y violations * @param violations - List of a11y violations * @param opts - Options used for formatting a11y issues */ static checkAndThrow(violations: AxeResults, opts?: Partial): void; constructor(violations: AxeResults, a11yResults: A11yResult[], opts?: Partial); get length(): number; /** * Format a11y violations into a readable format highlighting important information to help fixing the issue. * @param opts - Options used for formatting a11y issues. */ format(opts: Partial): string; } //# sourceMappingURL=format.d.ts.map