Skip to content

Commit

Permalink
chore: extract puppeteer launch options to type (#8448)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed May 31, 2022
1 parent 9f9a1a4 commit 3f4451e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/node/Puppeteer.ts
Expand Up @@ -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<string, unknown>;
}

/**
* Extends the main {@link Puppeteer} class with Node specific behaviour for fetching and
* downloading browsers.
Expand Down Expand Up @@ -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<string, unknown>;
} = {}
): Promise<Browser> {
launch(options: PuppeteerLaunchOptions = {}): Promise<Browser> {
if (options.product) this._productName = options.product;
return this._launcher.launch(options);
}
Expand Down

0 comments on commit 3f4451e

Please sign in to comment.