/**
 * SpecWeave Configuration Manager
 *
 * Manages .specweave/config.json for non-sensitive configuration
 * (Secrets like API tokens go in .env, NOT in config.json)
 *
 * @module core/config/config-manager
 */
import { SpecWeaveConfig, ValidationResult } from './types.js';
import { type Logger } from '../../utils/logger.js';
/**
 * Manages SpecWeave configuration
 */
export declare class ConfigManager {
    private configPath;
    private projectRoot;
    private config;
    private logger;
    /**
     * Create a new ConfigManager
     *
     * CRITICAL FIX: Uses getProjectRoot() instead of process.cwd() to prevent
     * creating/accessing .specweave in wrong location when CWD != project root.
     *
     * @param projectRoot - Path to project root (default: auto-detected via getProjectRoot())
     * @param logger - Logger instance (default: consoleLogger)
     */
    constructor(projectRoot?: string, logger?: Logger);
    /**
     * Read configuration from disk
     *
     * @returns Configuration object
     */
    read(): Promise<SpecWeaveConfig>;
    /**
     * Read configuration synchronously
     *
     * @returns Configuration object
     */
    readSync(): SpecWeaveConfig;
    /**
     * Write configuration to disk
     *
     * @param config - Configuration to write
     */
    write(config: SpecWeaveConfig): Promise<void>;
    /**
     * Update configuration with partial values
     *
     * @param partial - Partial configuration to merge
     */
    update(partial: Partial<SpecWeaveConfig>): Promise<void>;
    /**
     * Get a specific configuration value by path
     *
     * @param path - Dot-separated path (e.g., "issueTracker.domain")
     * @returns Configuration value
     */
    get(path: string): Promise<any>;
    /**
     * Set a specific configuration value by path
     *
     * @param path - Dot-separated path (e.g., "issueTracker.domain")
     * @param value - Value to set
     */
    set(path: string, value: any): Promise<void>;
    /**
     * Check if configuration file exists
     *
     * @returns True if config exists
     */
    exists(): Promise<boolean>;
    /**
     * Validate configuration
     *
     * @param config - Configuration to validate (default: current config)
     * @returns Validation result
     */
    validate(config?: SpecWeaveConfig): ValidationResult;
    /**
     * Merge configuration with defaults
     *
     * @param config - User configuration
     * @returns Merged configuration
     */
    private mergeWithDefaults;
    private hasLegacyConfig;
    private isPersistableWorkspaceMigration;
    private stripLegacyKeys;
    private persistMigratedConfig;
    private persistMigratedConfigSync;
    /**
     * Deep merge two objects
     *
     * @param target - Target object
     * @param source - Source object
     * @returns Merged object
     */
    private deepMerge;
    /**
     * Get value by dot-separated path
     *
     * @param obj - Object to get value from
     * @param path - Dot-separated path
     * @returns Value at path
     */
    private getByPath;
    /**
     * Set value by dot-separated path
     *
     * @param obj - Object to set value in
     * @param path - Dot-separated path
     * @param value - Value to set
     * @returns Updated object
     */
    private setByPath;
    /**
     * @deprecated Use readSync() instead
     */
    load(): SpecWeaveConfig;
    /**
     * @deprecated Use read() instead
     */
    loadAsync(): Promise<SpecWeaveConfig>;
    /**
     * @deprecated Use write() instead
     */
    save(config: SpecWeaveConfig): Promise<void>;
    /**
     * @deprecated Use write() with await instead
     */
    saveSync(config: SpecWeaveConfig): void;
    /**
     * @deprecated Access configPath via constructor
     */
    getConfigPath(): string;
    /**
     * @deprecated Use exists() instead
     */
    existsAsync(): Promise<boolean>;
    /**
     * Clear cached configuration
     */
    clearCache(): void;
}
/**
 * Get global config manager instance
 *
 * @param projectRoot - Path to project root (default: process.cwd())
 * @returns ConfigManager instance
 */
export declare function getConfigManager(projectRoot?: string): ConfigManager;
/**
 * Read configuration
 *
 * Convenience function for reading config
 *
 * @param projectRoot - Path to project root (default: process.cwd())
 * @returns Configuration object
 */
export declare function readConfig(projectRoot?: string): Promise<SpecWeaveConfig>;
/**
 * Write configuration
 *
 * Convenience function for writing config
 *
 * @param config - Configuration to write
 * @param projectRoot - Path to project root (default: process.cwd())
 */
export declare function writeConfig(config: SpecWeaveConfig, projectRoot?: string): Promise<void>;
//# sourceMappingURL=config-manager.d.ts.map