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

156 lines 4.79 kB
/** * Constants for Accessibility Testing * Centralized configuration values to avoid magic numbers */ /** * Timeout configurations (in milliseconds) */ export declare const TIMEOUTS: { /** Default page navigation timeout */ readonly DEFAULT_NAVIGATION: 30000; /** Pa11y test timeout */ readonly PA11Y_TEST: 15000; /** Minimal URL test timeout */ readonly MINIMAL_TEST: 5000; /** Wait time before running pa11y */ readonly PA11Y_WAIT: 1000; /** Queue item timeout */ readonly QUEUE_ITEM: 30000; /** Browser idle timeout */ readonly BROWSER_IDLE: 30000; }; /** * Concurrency configurations */ export declare const CONCURRENCY: { /** Default maximum concurrent tests */ readonly DEFAULT_MAX: 3; /** Maximum browser pool size */ readonly MAX_POOL_SIZE: 5; /** Initial browser warmup count */ readonly WARMUP_COUNT: 1; }; /** * Retry configurations */ export declare const RETRY: { /** Maximum retry attempts for failed tests */ readonly MAX_ATTEMPTS: 3; /** Delay between retries (in milliseconds) */ readonly DELAY_MS: 2000; }; /** * Scoring configurations */ export declare const SCORING: { /** Points deducted per pa11y error */ readonly ERROR_PENALTY: 2.5; /** Points deducted per pa11y warning */ readonly WARNING_PENALTY: 1; /** Points deducted per image without alt */ readonly IMAGE_NO_ALT_PENALTY: 3; /** Points deducted per button without label */ readonly BUTTON_NO_LABEL_PENALTY: 5; /** Points deducted for no headings */ readonly NO_HEADINGS_PENALTY: 20; /** Fallback scoring penalties */ readonly FALLBACK: { readonly ERROR_PENALTY: 15; readonly WARNING_PENALTY: 5; readonly IMAGE_NO_ALT: 3; readonly BUTTON_NO_LABEL: 5; readonly NO_HEADINGS: 20; }; }; /** * Viewport configurations */ export declare const VIEWPORT: { /** Default desktop viewport */ readonly DESKTOP: { readonly width: 1920; readonly height: 1080; }; /** Mobile viewport */ readonly MOBILE: { readonly width: 375; readonly height: 667; }; /** Tablet viewport */ readonly TABLET: { readonly width: 768; readonly height: 1024; }; }; /** * HTTP Status code ranges */ export declare const HTTP_STATUS: { /** Successful responses */ readonly SUCCESS_MIN: 200; readonly SUCCESS_MAX: 299; /** Redirect responses */ readonly REDIRECT_MIN: 300; readonly REDIRECT_MAX: 399; /** Client error responses */ readonly CLIENT_ERROR_MIN: 400; readonly CLIENT_ERROR_MAX: 499; /** Server error responses */ readonly SERVER_ERROR_MIN: 500; readonly SERVER_ERROR_MAX: 599; /** Common status codes */ readonly OK: 200; readonly NOT_FOUND: 404; readonly MOVED_PERMANENTLY: 301; readonly FOUND: 302; }; /** * User agent strings */ export declare const USER_AGENTS: { /** Default user agent for testing */ readonly DEFAULT: "auditmysite/2.0.0 (+https://github.com/casoon/AuditMySite)"; /** Desktop Chrome user agent */ readonly CHROME_DESKTOP: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"; /** Mobile user agent */ readonly MOBILE: "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1"; }; /** * Default hide elements for pa11y */ export declare const PA11Y_HIDE_ELEMENTS = "iframe[src*=\"google-analytics\"], iframe[src*=\"doubleclick\"]"; /** * Progress update intervals */ export declare const PROGRESS: { /** Queue progress update interval (ms) */ readonly UPDATE_INTERVAL: 3000; /** Progress reporting threshold (%) */ readonly REPORT_THRESHOLD: 25; }; /** * Memory configurations */ export declare const MEMORY: { /** Node max old space size (MB) */ readonly MAX_OLD_SPACE_SIZE: 2048; /** Browser args for memory optimization */ readonly BROWSER_ARGS: readonly ["--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage", "--disable-gpu", "--memory-pressure-off", "--max_old_space_size=2048"]; }; /** * Helper function to check if status code is in range */ export declare function isHttpStatusInRange(status: number, min: number, max: number): boolean; /** * Helper function to check if status is success */ export declare function isHttpSuccess(status: number): boolean; /** * Helper function to check if status is redirect */ export declare function isHttpRedirect(status: number): boolean; /** * Helper function to check if status is error */ export declare function isHttpError(status: number): boolean; //# sourceMappingURL=constants.d.ts.map