import { TypedEmitter } from 'tiny-typed-emitter'; import { BROWSER_CONTROLLER_EVENTS } from '../events'; import { LaunchContext } from '../launch-context'; import { UnwrapPromise } from '../utils'; import { BrowserPlugin, CommonBrowser, CommonLibrary } from './browser-plugin'; export interface BrowserControllerEvents[0], LaunchResult extends CommonBrowser = UnwrapPromise>, NewPageOptions = Parameters[0], NewPageResult = UnwrapPromise>> { [BROWSER_CONTROLLER_EVENTS.BROWSER_CLOSED]: (controller: BrowserController) => void; } export interface Cookie { /** * Cookie name. */ name: string; /** * Cookie value. */ value: string; /** * The request-URI to associate with the setting of the cookie. This value can affect the * default domain, path, source port, and source scheme values of the created cookie. */ url?: string; /** * Cookie domain. */ domain?: string; /** * Cookie path. */ path?: string; /** * True if cookie is secure. */ secure?: boolean; /** * True if cookie is http-only. */ httpOnly?: boolean; /** * Cookie SameSite type. */ sameSite?: 'Strict' | 'Lax' | 'None'; /** * Cookie expiration date, session cookie if not set */ expires?: number; /** * Cookie Priority. */ priority?: 'Low' | 'Medium' | 'High'; /** * True if cookie is SameParty. */ sameParty?: boolean; /** * Cookie source scheme type. */ sourceScheme?: 'Unset' | 'NonSecure' | 'Secure'; /** * Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. * An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. * This is a temporary ability and it will be removed in the future. */ sourcePort?: number; } /** * The `BrowserController` serves two purposes. First, it is the base class that * specialized controllers like `PuppeteerController` or `PlaywrightController` * extend. Second, it defines the public interface of the specialized classes * which provide only private methods. Therefore, we do not keep documentation * for the specialized classes, because it's the same for all of them. * @hideconstructor */ export declare abstract class BrowserController[0], LaunchResult extends CommonBrowser = UnwrapPromise>, NewPageOptions = Parameters[0], NewPageResult = UnwrapPromise>> extends TypedEmitter> { id: string; /** * The `BrowserPlugin` instance used to launch the browser. */ browserPlugin: BrowserPlugin; /** * Browser representation of the underlying automation library. */ browser: LaunchResult; /** * The configuration the browser was launched with. */ launchContext: LaunchContext; isActive: boolean; activePages: number; totalPages: number; lastPageOpenedAt: number; private _activate; private isActivePromise; private commitBrowser; private hasBrowserPromise; constructor(browserPlugin: BrowserPlugin); /** * Activates the BrowserController. If you try to open new pages before * activation, the pages will get queued and will only be opened after * activate is called. * @ignore */ activate(): void; /** * @ignore */ assignBrowser(browser: LaunchResult, launchContext: LaunchContext): void; /** * Gracefully closes the browser and makes sure * there will be no lingering browser processes. * * Emits 'browserClosed' event. */ close(): Promise; /** * Immediately kills the browser process. * * Emits 'browserClosed' event. */ kill(): Promise; /** * Opens new browser page. * @ignore */ newPage(pageOptions?: NewPageOptions): Promise; setCookies(page: NewPageResult, cookies: Cookie[]): Promise; getCookies(page: NewPageResult): Promise; /** * @private */ protected abstract _close(): Promise; /** * @private */ protected abstract _kill(): Promise; /** * @private */ protected abstract _newPage(pageOptions?: NewPageOptions): Promise; /** * @private */ protected abstract _setCookies(page: NewPageResult, cookies: Cookie[]): Promise; /** * @private */ protected abstract _getCookies(page: NewPageResult): Promise; /** * @private */ abstract normalizeProxyOptions(proxyUrl: string | undefined, pageOptions: any): Record; } //# sourceMappingURL=browser-controller.d.ts.map