mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat(new-docs): migrate Dialog documentation to TSDoc (#5981)
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Dialog](./puppeteer.dialog.md) > [(constructor)](./puppeteer.dialog._constructor_.md)
|
||||
|
||||
## Dialog.(constructor)
|
||||
|
||||
Constructs a new instance of the `Dialog` class
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
constructor(client: CDPSession, type: DialogType, message: string, defaultValue?: string);
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| client | [CDPSession](./puppeteer.cdpsession.md) | |
|
||||
| type | [DialogType](./puppeteer.dialogtype.md) | |
|
||||
| message | string | |
|
||||
| defaultValue | string | |
|
||||
|
||||
@@ -14,9 +14,11 @@ accept(promptText?: string): Promise<void>;
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| promptText | string | |
|
||||
| promptText | string | optional text that will be entered in the dialog prompt. Has no effect if the dialog's type is not <code>prompt</code>. |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<void>
|
||||
|
||||
A promise that resolves when the dialog has been accepted.
|
||||
|
||||
|
||||
@@ -13,3 +13,5 @@ defaultValue(): string;
|
||||
|
||||
string
|
||||
|
||||
The default value of the prompt, or an empty string if the dialog is not a `prompt`<!-- -->.
|
||||
|
||||
|
||||
@@ -13,3 +13,5 @@ dismiss(): Promise<void>;
|
||||
|
||||
Promise<void>
|
||||
|
||||
A promise which will resolve once the dialog has been dismissed
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -13,3 +13,5 @@ message(): string;
|
||||
|
||||
string
|
||||
|
||||
The message displayed in the dialog.
|
||||
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Dialog](./puppeteer.dialog.md) > [Type](./puppeteer.dialog.type.md)
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Dialog](./puppeteer.dialog.md) > [type](./puppeteer.dialog.type.md)
|
||||
|
||||
## Dialog.Type property
|
||||
## Dialog.type() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
static Type: typeof DialogType;
|
||||
type(): Protocol.Page.DialogType;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
Protocol.Page.DialogType
|
||||
|
||||
The type of the dialog.
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [puppeteer](./puppeteer.md) > [DialogType](./puppeteer.dialogtype.md)
|
||||
|
||||
## DialogType enum
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare enum DialogType
|
||||
```
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
| Member | Value | Description |
|
||||
| --- | --- | --- |
|
||||
| Alert | <code>"alert"</code> | |
|
||||
| BeforeUnload | <code>"beforeunload"</code> | |
|
||||
| Confirm | <code>"confirm"</code> | |
|
||||
| Prompt | <code>"prompt"</code> | |
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
| [Connection](./puppeteer.connection.md) | |
|
||||
| [ConsoleMessage](./puppeteer.consolemessage.md) | |
|
||||
| [Coverage](./puppeteer.coverage.md) | |
|
||||
| [Dialog](./puppeteer.dialog.md) | |
|
||||
| [Dialog](./puppeteer.dialog.md) | Dialog instances are dispatched by the [Page](./puppeteer.page.md) via the <code>dialog</code> event. |
|
||||
| [ElementHandle](./puppeteer.elementhandle.md) | |
|
||||
| [ExecutionContext](./puppeteer.executioncontext.md) | |
|
||||
| [FileChooser](./puppeteer.filechooser.md) | |
|
||||
@@ -36,12 +36,6 @@
|
||||
| [Tracing](./puppeteer.tracing.md) | |
|
||||
| [WebWorker](./puppeteer.webworker.md) | |
|
||||
|
||||
## Enumerations
|
||||
|
||||
| Enumeration | Description |
|
||||
| --- | --- |
|
||||
| [DialogType](./puppeteer.dialogtype.md) | |
|
||||
|
||||
## Functions
|
||||
|
||||
| Function | Description |
|
||||
|
||||
Reference in New Issue
Block a user