puppeteer-core
Version:
A high-level API to control headless Chrome over the DevTools Protocol
27 lines • 713 B
JavaScript
/**
* @license
* Copyright 2017 Google Inc.
* SPDX-License-Identifier: Apache-2.0
*/
import { Dialog } from '../api/Dialog.js';
export class BidiDialog extends Dialog {
static from(prompt) {
return new BidiDialog(prompt);
}
#prompt;
constructor(prompt) {
super(prompt.info.type, prompt.info.message, prompt.info.defaultValue);
this.#prompt = prompt;
this.handled = prompt.handled;
prompt.once('handled', () => {
this.handled = true;
});
}
async handle(options) {
await this.#prompt.handle({
accept: options.accept,
userText: options.text,
});
}
}
//# sourceMappingURL=Dialog.js.map