import type { AsyncContext } from "../utils/context.js";
interface CacheItem {
    date: Date;
    value: any;
}
export declare function invalidateByModifiedDate(cache: CacheItem, path: string | undefined): boolean;
export declare function withCache<Result>(key: string, path: string | undefined, callback: () => Result, invalidate?: (cache: CacheItem, path: string | undefined) => boolean): Result;
export declare function withCache<Result>(key: string, path: string | undefined, callback: () => Promise<Result>, invalidate?: (cache: CacheItem, path: string | undefined) => boolean): Promise<Result>;
/**
 * Caches worker operation results.
 *
 * @template Operation The signature of the wrapped operation.
 * @param name Unique name of the operation, used as part of the cache key.
 * @param operation The operation to cache.
 * @returns The wrapped operation.
 */
export declare function withOperationCache<Operation extends (ctx: AsyncContext, ...args: any[]) => any>(name: string, operation: Operation): Operation;
/**
 * Caches an operation that filters a class list per class.
 *
 * @param key Unique name of the operation, used as part of the cache key.
 * @param path Path of the file to watch for changes.
 * @param classes The classes to filter.
 * @param filterClasses The operation, called with the classes that have no cached verdict yet.
 * @returns The classes for which the operation's verdict is positive, in input order.
 */
export declare function withPerClassCache(key: string, path: string | undefined, classes: string[], filterClasses: (uncachedClasses: string[]) => string[]): string[];
export declare function clearCache(): void;
export {};
//# sourceMappingURL=cache.d.ts.map