@@ -92,19 +92,19 @@ export class ScreenClass {
92
92
93
93
/**
94
94
* {@link find } will search for a single occurrence of a template image on a systems main screen
95
- * @param templateImage Filename of the template image, relative to { @link ScreenClass.config.resourceDirectory}, or an {@link Image} instance
95
+ * @param template Template {@link Image} instance
96
96
* @param params {@link LocationParameters } which are used to fine tune search region and / or match confidence
97
97
*/
98
98
public async find (
99
- templateImage : Image | Promise < Image > ,
99
+ template : Image | Promise < Image > ,
100
100
params ?: LocationParameters ,
101
101
) : Promise < Region > {
102
102
const minMatch = ( params && params . confidence ) || this . config . confidence ;
103
103
const screenSize = await this . providerRegistry . getScreen ( ) . screenSize ( ) ;
104
104
const searchRegion = ( params && params . searchRegion ) || screenSize ;
105
105
const searchMultipleScales = ( params && params . searchMultipleScales )
106
106
107
- const needle = await templateImage ;
107
+ const needle = await template ;
108
108
109
109
const screenImage = await this . providerRegistry . getScreen ( ) . grabScreenRegion ( searchRegion ) ;
110
110
@@ -144,19 +144,19 @@ export class ScreenClass {
144
144
145
145
/**
146
146
* {@link findAll } will search for every occurrences of a template image on a systems main screen
147
- * @param templateImage Filename of the template image, relative to { @link ScreenClass.config.resourceDirectory}, or an {@link Image} instance
147
+ * @param template Template {@link Image} instance
148
148
* @param params {@link LocationParameters } which are used to fine tune search region and / or match confidence
149
149
*/
150
150
public async findAll (
151
- templateImage : Image | Promise < Image > ,
151
+ template : FirstArgumentType < typeof ScreenClass . prototype . find > ,
152
152
params ?: LocationParameters ,
153
153
) : Promise < Region [ ] > {
154
154
const minMatch = ( params && params . confidence ) || this . config . confidence ;
155
155
const screenSize = await this . providerRegistry . getScreen ( ) . screenSize ( ) ;
156
156
const searchRegion = ( params && params . searchRegion ) || screenSize ;
157
157
const searchMultipleScales = ( params && params . searchMultipleScales )
158
158
159
- const needle = await templateImage ;
159
+ const needle = await template ;
160
160
161
161
const screenImage = await this . providerRegistry . getScreen ( ) . grabScreenRegion ( searchRegion ) ;
162
162
0 commit comments