UNPKG

@salvoravida/reapop

Version:

A simple & customizable notifications system for React

15 lines (14 loc) 891 B
/// <reference types="react" /> import { Notification, Status } from '../reducers/notifications/types'; declare function upsertNotification(notification: Partial<Notification>): Notification; declare function upsertNotification(message: string, options?: Partial<Notification>): Notification; declare function upsertNotification(message: string, status: Status, options?: Partial<Notification>): Notification; declare function upsertNotification(...args: [Partial<Notification> | string, (Partial<Notification> | Status)?, Partial<Notification>?]): Notification; export declare type NotificationsContext = { notifications: Notification[]; notify: typeof upsertNotification; dismissNotification: (id: string) => void; dismissNotifications: () => void; }; export declare const ReapopNotificationsContext: import("react").Context<NotificationsContext>; export {};