/** * Optional Playwright loader (RFC 0004 R10, Lane F). * * UXLoom's core is zero-dependency: Playwright is NEVER declared in * package.json — not even devDependencies. It is loaded at runtime via an * indirect dynamic import (`new Function("return import(...)")()`), so tsc * never tries to resolve the module: a plain `import("playwright")` fails * type resolution (TS2307) when the package is absent. When the user has * installed Playwright, `--live` audit and `--png` export light up; * otherwise callers degrade gracefully and print PLAYWRIGHT_HINT. * * The Playwright surface is typed structurally below (PlaywrightLike et * al.) — only the handful of members we call — so this file compiles * cleanly without Playwright's own type declarations. */ /** One-line install hint printed whenever an optional feature is unavailable. */ export declare const PLAYWRIGHT_HINT = "npm i -D playwright && npx playwright install chromium \u2014 enables --live audit and --png export"; /** The subset of a Playwright Locator we use: element screenshots. */ export interface LocatorLike { screenshot(options?: Record): Promise; } /** The subset of a Playwright Page we use. */ export interface PageLike { goto(url: string, options?: Record): Promise; /** Evaluate a JS expression string in the page; we always pass strings. */ evaluate(script: string): Promise; waitForLoadState(state?: string, options?: Record): Promise; setViewportSize(size: { width: number; height: number; }): Promise; locator(selector: string): LocatorLike; } /** The subset of a Playwright Browser we use. */ export interface BrowserLike { newPage(): Promise; close(): Promise; } /** The subset of the Playwright module we use. */ export interface PlaywrightLike { chromium: { launch(options?: Record): Promise; }; } /** * Try to load Playwright at runtime. Returns null when it is not * installed (or exports an unexpected shape) — never throws. */ export declare function loadPlaywright(): Promise;