/** * Web Vitals measurement utilities * Implements Google's Core Web Vitals metrics */ export type MetricName = 'CLS' | 'FCP' | 'FID' | 'LCP' | 'TTFB' | 'INP'; export interface WebVitalMetric { name: MetricName; value: number; rating: 'good' | 'needs-improvement' | 'poor'; } export type WebVitalReportCallback = (metric: WebVitalMetric) => void; /** * Measure Cumulative Layout Shift (CLS) */ export declare function measureCLS(onReport: WebVitalReportCallback): void; /** * Measure First Contentful Paint (FCP) */ export declare function measureFCP(onReport: WebVitalReportCallback): void; /** * Measure Largest Contentful Paint (LCP) */ export declare function measureLCP(onReport: WebVitalReportCallback): void; /** * Measure First Input Delay (FID) */ export declare function measureFID(onReport: WebVitalReportCallback): void; /** * Measure Time to First Byte (TTFB) */ export declare function measureTTFB(onReport: WebVitalReportCallback): void; /** * Measure Interaction to Next Paint (INP) */ export declare function measureINP(onReport: WebVitalReportCallback): void; /** * Initialize all Web Vitals measurements */ export declare function initWebVitals(onReport?: WebVitalReportCallback): void; /** * Report route change performance * @param fromRoute - Previous route * @param toRoute - New route * @param duration - Time taken in milliseconds */ export declare function reportRouteChange(fromRoute: string, toRoute: string, duration: number): void; /** * Report custom performance metric * @param metricName - Name of the custom metric * @param value - Numeric value of the metric * @param attributes - Optional attributes to add context */ export declare function reportCustomMetric(metricName: string, value: number, attributes?: Record): void; /** * Report API call performance * @param endpoint - API endpoint * @param duration - Time taken in milliseconds * @param status - HTTP status code * @param method - HTTP method */ export declare function reportApiCall(endpoint: string, duration: number, status: number, method?: string): void; //# sourceMappingURL=web-vitals.d.ts.map