Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/screen.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,16 @@ export class ScreenClass {
* {@link waitFor} searches for a template image for a specified duration
* @param templateImage Filename of the template image, relative to {@link ScreenClass.config.resourceDirectory}, or an {@link Image}
* @param timeoutMs Timeout in milliseconds after which {@link waitFor} fails
* @param updateInterval Update interval in milliseconds to retry search
* @param params {@link LocationParameters} which are used to fine tune search region and / or match confidence
*/
public async waitFor(
templateImage: FirstArgumentType<typeof ScreenClass.prototype.find>,
timeoutMs: number = 5000,
updateInterval: number = 500,
params?: LocationParameters,
): Promise<Region> {
return timeout(500, timeoutMs, () => this.find(templateImage, params), {signal: params?.abort});
return timeout(updateInterval, timeoutMs, () => this.find(templateImage, params), {signal: params?.abort});
}

/**
Expand Down