/**
 * Cache Types
 *
 * Type definitions for the caching system.
 *
 * @since v1.29.0
 */
/**
 * Cache entry with metadata
 */
export interface CacheEntry<T> {
    /** Cached data */
    data: T;
    /** When the entry was created */
    timestamp: number;
    /** Time-to-live in milliseconds */
    ttl: number;
    /** Optional ETag for HTTP caching */
    etag?: string;
    /** Size in bytes (approximate) */
    size?: number;
}
/**
 * Options for cache operations
 */
export interface CacheOptions {
    /** Time-to-live in milliseconds */
    ttl?: number;
    /** Return stale data while revalidating */
    staleWhileRevalidate?: boolean;
    /** Persist this entry to disk */
    persistent?: boolean;
    /** ETag for HTTP caching */
    etag?: string;
}
/**
 * Cache statistics
 */
export interface CacheStats {
    /** Number of cache hits */
    hits: number;
    /** Number of cache misses */
    misses: number;
    /** Hit rate percentage */
    hitRate: number;
    /** Number of entries in cache */
    entryCount: number;
    /** Total size in bytes (approximate) */
    totalSize: number;
    /** Number of evictions */
    evictions: number;
}
/**
 * Serialized cache for persistence
 */
export interface SerializedCache {
    version: string;
    entries: Array<{
        key: string;
        entry: CacheEntry<unknown>;
    }>;
    stats: {
        hits: number;
        misses: number;
        evictions: number;
    };
}
/**
 * Cache configuration
 */
export interface CacheConfig {
    /** Default TTL in milliseconds */
    defaultTTL: number;
    /** Maximum cache size in bytes */
    maxSize: number;
    /** Maximum number of entries */
    maxEntries: number;
    /** Enable persistence to disk */
    persistEnabled: boolean;
    /** Path for persistence file */
    persistPath?: string;
    /** Cleanup interval in milliseconds */
    cleanupInterval: number;
}
/**
 * Default cache configuration
 */
export declare const DEFAULT_CACHE_CONFIG: CacheConfig;
/**
 * Cache TTL presets for different data types
 */
export declare const CACHE_TTL: {
    /** Short TTL - changes frequently */
    readonly VERSION_CHECK: number;
    readonly LATEST_RELEASE: number;
    /** Medium TTL - changes occasionally */
    readonly PLUGIN_INFO: number;
    readonly CHANGELOG: number;
    /** Long TTL - rarely changes */
    readonly PLUGIN_METADATA: number;
    readonly REGISTRY: number;
};
/**
 * Source-specific concurrency limits
 */
export declare const SOURCE_CONCURRENCY: Record<string, number>;
/**
 * Cache store version
 */
export declare const CACHE_STORE_VERSION = "1.0";
/**
 * Create empty cache stats
 */
export declare function createEmptyCacheStats(): CacheStats;
/**
 * Cache warmer configuration
 * @since v1.41.1
 */
export interface CacheWarmer<T = unknown> {
    /** Cache key */
    key: string;
    /** Async function to load the data */
    loader: () => Promise<T>;
    /** Optional TTL for this entry */
    ttl?: number;
    /** Priority (higher = load first) */
    priority?: number;
}
/**
 * Extended cache stats with more detail
 * @since v1.41.1
 */
export interface ExtendedCacheStats extends CacheStats {
    /** Oldest entry timestamp */
    oldestEntry?: number;
    /** Newest entry timestamp */
    newestEntry?: number;
    /** Average entry age in ms */
    averageAge: number;
    /** Estimated memory usage in bytes */
    estimatedMemoryUsage: number;
    /** Memory pressure (0-100%) */
    memoryPressure: number;
    /** Number of stale entries (expired but not yet cleaned) */
    staleEntries: number;
}
/**
 * Debug export format
 * @since v1.41.1
 */
export interface CacheDebugExport {
    /** Export timestamp */
    exportedAt: string;
    /** Cache configuration */
    config: CacheConfig;
    /** Statistics */
    stats: ExtendedCacheStats;
    /** All entries with metadata */
    entries: Array<{
        key: string;
        ttl: number;
        age: number;
        size: number;
        expiresIn: number;
        isExpired: boolean;
    }>;
}
/**
 * Cache warming result
 * @since v1.41.1
 */
export interface WarmingResult {
    /** Number of entries warmed */
    warmed: number;
    /** Number of entries that failed to load */
    failed: number;
    /** Errors encountered */
    errors: Array<{
        key: string;
        error: string;
    }>;
    /** Time taken in ms */
    duration: number;
}
/**
 * Preload result
 * @since v1.41.1
 */
export interface PreloadResult {
    /** Keys that were loaded */
    loaded: string[];
    /** Keys that were already cached */
    skipped: string[];
    /** Keys that failed to load */
    failed: Array<{
        key: string;
        error: string;
    }>;
}
//# sourceMappingURL=cache-types.d.ts.map