diff --git a/src/common/Page.ts b/src/common/Page.ts index fd27620beb08d..17f3b6342ee7b 100644 --- a/src/common/Page.ts +++ b/src/common/Page.ts @@ -1408,7 +1408,7 @@ export class Page extends EventEmitter { } async waitForRequest( - urlOrPredicate: string | Function, + urlOrPredicate: string | ((req: HTTPRequest) => boolean | Promise), options: { timeout?: number } = {} ): Promise { const { timeout = this._timeoutSettings.timeout() } = options; @@ -1428,7 +1428,9 @@ export class Page extends EventEmitter { } async waitForResponse( - urlOrPredicate: string | Function, + urlOrPredicate: + | string + | ((res: HTTPResponse) => boolean | Promise), options: { timeout?: number } = {} ): Promise { const { timeout = this._timeoutSettings.timeout() } = options;