chore: add type to resolve function (#7352)

This commit is contained in:
Yash Ladha 2021-06-24 14:00:21 +05:30 committed by GitHub
parent e3699e248b
commit e94a6b73d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -480,7 +480,7 @@ export class Browser extends EventEmitter {
const { timeout = 30000 } = options; const { timeout = 30000 } = options;
const existingTarget = this.targets().find(predicate); const existingTarget = this.targets().find(predicate);
if (existingTarget) return existingTarget; if (existingTarget) return existingTarget;
let resolve; let resolve: (value: Target | PromiseLike<Target>) => void;
const targetPromise = new Promise<Target>((x) => (resolve = x)); const targetPromise = new Promise<Target>((x) => (resolve = x));
this.on(BrowserEmittedEvents.TargetCreated, check); this.on(BrowserEmittedEvents.TargetCreated, check);
this.on(BrowserEmittedEvents.TargetChanged, check); this.on(BrowserEmittedEvents.TargetChanged, check);

View File

@ -641,7 +641,7 @@ export class Page extends EventEmitter {
}); });
const { timeout = this._timeoutSettings.timeout() } = options; const { timeout = this._timeoutSettings.timeout() } = options;
let callback; let callback: (value: FileChooser | PromiseLike<FileChooser>) => void;
const promise = new Promise<FileChooser>((x) => (callback = x)); const promise = new Promise<FileChooser>((x) => (callback = x));
this._fileChooserInterceptors.add(callback); this._fileChooserInterceptors.add(callback);
return helper return helper