mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
refactor: rename Dialog.sendCommand to Dialog.handle (#11650)
This commit is contained in:
parent
0dcdb89c57
commit
cf16cb49c9
@ -76,7 +76,7 @@ export abstract class Dialog {
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
protected abstract sendCommand(options: {
|
protected abstract handle(options: {
|
||||||
accept: boolean;
|
accept: boolean;
|
||||||
text?: string;
|
text?: string;
|
||||||
}): Promise<void>;
|
}): Promise<void>;
|
||||||
@ -91,7 +91,7 @@ export abstract class Dialog {
|
|||||||
async accept(promptText?: string): Promise<void> {
|
async accept(promptText?: string): Promise<void> {
|
||||||
assert(!this.#handled, 'Cannot accept dialog which is already handled!');
|
assert(!this.#handled, 'Cannot accept dialog which is already handled!');
|
||||||
this.#handled = true;
|
this.#handled = true;
|
||||||
await this.sendCommand({
|
await this.handle({
|
||||||
accept: true,
|
accept: true,
|
||||||
text: promptText,
|
text: promptText,
|
||||||
});
|
});
|
||||||
@ -103,7 +103,7 @@ export abstract class Dialog {
|
|||||||
async dismiss(): Promise<void> {
|
async dismiss(): Promise<void> {
|
||||||
assert(!this.#handled, 'Cannot dismiss dialog which is already handled!');
|
assert(!this.#handled, 'Cannot dismiss dialog which is already handled!');
|
||||||
this.#handled = true;
|
this.#handled = true;
|
||||||
await this.sendCommand({
|
await this.handle({
|
||||||
accept: false,
|
accept: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ export class BidiDialog extends Dialog {
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
override async sendCommand(options: {
|
override async handle(options: {
|
||||||
accept: boolean;
|
accept: boolean;
|
||||||
text?: string;
|
text?: string;
|
||||||
}): Promise<void> {
|
}): Promise<void> {
|
||||||
|
@ -25,7 +25,7 @@ export class CdpDialog extends Dialog {
|
|||||||
this.#client = client;
|
this.#client = client;
|
||||||
}
|
}
|
||||||
|
|
||||||
override async sendCommand(options: {
|
override async handle(options: {
|
||||||
accept: boolean;
|
accept: boolean;
|
||||||
text?: string;
|
text?: string;
|
||||||
}): Promise<void> {
|
}): Promise<void> {
|
||||||
|
Loading…
Reference in New Issue
Block a user