shineout
Version:
Shein 前端组件库
34 lines (33 loc) • 1.08 kB
TypeScript
import React from 'react';
import { PureComponent } from '../component';
import { MessageProps } from './Props';
declare type Message = {
id: string;
type: 'success' | 'info' | 'warning' | 'danger';
content: React.ReactNode;
dismiss: boolean;
h: number;
title: string;
top: number;
className: string;
position: string;
hideClose: boolean;
onClose: () => void;
};
interface MessageState {
messages: Message[];
}
declare class Container extends PureComponent<MessageProps, MessageState> {
handleClassName: (position: string | undefined, closeMsg: boolean) => string;
handleStyle: (closeMsg: boolean, h: number, position?: string) => React.CSSProperties | null;
static displayName: string;
constructor(props: MessageProps);
addMessage(msg: {
duration: number;
}): any;
removeMessage(id: string): void;
closeMessageForAnimation(id: string, duration?: number, msgHeight?: number): void;
closeEvent(id: string, duration: number): any;
render(): JSX.Element[][];
}
export default Container;