/** * Network Configuration Manager * Dynamic preset system that respects user configuration while providing temporary overrides * Handles conflicts with existing network utilities and provides comprehensive debugging */ import type { NetworkQualityPreset, UserNetworkPreferences, TemporaryOverride, DebuggerConfigSource, NetworkPresetName } from '@plyaz/types/api'; /** * Network quality preset configurations * These work alongside existing network utilities without conflicts */ /** * User configuration preferences that should be preserved */ /** * Temporary override information for debugging and restoration */ /** * Network Configuration Manager Class */ export declare class NetworkConfigurationManager { private userPreferences; private availablePresets; private activeOverrides; private currentPreset?; private monitoringEnabled; private cleanupFunctions; constructor(); /** * Set user preferences that should be preserved across preset changes */ setUserPreferences(preferences: UserNetworkPreferences): void; /** * Get current user preferences */ getUserPreferences(): UserNetworkPreferences; /** * Register a custom network quality preset */ registerPreset(preset: NetworkQualityPreset): void; /** * Get all available presets */ getAvailablePresets(): NetworkQualityPreset[]; /** * Helper to validate and get preset */ private validateAndGetPreset; /** * Helper to apply tracking to config */ private applyTrackingToConfig; /** * Apply a specific preset with user preference consideration */ applyPreset(presetId: string, options?: { temporary?: boolean; duration?: number; context?: { endpoint?: string; clientName?: string; configPath?: string; }; }): NetworkQualityPreset['config']; /** * Apply temporary configuration override with automatic restoration */ applyTemporaryOverride(property: string, value: unknown, options: { duration?: number; reason: string; source?: DebuggerConfigSource; context?: { endpoint?: string; clientName?: string; configPath?: string; }; }): () => void; /** * Get optimal preset for current network conditions */ getOptimalPreset(): NetworkQualityPreset | null; /** * Enable automatic preset monitoring and switching */ enableAutoPresetSwitching(): void; /** * Disable automatic preset monitoring */ disableAutoPresetSwitching(): void; /** * Get current active overrides for debugging */ getActiveOverrides(): TemporaryOverride[]; /** * Restore all temporary overrides */ restoreAllOverrides(): void; /** * Get configuration manager stats for debugging */ getStats(): { currentPreset?: string; activeOverrides: number; userPreferences: UserNetworkPreferences; availablePresets: string[]; monitoringEnabled: boolean; }; /** * Get the currently active preset ID */ getActivePreset(): string | undefined; /** * Get all temporary overrides currently active */ getTemporaryOverrides(): Record; /** * Cleanup resources */ dispose(): void; /** * Apply a preset by name (convenience method) */ applyPresetByName(name: NetworkPresetName, options?: { temporary?: boolean; duration?: number; context?: { endpoint?: string; clientName?: string; configPath?: string; }; }): NetworkQualityPreset['config']; /** * Initialize default network quality presets */ private initializeDefaultPresets; /** * Setup event handlers for configuration tracking */ private setupEventHandlers; /** * Apply timeout preferences to config */ private applyTimeoutPreferences; /** * Apply caching preferences to config */ private applyCachingPreferences; /** * Apply retry preferences to config */ private applyRetryPreferences; /** * Apply endpoint-specific overrides to config */ private applyEndpointOverrides; /** * Merge preset config with user preferences */ private mergeWithUserPreferences; /** * Find preset for specific quality level */ private findPresetForQuality; /** * Find best preset for current network conditions */ private findBestPresetForConditions; /** * Check if quality matches preset requirements */ private qualityMatchesPreset; /** * Check if save-data setting matches preset requirements */ private saveDataMatchesPreset; /** * Check if RTT is within preset threshold */ private rttWithinThreshold; /** * Check if downlink meets preset minimum */ private downlinkMeetsMinimum; /** * Check if preset matches current network conditions */ private presetMatchesConditions; /** * Track user preference overrides for debugging */ private trackUserPreferenceOverride; /** * Track preference changes */ private trackPreferenceChanges; /** * Schedule automatic restoration of a preset */ private schedulePresetRestore; /** * Get current configuration value (placeholder for actual implementation) */ private getCurrentConfigValue; /** * Set configuration value (placeholder for actual implementation) */ private setConfigValue; } /** * Global network configuration manager instance */ export declare const networkConfigManager: NetworkConfigurationManager; /** * Convenience function to apply temporary network override */ export declare function applyTemporaryNetworkOverride(property: string, value: unknown, options: { duration?: number; reason: string; endpoint?: string; clientName?: string; }): () => void; /** * Get network configuration optimized for current conditions with user preferences */ export declare function getOptimizedNetworkConfig(): NetworkQualityPreset['config'] | null; //# sourceMappingURL=networkConfigurationManager.d.ts.map