import { EnzymeExtension } from '../types'; import { VitalsSnapshot } from '../../performance/vitals'; import { PerformanceMetrics } from '../../performance/performance-monitor'; import { BudgetThreshold, BudgetViolationRecord, BudgetStatusSummary } from '../../performance/performance-budgets'; /** * Performance extension configuration */ export interface PerformanceExtensionConfig { /** Enable web vitals tracking */ enableVitals?: boolean; /** Enable component render tracking */ enableRenderTracking?: boolean; /** Enable memory monitoring */ enableMemoryMonitoring?: boolean; /** Enable long task detection */ enableLongTaskDetection?: boolean; /** Enable network metrics */ enableNetworkMetrics?: boolean; /** Sample rate for production (0-1) */ sampleRate?: number; /** Performance budgets */ budgets?: Partial>; /** Report to analytics endpoint */ analyticsEndpoint?: string; /** Enable debug logging */ debug?: boolean; /** Auto-start monitoring */ autoStart?: boolean; } /** * Component render timing */ export interface RenderTiming { componentName: string; startTime: number; endTime?: number; duration?: number; phase: 'mount' | 'update' | 'unmount'; timestamp: number; } /** * Operation timing */ export interface OperationTiming { name: string; startTime: number; endTime: number; duration: number; success: boolean; error?: Error; timestamp: number; } /** * Timeline marker */ export interface TimelineMarker { name: string; timestamp: number; type: 'mark' | 'measure'; duration?: number; } /** * Aggregated metrics with percentiles */ export interface AggregatedMetrics { /** Metric name */ name: string; /** Sample count */ count: number; /** Minimum value */ min: number; /** Maximum value */ max: number; /** Average value */ mean: number; /** Median (50th percentile) */ p50: number; /** 75th percentile */ p75: number; /** 90th percentile */ p90: number; /** 95th percentile */ p95: number; /** 99th percentile */ p99: number; /** Standard deviation */ stdDev: number; } /** * Network quality estimate */ export interface NetworkQuality { effectiveType: string; downlink: number; rtt: number; saveData: boolean; timestamp: number; } /** * Bundle size info */ export interface BundleInfo { name: string; size: number; gzipSize?: number; type: 'initial' | 'async' | 'vendor'; timestamp: number; } /** * Performance report */ export interface PerformanceReport { /** Report generation timestamp */ timestamp: number; /** Current URL */ url: string; /** Session duration */ sessionDuration: number; /** Web Vitals snapshot */ vitals: VitalsSnapshot | null; /** Performance metrics */ performance: PerformanceMetrics | null; /** Budget status */ budgetStatus: BudgetStatusSummary[]; /** Recent violations */ violations: BudgetViolationRecord[]; /** Aggregated render metrics */ renderMetrics: AggregatedMetrics[]; /** Network quality */ networkQuality: NetworkQuality | null; /** Overall health score (0-100) */ healthScore: number; /** Recommendations */ recommendations: string[]; } /** * Performance monitoring extension for Enzyme * * Provides comprehensive performance tracking capabilities including: * - Web Vitals (LCP, FID, CLS, FCP, TTFB, INP) * - Component render performance * - Memory monitoring * - Long task detection * - Performance budgets * - Metric aggregation and reporting */ export declare const performanceExtension: EnzymeExtension; export default performanceExtension;