import { S as Strategy, C as Category } from './index-CBmIhSX_.cjs'; /** * @silverassist/performance-toolkit * * Lighthouse CI type definitions. * * @module types/lighthouse * @author Miguel Colmenares * @license PolyForm-Noncommercial-1.0.0 */ /** * Lighthouse CI execution method */ type LHCIMethod = "node" | "psi"; /** * Lighthouse CI configuration options */ interface LHCIOptions { /** URLs to analyze */ urls: string[]; /** Execution method */ method?: LHCIMethod; /** Number of runs per URL */ numberOfRuns?: number; /** PSI API key (required for 'psi' method) */ psiApiKey?: string; /** PSI strategy (for 'psi' method) */ psiStrategy?: Strategy; /** Chrome flags (for 'node' method) */ chromeFlags?: string[]; /** Lighthouse config path */ configPath?: string; /** Output directory for reports */ outputDir?: string; } /** * Lighthouse CI assertion configuration */ interface LHCIAssertions { /** Minimum performance score (0-1) */ "categories:performance"?: ["error" | "warn", { minScore: number; }]; /** Minimum accessibility score (0-1) */ "categories:accessibility"?: ["error" | "warn", { minScore: number; }]; /** Minimum best practices score (0-1) */ "categories:best-practices"?: ["error" | "warn", { minScore: number; }]; /** Minimum SEO score (0-1) */ "categories:seo"?: ["error" | "warn", { minScore: number; }]; /** Maximum LCP in milliseconds */ "largest-contentful-paint"?: ["error" | "warn", { maxNumericValue: number; }]; /** Maximum FCP in milliseconds */ "first-contentful-paint"?: ["error" | "warn", { maxNumericValue: number; }]; /** Maximum CLS */ "cumulative-layout-shift"?: ["error" | "warn", { maxNumericValue: number; }]; /** Maximum TBT in milliseconds */ "total-blocking-time"?: ["error" | "warn", { maxNumericValue: number; }]; } /** * Lighthouse CI full configuration */ interface LHCIConfig { ci: { collect: { url: string[]; method?: LHCIMethod; numberOfRuns?: number; psiApiKey?: string; psiStrategy?: Strategy; settings?: { chromeFlags?: string[]; preset?: "desktop" | "mobile"; }; }; assert?: { assertions: LHCIAssertions; }; upload?: { target: "temporary-public-storage" | "lhci" | "filesystem"; serverBaseUrl?: string; token?: string; outputDir?: string; }; }; } /** * @silverassist/performance-toolkit * * Configuration and threshold type definitions. * * @module types/config * @author Miguel Colmenares * @license PolyForm-Noncommercial-1.0.0 */ /** * Performance thresholds for pass/fail decisions */ interface PerformanceThresholds { /** Minimum performance score (0-100) */ performance?: number; /** Maximum LCP in milliseconds */ lcp?: number; /** Maximum FCP in milliseconds */ fcp?: number; /** Maximum CLS (unitless) */ cls?: number; /** Maximum TBT in milliseconds */ tbt?: number; /** Maximum TTI in milliseconds */ tti?: number; /** Maximum SI (Speed Index) in milliseconds */ si?: number; /** Minimum accessibility score (0-100) */ accessibility?: number; /** Minimum best-practices score (0-100) */ bestPractices?: number; /** Minimum SEO score (0-100) */ seo?: number; } /** * Project-level performance configuration */ interface ProjectConfig { /** URLs to analyze */ urls: string[]; /** Default strategy */ strategy: Strategy; /** Categories to analyze */ categories: Category[]; /** Thresholds for each URL pattern */ thresholds: PerformanceThresholds; /** URL-specific threshold overrides */ urlThresholds?: Record>; /** CI/CD integration settings */ ci?: { /** Fail build on threshold violation */ failOnViolation: boolean; /** Comment on PR */ commentOnPR: boolean; /** Upload to dashboard */ uploadToDashboard: boolean; }; } /** * Complete toolkit configuration */ interface ToolkitConfig { /** Google PageSpeed API key */ apiKey?: string; /** Default strategy */ defaultStrategy: Strategy; /** Default categories */ defaultCategories: Category[]; /** Default thresholds */ defaultThresholds: PerformanceThresholds; /** LHCI assertions config */ assertions?: LHCIAssertions; /** Enable detailed insights extraction */ extractInsights: boolean; /** Cache settings */ cache?: { /** Enable caching */ enabled: boolean; /** Cache TTL in seconds */ ttl: number; /** Cache directory */ directory?: string; }; /** Retry settings */ retry?: { /** Max retry attempts */ maxAttempts: number; /** Initial delay in ms */ initialDelay: number; /** Backoff multiplier */ backoffMultiplier: number; }; } export type { LHCIAssertions as L, PerformanceThresholds as P, ToolkitConfig as T, LHCIConfig as a, LHCIMethod as b, LHCIOptions as c, ProjectConfig as d };