react-native-app-notification
Version:
In-app custom notifications for React-Native
63 lines (62 loc) • 2.24 kB
TypeScript
import React, { Component } from 'react';
import { AppNotificationComponentProps, NotificationOptions, NotificationQueueItem, ShowNotificationOptions } from './types';
declare type Props = AppNotificationComponentProps;
declare type State = {
notificationQueue: NotificationQueueItem[];
};
export declare class AppNotification extends Component<Props, State> {
static DEFAULT_DURATION: number;
static refs: Map<string, AppNotification>;
readonly id: string;
private static readonly _defaultId;
static AnimationWrappers: {
Shrink: React.FunctionComponent<{
duration?: number;
yOffset?: number;
delay?: number;
height?: number;
reversed?: boolean;
children?: JSX.Element;
}>;
SlideUpFadeIn: React.FunctionComponent<{
duration?: number;
yOffset?: number;
delay?: number;
height?: number;
reversed?: boolean;
children?: JSX.Element;
}>;
FadeIn: React.FunctionComponent<{
duration?: number;
yOffset?: number;
delay?: number;
height?: number;
reversed?: boolean;
children?: JSX.Element;
}>;
FadeOut: React.FunctionComponent<{
duration?: number;
yOffset?: number;
delay?: number;
height?: number;
reversed?: boolean;
children?: JSX.Element;
}>;
};
static clear: (id?: string) => void;
private static getRef;
static show: (options: NotificationOptions & ShowNotificationOptions) => void;
constructor(props: Props);
componentWillUnmount(): void;
state: {
notificationQueue: any[];
};
showNotification({ duration, styles, ...notificationOptions }: NotificationOptions & ShowNotificationOptions): void;
clearNotifications: () => void;
animateOutNotification: (id: string) => void;
removeNotification: (id: string) => void;
_onPress: (id: string, callback: () => void) => void;
renderNotification: (notification: NotificationQueueItem) => JSX.Element;
render(): JSX.Element;
}
export default AppNotification;