/**
 * @license
 * Copyright 2025 Steven Roussey <sroussey@gmail.com>
 * SPDX-License-Identifier: Apache-2.0
 */
import type { AccessibilityTree, AriaRole, BrowserConnectOptions, ClickOptions, ConsoleMessage, DialogAction, DialogInfo, DownloadOptions, DownloadResult, ElementRef, IBrowserContext, NavigateOptions, NetworkFilter, NetworkRequest, ScreenshotOptions, SnapshotOptions, TabInfo, WaitOptions } from "./IBrowserContext";
type AnyBrowser = any;
export declare class PlaywrightBackend implements IBrowserContext {
    private readonly sharedLocalBrowser?;
    /**
     * When set, `connect()` reuses this browser for local mode instead of launching a new process.
     * Used by integration tests to avoid per-test launch/teardown flakiness. The caller must not
     * close the browser until all backends that reference it have disconnected.
     */
    constructor(sharedLocalBrowser?: AnyBrowser);
    private _browser;
    private _context;
    private _page;
    private _connected;
    /** True when this backend launched Chromium locally (owns full process tree). */
    private _launchedLocalChromium;
    private _refMap;
    private _refCounter;
    private _dialogHandler;
    connect(options?: BrowserConnectOptions): Promise<void>;
    disconnect(): Promise<void>;
    isConnected(): boolean;
    private get page();
    private get context();
    /**
     * Resolve an ElementRef to a Playwright Locator.
     * The refMap stores descriptor strings like:
     *   "getByRole:button:Sign In"
     *   "getByText:some text"
     *   "css:.my-class"
     *   "nth:getByRole:listitem::2"
     */
    private resolveRef;
    private descriptorToLocator;
    navigate(url: string, options?: NavigateOptions): Promise<void>;
    goBack(options?: NavigateOptions): Promise<void>;
    goForward(options?: NavigateOptions): Promise<void>;
    reload(options?: NavigateOptions): Promise<void>;
    currentUrl(): Promise<string>;
    title(): Promise<string>;
    snapshot(options?: SnapshotOptions): Promise<AccessibilityTree>;
    click(ref: ElementRef, options?: ClickOptions): Promise<void>;
    fill(ref: ElementRef, value: string, options?: WaitOptions): Promise<void>;
    selectOption(ref: ElementRef, values: string | readonly string[], options?: WaitOptions): Promise<void>;
    hover(ref: ElementRef, options?: WaitOptions): Promise<void>;
    clickByRole(role: AriaRole, name: string, options?: ClickOptions): Promise<void>;
    fillByLabel(label: string, value: string, options?: WaitOptions): Promise<void>;
    content(): Promise<string>;
    innerHTML(ref: ElementRef): Promise<string>;
    textContent(ref: ElementRef): Promise<string | null>;
    attribute(ref: ElementRef, name: string): Promise<string | null>;
    querySelector(selector: string): Promise<ElementRef | null>;
    querySelectorAll(selector: string): Promise<readonly ElementRef[]>;
    evaluate<T>(expression: string): Promise<T>;
    screenshot(options?: ScreenshotOptions): Promise<Buffer>;
    pressKey(key: string, _options?: WaitOptions): Promise<void>;
    type(text: string, _options?: WaitOptions): Promise<void>;
    scroll(x: number, y: number, ref?: ElementRef): Promise<void>;
    uploadFile(ref: ElementRef, paths: string | readonly string[]): Promise<void>;
    download(trigger: () => Promise<void>, options?: DownloadOptions): Promise<DownloadResult>;
    onDialog(handler: (info: DialogInfo) => DialogAction | Promise<DialogAction>): void;
    tabs(): Promise<readonly TabInfo[]>;
    switchTab(tabId: string): Promise<void>;
    newTab(url?: string): Promise<TabInfo>;
    closeTab(tabId: string): Promise<void>;
    waitForNavigation(options?: NavigateOptions): Promise<void>;
    waitForSelector(selector: string, options?: WaitOptions): Promise<ElementRef>;
    waitForIdle(options?: WaitOptions): Promise<void>;
    readonly networkRequests: (_filter?: NetworkFilter) => Promise<readonly NetworkRequest[]>;
    readonly consoleMessages: () => Promise<readonly ConsoleMessage[]>;
}
export {};
//# sourceMappingURL=PlaywrightBackend.d.ts.map