UNPKG

react-native-alert-notification

Version:
52 lines (51 loc) 1.26 kB
import * as React from 'react'; import { StyleProp, TextStyle } from 'react-native'; import { ALERT_TYPE } from '../config'; export declare type IConfigToast = { autoClose?: number | boolean; type?: ALERT_TYPE; title?: string; textBody?: string; titleStyle?: StyleProp<TextStyle>; textBodyStyle?: StyleProp<TextStyle>; onPress?: () => void; onShow?: () => void; onHide?: () => void; }; declare type IProps = { isDark: boolean; config?: Pick<IConfigToast, 'autoClose' | 'titleStyle' | 'textBodyStyle'>; }; declare type IState = { overlayClose?: boolean; data: null | (IConfigToast & { timeout: number; }); }; export declare class Toast extends React.Component<IProps, IState> { /** * @type {React.RefObject<Toast>} */ static instance: React.RefObject<Toast>; /** * @param {IConfigToast} args */ static show: (args: IConfigToast) => void; /** * */ static hide: () => void; constructor(props: IProps); /** * @param {IConfigToast} args * @return {Promise<void>} */ private _open; /** * @return {Promise<void>} */ private _close; private _closedHandler; render(): JSX.Element | null; } export {};