mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: add type to resolve function (#7352)
This commit is contained in:
parent
e3699e248b
commit
e94a6b73d3
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user