perf-lens
Version:
AI-powered frontend performance optimizer
92 lines • 1.88 kB
TypeScript
/**
* AI provider types
*/
export type AIProvider = 'openai' | 'anthropic' | 'gemini';
/**
* Network throttle types
*/
export type NetworkThrottle = 'slow3G' | 'fast3G' | '4G' | 'none';
/**
* Global configuration
*/
export interface GlobalConfig {
verbose?: boolean;
}
/**
* AI model configuration
*/
export interface AIModelConfig {
provider: AIProvider;
model: string;
maxTokens?: number;
temperature?: number;
apiKey?: string;
}
/**
* Performance thresholds
*/
export interface PerformanceThresholds {
fcp?: number;
lcp?: number;
fid?: number;
cls?: number;
tti?: number;
tbt?: number;
speedIndex?: number;
performance?: number;
}
/**
* Bundle size thresholds
*/
export interface BundleThresholds {
maxInitialSize?: string;
maxChunkSize?: string;
maxAsyncChunks?: number;
maxTotalSize?: string;
}
/**
* Analysis configuration
*/
export interface AnalysisConfig {
targetDir?: string;
maxFiles?: number;
batchSize?: number;
maxFileSize?: number;
batchDelay?: number;
ignore?: string[];
include?: string[];
}
/**
* Lighthouse configuration
*/
export interface LighthouseConfig {
port?: number;
mobileEmulation?: boolean;
throttling?: {
cpu?: number;
network?: NetworkThrottle;
};
timeout?: number;
retries?: number;
}
/**
* Output configuration
*/
export interface OutputConfig {
directory?: string;
filename?: string;
format?: 'md' | 'html';
includeTimestamp?: boolean;
}
/**
* Main PerfLens configuration
*/
export interface PerflensConfig extends GlobalConfig {
ai?: AIModelConfig;
thresholds?: PerformanceThresholds;
bundleThresholds?: BundleThresholds;
analysis?: AnalysisConfig;
lighthouse?: LighthouseConfig;
output?: OutputConfig;
}
//# sourceMappingURL=config.d.ts.map