console-gui-tools
Version:
A simple library to draw option menu, text popup or other widgets and layout on a Node.js console.
46 lines • 1.37 kB
TypeScript
import ButtonPopup from "./ButtonPopup.js";
/**
* @description The configuration for the ConfirmPopup class.
* @typedef {Object} ConfirmPopupConfig
*
* @prop {string} id - The id of the popup.
* @prop {string} title - The title of the popup.
* @prop {string} [message] - The message of the popup.
*
* @export
* @interface ConfirmPopupConfig
*/
export interface ConfirmPopupConfig {
id: string;
title: string;
message?: string;
}
/**
* @class ConfirmPopup
* @extends ButtonPopup
* @description This class is an overload of ButtonPopup that is used to create a popup with That asks for a confirm [Yes, No].
*
* 
*
* Emits the following events:
* - "confirm" when the user confirm
* - "cancel" when the user cancel
* - "exit" when the user exit
* @param {ConfirmPopupConfig} config - The configuration of the popup.
*
* @example ```ts
* const popup = new ConfirmPopup({
* id: "popup1",
* title: "Are you shure",
* })
* popup.show() // show the popup
* popup.on("confirm", (answer) => {
* console.log(console.log(answer))
* })
* ```
*/
export declare class ConfirmPopup extends ButtonPopup {
constructor(config: ConfirmPopupConfig);
}
export default ConfirmPopup;
//# sourceMappingURL=ConfirmPopup.d.ts.map