import { default as React, ReactNode } from 'react'; import { PerformanceObservatoryContext, PerformanceObservatoryContextValue } from '../contexts/PerformanceObservatoryContext'; import { VitalMetricEntry, VitalsSnapshot, BudgetViolation } from './vitals'; /** * Resource statistics */ interface ResourceStats { total: number; totalSize: number; totalDuration: number; byType: Record; slowResources: PerformanceResourceTiming[]; } /** * Long task entry */ interface LongTaskEntry { startTime: number; duration: number; name: string; } /** * Props for PerformanceObservatory */ export interface PerformanceObservatoryProps { /** Show in development only */ devOnly?: boolean; /** Initial collapsed state */ defaultCollapsed?: boolean; /** Position on screen */ position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'; /** Enable analytics reporting */ reportToAnalytics?: boolean; /** Analytics endpoint */ analyticsEndpoint?: string; /** Sample rate for collection */ sampleRate?: number; /** Enable debug mode */ debug?: boolean; /** Custom z-index */ zIndex?: number; } /** * Props for PerformanceProvider */ export interface PerformanceProviderProps { children: ReactNode; /** Collector configuration */ reportToAnalytics?: boolean; analyticsEndpoint?: string; sampleRate?: number; debug?: boolean; /** Callback on metric update */ onMetric?: (metric: VitalMetricEntry, snapshot: VitalsSnapshot) => void; /** Callback on budget violation */ onViolation?: (violation: BudgetViolation) => void; } /** * Hook to access performance observatory context */ export declare function usePerformanceObservatory(): PerformanceObservatoryContextValue; /** * Performance monitoring provider that collects Web Vitals and resource metrics */ export declare function PerformanceProvider({ children, reportToAnalytics, analyticsEndpoint, sampleRate, debug, onMetric, onViolation, }: PerformanceProviderProps): React.JSX.Element; /** * Performance Observatory dashboard component * * @example * ```tsx * * * * * ``` */ export declare function PerformanceObservatory({ devOnly, defaultCollapsed, position, zIndex, }: PerformanceObservatoryProps): React.JSX.Element | null; export { PerformanceObservatoryContext, type PerformanceObservatoryContextValue, type ResourceStats, type LongTaskEntry, };