UNPKG

@casoon/auditmysite

Version:

Professional website analysis suite with robust accessibility testing, Core Web Vitals performance monitoring, SEO analysis, and content optimization insights. Features isolated browser contexts, retry mechanisms, and comprehensive API endpoints for profe

237 lines 6.29 kB
import { MobileFriendlinessMetrics } from './types/enhanced-metrics'; export interface Pa11yIssue { code: string; message: string; type: 'error' | 'warning' | 'notice'; selector?: string; context?: string; impact?: string; help?: string; helpUrl?: string; } export interface AccessibilityResult { url: string; title: string; imagesWithoutAlt: number; buttonsWithoutLabel: number; headingsCount: number; errors: string[]; warnings: string[]; passed: boolean; crashed?: boolean; skipped?: boolean; duration: number; pa11yScore?: number; pa11yIssues?: any[]; performanceMetrics?: { loadTime: number; domContentLoaded: number; firstPaint: number; renderTime: number; firstContentfulPaint: number; largestContentfulPaint: number; cumulativeLayoutShift?: number; interactionToNextPaint?: number; timeToFirstByte?: number; performanceScore?: number; performanceGrade?: 'A' | 'B' | 'C' | 'D' | 'F'; }; keyboardNavigation?: string[]; colorContrastIssues?: string[]; focusManagementIssues?: string[]; screenshots?: { desktop?: string; mobile?: string; }; consoleErrors?: string[]; networkErrors?: string[]; lighthouseScores?: LighthouseScores; lighthouseMetrics?: LighthouseMetrics; mobileFriendliness?: MobileFriendlinessMetrics; redirectInfo?: { status?: number; originalUrl: string; finalUrl: string; type: 'http_redirect' | 'automatic_redirect'; }; } export interface TestOptions { maxPages?: number; timeout?: number; waitUntil?: "domcontentloaded" | "load" | "networkidle"; filterPatterns?: string[]; includePatterns?: string[]; verbose?: boolean; output?: "console" | "json" | "html"; outputFile?: string; pa11yStandard?: 'WCAG2A' | 'WCAG2AA' | 'WCAG2AAA' | 'Section508'; hideElements?: string; includeNotices?: boolean; includeWarnings?: boolean; includePasses?: boolean; runners?: string[]; wait?: number; chromeLaunchConfig?: any; captureScreenshots?: boolean; testKeyboardNavigation?: boolean; testColorContrast?: boolean; testFocusManagement?: boolean; collectPerformanceMetrics?: boolean; blockImages?: boolean; blockCSS?: boolean; mobileEmulation?: boolean; viewportSize?: { width: number; height: number; }; userAgent?: string; maxConcurrent?: number; maxRetries?: number; retryDelay?: number; enableProgressBar?: boolean; progressUpdateInterval?: number; enableResourceMonitoring?: boolean; maxMemoryUsage?: number; maxCpuUsage?: number; useParallelTesting?: boolean; outputFormat?: 'markdown' | 'html' | 'pdf'; usePa11y?: boolean; lighthouse?: boolean; eventCallbacks?: { onUrlStarted?: (url: string) => void; onUrlCompleted?: (url: string, result: AccessibilityResult, duration: number) => void; onUrlFailed?: (url: string, error: string, attempts: number) => void; onProgressUpdate?: (stats: any) => void; onQueueEmpty?: () => void; }; } export interface LighthouseScores { performance: number; accessibility: number; bestPractices: number; seo: number; } export interface LighthouseMetrics { firstContentfulPaint: number; largestContentfulPaint: number; firstInputDelay: number; cumulativeLayoutShift: number; totalBlockingTime: number; speedIndex: number; } export interface SitemapUrl { loc: string; lastmod?: string; changefreq?: string; priority?: number; } export interface TestSummary { totalPages: number; testedPages: number; passedPages: number; failedPages: number; crashedPages: number; totalErrors: number; totalWarnings: number; totalDuration: number; results: AccessibilityResult[]; } /** * Central, unified issue interface for all report types */ export interface AuditIssue { reportType: 'accessibility' | 'security' | 'seo' | 'performance'; pageUrl: string; pageTitle?: string; type: string; severity: 'error' | 'warning' | 'info'; message: string; code?: string; selector?: string; context?: string; htmlSnippet?: string; lineNumber?: number; source?: string; recommendation?: string; resource?: string; score?: number; metric?: string; } /** * @deprecated Please use AuditIssue! */ export interface DetailedIssue extends AuditIssue { } export interface AuditConfig { sitemap?: string; maxPages?: number; timeout?: number; outputDir?: string; standards?: string[]; performance?: { enabled?: boolean; lighthouse?: boolean; coreWebVitals?: boolean; }; security?: { enabled?: boolean; scanHeaders?: boolean; httpsCheck?: boolean; cspCheck?: boolean; }; accessibility?: { enabled?: boolean; pa11y?: boolean; wcag?: string; }; seo?: { enabled?: boolean; metaCheck?: boolean; structuredData?: boolean; }; mobile?: { enabled?: boolean; touchTargets?: boolean; pwa?: boolean; }; parallel?: { maxConcurrent?: number; maxRetries?: number; retryDelay?: number; }; output?: { format?: 'markdown' | 'html' | 'json' | 'csv'; includeDetails?: boolean; }; logging?: { level?: 'debug' | 'info' | 'warn' | 'error'; file?: string; verbose?: boolean; }; } export interface PresetConfig { name: string; description: string; config: Partial<AuditConfig>; } export interface SecurityScanResult { url: string; timestamp: string; overallScore: number; tests: { securityHeaders: any; https: any; csp: any; vulnerability: any; }; summary: { totalIssues: number; totalWarnings: number; criticalIssues: number; highIssues: number; mediumIssues: number; lowIssues: number; }; recommendations: string[]; } //# sourceMappingURL=types.d.ts.map