@quanxi/ui
Version:
全悉组件库
31 lines (30 loc) • 1.09 kB
TypeScript
import { ReactNode } from "react";
import type { DialogProps } from "rc-dialog";
export type ConfirmModalFuncProps = string | Omit<ConfirmModalProps, "onOk" | "onCancel" | "visible" | "close">;
interface FunctionContentProps {
close: () => void;
}
type FunctionContent = (props: FunctionContentProps) => React.ReactNode;
export interface ConfirmModalProps extends DialogProps {
open?: boolean;
title?: string;
showCancel?: boolean;
icon?: React.ReactNode;
content?: React.ReactNode;
/**
* 当使用命令式调用(函数式调用)如: Modal\['warning'\]({}) 时,
* functionContent 会传出 close 函数,外部组件可以使用该 close 函数控制 Modal 的关闭。
*/
functionContent?: FunctionContent;
okText?: React.ReactNode;
cancelText?: React.ReactNode;
onOk?: () => void;
onCancel?: () => void;
afterClose?: () => void;
closable?: boolean;
close?: () => void;
children?: React.ReactNode;
type?: "info" | "success" | "error" | "warning" | "confirm";
footer?: ReactNode;
}
export {};