refactor: rename Dialog.sendCommand to Dialog.handle (#11650)

This commit is contained in:
jrandolf 2024-01-08 19:05:19 +01:00 committed by GitHub
parent 0dcdb89c57
commit cf16cb49c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -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,
});
}

View File

@ -32,7 +32,7 @@ export class BidiDialog extends Dialog {
/**
* @internal
*/
override async sendCommand(options: {
override async handle(options: {
accept: boolean;
text?: string;
}): Promise<void> {

View File

@ -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> {