@quanxi/ui
Version:
全悉组件库
45 lines (44 loc) • 1.51 kB
TypeScript
import React from "react";
import "./style.scss";
export type MessageProps = {
open: boolean;
content?: string | React.ReactNode;
duration?: number;
type?: "success" | "error" | "warning" | "info" | "loading";
colored?: boolean;
closed?: boolean;
onClose?: () => void;
placement?: "top" | "topLeft" | "topRight" | "bottom" | "bottomLeft" | "bottomRight";
};
export declare function MessageEle(props: MessageProps): JSX.Element;
declare class MessageManager {
private static instance;
private container;
private messageQueue;
private constructor();
static getInstance(): MessageManager;
private createMessage;
private removeMessage;
private renderMessages;
info(content: content, duration?: number, other?: other): string;
success(content: content, duration?: number, other?: other): string;
warning(content: content, duration?: number, other?: other): string;
error(content: content, duration?: number, other?: other): string;
loading(content: string, duration?: number, other?: other): string;
destroy(): void;
}
export type MessageEleProps = {
content: string | React.ReactNode;
duration?: number;
colored?: boolean;
closed?: boolean;
open?: boolean;
type?: "success" | "error" | "warning" | "info" | "loading";
};
export type content = string | React.ReactNode;
export type other = {
colored?: boolean;
closed?: boolean;
};
declare const Message: MessageManager;
export default Message;