-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
112 lines (109 loc) · 3.76 KB
/
index.d.ts
File metadata and controls
112 lines (109 loc) · 3.76 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* auto-generated by NAPI-RS */
/* eslint-disable */
export declare class Enigo {
static create(): Enigo
/** Get the location of the mouse in pixels. */
getMousePosition(): [number, number]
/**
* Move the mouse cursor to the specified x and y coordinates.
*
* The top left corner of your monitor screen is x=0 y=0.
* Move the cursor down the screen by increasing the y and to the right by increasing x coordinate.
*/
mouseMove(x: number, y: number): void
/**
* Sends an individual mouse button event.
*
* You can use this for example to simulate a click of the left mouse key.
* Some of the buttons are specific to a platform.
*/
mouseButton(button: Button, direction: Direction): void
/** Sends an individual mouse button event using Direction::Press. */
mouseDown(button: Button): void
/** Sends an individual mouse button event using Direction::Release. */
mouseUp(button: Button): void
/** Sends an individual mouse button event using Direction::Click (press then release). */
mouseClick(button: Button): void
/**
* Send a mouse scroll event
*
* ### Arguments
* - `length` - Number of 15° (click) rotations of the mouse wheel to scroll. How many lines will be scrolled depends on the current setting of the operating system.
* - `axis` - The axis to scroll on
*
* With `Axis::Vertical`, a positive length will result in scrolling down and negative ones up.
* With `Axis::Horizontal`, a positive length will result in scrolling to the right and negative ones to the left
*/
scroll(length: number, axis: Axis): void
/**
* Send a mouse scroll event on vertical axis.
* A positive length will result in scrolling down and negative ones up.
*/
scrollVertical(length: number): void
/**
* Send a mouse scroll event on horizontal axis.
* A positive length will result in scrolling to the right and negative ones to the left.
*/
scrollHorizontal(length: number): void
/** Sends an individual key event. */
key(key: string, direction: Direction): void
/** Sends an individual key event with Direction::Press. */
keyDown(key: string): void
/** Sends an individual key event with Direction::Release. */
keyUp(key: string): void
/** Sends an individual key event with Direction::Click (press then release). */
keyPress(key: string): void
/**
* Sends a raw keycode.
* The keycode may or may not be mapped on the current layout.
* You have to make sure of that yourself.
*/
keyRaw(key: number, direction: Direction): void
/** Sends a raw keycode with Direction::Press. */
keyDownRaw(key: number): void
/** Sends a raw keycode with Direction::Release. */
keyUpRaw(key: number): void
/** Sends a raw keycode with Direction::Click (press then release). */
keyPressRaw(key: number): void
/**
* Enter the text Use a fast method to enter the text, if it is available.
* You can use unicode here like: ❤吅. This works regardless of the current keyboard layout.
*
* You cannot use this function for entering shortcuts or something similar.
* For shortcuts, use the key() method instead.
*/
typeText(text: string): void
}
export type JsEnigo = Enigo
export declare const enum Axis {
Horizontal = 'Horizontal',
horizontal = 'horizontal',
Vertical = 'Vertical',
vertical = 'vertical'
}
export declare const enum Button {
Left = 'Left',
left = 'left',
Middle = 'Middle',
middle = 'middle',
Center = 'Center',
center = 'center',
Right = 'Right',
right = 'right',
Back = 'Back',
back = 'back',
Forward = 'Forward',
forward = 'forward'
}
export declare const enum Direction {
Press = 'Press',
press = 'press',
Down = 'Down',
down = 'down',
Release = 'Release',
release = 'release',
Up = 'Up',
up = 'up',
Click = 'Click',
click = 'click'
}