From 75a136e0de1da574ad157296aea8488dda47006e Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Thu, 6 Apr 2023 14:23:10 +0200 Subject: [PATCH] docs: website docs for browsers (#9986) --- docs/browsers-api/browsers.browser.md | 21 ++++ docs/browsers-api/browsers.browserplatform.md | 23 ++++ docs/browsers-api/browsers.candownload.md | 21 ++++ .../browsers.cdp_websocket_endpoint_regex.md | 11 ++ .../browsers.chromereleasechannel.md | 20 +++ .../browsers.cli._constructor_.md | 22 ++++ docs/browsers-api/browsers.cli.md | 23 ++++ docs/browsers-api/browsers.cli.run.md | 23 ++++ .../browsers.computeexecutablepath.md | 21 ++++ .../browsers.computesystemexecutablepath.md | 23 ++++ docs/browsers-api/browsers.createprofile.md | 25 ++++ .../browsers.detectbrowserplatform.md | 15 +++ docs/browsers-api/browsers.install.md | 23 ++++ docs/browsers-api/browsers.installoptions.md | 23 ++++ docs/browsers-api/browsers.launch.md | 21 ++++ docs/browsers-api/browsers.launchoptions.md | 22 ++++ .../browsers.makeprogresscallback.md | 25 ++++ docs/browsers-api/browsers.options.md | 20 +++ docs/browsers-api/browsers.profileoptions.md | 18 +++ docs/browsers-api/browsers.resolvebuildid.md | 27 ++++ docs/browsers-api/browsers.systemoptions.md | 19 +++ docs/browsers-api/browsers.timeouterror.md | 17 +++ ...webdriver_bidi_websocket_endpoint_regex.md | 11 ++ docs/browsers-api/index.md | 56 +++++++++ package.json | 1 + packages/browsers/api-extractor.docs.json | 15 +++ packages/browsers/api-extractor.json | 40 ++++++ packages/browsers/package.json | 12 ++ .../browsers/src/browser-data/browser-data.ts | 2 + packages/browsers/src/install.ts | 8 +- packages/browsers/src/launch.ts | 2 +- packages/browsers/src/main.ts | 6 +- tools/generate_docs.ts | 12 ++ website/docusaurus.config.js | 116 ++++++++++++------ website/sidebars.js | 6 + .../browsers-api/browsers.browser.md | 21 ++++ .../browsers-api/browsers.browserplatform.md | 23 ++++ .../browsers-api/browsers.candownload.md | 21 ++++ .../browsers.cdp_websocket_endpoint_regex.md | 11 ++ .../browsers.chromereleasechannel.md | 20 +++ .../browsers.cli._constructor_.md | 22 ++++ .../browsers-api/browsers.cli.md | 23 ++++ .../browsers-api/browsers.cli.run.md | 23 ++++ .../browsers.computeexecutablepath.md | 21 ++++ .../browsers.computesystemexecutablepath.md | 23 ++++ .../browsers-api/browsers.createprofile.md | 25 ++++ .../browsers.detectbrowserplatform.md | 15 +++ .../browsers-api/browsers.install.md | 23 ++++ .../browsers-api/browsers.installoptions.md | 23 ++++ .../browsers-api/browsers.launch.md | 21 ++++ .../browsers-api/browsers.launchoptions.md | 22 ++++ .../browsers.makeprogresscallback.md | 25 ++++ .../browsers-api/browsers.options.md | 20 +++ .../browsers-api/browsers.profileoptions.md | 18 +++ .../browsers-api/browsers.resolvebuildid.md | 27 ++++ .../browsers-api/browsers.systemoptions.md | 19 +++ .../browsers-api/browsers.timeouterror.md | 17 +++ ...webdriver_bidi_websocket_endpoint_regex.md | 11 ++ .../version-19.8.3/browsers-api/index.md | 56 +++++++++ .../version-19.8.3-sidebars.json | 6 + 60 files changed, 1241 insertions(+), 45 deletions(-) create mode 100644 docs/browsers-api/browsers.browser.md create mode 100644 docs/browsers-api/browsers.browserplatform.md create mode 100644 docs/browsers-api/browsers.candownload.md create mode 100644 docs/browsers-api/browsers.cdp_websocket_endpoint_regex.md create mode 100644 docs/browsers-api/browsers.chromereleasechannel.md create mode 100644 docs/browsers-api/browsers.cli._constructor_.md create mode 100644 docs/browsers-api/browsers.cli.md create mode 100644 docs/browsers-api/browsers.cli.run.md create mode 100644 docs/browsers-api/browsers.computeexecutablepath.md create mode 100644 docs/browsers-api/browsers.computesystemexecutablepath.md create mode 100644 docs/browsers-api/browsers.createprofile.md create mode 100644 docs/browsers-api/browsers.detectbrowserplatform.md create mode 100644 docs/browsers-api/browsers.install.md create mode 100644 docs/browsers-api/browsers.installoptions.md create mode 100644 docs/browsers-api/browsers.launch.md create mode 100644 docs/browsers-api/browsers.launchoptions.md create mode 100644 docs/browsers-api/browsers.makeprogresscallback.md create mode 100644 docs/browsers-api/browsers.options.md create mode 100644 docs/browsers-api/browsers.profileoptions.md create mode 100644 docs/browsers-api/browsers.resolvebuildid.md create mode 100644 docs/browsers-api/browsers.systemoptions.md create mode 100644 docs/browsers-api/browsers.timeouterror.md create mode 100644 docs/browsers-api/browsers.webdriver_bidi_websocket_endpoint_regex.md create mode 100644 docs/browsers-api/index.md create mode 100644 packages/browsers/api-extractor.docs.json create mode 100644 packages/browsers/api-extractor.json create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.browser.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.browserplatform.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.candownload.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.cdp_websocket_endpoint_regex.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.chromereleasechannel.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.cli._constructor_.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.cli.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.cli.run.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.computeexecutablepath.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.computesystemexecutablepath.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.createprofile.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.detectbrowserplatform.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.install.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.installoptions.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.launch.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.launchoptions.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.makeprogresscallback.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.options.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.profileoptions.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.resolvebuildid.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.systemoptions.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.timeouterror.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/browsers.webdriver_bidi_websocket_endpoint_regex.md create mode 100644 website/versioned_docs/version-19.8.3/browsers-api/index.md diff --git a/docs/browsers-api/browsers.browser.md b/docs/browsers-api/browsers.browser.md new file mode 100644 index 00000000..53b649aa --- /dev/null +++ b/docs/browsers-api/browsers.browser.md @@ -0,0 +1,21 @@ +--- +sidebar_label: Browser +--- + +# Browser enum + +Supported browsers. + +#### Signature: + +```typescript +export declare enum Browser +``` + +## Enumeration Members + +| Member | Value | Description | +| -------- | --------------------------------- | ----------- | +| CHROME | "chrome" | | +| CHROMIUM | "chromium" | | +| FIREFOX | "firefox" | | diff --git a/docs/browsers-api/browsers.browserplatform.md b/docs/browsers-api/browsers.browserplatform.md new file mode 100644 index 00000000..50c021f1 --- /dev/null +++ b/docs/browsers-api/browsers.browserplatform.md @@ -0,0 +1,23 @@ +--- +sidebar_label: BrowserPlatform +--- + +# BrowserPlatform enum + +Platform names used to identify a OS platfrom x architecture combination in the way that is relevant for the browser download. + +#### Signature: + +```typescript +export declare enum BrowserPlatform +``` + +## Enumeration Members + +| Member | Value | Description | +| ------- | -------------------------------- | ----------- | +| LINUX | "linux" | | +| MAC | "mac" | | +| MAC_ARM | "mac_arm" | | +| WIN32 | "win32" | | +| WIN64 | "win64" | | diff --git a/docs/browsers-api/browsers.candownload.md b/docs/browsers-api/browsers.candownload.md new file mode 100644 index 00000000..ec56447d --- /dev/null +++ b/docs/browsers-api/browsers.candownload.md @@ -0,0 +1,21 @@ +--- +sidebar_label: canDownload +--- + +# canDownload() function + +#### Signature: + +```typescript +export declare function canDownload(options: InstallOptions): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------------- | ----------- | +| options | [InstallOptions](./browsers.installoptions.md) | | + +**Returns:** + +Promise<boolean> diff --git a/docs/browsers-api/browsers.cdp_websocket_endpoint_regex.md b/docs/browsers-api/browsers.cdp_websocket_endpoint_regex.md new file mode 100644 index 00000000..328b0433 --- /dev/null +++ b/docs/browsers-api/browsers.cdp_websocket_endpoint_regex.md @@ -0,0 +1,11 @@ +--- +sidebar_label: CDP_WEBSOCKET_ENDPOINT_REGEX +--- + +# CDP_WEBSOCKET_ENDPOINT_REGEX variable + +#### Signature: + +```typescript +CDP_WEBSOCKET_ENDPOINT_REGEX: RegExp; +``` diff --git a/docs/browsers-api/browsers.chromereleasechannel.md b/docs/browsers-api/browsers.chromereleasechannel.md new file mode 100644 index 00000000..79559f39 --- /dev/null +++ b/docs/browsers-api/browsers.chromereleasechannel.md @@ -0,0 +1,20 @@ +--- +sidebar_label: ChromeReleaseChannel +--- + +# ChromeReleaseChannel enum + +#### Signature: + +```typescript +export declare enum ChromeReleaseChannel +``` + +## Enumeration Members + +| Member | Value | Description | +| ------ | ------------------------------- | ----------- | +| BETA | "beta" | | +| CANARY | "canary" | | +| DEV | "dev" | | +| STABLE | "stable" | | diff --git a/docs/browsers-api/browsers.cli._constructor_.md b/docs/browsers-api/browsers.cli._constructor_.md new file mode 100644 index 00000000..e6716617 --- /dev/null +++ b/docs/browsers-api/browsers.cli._constructor_.md @@ -0,0 +1,22 @@ +--- +sidebar_label: CLI.(constructor) +--- + +# CLI.(constructor) + +Constructs a new instance of the `CLI` class + +#### Signature: + +```typescript +class CLI { + constructor(cachePath?: string, rl?: readline.Interface); +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------ | ------------ | +| cachePath | string | _(Optional)_ | +| rl | readline.Interface | _(Optional)_ | diff --git a/docs/browsers-api/browsers.cli.md b/docs/browsers-api/browsers.cli.md new file mode 100644 index 00000000..1e4fc22c --- /dev/null +++ b/docs/browsers-api/browsers.cli.md @@ -0,0 +1,23 @@ +--- +sidebar_label: CLI +--- + +# CLI class + +#### Signature: + +```typescript +export declare class CLI +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --------------------------------------------------------------- | --------- | ------------------------------------------------------- | +| [(constructor)(cachePath, rl)](./browsers.cli._constructor_.md) | | Constructs a new instance of the CLI class | + +## Methods + +| Method | Modifiers | Description | +| ---------------------------------- | --------- | ----------- | +| [run(argv)](./browsers.cli.run.md) | | | diff --git a/docs/browsers-api/browsers.cli.run.md b/docs/browsers-api/browsers.cli.run.md new file mode 100644 index 00000000..9c91b079 --- /dev/null +++ b/docs/browsers-api/browsers.cli.run.md @@ -0,0 +1,23 @@ +--- +sidebar_label: CLI.run +--- + +# CLI.run() method + +#### Signature: + +```typescript +class CLI { + run(argv: string[]): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------- | ----------- | +| argv | string\[\] | | + +**Returns:** + +Promise<void> diff --git a/docs/browsers-api/browsers.computeexecutablepath.md b/docs/browsers-api/browsers.computeexecutablepath.md new file mode 100644 index 00000000..0c0e1480 --- /dev/null +++ b/docs/browsers-api/browsers.computeexecutablepath.md @@ -0,0 +1,21 @@ +--- +sidebar_label: computeExecutablePath +--- + +# computeExecutablePath() function + +#### Signature: + +```typescript +export declare function computeExecutablePath(options: Options): string; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------------- | ----------- | +| options | [Options](./browsers.options.md) | | + +**Returns:** + +string diff --git a/docs/browsers-api/browsers.computesystemexecutablepath.md b/docs/browsers-api/browsers.computesystemexecutablepath.md new file mode 100644 index 00000000..b1e9a846 --- /dev/null +++ b/docs/browsers-api/browsers.computesystemexecutablepath.md @@ -0,0 +1,23 @@ +--- +sidebar_label: computeSystemExecutablePath +--- + +# computeSystemExecutablePath() function + +#### Signature: + +```typescript +export declare function computeSystemExecutablePath( + options: SystemOptions +): string; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------------------------- | ----------- | +| options | [SystemOptions](./browsers.systemoptions.md) | | + +**Returns:** + +string diff --git a/docs/browsers-api/browsers.createprofile.md b/docs/browsers-api/browsers.createprofile.md new file mode 100644 index 00000000..3edbbdf8 --- /dev/null +++ b/docs/browsers-api/browsers.createprofile.md @@ -0,0 +1,25 @@ +--- +sidebar_label: createProfile +--- + +# createProfile() function + +#### Signature: + +```typescript +export declare function createProfile( + browser: Browser, + opts: ProfileOptions +): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------------- | ----------- | +| browser | [Browser](./browsers.browser.md) | | +| opts | [ProfileOptions](./browsers.profileoptions.md) | | + +**Returns:** + +Promise<void> diff --git a/docs/browsers-api/browsers.detectbrowserplatform.md b/docs/browsers-api/browsers.detectbrowserplatform.md new file mode 100644 index 00000000..f3d7865d --- /dev/null +++ b/docs/browsers-api/browsers.detectbrowserplatform.md @@ -0,0 +1,15 @@ +--- +sidebar_label: detectBrowserPlatform +--- + +# detectBrowserPlatform() function + +#### Signature: + +```typescript +export declare function detectBrowserPlatform(): BrowserPlatform | undefined; +``` + +**Returns:** + +[BrowserPlatform](./browsers.browserplatform.md) \| undefined diff --git a/docs/browsers-api/browsers.install.md b/docs/browsers-api/browsers.install.md new file mode 100644 index 00000000..14fa4a42 --- /dev/null +++ b/docs/browsers-api/browsers.install.md @@ -0,0 +1,23 @@ +--- +sidebar_label: install +--- + +# install() function + +#### Signature: + +```typescript +export declare function install( + options: InstallOptions +): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------------- | ----------- | +| options | [InstallOptions](./browsers.installoptions.md) | | + +**Returns:** + +Promise<InstalledBrowser> diff --git a/docs/browsers-api/browsers.installoptions.md b/docs/browsers-api/browsers.installoptions.md new file mode 100644 index 00000000..ab0731df --- /dev/null +++ b/docs/browsers-api/browsers.installoptions.md @@ -0,0 +1,23 @@ +--- +sidebar_label: InstallOptions +--- + +# InstallOptions interface + +#### Signature: + +```typescript +export interface InstallOptions +``` + +## Properties + +| Property | Modifiers | Type | Description | Default | +| ------------------------ | --------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| baseUrl | optional | string | Determines the host that will be used for downloading. |

Either

- https://storage.googleapis.com/chromium-browser-snapshots or - https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central

| +| browser | | [Browser](./browsers.browser.md) | Determines which browser to install. | | +| buildId | | string | Determines which buildId to dowloand. BuildId should uniquely identify binaries and they are used for caching. | | +| cacheDir | | string | Determines the path to download browsers to. | | +| downloadProgressCallback | optional | (downloadedBytes: number, totalBytes: number) => void | Provides information about the progress of the download. | | +| platform | optional | [BrowserPlatform](./browsers.browserplatform.md) | Determines which platform the browser will be suited for. | **Auto-detected.** | +| unpack | optional | boolean | Whether to unpack and install browser archives. | true | diff --git a/docs/browsers-api/browsers.launch.md b/docs/browsers-api/browsers.launch.md new file mode 100644 index 00000000..84d3889e --- /dev/null +++ b/docs/browsers-api/browsers.launch.md @@ -0,0 +1,21 @@ +--- +sidebar_label: launch +--- + +# launch() function + +#### Signature: + +```typescript +export declare function launch(opts: LaunchOptions): Process; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------------------------- | ----------- | +| opts | [LaunchOptions](./browsers.launchoptions.md) | | + +**Returns:** + +Process diff --git a/docs/browsers-api/browsers.launchoptions.md b/docs/browsers-api/browsers.launchoptions.md new file mode 100644 index 00000000..6b72faf9 --- /dev/null +++ b/docs/browsers-api/browsers.launchoptions.md @@ -0,0 +1,22 @@ +--- +sidebar_label: LaunchOptions +--- + +# LaunchOptions type + +#### Signature: + +```typescript +export type LaunchOptions = { + executablePath: string; + pipe?: boolean; + dumpio?: boolean; + args?: string[]; + env?: Record; + handleSIGINT?: boolean; + handleSIGTERM?: boolean; + handleSIGHUP?: boolean; + detached?: boolean; + onExit?: () => Promise; +}; +``` diff --git a/docs/browsers-api/browsers.makeprogresscallback.md b/docs/browsers-api/browsers.makeprogresscallback.md new file mode 100644 index 00000000..8a1aab32 --- /dev/null +++ b/docs/browsers-api/browsers.makeprogresscallback.md @@ -0,0 +1,25 @@ +--- +sidebar_label: makeProgressCallback +--- + +# makeProgressCallback() function + +#### Signature: + +```typescript +export declare function makeProgressCallback( + browser: Browser, + buildId: string +): (downloadedBytes: number, totalBytes: number) => void; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------------- | ----------- | +| browser | [Browser](./browsers.browser.md) | | +| buildId | string | | + +**Returns:** + +(downloadedBytes: number, totalBytes: number) => void diff --git a/docs/browsers-api/browsers.options.md b/docs/browsers-api/browsers.options.md new file mode 100644 index 00000000..274d4ba0 --- /dev/null +++ b/docs/browsers-api/browsers.options.md @@ -0,0 +1,20 @@ +--- +sidebar_label: Options +--- + +# Options interface + +#### Signature: + +```typescript +export interface Options +``` + +## Properties + +| Property | Modifiers | Type | Description | Default | +| -------- | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- | ------------------ | +| browser | | [Browser](./browsers.browser.md) | Determines which browser to launch. | | +| buildId | | string | Determines which buildId to download. BuildId should uniquely identify binaries and they are used for caching. | | +| cacheDir | | string | Root path to the storage directory. | | +| platform | optional | [BrowserPlatform](./browsers.browserplatform.md) | Determines which platform the browser will be suited for. | **Auto-detected.** | diff --git a/docs/browsers-api/browsers.profileoptions.md b/docs/browsers-api/browsers.profileoptions.md new file mode 100644 index 00000000..a314fa18 --- /dev/null +++ b/docs/browsers-api/browsers.profileoptions.md @@ -0,0 +1,18 @@ +--- +sidebar_label: ProfileOptions +--- + +# ProfileOptions interface + +#### Signature: + +```typescript +export interface ProfileOptions +``` + +## Properties + +| Property | Modifiers | Type | Description | Default | +| ----------- | --------- | ----------------------------- | ----------- | ------- | +| path | | string | | | +| preferences | | Record<string, unknown> | | | diff --git a/docs/browsers-api/browsers.resolvebuildid.md b/docs/browsers-api/browsers.resolvebuildid.md new file mode 100644 index 00000000..02cc3011 --- /dev/null +++ b/docs/browsers-api/browsers.resolvebuildid.md @@ -0,0 +1,27 @@ +--- +sidebar_label: resolveBuildId +--- + +# resolveBuildId() function + +#### Signature: + +```typescript +export declare function resolveBuildId( + browser: Browser, + platform: BrowserPlatform, + tag: string +): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------ | ----------- | +| browser | [Browser](./browsers.browser.md) | | +| platform | [BrowserPlatform](./browsers.browserplatform.md) | | +| tag | string | | + +**Returns:** + +Promise<string> diff --git a/docs/browsers-api/browsers.systemoptions.md b/docs/browsers-api/browsers.systemoptions.md new file mode 100644 index 00000000..7fee22d2 --- /dev/null +++ b/docs/browsers-api/browsers.systemoptions.md @@ -0,0 +1,19 @@ +--- +sidebar_label: SystemOptions +--- + +# SystemOptions interface + +#### Signature: + +```typescript +export interface SystemOptions +``` + +## Properties + +| Property | Modifiers | Type | Description | Default | +| -------- | --------------------- | ---------------------------------------------------------- | --------------------------------------------------------- | ------------------ | +| browser | | [Browser](./browsers.browser.md) | Determines which browser to launch. | | +| channel | | [ChromeReleaseChannel](./browsers.chromereleasechannel.md) | Release channel to look for on the system. | | +| platform | optional | [BrowserPlatform](./browsers.browserplatform.md) | Determines which platform the browser will be suited for. | **Auto-detected.** | diff --git a/docs/browsers-api/browsers.timeouterror.md b/docs/browsers-api/browsers.timeouterror.md new file mode 100644 index 00000000..48442d68 --- /dev/null +++ b/docs/browsers-api/browsers.timeouterror.md @@ -0,0 +1,17 @@ +--- +sidebar_label: TimeoutError +--- + +# TimeoutError class + +#### Signature: + +```typescript +export declare class TimeoutError extends Error +``` + +**Extends:** Error + +## Remarks + +The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `TimeoutError` class. diff --git a/docs/browsers-api/browsers.webdriver_bidi_websocket_endpoint_regex.md b/docs/browsers-api/browsers.webdriver_bidi_websocket_endpoint_regex.md new file mode 100644 index 00000000..ad47afe0 --- /dev/null +++ b/docs/browsers-api/browsers.webdriver_bidi_websocket_endpoint_regex.md @@ -0,0 +1,11 @@ +--- +sidebar_label: WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX +--- + +# WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX variable + +#### Signature: + +```typescript +WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX: RegExp; +``` diff --git a/docs/browsers-api/index.md b/docs/browsers-api/index.md new file mode 100644 index 00000000..ae7dcaaf --- /dev/null +++ b/docs/browsers-api/index.md @@ -0,0 +1,56 @@ +--- +sidebar_label: API +--- + +# API Reference + +## Classes + +| Class | Description | +| ------------------------------------------ | ----------- | +| [CLI](./browsers.cli.md) | | +| [TimeoutError](./browsers.timeouterror.md) | | + +## Enumerations + +| Enumeration | Description | +| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | +| [Browser](./browsers.browser.md) | Supported browsers. | +| [BrowserPlatform](./browsers.browserplatform.md) | Platform names used to identify a OS platfrom x architecture combination in the way that is relevant for the browser download. | +| [ChromeReleaseChannel](./browsers.chromereleasechannel.md) | | + +## Functions + +| Function | Description | +| --------------------------------------------------------------------------------- | ----------- | +| [canDownload(options)](./browsers.candownload.md) | | +| [computeExecutablePath(options)](./browsers.computeexecutablepath.md) | | +| [computeSystemExecutablePath(options)](./browsers.computesystemexecutablepath.md) | | +| [createProfile(browser, opts)](./browsers.createprofile.md) | | +| [detectBrowserPlatform()](./browsers.detectbrowserplatform.md) | | +| [install(options)](./browsers.install.md) | | +| [launch(opts)](./browsers.launch.md) | | +| [makeProgressCallback(browser, buildId)](./browsers.makeprogresscallback.md) | | +| [resolveBuildId(browser, platform, tag)](./browsers.resolvebuildid.md) | | + +## Interfaces + +| Interface | Description | +| ---------------------------------------------- | ----------- | +| [InstallOptions](./browsers.installoptions.md) | | +| [Options](./browsers.options.md) | | +| [ProfileOptions](./browsers.profileoptions.md) | | +| [SystemOptions](./browsers.systemoptions.md) | | + +## Variables + +| Variable | Description | +| ------------------------------------------------------------------------------------------------ | ----------- | +| [CDP_WEBSOCKET_ENDPOINT_REGEX](./browsers.cdp_websocket_endpoint_regex.md) | | +| [WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX](./browsers.webdriver_bidi_websocket_endpoint_regex.md) | | + +## Type Aliases + +| Type Alias | Description | +| -------------------------------------------- | ----------- | +| [LaunchOptions](./browsers.launchoptions.md) | | diff --git a/package.json b/package.json index 3ea23e0d..5c6f25ff 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ }, "build:docs": { "dependencies": [ + "./packages/browsers:build:docs", "./packages/puppeteer:build:docs", "./packages/puppeteer-core:build:docs" ] diff --git a/packages/browsers/api-extractor.docs.json b/packages/browsers/api-extractor.docs.json new file mode 100644 index 00000000..6a41a3b5 --- /dev/null +++ b/packages/browsers/api-extractor.docs.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "/lib/esm/main.d.ts", + + "extends": "./api-extractor.json", + + "dtsRollup": { + "enabled": false + }, + + "docModel": { + "enabled": true, + "apiJsonFilePath": "/../../docs/.api.json" + } +} diff --git a/packages/browsers/api-extractor.json b/packages/browsers/api-extractor.json new file mode 100644 index 00000000..da1caae6 --- /dev/null +++ b/packages/browsers/api-extractor.json @@ -0,0 +1,40 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "/lib/esm/main.d.ts", + "bundledPackages": [], + + "apiReport": { + "enabled": false + }, + + "docModel": { + "enabled": false + }, + + "tsdocMetadata": { + "enabled": false + }, + + "messages": { + "compilerMessageReporting": { + "default": { + "logLevel": "warning" + } + }, + + "extractorMessageReporting": { + "ae-internal-missing-underscore": { + "logLevel": "none" + }, + "default": { + "logLevel": "warning" + } + }, + + "tsdocMessageReporting": { + "default": { + "logLevel": "warning" + } + } + } +} diff --git a/packages/browsers/package.json b/packages/browsers/package.json index 039d521b..2e4eb6b8 100644 --- a/packages/browsers/package.json +++ b/packages/browsers/package.json @@ -3,6 +3,7 @@ "version": "0.3.2", "description": "Download and launch browsers", "scripts": { + "build:docs": "wireit", "build": "wireit", "build:test": "wireit", "clean": "tsc --build --clean && rm -rf lib", @@ -45,6 +46,17 @@ "lib/esm/package.json" ] }, + "build:docs": { + "command": "api-extractor run --local --config \"./api-extractor.docs.json\"", + "files": [ + "api-extractor.docs.json", + "lib/esm/main.d.ts", + "tsconfig.json" + ], + "dependencies": [ + "build" + ] + }, "build:test": { "command": "tsc -b test/src/tsconfig.json", "files": [ diff --git a/packages/browsers/src/browser-data/browser-data.ts b/packages/browsers/src/browser-data/browser-data.ts index dc8975ef..c97fa6ac 100644 --- a/packages/browsers/src/browser-data/browser-data.ts +++ b/packages/browsers/src/browser-data/browser-data.ts @@ -25,6 +25,8 @@ import { ProfileOptions, } from './types.js'; +export {ProfileOptions}; + export const downloadUrls = { [Browser.CHROME]: chrome.resolveDownloadUrl, [Browser.CHROMIUM]: chromium.resolveDownloadUrl, diff --git a/packages/browsers/src/install.ts b/packages/browsers/src/install.ts index 8afe6e53..fad4d128 100644 --- a/packages/browsers/src/install.ts +++ b/packages/browsers/src/install.ts @@ -52,7 +52,7 @@ function debugTimeEnd(label: string) { /** * @public */ -export interface Options { +export interface InstallOptions { /** * Determines the path to download browsers to. */ @@ -104,7 +104,9 @@ export type InstalledBrowser = { platform: BrowserPlatform; }; -export async function install(options: Options): Promise { +export async function install( + options: InstallOptions +): Promise { options.platform ??= detectBrowserPlatform(); options.unpack ??= true; if (!options.platform) { @@ -192,7 +194,7 @@ export async function install(options: Options): Promise { }; } -export async function canDownload(options: Options): Promise { +export async function canDownload(options: InstallOptions): Promise { options.platform ??= detectBrowserPlatform(); if (!options.platform) { throw new Error( diff --git a/packages/browsers/src/launch.ts b/packages/browsers/src/launch.ts index 45fcf720..5e61ebdd 100644 --- a/packages/browsers/src/launch.ts +++ b/packages/browsers/src/launch.ts @@ -117,7 +117,7 @@ export function computeSystemExecutablePath(options: SystemOptions): string { return path; } -type LaunchOptions = { +export type LaunchOptions = { executablePath: string; pipe?: boolean; dumpio?: boolean; diff --git a/packages/browsers/src/main.ts b/packages/browsers/src/main.ts index ab169f19..42dd875f 100644 --- a/packages/browsers/src/main.ts +++ b/packages/browsers/src/main.ts @@ -19,10 +19,13 @@ export { computeExecutablePath, computeSystemExecutablePath, TimeoutError, + LaunchOptions, + Options, + SystemOptions, CDP_WEBSOCKET_ENDPOINT_REGEX, WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX, } from './launch.js'; -export {install, canDownload} from './install.js'; +export {install, canDownload, InstallOptions} from './install.js'; export {detectBrowserPlatform} from './detectPlatform.js'; export { resolveBuildId, @@ -30,6 +33,7 @@ export { BrowserPlatform, ChromeReleaseChannel, createProfile, + ProfileOptions, } from './browser-data/browser-data.js'; export {CLI, makeProgressCallback} from './CLI.js'; export {Cache} from './Cache.js'; diff --git a/tools/generate_docs.ts b/tools/generate_docs.ts index ee7bc2f1..f792e20c 100644 --- a/tools/generate_docs.ts +++ b/tools/generate_docs.ts @@ -118,4 +118,16 @@ function spliceIntoSection( ]) .outputs(['docs/api']) .build(); + + job('', async ({inputs, outputs}) => { + await rm(outputs[0]!, {recursive: true, force: true}); + generateDocs(inputs[0]!, outputs[0]!); + spawnAndLog('prettier', '--ignore-path', 'none', '--write', 'docs'); + }) + .inputs([ + 'docs/browsers.api.json', + 'tools/internal/custom_markdown_documenter.ts', + ]) + .outputs(['docs/browsers-api']) + .build(); })(); diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 50bb0e33..31bd8a2d 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -92,12 +92,6 @@ const config = { docs: { async sidebarItemsGenerator({defaultSidebarItemsGenerator, ...args}) { const sidebarItems = await defaultSidebarItemsGenerator(args); - const apiItem = sidebarItems.find(value => { - return value.type === 'doc' && value.label === 'API'; - }); - if (!apiItem) { - return sidebarItems; - } /** @type {typeof sidebarItems} */ const apiSidebarItems = []; @@ -112,37 +106,6 @@ const config = { } } - const order = [ - // PuppeteerNode and Puppeteer go first as the entrypoints into - // the Puppeteer API. - 'PuppeteerNode', - 'Puppeteer', - 'BrowserFetcher', - 'Browser', - 'BrowserContext', - 'Page', - 'WebWorker', - 'Accessibility', - 'Keyboard', - 'Mouse', - 'Touchscreen', - 'Tracing', - 'FileChooser', - 'Dialog', - 'ConsoleMessage', - 'Frame', - 'JSHandle', - 'ElementHandle', - 'HTTPRequest', - 'HTTPResponse', - 'SecurityDetails', - 'Target', - 'CDPSession', - 'Coverage', - 'TimeoutError', - 'EventEmitter', - ]; - function addNamespace(namespace, target) { let items = categories.get(namespace); if (!items) { @@ -171,8 +134,73 @@ const config = { categories.delete(namespace); } - for (const namespace of order) { - addNamespace(namespace, apiSidebarItems); + if (args.item.dirName === 'browsers-api') { + const order = [ + 'launch', + 'install', + 'canDownload', + 'createProfile', + 'computeExecutablePath', + 'computeSystemExecutablePath', + 'detectBrowserPlatform', + 'resolveBuildId', + 'BrowserPlatform', + 'Browser', + 'CLI', + ]; + const apiItem = sidebarItems.find(value => { + return value.type === 'doc' && value.label === 'API'; + }); + apiSidebarItems.push({ + type: 'category', + label: 'API', + items: [], + link: apiItem + ? { + type: 'doc', + id: apiItem.id, + } + : undefined, + }); + const container = apiSidebarItems[apiSidebarItems.length - 1]; + for (const namespace of order) { + addNamespace(namespace, container.items); + } + } else { + const order = [ + // PuppeteerNode and Puppeteer go first as the entrypoints into + // the Puppeteer API. + 'PuppeteerNode', + 'Puppeteer', + 'BrowserFetcher', + 'Browser', + 'BrowserContext', + 'Page', + 'WebWorker', + 'Accessibility', + 'Keyboard', + 'Mouse', + 'Touchscreen', + 'Tracing', + 'FileChooser', + 'Dialog', + 'ConsoleMessage', + 'Frame', + 'JSHandle', + 'ElementHandle', + 'HTTPRequest', + 'HTTPResponse', + 'SecurityDetails', + 'Target', + 'CDPSession', + 'Coverage', + 'TimeoutError', + 'EventEmitter', + ]; + + for (const namespace of order) { + addNamespace(namespace, apiSidebarItems); + } } const otherItems = []; apiSidebarItems.push({ @@ -186,6 +214,9 @@ const config = { return a.localeCompare(b); }); for (const namespace of remaining) { + if (namespace === 'API') { + continue; + } addNamespace(namespace, otherItems); } return apiSidebarItems; @@ -224,7 +255,12 @@ const config = { { type: 'docSidebar', sidebarId: 'api', - label: 'API', + label: 'Puppeteer API', + }, + { + type: 'docSidebar', + sidebarId: 'browsersApi', + label: '@puppeteer/browsers API', }, ].map(item => { return Object.assign(item, {position: 'left'}); diff --git a/website/sidebars.js b/website/sidebars.js index fd9817f8..29b7842c 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -32,4 +32,10 @@ module.exports = { dirName: 'api', }, ], + browsersApi: [ + { + type: 'autogenerated', + dirName: 'browsers-api', + }, + ], }; diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.browser.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.browser.md new file mode 100644 index 00000000..53b649aa --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.browser.md @@ -0,0 +1,21 @@ +--- +sidebar_label: Browser +--- + +# Browser enum + +Supported browsers. + +#### Signature: + +```typescript +export declare enum Browser +``` + +## Enumeration Members + +| Member | Value | Description | +| -------- | --------------------------------- | ----------- | +| CHROME | "chrome" | | +| CHROMIUM | "chromium" | | +| FIREFOX | "firefox" | | diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.browserplatform.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.browserplatform.md new file mode 100644 index 00000000..50c021f1 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.browserplatform.md @@ -0,0 +1,23 @@ +--- +sidebar_label: BrowserPlatform +--- + +# BrowserPlatform enum + +Platform names used to identify a OS platfrom x architecture combination in the way that is relevant for the browser download. + +#### Signature: + +```typescript +export declare enum BrowserPlatform +``` + +## Enumeration Members + +| Member | Value | Description | +| ------- | -------------------------------- | ----------- | +| LINUX | "linux" | | +| MAC | "mac" | | +| MAC_ARM | "mac_arm" | | +| WIN32 | "win32" | | +| WIN64 | "win64" | | diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.candownload.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.candownload.md new file mode 100644 index 00000000..ec56447d --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.candownload.md @@ -0,0 +1,21 @@ +--- +sidebar_label: canDownload +--- + +# canDownload() function + +#### Signature: + +```typescript +export declare function canDownload(options: InstallOptions): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------------- | ----------- | +| options | [InstallOptions](./browsers.installoptions.md) | | + +**Returns:** + +Promise<boolean> diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.cdp_websocket_endpoint_regex.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.cdp_websocket_endpoint_regex.md new file mode 100644 index 00000000..328b0433 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.cdp_websocket_endpoint_regex.md @@ -0,0 +1,11 @@ +--- +sidebar_label: CDP_WEBSOCKET_ENDPOINT_REGEX +--- + +# CDP_WEBSOCKET_ENDPOINT_REGEX variable + +#### Signature: + +```typescript +CDP_WEBSOCKET_ENDPOINT_REGEX: RegExp; +``` diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.chromereleasechannel.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.chromereleasechannel.md new file mode 100644 index 00000000..79559f39 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.chromereleasechannel.md @@ -0,0 +1,20 @@ +--- +sidebar_label: ChromeReleaseChannel +--- + +# ChromeReleaseChannel enum + +#### Signature: + +```typescript +export declare enum ChromeReleaseChannel +``` + +## Enumeration Members + +| Member | Value | Description | +| ------ | ------------------------------- | ----------- | +| BETA | "beta" | | +| CANARY | "canary" | | +| DEV | "dev" | | +| STABLE | "stable" | | diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.cli._constructor_.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.cli._constructor_.md new file mode 100644 index 00000000..e6716617 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.cli._constructor_.md @@ -0,0 +1,22 @@ +--- +sidebar_label: CLI.(constructor) +--- + +# CLI.(constructor) + +Constructs a new instance of the `CLI` class + +#### Signature: + +```typescript +class CLI { + constructor(cachePath?: string, rl?: readline.Interface); +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------ | ------------ | +| cachePath | string | _(Optional)_ | +| rl | readline.Interface | _(Optional)_ | diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.cli.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.cli.md new file mode 100644 index 00000000..1e4fc22c --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.cli.md @@ -0,0 +1,23 @@ +--- +sidebar_label: CLI +--- + +# CLI class + +#### Signature: + +```typescript +export declare class CLI +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --------------------------------------------------------------- | --------- | ------------------------------------------------------- | +| [(constructor)(cachePath, rl)](./browsers.cli._constructor_.md) | | Constructs a new instance of the CLI class | + +## Methods + +| Method | Modifiers | Description | +| ---------------------------------- | --------- | ----------- | +| [run(argv)](./browsers.cli.run.md) | | | diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.cli.run.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.cli.run.md new file mode 100644 index 00000000..9c91b079 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.cli.run.md @@ -0,0 +1,23 @@ +--- +sidebar_label: CLI.run +--- + +# CLI.run() method + +#### Signature: + +```typescript +class CLI { + run(argv: string[]): Promise; +} +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------- | ----------- | +| argv | string\[\] | | + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.computeexecutablepath.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.computeexecutablepath.md new file mode 100644 index 00000000..0c0e1480 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.computeexecutablepath.md @@ -0,0 +1,21 @@ +--- +sidebar_label: computeExecutablePath +--- + +# computeExecutablePath() function + +#### Signature: + +```typescript +export declare function computeExecutablePath(options: Options): string; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------------- | ----------- | +| options | [Options](./browsers.options.md) | | + +**Returns:** + +string diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.computesystemexecutablepath.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.computesystemexecutablepath.md new file mode 100644 index 00000000..b1e9a846 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.computesystemexecutablepath.md @@ -0,0 +1,23 @@ +--- +sidebar_label: computeSystemExecutablePath +--- + +# computeSystemExecutablePath() function + +#### Signature: + +```typescript +export declare function computeSystemExecutablePath( + options: SystemOptions +): string; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------------------------- | ----------- | +| options | [SystemOptions](./browsers.systemoptions.md) | | + +**Returns:** + +string diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.createprofile.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.createprofile.md new file mode 100644 index 00000000..3edbbdf8 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.createprofile.md @@ -0,0 +1,25 @@ +--- +sidebar_label: createProfile +--- + +# createProfile() function + +#### Signature: + +```typescript +export declare function createProfile( + browser: Browser, + opts: ProfileOptions +): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------------- | ----------- | +| browser | [Browser](./browsers.browser.md) | | +| opts | [ProfileOptions](./browsers.profileoptions.md) | | + +**Returns:** + +Promise<void> diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.detectbrowserplatform.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.detectbrowserplatform.md new file mode 100644 index 00000000..f3d7865d --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.detectbrowserplatform.md @@ -0,0 +1,15 @@ +--- +sidebar_label: detectBrowserPlatform +--- + +# detectBrowserPlatform() function + +#### Signature: + +```typescript +export declare function detectBrowserPlatform(): BrowserPlatform | undefined; +``` + +**Returns:** + +[BrowserPlatform](./browsers.browserplatform.md) \| undefined diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.install.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.install.md new file mode 100644 index 00000000..14fa4a42 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.install.md @@ -0,0 +1,23 @@ +--- +sidebar_label: install +--- + +# install() function + +#### Signature: + +```typescript +export declare function install( + options: InstallOptions +): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------------- | ----------- | +| options | [InstallOptions](./browsers.installoptions.md) | | + +**Returns:** + +Promise<InstalledBrowser> diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.installoptions.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.installoptions.md new file mode 100644 index 00000000..ab0731df --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.installoptions.md @@ -0,0 +1,23 @@ +--- +sidebar_label: InstallOptions +--- + +# InstallOptions interface + +#### Signature: + +```typescript +export interface InstallOptions +``` + +## Properties + +| Property | Modifiers | Type | Description | Default | +| ------------------------ | --------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| baseUrl | optional | string | Determines the host that will be used for downloading. |

Either

- https://storage.googleapis.com/chromium-browser-snapshots or - https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central

| +| browser | | [Browser](./browsers.browser.md) | Determines which browser to install. | | +| buildId | | string | Determines which buildId to dowloand. BuildId should uniquely identify binaries and they are used for caching. | | +| cacheDir | | string | Determines the path to download browsers to. | | +| downloadProgressCallback | optional | (downloadedBytes: number, totalBytes: number) => void | Provides information about the progress of the download. | | +| platform | optional | [BrowserPlatform](./browsers.browserplatform.md) | Determines which platform the browser will be suited for. | **Auto-detected.** | +| unpack | optional | boolean | Whether to unpack and install browser archives. | true | diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.launch.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.launch.md new file mode 100644 index 00000000..84d3889e --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.launch.md @@ -0,0 +1,21 @@ +--- +sidebar_label: launch +--- + +# launch() function + +#### Signature: + +```typescript +export declare function launch(opts: LaunchOptions): Process; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------------------------- | ----------- | +| opts | [LaunchOptions](./browsers.launchoptions.md) | | + +**Returns:** + +Process diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.launchoptions.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.launchoptions.md new file mode 100644 index 00000000..6b72faf9 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.launchoptions.md @@ -0,0 +1,22 @@ +--- +sidebar_label: LaunchOptions +--- + +# LaunchOptions type + +#### Signature: + +```typescript +export type LaunchOptions = { + executablePath: string; + pipe?: boolean; + dumpio?: boolean; + args?: string[]; + env?: Record; + handleSIGINT?: boolean; + handleSIGTERM?: boolean; + handleSIGHUP?: boolean; + detached?: boolean; + onExit?: () => Promise; +}; +``` diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.makeprogresscallback.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.makeprogresscallback.md new file mode 100644 index 00000000..8a1aab32 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.makeprogresscallback.md @@ -0,0 +1,25 @@ +--- +sidebar_label: makeProgressCallback +--- + +# makeProgressCallback() function + +#### Signature: + +```typescript +export declare function makeProgressCallback( + browser: Browser, + buildId: string +): (downloadedBytes: number, totalBytes: number) => void; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------------- | ----------- | +| browser | [Browser](./browsers.browser.md) | | +| buildId | string | | + +**Returns:** + +(downloadedBytes: number, totalBytes: number) => void diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.options.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.options.md new file mode 100644 index 00000000..274d4ba0 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.options.md @@ -0,0 +1,20 @@ +--- +sidebar_label: Options +--- + +# Options interface + +#### Signature: + +```typescript +export interface Options +``` + +## Properties + +| Property | Modifiers | Type | Description | Default | +| -------- | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- | ------------------ | +| browser | | [Browser](./browsers.browser.md) | Determines which browser to launch. | | +| buildId | | string | Determines which buildId to download. BuildId should uniquely identify binaries and they are used for caching. | | +| cacheDir | | string | Root path to the storage directory. | | +| platform | optional | [BrowserPlatform](./browsers.browserplatform.md) | Determines which platform the browser will be suited for. | **Auto-detected.** | diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.profileoptions.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.profileoptions.md new file mode 100644 index 00000000..a314fa18 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.profileoptions.md @@ -0,0 +1,18 @@ +--- +sidebar_label: ProfileOptions +--- + +# ProfileOptions interface + +#### Signature: + +```typescript +export interface ProfileOptions +``` + +## Properties + +| Property | Modifiers | Type | Description | Default | +| ----------- | --------- | ----------------------------- | ----------- | ------- | +| path | | string | | | +| preferences | | Record<string, unknown> | | | diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.resolvebuildid.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.resolvebuildid.md new file mode 100644 index 00000000..02cc3011 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.resolvebuildid.md @@ -0,0 +1,27 @@ +--- +sidebar_label: resolveBuildId +--- + +# resolveBuildId() function + +#### Signature: + +```typescript +export declare function resolveBuildId( + browser: Browser, + platform: BrowserPlatform, + tag: string +): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------------------------ | ----------- | +| browser | [Browser](./browsers.browser.md) | | +| platform | [BrowserPlatform](./browsers.browserplatform.md) | | +| tag | string | | + +**Returns:** + +Promise<string> diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.systemoptions.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.systemoptions.md new file mode 100644 index 00000000..7fee22d2 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.systemoptions.md @@ -0,0 +1,19 @@ +--- +sidebar_label: SystemOptions +--- + +# SystemOptions interface + +#### Signature: + +```typescript +export interface SystemOptions +``` + +## Properties + +| Property | Modifiers | Type | Description | Default | +| -------- | --------------------- | ---------------------------------------------------------- | --------------------------------------------------------- | ------------------ | +| browser | | [Browser](./browsers.browser.md) | Determines which browser to launch. | | +| channel | | [ChromeReleaseChannel](./browsers.chromereleasechannel.md) | Release channel to look for on the system. | | +| platform | optional | [BrowserPlatform](./browsers.browserplatform.md) | Determines which platform the browser will be suited for. | **Auto-detected.** | diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.timeouterror.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.timeouterror.md new file mode 100644 index 00000000..48442d68 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.timeouterror.md @@ -0,0 +1,17 @@ +--- +sidebar_label: TimeoutError +--- + +# TimeoutError class + +#### Signature: + +```typescript +export declare class TimeoutError extends Error +``` + +**Extends:** Error + +## Remarks + +The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `TimeoutError` class. diff --git a/website/versioned_docs/version-19.8.3/browsers-api/browsers.webdriver_bidi_websocket_endpoint_regex.md b/website/versioned_docs/version-19.8.3/browsers-api/browsers.webdriver_bidi_websocket_endpoint_regex.md new file mode 100644 index 00000000..ad47afe0 --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/browsers.webdriver_bidi_websocket_endpoint_regex.md @@ -0,0 +1,11 @@ +--- +sidebar_label: WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX +--- + +# WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX variable + +#### Signature: + +```typescript +WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX: RegExp; +``` diff --git a/website/versioned_docs/version-19.8.3/browsers-api/index.md b/website/versioned_docs/version-19.8.3/browsers-api/index.md new file mode 100644 index 00000000..ae7dcaaf --- /dev/null +++ b/website/versioned_docs/version-19.8.3/browsers-api/index.md @@ -0,0 +1,56 @@ +--- +sidebar_label: API +--- + +# API Reference + +## Classes + +| Class | Description | +| ------------------------------------------ | ----------- | +| [CLI](./browsers.cli.md) | | +| [TimeoutError](./browsers.timeouterror.md) | | + +## Enumerations + +| Enumeration | Description | +| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | +| [Browser](./browsers.browser.md) | Supported browsers. | +| [BrowserPlatform](./browsers.browserplatform.md) | Platform names used to identify a OS platfrom x architecture combination in the way that is relevant for the browser download. | +| [ChromeReleaseChannel](./browsers.chromereleasechannel.md) | | + +## Functions + +| Function | Description | +| --------------------------------------------------------------------------------- | ----------- | +| [canDownload(options)](./browsers.candownload.md) | | +| [computeExecutablePath(options)](./browsers.computeexecutablepath.md) | | +| [computeSystemExecutablePath(options)](./browsers.computesystemexecutablepath.md) | | +| [createProfile(browser, opts)](./browsers.createprofile.md) | | +| [detectBrowserPlatform()](./browsers.detectbrowserplatform.md) | | +| [install(options)](./browsers.install.md) | | +| [launch(opts)](./browsers.launch.md) | | +| [makeProgressCallback(browser, buildId)](./browsers.makeprogresscallback.md) | | +| [resolveBuildId(browser, platform, tag)](./browsers.resolvebuildid.md) | | + +## Interfaces + +| Interface | Description | +| ---------------------------------------------- | ----------- | +| [InstallOptions](./browsers.installoptions.md) | | +| [Options](./browsers.options.md) | | +| [ProfileOptions](./browsers.profileoptions.md) | | +| [SystemOptions](./browsers.systemoptions.md) | | + +## Variables + +| Variable | Description | +| ------------------------------------------------------------------------------------------------ | ----------- | +| [CDP_WEBSOCKET_ENDPOINT_REGEX](./browsers.cdp_websocket_endpoint_regex.md) | | +| [WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX](./browsers.webdriver_bidi_websocket_endpoint_regex.md) | | + +## Type Aliases + +| Type Alias | Description | +| -------------------------------------------- | ----------- | +| [LaunchOptions](./browsers.launchoptions.md) | | diff --git a/website/versioned_sidebars/version-19.8.3-sidebars.json b/website/versioned_sidebars/version-19.8.3-sidebars.json index 76b160d0..ba2a8376 100644 --- a/website/versioned_sidebars/version-19.8.3-sidebars.json +++ b/website/versioned_sidebars/version-19.8.3-sidebars.json @@ -32,5 +32,11 @@ "type": "autogenerated", "dirName": "api" } + ], + "browsersApi": [ + { + "type": "autogenerated", + "dirName": "browsers-api" + } ] }