UNPKG

@aliretail/react-materials-components

Version:
16 lines (15 loc) 793 B
import * as React from 'react'; import { QuickShowConfig } from '@alifd/next/types/dialog'; declare type MapPropsToDialogConfig<T> = (props: T) => QuickShowConfig; export declare type DialogConfirmCommonProps<T> = T & { /** 点击确认键接口成功之后调用 */ onConfirmSuccess?: () => void; /** 点击确认键接口失败之后调用 */ onConfirmFailed?: (result: any) => void; }; export interface DialogConfirmOptions { /** 打开弹窗的类型,confirm、alert 默认confirm */ type?: 'confirm' | 'alert'; } declare const withConfirmDialog: <Props extends object>(mapPropsToDialogConfig: MapPropsToDialogConfig<DialogConfirmCommonProps<Props>>, options?: DialogConfirmOptions) => React.FC<DialogConfirmCommonProps<Props>>; export default withConfirmDialog;