import { MitmProxy } from '@unblocked-web/agent-mitm'; import IBrowserEngine from '@unblocked-web/specifications/agent/browser/IBrowserEngine'; import { TypedEventEmitter } from '@ulixee/commons/lib/eventUtils'; import { ICertificateStore } from '@unblocked-web/agent-mitm/interfaces/ICertificateGenerator'; import { IBoundLog } from '@ulixee/commons/interfaces/ILog'; import IBrowserLaunchArgs from '@unblocked-web/specifications/agent/browser/IBrowserLaunchArgs'; import { IHooksProvider } from '@unblocked-web/specifications/agent/hooks/IHooks'; import { IUnblockedPluginClass } from '@unblocked-web/specifications/plugin/IUnblockedPlugin'; import Browser from './Browser'; import Agent, { IAgentCreateOptions } from './Agent'; interface ICreatePoolOptions { maxConcurrentAgents?: number; certificateStore?: ICertificateStore; defaultBrowserEngine?: IBrowserEngine; plugins?: IUnblockedPluginClass[]; dataDir?: string; logger?: IBoundLog; } export default class Pool extends TypedEventEmitter<{ 'agent-created': { agent: Agent; }; 'browser-launched': { browser: Browser; }; 'browser-has-no-open-windows': { browser: Browser; }; 'all-browsers-closed': void; }> { #private; readonly options: ICreatePoolOptions; get hasAvailability(): boolean; get activeAgentsCount(): number; maxConcurrentAgents: number; readonly browsersById: Map; readonly agentsById: Map; sharedMitmProxy: MitmProxy; plugins: IUnblockedPluginClass[]; protected logger: IBoundLog; private isClosing; private mitmStartPromise; private browserCreationQueue; private events; private certificateGenerator; constructor(options?: ICreatePoolOptions); start(): Promise; createAgent(options?: IAgentCreateOptions): Agent; waitForAvailability(agent: Agent): Promise; createMitmProxy(): Promise; getBrowser(engine: IBrowserEngine, hooks: IHooksProvider, launchArgs?: IBrowserLaunchArgs): Promise; close(): Promise; protected waitForAgentClose(agent: Agent): void; private onAgentClosed; private startSharedMitm; private onBrowserClosed; private watchForContextPagesClosed; private checkForInactiveBrowserEngine; private browserWithEngine; } export {};