import { PopupParams } from './types'; import { Bridge } from '../Bridge'; import { WebApp } from '../WebApp'; import { PopupEventsMap } from './events'; /** * Controls currently displayed application popup. It allows developers to * open new custom popups and detect popup-connected events. */ export declare class Popup { private bridge; private webApp; private ee; private _isOpened; /** * Changes current open state. * * @param value - new open state. * @private */ private set isOpened(value); constructor(bridge: Bridge, webApp: WebApp); /** * Shows whether popup is currently opened. */ get isOpened(): boolean; /** * Adds new event listener. */ on: (event: E, listener: import("twa-core").EventListener) => void; /** * Removes event listener. */ off: (event: E, listener: import("twa-core").EventListener) => void; /** * A method that shows a native popup described by the `params` argument. * Promise will be resolved when popup is closed. Resolved value will have * an identifier of pressed button. * * In case, user clicked outside the popup or clicked top right popup close * button, `null` will be returned. * * FIXME: On desktop, this function may work incorrectly. * Issue: https://github.com/Telegram-Web-Apps/client-sdk/issues/5 * * @param params - popup parameters. * @since Web App version 6.2+ * @see preparePopupParams * @throws {Error} Popup is already opened. */ show(params: PopupParams): Promise; /** * A method that shows message in a simple alert with a 'Close' button. * Promise will be resolved when popup is closed. * * @param message - message to display. * @since Web App version 6.2+ * @see show */ showAlert(message: string): Promise; /** * A method that shows message in a simple confirmation window with `OK` * and `Cancel` buttons. Promise will be resolved when popup is closed. * Resolved value will be `true` in case, user pressed `OK` button. The * result will be `false` otherwise. * * @param message - message to display. * @since Web App version 6.2+ * @see show */ showConfirm(message: string): Promise; }