/** * Coverage Analyzer * * Analyzes coverage data to provide insights, trends, and recommendations. */ import type { FileCoverage, CoverageMetrics, CoverageResult, CoverageTrend, CoverageGap, CoverageComparison, CoverageThreshold, CoverageType, CoverageReport } from './types.js'; /** * Historical coverage data point */ interface HistoricalCoverage { runId: string; timestamp: number; metrics: CoverageMetrics; } /** * Coverage Analyzer class */ export declare class CoverageAnalyzer { private history; /** * Analyze coverage and generate insights */ analyze(result: CoverageResult, threshold?: CoverageThreshold): CoverageReport; /** * Check if coverage meets thresholds */ checkThresholds(metrics: CoverageMetrics, threshold?: CoverageThreshold): boolean; /** * Check if a single file meets thresholds */ checkFileThresholds(file: FileCoverage, threshold?: CoverageThreshold): boolean; /** * Find coverage gaps */ findGaps(files: Record, threshold?: CoverageThreshold): CoverageGap[]; /** * Calculate priority for covering a file */ private calculatePriority; /** * Estimate effort to cover a file */ private estimateEffort; /** * Generate test suggestions for a file */ private generateSuggestions; /** * Group consecutive numbers into ranges */ private groupConsecutiveNumbers; /** * Get top and bottom files by coverage */ getTopFiles(files: Record, limit?: number): Array<{ path: string; coverage: number; type: 'best' | 'worst'; }>; /** * Compare two coverage results */ compare(baseResult: CoverageResult, compareResult: CoverageResult): CoverageComparison; /** * Add historical coverage data */ addHistory(key: string, data: HistoricalCoverage): void; /** * Get coverage trends */ getTrends(key: string, type?: CoverageType, limit?: number): CoverageTrend[]; /** * Calculate trend direction */ getTrendDirection(trends: CoverageTrend[]): 'improving' | 'stable' | 'declining'; /** * Predict future coverage based on trends */ predictCoverage(key: string, type: CoverageType | undefined, targetCoverage: number): { predictedReach: number | null; projectedCoverage: number; confidence: 'high' | 'medium' | 'low'; }; /** * Generate coverage summary text */ generateSummary(metrics: CoverageMetrics): string; /** * Format coverage percentage with color indicator */ formatCoverage(percentage: number, threshold?: number): string; /** * Clear history */ clearHistory(key?: string): void; } /** * Create a coverage analyzer */ export declare function createCoverageAnalyzer(): CoverageAnalyzer; export {};