import { default as React } from 'react'; import { BlockerFunction, Location } from 'react-router'; import { default as useConfirm } from './hooks/use-confirm'; import { default as usePrompt } from './hooks/use-prompt'; type ReactRouterPromptProps = { when: boolean | BlockerFunction; children: (data: { isActive: boolean; onCancel: () => void; onConfirm: () => void; nextLocation?: Location; }) => React.ReactNode; beforeCancel?: () => Promise; beforeConfirm?: (nextLocation?: Location) => Promise; }; /** * A replacement component for the react-router `Prompt`. * Allows for more flexible dialogs. * * @example * * {({isActive, onConfirm, onCancel}) => ( * *
*

Do you really want to leave?

* * *
*
* )} *
*/ declare function ReactRouterPrompt({ when, children, beforeCancel, beforeConfirm, }: ReactRouterPromptProps): import("react/jsx-runtime").JSX.Element; export { useConfirm, usePrompt }; export default ReactRouterPrompt;