import type { ClientOptions, WebSocket } from 'ws'; import type { CommandData } from './remoteTypes.js'; import type { CommandResponse } from './localTypes.js'; import type { Client } from '../types.js'; /** * Set this symbol on a command's `params` to keep its values out of logs and * `bidiCommand` events, e.g. text typed with `setValue(value, { mask: true })`. * `JSON.stringify` skips symbol keys, so the command is sent unchanged. */ export declare const BIDI_MASK: unique symbol; /** * Set this symbol on a command's `params` to a number of milliseconds: `send` * rejects with a `script timeout` error when the browser does not answer within * that time. WebDriver BiDi has no script timeout * (https://github.com/w3c/webdriver-bidi/issues/199), so `execute` sets the * session's `script` timeout here. The time starts when the command is sent, * so command hooks do not count. Like `BIDI_MASK`, it is not sent. */ export declare const BIDI_SCRIPT_TIMEOUT: unique symbol; /** * how many timed out commands `BidiCore` remembers to ignore their late result; * a script that never settles never answers, so the oldest ids are dropped */ export declare const MAX_EXPIRED_COMMANDS = 1000; export declare class BidiCore { #private; client: Client | undefined; /** * @private */ private _isConnected; constructor(webSocketUrl: string, opts?: ClientOptions, responseTimeout?: number, connectTimeout?: number); /** * We initiate the Bidi instance before a WebdriverIO instance is created. * In order to emit Bidi events we have to attach the WebdriverIO instance * to the Bidi instance afterwards. */ attachClient(client: Client): void; connect(): Promise; close(): void; /** * Close a connection that can not serve the session: the handler is then in the * state of a connection that could not be made, so the session does not count as ended */ discard(): void; reconnect(webSocketUrl: string, opts?: ClientOptions): Promise; /** * Helper function that allows to wait until Bidi connection establishes * @returns a promise that resolves once the connection to WebDriver Bidi protocol was established */ waitForConnected(): Promise; get socket(): WebSocket | undefined; get isConnected(): boolean; /** * `true` when the connection was open and is closed now: after `close()` (e.g. by * `deleteSession`), or when the browser or the driver closed the socket. `false` before * the first connection and when the connection could not be made. */ get isClosed(): boolean; send(params: Omit): Promise; sendAsync(params: Omit): number; } /** * A copy of the command to log when its params carry `BIDI_MASK`. Key action * values are replaced, so the log still shows the shape of the input. * Any other masked command hides all of its params. */ export declare function maskBidiCommand(params: Omit): Omit; export declare function parseBidiCommand(params: Omit): string[]; //# sourceMappingURL=core.d.ts.map