import type { Browser, Page } from "playwright";
interface ViewportSize {
    width: number;
    height: number;
}
interface LaunchOptions {
    headless?: boolean;
    viewport?: ViewportSize;
    engine?: import("../types/index.js").BrowserEngine;
}
interface PageOptions {
    viewport?: ViewportSize;
    userAgent?: string;
    locale?: string;
}
/**
 * Launches a Chromium browser instance via Playwright.
 */
export declare function launchBrowser(options?: LaunchOptions): Promise<Browser>;
/**
 * Creates a new page in the given browser with optional viewport,
 * user agent, and locale settings.
 */
export declare function getPage(browser: Browser, options?: PageOptions & {
    engine?: import("../types/index.js").BrowserEngine;
}): Promise<Page>;
/**
 * Closes a browser instance gracefully.
 */
export declare function closeBrowser(browser: Browser, engine?: import("../types/index.js").BrowserEngine): Promise<void>;
/**
 * A pool of reusable browser instances to avoid the overhead of
 * launching a new browser for every test scenario.
 */
export declare class BrowserPool {
    private readonly pool;
    private readonly maxSize;
    private readonly headless;
    private readonly viewport;
    private readonly engine;
    constructor(size: number, options?: {
        headless?: boolean;
        viewport?: ViewportSize;
        engine?: import("../types/index.js").BrowserEngine;
    });
    /**
     * Acquires a browser and page from the pool. Reuses an idle browser
     * if available, or launches a new one if the pool hasn't reached capacity.
     * Waits and retries if the pool is fully occupied.
     */
    acquire(): Promise<{
        browser: Browser;
        page: Page;
    }>;
    /**
     * Returns a browser to the pool, marking it as available.
     */
    release(browser: Browser): void;
    /**
     * Closes all browsers in the pool and clears it.
     */
    closeAll(): Promise<void>;
}
/**
 * A simple factory that launches the appropriate browser engine.
 * Use this as the single entry-point when you want engine-agnostic launch logic.
 */
export interface BrowserConfig {
    headless: boolean;
    viewport?: ViewportSize;
}
export declare function launchBrowserEngine(engine: import("../types/index.js").BrowserEngine, config: BrowserConfig): Promise<Browser>;
/**
 * Installs Chromium for Playwright using bunx.
 */
export declare function installBrowser(engine?: import("../types/index.js").BrowserEngine): Promise<void>;
export {};
//# sourceMappingURL=browser.d.ts.map