From c90d76e46458a97c8087e24fa3cd27a9b2274993 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Tue, 12 Mar 2024 07:34:53 +0100 Subject: [PATCH] Update types --- types/core/engine/command/bidi.d.ts | 60 +++++++++++++++++++++++++ types/core/engine/command/bidi.d.ts.map | 1 + types/core/engine/commands.d.ts | 7 +++ types/core/engine/commands.d.ts.map | 2 +- types/support/getViewPort.d.ts.map | 2 +- 5 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 types/core/engine/command/bidi.d.ts create mode 100644 types/core/engine/command/bidi.d.ts.map diff --git a/types/core/engine/command/bidi.d.ts b/types/core/engine/command/bidi.d.ts new file mode 100644 index 000000000..dde40a5fd --- /dev/null +++ b/types/core/engine/command/bidi.d.ts @@ -0,0 +1,60 @@ +/** + * Manages interactions using Bidi. At the moment this only works for Firefox + * but Chrome and maybe other browsers will support it in the future. + * @class + * @hideconstructor + * @see https://w3c.github.io/webdriver-bidi/ + */ +export class Bidi { + constructor(engineDelegate: any, browserName: any); + /** + * @private + */ + private engineDelegate; + /** + * @private + */ + private browserName; + /** + * Add a fanction that will get the events that you subscribes. + * @async + * @param {Function} f - The callback function to handle incoming messages. The function will get an event passed on to it. Remember to subscribe to the event. + * @throws {Error} Throws an error if the method is called in a browser other than Firefox. + */ + onMessage(f: Function): Promise; + /** + * Retrieves the raw client for Bidi. + * @async + * @example const bidi = await commands.bidi.getRawClient(); + * @returns {Promise} A promise that resolves to the Bidi client. + * @throws {Error} Throws an error if the browser is not supported. + */ + getRawClient(): Promise; + /** + * Subscribe to a event. + * @async + * @param {string} messageType The type of message to subscribe to. + * @returns {Promise} A promise that resolves you have subscribed. + * @throws {Error} Throws an error if the method is called in a browser other than Firefox. + */ + subscribe(messageType: string): Promise; + /** + * Unsubscribe to an event. + * @async + * @param {string} messageType The type of message to unsubscribe to. + * @returns {Promise} A promise that resolves you have unsubscribed. + * @throws {Error} Throws an error if the method is called in a browser other than Firefox. + */ + unsubscribe(messageType: string): Promise; + /** + * Sends a command using Bidi. + * + * @async + * @example await commands.bidi.send({}); + * @param {Object} parameters - The paramaters for the command. + * @throws {Error} Throws an error if the browser is not supported or if the command fails. + * @returns {Promise} A promise that resolves when the command has been sent. + */ + send(parameters: any): Promise; +} +//# sourceMappingURL=bidi.d.ts.map \ No newline at end of file diff --git a/types/core/engine/command/bidi.d.ts.map b/types/core/engine/command/bidi.d.ts.map new file mode 100644 index 000000000..6da466698 --- /dev/null +++ b/types/core/engine/command/bidi.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bidi.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/bidi.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH;IACE,mDASC;IARC;;OAEG;IACH,uBAAoC;IACpC;;OAEG;IACH,oBAA8B;IAGhC;;;;;OAKG;IACH,sCAQC;IAED;;;;;;OAMG;IACH,gBAHa,YAAe,CAS3B;IAED;;;;;;OAMG;IACH,uBAJW,MAAM,GACJ,YAAe,CAY3B;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,GACH,YAAe,CAY5B;IAED;;;;;;;;OAQG;IACH,uBAFa,YAAe,CAe3B;CACF"} \ No newline at end of file diff --git a/types/core/engine/commands.d.ts b/types/core/engine/commands.d.ts index 5273ef384..5ecb86fc8 100644 --- a/types/core/engine/commands.d.ts +++ b/types/core/engine/commands.d.ts @@ -104,6 +104,12 @@ export class Commands { * @type {ChromeDevelopmentToolsProtocol} */ cdp: ChromeDevelopmentToolsProtocol; + /** + * + * Use WebDriver Bidi. Availible in Firefox and in the future more browsers. + * @type {Bidi} + */ + bidi: Bidi; /** * Provides commands for interacting with an Android device. * @type {AndroidCommand} @@ -153,6 +159,7 @@ import { Cache } from './command/cache.js'; import { Meta } from './command/meta.js'; import { Screenshot } from './command/screenshot.js'; import { ChromeDevelopmentToolsProtocol } from './command/chromeDevToolsProtocol.js'; +import { Bidi } from './command/bidi.js'; import { AndroidCommand } from './command/android.js'; import { Debug } from './command/debug.js'; import { Select } from './command/select.js'; diff --git a/types/core/engine/commands.d.ts.map b/types/core/engine/commands.d.ts.map index c2aa20639..2267d5e1c 100644 --- a/types/core/engine/commands.d.ts.map +++ b/types/core/engine/commands.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../lib/core/engine/commands.js"],"names":[],"mappings":"AA6BA;;;GAGG;AACH;IACE,sRAuOC;IApMC,+BAMC;IAMD;;;OAGG;IACH,OAFU,WAAW,CAE+C;IAEpE;;;OAGG;IACH,OAFU,KAAK,CAEmC;IAElD;;;OAGG;IACH,QAFU,MAAM,CAE0B;IAE1C;;;OAGG;IACH,SAFU,OAAO,CAEkB;IAEnC;;;OAGG;IACH,MAFU,IAAI,CAEkC;IAEhD;;;OAGG;IACH,SAFU,OAAO,CAEK;IAEtB;;;;;;;;OAQG;IACH,mBAA+C;IAE/C;;;OAGG;IACH,YAFU,UAAU,CAEwC;IAE5D;;;;;OAKG;IACH,gBAAyC;IAEzC;;;;;OAKG;IACH,wBAAmD;IAEnD;;;OAGG;IACH,IAFU,UAAU,CAEgC;IAEpD;;;OAGG;IACH,QAFU,MAAM,CAMf;IAED;;;OAGG;IACH,KAFU,GAAG,CAEc;IAE3B;;;OAGG;IACH,WAFU,SAAS,CAEoB;IAEvC;;;OAGG;IACH,OAFU,KAAK,CAEuD;IAEtE;;;OAGG;IACH,MAFU,IAAI,CAEQ;IAEtB;;;OAGG;IACH,YAFU,UAAU,CAE+C;IAEnE;;;OAGG;IACH,KAFU,8BAA8B,CAE1B;IAEd;;;OAGG;IACH,SAFU,cAAc,CAEkB;IAE1C;;;;OAIG;IACH,OAFW,KAAK,CAEwB;IAExC;;;OAGG;IACH,WA0BC;IAED;;;OAGG;IACH,QAFU,MAAM,CAEiB;IAEjC;;;;OAIG;IACH,QAHU,OAAO,CAGiB;IAElC;;;OAGG;IACH,SAFU,OAAO,CAEkB;CAEtC;sDA9OqD,4BAA4B;4BAXtD,0BAA0B;sBAfhC,oBAAoB;uBAuBnB,qBAAqB;wBAxBpB,sBAAsB;qBAGzB,mBAAmB;wBAChB,sBAAsB;2BAqBnB,yBAAyB;2BApBzB,yBAAyB;uBAC7B,qBAAqB;oBAExB,kBAAkB;mCAGH,wBAAwB;sBAFrC,oBAAoB;qBACrB,mBAAmB;2BAHb,yBAAyB;+CAQL,qCAAqC;+BADrD,sBAAsB;sBAD/B,oBAAoB;uBADnB,qBAAqB;wBAbpB,sBAAsB;wBAGtB,sBAAsB"} \ No newline at end of file +{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../lib/core/engine/commands.js"],"names":[],"mappings":"AA8BA;;;GAGG;AACH;IACE,sRA8OC;IA3MC,+BAMC;IAMD;;;OAGG;IACH,OAFU,WAAW,CAE+C;IAEpE;;;OAGG;IACH,OAFU,KAAK,CAEmC;IAElD;;;OAGG;IACH,QAFU,MAAM,CAE0B;IAE1C;;;OAGG;IACH,SAFU,OAAO,CAEkB;IAEnC;;;OAGG;IACH,MAFU,IAAI,CAEkC;IAEhD;;;OAGG;IACH,SAFU,OAAO,CAEK;IAEtB;;;;;;;;OAQG;IACH,mBAA+C;IAE/C;;;OAGG;IACH,YAFU,UAAU,CAEwC;IAE5D;;;;;OAKG;IACH,gBAAyC;IAEzC;;;;;OAKG;IACH,wBAAmD;IAEnD;;;OAGG;IACH,IAFU,UAAU,CAEgC;IAEpD;;;OAGG;IACH,QAFU,MAAM,CAMf;IAED;;;OAGG;IACH,KAFU,GAAG,CAEc;IAE3B;;;OAGG;IACH,WAFU,SAAS,CAEoB;IAEvC;;;OAGG;IACH,OAFU,KAAK,CAEuD;IAEtE;;;OAGG;IACH,MAFU,IAAI,CAEQ;IAEtB;;;OAGG;IACH,YAFU,UAAU,CAE+C;IAEnE;;;OAGG;IACH,KAFU,8BAA8B,CAE1B;IAEd;;;;OAIG;IACH,MAFU,IAAI,CAEuC;IAErD;;;OAGG;IACH,SAFU,cAAc,CAEkB;IAE1C;;;;OAIG;IACH,OAFW,KAAK,CAEwB;IAExC;;;OAGG;IACH,WA0BC;IAED;;;OAGG;IACH,QAFU,MAAM,CAEiB;IAEjC;;;;OAIG;IACH,QAHU,OAAO,CAGiB;IAElC;;;OAGG;IACH,SAFU,OAAO,CAEkB;CAEtC;sDArPqD,4BAA4B;4BAXtD,0BAA0B;sBAhBhC,oBAAoB;uBAwBnB,qBAAqB;wBAzBpB,sBAAsB;qBAGzB,mBAAmB;wBAChB,sBAAsB;2BAsBnB,yBAAyB;2BArBzB,yBAAyB;uBAC7B,qBAAqB;oBAExB,kBAAkB;mCAGH,wBAAwB;sBAFrC,oBAAoB;qBACrB,mBAAmB;2BAHb,yBAAyB;+CASL,qCAAqC;qBAF/D,mBAAmB;+BACT,sBAAsB;sBAF/B,oBAAoB;uBADnB,qBAAqB;wBAbpB,sBAAsB;wBAGtB,sBAAsB"} \ No newline at end of file diff --git a/types/support/getViewPort.d.ts.map b/types/support/getViewPort.d.ts.map index 48369bddc..49234c2e1 100644 --- a/types/support/getViewPort.d.ts.map +++ b/types/support/getViewPort.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"getViewPort.d.ts","sourceRoot":"","sources":["../../lib/support/getViewPort.js"],"names":[],"mappings":"AA+BA,+CAkCC"} \ No newline at end of file +{"version":3,"file":"getViewPort.d.ts","sourceRoot":"","sources":["../../lib/support/getViewPort.js"],"names":[],"mappings":"AAqCA,+CAkCC"} \ No newline at end of file