UNPKG

1.29 kBTypeScriptView Raw
1import type { ElementReference } from '@wdio/protocols';
2export type ActionType = 'key' | 'pointer' | 'wheel';
3export type KeyActionType = 'mouse' | 'pen' | 'touch';
4export interface ActionParameters {
5 pointerType?: KeyActionType;
6}
7export interface BaseActionParams {
8 id?: string;
9 parameters?: ActionParameters;
10}
11interface Sequence {
12 type: string;
13 duration?: number;
14 origin?: (ElementReference | WebdriverIO.Element | 'pointer' | 'viewport') & {
15 then?: Function;
16 };
17 value?: string;
18}
19export default class BaseAction {
20 #private;
21 protected instance: WebdriverIO.Browser;
22 protected sequence: Sequence[];
23 constructor(instance: WebdriverIO.Browser, type: ActionType, params?: BaseActionParams);
24 toJSON(): {
25 id: string;
26 type: ActionType;
27 parameters: ActionParameters;
28 actions: Sequence[];
29 };
30 /**
31 * Inserts a pause action for the specified device, ensuring it idles for a tick.
32 * @param duration idle time of tick
33 */
34 pause(duration: number): this;
35 /**
36 * Perform action sequence
37 * @param skipRelease set to true if `releaseActions` command should not be invoked
38 */
39 perform(skipRelease?: boolean): Promise<void>;
40}
41export {};
42//# sourceMappingURL=base.d.ts.map
\No newline at end of file