test-nut-ui
Version:
<p align="center"> <img alt="logo" src="https://img11.360buyimg.com/imagetools/jfs/t1/211965/25/7152/22022/61b16785E433119bb/aa41d7a9f7e823f3.png" width="150" style="margin-bottom: 10px;"> </p>
46 lines (45 loc) • 1.48 kB
TypeScript
import { ReactNode, ForwardRefExoticComponent, PropsWithChildren, CSSProperties } from 'react';
export type DialogConfigType = {
prefixCls?: string;
simple?: boolean;
};
export interface BasicDialogProps {
visible?: boolean;
title?: ReactNode;
content?: ReactNode;
footer?: ReactNode;
confirmText?: ReactNode;
cancelText?: ReactNode;
overlay?: boolean;
hideConfirmButton?: boolean;
hideCancelButton?: boolean;
disableConfirmButton?: boolean;
closeOnOverlayClick?: boolean;
footerDirection?: string;
lockScroll?: boolean;
buttonType?: 'normal' | 'round';
style?: CSSProperties;
beforeClose?: () => boolean;
beforeCancel?: () => boolean;
onClose?: () => void;
onConfirm?: (e?: MouseEvent) => Promise<() => void> | void;
onCancel?: () => void;
onClick?: () => void;
}
export type DialogReturnProps = {
update: (newConfig: ConfirmProps) => void;
close: () => void;
};
export interface ConfirmProps extends BasicDialogProps {
content?: ReactNode;
icon?: ReactNode | null;
isNotice?: boolean;
noticeType?: string;
}
export interface DialogComponent extends ForwardRefExoticComponent<PropsWithChildren<BasicDialogProps>> {
confirm: (props: ConfirmProps) => DialogReturnProps;
alert: (props: ConfirmProps) => DialogReturnProps;
config: (config: DialogConfigType) => void;
destroyAll: () => void;
}
export declare const destroyList: Array<() => void>;