import type { NetworkRequest } from './types.js';
/**
 * Minimal HAR 1.2 shapes. We only produce what our request buffer can back —
 * fields the buffer doesn't populate (headers, cookies, bodies, timings) are
 * emitted with the spec-mandated empty defaults or `-1` sentinels so validators
 * still accept the document.
 *
 * Spec: http://www.softwareishard.com/blog/har-12-spec/
 */
export interface HarLog {
    version: '1.2';
    creator: {
        name: string;
        version: string;
    };
    pages: HarPage[];
    entries: HarEntry[];
}
export interface HarPage {
    startedDateTime: string;
    id: string;
    title: string;
    pageTimings: {
        onContentLoad: number;
        onLoad: number;
    };
}
export interface HarEntry {
    startedDateTime: string;
    time: number;
    request: HarRequest;
    response: HarResponse;
    cache: Record<string, never>;
    timings: HarTimings;
}
export interface HarRequest {
    method: string;
    url: string;
    httpVersion: string;
    cookies: never[];
    headers: never[];
    queryString: Array<{
        name: string;
        value: string;
    }>;
    headersSize: number;
    bodySize: number;
}
export interface HarResponse {
    status: number;
    statusText: string;
    httpVersion: string;
    cookies: never[];
    headers: never[];
    content: {
        size: number;
        mimeType: string;
        text?: string;
    };
    redirectURL: string;
    headersSize: number;
    bodySize: number;
}
export interface HarTimings {
    send: number;
    wait: number;
    receive: number;
}
export interface BuildHarOptions {
    creatorName?: string;
    creatorVersion?: string;
}
/**
 * Serialize a buffered `NetworkRequest[]` into a HAR 1.2 document.
 *
 * The buffer only records `url`, `method`, `status`, `mimeType`, `timestamp`.
 * Everything downstream — cookies, headers, bodies, per-phase timings — is
 * unknown and must be emitted as the spec's "unknown" sentinels: `-1` for
 * sizes / timings, empty arrays for cookies / headers. HAR validators accept
 * this shape (browsers do the same for opaque cross-origin responses).
 */
export declare function buildHar(requests: NetworkRequest[], opts?: BuildHarOptions): {
    log: HarLog;
};
