From e94a6b73d3014487b48a018fdcfb5f9874c86bdf Mon Sep 17 00:00:00 2001 From: Yash Ladha Date: Thu, 24 Jun 2021 14:00:21 +0530 Subject: [PATCH] chore: add type to resolve function (#7352) --- src/common/Browser.ts | 2 +- src/common/Page.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/Browser.ts b/src/common/Browser.ts index f1df5772752..cbb3932d860 100644 --- a/src/common/Browser.ts +++ b/src/common/Browser.ts @@ -480,7 +480,7 @@ export class Browser extends EventEmitter { const { timeout = 30000 } = options; const existingTarget = this.targets().find(predicate); if (existingTarget) return existingTarget; - let resolve; + let resolve: (value: Target | PromiseLike) => void; const targetPromise = new Promise((x) => (resolve = x)); this.on(BrowserEmittedEvents.TargetCreated, check); this.on(BrowserEmittedEvents.TargetChanged, check); diff --git a/src/common/Page.ts b/src/common/Page.ts index 238d7bde360..d342f189296 100644 --- a/src/common/Page.ts +++ b/src/common/Page.ts @@ -641,7 +641,7 @@ export class Page extends EventEmitter { }); const { timeout = this._timeoutSettings.timeout() } = options; - let callback; + let callback: (value: FileChooser | PromiseLike) => void; const promise = new Promise((x) => (callback = x)); this._fileChooserInterceptors.add(callback); return helper