import { LibraryConfig, DeepPartial, ConfigPath, ConfigSource, ConfigChangeListener, RuntimeConfigOptions, Unsubscribe, Milliseconds } from '../types'; interface ConfigSnapshot { timestamp: Date; config: DeepPartial; reason?: string; } /** * Manages runtime configuration updates with batching, persistence, and rollback. * * @example * ```typescript * const manager = RuntimeConfigManager.getInstance(); * * // Enable persistence * manager.enablePersistence(); * * // Make changes (batched) * manager.set('network.defaultTimeout', 60000); * manager.set('cache.defaultTTL', 120000); * * // Manually flush batched changes * manager.flush(); * * // Rollback to last snapshot * manager.rollback(); * * // Start polling remote config * manager.startPolling('https://config.example.com/lib-config'); * ``` */ export declare class RuntimeConfigManager { private static instance; private options; private pendingChanges; private snapshots; private debounceTimer; private pollingTimer; private remoteUrl; private listeners; private maxSnapshots; private constructor(); /** * Get the singleton instance. */ static getInstance(options?: RuntimeConfigOptions): RuntimeConfigManager; /** * Reset the singleton instance (for testing). */ static resetInstance(): void; /** * Set a configuration value (batched by default). */ set(path: ConfigPath, value: unknown, source?: ConfigSource): void; /** * Set a configuration value immediately (bypasses batching). */ setImmediate(path: ConfigPath, value: unknown, source?: ConfigSource): void; /** * Apply a partial configuration overlay (batched). */ applyOverlay(overlay: DeepPartial, source?: ConfigSource): void; /** * Apply a partial configuration overlay immediately. */ applyOverlayImmediate(overlay: DeepPartial, source?: ConfigSource): void; /** * Flush all pending changes. */ flush(): void; /** * Cancel pending changes. */ cancelPending(): void; /** * Get the number of pending changes. */ getPendingCount(): number; /** * Create a snapshot of the current configuration. */ createSnapshot(reason?: string): void; /** * Rollback to the last snapshot. */ rollback(): boolean; /** * Get all snapshots. */ getSnapshots(): readonly ConfigSnapshot[]; /** * Clear all snapshots. */ clearSnapshots(): void; /** * Enable configuration persistence. */ enablePersistence(storageKey?: string): void; /** * Disable configuration persistence. */ disablePersistence(): void; /** * Save current configuration to storage. */ saveToStorage(): void; /** * Load configuration from storage. */ loadFromStorage(): void; /** * Clear persisted configuration. */ clearStorage(): void; /** * Start polling for remote configuration updates. */ startPolling(url: string, interval?: Milliseconds): void; /** * Stop polling for remote configuration. */ stopPolling(): void; /** * Fetch remote configuration once. */ fetchRemoteConfig(): Promise; /** * Subscribe to runtime configuration changes. */ subscribe(listener: ConfigChangeListener): Unsubscribe; private scheduleFlush; private traverseAndQueue; } /** * Get the RuntimeConfigManager singleton instance. */ export declare function getRuntimeConfigManager(options?: RuntimeConfigOptions): RuntimeConfigManager; /** * Set a runtime configuration value. */ export declare function setRuntimeConfig(path: ConfigPath, value: unknown): void; /** * Apply a runtime configuration overlay. */ export declare function applyRuntimeOverlay(overlay: DeepPartial): void; /** * Rollback to the previous configuration snapshot. */ export declare function rollbackConfig(): boolean; /** * Start polling for remote configuration. */ export declare function startConfigPolling(url: string, interval?: Milliseconds): void; /** * Stop polling for remote configuration. */ export declare function stopConfigPolling(): void; export {};