chowa
Version:
UI component library based on React
60 lines (59 loc) • 1.99 kB
TypeScript
/**
* @license chowa v1.1.3
*
* Copyright (c) Chowa Techonlogies Co.,Ltd.(http://www.chowa.cn).
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';
import * as PropTypes from 'prop-types';
import $notification from './$notification';
export declare type Placement = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
export interface NotificationProps {
className?: string;
style?: React.CSSProperties;
type?: 'info' | 'success' | 'error' | 'warning';
title: string;
content?: React.ReactNode;
closable?: boolean;
delay?: number;
index?: number;
placement?: Placement;
onHide?: (index: number, placement: Placement) => void;
}
export interface NotificationState {
visible: boolean;
}
declare class Notification extends React.PureComponent<NotificationProps, NotificationState> {
static propTypes: {
className: PropTypes.Requireable<string>;
style: PropTypes.Requireable<object>;
type: PropTypes.Requireable<string>;
title: PropTypes.Validator<string>;
content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
closable: PropTypes.Requireable<boolean>;
delay: PropTypes.Requireable<number>;
index: PropTypes.Requireable<number>;
placement: PropTypes.Requireable<string>;
onHide: PropTypes.Requireable<(...args: any[]) => any>;
};
static defaultProps: {
closable: boolean;
delay: number;
placement: string;
};
static $notification: typeof $notification;
private timer;
constructor(props: NotificationProps);
private onMouseEnterHandler;
private onMouseLeaveHandler;
private closeHandler;
private onHideHandler;
private clearCrontab;
private crontab;
componentDidMount(): void;
componentWillUnmount(): void;
render(): JSX.Element;
}
export default Notification;