UNPKG

react-native-network-toast

Version:
85 lines (84 loc) 2.84 kB
import * as React from 'react'; export interface IncomingArguments { buttonText?: string; buttonStyles?: any; buttonTextStyles?: any; containerStyles?: any; messageStyles?: any; messageText?: string; position?: string; positionOffset?: number; } export interface IMergedProps { [key: string]: any; connected: boolean; setupNetworkRetry: (onRetry: () => any) => any; hideNetworkToast: () => any; } export interface State { connected: boolean; modalVisible: boolean; message: string; buttonText: string; onRetry?: any; positionValue?: any; } export declare const withNetwork: (incomingArgs?: IncomingArguments) => (WrappedComponent: any) => { new (props: any): { unsubscribeNetworkListener: any; state: State; componentDidMount(): void; componentWillUnmount(): void; renderToastMessage(): JSX.Element; render(): JSX.Element; _setOnRetryBtn: (onRetry: () => any) => void; _getModalStatus: () => boolean; _showToast: () => void; _hideToast: () => void; _closeModal: () => void; _handleRetryButton: () => void; _getMessageText: () => string; _getButtonText: () => string; _getContainerStyle: () => { bottom: any; top: any; position: "absolute"; opacity: number; width: string; elevation: number; paddingHorizontal: number; }; _getToastStyles: () => { backgroundColor: string; flexDirection: "row"; justifyContent: "space-between"; alignItems: "center"; padding: number; minHeight: number; }; _getMessageTextStyles: () => { flex: number; fontSize: number; color: string; }; _getButtonStyles: () => { backgroundColor: string; padding: number; }; _getButtonTextStyles: () => { color: string; fontSize: number; fontWeight: "bold"; }; context: any; setState<K extends "connected" | "modalVisible" | "message" | "buttonText" | "onRetry" | "positionValue">(state: State | ((prevState: Readonly<State>, props: Readonly<any>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callBack?: (() => void) | undefined): void; readonly props: Readonly<any> & Readonly<{ children?: React.ReactNode; }>; refs: { [key: string]: React.ReactInstance; }; }; contextType?: React.Context<any> | undefined; };