Skip to content

Commit

Permalink
feat(types): improve type of predicate function (#6997)
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky authored and mathiasbynens committed Apr 7, 2021
1 parent c39c81d commit 943477c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/common/Page.ts
Expand Up @@ -1408,7 +1408,7 @@ export class Page extends EventEmitter {
}

async waitForRequest(
urlOrPredicate: string | Function,
urlOrPredicate: string | ((req: HTTPRequest) => boolean | Promise<boolean>),
options: { timeout?: number } = {}
): Promise<HTTPRequest> {
const { timeout = this._timeoutSettings.timeout() } = options;
Expand All @@ -1428,7 +1428,9 @@ export class Page extends EventEmitter {
}

async waitForResponse(
urlOrPredicate: string | Function,
urlOrPredicate:
| string
| ((res: HTTPResponse) => boolean | Promise<boolean>),
options: { timeout?: number } = {}
): Promise<HTTPResponse> {
const { timeout = this._timeoutSettings.timeout() } = options;
Expand Down

0 comments on commit 943477c

Please sign in to comment.