/// declare namespace WebdriverIO { function remote( options?: RemoteOptions, modifier?: (...args: any[]) => any ): Promise; function attach( options: WebDriver.AttachSessionOptions, ): BrowserObject; function multiremote( options: MultiRemoteOptions, config?: { automationProtocol?: string } ): Promise; interface Browser { strategies: Map WebDriver.ElementReference | WebDriver.ElementReference[]> __propertiesObject__: Record puppeteer?: any /** * execute any async action within your test spec */ call: (callback: (...args: any[]) => Promise) => Promise; /** * Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. * The executed script is assumed to be synchronous and the result of evaluating the script is returned to * the client. */ execute: { (script: string | ((...arguments: V) => T), ...arguments: U): Promise; // This overload can be removed when typescript supports partial generics inference: https://github.com/microsoft/TypeScript/issues/26242 (script: string | ((...arguments: any[]) => T), ...arguments: any[]): Promise; }; // there is no way to add callback as last parameter after `...args`. // https://github.com/Microsoft/TypeScript/issues/1360 // executeAsync: (script: string | ((...arguments: any[], callback: (result: T) => void) => void), ...arguments: any[]) => Promise; /** * Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. * The executed script is assumed to be asynchronous and must signal that is done by invoking * the provided callback, which is always provided as the final argument to the function. The value * to this callback will be returned to the client. */ executeAsync: (script: string | ((...arguments: V) => void), ...arguments: U) => Promise; } interface BrowserObject extends WebDriver.ClientOptions, WebDriver.ClientAsync, Browser { } interface MultiRemoteBrowser extends WebDriver.ClientOptions, WebDriver.ClientAsync, Browser { } /** * Error to be thrown when a severe error was encountered when a Service is being ran. */ class SevereServiceError extends Error { } } declare var browser: WebdriverIO.BrowserObject | WebdriverIO.MultiRemoteBrowserObject; declare var driver: WebdriverIO.BrowserObject | WebdriverIO.MultiRemoteBrowserObject; /** * internal flags */ declare var _HAS_FIBER_CONTEXT: boolean /** * find a single element on the page. */ declare var $: (selector: string | Function) => Promise; /** * find multiple elements on the page. */ declare var $$: (selector: string | Function) => Promise; declare module "webdriverio" { export = WebdriverIO }