-
-
Notifications
You must be signed in to change notification settings - Fork 150
/
Copy pathmouse-provider.interface.ts
85 lines (73 loc) · 2.03 KB
/
mouse-provider.interface.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { Button } from "../button.enum";
import { Point } from "../point.class";
/**
* A MouseActionProvider should provide access to a systems mouse input
*/
export interface MouseProviderInterface {
/**
* setMouseDelay should allow to configure mouse movement speed
*
* @param delay The delay in milliseconds
*/
setMouseDelay(delay: number): void;
/**
* setMousePosition should allow to set the mouse cursor position
*
* @param p The {@link Point} to which the mouse pointer should be set
*/
setMousePosition(p: Point): Promise<void>;
/**
* currentMousePosition should return the current mouse pointer position
*
* @returns The current mouse pointer position
*/
currentMousePosition(): Promise<Point>;
/**
* leftClick should allow to perform a left click via OS event
*/
leftClick(): Promise<void>;
/**
* rightClick should allow to perform a right click via OS event
*/
rightClick(): Promise<void>;
/**
* middleClick should allow to perform a middle click via OS event
*/
middleClick(): Promise<void>;
/**
* scrollUp should allow to perform an upward mouse scroll
*
* @param amount The scroll amount
*/
scrollUp(amount: number): Promise<void>;
/**
* scrollDown should allow to perform an downward mouse scroll
*
* @param amount The scroll amount
*/
scrollDown(amount: number): Promise<void>;
/**
* scrollLeft should allow to perform a left mouse scroll
*
* @param amount The scroll amount
*/
scrollLeft(amount: number): Promise<void>;
/**
* scrollRight should perform a right mouse scroll
*
* @param amount The scroll amount
*/
scrollRight(amount: number): Promise<void>;
/**
* pressButton should allow to press and hold a mouse button
*
* @param btn The {@link Button} to press and hold
*/
pressButton(btn: Button): Promise<void>;
/**
* releaseButton should allow to release a pressed button
*
* @param btn The {@link Button} to release
*/
releaseButton(btn: Button): Promise<void>;
}