/// declare namespace WebdriverIO { function remote( options?: RemoteOptions, modifier?: (...args: any[]) => any ): Promise; function attach( options: WebDriver.AttachSessionOptions, ): BrowserObject; function multiremote( options: MultiRemoteOptions ): Promise; interface Browser { /** * 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: 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: any[]) => void), ...arguments: any[]) => Promise; } interface BrowserObject extends WebDriver.ClientOptions, WebDriver.ClientAsync, Browser { } } declare var browser: WebdriverIO.BrowserObject; declare var driver: WebdriverIO.BrowserObject; /** * 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 }