1 | import type { ElementReference } from '@wdio/protocols';
|
2 | import type { BaseActionParams } from './base.js';
|
3 | import BaseAction from './base.js';
|
4 | import type { ChainablePromiseElement } from '../../types.js';
|
5 | export declare const buttonValue: readonly [0, 1, 2, "left", "middle", "right"];
|
6 | export type ButtonNames = 'left' | 'middle' | 'right';
|
7 | export type Button = 0 | 1 | 2;
|
8 | export type Origin = 'pointer' | 'viewport';
|
9 | interface PointerActionUpParams {
|
10 | |
11 |
|
12 |
|
13 |
|
14 | button: Button | ButtonNames;
|
15 | }
|
16 | declare const PARAM_DEFAULTS: {
|
17 | width: number;
|
18 | height: number;
|
19 | pressure: number;
|
20 | tangentialPressure: number;
|
21 | tiltX: number;
|
22 | tiltY: number;
|
23 | twist: number;
|
24 | altitudeAngle: number;
|
25 | azimuthAngle: number;
|
26 | |
27 |
|
28 |
|
29 |
|
30 | button: Button | ButtonNames;
|
31 | };
|
32 | declare const MOVE_PARAM_DEFAULTS: {
|
33 | x: number;
|
34 | y: number;
|
35 | duration: number;
|
36 | origin: (Origin | ElementReference | ChainablePromiseElement | WebdriverIO.Element);
|
37 | };
|
38 | type PointerActionParams = Partial<typeof PARAM_DEFAULTS> & Partial<PointerActionUpParams>;
|
39 | type PointerActionMoveParams = Partial<typeof MOVE_PARAM_DEFAULTS> & PointerActionParams;
|
40 | export default class PointerAction extends BaseAction {
|
41 | constructor(instance: WebdriverIO.Browser, params?: BaseActionParams);
|
42 | /**
|
43 | * Creates an action for moving the pointer `x` and `y` pixels from the specified
|
44 | * `origin`. The `origin` may be defined as the pointers current position (e.g. "pointer"),
|
45 | * the viewport (e.g. "viewport") or the center of a specific element.
|
46 | * @param params PointerActionMoveParams
|
47 | */
|
48 | move(params: PointerActionMoveParams): PointerAction;
|
49 | move(x: number, y: number): PointerAction;
|
50 | /**
|
51 | * Creates an action to release a single key.
|
52 | * @param params PointerActionUpParams
|
53 | */
|
54 | up(button?: Button): PointerAction;
|
55 | up(button?: ButtonNames): PointerAction;
|
56 | up(params?: PointerActionUpParams): PointerAction;
|
57 | /**
|
58 | * Creates an action to press a single key
|
59 | * @param params PointerActionParams
|
60 | */
|
61 | down(button?: Button): PointerAction;
|
62 | down(button?: ButtonNames): PointerAction;
|
63 | down(params?: PointerActionParams): PointerAction;
|
64 | /**
|
65 | * An action that cancels this pointer's current input.
|
66 | */
|
67 | cancel(): this;
|
68 | }
|
69 | export {};
|
70 |
|
\ | No newline at end of file |