import { LibraryIntegration } from './library-integration'; /** * Performance flag keys */ export declare const PERFORMANCE_FLAG_KEYS: { /** Enable performance monitoring */ readonly PERF_MONITORING_ENABLED: "perf-monitoring-enabled"; /** Enable web vitals collection */ readonly PERF_VITALS_ENABLED: "perf-vitals-enabled"; /** Enable render profiling */ readonly PERF_PROFILING_ENABLED: "perf-profiling-enabled"; /** Enable memory monitoring */ readonly PERF_MEMORY_ENABLED: "perf-memory-enabled"; /** Enable network monitoring */ readonly PERF_NETWORK_ENABLED: "perf-network-enabled"; /** Enable budget enforcement */ readonly PERF_BUDGETS_ENABLED: "perf-budgets-enabled"; /** Enable long task detection */ readonly PERF_LONG_TASKS_ENABLED: "perf-long-tasks-enabled"; /** Enable prefetching */ readonly PERF_PREFETCH_ENABLED: "perf-prefetch-enabled"; /** Enable predictive prefetch */ readonly PERF_PREDICTIVE_ENABLED: "perf-predictive-enabled"; /** Enable code splitting */ readonly PERF_CODE_SPLITTING_ENABLED: "perf-code-splitting-enabled"; /** Enable RUM (Real User Monitoring) */ readonly PERF_RUM_ENABLED: "perf-rum-enabled"; /** Enable synthetic monitoring */ readonly PERF_SYNTHETIC_ENABLED: "perf-synthetic-enabled"; /** Enable resource hints */ readonly PERF_RESOURCE_HINTS_ENABLED: "perf-resource-hints-enabled"; /** Enable image optimization */ readonly PERF_IMAGE_OPT_ENABLED: "perf-image-opt-enabled"; /** Enable bundle analysis */ readonly PERF_BUNDLE_ANALYSIS_ENABLED: "perf-bundle-analysis-enabled"; /** Enable degradation mode */ readonly PERF_DEGRADATION_ENABLED: "perf-degradation-enabled"; }; export type PerformanceFlagKey = (typeof PERFORMANCE_FLAG_KEYS)[keyof typeof PERFORMANCE_FLAG_KEYS]; /** * Performance flag configuration */ export interface PerformanceFlagConfig { /** Enable monitoring */ readonly monitoringEnabled: boolean; /** Enable vitals collection */ readonly vitalsEnabled: boolean; /** Enable render profiling */ readonly profilingEnabled: boolean; /** Enable memory monitoring */ readonly memoryEnabled: boolean; /** Enable network monitoring */ readonly networkEnabled: boolean; /** Enable budget enforcement */ readonly budgetsEnabled: boolean; /** Enable long task detection */ readonly longTasksEnabled: boolean; /** Enable prefetching */ readonly prefetchEnabled: boolean; /** Enable predictive prefetch */ readonly predictiveEnabled: boolean; /** Enable code splitting */ readonly codeSplittingEnabled: boolean; /** Enable RUM */ readonly rumEnabled: boolean; /** Enable synthetic monitoring */ readonly syntheticEnabled: boolean; /** Enable resource hints */ readonly resourceHintsEnabled: boolean; /** Enable image optimization */ readonly imageOptEnabled: boolean; /** Enable bundle analysis */ readonly bundleAnalysisEnabled: boolean; /** Enable degradation mode */ readonly degradationEnabled: boolean; /** Index signature for Record compatibility */ [key: string]: unknown; } /** * Monitoring configuration with flag overrides */ export interface FlaggedMonitoringConfig { /** Whether monitoring is active */ readonly active: boolean; /** Sampling rate (0-1) */ readonly sampleRate: number; /** Features to monitor */ readonly features: { vitals: boolean; memory: boolean; network: boolean; longTasks: boolean; renders: boolean; }; /** Budget configuration */ readonly budgets: { enabled: boolean; enforceOnViolation: boolean; }; } /** * Optimization configuration with flag overrides */ export interface FlaggedOptimizationConfig { /** Whether optimization is active */ readonly active: boolean; /** Prefetch configuration */ readonly prefetch: { enabled: boolean; predictive: boolean; maxItems: number; }; /** Code splitting configuration */ readonly codeSplitting: { enabled: boolean; threshold: number; }; /** Image optimization */ readonly images: { enabled: boolean; lazy: boolean; responsive: boolean; }; } /** * Default performance flag configuration */ export declare const DEFAULT_PERFORMANCE_FLAG_CONFIG: PerformanceFlagConfig; /** * Create performance flag integration */ export declare function createPerformanceFlagIntegration(): LibraryIntegration; declare const performanceIntegration: LibraryIntegration; /** * Performance flags helper class */ declare class PerformanceFlagsHelper { setFlagGetter(getter: (flagKey: string) => boolean): void; isMonitoringEnabled(): boolean; isVitalsEnabled(): boolean; isProfilingEnabled(): boolean; isMemoryEnabled(): boolean; isNetworkEnabled(): boolean; isBudgetsEnabled(): boolean; isLongTasksEnabled(): boolean; isPrefetchEnabled(): boolean; isPredictiveEnabled(): boolean; isCodeSplittingEnabled(): boolean; isRumEnabled(): boolean; isSyntheticEnabled(): boolean; isResourceHintsEnabled(): boolean; isImageOptEnabled(): boolean; isBundleAnalysisEnabled(): boolean; isDegradationEnabled(): boolean; getAllFlags(): Record; private getFlag; } /** * Global performance flags helper instance */ export declare const performanceFlags: PerformanceFlagsHelper; /** * Hook to get performance flag configuration */ export declare function usePerformanceFlagConfig(): PerformanceFlagConfig; /** * Hook to check a specific performance flag */ export declare function usePerformanceFlag(flagKey: PerformanceFlagKey): boolean; /** * Hook to get flagged monitoring configuration */ export declare function useFlaggedMonitoringConfig(options?: { defaultSampleRate?: number; }): FlaggedMonitoringConfig; /** * Hook to get flagged optimization configuration */ export declare function useFlaggedOptimizationConfig(options?: { maxPrefetchItems?: number; codeSplitThreshold?: number; }): FlaggedOptimizationConfig; /** * Get monitoring configuration based on flags */ export declare function getFlaggedMonitoringConfig(getFlag: (flagKey: string) => boolean, options?: { defaultSampleRate?: number; }): FlaggedMonitoringConfig; /** * Get optimization configuration based on flags */ export declare function getFlaggedOptimizationConfig(getFlag: (flagKey: string) => boolean, options?: { maxPrefetchItems?: number; codeSplitThreshold?: number; }): FlaggedOptimizationConfig; /** * Degradation level based on performance flags and budget violations */ export type DegradationLevel = 'none' | 'light' | 'moderate' | 'heavy'; /** * Get degradation configuration based on flags */ export declare function getDegradationConfig(getFlag: (flagKey: string) => boolean, budgetViolations?: number): { level: DegradationLevel; disableAnimations: boolean; disableImages: boolean; disablePrefetch: boolean; reduceQuality: boolean; }; /** * Hook for performance degradation */ export declare function usePerformanceDegradation(budgetViolations?: number): { level: DegradationLevel; disableAnimations: boolean; disableImages: boolean; disablePrefetch: boolean; reduceQuality: boolean; }; export { performanceIntegration };