Files
DefinitelyTyped/react-notification-system-redux/index.d.ts
Karol Janyst 08c8f92a86 Add definitions for react-notification-system-redux (#13431)
* Add definitions for react-notification-system-redux

* Add semicolor, add missing compiler option
2016-12-28 11:10:10 -05:00

40 lines
1.4 KiB
TypeScript

// Type definitions for react-notification-system-redux 1.0
// Project: https://github.com/gor181/react-notification-system-redux
// Definitions by: Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { Component } from "react";
import { Action } from "redux";
import { Attributes, Notification } from "react-notification-system";
export as namespace Notifications;
export = Notifications;
declare class Notifications extends Component<Notifications.NotificationsProps, any> {}
declare namespace Notifications {
export type NotificationsState = Notification[];
export type NotificationLevel = "error" | "warning" | "info" | "success";
export type NotificationsReducer<A extends Action> = (state: NotificationsState, action: A) => NotificationsState;
export type NotificationShow = (opts?: Notification) => Action;
export interface NotificationsProps extends Attributes {
notifications?: Notification[];
}
export const reducer: NotificationsReducer<any>;
export const show: (opts?: Notification, level?: NotificationLevel) => Action;
export const error: NotificationShow;
export const hide: (opts?: Notification | string | number) => Action;
export const info: NotificationShow;
export const success: NotificationShow;
export const warning: NotificationShow;
}