UNPKG

@onesy/ui-react

Version:
36 lines (35 loc) 986 B
import React from 'react'; import { TMethod } from '@onesy/utils'; import { IBaseElement } from '../types'; export declare type IConfirmOpen = { modal?: (promise: IConfirmPromiseArgument) => React.ReactElement; name?: string | boolean | React.ReactElement; description?: string | React.ReactElement; buttons?: { positive?: { text?: string; }; negative?: { text?: string; }; }; throwError?: boolean; ButtonNegativeProps?: any; ButtonPositiveProps?: any; [p: string]: any; }; export declare type IConfirmPromiseArgument = { resolve: TMethod; reject: TMethod; }; export declare type IConfirmValue = { open: (value?: IConfirmOpen) => Promise<any>; close: (confirmed?: boolean) => void; }; export declare type IConfirm = IBaseElement & { throwError?: boolean; onOpen?: () => any; onClose?: () => any; }; declare const Confirm: React.FC<IConfirm>; export default Confirm;