/**
 * Source Cache
 *
 * TTL-based in-memory cache for source API responses.
 * Supports pattern-based invalidation and cache statistics.
 *
 * @since v1.37.0
 */
/**
 * Cache entry with data and expiry
 */
export interface CacheEntryData<T> {
    data: T;
    expiry: number;
    createdAt: number;
}
/**
 * Cache statistics
 */
export interface CacheStats {
    hits: number;
    misses: number;
    size: number;
    hitRate: number;
}
/**
 * Cache options
 */
export interface SourceCacheOptions {
    /** Default TTL in milliseconds (default: 5 minutes) */
    defaultTtl?: number;
    /** Maximum cache size (default: 1000) */
    maxSize?: number;
    /** Whether to log cache operations (default: false) */
    debug?: boolean;
    /** Cache name for logging */
    name?: string;
}
/**
 * TTL-based in-memory cache for source data
 *
 * @example
 * ```typescript
 * const cache = new SourceCache<PluginInfo>({ defaultTtl: 5 * 60 * 1000 });
 *
 * // Set with default TTL
 * cache.set('plugin:essentialsx', pluginInfo);
 *
 * // Get (returns undefined if expired or not found)
 * const info = cache.get('plugin:essentialsx');
 *
 * // Invalidate by pattern
 * cache.invalidate(/^plugin:/);
 * ```
 */
export declare class SourceCache<T> {
    private cache;
    private readonly defaultTtl;
    private readonly maxSize;
    private readonly debug;
    private readonly name;
    private hits;
    private misses;
    constructor(options?: SourceCacheOptions);
    /**
     * Get a value from cache
     * Returns undefined if not found or expired
     */
    get(key: string): T | undefined;
    /**
     * Set a value in cache
     */
    set(key: string, data: T, ttlMs?: number): void;
    /**
     * Check if a key exists and is not expired
     */
    has(key: string): boolean;
    /**
     * Delete a specific key
     */
    delete(key: string): boolean;
    /**
     * Invalidate cache entries matching a pattern
     * If no pattern provided, clears entire cache
     */
    invalidate(pattern?: RegExp | string): number;
    /**
     * Clear all entries
     */
    clear(): void;
    /**
     * Get cache size
     */
    get size(): number;
    /**
     * Get cache statistics
     */
    getStats(): CacheStats;
    /**
     * Reset statistics
     */
    resetStats(): void;
    /**
     * Get or set - returns cached value or fetches and caches new value
     */
    getOrSet(key: string, fetcher: () => Promise<T>, ttlMs?: number): Promise<T>;
    /**
     * Cleanup expired entries
     */
    cleanup(): number;
    /**
     * Evict oldest entries when at max size
     */
    private evictOldest;
    /**
     * Log debug message if debug mode is enabled
     */
    private logDebug;
}
/**
 * Create a cache instance with common source defaults
 */
export declare function createSourceCache<T>(name: string, ttlMs?: number): SourceCache<T>;
//# sourceMappingURL=source-cache.d.ts.map