/** * Configuration Manager for Smart Tiered Cache * Handles loading configuration from files (JSON/YAML) and environment variables. * Requirements: 10.1, 10.2, 10.3, 10.4, 10.5 */ /** * Eviction policy types supported by the cache engine. */ export type PolicyType = 'lru' | 'lfu' | 'hybrid'; /** * Complete cache configuration interface. * Contains all configurable options for the Smart Tiered Cache system. */ export interface CacheConfig { redisPort: number; dashboardPort: number; maxConnections: number; ramTierMaxBytes: number; ssdTierMaxBytes: number; hotThreshold: number; warmThreshold: number; coldThreshold: number; evictionPolicy: PolicyType; snapshotIntervalMs: number; predictionEnabled: boolean; maxPrefetchCount: number; accessWindowMs: number; tierMovementIntervalMs: number; dbConnectionString: string; } /** * Validation result for configuration validation. */ export interface ValidationResult { valid: boolean; errors: ValidationError[]; } /** * Individual validation error. */ export interface ValidationError { key: string; message: string; value: unknown; } /** * Default configuration values. */ export declare const DEFAULT_CONFIG: CacheConfig; /** * ConfigManager class for managing cache configuration. * Supports loading from JSON/YAML files and environment variables. */ export declare class ConfigManager { private config; constructor(); /** * Load configuration from a JSON or YAML file. * @param filePath - Path to the configuration file * @throws Error if file cannot be read or parsed */ loadFromFile(filePath: string): Promise; /** * Load configuration from environment variables. * Environment variables are prefixed with CACHE_ (e.g., CACHE_REDIS_PORT). */ loadFromEnv(): void; /** * Get a specific configuration value by key. * @param key - The configuration key * @returns The configuration value */ get(key: string): T; /** * Get the complete configuration object. * @returns A copy of the current configuration */ getAll(): CacheConfig; /** * Update a configuration value at runtime. * @param key - The configuration key to update * @param value - The new value * @returns true if update was successful, false otherwise */ update(key: string, value: unknown): boolean; /** * Validate the current configuration. * @returns ValidationResult with any errors found */ validate(): ValidationResult; /** * Validate configuration and apply defaults for invalid values. * Logs errors for each invalid value before resetting to default. * This method fulfills requirement 10.5: log error and use default values for invalid configuration. * @returns ValidationResult with errors that were found and corrected */ validateAndApplyDefaults(): ValidationResult; /** * Merge partial configuration into current config. */ private mergeConfig; /** * Parse an environment variable value to the appropriate type. */ private parseEnvValue; /** * Validate a single configuration value. */ private validateSingleValue; /** * Check if a port number is valid. */ private isValidPort; } //# sourceMappingURL=ConfigManager.d.ts.map