
import { AlertDialogResolveStatus, DialogProps } from "./types.js";
import "react/jsx-runtime";

//#region src/components/overlays/AlertDialog/AlertDialogApiProvider.d.ts
interface DialogApi {
  open: (dialogProps: DialogProps, params?: DialogApiParams) => Promise<AlertDialogResolveStatus>;
}
interface DialogApiParams {
  cancelToken?: AbortSignal;
}
/**
 * @internal Do not use it in your code!
 */
/**
 * Hook gives the ability to open `<AlertDialog />` imperatively.
 *
 * ***Important*** it's commonly a bad practice when you open multiple dialogs in a row;
 * that means this api will reject all dialogs when there is already open one
 *
 * @example calling in a side effect
 * const alertDialogAPI = useAlertDialogAPI();
 *
 * useEffect(() => {
 *   const abortDialog = new AbortController();
 *   const openedDialog = alertDialogAPI.open({
 *     title: 'Are you sure?',
 *     content: <Paragraph>Test content</Paragraph>
 *   }, {
 *      cancelToken: abortDialog.signal
 *   });
 *
 *   openedDialog
 *     .then((status) => {
 *       // User confirmed or used secondary action
 *       if (status === 'confirm') {
 *         // Handle confirm
 *       } else if (status === 'secondary') {
 *         // Handle secondary action
 *       }
 *     })
 *     .catch(() => {
 *       // User cancelled or dismissed the dialog
 *       // Handle cancel/dismiss
 *     })
 *
 *   return () => {
 *     abortDialog.abort();
 *   }
 * }, [])
 *
 * @example opening dialog on Button click.
 * const alertDialogAPI = useAlertDialogAPI();
 *
 * const onPress = useCallback(() => {
 *   alertDialogAPI.open({...})
 *     .then((status) => {
 *       if (status === 'confirm') {
 *         // Handle confirm
 *       }
 *     })
 *     .catch(() => {
 *       // Handle cancel/dismiss
 *     })
 * }, [])
 *
 * return <Button onPress={onPress}>New issue</Button>
 */
declare function useAlertDialogAPI(): DialogApi;
//#endregion
export { useAlertDialogAPI };
//# sourceMappingURL=AlertDialogApiProvider.d.ts.map