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
|
||||
*/
|
||||
protected abstract sendCommand(options: {
|
||||
protected abstract handle(options: {
|
||||
accept: boolean;
|
||||
text?: string;
|
||||
}): Promise<void>;
|
||||
@ -91,7 +91,7 @@ export abstract class Dialog {
|
||||
async accept(promptText?: string): Promise<void> {
|
||||
assert(!this.#handled, 'Cannot accept dialog which is already handled!');
|
||||
this.#handled = true;
|
||||
await this.sendCommand({
|
||||
await this.handle({
|
||||
accept: true,
|
||||
text: promptText,
|
||||
});
|
||||
@ -103,7 +103,7 @@ export abstract class Dialog {
|
||||
async dismiss(): Promise<void> {
|
||||
assert(!this.#handled, 'Cannot dismiss dialog which is already handled!');
|
||||
this.#handled = true;
|
||||
await this.sendCommand({
|
||||
await this.handle({
|
||||
accept: false,
|
||||
});
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ export class BidiDialog extends Dialog {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
override async sendCommand(options: {
|
||||
override async handle(options: {
|
||||
accept: boolean;
|
||||
text?: string;
|
||||
}): Promise<void> {
|
||||
|
@ -25,7 +25,7 @@ export class CdpDialog extends Dialog {
|
||||
this.#client = client;
|
||||
}
|
||||
|
||||
override async sendCommand(options: {
|
||||
override async handle(options: {
|
||||
accept: boolean;
|
||||
text?: string;
|
||||
}): Promise<void> {
|
||||
|
Loading…
Reference in New Issue
Block a user