import type { IPage } from './types.js'; /** * Returns the appropriate browser factory based on site type. * Uses CDPBridge for registered Electron apps, otherwise BrowserBridge. */ export declare function getBrowserFactory(site?: string): new () => IBrowserFactory; export declare const DEFAULT_BROWSER_CONNECT_TIMEOUT: number; export declare const DEFAULT_BROWSER_COMMAND_TIMEOUT: number; export type BrowserWindowMode = 'foreground' | 'background'; export type BrowserSurface = 'browser' | 'adapter'; /** * Timeout with seconds unit. Used for high-level command timeouts. */ export declare function runWithTimeout(promise: Promise, opts: { timeout: number; label?: string; hint?: string; }): Promise; /** * Timeout with milliseconds unit. Used for low-level internal timeouts. * Accepts a factory function to create the rejection error, keeping this * utility decoupled from specific error types. */ export declare function withTimeoutMs(promise: Promise, timeoutMs: number, makeError?: string | (() => Error)): Promise; /** Interface for browser factory (BrowserBridge or test mocks) */ export interface IBrowserFactory { connect(opts?: { timeout?: number; session?: string; cdpEndpoint?: string; contextId?: string; idleTimeout?: number; windowMode?: BrowserWindowMode; surface?: BrowserSurface; siteSession?: 'ephemeral' | 'persistent'; }): Promise; close(): Promise; } export declare function browserSession(BrowserFactory: new () => IBrowserFactory, fn: (page: IPage) => Promise, opts?: { session?: string; cdpEndpoint?: string; contextId?: string; idleTimeout?: number; windowMode?: BrowserWindowMode; surface?: BrowserSurface; siteSession?: 'ephemeral' | 'persistent'; }): Promise;