import { Component } from 'react'; import type { ReactNode } from 'react'; import type { ButtonColor } from '../Button'; import { ModalProps } from '../Modal'; import type { ModalSize } from '../Modal'; export declare const StyledContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>; export type ConfirmErrorParams = { title?: ReactNode; message?: ReactNode; }; export declare class ConfirmError extends Error { title: ReactNode; errorMessage: ReactNode; constructor({ title, message }: ConfirmErrorParams); } export type ShowConfirmParams = { /** * Размер модального окна */ modalSize?: ModalSize; /** * Заголовок */ title?: string; /** * Текст */ content?: ReactNode; /** * Элемент для монтирования модального окна */ container?: HTMLElement | null; /** * Асинхронная функция подтверждения, может закончиться с исключением ConfirmError({ title, message }) */ approve?: () => void | Promise; /** * Текст кнопки отмены */ cancelButtonText: string; /** * Скрыть кнопку отмены */ hideCancelButton?: boolean; /** * Текст кнопки подтверждения */ approveButtonText: string; /** * Цвет кнопки подтверждения */ approveButtonColor?: ButtonColor; } & Pick; export type ConfirmProps = ShowConfirmParams & { resolveModal: (result: boolean) => void; }; export type ConfirmState = { approving: boolean; error?: { title?: ReactNode; message?: ReactNode; }; }; export declare class Confirm extends Component { constructor(props: ConfirmProps); handleCancel: () => void; handleApprove: () => Promise; render(): ReactNode; } export declare const showConfirm: ({ title, content, container, approve, cancelButtonText, approveButtonText, approveButtonColor, modalSize, isHideOnBackdropClick, hideCancelButton, }: ShowConfirmParams) => Promise;