/** * Web Vitals Manager * * Extends LazyFeature to handle lazy-loading the web-vitals script. * Captures Core Web Vitals (LCP, CLS, FCP, INP, TTFB) and sends them * as batched $web_vitals events. * * Event structure: * - event: "$web_vitals" * - properties: * - $web_vitals_LCP_value: number * - $web_vitals_LCP_event: { name, value, delta, rating, ... } * - $pathname: string * - $current_url: string * * @see docs/patterns/tracker-feature-lifecycle.md */ import { VTiltConfig, CapturePerformanceConfig, SupportedWebVitalsMetric } from "../../types"; import { LazyFeature } from "../../feature"; import type { VTilt } from "../../vtilt"; import { WebVitalsCallbacks } from "../../utils/globals"; export declare class WebVitalsManager extends LazyFeature { readonly name = "WebVitals"; readonly scriptName = "web-vitals"; private _buffer; private _flushTimer; static extractConfig(config: VTiltConfig): CapturePerformanceConfig; constructor(instance: VTilt, config?: CapturePerformanceConfig); get isEnabled(): boolean; /** * Web Vitals checks if callbacks are already registered (from full bundle) * before trying to lazy-load the script. */ startIfEnabled(): void; stop(): void; onConfigUpdate(config: VTiltConfig): void; protected _createLoaded(): WebVitalsCallbacks; protected _onLoaded(loaded: WebVitalsCallbacks): void; get allowedMetrics(): SupportedWebVitalsMetric[]; get flushTimeoutMs(): number; get maxAllowedValue(): number; private _createEmptyBuffer; private _getWebVitalsCallbacks; private _startCapturing; private _getCurrentUrl; private _getCurrentPathname; private _addToBuffer; private _cleanAttribution; private _getWindowId; private _scheduleFlush; private _flush; }