/**
 * Shared cache for the Next.js framework audit (T11).
 *
 * Sub-tools called by `frameworkAudit` re-walk the same files and re-parse
 * the same trees. This cache shares parsed tree promises and walk results
 * across sub-tools, with a TTL eviction policy so long-running servers don't
 * grow unbounded.
 *
 * Pattern: promise-sharing (not result caching). Concurrent calls for the
 * same key reuse the in-flight promise. After resolution, the result stays
 * in cache until the TTL expires.
 */
import type Parser from "web-tree-sitter";
import { type WalkOptions } from "./walk.js";
/** Activate the shared cache (called by frameworkAudit at start). */
export declare function activateGlobalCache(): NextjsAuditCache;
/** Deactivate and clear (called by frameworkAudit at end). */
export declare function deactivateGlobalCache(): void;
/** Get the active cache, or null if not in a framework_audit context. */
export declare function getGlobalCache(): NextjsAuditCache | null;
/**
 * Proxy for walkDirectory that uses global cache when active.
 * Drop-in replacement — same signature as walkDirectory.
 */
export declare function cachedWalkDirectory(root: string, options?: WalkOptions): Promise<string[]>;
/**
 * Proxy for parseFile that uses global cache when active.
 * Drop-in replacement — same signature as parseFile.
 */
export declare function cachedParseFile(path: string, source: string): Promise<Parser.Tree | null>;
export declare class NextjsAuditCache {
    private parseFileCache;
    private walkCache;
    private readonly ttl;
    constructor();
    /**
     * Parse and cache a file. Concurrent calls share the same promise.
     * Synchronous (returns the cached/in-flight Promise directly) so that
     * `cache.getParsedFile(p) === cache.getParsedFile(p)` for concurrent calls.
     */
    getParsedFile(path: string, source: string): Promise<Parser.Tree | null>;
    /** Walk and cache a directory. Concurrent calls share the same promise. */
    getWalk(root: string, options?: WalkOptions): Promise<string[]>;
    /** Clear all entries. */
    clear(): void;
    /** Total cached entries. */
    size(): number;
    /** Evict entries whose TTL has passed. */
    private evictExpired;
}
//# sourceMappingURL=nextjs-audit-cache.d.ts.map