/// import { AlertDialogResolveStatus, DialogProps } from './types'; interface DialogApi { open: (dialogProps: DialogProps, params?: DialogApiParams) => Promise; } interface DialogApiParams { cancelToken?: AbortSignal; } /** * @internal Do not use it in your code! */ export declare function AlertDialogApiProvider(props: any): JSX.Element; /** * Hook gives the ability to open `` 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: Test content * }, { * cancelToken: abortDialog.signal * }); * * openedDialog.then(() => console.log('closed')) * * return () => { * abortDialog.abort(); * } * }, []) * * @example opening dialog on Button click. * const alertDialogAPI = useAlertDialogAPI(); * * const onPress = useCallback(() => { * alertDialogAPI.open({...}) * }, []) * * return */ export declare function useAlertDialogAPI(): DialogApi; export {};