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