/**
 * Pass #21: resource-leak (CWE-772, category: reliability)
 *
 * Detects I/O resources (streams, connections, sockets) that are opened but
 * not closed on all exit paths. Unclosed resources exhaust file descriptors
 * or connection pools and cause subtle failures under load.
 *
 * Detection strategy:
 *   1. Find resource-opening calls: known constructors (FileInputStream, etc.)
 *      or factory methods (open, createReadStream, etc.).
 *   2. Get the variable bound to the resource from DFG defs at the open line.
 *   3. Within the enclosing method, look for a close()/dispose() call whose
 *      receiver matches the resource variable.
 *   4a. No close call found → definite leak (high, error).
 *   4b. Close found but no `finally` keyword in the method after the open
 *       → potential leak (medium, warning): an exception skips the close.
 *
 * Note: Java try-with-resources generates no explicit close() in the source;
 * the pass treats the absence of both an explicit close AND a finally as a
 * definite leak.
 */
import type { AnalysisPass, PassContext } from '../../graph/analysis-pass.js';
export interface ResourceLeakResult {
    /** Resources that may not be properly closed. */
    leaks: Array<{
        line: number;
        resource: string;
        variable: string;
        kind: 'definite' | 'potential';
    }>;
}
export declare class ResourceLeakPass implements AnalysisPass<ResourceLeakResult> {
    readonly name = "resource-leak";
    readonly category: "reliability";
    run(ctx: PassContext): ResourceLeakResult;
    /** True if a `finally` keyword appears in the method body after the open line. */
    private hasFinallyBlock;
    /**
     * True if a try-with-resources or Python `with` statement wraps the resource,
     * indicating implicit close. Detects `try (` or `with open(` patterns.
     */
    private hasTryWithResources;
}
//# sourceMappingURL=resource-leak-pass.d.ts.map