feat(new-docs): migrate Dialog documentation to TSDoc (#5981)

This commit is contained in:
Jack Franklin
2020-06-09 09:19:42 +01:00
committed by GitHub
parent 0b3d52a70e
commit ca8b0d685c
11 changed files with 93 additions and 82 deletions

View File

@@ -4,23 +4,36 @@
## Dialog class
Dialog instances are dispatched by the [Page](./puppeteer.page.md) via the `dialog` event.
<b>Signature:</b>
```typescript
export declare class Dialog
```
## Constructors
## Remarks
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(client, type, message, defaultValue)](./puppeteer.dialog._constructor_.md) | | Constructs a new instance of the <code>Dialog</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 `Dialog` class.
## Properties
## Example
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [Type](./puppeteer.dialog.type.md) | <code>static</code> | typeof [DialogType](./puppeteer.dialogtype.md) | |
```js
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
page.on('dialog', async dialog => {
console.log(dialog.message());
await dialog.dismiss();
await browser.close();
});
page.evaluate(() => alert('1'));
})();
```
## Methods