/// <reference types="node" />
import { EventEmitter } from 'events';
import { Logger } from '../logger.js';
import { Connection } from './connection.js';
import { Frame } from './frame.js';
import { Interceptor, InterceptorHandler } from './interceptor.js';
import { Page } from './page.js';
import { Target, TargetInitFn } from './target.js';
export interface BrowserConfig {
    chromeAddress: string;
    chromePort: number;
    cdpTimeout: number;
    navigationTimeout: number;
    stableBoxTimeout: number;
    suspendTargets: boolean;
    toolkitBinding: string;
    logger: Logger;
}
export declare class Browser extends EventEmitter {
    connection: Connection;
    config: BrowserConfig;
    interceptors: Interceptor[];
    targetInitFns: TargetInitFn[];
    constructor(config?: Partial<BrowserConfig>);
    get logger(): Logger;
    applyConfig(config: Partial<BrowserConfig>): void;
    connect(): Promise<void>;
    close(): Promise<void>;
    disconnect(): void;
    isConnected(): boolean;
    newTab(browserContextId?: string): Promise<Page>;
    closeAllTabs(): void;
    getTarget(targetId: string): Target | null;
    getPage(targetId: string): Promise<Page | null>;
    attachedTargets(): IterableIterator<Target>;
    attachedPages(): IterableIterator<Page>;
    resolveFrameById(frameId: string): Promise<Frame | null>;
    send(method: string, params?: any): Promise<any>;
    sendAndForget(method: string, params?: any): void;
    http(pathname: string, readJson?: boolean): Promise<any>;
    getVersion(): Promise<BrowserVersion>;
    createBrowserContext(): Promise<{
        browserContextId: string;
    }>;
    disposeBrowserContext(browserContextId: string): Promise<void>;
    interceptRequests(handler: InterceptorHandler, label?: string): Interceptor;
    clearInterceptors(label?: string): void;
    addTargetInit(fn: TargetInitFn): void;
}
export interface BrowserVersion {
    browserVersion: string;
    protocolVersion: string;
    userAgent: string;
    v8Version: string;
    webkitVersion: string;
    webSocketDebuggerUrl: string;
}
//# sourceMappingURL=browser.d.ts.map