Skip to content

Commit

Permalink
chore: add type to resolve function (#7352)
Browse files Browse the repository at this point in the history
  • Loading branch information
yashLadha committed Jun 24, 2021
1 parent e3699e2 commit e94a6b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/Browser.ts
Expand Up @@ -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<Target>) => void;
const targetPromise = new Promise<Target>((x) => (resolve = x));
this.on(BrowserEmittedEvents.TargetCreated, check);
this.on(BrowserEmittedEvents.TargetChanged, check);
Expand Down
2 changes: 1 addition & 1 deletion src/common/Page.ts
Expand Up @@ -641,7 +641,7 @@ export class Page extends EventEmitter {
});

const { timeout = this._timeoutSettings.timeout() } = options;
let callback;
let callback: (value: FileChooser | PromiseLike<FileChooser>) => void;
const promise = new Promise<FileChooser>((x) => (callback = x));
this._fileChooserInterceptors.add(callback);
return helper
Expand Down

0 comments on commit e94a6b7

Please sign in to comment.