import type { ResolvedLaunchOpts } from './options.js'; export type AnyBrowser = { newPage: (opts?: unknown) => Promise; newContext: (opts?: unknown) => Promise; contexts: () => AnyContext[]; close: () => Promise; version?: () => string; }; export type AnyContext = { newPage: () => Promise; pages: () => AnyPage[]; cookies: (urls?: string | string[]) => Promise; addCookies: (cookies: unknown[]) => Promise; clearCookies: () => Promise; storageState: (opts?: { path?: string; }) => Promise; setExtraHTTPHeaders: (h: Record) => Promise; grantPermissions: (perms: string[], opts?: unknown) => Promise; request: AnyRequest; close: () => Promise; browser?: () => AnyBrowser | null; }; export type AnyPage = { goto: (url: string, opts?: unknown) => Promise; goBack: (opts?: unknown) => Promise; goForward: (opts?: unknown) => Promise; reload: (opts?: unknown) => Promise; url: () => string; title: () => Promise; content: () => Promise; screenshot: (opts?: unknown) => Promise; pdf: (opts?: unknown) => Promise; evaluate: (fn: string | ((...args: unknown[]) => T), ...args: unknown[]) => Promise; click: (selector: string, opts?: unknown) => Promise; dblclick: (selector: string, opts?: unknown) => Promise; fill: (selector: string, value: string, opts?: unknown) => Promise; type: (selector: string, text: string, opts?: unknown) => Promise; hover: (selector: string, opts?: unknown) => Promise; focus: (selector: string, opts?: unknown) => Promise; selectOption: (selector: string, values: unknown, opts?: unknown) => Promise; check: (selector: string, opts?: unknown) => Promise; uncheck: (selector: string, opts?: unknown) => Promise; setInputFiles: (selector: string, files: unknown, opts?: unknown) => Promise; dragAndDrop: (from: string, to: string, opts?: unknown) => Promise; dispatchEvent: (selector: string, type: string, eventInit?: unknown) => Promise; waitForSelector: (selector: string, opts?: unknown) => Promise; waitForLoadState: (state?: string, opts?: unknown) => Promise; waitForURL: (url: string | RegExp, opts?: unknown) => Promise; waitForFunction: (fn: string | ((...args: unknown[]) => unknown), arg?: unknown, opts?: unknown) => Promise; waitForTimeout: (ms: number) => Promise; innerText: (selector: string, opts?: unknown) => Promise; innerHTML: (selector: string, opts?: unknown) => Promise; textContent: (selector: string, opts?: unknown) => Promise; getAttribute: (selector: string, name: string, opts?: unknown) => Promise; accessibility: { snapshot: (opts?: unknown) => Promise; }; keyboard: { press: (key: string, opts?: unknown) => Promise; type: (text: string, opts?: unknown) => Promise; }; mouse: { move: (x: number, y: number) => Promise; click: (x: number, y: number, opts?: unknown) => Promise; }; frames: () => Array<{ url: () => string; name: () => string; }>; close: () => Promise; isClosed: () => boolean; on: (event: string, handler: (...args: unknown[]) => void) => void; off: (event: string, handler: (...args: unknown[]) => void) => void; route: (pattern: string | RegExp, handler: (...args: unknown[]) => void) => Promise; unroute: (pattern: string | RegExp, handler?: (...args: unknown[]) => void) => Promise; context: () => AnyContext; }; export type AnyRequest = { fetch: (url: string, opts?: unknown) => Promise<{ status: () => number; statusText: () => string; headers: () => Record; text: () => Promise; body: () => Promise; json: () => Promise; ok: () => boolean; url: () => string; }>; }; type CloakModule = { launch: (opts?: unknown) => Promise; launchContext?: (opts?: unknown) => Promise; launchPersistentContext?: (userDataDir: string, opts?: unknown) => Promise; ensureBinary?: () => Promise; binaryInfo?: () => unknown; clearCache?: () => unknown; buildLaunchOptions?: (raw: Record) => Promise>; buildContextOptions?: (raw: Record) => Record; humanizeBrowser?: (browser: AnyBrowser, opts?: Record) => Promise; }; export declare function loadCloakBrowser(): Promise; export type LaunchedHandle = { kind: 'browser'; browser: AnyBrowser; close: () => Promise; } | { kind: 'context'; context: AnyContext; close: () => Promise; }; export declare function launchFromResolved(resolved: ResolvedLaunchOpts): Promise; export declare function getPageOrCreate(handle: LaunchedHandle): Promise; export declare function getDefaultContext(handle: LaunchedHandle): Promise; export {}; //# sourceMappingURL=browser.d.ts.map