UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

37 lines (36 loc) 2.09 kB
import type { RefObject } from 'react'; import type { DialogDomRef, DialogPropTypes, MenuDomRef, MenuPropTypes, PopoverDomRef, PopoverPropTypes, ResponsivePopoverDomRef, ResponsivePopoverPropTypes, ToastDomRef, ToastPropTypes } from '../../webComponents/index.js'; import type { MessageBoxPropTypes } from '../MessageBox/index.js'; type ModalReturnType<DomRef> = { ref: RefObject<DomRef>; }; type ClosableModalReturnType<DomRef> = ModalReturnType<DomRef> & { close: () => void; }; declare function showDialogFn(props: DialogPropTypes, container?: Element | DocumentFragment): ClosableModalReturnType<DialogDomRef>; declare function showPopoverFn(props: PopoverPropTypes, container?: Element | DocumentFragment): ClosableModalReturnType<PopoverDomRef>; declare function showResponsivePopoverFn(props: ResponsivePopoverPropTypes, container?: Element | DocumentFragment): ClosableModalReturnType<ResponsivePopoverDomRef>; declare function showMenuFn(props: MenuPropTypes, container?: Element | DocumentFragment): ClosableModalReturnType<MenuDomRef>; declare function showMessageBoxFn(props: MessageBoxPropTypes, container?: Element | DocumentFragment): ClosableModalReturnType<DialogDomRef>; declare function showToastFn(props: ToastPropTypes, container?: Element | DocumentFragment): ModalReturnType<ToastDomRef>; /** * Utility class for opening modals in an imperative way. * * These static helper methods might be useful for showing e.g. Toasts or MessageBoxes after successful or failed * network calls. * * **In order to use these helpers, please make sure to render the `Modals` component somewhere in your application tree.** * * @since 0.22.2 */ export declare function Modals(): import("react/jsx-runtime").JSX.Element; export declare namespace Modals { var displayName: string; var showDialog: typeof showDialogFn; var showPopover: typeof showPopoverFn; var showResponsivePopover: typeof showResponsivePopoverFn; var showMenu: typeof showMenuFn; var showMessageBox: typeof showMessageBoxFn; var showToast: typeof showToastFn; } export {};