@aspiresys/visor 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -5,327 +5,327 @@ export declare class Visor {
5
5
  Key: typeof Key;
6
6
  Button: typeof Button;
7
7
  /**
8
- * Finds an image on screen using OpenCV
9
- * and performs a left mouse click
10
- * on the matched region.
11
- *
12
- * @param image Optional image filename or path.
13
- *
14
- * @param confidence Match confidence threshold.
15
- *
16
- * Accepted range:
17
- * 0.0 to 1.0
18
- *
19
- * Default:
20
- * 0.8
21
- *
22
- * Recommended values:
23
- * - 0.7 for dynamic UI
24
- * - 0.8 for standard usage
25
- * - 0.9+ for strict matching
26
- *
27
- * Lower confidence increases
28
- * flexibility but may increase
29
- * false positives.
30
- *
31
- * @example
32
- * await visor.click("save.png");
33
- *
34
- * @example
35
- * await visor.click("./images/save.png", 0.9);
36
- */
8
+ * Finds an image on screen using OpenCV
9
+ * and performs a left mouse click
10
+ * on the matched region.
11
+ *
12
+ * @param image Optional image filename or path.
13
+ *
14
+ * @param confidence Match confidence threshold.
15
+ *
16
+ * Accepted range:
17
+ * 0.0 to 1.0
18
+ *
19
+ * Default:
20
+ * 0.8
21
+ *
22
+ * Recommended values:
23
+ * - 0.7 for dynamic UI
24
+ * - 0.8 for standard usage
25
+ * - 0.9+ for strict matching
26
+ *
27
+ * Lower confidence increases
28
+ * flexibility but may increase
29
+ * false positives.
30
+ *
31
+ * @example
32
+ * await visor.click("save.png");
33
+ *
34
+ * @example
35
+ * await visor.click("./images/save.png", 0.9);
36
+ */
37
37
  click(image?: string, confidence?: number): Promise<void>;
38
38
  /**
39
- * Performs a right mouse click.
40
- *
41
- * If an image is provided, the framework
42
- * first finds the image on screen and
43
- * moves the mouse to the matched region
44
- * before performing the click.
45
- *
46
- * @param image Image filename or path.
47
- * @param confidence Match confidence threshold.
48
- *
49
- * Accepted range:
50
- * 0.0 to 1.0
51
- *
52
- * Default:
53
- * 0.8
54
- * @throws Error if image is not found.
55
- *
56
- * @example
57
- * await visor.rightClick("file.png");
58
- *
59
- * @example
60
- * await visor.rightClick();
61
- */
39
+ * Performs a right mouse click.
40
+ *
41
+ * If an image is provided, the framework
42
+ * first finds the image on screen and
43
+ * moves the mouse to the matched region
44
+ * before performing the click.
45
+ *
46
+ * @param image Image filename or path.
47
+ * @param confidence Match confidence threshold.
48
+ *
49
+ * Accepted range:
50
+ * 0.0 to 1.0
51
+ *
52
+ * Default:
53
+ * 0.8
54
+ * @throws Error if image is not found.
55
+ *
56
+ * @example
57
+ * await visor.rightClick("file.png");
58
+ *
59
+ * @example
60
+ * await visor.rightClick();
61
+ */
62
62
  rightClick(image?: string, confidence?: number): Promise<void>;
63
63
  /**
64
- * Performs a double left mouse click.
65
- *
66
- * If an image is provided, the framework
67
- * first finds the image on screen and
68
- * moves the mouse to the matched region
69
- * before performing the click.
70
- *
71
- * @param image Image filename or path.
72
- * @param confidence Match confidence threshold.
73
- *
74
- * Accepted range:
75
- * 0.0 to 1.0
76
- *
77
- * Default:
78
- * 0.8
79
- *
80
- * @throws Error if image is not found.
81
- *
82
- * @example
83
- * await visor.doubleClick("folder.png");
84
- *
85
- * @example
86
- * await visor.doubleClick();
87
- */
64
+ * Performs a double left mouse click.
65
+ *
66
+ * If an image is provided, the framework
67
+ * first finds the image on screen and
68
+ * moves the mouse to the matched region
69
+ * before performing the click.
70
+ *
71
+ * @param image Image filename or path.
72
+ * @param confidence Match confidence threshold.
73
+ *
74
+ * Accepted range:
75
+ * 0.0 to 1.0
76
+ *
77
+ * Default:
78
+ * 0.8
79
+ *
80
+ * @throws Error if image is not found.
81
+ *
82
+ * @example
83
+ * await visor.doubleClick("folder.png");
84
+ *
85
+ * @example
86
+ * await visor.doubleClick();
87
+ */
88
88
  doubleClick(image?: string, confidence?: number): Promise<void>;
89
89
  /**
90
- * Finds the best matching image on screen
91
- * using OpenCV template matching.
92
- *
93
- * @param image Image filename or path.
94
- *
95
- * @param confidence Match confidence threshold.
96
- *
97
- * Accepted range:
98
- * 0.0 to 1.0
99
- *
100
- * Default:
101
- * 0.8
102
- *
103
- * Recommended values:
104
- * - 0.7 for dynamic UI
105
- * - 0.8 for standard usage
106
- * - 0.9+ for strict matching
107
- *
108
- * Higher confidence improves
109
- * matching accuracy but may fail
110
- * on scaled or slightly modified UI.
111
- *
112
- * @returns Best matched region or null.
113
- *
114
- * @example
115
- * const region =
116
- * await visor.find("save.png");
117
- */
90
+ * Finds the best matching image on screen
91
+ * using OpenCV template matching.
92
+ *
93
+ * @param image Image filename or path.
94
+ *
95
+ * @param confidence Match confidence threshold.
96
+ *
97
+ * Accepted range:
98
+ * 0.0 to 1.0
99
+ *
100
+ * Default:
101
+ * 0.8
102
+ *
103
+ * Recommended values:
104
+ * - 0.7 for dynamic UI
105
+ * - 0.8 for standard usage
106
+ * - 0.9+ for strict matching
107
+ *
108
+ * Higher confidence improves
109
+ * matching accuracy but may fail
110
+ * on scaled or slightly modified UI.
111
+ *
112
+ * @returns Best matched region or null.
113
+ *
114
+ * @example
115
+ * const region =
116
+ * await visor.find("save.png");
117
+ */
118
118
  find(image: string, confidence?: number): Promise<import("./types").Region>;
119
119
  /**
120
- * Checks whether an image exists
121
- * on the current screen.
122
- *
123
- * @param image Image filename or path.
124
- * @param confidence Match confidence threshold.
125
- *
126
- * Accepted range:
127
- * 0.0 to 1.0
128
- *
129
- * Default:
130
- * 0.8
131
- *
132
- * @returns True if image exists.
133
- *
134
- * @example
135
- * const exists =
136
- * await visor.exists("login.png");
137
- */
120
+ * Checks whether an image exists
121
+ * on the current screen.
122
+ *
123
+ * @param image Image filename or path.
124
+ * @param confidence Match confidence threshold.
125
+ *
126
+ * Accepted range:
127
+ * 0.0 to 1.0
128
+ *
129
+ * Default:
130
+ * 0.8
131
+ *
132
+ * @returns True if image exists.
133
+ *
134
+ * @example
135
+ * const exists =
136
+ * await visor.exists("login.png");
137
+ */
138
138
  exists(image: string, confidence?: number): Promise<boolean>;
139
139
  /**
140
- * Finds all matching occurrences of an image
141
- * on the current screen using OpenCV.
142
- *
143
- * @param image Image filename or path.
144
- * @param confidence Match confidence threshold.
145
- *
146
- * Accepted range:
147
- * 0.0 to 1.0
148
- *
149
- * Default:
150
- * 0.8
151
- *
152
- * Lower confidence may return
153
- * more false-positive matches.
154
- *
155
- * @returns Array of matched regions.
156
- *
157
- * @example
158
- * const matches =
159
- * await visor.findAll("icon.png");
160
- */
140
+ * Finds all matching occurrences of an image
141
+ * on the current screen using OpenCV.
142
+ *
143
+ * @param image Image filename or path.
144
+ * @param confidence Match confidence threshold.
145
+ *
146
+ * Accepted range:
147
+ * 0.0 to 1.0
148
+ *
149
+ * Default:
150
+ * 0.8
151
+ *
152
+ * Lower confidence may return
153
+ * more false-positive matches.
154
+ *
155
+ * @returns Array of matched regions.
156
+ *
157
+ * @example
158
+ * const matches =
159
+ * await visor.findAll("icon.png");
160
+ */
161
161
  findAll(image: string, confidence?: number): Promise<import("./types").Region[]>;
162
162
  /**
163
- * Finds all image matches and prints
164
- * a formatted match preview including
165
- * coordinates and confidence values.
166
- *
167
- * Useful for debugging and visual
168
- * automation tuning.
169
- *
170
- * @param image Image filename or path.
171
- * @param confidence Match confidence threshold.
172
- *
173
- * Accepted range:
174
- * 0.0 to 1.0
175
- *
176
- * Default:
177
- * 0.8
178
- *
179
- * @returns Array of matched regions.
180
- *
181
- * @example
182
- * await visor.previewMatches("button.png");
183
- */
163
+ * Finds all image matches and prints
164
+ * a formatted match preview including
165
+ * coordinates and confidence values.
166
+ *
167
+ * Useful for debugging and visual
168
+ * automation tuning.
169
+ *
170
+ * @param image Image filename or path.
171
+ * @param confidence Match confidence threshold.
172
+ *
173
+ * Accepted range:
174
+ * 0.0 to 1.0
175
+ *
176
+ * Default:
177
+ * 0.8
178
+ *
179
+ * @returns Array of matched regions.
180
+ *
181
+ * @example
182
+ * await visor.previewMatches("button.png");
183
+ */
184
184
  previewMatches(image: string, confidence?: number): Promise<import("./types").Region[]>;
185
185
  /**
186
- * Waits until an image appears
187
- * on the screen.
188
- *
189
- * @param image Image filename or path.
190
- *
191
- * @param confidence Match confidence threshold.
192
- *
193
- * Accepted range:
194
- * 0.0 to 1.0
195
- *
196
- * Default:
197
- * 0.8
198
- *
199
- * Recommended values:
200
- * - 0.7 for dynamic UI
201
- * - 0.8 for standard usage
202
- * - 0.9+ for strict matching
203
- *
204
- * @param timeout Timeout duration
205
- * in milliseconds.
206
- *
207
- * Default:
208
- * 5000ms
209
- *
210
- * Recommended range:
211
- * 1000ms to 30000ms
212
- *
213
- * @throws Error if timeout occurs.
214
- *
215
- * @example
216
- * await visor.wait("loading-done.png");
217
- */
186
+ * Waits until an image appears
187
+ * on the screen.
188
+ *
189
+ * @param image Image filename or path.
190
+ *
191
+ * @param confidence Match confidence threshold.
192
+ *
193
+ * Accepted range:
194
+ * 0.0 to 1.0
195
+ *
196
+ * Default:
197
+ * 0.8
198
+ *
199
+ * Recommended values:
200
+ * - 0.7 for dynamic UI
201
+ * - 0.8 for standard usage
202
+ * - 0.9+ for strict matching
203
+ *
204
+ * @param timeout Timeout duration
205
+ * in milliseconds.
206
+ *
207
+ * Default:
208
+ * 5000ms
209
+ *
210
+ * Recommended range:
211
+ * 1000ms to 30000ms
212
+ *
213
+ * @throws Error if timeout occurs.
214
+ *
215
+ * @example
216
+ * await visor.wait("loading-done.png");
217
+ */
218
218
  wait(image: string, { confidence, timeout }?: {
219
219
  confidence?: number;
220
220
  timeout?: number;
221
221
  }): Promise<boolean>;
222
222
  /**
223
- * Waits until an image disappears
224
- * from the screen.
225
- *
226
- * @param image Image filename or path.
227
- * @param confidence Match confidence threshold.
228
- *
229
- * Accepted range:
230
- * 0.0 to 1.0
231
- *
232
- * Default:
233
- * 0.8
234
- * @param timeout Timeout duration
235
- * in milliseconds.
236
- *
237
- * Default:
238
- * 5000ms
239
- *
240
- * Recommended range:
241
- * 1000ms to 30000ms
242
- * @throws Error if timeout occurs.
243
- *
244
- * @example
245
- * await visor.waitToVanish("spinner.png");
246
- */
223
+ * Waits until an image disappears
224
+ * from the screen.
225
+ *
226
+ * @param image Image filename or path.
227
+ * @param confidence Match confidence threshold.
228
+ *
229
+ * Accepted range:
230
+ * 0.0 to 1.0
231
+ *
232
+ * Default:
233
+ * 0.8
234
+ * @param timeout Timeout duration
235
+ * in milliseconds.
236
+ *
237
+ * Default:
238
+ * 5000ms
239
+ *
240
+ * Recommended range:
241
+ * 1000ms to 30000ms
242
+ * @throws Error if timeout occurs.
243
+ *
244
+ * @example
245
+ * await visor.waitToVanish("spinner.png");
246
+ */
247
247
  waitToVanish(image: string, { confidence, timeout }?: {
248
248
  confidence?: number;
249
249
  timeout?: number;
250
250
  }): Promise<boolean>;
251
251
  /**
252
- * Waits until specific text appears
253
- * on screen using OCR.
254
- *
255
- * Performance Note:
256
- * OCR operations are computationally
257
- * expensive and may take 1–5 seconds
258
- * depending on screen complexity.
259
- *
260
- * @param text Text to search for.
261
- *
262
- * @param timeout Timeout duration
263
- * in milliseconds.
264
- *
265
- * Default:
266
- * 5000ms
267
- *
268
- * Recommended range:
269
- * 1000ms to 30000ms
270
- *
271
- * @throws Error if timeout occurs.
272
- *
273
- * @example
274
- * await visor.waitText("Success");
275
- */
252
+ * Waits until specific text appears
253
+ * on screen using OCR.
254
+ *
255
+ * Performance Note:
256
+ * OCR operations are computationally
257
+ * expensive and may take 1–5 seconds
258
+ * depending on screen complexity.
259
+ *
260
+ * @param text Text to search for.
261
+ *
262
+ * @param timeout Timeout duration
263
+ * in milliseconds.
264
+ *
265
+ * Default:
266
+ * 5000ms
267
+ *
268
+ * Recommended range:
269
+ * 1000ms to 30000ms
270
+ *
271
+ * @throws Error if timeout occurs.
272
+ *
273
+ * @example
274
+ * await visor.waitText("Success");
275
+ */
276
276
  waitText(text: string, timeout?: number): Promise<boolean>;
277
277
  /**
278
- * Waits until specific text disappears
279
- * from screen using OCR.
280
- * Performance Note:
281
- * OCR operations are computationally
282
- * expensive and may take 1–5 seconds
283
- * depending on screen complexity.
284
- *
285
- * @param text Text to search for.
286
- * @param timeout Timeout duration
287
- * in milliseconds.
288
- *
289
- * Default:
290
- * 5000ms
291
- *
292
- * Recommended range:
293
- * 1000ms to 30000ms
294
- *
295
- * @throws Error if timeout occurs.
296
- *
297
- * @example
298
- * await visor.waitTextToVanish("Loading");
299
- */
278
+ * Waits until specific text disappears
279
+ * from screen using OCR.
280
+ * Performance Note:
281
+ * OCR operations are computationally
282
+ * expensive and may take 1–5 seconds
283
+ * depending on screen complexity.
284
+ *
285
+ * @param text Text to search for.
286
+ * @param timeout Timeout duration
287
+ * in milliseconds.
288
+ *
289
+ * Default:
290
+ * 5000ms
291
+ *
292
+ * Recommended range:
293
+ * 1000ms to 30000ms
294
+ *
295
+ * @throws Error if timeout occurs.
296
+ *
297
+ * @example
298
+ * await visor.waitTextToVanish("Loading");
299
+ */
300
300
  waitTextToVanish(text: string, timeout?: number): Promise<boolean>;
301
301
  /**
302
- * Finds text on screen using OCR
303
- * and performs a left mouse click
304
- * on the matched text region.
305
- *
306
- * @param text Text to search for.
307
- * @param index Index of the text to click.
308
- *
309
- * @throws Error if text is not found.
310
- *
311
- * @example
312
- * await visor.clickText("Login");
313
- */
302
+ * Finds text on screen using OCR
303
+ * and performs a left mouse click
304
+ * on the matched text region.
305
+ *
306
+ * @param text Text to search for.
307
+ * @param index Index of the text to click.
308
+ *
309
+ * @throws Error if text is not found.
310
+ *
311
+ * @example
312
+ * await visor.clickText("Login");
313
+ */
314
314
  clickText(text: string, index?: number): Promise<void>;
315
315
  /**
316
- * Finds text on screen or inside
317
- * a specific region using OCR.
318
- *
319
- * @param text Text to search for.
320
- * @param index Index of the text to search.
321
- * @param region Optional search region.
322
- *
323
- * @returns Matched text region or null.
324
- *
325
- * @example
326
- * const region =
327
- * await visor.findText("Submit");
328
- */
316
+ * Finds text on screen or inside
317
+ * a specific region using OCR.
318
+ *
319
+ * @param text Text to search for.
320
+ * @param index Index of the text to search.
321
+ * @param region Optional search region.
322
+ *
323
+ * @returns Matched text region or null.
324
+ *
325
+ * @example
326
+ * const region =
327
+ * await visor.findText("Submit");
328
+ */
329
329
  findText(text: string, index?: number, region?: {
330
330
  x: number;
331
331
  y: number;
@@ -333,18 +333,18 @@ export declare class Visor {
333
333
  height: number;
334
334
  }): Promise<import("./types").Region>;
335
335
  /**
336
- * Checks whether specific text exists
337
- * on screen using OCR.
338
- *
339
- * @param text Text to search for.
340
- * @param region Optional search region.
341
- *
342
- * @returns True if text exists.
343
- *
344
- * @example
345
- * const exists =
346
- * await visor.existsText("Teams");
347
- */
336
+ * Checks whether specific text exists
337
+ * on screen using OCR.
338
+ *
339
+ * @param text Text to search for.
340
+ * @param region Optional search region.
341
+ *
342
+ * @returns True if text exists.
343
+ *
344
+ * @example
345
+ * const exists =
346
+ * await visor.existsText("Teams");
347
+ */
348
348
  existsText(text: string, region?: {
349
349
  x: number;
350
350
  y: number;
@@ -352,22 +352,22 @@ export declare class Visor {
352
352
  height: number;
353
353
  }): Promise<boolean>;
354
354
  /**
355
- * Performs OCR on a specific
356
- * screen region.
357
- *
358
- * @param region Screen region coordinates.
359
- *
360
- * @returns OCR result object.
361
- *
362
- * @example
363
- * const result =
364
- * await visor.readRegion({
365
- * x: 100,
366
- * y: 100,
367
- * width: 500,
368
- * height: 300
369
- * });
370
- */
355
+ * Performs OCR on a specific
356
+ * screen region.
357
+ *
358
+ * @param region Screen region coordinates.
359
+ *
360
+ * @returns OCR result object.
361
+ *
362
+ * @example
363
+ * const result =
364
+ * await visor.readRegion({
365
+ * x: 100,
366
+ * y: 100,
367
+ * width: 500,
368
+ * height: 300
369
+ * });
370
+ */
371
371
  readRegion(region: {
372
372
  x: number;
373
373
  y: number;
@@ -375,362 +375,364 @@ export declare class Visor {
375
375
  height: number;
376
376
  }): Promise<any>;
377
377
  /**
378
- * Performs OCR on the entire screen
379
- * using Tesseract OCR.
380
- *
381
- * Captures the current screen,
382
- * preprocesses the image, and
383
- * extracts readable text content.
384
- *
385
- * Performance Note:
386
- * OCR is computationally expensive
387
- * and may take 1–5 seconds depending
388
- * on:
389
- * - screen complexity
390
- * - text density
391
- * - display resolution
392
- * - system performance
393
- *
394
- * Returns:
395
- * - extracted text
396
- * - OCR metadata
397
- * - TSV layout information
398
- * - HOCR data
399
- *
400
- * @returns OCR result object.
401
- *
402
- * @example
403
- * const result =
404
- * await visor.readScreen();
405
- *
406
- * console.log(result.text);
407
- */
378
+ * Performs OCR on the entire screen
379
+ * using Tesseract OCR.
380
+ *
381
+ * Captures the current screen,
382
+ * preprocesses the image, and
383
+ * extracts readable text content.
384
+ *
385
+ * Performance Note:
386
+ * OCR is computationally expensive
387
+ * and may take 1–5 seconds depending
388
+ * on:
389
+ * - screen complexity
390
+ * - text density
391
+ * - display resolution
392
+ * - system performance
393
+ *
394
+ * Returns:
395
+ * - extracted text
396
+ * - OCR metadata
397
+ * - TSV layout information
398
+ * - HOCR data
399
+ *
400
+ * @returns OCR result object.
401
+ *
402
+ * @example
403
+ * const result =
404
+ * await visor.readScreen();
405
+ *
406
+ * log(result.text);
407
+ */
408
408
  readScreen(): Promise<any>;
409
409
  /**
410
- * Captures a screenshot of the
411
- * current screen and saves it
412
- * to the specified path.
413
- *
414
- * Supported formats depend on
415
- * the output file extension.
416
- *
417
- * @param path Output image path.
418
- *
419
- * @example
420
- * await visor.captureScreenshot(
421
- * "./screenshots/home.png"
422
- * );
423
- */
410
+ * Captures a screenshot of the
411
+ * current screen and saves it
412
+ * to the specified path.
413
+ *
414
+ * Supported formats depend on
415
+ * the output file extension.
416
+ *
417
+ * @param path Output image path.
418
+ *
419
+ * @example
420
+ * await visor.captureScreenshot(
421
+ * "./screenshots/home.png"
422
+ * );
423
+ */
424
424
  captureScreenshot(path: string): Promise<void>;
425
425
  /**
426
- * Opens a desktop application,
427
- * executable, file, folder,
428
- * or URL using Windows shell.
429
- *
430
- * Performance Note:
431
- * Some Electron-based applications
432
- * may require additional startup
433
- * stabilization time.
434
- *
435
- * @param command App name, executable,
436
- * file path, or URL.
437
- *
438
- * @example
439
- * await visor.openApp("notepad");
440
- *
441
- * @example
442
- * await visor.openApp("chrome.exe");
443
- */
426
+ * Opens a desktop application,
427
+ * executable, file, folder,
428
+ * or URL using Windows shell.
429
+ *
430
+ * Performance Note:
431
+ * Some Electron-based applications
432
+ * may require additional startup
433
+ * stabilization time.
434
+ *
435
+ * @param command App name, executable,
436
+ * file path, or URL.
437
+ *
438
+ * @example
439
+ * await visor.openApp("notepad");
440
+ *
441
+ * @example
442
+ * await visor.openApp("chrome.exe");
443
+ */
444
444
  openApp(command: string): Promise<void>;
445
445
  /**
446
- * Drags one visual element and
447
- * drops it onto another using
448
- * image matching.
449
- *
450
- * @param source Source image.
451
- *
452
- * @param target Target image.
453
- *
454
- * @param confidence Match confidence threshold.
455
- *
456
- * Accepted range:
457
- * 0.0 to 1.0
458
- *
459
- * Default:
460
- * 0.8
461
- *
462
- * Recommended values:
463
- * - 0.7 for dynamic UI
464
- * - 0.8 for standard usage
465
- * - 0.9+ for strict matching
466
- *
467
- * @throws Error if source or target
468
- * image is not found.
469
- *
470
- * @example
471
- * await visor.dragDrop(
472
- * "file.png",
473
- * "folder.png"
474
- * );
475
- */
446
+ * Drags one visual element and
447
+ * drops it onto another using
448
+ * image matching.
449
+ *
450
+ * @param source Source image.
451
+ *
452
+ * @param target Target image.
453
+ *
454
+ * @param confidence Match confidence threshold.
455
+ *
456
+ * Accepted range:
457
+ * 0.0 to 1.0
458
+ *
459
+ * Default:
460
+ * 0.8
461
+ *
462
+ * Recommended values:
463
+ * - 0.7 for dynamic UI
464
+ * - 0.8 for standard usage
465
+ * - 0.9+ for strict matching
466
+ *
467
+ * @throws Error if source or target
468
+ * image is not found.
469
+ *
470
+ * @example
471
+ * await visor.dragDrop(
472
+ * "file.png",
473
+ * "folder.png"
474
+ * );
475
+ */
476
476
  dragDrop(source: string, target: string, confidence?: number): Promise<void>;
477
477
  /**
478
- * Moves the mouse cursor to the
479
- * matched image location without
480
- * performing a click.
481
- *
482
- * @param image Image filename or path.
483
- * @param confidence Match confidence threshold.
484
- *
485
- * Accepted range:
486
- * 0.0 to 1.0
487
- *
488
- * Default:
489
- * 0.8
490
- *
491
- * @throws Error if image is not found.
492
- *
493
- * @example
494
- * await visor.hover("menu.png");
495
- */
478
+ * Moves the mouse cursor to the
479
+ * matched image location without
480
+ * performing a click.
481
+ *
482
+ * @param image Image filename or path.
483
+ * @param confidence Match confidence threshold.
484
+ *
485
+ * Accepted range:
486
+ * 0.0 to 1.0
487
+ *
488
+ * Default:
489
+ * 0.8
490
+ *
491
+ * @throws Error if image is not found.
492
+ *
493
+ * @example
494
+ * await visor.hover("menu.png");
495
+ */
496
496
  hover(image: string, confidence?: number): Promise<void>;
497
497
  /**
498
- * Scrolls the mouse wheel downward.
499
- *
500
- * @param amount Scroll amount.
501
- *
502
- * Default:
503
- * 500
504
- *
505
- * Recommended range:
506
- * 100 to 3000
507
- *
508
- * @example
509
- * await visor.scrollDown(1000);
510
- */
498
+ * Scrolls the mouse wheel downward.
499
+ *
500
+ * @param amount Scroll amount.
501
+ *
502
+ * Default:
503
+ * 500
504
+ *
505
+ * Recommended range:
506
+ * 100 to 3000
507
+ *
508
+ * @example
509
+ * await visor.scrollDown(1000);
510
+ */
511
511
  scrollDown(amount?: number): Promise<void>;
512
512
  /**
513
- * Scrolls the mouse wheel upward.
514
- *
515
- * @param amount Scroll amount.
516
- *
517
- * Default:
518
- * 500
519
- *
520
- * Recommended range:
521
- * 100 to 3000
522
- *
523
- * @example
524
- * await visor.scrollUp(1000);
525
- */
513
+ * Scrolls the mouse wheel upward.
514
+ *
515
+ * @param amount Scroll amount.
516
+ *
517
+ * Default:
518
+ * 500
519
+ *
520
+ * Recommended range:
521
+ * 100 to 3000
522
+ *
523
+ * @example
524
+ * await visor.scrollUp(1000);
525
+ */
526
526
  scrollUp(amount?: number): Promise<void>;
527
527
  /**
528
- * Types text using keyboard automation.
529
- *
530
- * @param text Text to type.
531
- *
532
- * @example
533
- * await visor.type("Hello World");
534
- */
528
+ * Types text using keyboard automation.
529
+ *
530
+ * @param text Text to type.
531
+ *
532
+ * @example
533
+ * await visor.type("Hello World");
534
+ */
535
535
  type(text: string): Promise<void>;
536
536
  /**
537
- * Presses one or more keyboard keys.
538
- *
539
- * Supports both single key presses
540
- * and hotkey combinations.
541
- *
542
- * @param keys Keyboard keys to press.
543
- *
544
- * @example
545
- * await visor.press(visor.Key.Enter);
546
- *
547
- * @example
548
- * await visor.press(
549
- * visor.Key.LeftControl,
550
- * visor.Key.S
551
- * );
552
- */
537
+ * Presses one or more keyboard keys.
538
+ *
539
+ * Supports both single key presses
540
+ * and hotkey combinations.
541
+ *
542
+ * @param keys Keyboard keys to press.
543
+ *
544
+ * @example
545
+ * await visor.press(visor.Key.Enter);
546
+ *
547
+ * @example
548
+ * await visor.press(
549
+ * visor.Key.LeftControl,
550
+ * visor.Key.S
551
+ * );
552
+ */
553
553
  press(...keys: any[]): Promise<void>;
554
554
  /**
555
- * Pauses execution for a specified
556
- * duration.
557
- *
558
- * Useful for:
559
- * - UI stabilization
560
- * - animation completion
561
- * - Electron rendering delays
562
- * - OCR synchronization
563
- * - desktop transition handling
564
- *
565
- * Recommended for short stabilization
566
- * waits rather than long fixed delays.
567
- *
568
- * @param ms Delay duration
569
- * in milliseconds.
570
- *
571
- * Recommended range:
572
- * 200ms to 5000ms
573
- *
574
- * Excessive sleep usage may
575
- * slow automation execution.
576
- *
577
- * @example
578
- * await visor.sleep(2000);
579
- */
555
+ * Pauses execution for a specified
556
+ * duration.
557
+ *
558
+ * Useful for:
559
+ * - UI stabilization
560
+ * - animation completion
561
+ * - Electron rendering delays
562
+ * - OCR synchronization
563
+ * - desktop transition handling
564
+ *
565
+ * Recommended for short stabilization
566
+ * waits rather than long fixed delays.
567
+ *
568
+ * @param ms Delay duration
569
+ * in milliseconds.
570
+ *
571
+ * Recommended range:
572
+ * 200ms to 5000ms
573
+ *
574
+ * Excessive sleep usage may
575
+ * slow automation execution.
576
+ *
577
+ * @example
578
+ * await visor.sleep(2000);
579
+ */
580
580
  sleep(ms: number): Promise<unknown>;
581
581
  /**
582
- * Moves the mouse cursor to the
583
- * specified screen coordinates.
584
- *
585
- * Coordinates should match the
586
- * current display scaling setup.
587
- *
588
- * @param x X coordinate.
589
- * @param y Y coordinate.
590
- *
591
- * @example
592
- * await visor.moveMouse(500, 300);
593
- */
582
+ * Moves the mouse cursor to the
583
+ * specified screen coordinates.
584
+ *
585
+ * Coordinates should match the
586
+ * current display scaling setup.
587
+ *
588
+ * @param x X coordinate.
589
+ * @param y Y coordinate.
590
+ *
591
+ * @example
592
+ * await visor.moveMouse(500, 300);
593
+ */
594
594
  moveMouse(x: number, y: number): Promise<void>;
595
595
  /**
596
- * Returns the current mouse cursor
597
- * position.
598
- *
599
- * @returns Current mouse coordinates.
600
- *
601
- * @example
602
- * const pos =
603
- * await visor.getMousePosition();
604
- */
596
+ * Returns the current mouse cursor
597
+ * position.
598
+ *
599
+ * @returns Current mouse coordinates.
600
+ *
601
+ * @example
602
+ * const pos =
603
+ * await visor.getMousePosition();
604
+ */
605
605
  getMousePosition(): Promise<Point>;
606
606
  /**
607
- * Sets the display scaling factor
608
- * used for coordinate normalization
609
- * and image matching.
610
- *
611
- * Required for:
612
- * - high-DPI displays
613
- * - Windows display scaling
614
- * - accurate mouse positioning
615
- * - reliable template matching
616
- *
617
- * Common values:
618
- * - 1.0 = 100% scaling
619
- * - 1.25 = 125% scaling
620
- * - 1.5 = 150% scaling
621
- * - 2.0 = 200% scaling
622
- *
623
- * Incorrect scaling values may cause:
624
- * - inaccurate clicks
625
- * - failed image matching
626
- * - incorrect OCR regions
627
- * - offset mouse movement
628
- *
629
- * @param scale Display scaling factor.
630
- *
631
- * Recommended range:
632
- * 1.0 to 2.0
633
- *
634
- * @example
635
- * visor.setScaleFactor(1.5);
636
- */
607
+ * Sets the display scaling factor
608
+ * used for coordinate normalization
609
+ * and image matching.
610
+ *
611
+ * Required for:
612
+ * - high-DPI displays
613
+ * - Windows display scaling
614
+ * - accurate mouse positioning
615
+ * - reliable template matching
616
+ *
617
+ * Common values:
618
+ * - 1.0 = 100% scaling
619
+ * - 1.25 = 125% scaling
620
+ * - 1.5 = 150% scaling
621
+ * - 2.0 = 200% scaling
622
+ *
623
+ * Incorrect scaling values may cause:
624
+ * - inaccurate clicks
625
+ * - failed image matching
626
+ * - incorrect OCR regions
627
+ * - offset mouse movement
628
+ *
629
+ * @param scale Display scaling factor.
630
+ *
631
+ * Recommended range:
632
+ * 1.0 to 2.0
633
+ *
634
+ * @example
635
+ * visor.setScaleFactor(1.5);
636
+ */
637
637
  setScaleFactor(scale: number): void;
638
638
  /**
639
- * Returns the current display
640
- * scaling factor.
641
- *
642
- * @returns Current scale factor.
643
- *
644
- * @example
645
- * const scale =
646
- * visor.getScaleFactor();
647
- */
639
+ * Returns the current display
640
+ * scaling factor.
641
+ *
642
+ * @returns Current scale factor.
643
+ *
644
+ * @example
645
+ * const scale =
646
+ * visor.getScaleFactor();
647
+ */
648
648
  getScaleFactor(): number;
649
649
  /**
650
- * Enables or disables debug logging.
651
- *
652
- * @param mode Debug mode state.
653
- *
654
- * @example
655
- * visor.setDebug(true);
656
- */
650
+ * Enables or disables debug logging.
651
+ *
652
+ * @param mode Debug mode state.
653
+ *
654
+ * @example
655
+ * visor.setDebug(true);
656
+ */
657
657
  setDebug(mode: boolean): void;
658
658
  /**
659
- * Sets the default image search path
660
- * used for visual automation APIs.
661
- *
662
- * @param path Image directory path.
663
- *
664
- * @example
665
- * visor.setImagePath("./images");
666
- */
659
+ * Sets the default image search path
660
+ * used for visual automation APIs.
661
+ *
662
+ * @param path Image directory path.
663
+ *
664
+ * @example
665
+ * visor.setImagePath("./images");
666
+ */
667
667
  setImagePath(path: string): void;
668
668
  /**
669
- * Returns the current default
670
- * image search path.
671
- *
672
- * @returns Image path.
673
- *
674
- * @example
675
- * const path =
676
- * visor.getImagePath();
677
- */
669
+ * Returns the current default
670
+ * image search path.
671
+ *
672
+ * @returns Image path.
673
+ *
674
+ * @example
675
+ * const path =
676
+ * visor.getImagePath();
677
+ */
678
678
  getImagePath(): string;
679
679
  /**
680
- * Sets the default output path
681
- * used for visual automation APIs.
682
- *
683
- * @param path Output directory path.
684
- *
685
- * @example
686
- * visor.setOutputPath("./images");
687
- */
680
+ * Sets the default output path
681
+ * used for visual automation APIs.
682
+ *
683
+ * @param path Output directory path.
684
+ *
685
+ * @example
686
+ * visor.setOutputPath("./images");
687
+ */
688
688
  setOutputPath(path: string): void;
689
689
  /**
690
- * Returns the current default
691
- * Output path.
692
- *
693
- * @returns Output path.
694
- *
695
- * @example
696
- * const path =
697
- * visor.getOutputPath();
698
- */
690
+ * Returns the current default
691
+ * Output path.
692
+ *
693
+ * @returns Output path.
694
+ *
695
+ * @example
696
+ * const path =
697
+ * visor.getOutputPath();
698
+ */
699
699
  getOutputPath(): string;
700
700
  /**
701
- * Closes a desktop application
702
- * using Windows taskkill.
703
- *
704
- * @param processName Process executable name.
705
- *
706
- * @example
707
- * await visor.closeApp("notepad.exe");
708
- *
709
- * @example
710
- * await visor.closeApp("ms-teams.exe");
711
- */
701
+ * Closes a desktop application
702
+ * using Windows taskkill.
703
+ *
704
+ * @param processName Process executable name.
705
+ *
706
+ * @example
707
+ * await visor.closeApp("notepad.exe");
708
+ *
709
+ * @example
710
+ * await visor.closeApp("ms-teams.exe");
711
+ */
712
712
  closeApp(processName: string): Promise<void>;
713
713
  /**
714
- * Loads multiple framework settings
715
- * at once from a configuration object.
716
- *
717
- * Useful for centralized framework
718
- * initialization and project setup.
719
- *
720
- * Supported settings:
721
- * - scaleFactor
722
- * - imagePath
723
- * - debug
724
- *
725
- * @param config Framework configuration object.
726
- *
727
- * @example
728
- * visor.loadConfig({
729
- * scaleFactor: 1.5,
730
- * imagePath: "./images",
731
- * debug: true
732
- * });
733
- */
714
+ * Loads multiple framework settings
715
+ * at once from a configuration object.
716
+ *
717
+ * Useful for centralized framework
718
+ * initialization and project setup.
719
+ *
720
+ * Supported settings:
721
+ * - scaleFactor
722
+ * - imagePath
723
+ * - ssOutputPath
724
+ * - debug
725
+ *
726
+ * @param config Framework configuration object.
727
+ *
728
+ * @example
729
+ * visor.loadConfig({
730
+ * scaleFactor: 1.5,
731
+ * imagePath: "./images",
732
+ * ssOutputPath: "./screenshots",
733
+ * debug: true
734
+ * });
735
+ */
734
736
  loadConfig(config: {
735
737
  scaleFactor?: number;
736
738
  imagePath?: string;
@@ -738,168 +740,168 @@ export declare class Visor {
738
740
  debug?: boolean;
739
741
  }): void;
740
742
  /**
741
- * Finds the first matching image
742
- * from a list of possible images.
743
- *
744
- * Useful for handling:
745
- * - light/dark themes
746
- * - UI variations
747
- * - multiple visual states
748
- *
749
- * @param images Array of image filenames or paths.
750
- * @param confidence Match confidence threshold.
751
- *
752
- * Accepted range:
753
- * 0.0 to 1.0
754
- *
755
- * Default:
756
- * 0.8
757
- *
758
- * @returns Object containing matched image
759
- * and region, or null if none matched.
760
- *
761
- * @example
762
- * const result =
763
- * await visor.findAny([
764
- * "chat-light.png",
765
- * "chat-dark.png"
766
- * ]);
767
- */
743
+ * Finds the first matching image
744
+ * from a list of possible images.
745
+ *
746
+ * Useful for handling:
747
+ * - light/dark themes
748
+ * - UI variations
749
+ * - multiple visual states
750
+ *
751
+ * @param images Array of image filenames or paths.
752
+ * @param confidence Match confidence threshold.
753
+ *
754
+ * Accepted range:
755
+ * 0.0 to 1.0
756
+ *
757
+ * Default:
758
+ * 0.8
759
+ *
760
+ * @returns Object containing matched image
761
+ * and region, or null if none matched.
762
+ *
763
+ * @example
764
+ * const result =
765
+ * await visor.findAny([
766
+ * "chat-light.png",
767
+ * "chat-dark.png"
768
+ * ]);
769
+ */
768
770
  findAny(images: string[], confidence?: number): Promise<{
769
771
  image: string;
770
772
  region: import("./types").Region;
771
773
  }>;
772
774
  /**
773
- * Checks whether any image from
774
- * a list exists on the current screen.
775
- *
776
- * Useful for handling:
777
- * - multiple themes
778
- * - alternate UI layouts
779
- * - dynamic visual states
780
- *
781
- * @param images Array of image filenames or paths.
782
- * @param confidence Match confidence threshold.
783
- *
784
- * Accepted range:
785
- * 0.0 to 1.0
786
- *
787
- * Default:
788
- * 0.8
789
- *
790
- * @returns True if any image exists.
791
- *
792
- * @example
793
- * const exists =
794
- * await visor.existsAny([
795
- * "save-light.png",
796
- * "save-dark.png"
797
- * ]);
798
- */
775
+ * Checks whether any image from
776
+ * a list exists on the current screen.
777
+ *
778
+ * Useful for handling:
779
+ * - multiple themes
780
+ * - alternate UI layouts
781
+ * - dynamic visual states
782
+ *
783
+ * @param images Array of image filenames or paths.
784
+ * @param confidence Match confidence threshold.
785
+ *
786
+ * Accepted range:
787
+ * 0.0 to 1.0
788
+ *
789
+ * Default:
790
+ * 0.8
791
+ *
792
+ * @returns True if any image exists.
793
+ *
794
+ * @example
795
+ * const exists =
796
+ * await visor.existsAny([
797
+ * "save-light.png",
798
+ * "save-dark.png"
799
+ * ]);
800
+ */
799
801
  existsAny(images: string[], confidence?: number): Promise<boolean>;
800
802
  /**
801
- * Finds the first matching image
802
- * from a list and performs a
803
- * left mouse click on it.
804
- *
805
- * Useful for handling:
806
- * - light/dark themes
807
- * - UI variations
808
- * - dynamic buttons/icons
809
- *
810
- * @param images Array of image
811
- * filenames or paths.
812
- *
813
- * @param confidence Match confidence threshold.
814
- *
815
- * Accepted range:
816
- * 0.0 to 1.0
817
- *
818
- * Default:
819
- * 0.8
820
- *
821
- * Recommended values:
822
- * - 0.7 for dynamic UI
823
- * - 0.8 for standard usage
824
- * - 0.9+ for strict matching
825
- *
826
- * Lower confidence increases
827
- * flexibility but may increase
828
- * false positives.
829
- *
830
- * @throws Error if none of the
831
- * images are found.
832
- *
833
- * @example
834
- * await visor.clickAny([
835
- * "send-light.png",
836
- * "send-dark.png"
837
- * ]);
838
- */
803
+ * Finds the first matching image
804
+ * from a list and performs a
805
+ * left mouse click on it.
806
+ *
807
+ * Useful for handling:
808
+ * - light/dark themes
809
+ * - UI variations
810
+ * - dynamic buttons/icons
811
+ *
812
+ * @param images Array of image
813
+ * filenames or paths.
814
+ *
815
+ * @param confidence Match confidence threshold.
816
+ *
817
+ * Accepted range:
818
+ * 0.0 to 1.0
819
+ *
820
+ * Default:
821
+ * 0.8
822
+ *
823
+ * Recommended values:
824
+ * - 0.7 for dynamic UI
825
+ * - 0.8 for standard usage
826
+ * - 0.9+ for strict matching
827
+ *
828
+ * Lower confidence increases
829
+ * flexibility but may increase
830
+ * false positives.
831
+ *
832
+ * @throws Error if none of the
833
+ * images are found.
834
+ *
835
+ * @example
836
+ * await visor.clickAny([
837
+ * "send-light.png",
838
+ * "send-dark.png"
839
+ * ]);
840
+ */
839
841
  clickAny(images: string[], confidence?: number): Promise<void>;
840
842
  /**
841
- * Waits until any image from
842
- * a list appears on screen.
843
- *
844
- * Useful for handling:
845
- * - multiple themes
846
- * - alternate UI layouts
847
- * - dynamic application states
848
- *
849
- * @param images Array of image
850
- * filenames or paths.
851
- *
852
- * @param confidence Match confidence threshold.
853
- *
854
- * Accepted range:
855
- * 0.0 to 1.0
856
- *
857
- * Default:
858
- * 0.8
859
- *
860
- * Recommended values:
861
- * - 0.7 for dynamic UI
862
- * - 0.8 for standard usage
863
- * - 0.9+ for strict matching
864
- *
865
- * Lower confidence increases
866
- * flexibility but may increase
867
- * false positives.
868
- *
869
- * @param timeout Timeout duration
870
- * in milliseconds.
871
- *
872
- * Default:
873
- * 5000ms
874
- *
875
- * Recommended range:
876
- * 1000ms to 30000ms
877
- *
878
- * @throws Error if timeout occurs.
879
- *
880
- * @example
881
- * await visor.waitAny([
882
- * "home-light.png",
883
- * "home-dark.png"
884
- * ]);
885
- */
843
+ * Waits until any image from
844
+ * a list appears on screen.
845
+ *
846
+ * Useful for handling:
847
+ * - multiple themes
848
+ * - alternate UI layouts
849
+ * - dynamic application states
850
+ *
851
+ * @param images Array of image
852
+ * filenames or paths.
853
+ *
854
+ * @param confidence Match confidence threshold.
855
+ *
856
+ * Accepted range:
857
+ * 0.0 to 1.0
858
+ *
859
+ * Default:
860
+ * 0.8
861
+ *
862
+ * Recommended values:
863
+ * - 0.7 for dynamic UI
864
+ * - 0.8 for standard usage
865
+ * - 0.9+ for strict matching
866
+ *
867
+ * Lower confidence increases
868
+ * flexibility but may increase
869
+ * false positives.
870
+ *
871
+ * @param timeout Timeout duration
872
+ * in milliseconds.
873
+ *
874
+ * Default:
875
+ * 5000ms
876
+ *
877
+ * Recommended range:
878
+ * 1000ms to 30000ms
879
+ *
880
+ * @throws Error if timeout occurs.
881
+ *
882
+ * @example
883
+ * await visor.waitAny([
884
+ * "home-light.png",
885
+ * "home-dark.png"
886
+ * ]);
887
+ */
886
888
  waitAny(images: string[], { confidence, timeout }?: {
887
889
  confidence?: number;
888
890
  timeout?: number;
889
891
  }): Promise<boolean>;
890
892
  /**
891
- * Terminates shared OCR worker.
892
- *
893
- * Useful for framework cleanup
894
- * after long automation sessions.
895
- *
896
- * Recommended for:
897
- * - long-running automation
898
- * - memory cleanup
899
- * - graceful framework shutdown
900
- * @example
901
- * await visor.terminateOCR();
902
- */
893
+ * Terminates shared OCR worker.
894
+ *
895
+ * Useful for framework cleanup
896
+ * after long automation sessions.
897
+ *
898
+ * Recommended for:
899
+ * - long-running automation
900
+ * - memory cleanup
901
+ * - graceful framework shutdown
902
+ * @example
903
+ * await visor.terminateOCR();
904
+ */
903
905
  terminateOCR(): Promise<void>;
904
906
  }
905
907
  export declare const visor: Visor;