docs(new): add TSDoc comments to Puppeteer (#6032)

This commit is contained in:
Martin Splitt
2020-06-24 16:21:46 +02:00
committed by Mathias Bynens
parent a46c78fc91
commit f1f7339a3b
18 changed files with 256 additions and 140 deletions

View File

@@ -4,7 +4,7 @@
## Puppeteer class
The main Puppeteer class
The main Puppeteer class Puppeteer module provides a method to launch a browser instance.
<b>Signature:</b>
@@ -12,11 +12,26 @@ The main Puppeteer class
export declare class Puppeteer
```
## Constructors
## Remarks
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(projectRoot, preferredRevision, isPuppeteerCore, productName)](./puppeteer.puppeteer._constructor_.md) | | Constructs a new instance of the <code>Puppeteer</code> class |
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Puppeteer` class.
## Example
The following is a typical example of using Puppeteer to drive automation:
```js
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://www.google.com');
// other actions...
await browser.close();
})();
```
## Properties
@@ -25,10 +40,8 @@ export declare class Puppeteer
| [\_\_productName](./puppeteer.puppeteer.__productname.md) | | string | |
| [\_changedProduct](./puppeteer.puppeteer._changedproduct.md) | | boolean | |
| [\_isPuppeteerCore](./puppeteer.puppeteer._ispuppeteercore.md) | | boolean | |
| [\_launcher](./puppeteer.puppeteer._launcher.md) | | ProductLauncher | |
| [\_lazyLauncher](./puppeteer.puppeteer._lazylauncher.md) | | ProductLauncher | |
| [\_preferredRevision](./puppeteer.puppeteer._preferredrevision.md) | | string | |
| [\_productName](./puppeteer.puppeteer._productname.md) | | string | |
| [\_projectRoot](./puppeteer.puppeteer._projectroot.md) | | string | |
| [devices](./puppeteer.puppeteer.devices.md) | | DevicesMap | |
| [errors](./puppeteer.puppeteer.errors.md) | | [PuppeteerErrors](./puppeteer.puppeteererrors.md) | |
@@ -38,13 +51,9 @@ export declare class Puppeteer
| Method | Modifiers | Description |
| --- | --- | --- |
| [\_\_experimental\_clearQueryHandlers()](./puppeteer.puppeteer.__experimental_clearqueryhandlers.md) | | |
| [\_\_experimental\_customQueryHandlers()](./puppeteer.puppeteer.__experimental_customqueryhandlers.md) | | |
| [\_\_experimental\_registerCustomQueryHandler(name, queryHandler)](./puppeteer.puppeteer.__experimental_registercustomqueryhandler.md) | | |
| [\_\_experimental\_unregisterCustomQueryHandler(name)](./puppeteer.puppeteer.__experimental_unregistercustomqueryhandler.md) | | |
| [connect(options)](./puppeteer.puppeteer.connect.md) | | |
| [connect(options)](./puppeteer.puppeteer.connect.md) | | This method attaches Puppeteer to an existing browser instance. |
| [createBrowserFetcher(options)](./puppeteer.puppeteer.createbrowserfetcher.md) | | |
| [defaultArgs(options)](./puppeteer.puppeteer.defaultargs.md) | | |
| [executablePath()](./puppeteer.puppeteer.executablepath.md) | | |
| [launch(options)](./puppeteer.puppeteer.launch.md) | | |
| [launch(options)](./puppeteer.puppeteer.launch.md) | | Launches puppeteer and launches a browser instance with given arguments and options when specified. |