diff --git a/axe.d.ts b/axe.d.ts index eb285d9c2c..c4a4d49d7c 100644 --- a/axe.d.ts +++ b/axe.d.ts @@ -155,6 +155,13 @@ declare namespace axe { }[]; cleanup?(callback: Function): void; } + interface RuleMetadata { + ruleId: string; + description: string; + help: string; + helpUrl: string; + tags: string[]; + } let plugins: any; @@ -203,7 +210,7 @@ declare namespace axe { * @param {Array} tags Optional array of tags * @return {Array} Array of rules */ - function getRules(tags?: string[]): Object[]; + function getRules(tags?: string[]): RuleMetadata[]; /** * Restores the default axe configuration diff --git a/doc/rule-descriptions.md b/doc/rule-descriptions.md index 65323ef344..fbe7e7ca90 100644 --- a/doc/rule-descriptions.md +++ b/doc/rule-descriptions.md @@ -74,7 +74,7 @@ | role-img-alt | Ensures [role='img'] elements have alternate text | Serious | cat.text-alternatives, wcag2a, wcag111, section508, section508.22.a | true | true | false | | scope-attr-valid | Ensures the scope attribute is used correctly on tables | Moderate, Critical | cat.tables, best-practice | true | true | false | | scrollable-region-focusable | Elements that have scrollable content should be accessible by keyboard | Moderate | wcag2a, wcag211 | true | true | false | -| server-side-image-map | Ensures that server-side image maps are not used | Minor | cat.text-alternatives, wcag2a, wcag211, section508, section508.22.f | true | true | false | +| server-side-image-map | Ensures that server-side image maps are not used | Minor | cat.text-alternatives, wcag2a, wcag211, section508, section508.22.f | true | false | true | | skip-link | Ensure all skip links have a focusable target | Moderate | cat.keyboard, best-practice | true | true | true | | tabindex | Ensures tabindex attribute values are not greater than 0 | Serious | cat.keyboard, best-practice | true | true | false | | table-duplicate-name | Ensure that tables do not have the same summary and caption | Minor | cat.tables, best-practice | true | true | false | diff --git a/typings/axe-core/axe-core-tests.ts b/typings/axe-core/axe-core-tests.ts index 09866773aa..11b27ac7e4 100644 --- a/typings/axe-core/axe-core-tests.ts +++ b/typings/axe-core/axe-core-tests.ts @@ -111,6 +111,11 @@ axe.reset(); axe.getRules(['wcag2aa']); typeof axe.getRules() === 'object'; +const rules = axe.getRules(); +rules.forEach(rule => { + rule.ruleId.substr(1234); +}); + // Plugins var pluginSrc: axe.AxePlugin = { id: 'doStuff',