/** * @fileoverview Bridge between library configuration and application configuration. * * This module provides integration between the lib/core/config system and * the application-level @/config system, ensuring consistency and allowing * the library to inherit application-wide settings. * * @module core/config/integration/AppConfigBridge */ /** * Expected shape of app-level environment config. * * This mirrors the EnvConfig from @/config/env.ts */ interface AppEnvConfig { apiBaseUrl: string; apiTimeout: number; apiRetryCount: number; apiRetryDelay: number; wsUrl: string; sseUrl: string; wsReconnectInterval: number; wsMaxReconnectAttempts: number; isDev: boolean; isProd: boolean; isTest: boolean; appEnv: string; } /** * Expected shape of app-level timing config. * * This mirrors TIMING from @/config/timing.constants.ts */ interface AppTimingConfig { API: { TIMEOUT: number; TIMEOUT_LONG: number; TIMEOUT_SHORT: number; TIMEOUT_HEALTH: number; RETRY_BASE_DELAY: number; RETRY_MAX_DELAY: number; }; QUERY: { STALE: { REALTIME: number; SHORT: number; MEDIUM: number; LONG: number; EXTENDED: number; STATIC: number; }; GC: { SHORT: number; MEDIUM: number; LONG: number; }; }; UI: { DEBOUNCE: { FAST: number; INPUT: number; FORM: number; RESIZE: number; SCROLL: number; }; ANIMATION: { FAST: number; STANDARD: number; SLOW: number; }; TOAST: { SHORT: number; STANDARD: number; LONG: number; }; LOADING: { SPINNER_DELAY: number; MIN_DISPLAY: number; }; }; RETRY: { DEFAULT_ATTEMPTS: number; API_ATTEMPTS: number; AUTH_ATTEMPTS: number; }; } /** * Expected shape of app-level API config. * * This mirrors API_CONFIG from @/config/api.config.ts */ interface AppApiConfig { BASE_URL: string; TIMEOUT: { DEFAULT: number; LONG: number; SHORT: number; HEALTH: number; }; RETRY: { ATTEMPTS: number; BASE_DELAY: number; MAX_DELAY: number; }; PAGINATION: { DEFAULT_PAGE: number; DEFAULT_PAGE_SIZE: number; MAX_PAGE_SIZE: number; }; } interface BridgeConfig { /** Whether to auto-sync on changes */ autoSync: boolean; /** Whether to override lib defaults with app config */ overrideDefaults: boolean; /** Log sync operations in development */ debug: boolean; } /** * Bridge between library configuration and application configuration. * * This class synchronizes settings from @/config to the lib/core/config system, * ensuring the library uses the same timeouts, base URLs, and settings as the * application. * * @example * ```typescript * import { env, TIMING, API_CONFIG } from '@/config'; * * // Initialize bridge with app config * const bridge = AppConfigBridge.getInstance(); * bridge.syncFromAppConfig({ env, TIMING, API_CONFIG }); * * // Now library modules use app-level settings * ``` */ export declare class AppConfigBridge { private static instance; private config; private initialized; private constructor(); /** * Get the singleton instance. */ static getInstance(config?: Partial): AppConfigBridge; /** * Reset the singleton instance (for testing). */ static resetInstance(): void; /** * Synchronize library configuration from application configuration. */ syncFromAppConfig(appConfig: { env?: Partial; TIMING?: Partial; API_CONFIG?: Partial; }): void; /** * Synchronize a specific domain from app config. */ syncDomain(domain: 'network' | 'cache' | 'ui', config: object): void; /** * Check if bridge has been initialized. */ isInitialized(): boolean; private mapEnvToNetworkConfig; private mapTimingToNetworkConfig; private mapTimingToCacheConfig; private mapTimingToUIConfig; private mapApiConfigToNetworkConfig; } /** * Get the AppConfigBridge singleton instance. */ export declare function getAppConfigBridge(): AppConfigBridge; /** * Initialize the library config from app config. * * This is the main entry point for bridging app config to library config. * * @example * ```typescript * // In your app initialization * import { env, TIMING, API_CONFIG } from '@/config'; * import { initLibConfigFromApp } from '@/lib/core/config'; * * initLibConfigFromApp({ env, TIMING, API_CONFIG }); * ``` */ export declare function initLibConfigFromApp(appConfig: { env?: Partial; TIMING?: Partial; API_CONFIG?: Partial; }): void; export {};