/** * Daemon Browser Management * * Manages a persistent Playwright browser and page instance within the daemon process. * Unlike the existing playwright.ts which opens and closes browsers per-operation, * this keeps a single browser alive for the daemon's lifetime. */ type Browser = import('playwright').Browser; type Page = import('playwright').Page; /** Configure headed mode before first initBrowser() call */ export declare function setHeadedMode(headed: boolean): void; /** * Initialize the persistent browser and navigate to the target URL. * Called once when the daemon starts or on first command. */ export declare function initBrowser(url: string): Promise; /** * Get the persistent page instance. Throws if browser not initialized. */ export declare function getPage(): Page; /** * Get the browser instance (needed for creating recording contexts). */ export declare function getBrowserInstance(): Browser; /** * Navigate to a URL if it differs from the current one. */ export declare function navigateTo(url: string): Promise; /** * Take a screenshot of the current page or a specific element. * If `page` is provided, screenshots that page instead of the daemon's * main page (e.g. the recording page during a session). */ export declare function takeScreenshot(opts: { selector?: string; fullPage?: boolean; viewport?: string; page?: Page; /** Pixels of extra context to include around the selector's bounding box. */ padding?: number; /** Force the page's color scheme: 'light' | 'dark' | 'no-preference' */ theme?: 'light' | 'dark' | 'no-preference'; /** Temporarily hide DevBar chrome from the captured image. */ hideDevbar?: boolean; }): Promise<{ buffer: Buffer; width: number; height: number; /** Number of elements matching `selector` (informational; only the first is captured). */ matchCount?: number; /** Document scrollHeight if it exceeds the viewport (lets callers hint at --full-page). */ pageHeight?: number; viewportHeight?: number; }>; /** * Take responsive screenshots at multiple viewport widths. */ export declare function takeResponsiveScreenshots(opts: { viewports: number[]; fullPage?: boolean; hideDevbar?: boolean; }): Promise>; /** * Close the browser and clean up resources. */ export declare function closeBrowser(): Promise; export {}; //# sourceMappingURL=browser.d.ts.map