/// import { Target } from "./createTarget"; import { EmulatorOptions } from "../runner/parseConfig"; declare type Unsubscriber = () => void; export declare type ChromeCookie = { name: string; value: string; url?: string; domain?: string; path?: string; secure?: boolean; httpOnly?: boolean; sameSite?: "Strict" | "Lax" | "Extended" | "None"; expires?: number; }; export interface ICDPClient { _ws: { readyState: 1 | 2 | 3; }; close: () => Promise; Browser: { close: () => Promise; }; Network: { enable: () => Promise; setCookies: (arg: { cookies: ChromeCookie[]; }) => Promise; getCookies: (arg?: { urls?: string[]; }) => Promise<{ cookies: ChromeCookie[]; }>; }; Page: { enable: () => Promise; loadEventFired: (fn?: () => void) => (() => void); domContentEventFired: (fn?: () => void) => (() => void); navigate: (options: { url: string; }) => Promise; addScriptToEvaluateOnNewDocument: (arg0: { source: string; }) => Promise; removeScriptToEvaluateOnNewDocument: (scriptId: object) => Promise; navigatedWithinDocument: (fn?: () => void) => (() => void); frameNavigated: (fn?: () => void) => (() => void); stopLoading: () => Promise; setBypassCSP: (arg0: { enabled: boolean; }) => Promise; }; DOM: { enable: () => Promise; querySelector: (arg: { nodeId: number; selector: string; }) => Promise<{ nodeId: number; }>; getDocument: () => Promise<{ root: any; }>; focus: (arg: { nodeId: number; }) => Promise; }; CSS: { enable: () => Promise; }; DOMStorage: { enable: () => Promise; }; Security: { enable: () => Promise; setIgnoreCertificateErrors: (arg: { ignore: boolean; }) => Promise; }; Console: { enable: () => Promise; }; Emulation: { setDeviceMetricsOverride: (metrics: EmulatorOptions) => Promise; setVisibleSize: (size: { width: EmulatorOptions["width"]; height: EmulatorOptions["height"]; }) => Promise; setUserAgentOverride: (arg: { userAgent: string; acceptLanguage: string; platform: string; }) => Promise; }; Target: { createTarget: (options: { url: string; browserContextId?: string; }) => Promise<{ targetId: string; }>; activateTarget: (options: { targetId: string; }) => Promise; closeTarget: (options: { targetId: string; }) => Promise; createBrowserContext: () => Promise<{ browserContextId: string; }>; disposeBrowserContext: (options: { browserContextId: string; }) => Promise; }; Runtime: { enable: () => Promise; evaluate: (options: { expression: string; returnByValue: boolean; awaitPromise: boolean; }) => Promise<{ result: { value: any; }; exceptionDetails?: object; }>; }; on: (domainEvent: string, listener: () => void) => Unsubscriber; removeListener: (domainEvent: string, listener: () => void) => void; } export interface IConnection { client: ICDPClient; target: Target; active: boolean; preloaderIds: object[]; preloaders: string[]; unsubscribers: Unsubscriber[]; timeouts: NodeJS.Timeout[]; intervals: NodeJS.Timeout[]; namespace: string; useNameSpace: (ns: string) => Promise; activate: () => Promise; release: () => Promise; evaluate: (fn: (this: Window["ayakashi"], ...params: U) => T, ...args: U) => Promise; evaluateAsync: (fn: (this: Window["ayakashi"], ...params: U) => Promise, ...args: U) => Promise; injectPreloader: (options: { compiled: { wrapper: string; source: string; }; as: string | null; waitForDOM: boolean; }) => Promise; pipe: { console: (listener: (text: string) => void) => void; uncaughtException: (listener: (exception: { text: string; lineNumber: number; columnNumber: number; stackTrace: Object; }) => void) => void; }; mouse: { click: (x: number, y: number, options?: { button?: "left" | "right" | "middle"; clickCount?: number; }) => Promise; move: (x: number, y: number) => Promise; }; touchScreen: { tap: (x: number, y: number) => Promise; }; keyBoard: { type: (text: string, options?: { delay: number; }) => Promise; press: (key: string, options?: { delay: number; }) => Promise; }; } export declare function createConnection(target: Target, bridgePort: number, emulatorOptions?: EmulatorOptions): Promise; export {};