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

193 lines 5.77 kB
import { AccessibilityIssue } from '../types'; import { WCAGCriterion, CodeExample } from '../data/wcag-database'; import { ReportIssue } from '../types/output'; /** * Enhanced issue processing options */ export interface IssueProcessingOptions { /** Include code examples in remediation */ includeCodeExamples: boolean; /** Include testing guidance */ includeTestingGuidance: boolean; /** Include estimated fix time */ includeTimeEstimates: boolean; /** Priority mode for recommendations */ priorityMode: 'severity' | 'impact' | 'effort' | 'quickWins'; /** Context-aware recommendations */ contextAware: boolean; /** Maximum number of code examples per issue */ maxCodeExamples: number; } /** * Enhanced issue with detailed WCAG information */ export interface EnhancedIssue extends ReportIssue { /** Full WCAG criterion information */ wcagCriterion?: WCAGCriterion; /** Contextual remediation guidance */ contextualRemediation?: ContextualRemediation; /** Priority score for fixing */ priorityScore?: number; /** Estimated impact assessment of fixing this issue */ impactAssessment?: IssueImpact; /** Testing guidance */ testingGuidance?: TestingGuidance; /** Related issues that might exist */ relatedIssues?: string[]; /** Fix complexity assessment */ complexity?: FixComplexity; } /** * Contextual remediation based on element and context */ export interface ContextualRemediation { /** Context-specific summary */ summary: string; /** Tailored steps for this specific context */ steps: string[]; /** Code examples relevant to this context */ codeExamples: CodeExample[]; /** Tools specific to this issue type */ recommendedTools: string[]; /** Additional considerations for this context */ considerations: string[]; /** Urgency level */ urgency: 'immediate' | 'high' | 'medium' | 'low'; } /** * Issue impact assessment */ export interface IssueImpact { /** Estimated percentage of users affected */ usersAffected: number; /** Assistive technologies impacted */ assistiveTechImpact: string[]; /** Business impact description */ businessImpact: string; /** Legal compliance risk */ complianceRisk: 'high' | 'medium' | 'low'; } /** * Testing guidance for verification */ export interface TestingGuidance { /** Quick manual tests */ quickTests: string[]; /** Automated testing tools */ automatedTools: string[]; /** Screen reader specific tests */ screenReaderTests?: string[]; /** Keyboard navigation tests */ keyboardTests?: string[]; /** Verification criteria */ verificationCriteria: string[]; } /** * Fix complexity assessment */ export interface FixComplexity { /** Overall complexity level */ level: 'simple' | 'moderate' | 'complex' | 'architectural'; /** Estimated time to fix */ estimatedTime: string; /** Skills required */ skillsRequired: string[]; /** Dependencies and blockers */ dependencies: string[]; /** Risk of introducing new issues */ riskLevel: 'low' | 'medium' | 'high'; } /** * Enhanced issue processor for detailed accessibility reporting */ export declare class IssueProcessor { private defaultOptions; /** * Process and enhance accessibility issues with detailed WCAG information */ processIssues(issues: AccessibilityIssue[], options?: Partial<IssueProcessingOptions>): Promise<EnhancedIssue[]>; /** * Enhance a single issue with detailed information * @private */ private enhanceIssue; /** * Convert AccessibilityIssue to ReportIssue format * @private */ private convertToReportIssue; /** * Generate contextual remediation guidance * @private */ private generateContextualRemediation; /** * Calculate priority score for issue * @private */ private calculatePriorityScore; /** * Assess the impact of an issue * @private */ private assessIssueImpact; /** * Assess fix complexity * @private */ private assessFixComplexity; /** * Generate testing guidance * @private */ private generateTestingGuidance; /** * Analyze element context * @private */ private analyzeElementContext; /** * Helper methods for issue analysis * @private */ private categorizeIssue; private generateIssueTitle; private convertToAffectedElement; private truncateHtml; private extractElementText; private findPatternMatch; private determineUrgency; private addFormSpecificSteps; private addInteractiveElementSteps; private addImageSpecificSteps; private contextualizeGuidance; private contextualizeSteps; private getRecommendedTools; private getContextualConsiderations; private isHighImpactIssue; private isQuickWin; private determineAssistiveTechImpact; private estimateUsersAffected; private assessComplianceRisk; private generateBusinessImpact; private generateQuickTests; private generateVerificationCriteria; private findRelatedIssues; /** * Generate issue summary statistics */ generateIssueSummary(issues: EnhancedIssue[]): { total: number; bySeverity: Record<string, number>; byCategory: Record<string, number>; byComplexity: Record<string, number>; byUrgency: Record<string, number>; quickWins: number; highImpact: number; }; private groupBySeverity; private groupByCategory; private groupByComplexity; private groupByUrgency; } //# sourceMappingURL=issue-processor.d.ts.map