import type { Backend } from "lucarne"; import { type ChildProcess } from "node:child_process"; type SpawnBrowser = (command: string, args: readonly string[], options: { env: NodeJS.ProcessEnv; stdio: ["ignore", "ignore", "pipe"]; }) => ChildProcess; type NativeBackendDependencies = { closeBrowser?: (cdpUrl: string) => Promise; spawnBrowser?: SpawnBrowser; waitForCdp?: (host: string, port: number) => Promise; }; type BrowserEnvironmentOptions = { platform?: NodeJS.Platform; sessionBusExists?: (path: string) => boolean; uid?: number; }; /** * Lucarne's native-backend seam with ownership-safe startup rollback. * * Lucarne only receives a BackendHandle after start() resolves. If Chromium is * spawned and CDP then fails to appear, a backend that simply throws has lost the * only process handle and the engine cannot clean it up. Keep the child here and * tear it down before propagating the startup error. */ export declare function createBrowserNativeBackend(dependencies?: NativeBackendDependencies): Backend; export declare function browserProcessEnvironment(source: NodeJS.ProcessEnv, options?: BrowserEnvironmentOptions): NodeJS.ProcessEnv; export declare function contentSafeChromeDiagnostic(value: string): string; export {};