import '@ulixee/commons/lib/SourceMapSupport'; import { RequestSession } from '@unblocked-web/agent-mitm'; import { IBoundLog } from '@ulixee/commons/interfaces/ILog'; import { TypedEventEmitter } from '@ulixee/commons/lib/eventUtils'; import { IHooksProvider } from '@unblocked-web/specifications/agent/hooks/IHooks'; import IEmulationProfile, { IEmulationOptions } from '@unblocked-web/specifications/plugin/IEmulationProfile'; import { IUnblockedPluginClass } from '@unblocked-web/specifications/plugin/IUnblockedPlugin'; import Plugins from './Plugins'; import ICommandMarker from '../interfaces/ICommandMarker'; import Page from './Page'; import Browser from './Browser'; import Pool from './Pool'; import BrowserContext from './BrowserContext'; export interface IAgentCreateOptions extends Omit { id?: string; plugins?: IUnblockedPluginClass[]; commandMarker?: ICommandMarker; } export default class Agent extends TypedEventEmitter<{ close: void; }> { private readonly options; readonly pool?: Pool; readonly id: string; browserContext: BrowserContext; readonly mitmRequestSession: RequestSession; readonly logger: IBoundLog; readonly plugins: Plugins; get emulationProfile(): IEmulationProfile; get isIncognito(): boolean; private isOpen; private isClosing; private events; private readonly enableMitm; private readonly closeBrowserOnClose; private isolatedMitm; private get mitmProxyConnectionInfo(); constructor(options?: IAgentCreateOptions, pool?: Pool); open(): Promise; newPage(): Promise; hook(hooks: IHooksProvider): this; close(): Promise; protected createBrowserContext(browser: Browser): Promise; }