File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -226,12 +226,12 @@ export class ScreenClass {
226
226
*/
227
227
public async captureRegion (
228
228
fileName : string ,
229
- regionToCapture : Region ,
229
+ regionToCapture : Region | Promise < Region > ,
230
230
fileFormat : FileType = FileType . PNG ,
231
231
filePath : string = cwd ( ) ,
232
232
fileNamePrefix : string = "" ,
233
233
fileNamePostfix : string = "" ) : Promise < string > {
234
- const regionImage = await this . vision . grabScreenRegion ( regionToCapture ) ;
234
+ const regionImage = await this . vision . grabScreenRegion ( await regionToCapture ) ;
235
235
return this . saveImage (
236
236
regionImage ,
237
237
fileName ,
@@ -243,9 +243,10 @@ export class ScreenClass {
243
243
244
244
/**
245
245
* {@link grabRegion } grabs screen content of a region on the systems main display
246
+ * @param regionToGrab The screen region to grab
246
247
*/
247
- public async grabRegion ( regionToGrab : Region ) : Promise < Image > {
248
- return this . vision . grabScreenRegion ( regionToGrab ) ;
248
+ public async grabRegion ( regionToGrab : Region | Promise < Region > ) : Promise < Image > {
249
+ return this . vision . grabScreenRegion ( await regionToGrab ) ;
249
250
}
250
251
251
252
private async saveImage (
You can’t perform that action at this time.
0 commit comments