import { Browser, Page, PuppeteerLaunchOptions, ConsoleMessage } from 'puppeteer'; import { Log } from '@probe.gl/log'; export type BrowserDriverProps = { id?: string; }; type ServerInstance = { url: string; stop: () => void; }; export type ServerConfiguration = { command?: string; arguments?: string[]; port?: number | 'auto'; wait?: number; options?: any; /** Callback to start the server */ start?: (config: ServerConfiguration) => Promise; }; export default class BrowserDriver { readonly id: string; logger: Log; server: ServerInstance | null; browser: Browser | null; page: Page | null; constructor(options?: BrowserDriverProps); startBrowser(puppeteerOptions?: PuppeteerLaunchOptions): Promise; openPage(options?: { url?: string; exposeFunctions?: Record; onLoad?: () => void; onConsole?: (e: ConsoleMessage) => void; onError?: (e: Error) => void; }): Promise; stopBrowser(): Promise; /** Starts a web server with the provided configs. * Resolves to the bound url if successful */ startServer(serverConfig: ServerConfiguration): Promise; stopServer(): Promise; exit(statusCode?: number): Promise; } export {}; //# sourceMappingURL=browser-driver.d.ts.map