UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

215 lines (214 loc) • 10.1 kB
import type { BrowserUserContext } from './browser.js'; import './browser.js'; import type { BrowsingContextBrowsingContext } from './browsing_context.js'; import './browsing_context.js'; import type { EmptyResult, JsInt, JsUint } from './common.js'; import './common.js'; import type { ScriptSharedReference } from './script.js'; import './script.js'; import { Domain, type EventDescriptor } from '../domain.js'; /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputElementOrigin { type: "element"; element: ScriptSharedReference; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputPerformActions { method: "input.performActions"; params: InputPerformActionsParameters; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputPerformActionsParameters { context: BrowsingContextBrowsingContext; actions: Array<InputSourceActions>; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export type InputSourceActions = InputNoneSourceActions | InputKeySourceActions | InputPointerSourceActions | InputWheelSourceActions; /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputNoneSourceActions { type: "none"; id: string; actions: Array<InputNoneSourceAction>; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export type InputNoneSourceAction = InputPauseAction; /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputKeySourceActions { type: "key"; id: string; actions: Array<InputKeySourceAction>; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export type InputKeySourceAction = InputPauseAction | InputKeyDownAction | InputKeyUpAction; /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputPointerSourceActions { type: "pointer"; id: string; parameters?: InputPointerParameters; actions: Array<InputPointerSourceAction>; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export type InputPointerType = "mouse" | "pen" | "touch"; /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputPointerParameters { pointerType?: InputPointerType; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export type InputPointerSourceAction = InputPauseAction | InputPointerDownAction | InputPointerUpAction | InputPointerMoveAction; /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputWheelSourceActions { type: "wheel"; id: string; actions: Array<InputWheelSourceAction>; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export type InputWheelSourceAction = InputPauseAction | InputWheelScrollAction; /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputPauseAction { type: "pause"; duration?: JsUint; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputKeyDownAction { type: "keyDown"; value: string; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputKeyUpAction { type: "keyUp"; value: string; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputPointerUpAction { type: "pointerUp"; button: JsUint; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputPointerDownAction { type: "pointerDown"; button: JsUint; width?: JsUint; height?: JsUint; pressure?: number; tangentialPressure?: number; twist?: number; altitudeAngle?: number; azimuthAngle?: number; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputPointerMoveAction { type: "pointerMove"; x: number; y: number; duration?: JsUint; origin?: InputOrigin; width?: JsUint; height?: JsUint; pressure?: number; tangentialPressure?: number; twist?: number; altitudeAngle?: number; azimuthAngle?: number; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputWheelScrollAction { type: "scroll"; x: JsInt; y: JsInt; deltaX: JsInt; deltaY: JsInt; duration?: JsUint; origin?: InputOrigin; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputPointerCommonProperties { width?: JsUint; height?: JsUint; pressure?: number; tangentialPressure?: number; twist?: number; altitudeAngle?: number; azimuthAngle?: number; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export type InputOrigin = "viewport" | "pointer" | InputElementOrigin; /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export type InputPerformActionsResult = EmptyResult; /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputReleaseActions { method: "input.releaseActions"; params: InputReleaseActionsParameters; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputReleaseActionsParameters { context: BrowsingContextBrowsingContext; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export type InputReleaseActionsResult = EmptyResult; /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputSetFiles { method: "input.setFiles"; params: InputSetFilesParameters; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputSetFilesParameters { context: BrowsingContextBrowsingContext; element: ScriptSharedReference; files: Array<string>; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export type InputSetFilesResult = EmptyResult; /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputFileDialogOpened { method: "input.fileDialogOpened"; params: InputFileDialogInfo; } /** Unsupported BiDi implementation type, see https://www.selenium.dev/documentation/warnings/bidi-implementation/ @internal */ export interface InputFileDialogInfo { context: BrowsingContextBrowsingContext; userContext?: BrowserUserContext; element?: ScriptSharedReference; multiple: boolean; } /** * This is an unsupported API. No compatibility guarantees are provided. * It tracks the W3C WebDriver BiDi specification directly. As the specification * evolves, this API will change or be removed without prior notice. * * @see https://www.selenium.dev/documentation/warnings/bidi-implementation/ * @internal */ export declare class Input extends Domain { /** @see https://w3c.github.io/webdriver-bidi/#event-input-fileDialogOpened */ static readonly FILE_DIALOG_OPENED: EventDescriptor<InputFileDialogInfo>; static readonly PointerType: Readonly<{ readonly MOUSE: "mouse"; readonly PEN: "pen"; readonly TOUCH: "touch"; }>; static create(driver: unknown): Promise<Input>; /** * @param {InputPerformActionsParameters} params * @param {BrowsingContextBrowsingContext} params.context * @param {Array<InputSourceActions>} params.actions * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-input-performActions */ performActions(params: InputPerformActionsParameters): Promise<void>; /** * @param {InputReleaseActionsParameters} params * @param {BrowsingContextBrowsingContext} params.context * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-input-releaseActions */ releaseActions(params: InputReleaseActionsParameters): Promise<void>; /** * @param {InputSetFilesParameters} params * @param {BrowsingContextBrowsingContext} params.context * @param {ScriptSharedReference} params.element * @param {Array<string>} params.files * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-input-setFiles */ setFiles(params: InputSetFilesParameters): Promise<void>; }