-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
271 lines (269 loc) · 8.09 KB
/
index.d.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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export interface Point {
x: number
y: number
}
export interface Rect {
left: number
top: number
right: number
bottom: number
}
export interface Color {
r: number
g: number
b: number
}
export const MAGENTA: Color
export function readImageData(path: string): Promise<ImageData>
export function saveImageData(path: string, imageData: ImageData): Promise<void>
export function imageSearch(source: ImageData, target: ImageData, variant?: number | undefined | null, transColor?: Color | undefined | null): Promise<Point | null>
export function multipleImageSearch(source: ImageData, target: ImageData, variant?: number | undefined | null, transColor?: Color | undefined | null): Promise<Array<Point>>
export const enum Modifiers {
Alt = 1,
AltGraph = 2,
CapsLock = 4,
Control = 8,
Fn = 16,
FnLock = 32,
Meta = 64,
NumLock = 128,
ScrollLock = 256,
Shift = 512,
Symbol = 1024,
SymbolLock = 2048,
Hyper = 4096,
Super = 8192
}
export const enum Key {
None = 0,
Back = 8,
Tab = 9,
LineFeed = 10,
Clear = 12,
Enter = 13,
Shift = 16,
Control = 17,
Alt = 18,
Pause = 19,
CapsLock = 20,
Esc = 27,
Space = 32,
PageUp = 33,
PageDown = 34,
End = 35,
Home = 36,
ArrowLeft = 37,
ArrowUp = 38,
ArrowRight = 39,
ArrowDown = 40,
Insert = 45,
Delete = 46,
D0 = 48,
D1 = 49,
D2 = 50,
D3 = 51,
D4 = 52,
D5 = 53,
D6 = 54,
D7 = 55,
D8 = 56,
D9 = 57,
A = 65,
B = 66,
C = 67,
D = 68,
E = 69,
F = 70,
G = 71,
H = 72,
I = 73,
J = 74,
K = 75,
L = 76,
M = 77,
N = 78,
O = 79,
P = 80,
Q = 81,
R = 82,
S = 83,
T = 84,
U = 85,
V = 86,
W = 87,
X = 88,
Y = 89,
Z = 90,
LeftWin = 91,
RightWin = 92,
Apps = 93,
Sleep = 95,
NumPad0 = 96,
NumPad1 = 97,
NumPad2 = 98,
NumPad3 = 99,
NumPad4 = 100,
NumPad5 = 101,
NumPad6 = 102,
NumPad7 = 103,
NumPad8 = 104,
NumPad9 = 105,
Multiply = 106,
Add = 107,
Separator = 108,
Subtract = 109,
Decimal = 110,
Divide = 111,
F1 = 112,
F2 = 113,
F3 = 114,
F4 = 115,
F5 = 116,
F6 = 117,
F7 = 118,
F8 = 119,
F9 = 120,
F10 = 121,
F11 = 122,
F12 = 123,
F13 = 124,
F14 = 125,
F15 = 126,
F16 = 127,
F17 = 128,
F18 = 129,
F19 = 130,
F20 = 131,
F21 = 132,
F22 = 133,
F23 = 134,
F24 = 135,
NumLock = 144,
ScrollLock = 145,
LeftShift = 160,
RightShift = 161,
LeftControl = 162,
RightControl = 163,
LeftAlt = 164,
RightAlt = 165
}
export const enum MouseButton {
Left = 0,
Right = 1,
Middle = 2
}
export function getScreenSize(): Promise<Point>
export function takeScreenshot(x: number, y: number, width: number, height: number): Promise<ImageData>
export interface Process {
pid: number
name: string
}
export const enum ProcessAccess {
AllAccess = 0,
CreateProcess = 1,
CreateThread = 2,
Delete = 3,
DupHandle = 4,
QueryInformation = 5,
QueryLimitedInformation = 6,
ReadControl = 7,
SetInformation = 8,
SetLimitedInformation = 9,
SetQuota = 10,
SetSessionId = 11,
Synchronize = 12,
Terminate = 13,
VmOperation = 14,
VmRead = 15,
VmWrite = 16,
WriteDac = 17,
WriteOwner = 18
}
export function openProcess(access: ProcessAccess, pid: number): Promise<OpenedProcess>
export function getProcesses(): Promise<Array<Process>>
export class ImageData {
data: Array<number>
width: number
height: number
pixelWidth: number
}
export class Keyboard {
static press(key: Key): Promise<void>
static release(key: Key): Promise<void>
static click(key: Key): Promise<void>
static typing(text: string): Promise<void>
static registerHotkey(mods: Array<Modifiers>, key: Key, callback: (...args: any[]) => any): number
static unregisterHotkey(id: number): void
}
export class Mouse {
static move(x: number, y: number): Promise<void>
static press(button: MouseButton): Promise<void>
static release(button: MouseButton): Promise<void>
static click(button: MouseButton, x: number, y: number): Promise<void>
static getPosition(): Promise<Point>
}
export class Window {
minimize(): Promise<void>
maximize(): Promise<void>
getTitle(): Promise<string>
getWindowRect(): Promise<Rect>
setPosition(x: number, y: number): Promise<void>
setSize(width: number, height: number): Promise<void>
foreground(): Promise<boolean>
static getForegroundWindow(): Promise<Window | null>
static findWindowByTitle(title: string): Promise<Window | null>
static findWindowByClassName(classname: string): Promise<Window | null>
}
export class OpenedProcess {
readMemoryBool(address: bigint): Promise<boolean>
readMemoryChainBool(baseAddress: bigint, offsets: Array<bigint>): Promise<boolean>
readMemoryUint8(address: bigint): Promise<bigint>
readMemoryChainUint8(baseAddress: bigint, offsets: Array<bigint>): Promise<bigint>
readMemoryInt8(address: bigint): Promise<bigint>
readMemoryChainInt8(baseAddress: bigint, offsets: Array<bigint>): Promise<bigint>
readMemoryUint16(address: bigint): Promise<bigint>
readMemoryChainUint16(baseAddress: bigint, offsets: Array<bigint>): Promise<bigint>
readMemoryInt16(address: bigint): Promise<bigint>
readMemoryChainInt16(baseAddress: bigint, offsets: Array<bigint>): Promise<bigint>
readMemoryUint32(address: bigint): Promise<bigint>
readMemoryChainUint32(baseAddress: bigint, offsets: Array<bigint>): Promise<bigint>
readMemoryInt32(address: bigint): Promise<bigint>
readMemoryChainInt32(baseAddress: bigint, offsets: Array<bigint>): Promise<bigint>
readMemoryUint64(address: bigint): Promise<bigint>
readMemoryChainUint64(baseAddress: bigint, offsets: Array<bigint>): Promise<bigint>
readMemoryInt64(address: bigint): Promise<bigint>
readMemoryChainInt64(baseAddress: bigint, offsets: Array<bigint>): Promise<bigint>
readMemoryUsize(address: bigint): Promise<bigint>
readMemoryChainUsize(baseAddress: bigint, offsets: Array<bigint>): Promise<bigint>
readMemoryFloat32(address: bigint): Promise<number>
readMemoryChainFloat32(baseAddress: bigint, offsets: Array<bigint>): Promise<number>
readMemoryFloat64(address: bigint): Promise<number>
readMemoryChainFloat64(baseAddress: bigint, offsets: Array<bigint>): Promise<number>
writeMemoryBool(address: bigint, value: boolean): Promise<void>
writeMemoryChainBool(baseAddress: bigint, offsets: Array<bigint>, value: boolean): Promise<void>
writeMemoryUint8(address: bigint, value: bigint): Promise<void>
writeMemoryChainUint8(baseAddress: bigint, offsets: Array<bigint>, value: bigint): Promise<void>
writeMemoryInt8(address: bigint, value: bigint): Promise<void>
writeMemoryChainInt8(baseAddress: bigint, offsets: Array<bigint>, value: bigint): Promise<void>
writeMemoryUint16(address: bigint, value: bigint): Promise<void>
writeMemoryChainUint16(baseAddress: bigint, offsets: Array<bigint>, value: bigint): Promise<void>
writeMemoryInt16(address: bigint, value: bigint): Promise<void>
writeMemoryChainInt16(baseAddress: bigint, offsets: Array<bigint>, value: bigint): Promise<void>
writeMemoryUint32(address: bigint, value: bigint): Promise<void>
writeMemoryChainUint32(baseAddress: bigint, offsets: Array<bigint>, value: bigint): Promise<void>
writeMemoryInt32(address: bigint, value: bigint): Promise<void>
writeMemoryChainInt32(baseAddress: bigint, offsets: Array<bigint>, value: bigint): Promise<void>
writeMemoryUint64(address: bigint, value: bigint): Promise<void>
writeMemoryChainUint64(baseAddress: bigint, offsets: Array<bigint>, value: bigint): Promise<void>
writeMemoryInt64(address: bigint, value: bigint): Promise<void>
writeMemoryChainInt64(baseAddress: bigint, offsets: Array<bigint>, value: bigint): Promise<void>
writeMemoryUsize(address: bigint, value: bigint): Promise<void>
writeMemoryChainUsize(baseAddress: bigint, offsets: Array<bigint>, value: bigint): Promise<void>
writeMemoryFloat32(address: bigint, value: number): Promise<void>
writeMemoryChainFloat32(baseAddress: bigint, offsets: Array<bigint>, value: number): Promise<void>
writeMemoryFloat64(address: bigint, value: number): Promise<void>
writeMemoryChainFloat64(baseAddress: bigint, offsets: Array<bigint>, value: number): Promise<void>
}