/** Per-page emulation. Playwright honours all of it (via a context); rustwright * IGNORES it (no context/emulation surface) — so a caller that NEEDS emulation * must declare it so the selector routes to Playwright. */ export interface EmuOptions { colorScheme?: "light" | "dark"; viewport?: { width: number; height: number; }; deviceScaleFactor?: number; } export type WaitUntil = "load" | "domcontentloaded" | "networkidle" | "commit"; /** The minimal page surface both engines implement — the subset slowcook uses * (no locators/route/tracing; those aren't used anywhere in the codebase). */ export interface DriverPage { goto(url: string, opts?: { waitUntil?: WaitUntil; }): Promise; evaluate(expression: string): Promise; screenshot(opts: { path?: string; fullPage?: boolean; }): Promise; click(selector: string): Promise; fill(selector: string, value: string): Promise; textContent(selector: string): Promise; title(): Promise; waitFor(ms: number): Promise; close(): Promise; } export interface DriverSession { /** A fresh page. `emu` is honoured only if `caps.emulation` is true. */ newPage(emu?: EmuOptions): Promise; close(): Promise; } /** What an engine can do — the selector matches these against a workload's needs. */ export interface DriverCaps { /** per-page colorScheme/viewport/DPI (Playwright: yes; rustwright: no). */ emulation: boolean; /** isolated browser contexts (Playwright: yes; rustwright: no → fresh browser per page). */ contexts: boolean; /** "full" = keyboard/hover/press/etc; "basic" = click + fill only (rustwright). */ actions: "full" | "basic"; } export interface BrowserDriver { readonly name: "playwright" | "rustwright"; readonly caps: DriverCaps; launch(): Promise; } /** A workload's requirements; the selector will only pick an engine whose caps * satisfy ALL of these, else it FAILS OVER to Playwright. */ export interface DriverNeed { emulation?: boolean; contexts?: boolean; actions?: "full" | "basic"; } /** true if `caps` satisfies every stated need. */ export declare function satisfies(caps: DriverCaps, need: DriverNeed): boolean; //# sourceMappingURL=driver.d.ts.map