import { useA11yDialog } from 'react-a11y-dialog'; import { ModalConfig, UseModalOptions } from './types.js'; export type ModalInstance = ReturnType[0]; export type UseModalReturn = readonly [ModalInstance, ModalConfig]; /** * @example * ```jsx * const heading = "Bekreft sletting"; * const [instance, { title, overlay, container, modal, closeButton }] = useModal({ title: heading }); * * useEffect(() => { * if (!instance) { * return; * } * instance.show(); * }, [instance]); * * return ReactDOM.createPortal( * * * * * {heading} * * * * Er du sikker på at du vil slette Foo Bar Baz? * * * { * // Do the thing * instance?.hide() * }} * > * Bekreft * * instance?.hide()}> * Avbryt * * * * , * document.body, * ); * ``` */ export declare function useModal(props: UseModalOptions): UseModalReturn;