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>
35 lines (34 loc) • 1.2 kB
TypeScript
import * as React from 'react';
import { BasicComponent } from '../../utils/typings';
import '@nascent/nutui-icons-react/lib/style.css';
export interface NotificationProps extends BasicComponent {
id?: string;
icon: 'success' | 'fail' | 'loading' | 'warn' | React.ReactNode;
iconPosition?: 'top' | 'left';
content: string | React.ReactNode;
duration: number;
position?: 'top' | 'center' | 'bottom';
title: string;
size: string | number;
closeOnOverlayClick: boolean;
lockScroll: boolean;
contentClassName?: string;
contentStyle?: React.CSSProperties;
onClose: () => void;
}
export interface NotificationState {
show: boolean;
}
export default class Notification extends React.PureComponent<NotificationProps, NotificationState> {
static newInstance: (properties: NotificationProps, callback: any) => void;
private closeTimer;
constructor(props: NotificationProps);
close(): void;
startCloseTimer(): void;
clearCloseTimer(): void;
clickCover(): void;
renderIcon(): number | boolean | JSX.Element | React.ReactFragment;
componentDidMount(): void;
componentWillUnmount(): void;
render(): JSX.Element;
}