import type { Browser, BrowserContext, Page } from 'playwright'; import type { PageRegion, Viewport } from '@variance-authority/core/format'; /** * One page per viewport, reused. * * `deviceScaleFactor` and `colorScheme` are context-level in Playwright, so a * document at 2x genuinely needs its own context. Keying the cache on the whole * viewport rather than recreating per render keeps a run at one context in the * normal case, where every subject shares a viewport. */ export declare class PagePool { #private; constructor(browser: Browser, limit: number, region: Required, onWebSocket: (context: BrowserContext, url: string) => void, drive: (page: Page) => Promise); /** * Wait for a slot, then hand back a page nobody else is painting into. * * The slot count is global while pages are keyed by viewport, and those are * deliberately different. The limit exists to bound *concurrent Chromium work*, * which does not care what size the pages are; the key exists because a page's * viewport and scale factor cannot be changed without recreating its context. * A run at one viewport — the normal case — reuses the same pages forever. */ acquire(viewport: Viewport, closed: boolean): Promise<{ page: Page; release: () => void; }>; /** * Close every context this pool opened. * * The browser is leased and may outlive this pool — a collector's pages are * still in it — so what the pool opened is closed here rather than by closing * the browser. */ close(): Promise; } //# sourceMappingURL=page-pool.d.ts.map