From 03a87e814deb08ea514541361a72f03e4658e66f Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Thu, 9 Jul 2020 14:49:27 +0100 Subject: [PATCH] chore(docs): tidy Puppeteer class docs (#6181) * Mark properties as `private` or `@internal` so they don't get documented. * Fix the `@returns` on a getter which gets ignored. --- new-docs/puppeteer.md | 2 +- new-docs/puppeteer.puppeteer.__productname.md | 11 ---------- .../puppeteer.puppeteer._changedproduct.md | 11 ---------- .../puppeteer.puppeteer._ispuppeteercore.md | 11 ---------- .../puppeteer.puppeteer._preferredrevision.md | 11 ---------- new-docs/puppeteer.puppeteer.md | 10 ++++------ new-docs/puppeteer.puppeteer.product.md | 2 ++ src/common/Puppeteer.ts | 20 ++++++++++++------- 8 files changed, 20 insertions(+), 58 deletions(-) delete mode 100644 new-docs/puppeteer.puppeteer.__productname.md delete mode 100644 new-docs/puppeteer.puppeteer._changedproduct.md delete mode 100644 new-docs/puppeteer.puppeteer._ispuppeteercore.md delete mode 100644 new-docs/puppeteer.puppeteer._preferredrevision.md diff --git a/new-docs/puppeteer.md b/new-docs/puppeteer.md index 2811570a..ad2d130b 100644 --- a/new-docs/puppeteer.md +++ b/new-docs/puppeteer.md @@ -27,7 +27,7 @@ | [Keyboard](./puppeteer.keyboard.md) | Keyboard provides an api for managing a virtual keyboard. The high level api is [Keyboard.type()](./puppeteer.keyboard.type.md), which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page. | | [Mouse](./puppeteer.mouse.md) | The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport. | | [Page](./puppeteer.page.md) | Page provides methods to interact with a single tab or [extension background page](https://developer.chrome.com/extensions/background_pages) in Chromium. | -| [Puppeteer](./puppeteer.puppeteer.md) | The main Puppeteer class Puppeteer module provides a method to launch a browser instance. | +| [Puppeteer](./puppeteer.puppeteer.md) | The main Puppeteer class. Provides the [launch](./puppeteer.puppeteer.launch.md) method to launch a browser.When you require or import the Puppeteer npm package you get back an instance of this class. | | [SecurityDetails](./puppeteer.securitydetails.md) | The SecurityDetails class represents the security details of a response that was received over a secure connection. | | [Target](./puppeteer.target.md) | | | [TimeoutError](./puppeteer.timeouterror.md) | TimeoutError is emitted whenever certain operations are terminated due to timeout. | diff --git a/new-docs/puppeteer.puppeteer.__productname.md b/new-docs/puppeteer.puppeteer.__productname.md deleted file mode 100644 index 9dde1680..00000000 --- a/new-docs/puppeteer.puppeteer.__productname.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [Puppeteer](./puppeteer.puppeteer.md) > [\_\_productName](./puppeteer.puppeteer.__productname.md) - -## Puppeteer.\_\_productName property - -Signature: - -```typescript -__productName: string; -``` diff --git a/new-docs/puppeteer.puppeteer._changedproduct.md b/new-docs/puppeteer.puppeteer._changedproduct.md deleted file mode 100644 index 4a403a77..00000000 --- a/new-docs/puppeteer.puppeteer._changedproduct.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [Puppeteer](./puppeteer.puppeteer.md) > [\_changedProduct](./puppeteer.puppeteer._changedproduct.md) - -## Puppeteer.\_changedProduct property - -Signature: - -```typescript -_changedProduct: boolean; -``` diff --git a/new-docs/puppeteer.puppeteer._ispuppeteercore.md b/new-docs/puppeteer.puppeteer._ispuppeteercore.md deleted file mode 100644 index c4c6655a..00000000 --- a/new-docs/puppeteer.puppeteer._ispuppeteercore.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [Puppeteer](./puppeteer.puppeteer.md) > [\_isPuppeteerCore](./puppeteer.puppeteer._ispuppeteercore.md) - -## Puppeteer.\_isPuppeteerCore property - -Signature: - -```typescript -_isPuppeteerCore: boolean; -``` diff --git a/new-docs/puppeteer.puppeteer._preferredrevision.md b/new-docs/puppeteer.puppeteer._preferredrevision.md deleted file mode 100644 index a5e62c2b..00000000 --- a/new-docs/puppeteer.puppeteer._preferredrevision.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [puppeteer](./puppeteer.md) > [Puppeteer](./puppeteer.puppeteer.md) > [\_preferredRevision](./puppeteer.puppeteer._preferredrevision.md) - -## Puppeteer.\_preferredRevision property - -Signature: - -```typescript -_preferredRevision: string; -``` diff --git a/new-docs/puppeteer.puppeteer.md b/new-docs/puppeteer.puppeteer.md index b08fae37..ca7e00cf 100644 --- a/new-docs/puppeteer.puppeteer.md +++ b/new-docs/puppeteer.puppeteer.md @@ -4,7 +4,9 @@ ## Puppeteer class -The main Puppeteer class Puppeteer module provides a method to launch a browser instance. +The main Puppeteer class. Provides the [launch](./puppeteer.puppeteer.launch.md) method to launch a browser. + +When you `require` or `import` the Puppeteer npm package you get back an instance of this class. Signature: @@ -37,13 +39,9 @@ const puppeteer = require('puppeteer'); | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [\_\_productName](./puppeteer.puppeteer.__productname.md) | | string | | -| [\_changedProduct](./puppeteer.puppeteer._changedproduct.md) | | boolean | | -| [\_isPuppeteerCore](./puppeteer.puppeteer._ispuppeteercore.md) | | boolean | | -| [\_preferredRevision](./puppeteer.puppeteer._preferredrevision.md) | | string | | | [devices](./puppeteer.puppeteer.devices.md) | | [DevicesMap](./puppeteer.devicesmap.md) | | | [errors](./puppeteer.puppeteer.errors.md) | | [PuppeteerErrors](./puppeteer.puppeteererrors.md) | | -| [product](./puppeteer.puppeteer.product.md) | | string | | +| [product](./puppeteer.puppeteer.product.md) | | string | The name of the browser that is under automation ("chrome" or "firefox") | ## Methods diff --git a/new-docs/puppeteer.puppeteer.product.md b/new-docs/puppeteer.puppeteer.product.md index 465211c6..e6509889 100644 --- a/new-docs/puppeteer.puppeteer.product.md +++ b/new-docs/puppeteer.puppeteer.product.md @@ -4,6 +4,8 @@ ## Puppeteer.product property +The name of the browser that is under automation (`"chrome"` or `"firefox"`) + Signature: ```typescript diff --git a/src/common/Puppeteer.ts b/src/common/Puppeteer.ts index 122dac5e..e4833c9a 100644 --- a/src/common/Puppeteer.ts +++ b/src/common/Puppeteer.ts @@ -35,8 +35,11 @@ import { import { PUPPETEER_REVISIONS } from '../revisions'; /** - * The main Puppeteer class - * Puppeteer module provides a method to launch a browser instance. + * The main Puppeteer class. Provides the {@link Puppeteer.launch | launch} + * method to launch a browser. + * + * When you `require` or `import` the Puppeteer npm package you get back an + * instance of this class. * * @remarks * @@ -57,11 +60,14 @@ import { PUPPETEER_REVISIONS } from '../revisions'; */ export class Puppeteer { private _projectRoot: string; - _preferredRevision: string; - _isPuppeteerCore: boolean; - _changedProduct = false; - __productName: string; + private _isPuppeteerCore: boolean; + private _changedProduct = false; + private __productName: string; private _lazyLauncher: ProductLauncher; + /** + * @internal + */ + _preferredRevision: string; /** * @internal @@ -189,7 +195,7 @@ export class Puppeteer { } /** - * @returns The name of the browser that is under automation (`"chrome"` or `"firefox"`) + * The name of the browser that is under automation (`"chrome"` or `"firefox"`) * * @remarks * The product is set by the `PUPPETEER_PRODUCT` environment variable or the `product`