From 3f4451eff7b6aac3360f80a58bd69d53b1ccb8b2 Mon Sep 17 00:00:00 2001 From: jrandolf <101637635+jrandolf@users.noreply.github.com> Date: Tue, 31 May 2022 19:54:25 +0200 Subject: [PATCH] chore: extract puppeteer launch options to type (#8448) --- src/node/Puppeteer.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/node/Puppeteer.ts b/src/node/Puppeteer.ts index ffc52c42668..58f86ce3600 100644 --- a/src/node/Puppeteer.ts +++ b/src/node/Puppeteer.ts @@ -30,6 +30,17 @@ import Launcher, { ProductLauncher } from './Launcher.js'; import { PUPPETEER_REVISIONS } from '../revisions.js'; import { Product } from '../common/Product.js'; +/** + * @public + */ +export interface PuppeteerLaunchOptions + extends LaunchOptions, + BrowserLaunchArgumentOptions, + BrowserConnectOptions { + product?: Product; + extraPrefsFirefox?: Record; +} + /** * Extends the main {@link Puppeteer} class with Node specific behaviour for fetching and * downloading browsers. @@ -143,14 +154,7 @@ export class PuppeteerNode extends Puppeteer { * @param options - Set of configurable options to set on the browser. * @returns Promise which resolves to browser instance. */ - launch( - options: LaunchOptions & - BrowserLaunchArgumentOptions & - BrowserConnectOptions & { - product?: Product; - extraPrefsFirefox?: Record; - } = {} - ): Promise { + launch(options: PuppeteerLaunchOptions = {}): Promise { if (options.product) this._productName = options.product; return this._launcher.launch(options); }