Skip to content

Commit

Permalink
docs: move ProductLauncher to abstract class (#11324)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade committed Nov 8, 2023
1 parent 1927fb5 commit f7cf05c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/api/puppeteer.productlauncher.defaultargs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_label: ProductLauncher.defaultArgs

```typescript
class ProductLauncher {
defaultArgs(object: BrowserLaunchArgumentOptions): string[];
abstract defaultArgs(object: BrowserLaunchArgumentOptions): string[];
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.productlauncher.executablepath.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_label: ProductLauncher.executablePath

```typescript
class ProductLauncher {
executablePath(channel?: ChromeReleaseChannel): string;
abstract executablePath(channel?: ChromeReleaseChannel): string;
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.productlauncher.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Describes a launcher - a class that is able to create and launch a browser insta
#### Signature:

```typescript
export declare class ProductLauncher
export declare abstract class ProductLauncher
```

## Remarks
Expand Down
22 changes: 5 additions & 17 deletions packages/puppeteer-core/src/node/ProductLauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface ResolvedLaunchArgs {
*
* @public
*/
export class ProductLauncher {
export abstract class ProductLauncher {
#product: Product;

/**
Expand Down Expand Up @@ -201,15 +201,9 @@ export class ProductLauncher {
return browser;
}

executablePath(channel?: ChromeReleaseChannel): string;
executablePath(): string {
throw new Error('Not implemented');
}
abstract executablePath(channel?: ChromeReleaseChannel): string;

defaultArgs(object: BrowserLaunchArgumentOptions): string[];
defaultArgs(): string[] {
throw new Error('Not implemented');
}
abstract defaultArgs(object: BrowserLaunchArgumentOptions): string[];

/**
* Set only for Firefox, after the launcher resolves the `latest` revision to
Expand All @@ -223,23 +217,17 @@ export class ProductLauncher {
/**
* @internal
*/
protected async computeLaunchArguments(
protected abstract computeLaunchArguments(
options: PuppeteerNodeLaunchOptions
): Promise<ResolvedLaunchArgs>;
protected async computeLaunchArguments(): Promise<ResolvedLaunchArgs> {
throw new Error('Not implemented');
}

/**
* @internal
*/
protected async cleanUserDataDir(
protected abstract cleanUserDataDir(
path: string,
opts: {isTemp: boolean}
): Promise<void>;
protected async cleanUserDataDir(): Promise<void> {
throw new Error('Not implemented');
}

/**
* @internal
Expand Down

0 comments on commit f7cf05c

Please sign in to comment.