forked from vue-a11y/vue-axe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
156 lines (147 loc) · 3.46 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import { PluginFunction } from 'vue';
export interface RunOptions {
clearConsole: boolean;
element: Document | HTMLElement;
}
export interface AxeConfig {
/**
* mixed(optional) Used to set the branding of the helpUrls
*/
branding?: {
/**
* string(optional) sets the brand string - default "axe"
*/
brand?: string;
/**
* string(optional) sets the application string - default "axeAPI"
*/
application?: string;
};
/**
* Used to set the output format that the axe.run function will pass to the callback function
*/
reporter?: string;
/**
* Used to add checks to the list of checks used by rules, or to override the properties of existing checks
*/
checks?: any;
/**
* Used to add rules to the existing set of rules, or to override the properties of existing rules
*/
rules?: any;
/**
* A locale object to apply (at runtime) to all rules and checks, in the same shape as /locales/*.json.
*/
locale?: any;
/**
* Set the compatible version of a custom rule with the current axe version. Compatible versions are all patch and minor updates that are the same as, or newer than those of the `axeVersion` property
*/
axeVersion?: string;
}
export interface AxeRunOptions {
/**
* Limit which rules are executed, based on names or tags
*/
runOnly?: any;
/**
* Allow customizing a rule's properties (including { enable: false })
*/
rules?: any;
/**
* Which reporter to use
*/
reporter?: string;
/**
* Limit which result types are processed and aggregated
*/
resultTypes?: any;
/**
* Return xpath selectors for elements
*/
xpath?: boolean;
/**
* Use absolute paths when creating element selectors
*/
absolutePaths?: boolean;
/**
* Tell axe to run inside iframes
*/
iframes?: boolean;
/**
* Return element references in addition to the target
*/
elementRef?: boolean;
/**
* Scrolls elements back to before axe started
*/
restoreScroll?: boolean;
/**
* How long (in milliseconds) axe waits for a response from embedded frames before timing out
*/
frameWaitTime?: number;
/**
* Any additional assets (eg: cssom) to preload before running rules
*/
preload?: boolean;
/**
* Log rule performance metrics to the console
*/
performanceTimer?: boolean;
}
export interface VueAxeStyle {
head?: string;
boldCourier?: string;
moderate?: string;
critical?: string;
serious?: string;
minor?: string;
title?: string;
url?: string;
}
export interface VueAxeOptions {
/**
* Disables automatic verification. Only checks with $axe.run
*/
auto?: boolean;
/**
* Clears the console each time vue-axe runs
*/
clearConsoleOnUpdate?: boolean;
/**
* Provide your Axe-core configuration
*/
config?: AxeConfig;
/**
* Provide your Axe-core runtime options
*/
runOptions?: AxeRunOptions;
/**
* Used to delay the first check. - `Millisecond`
*/
delay?: number;
/**
*
*/
style?: VueAxeStyle;
/**
* Register Axe plugins
*/
plugins?: any[];
/**
* Handle the results. (This may be needed for automated tests)
*/
customResultHandler?: (error: any, results: any) => any;
}
export interface VueAxe {
run({ clearConsole, element }: RunOptions): void;
plugins: Record<string, any>;
}
declare module 'vue/types/vue' {
interface Vue {
$axe: VueAxe;
}
}
declare class VueAxePlugin {
static install: PluginFunction<VueAxeOptions>;
}
export default VueAxePlugin;