/**
 * Copyright: (c) Myia SAS 2026.
 * This file and its contents are licensed under the AGPLv3 License.
 * Please see the LICENSE file at the root of this repository
 */
import type { APIRequestContext, BrowserContext } from 'playwright';
import type { HealTracerNetworkConfig } from '../../application/heal-config/types';
import type { Clock } from '../../domain/trace-event-recorder/port/clock';
export interface NetworkCaptureDeps {
    clock: Clock;
    startedAt: number;
    getCurrentStatementSeq: () => number | undefined;
    getCurrentStepPath: () => string[] | undefined;
}
export declare class NetworkCaptureSession {
    private readonly ndjsonPath;
    private readonly deps;
    private fd;
    private closed;
    private readonly contexts;
    private readonly apiContexts;
    private readonly apiPatches;
    private apiCounter;
    private readonly coalescer;
    private readonly bufferedBodies;
    private readonly bodyMode;
    private readonly maxBodyBytes;
    private readonly extraDenylist;
    private readonly contentTypeAllowlist;
    private readonly urlFilter;
    constructor(ndjsonPath: string, deps: NetworkCaptureDeps, config: HealTracerNetworkConfig);
    attachToContext(ctx: BrowserContext): void;
    attachToApiRequestContext(api: APIRequestContext): void;
    private beginApiRecord;
    private completeApiRecord;
    private failApiRecord;
    private snapshotApiCorrelation;
    private handleRequest;
    private handleResponse;
    private handleRequestFinished;
    private handleRequestFailed;
    private snapshotCorrelation;
    private write;
    /**
     * Drain any pending exchanges (writing them as-is) and, when the
     * test ended in a failing status and `bodyMode === 'on-error'`,
     * flush buffered bodies as `network-body` records. Idempotent.
     *
     * The body is currently fully synchronous (every disk write is
     * `fs.writeSync`); the `Promise<void>` return type is preserved so
     * the fixture can await it under `withTimeout` exactly like
     * `projector.finalize`.
     */
    stop(testFailed: boolean): Promise<void>;
}
