/// <reference types="node" />
import { EventEmitter } from 'events';
import { Browser } from './browser.js';
import { Page, PageNavigateOptions } from './page.js';
import { CdpResponse, CdpTargetInfo, CdpTargetType } from './types.js';
export type TargetInitFn = (target: Target) => Promise<void>;
export declare class Target extends EventEmitter {
    browser: Browser;
    targetId: string;
    type: CdpTargetType;
    url: string;
    title: string;
    sessionId: string;
    browserContextId: string | null;
    openerId: string | null;
    loaded: boolean;
    ready: boolean;
    loadingFailed: boolean;
    requestId: string | null;
    errorText: string | null;
    response: CdpResponse | null;
    postData?: string;
    attachedPage: Page | null;
    protected initPromise: Promise<void>;
    constructor(browser: Browser, sessionId: string, targetInfo: CdpTargetInfo);
    get logger(): import("../logger.js").Logger;
    getPage(): Promise<Page>;
    init(): Promise<void>;
    protected _init(): Promise<void>;
    activate(): Promise<void>;
    close(): void;
    send(method: string, params?: any, timeout?: number): Promise<any>;
    sendAndForget(method: string, params?: any): void;
    updateInfo(targetInfo: CdpTargetInfo): void;
    onInfoChanged(targetInfo: CdpTargetInfo): void;
    refreshInfo(): Promise<void>;
    isPageTarget(): boolean;
    isValidTarget(): boolean;
    collectInfo(): {
        targetId: string;
        url: string;
        type: CdpTargetType;
    };
    navigate(url: string, options?: PageNavigateOptions): Promise<void>;
    waitForReady(options?: PageNavigateOptions): Promise<void>;
    waitForLoad(options?: PageNavigateOptions): Promise<void>;
    private waitForEvents;
    private onRequestWillBeSent;
    private onResponseReceived;
    private onLoadingFailed;
    private onTargetCrashed;
    private onLifecycleEvent;
    private onFrameNavigated;
    private onFrameStoppedLoading;
    private onDomReady;
    private onRequestPaused;
}
//# sourceMappingURL=target.d.ts.map