/**
 * Package.json Cache - Performance optimization for package.json reads
 *
 * Provides a caching layer for package.json reads to avoid redundant file I/O
 * during codebase analysis operations like repo scanning and discovery.
 *
 * Part of increment 0168: Code Review Fixes
 *
 * @module utils/package-json-cache
 * @since v0.34.0
 */
/**
 * Parsed package.json content
 */
export interface PackageJsonContent {
    name?: string;
    version?: string;
    main?: string;
    exports?: Record<string, unknown>;
    dependencies?: Record<string, string>;
    devDependencies?: Record<string, string>;
    peerDependencies?: Record<string, string>;
    scripts?: Record<string, string>;
    [key: string]: unknown;
}
/**
 * Cache options
 */
export interface PackageJsonCacheOptions {
    /** Maximum number of entries to cache (default: 1000) */
    maxEntries?: number;
    /** Time-to-live in milliseconds (default: 60000 = 1 minute) */
    ttl?: number;
    /** Whether to validate cache entries by mtime (default: true) */
    validateMtime?: boolean;
}
/**
 * Statistics for cache performance monitoring
 */
export interface CacheStats {
    hits: number;
    misses: number;
    invalidations: number;
    size: number;
}
/**
 * Package.json Cache - Singleton pattern for shared caching
 *
 * Usage:
 * ```typescript
 * const cache = PackageJsonCache.getInstance();
 * const pkg = cache.get('/path/to/project');
 * if (pkg) {
 *   const deps = cache.getAllDependencies(pkg);
 * }
 * ```
 */
export declare class PackageJsonCache {
    private static instance;
    private cache;
    private stats;
    private options;
    private constructor();
    /**
     * Get the singleton instance
     */
    static getInstance(options?: PackageJsonCacheOptions): PackageJsonCache;
    /**
     * Reset the singleton instance (useful for testing)
     */
    static resetInstance(): void;
    /**
     * Get package.json content for a project path
     *
     * @param projectPath - Path to the project directory (not the package.json file)
     * @returns Parsed package.json content or null if not found/invalid
     */
    get(projectPath: string): PackageJsonContent | null;
    /**
     * Check if a package.json exists at the given path
     *
     * @param projectPath - Path to the project directory
     * @returns true if package.json exists
     */
    exists(projectPath: string): boolean;
    /**
     * Get all dependencies (dependencies + devDependencies + peerDependencies)
     *
     * @param pkg - Package.json content
     * @returns Combined dependencies object
     */
    getAllDependencies(pkg: PackageJsonContent): Record<string, string>;
    /**
     * Get production dependencies only
     *
     * @param pkg - Package.json content
     * @returns Production dependencies
     */
    getProductionDependencies(pkg: PackageJsonContent): Record<string, string>;
    /**
     * Check if a dependency exists
     *
     * @param pkg - Package.json content
     * @param depName - Dependency name to check
     * @returns true if dependency exists in any dependency type
     */
    hasDependency(pkg: PackageJsonContent, depName: string): boolean;
    /**
     * Invalidate cache for a specific path
     *
     * @param projectPath - Path to invalidate
     */
    invalidate(projectPath: string): void;
    /**
     * Clear the entire cache
     */
    clear(): void;
    /**
     * Get cache statistics
     */
    getStats(): CacheStats;
    /**
     * Pre-warm cache with multiple paths (useful for batch operations)
     *
     * @param projectPaths - Array of project paths to pre-load
     */
    preWarm(projectPaths: string[]): void;
    /**
     * Check if a cache entry is still valid
     */
    private isValid;
    /**
     * Read package.json and cache the result
     */
    private readAndCache;
    /**
     * Evict oldest entries when cache is full
     */
    private evictOldest;
}
/**
 * Convenience function for one-off reads (uses singleton)
 *
 * @param projectPath - Path to the project directory
 * @returns Parsed package.json content or null
 */
export declare function readPackageJson(projectPath: string): PackageJsonContent | null;
/**
 * Convenience function for checking package.json existence (uses singleton)
 *
 * @param projectPath - Path to the project directory
 * @returns true if package.json exists
 */
export declare function packageJsonExists(projectPath: string): boolean;
/**
 * Convenience function for getting all dependencies (uses singleton)
 *
 * @param projectPath - Path to the project directory
 * @returns Combined dependencies or empty object if not found
 */
export declare function getAllDependencies(projectPath: string): Record<string, string>;
//# sourceMappingURL=package-json-cache.d.ts.map