mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-20 16:14:57 +08:00
Definition file added
This commit is contained in:
89
react-notification-system/react-notification-system.d.ts
vendored
Normal file
89
react-notification-system/react-notification-system.d.ts
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
// Type definitions for React Notification System v0.2.6
|
||||
// Project: https://www.npmjs.com/package/react-notification-system
|
||||
// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>, Deividas Bakanas <https://github.com/DeividasBakanas>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
|
||||
declare module NotificationSystem {
|
||||
|
||||
import React = __React;
|
||||
|
||||
export interface System extends React.Component<any, any> {
|
||||
addNotification(notification: Notification): Notification;
|
||||
removeNotification(notification: Notification): void;
|
||||
removeNotification(uid: string): void;
|
||||
}
|
||||
|
||||
export interface CallBackFunction {
|
||||
(notification: Notification): void;
|
||||
}
|
||||
|
||||
export interface Notification {
|
||||
title?: string;
|
||||
message?: string;
|
||||
level?: string;
|
||||
position?: string;
|
||||
autoDismiss?: number;
|
||||
dismissible?: boolean;
|
||||
action?: ActionObject;
|
||||
onAdd?: CallBackFunction;
|
||||
onRemove?: CallBackFunction;
|
||||
uid?: number | string;
|
||||
}
|
||||
|
||||
export interface ActionObject {
|
||||
label: string;
|
||||
callback?: Function;
|
||||
}
|
||||
|
||||
export interface ContainersStyle {
|
||||
DefaultStyle: React.CSSProperties;
|
||||
tl?: React.CSSProperties;
|
||||
tr?: React.CSSProperties;
|
||||
tc?: React.CSSProperties;
|
||||
bl?: React.CSSProperties;
|
||||
br?: React.CSSProperties;
|
||||
bc?: React.CSSProperties;
|
||||
}
|
||||
|
||||
export interface ItemStyle {
|
||||
DefaultStyle?: React.CSSProperties;
|
||||
success?: React.CSSProperties;
|
||||
error?: React.CSSProperties;
|
||||
warning?: React.CSSProperties;
|
||||
info?: React.CSSProperties;
|
||||
}
|
||||
|
||||
export interface WrapperStyle {
|
||||
DefaultStyle?: React.CSSProperties;
|
||||
}
|
||||
|
||||
export interface Style {
|
||||
Wrapper?: any;
|
||||
Containers?: ContainersStyle;
|
||||
NotificationItem?: ItemStyle;
|
||||
Title?: ItemStyle;
|
||||
MessageWrapper?: WrapperStyle;
|
||||
Dismiss?: ItemStyle;
|
||||
Action?: ItemStyle;
|
||||
ActionWrapper?: WrapperStyle;
|
||||
}
|
||||
|
||||
export interface Attributes {
|
||||
noAnimation?: boolean;
|
||||
ref?: string;
|
||||
style?: Style | boolean;
|
||||
}
|
||||
|
||||
|
||||
export interface Component {
|
||||
(): React.ReactElement<Attributes>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
declare module 'react-notification-system' {
|
||||
var component: NotificationSystem.Component;
|
||||
export = component;
|
||||
}
|
||||
Reference in New Issue
Block a user