import { LibraryConfig, DeepPartial, DeepReadonly, ConfigPath, ConfigSource, ConfigChangeListener, Unsubscribe, IConfigRegistry, Environment } from '../types'; /** * Centralized configuration registry for the library. * * Provides type-safe access to all library configuration with support for: * - Runtime updates * - Environment-specific overrides * - Change subscriptions * - Source tracking * * @example * ```typescript * const registry = ConfigRegistry.getInstance(); * * // Get complete config * const config = registry.getConfig(); * * // Get specific value * const timeout = registry.get('network.defaultTimeout'); * * // Update at runtime * registry.set('network.defaultTimeout', 60000); * * // Subscribe to changes * const unsub = registry.subscribe((event) => { * console.log(`${event.path} changed to ${event.newValue}`); * }); * ``` */ export declare class ConfigRegistry implements IConfigRegistry { private static instance; private config; private sources; private listeners; private pathListeners; private environment; private frozen; private constructor(); /** * Get the singleton instance. */ static getInstance(): ConfigRegistry; /** * Reset the singleton instance (for testing). */ static resetInstance(): void; /** * Get the complete library configuration (frozen). */ getConfig(): DeepReadonly; /** * Get a configuration value by path. */ get(path: ConfigPath, defaultValue?: T): T; /** * Check if a configuration path exists. */ has(path: ConfigPath): boolean; /** * Set a runtime configuration value. */ set(path: ConfigPath, value: unknown, source?: ConfigSource): void; /** * Reset configuration to defaults. */ reset(path?: ConfigPath): void; /** * Subscribe to all configuration changes. */ subscribe(listener: ConfigChangeListener): Unsubscribe; /** * Subscribe to changes at a specific path. */ subscribeToPath(path: ConfigPath, listener: ConfigChangeListener): Unsubscribe; /** * Apply environment-specific overrides. */ applyEnvironmentOverrides(env: Environment): void; /** * Get the source of a configuration value. */ getSource(path: ConfigPath): ConfigSource; /** * Get the current environment. */ getEnvironment(): Environment; /** * Apply a partial configuration overlay. */ applyOverlay(overlay: DeepPartial, source?: ConfigSource): void; /** * Freeze the configuration (prevent further modifications). */ freeze(): void; /** * Unfreeze the configuration. */ unfreeze(): void; /** * Check if configuration is frozen. */ isFrozen(): boolean; /** * Get all configuration paths. */ getAllPaths(): string[]; /** * Export configuration as JSON. */ toJSON(): string; /** * Import configuration from JSON. */ fromJSON(json: string, source?: ConfigSource): void; /** * Initialize source tracking for all paths. */ private initializeSources; private traverseAndMarkSource; /** * Detect and apply environment. * Uses centralized detectEnvironment() from environment-config to avoid * duplicating environment detection logic across the codebase. */ private detectEnvironment; private emitChange; } /** * Get the ConfigRegistry singleton instance. */ export declare function getConfigRegistry(): ConfigRegistry; /** * Get the complete library configuration. */ export declare function getLibConfig(): DeepReadonly; /** * Get a configuration value by path. */ export declare function getLibConfigValue(path: ConfigPath, defaultValue?: T): T; /** * Set a runtime configuration value. */ export declare function setLibConfigValue(path: ConfigPath, value: unknown): void; /** * Subscribe to configuration changes. */ export declare function subscribeToLibConfig(listener: ConfigChangeListener): Unsubscribe; /** * Type-safe accessors for configuration domains. */ export declare const LIB_CONFIG: { readonly network: DeepReadonly; readonly cache: DeepReadonly; readonly flags: DeepReadonly; readonly auth: DeepReadonly; readonly layouts: DeepReadonly; readonly vdom: DeepReadonly; readonly ui: DeepReadonly; readonly monitoring: DeepReadonly; };