reapop
Version:
A simple & customizable notifications system for React
22 lines (21 loc) • 1.18 kB
TypeScript
import { NotificationAction } from './constants';
import { Notification, Status } from './types';
export declare type UpsertNotificationAction = {
type: NotificationAction.UpsertNotification;
payload: Notification;
};
export declare type DismissNotificationAction = {
type: NotificationAction.DismissNotification;
payload: string;
};
export declare type DismissNotificationsAction = {
type: NotificationAction.DismissNotifications;
};
declare function upsertNotification(notification: Partial<Notification>): UpsertNotificationAction;
declare function upsertNotification(message: string, options?: Partial<Notification>): UpsertNotificationAction;
declare function upsertNotification(message: string, status: Status, options?: Partial<Notification>): UpsertNotificationAction;
export declare const dismissNotification: (notificationId: string) => DismissNotificationAction;
export declare const dismissNotifications: () => DismissNotificationsAction;
export declare const notify: typeof upsertNotification;
export declare type NotificationActions = UpsertNotificationAction | DismissNotificationAction | DismissNotificationsAction;
export {};