UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

15 lines (14 loc) 654 B
import { ConfirmationDialogProps } from "./ConfirmationDialog.js"; import React from "react"; //#region src/ConfirmationDialog/useConfirm.d.ts type ConfirmOptions = Omit<ConfirmationDialogProps, 'onClose'> & { content: React.ReactNode; }; /** * This hook takes no parameters and returns an `async` function, `confirm`. When `confirm` * is called, it shows the confirmation dialog. When the dialog is dismissed, a promise is * resolved with `true` or `false` depending on whether or not the confirm button was used. */ declare function useConfirm(): (options: ConfirmOptions) => Promise<boolean>; //#endregion export { ConfirmOptions, useConfirm };