import { PipelineStep } from "@warpgogol/pipeline-core"; import type { PipelineStepContext } from "@warpgogol/pipeline-core"; export type PlaywrightBrowser = { newContext(opts?: unknown): Promise; close(): Promise; }; export type PlaywrightContext = { newPage(): Promise; close(): Promise; }; export type PlaywrightPage = { goto(url: string, opts?: unknown): Promise; close(): Promise; [k: string]: unknown; }; export type BrowserLaunchOptions = { headless?: boolean; args?: string[]; timeout?: number; }; export declare abstract class PlaywrightPooledStep extends PipelineStep { #private; /** * Max concurrent pages (contexts) across the pool. Default: 2. * Override to adjust per-step concurrency. */ protected getPoolConcurrency(): number; /** Override to change Chromium launch options. */ protected getLaunchOptions(): BrowserLaunchOptions; /** * Launches Chromium, runs `fn` with the browser, then closes the browser. * Subclass typically calls this once at the top of `run()`. */ protected withBrowser(fn: (browser: PlaywrightBrowser) => Promise): Promise; /** * Opens a fresh context + page, runs `fn`, then closes both. * Enforces `getPoolConcurrency()` via an internal ConcurrencyGate. * * Each call gets an isolated browser context — safe for parallel scrapes * without cookie / cache cross-contamination. */ protected withPage(browser: PlaywrightBrowser, fn: (page: PlaywrightPage) => Promise): Promise; } //# sourceMappingURL=playwright-pooled-step.d.ts.map