lole-ui
Version:
React UI Component which like a love letter
30 lines (29 loc) • 1.04 kB
TypeScript
import React from "react";
declare type notificationType = "info" | "success" | "error" | "warning" | "open";
declare type notificationPlacement = "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
export interface NoticeProps {
/** 通知提醒标题,必选 */
message: string;
/** 通知提醒内容,必选 */
description: string;
/** 默认4秒后自动关闭,配置为null则不自动关闭 */
duration?: number;
type?: notificationType;
/** 自定义图标 */
icon?: React.ReactNode;
/** 弹出位置,可选 topLeft topRight bottomLeft bottomRight */
placement?: notificationPlacement;
/** 当通知关闭时触发 */
onClose?: () => any;
className?: string;
style?: React.CSSProperties;
}
export declare type staticMethodsType = {
open: Function;
info: Function;
success: Function;
error: Function;
warning: Function;
};
declare const Notice: React.FC<NoticeProps> & staticMethodsType;
export default Notice;