/** * @file Toast * @description toast提示组件, 单例模式,App级别只需要一个ToastComponent,引入了多个会兼容,也只有第一个生效 * @author fex */ /// import React from 'react'; import { ClassNamesFn, ThemeProps } from '../theme'; import { LocaleProps, TranslateFn } from '../locale'; interface Config { closeButton?: boolean; timeout?: number; } interface ToastComponentProps extends ThemeProps, LocaleProps { position: 'top-right' | 'top-center' | 'top-left' | 'bottom-center' | 'bottom-left' | 'bottom-right'; closeButton: boolean; showIcon?: boolean; timeout: number; className?: string; } interface Item extends Config { title?: string; body: string; level: 'info' | 'success' | 'error' | 'warning'; id: string; onDissmiss?: () => void; position?: 'top-right' | 'top-center' | 'top-left' | 'bottom-center' | 'bottom-left' | 'bottom-right'; } interface ToastComponentState { items: Array; } export declare class ToastComponent extends React.Component { static defaultProps: Pick; static themeKey: string; hasRendered: boolean; state: ToastComponentState; componentDidMount(): void; componentWillUnmount(): void; notifiy(level: string, content: string, title?: string, config?: any): void; success(content: string, title?: string, config?: any): void; error(content: string, title?: string, config?: any): void; info(content: string, title?: string, config?: any): void; warning(content: string, title?: string, config?: any): void; handleDismissed(index: number): void; render(): JSX.Element[] | null; } declare const _default: { new (props: (Pick, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps) | Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void; }; new (props: Pick, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps, context: any): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, "position" | "locale" | "translate" | "timeout" | "closeButton" | "showIcon"> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void; }; displayName: string; contextType: React.Context; ComposedComponent: { new (props: (Pick, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }) | Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): void; }; new (props: Pick, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, context: any): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): void; }; displayName: string; contextType: React.Context; ComposedComponent: typeof ToastComponent; } & import("hoist-non-react-statics").NonReactStatics & { ComposedComponent: typeof ToastComponent; }; } & import("hoist-non-react-statics").NonReactStatics<{ new (props: (Pick, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }) | Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): void; }; new (props: Pick, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, context: any): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): void; }; displayName: string; contextType: React.Context; ComposedComponent: typeof ToastComponent; } & import("hoist-non-react-statics").NonReactStatics & { ComposedComponent: typeof ToastComponent; }, {}> & { ComposedComponent: { new (props: (Pick, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }) | Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): void; }; new (props: Pick, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }, context: any): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, "classPrefix" | "className" | "classnames" | "theme" | "showIcon"> & Partial, "position" | "timeout" | "closeButton">> & Partial, never>> & { locale?: string | undefined; translate?: ((str: string, ...args: any[]) => string) | undefined; }>, nextState: Readonly<{}>, nextContext: any): void; }; displayName: string; contextType: React.Context; ComposedComponent: typeof ToastComponent; } & import("hoist-non-react-statics").NonReactStatics & { ComposedComponent: typeof ToastComponent; }; }; export default _default; interface ToastMessageProps { title?: string; body: string; level: 'info' | 'success' | 'error' | 'warning'; timeout: number; closeButton?: boolean; showIcon?: boolean; position: 'top-right' | 'top-center' | 'top-left' | 'bottom-center' | 'bottom-left' | 'bottom-right'; onDismiss?: () => void; classnames: ClassNamesFn; translate: TranslateFn; allowHtml: boolean; } interface ToastMessageState { visible: boolean; } export declare class ToastMessage extends React.Component { static defaultProps: { timeout: number; classPrefix: string; position: string; allowHtml: boolean; level: string; }; state: { visible: boolean; }; timer: ReturnType; mounted: boolean; componentDidMount(): void; componentWillUnmount(): void; handleMouseEnter(): void; handleMouseLeave(): void; handleEntered(): void; close(): void; render(): JSX.Element; } export declare const toast: { container: any; success: (content: string, title?: string | undefined, conf?: any) => void; error: (content: string, title?: string | undefined, conf?: any) => void; info: (content: string, title?: string | undefined, conf?: any) => void; warning: (content: string, title?: string | undefined, conf?: any) => void; };