import redux, { AnyAction } from 'redux'; export interface ComponentState { options: ListenOptions; notifications: Notification[]; } export interface NotificationsState { subscribers: { [componentId: string]: ComponentState; }; } export interface Notification { key: string; message: string; trigger: AnyAction; } export interface ListeningTo { hideAfter?: number | null; defaultMessage?: string | null; showDismiss: boolean; } export declare const LISTEN_TO = "notifications/listenTo"; export declare const STOP_LISTEN = "notifications/stopListen"; export declare const SHOW_NOTIFICATION = "notification/showNotification"; export declare const HIDE_NOTIFICATION = "notification/hideNotification"; export interface ListenOptions { componentId: string; triggeredBy: string[]; hideAfter: number | undefined; defaultMessage: string | undefined; } export declare function listen(options: ListenOptions): ListenToAction; export declare function unlisten(componentId: string): StopListenAction; export declare function hide(componentId: string, key: string): HideNotificationAction; export declare function createMiddleware(key: string): redux.Middleware; export declare const middleware: redux.Middleware; export interface ListenToAction { type: typeof LISTEN_TO; options: ListenOptions; } export interface StopListenAction { type: typeof STOP_LISTEN; componentId: string; } export interface ShowNotificationAction { type: typeof SHOW_NOTIFICATION; componentId: string; notification: Notification; } export interface HideNotificationAction { type: typeof HIDE_NOTIFICATION; componentId?: string; notificationKey: string; } export declare type NotificationActions = ListenToAction | StopListenAction | ShowNotificationAction | HideNotificationAction; declare const reducer: redux.Reducer; export default reducer;