import type { BrowserContext, Page } from 'playwright-core'; export declare class BrowserHostError extends Error { readonly fix: string | null; constructor(message: string, fix?: string | null); } /** * Where the host script is, for an ordinary install of this package. * * The first candidate is the compiled output's own directory, which is where * the build stages the script for anyone consuming the published package. The * second is the source tree, so the suite and a dev-linked checkout find it * without a build. A product that compiles this module into a single-file * executable stages the script itself and passes `scriptPath` instead, there * is nowhere for this function to look inside a binary. */ export declare function browserHostScriptPath(): string; export interface BrowserHostOptions { /** An explicit host-script location, for a build that stages it elsewhere. */ readonly scriptPath?: string | undefined; /** * What to tell someone whose host script is missing, phrased for how this * build was installed. The SDK ships no installer, so the product says it. */ readonly missingScriptFix?: string | undefined; } export declare class BrowserHostClient { private readonly options; private child; private readonly pending; private nextId; private buffer; private ready; private notReady; private startupError; constructor(options?: BrowserHostOptions); start(): Promise; private waitForReady; private drain; private handleLine; call(command: string, params?: Record): Promise; /** * Ends the host process only. The browser it attached to is untouched: this * agent never started it, so it is not this agent's to close. */ stop(): void; } /** * A Page as the engine uses one, backed by the host. * * `__frameChain` on the frame objects is read by the snapshot code, which would * otherwise have to ask each frame for its own element, a round trip the host * already made when it listed them. */ export declare function remotePage(client: BrowserHostClient, pageId: string, initialUrl: string): Page; export interface RemoteContextHandle { readonly context: BrowserContext; readonly refresh: () => Promise; } /** A BrowserContext as the engine uses one, backed by the host. */ export declare function remoteContext(client: BrowserHostClient, initialPages: readonly { pageId: string; url: string; }[]): BrowserContext; //# sourceMappingURL=browser-host-client.d.ts.map