/** * Lightweight Playwright renderer for SPA-aware page fetching. * * Ported from the Python `render_page.py` in claude-seo. Uses a standalone * Playwright browser context (not shared with the browser extension) to keep * the SEO extension self-contained. */ import type { SeoConfig } from "../config.js"; import type { FetchResult, MeasuredPerformance } from "../types.js"; export interface RenderOptions { viewport?: "desktop" | "mobile"; timeout?: number; blockResources?: string[]; /** Whether to capture the accessibility tree (for agent UX audits). */ captureA11y?: boolean; /** Whether to capture console errors. */ captureConsole?: boolean; /** Whether to capture Web Vitals and real browser performance metrics. */ capturePerformance?: boolean; /** User agent override. */ userAgent?: string; /** Optional AbortSignal to cancel an in-flight render. */ signal?: AbortSignal; } export interface RenderResult extends FetchResult { isSpa: boolean; rawContent: string; consoleErrors: string[]; renderMs: number; accessibilityTree: unknown | null; measuredPerformance?: MeasuredPerformance; } /** Close the shared browser instance (called on session shutdown). */ export declare function closeRenderer(): Promise; /** Check whether Playwright Chromium is available. */ export declare function isRendererAvailable(): Promise; /** * Render a page with Playwright, returning the full DOM after JS execution. * * This is slower than a plain HTTP fetch but necessary for single-page * applications where critical content is injected via JavaScript. */ export declare function renderPage(url: string, config: SeoConfig, opts?: RenderOptions): Promise; //# sourceMappingURL=renderer.d.ts.map