2025-02-26 17:58:30 +01:00
|
|
|
/**
|
2025-02-27 10:33:58 +01:00
|
|
|
* Audit categories available in Lighthouse
|
2025-02-26 17:58:30 +01:00
|
|
|
*/
|
2025-02-27 10:33:58 +01:00
|
|
|
export enum AuditCategory {
|
|
|
|
ACCESSIBILITY = "accessibility",
|
|
|
|
PERFORMANCE = "performance",
|
|
|
|
SEO = "seo",
|
2025-02-27 12:54:48 +01:00
|
|
|
BEST_PRACTICES = "best-practices", // Not yet implemented
|
|
|
|
PWA = "pwa", // Not yet implemented
|
2025-02-26 17:58:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2025-02-27 10:33:58 +01:00
|
|
|
* Base interface for Lighthouse report metadata
|
2025-02-26 17:58:30 +01:00
|
|
|
*/
|
2025-02-27 10:33:58 +01:00
|
|
|
export interface LighthouseReport {
|
|
|
|
metadata: {
|
2025-02-26 17:58:30 +01:00
|
|
|
url: string;
|
2025-02-27 10:33:58 +01:00
|
|
|
timestamp: string; // ISO 8601, e.g., "2025-02-27T14:30:00Z"
|
|
|
|
device: string; // e.g., "mobile", "desktop"
|
|
|
|
lighthouseVersion: string; // e.g., "10.4.0"
|
2025-02-26 17:58:30 +01:00
|
|
|
};
|
2025-02-27 10:33:58 +01:00
|
|
|
overallScore: number;
|
|
|
|
failedAuditsCount: number;
|
|
|
|
passedAuditsCount: number;
|
|
|
|
manualAuditsCount: number;
|
|
|
|
informativeAuditsCount: number;
|
|
|
|
notApplicableAuditsCount: number;
|
|
|
|
failedAudits: any[];
|
2025-02-26 17:58:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Configuration options for Lighthouse audits
|
|
|
|
*/
|
|
|
|
export interface LighthouseConfig {
|
|
|
|
flags: {
|
|
|
|
output: string[];
|
|
|
|
onlyCategories: string[];
|
|
|
|
formFactor: string;
|
|
|
|
port: number | undefined;
|
|
|
|
screenEmulation: {
|
|
|
|
mobile: boolean;
|
|
|
|
width: number;
|
|
|
|
height: number;
|
|
|
|
deviceScaleFactor: number;
|
|
|
|
disabled: boolean;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config: {
|
|
|
|
extends: string;
|
|
|
|
settings: {
|
|
|
|
onlyCategories: string[];
|
|
|
|
emulatedFormFactor: string;
|
|
|
|
throttling: {
|
|
|
|
cpuSlowdownMultiplier: number;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|