/**
 * Version Detector
 *
 * Detects application and configuration versions:
 * - Package.json version
 * - Config file versions
 * - Data format versions
 * - Runtime version detection
 */
import { EventEmitter } from 'events';
export interface VersionInfo {
    version: string;
    source: string;
    detectedAt: Date;
    metadata?: Record<string, unknown>;
}
export interface ConfigVersion {
    version: string;
    format: string;
    schema?: string;
}
export interface VersionDetectorConfig {
    dataDir?: string;
    configDir?: string;
    packageJsonPath?: string;
    versionFile?: string;
}
export interface VersionComparison {
    current: string;
    target: string;
    relation: 'equal' | 'older' | 'newer' | 'invalid';
    needsUpgrade: boolean;
    majorDiff: number;
    minorDiff: number;
    patchDiff: number;
}
/**
 * Version Detector class
 */
export declare class VersionDetector extends EventEmitter {
    private config;
    private cachedVersions;
    private initialized;
    constructor(config?: VersionDetectorConfig);
    /**
     * Initialize version detector
     */
    initialize(): Promise<void>;
    /**
     * Detect all available versions
     */
    detectAllVersions(): Promise<Map<string, VersionInfo>>;
    /**
     * Detect package.json version
     */
    detectPackageVersion(): Promise<VersionInfo | null>;
    /**
     * Detect stored version from version file
     */
    detectStoredVersion(): Promise<VersionInfo | null>;
    /**
     * Detect config file version
     */
    detectConfigVersion(): Promise<VersionInfo | null>;
    /**
     * Get package version
     */
    getPackageVersion(): string | null;
    /**
     * Get stored version
     */
    getStoredVersion(): string | null;
    /**
     * Get config version
     */
    getConfigVersion(): string | null;
    /**
     * Get current version (prioritize package > stored > config)
     */
    getCurrentVersion(): string;
    /**
     * Store current version
     */
    storeVersion(version: string, metadata?: Record<string, unknown>): Promise<void>;
    /**
     * Compare two versions
     */
    compareVersions(current: string, target: string): VersionComparison;
    /**
     * Check if upgrade is needed from stored to package version
     */
    needsUpgrade(): boolean;
    /**
     * Get upgrade path between versions
     */
    getUpgradePath(from: string, to: string): string[];
    /**
     * Validate version string
     */
    isValidVersion(version: string): boolean;
    /**
     * Coerce string to valid semver
     */
    coerceVersion(version: string): string | null;
    /**
     * Parse version into components
     */
    parseVersion(version: string): {
        major: number;
        minor: number;
        patch: number;
        prerelease: string[];
        build: string[];
    } | null;
    /**
     * Check if version satisfies range
     */
    satisfiesRange(version: string, range: string): boolean;
    /**
     * Get all cached versions
     */
    getAllVersions(): Map<string, VersionInfo>;
    /**
     * Get version by source
     */
    getVersion(source: string): VersionInfo | undefined;
    /**
     * Clear version cache
     */
    clearCache(): void;
    /**
     * Check if initialized
     */
    isInitialized(): boolean;
    /**
     * Dispose resources
     */
    dispose(): void;
}
/**
 * Get or create version detector
 */
export declare function getVersionDetector(config?: VersionDetectorConfig): VersionDetector;
/**
 * Reset version detector singleton
 */
export declare function resetVersionDetector(): void;
export default VersionDetector;
