import { ConfigRecord, ConfigValue, ConfigSource, ConfigSourceType, ConfigSchema, ConfigLoaderOptions, RemoteConfigOptions, Environment } from './types'; /** * Configuration loader that combines multiple sources. */ export declare class ConfigLoader { private sources; private schema?; private options; private loaded; private cachedConfig; constructor(options?: ConfigLoaderOptions); /** * Set the configuration schema for validation. */ setSchema(schema: ConfigSchema): this; /** * Add a source with default values. */ addDefaultSource(config: ConfigRecord): this; /** * Add environment variables as a source. */ addEnvSource(prefix?: string): this; /** * Add a static configuration source. */ addSource(type: ConfigSourceType, name: string, data: ConfigRecord, priority?: number): this; /** * Add a remote configuration source. */ addRemoteSource(options: RemoteConfigOptions): Promise; /** * Load and merge all configuration sources. */ load(): Promise; /** * Get the current configuration. */ getConfig(): ConfigRecord; /** * Get a value from the configuration. */ get(path: string, defaultValue?: T): T; /** * Get the current environment. */ getEnvironment(): Environment; /** * Check if a source is loaded. */ hasSource(name: string): boolean; /** * Get all loaded sources. */ getSources(): readonly ConfigSource[]; /** * Clear all sources. */ clearSources(): void; private loadFromEnvironment; private envKeyToConfigKey; private parseEnvValue; /** * Load configuration from a remote URL. * * Note: This method intentionally uses raw fetch() rather than apiClient because: * 1. Config loading happens before the apiClient may be fully initialized * 2. Config endpoints may be on CDN or static hosting (not API servers) * 3. The config loader should be independent of the API layer * * @see {@link @/lib/api/api-client} for the main API client */ private loadFromRemote; private applyDefaults; private defaultDetectEnvironment; private getDefaultPriority; private log; } /** * Create a configuration loader with common setup. */ export declare function createConfigLoader(options?: ConfigLoaderOptions): ConfigLoader; /** * Load configuration from multiple sources. */ export declare function loadConfig(defaults: ConfigRecord, options?: ConfigLoaderOptions): Promise;