import { type BrowserContext } from '@playwright/test'; import type { Config } from '../types/index.js'; export interface BrowserLaunchOptions { userDataDir: string; serviceName: string; config: Config; timeout?: number; extraArgs?: string[]; } export interface BrowserLaunchResult { context: BrowserContext; wasHeadless: boolean; needsLogin: boolean; } export declare const COMMON_CHROME_ARGS: string[]; /** * Check if user data directory has existing session */ export declare function hasExistingSession(userDataDir: string): boolean; /** * Determine if browser should run in headless mode */ export declare function shouldRunHeadless(hasSession: boolean, config: Config): boolean; /** * Launch browser with conditional headless mode * * Returns context and metadata about launch configuration */ export declare function launchBrowser(options: BrowserLaunchOptions): Promise; /** * Handle session expiration with clear error message */ export declare function handleSessionExpired(serviceName: string, userDataDir: string): never; /** * Check if Playwright Chromium is installed * * @returns true if Chromium browser is installed, false otherwise */ export declare function checkChromiumInstalled(): Promise; /** * Install Playwright Chromium browser * * @returns true if installation succeeded, false otherwise */ export declare function installChromium(): Promise; export interface RequirePlaywrightOptions { /** Context-specific message explaining why Playwright is needed */ featureDescription: string; /** If true, skip interactive prompt (for CI/scripts) */ nonInteractive?: boolean; /** If true with nonInteractive, auto-install without prompting */ autoInstall?: boolean; } /** * Ensure Playwright Chromium is available, prompting for installation if needed. * * @returns true if Playwright is available, false if user declined or installation failed */ export declare function requirePlaywright(options: RequirePlaywrightOptions): Promise; //# sourceMappingURL=browser-launcher.d.ts.map