/**
 * Cache Manager
 *
 * High-level cache operations for different data types.
 * Provides typed access to update results, MC versions, etc.
 */
import type { CacheConfig, CacheLoadResult, CachedSourceMetadata, CachedUpdateResult, FailedDownloadsCache, MinecraftVersionsCache, ServerJarVersionsCache, SourceMetadataCache, UpdateResultsCache } from './types.js';
import { CACHE_ENTRIES } from './types.js';
/**
 * Cache manager class
 */
export declare class CacheManager {
    private storage;
    private config;
    constructor(config?: Partial<CacheConfig>);
    /**
     * Get cached update results
     */
    getUpdateResults(): Promise<CacheLoadResult<UpdateResultsCache>>;
    /**
     * Get a single plugin's cached update result
     */
    getPluginUpdateResult(pluginName: string): Promise<{
        result: CachedUpdateResult | null;
        isFresh: boolean;
        lastChecked: string | null;
    }>;
    /**
     * Save update results
     */
    saveUpdateResults(results: Record<string, CachedUpdateResult>): Promise<void>;
    /**
     * Update a single plugin's cached result (merge with existing)
     */
    updatePluginResult(pluginName: string, result: CachedUpdateResult): Promise<void>;
    /**
     * Check if update results cache is fresh
     */
    isUpdateResultsFresh(): Promise<boolean>;
    /**
     * Get cached Minecraft versions
     */
    getMinecraftVersions(): Promise<CacheLoadResult<MinecraftVersionsCache>>;
    /**
     * Save Minecraft versions
     */
    saveMinecraftVersions(versions: string[]): Promise<void>;
    /**
     * Check if MC versions cache is fresh
     */
    isMinecraftVersionsFresh(): Promise<boolean>;
    /**
     * Get cached source metadata
     */
    getSourceMetadata(): Promise<CacheLoadResult<SourceMetadataCache>>;
    /**
     * Get a single source's cached metadata
     */
    getSourceMetadataEntry(cacheKey: string): Promise<CachedSourceMetadata | null>;
    /**
     * Save source metadata entry
     */
    saveSourceMetadataEntry(cacheKey: string, metadata: CachedSourceMetadata): Promise<void>;
    /**
     * Get cached server JAR versions
     */
    getServerJarVersions(): Promise<CacheLoadResult<ServerJarVersionsCache>>;
    /**
     * Get versions for a specific server type
     */
    getServerJarVersionsFor(serverType: string): Promise<{
        versions: string[] | null;
        isFresh: boolean;
        fetchedAt: string | null;
    }>;
    /**
     * Save server JAR versions for a specific server type
     */
    saveServerJarVersions(serverType: string, versions: string[]): Promise<void>;
    /**
     * Get failed downloads cache
     */
    getFailedDownloads(): Promise<CacheLoadResult<FailedDownloadsCache>>;
    /**
     * Get all plugin names that have failed downloads
     */
    getFailedDownloadNames(): Promise<Set<string>>;
    /**
     * Check if a plugin has a failed download
     */
    hasFailedDownload(pluginName: string): Promise<boolean>;
    /**
     * Record a download failure
     */
    recordDownloadFailure(pluginName: string, errorMessage: string, statusCode?: number): Promise<void>;
    /**
     * Clear a download failure (e.g., after successful download or source change)
     */
    clearDownloadFailure(pluginName: string): Promise<void>;
    /**
     * Clear all caches
     */
    clearAll(): Promise<void>;
    /**
     * Clear a specific cache
     */
    clearCache(entryName: keyof typeof CACHE_ENTRIES): Promise<boolean>;
    /**
     * Get cache statistics
     */
    getStats(): Promise<{
        entryCount: number;
        entries: Array<{
            name: string;
            updatedAt: string;
            ageMs: number;
            isFresh: boolean;
            ttlMs: number;
        }>;
    }>;
    /**
     * Format age for display (e.g., "5 minutes ago", "2 hours ago")
     */
    static formatAge(ageMs: number): string;
}
/**
 * Get or create the global cache manager instance
 */
export declare function getCacheManager(config?: Partial<CacheConfig>): CacheManager;
/**
 * Reset the global cache manager (mainly for testing)
 */
export declare function resetCacheManager(): void;
//# sourceMappingURL=manager.d.ts.map