Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(new): add TSDoc comments to BrowserFetcher #6078

Merged
merged 5 commits into from Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion new-docs/puppeteer.browser.md
Expand Up @@ -9,7 +9,6 @@
```typescript
export declare class Browser extends EventEmitter
```
<b>Extends:</b> [EventEmitter](./puppeteer.eventemitter.md)
AVGP marked this conversation as resolved.
Show resolved Hide resolved

## Constructors

Expand Down
1 change: 0 additions & 1 deletion new-docs/puppeteer.browsercontext.md
Expand Up @@ -9,7 +9,6 @@
```typescript
export declare class BrowserContext extends EventEmitter
```
<b>Extends:</b> [EventEmitter](./puppeteer.eventemitter.md)

## Constructors

Expand Down
21 changes: 0 additions & 21 deletions new-docs/puppeteer.browserfetcher._constructor_.md

This file was deleted.

24 changes: 0 additions & 24 deletions new-docs/puppeteer.browserfetcher._getfolderpath.md

This file was deleted.

10 changes: 9 additions & 1 deletion new-docs/puppeteer.browserfetcher.candownload.md
Expand Up @@ -4,6 +4,8 @@

## BrowserFetcher.canDownload() method

Initiates a HEAD request to check if the revision is available.

<b>Signature:</b>

```typescript
Expand All @@ -14,9 +16,15 @@ canDownload(revision: string): Promise<boolean>;

| Parameter | Type | Description |
| --- | --- | --- |
| revision | string | |
| revision | string | The revision to check availability for. |

<b>Returns:</b>

Promise&lt;boolean&gt;

A promise that resolves to `true` if the revision could be downloaded from the host.

## Remarks

This method is affected by the current `product`<!-- -->.

12 changes: 9 additions & 3 deletions new-docs/puppeteer.browserfetcher.download.md
Expand Up @@ -4,6 +4,8 @@

## BrowserFetcher.download() method

Initiates a GET request to download the revision from the host.

<b>Signature:</b>

```typescript
Expand All @@ -14,12 +16,16 @@ download(revision: string, progressCallback: (x: number, y: number) => void): Pr

| Parameter | Type | Description |
| --- | --- | --- |
| revision | string | |
| progressCallback | (x: number, y: number) =&gt; void | |
| revision | string | The revision to download. |
| progressCallback | (x: number, y: number) =&gt; void | A function that will be called with two arguments: How many bytes have been downloaded and the total number of bytes of the download. |

<b>Returns:</b>

Promise&lt;BrowserFetcherRevisionInfo&gt;

{<!-- -->!Promise<!-- -->&lt;<!-- -->!BrowserFetcher.RevisionInfo<!-- -->&gt;<!-- -->}
A promise with revision information when the revision is downloaded and extracted.

## Remarks

This method is affected by the current `product`<!-- -->.

2 changes: 2 additions & 0 deletions new-docs/puppeteer.browserfetcher.host.md
Expand Up @@ -13,3 +13,5 @@ host(): string;

string

The download host being used.

6 changes: 6 additions & 0 deletions new-docs/puppeteer.browserfetcher.localrevisions.md
Expand Up @@ -13,3 +13,9 @@ localRevisions(): Promise<string[]>;

Promise&lt;string\[\]&gt;

A promise with a list of all revision strings (for the current `product`<!-- -->) available locally on disk.

## Remarks

This method is affected by the current `product`<!-- -->.

27 changes: 20 additions & 7 deletions new-docs/puppeteer.browserfetcher.md
Expand Up @@ -4,25 +4,38 @@

## BrowserFetcher class

BrowserFetcher can download and manage different versions of Chromium and Firefox.

<b>Signature:</b>

```typescript
export declare class BrowserFetcher
```

## Constructors
## Remarks

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(projectRoot, options)](./puppeteer.browserfetcher._constructor_.md) | | Constructs a new instance of the <code>BrowserFetcher</code> class |
BrowserFetcher operates on revision strings that specify a precise version of Chromium, e.g. `"533271"`<!-- -->. Revision strings can be obtained from \[omahaproxy.appspot.com\](http://omahaproxy.appspot.com/). In the Firefox case, BrowserFetcher downloads Firefox Nightly and operates on version numbers such as `"75"`<!-- -->.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BrowserFetcher` class.

## Example

An example of using BrowserFetcher to download a specific version of Chromium and running Puppeteer against it:

```js
const browserFetcher = puppeteer.createBrowserFetcher();
const revisionInfo = await browserFetcher.download('533271');
const browser = await puppeteer.launch({executablePath: revisionInfo.executablePath})

```
\*\*NOTE\*\* BrowserFetcher is not designed to work concurrently with other instances of BrowserFetcher that share the same downloads directory.

## Methods

| Method | Modifiers | Description |
| --- | --- | --- |
| [\_getFolderPath(revision)](./puppeteer.browserfetcher._getfolderpath.md) | | |
| [canDownload(revision)](./puppeteer.browserfetcher.candownload.md) | | |
| [download(revision, progressCallback)](./puppeteer.browserfetcher.download.md) | | |
| [canDownload(revision)](./puppeteer.browserfetcher.candownload.md) | | Initiates a HEAD request to check if the revision is available. |
| [download(revision, progressCallback)](./puppeteer.browserfetcher.download.md) | | Initiates a GET request to download the revision from the host. |
| [host()](./puppeteer.browserfetcher.host.md) | | |
| [localRevisions()](./puppeteer.browserfetcher.localrevisions.md) | | |
| [platform()](./puppeteer.browserfetcher.platform.md) | | |
Expand Down
2 changes: 2 additions & 0 deletions new-docs/puppeteer.browserfetcher.platform.md
Expand Up @@ -13,3 +13,5 @@ platform(): string;

string

One of `mac`<!-- -->, `linux`<!-- -->, `win32` or `win64`<!-- -->.

2 changes: 2 additions & 0 deletions new-docs/puppeteer.browserfetcher.product.md
Expand Up @@ -13,3 +13,5 @@ product(): string;

string

One of `chrome` or `firefox`<!-- -->.

8 changes: 7 additions & 1 deletion new-docs/puppeteer.browserfetcher.remove.md
Expand Up @@ -14,9 +14,15 @@ remove(revision: string): Promise<void>;

| Parameter | Type | Description |
| --- | --- | --- |
| revision | string | |
| revision | string | A revision to remove for the current <code>product</code>. |

<b>Returns:</b>

Promise&lt;void&gt;

A promise that resolves when the revision has been removes or throws if the revision has not been downloaded.

## Remarks

This method is affected by the current `product`<!-- -->.

4 changes: 3 additions & 1 deletion new-docs/puppeteer.browserfetcher.revisioninfo.md
Expand Up @@ -14,9 +14,11 @@ revisionInfo(revision: string): BrowserFetcherRevisionInfo;

| Parameter | Type | Description |
| --- | --- | --- |
| revision | string | |
| revision | string | The revision to get info for. |

<b>Returns:</b>

BrowserFetcherRevisionInfo

The revision info for the given revision.

1 change: 0 additions & 1 deletion new-docs/puppeteer.cdpsession.md
Expand Up @@ -9,7 +9,6 @@
```typescript
export declare class CDPSession extends EventEmitter
```
<b>Extends:</b> [EventEmitter](./puppeteer.eventemitter.md)

## Constructors

Expand Down
1 change: 0 additions & 1 deletion new-docs/puppeteer.connection.md
Expand Up @@ -9,7 +9,6 @@
```typescript
export declare class Connection extends EventEmitter
```
<b>Extends:</b> [EventEmitter](./puppeteer.eventemitter.md)

## Constructors

Expand Down
1 change: 0 additions & 1 deletion new-docs/puppeteer.elementhandle.md
Expand Up @@ -9,7 +9,6 @@
```typescript
export declare class ElementHandle extends JSHandle
```
<b>Extends:</b> [JSHandle](./puppeteer.jshandle.md)

## Constructors

Expand Down
1 change: 0 additions & 1 deletion new-docs/puppeteer.eventemitter.md
Expand Up @@ -11,7 +11,6 @@ The EventEmitter class that many Puppeteer classes extend.
```typescript
export declare class EventEmitter implements CommonEventEmitter
```
<b>Implements:</b> CommonEventEmitter

## Remarks

Expand Down
1 change: 0 additions & 1 deletion new-docs/puppeteer.framemanager.md
Expand Up @@ -9,7 +9,6 @@
```typescript
export declare class FrameManager extends EventEmitter
```
<b>Extends:</b> [EventEmitter](./puppeteer.eventemitter.md)

## Constructors

Expand Down
2 changes: 1 addition & 1 deletion new-docs/puppeteer.md
Expand Up @@ -11,7 +11,7 @@
| [Accessibility](./puppeteer.accessibility.md) | The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access)<!-- -->. |
| [Browser](./puppeteer.browser.md) | |
| [BrowserContext](./puppeteer.browsercontext.md) | |
| [BrowserFetcher](./puppeteer.browserfetcher.md) | |
| [BrowserFetcher](./puppeteer.browserfetcher.md) | BrowserFetcher can download and manage different versions of Chromium and Firefox. |
| [CDPSession](./puppeteer.cdpsession.md) | |
| [Connection](./puppeteer.connection.md) | |
| [ConsoleMessage](./puppeteer.consolemessage.md) | |
Expand Down
1 change: 0 additions & 1 deletion new-docs/puppeteer.page.md
Expand Up @@ -11,7 +11,6 @@ Page provides methods to interact with a single tab or \[extension background pa
```typescript
export declare class Page extends EventEmitter
```
<b>Extends:</b> [EventEmitter](./puppeteer.eventemitter.md)

## Remarks

Expand Down
1 change: 0 additions & 1 deletion new-docs/puppeteer.timeouterror.md
Expand Up @@ -11,7 +11,6 @@ TimeoutError is emitted whenever certain operations are terminated due to timeou
```typescript
export declare class TimeoutError extends CustomError
```
<b>Extends:</b> CustomError

## Remarks

Expand Down
1 change: 0 additions & 1 deletion new-docs/puppeteer.webworker.md
Expand Up @@ -11,7 +11,6 @@ The WebWorker class represents a [WebWorker](https://developer.mozilla.org/en-US
```typescript
export declare class WebWorker extends EventEmitter
```
<b>Extends:</b> [EventEmitter](./puppeteer.eventemitter.md)

## Remarks

Expand Down