export type BrowserEngineId = "chrome" | "edge" | "brave" | "chromium"; export interface InstalledEngine { engine: BrowserEngineId; executablePath: string; /** Best-effort version ("139.0.7258.67" style); "" when undetectable. */ version: string; /** Playwright channel name when launchable via channel, else null * (brave has no Playwright channel: launched via executablePath). */ channel: "chrome" | "msedge" | null; /** Engine-specific caveats the caller should surface to the user. */ quirks: string[]; } export interface BrowserCapabilityReport { engines: InstalledEngine[]; cdp: boolean; provisioner: "v1"; platform: NodeJS.Platform; } export declare function discoverEngines(forceRefresh?: boolean): Promise; export declare function capabilityReport(): Promise; export declare class ProvisionError extends Error { readonly code: "engine_not_installed" | "download_not_authorized" | "download_failed" | "engine_unsupported"; readonly instructions?: string; constructor(code: ProvisionError["code"], message: string, instructions?: string); } /** Resolve an engine to a launchable executable. NEVER downloads unless * allowDownload is explicitly true, and even then only the * Playwright-bundled Chromium is downloadable (Chrome/Edge/Brave are * user-installed products we will not fetch on the user's behalf). */ export declare function ensureEngine(engine: BrowserEngineId, opts?: { allowDownload?: boolean; log?: (m: string) => void; }): Promise; /** Preference order for headed flows. */ export declare const INSTALLED_BROWSER_PREFERENCE: readonly BrowserEngineId[]; /** Actionable error when no supported browser is installed. */ export declare function noInstalledBrowserError(): ProvisionError; /** `npx` on PATH (Windows: npx.cmd). File checks only, no subprocess. */ export declare function npxOnPath(env?: NodeJS.ProcessEnv): boolean; /** May this process download Playwright's Chromium? Only the CLI, with npx present. */ export declare function canDownloadBundledChromium(opts?: { hosted?: boolean; npx?: boolean; }): boolean; /** Installed engines in preference order (Chrome, Edge, Brave, on-disk Chromium). */ export declare function installedBrowsersByPreference(engines?: InstalledEngine[]): Promise; type LaunchFn = (o: { headless: boolean; channel?: string; executablePath?: string; args?: string[]; }) => Promise; /** * Launch a headed browser for a sign-in flow from the installed set. Tries each * installed engine in preference order, then Playwright's own Chrome / Edge * channel lookup. When nothing launches: in the CLI with npx, `downloadChromium` * (if given) installs Playwright's Chromium and it is launched; otherwise a * ProvisionError with install instructions is thrown. Never spawns npx in the * desktop app. */ export declare function launchInstalledBrowser(launch: LaunchFn, opts?: { args?: string[]; progress?: (m: string) => void; downloadChromium?: () => Promise; engines?: InstalledEngine[]; hosted?: boolean; npx?: boolean; }): Promise<{ browser: B; engine: BrowserEngineId | "channel"; }>; export {};