UNPKG

a11yanalyze

Version:

A command-line tool for developers and QA engineers to test web pages and websites for WCAG 2.2 AA accessibility compliance

106 lines 2.64 kB
import { Page } from 'playwright'; import { RuleEngineConfig, RuleResult, WCAGRule } from '../types'; /** * Hybrid rule engine combining axe-core with custom WCAG 2.2 rules * Provides comprehensive accessibility testing with extensible rule system */ export declare class RuleEngine { private config; private customRules; private disabledRules; constructor(config: RuleEngineConfig); /** * Initialize rule engine with axe-core and custom rules * @private */ private initializeRules; /** * Configure axe-core based on WCAG level and preferences * @private */ private setupAxeCore; /** * Load and validate custom WCAG rules * @private */ private loadCustomRules; /** * Validate custom rule configuration * @private */ private validateRule; /** * Execute accessibility scan on a page using hybrid rule engine * @param page - Playwright page instance * @returns Promise<RuleResult[]> */ executeRules(page: Page): Promise<RuleResult[]>; /** * Execute axe-core accessibility rules * @private */ private executeAxeCore; /** * Transform axe-core results to standard RuleResult format * @private */ private transformAxeResults; /** * Execute custom WCAG 2.2 rules * @private */ private executeCustomRules; /** * Execute a single custom rule * @private */ private executeCustomRule; /** * Extract WCAG reference from axe tags * @private */ private extractWcagReference; /** * Determine WCAG level from tags * @private */ private determineWcagLevel; /** * Transform axe node information * @private */ private transformAxeNodes; /** * Add a custom rule to the engine */ addCustomRule(rule: WCAGRule): void; /** * Remove a custom rule from the engine */ removeCustomRule(ruleId: string): void; /** * Enable a previously disabled rule */ enableRule(ruleId: string): void; /** * Disable a rule from execution */ disableRule(ruleId: string): void; /** * Get current rule configuration */ getConfiguration(): RuleEngineConfig; /** * Get list of available custom rules */ getCustomRules(): WCAGRule[]; /** * Get list of disabled rules */ getDisabledRules(): string[]; /** * Update engine configuration */ updateConfiguration(newConfig: Partial<RuleEngineConfig>): void; } //# sourceMappingURL=rule-engine.d.ts.map