/// <reference types="node" />
import { Browser } from './browser.js';
import { Target } from './target.js';
import { CdpHeaderEntry, CdpHeaders, CdpNetworkErrorReason, CdpRequest, CdpRequestPaused } from './types.js';
export type InterceptorHandler = (req: InterceptedRequest) => Promise<InterceptorOutcome | void>;
export declare class Interceptor {
    browser: Browser;
    handler: InterceptorHandler;
    label: string;
    id: string;
    constructor(browser: Browser, handler: InterceptorHandler, label: string);
    stop(): void;
}
export declare class InterceptedRequest {
    target: Target;
    requestId: string;
    frameId: string;
    resourceType: string;
    request: CdpRequest;
    responseErrorReason?: string;
    responseStatusCode?: number;
    responseHeaders?: CdpHeaderEntry[];
    networkId?: string;
    protected modifications: InterceptorModifications;
    constructor(target: Target, payload: CdpRequestPaused);
    fail(errorReason: CdpNetworkErrorReason): InterceptorOutcome;
    fulfill(response: InterceptorResponse): InterceptorOutcome;
    continue(mods?: InterceptorModifications): InterceptorOutcome;
    pass(mods?: InterceptorModifications): InterceptorOutcome;
    getEffectiveHeaders(): CdpHeaders | undefined;
    getEffectiveHeaderEntries(): CdpHeaderEntry[] | undefined;
    protected assignModifications(mods: InterceptorModifications): void;
}
export interface InterceptorOutcome {
    method: string;
    params: any;
}
export interface InterceptorResponse {
    responseCode: number;
    responseHeaders?: CdpHeaders;
    body?: string | Buffer;
}
export interface InterceptorModifications {
    url?: string;
    method?: string;
    postData?: string;
    extraHeaders?: CdpHeaders;
    headers?: CdpHeaders;
}
//# sourceMappingURL=interceptor.d.ts.map