Updated bootstrap-notify to v3.1.3

This commit is contained in:
robert-voica
2015-09-17 13:41:05 +03:00
parent 4356af494c
commit 0592895e04
2 changed files with 101 additions and 59 deletions
+50 -59
View File
@@ -1,68 +1,59 @@
// Type definitions for bootstrap-notify
// Project: https://github.com/Nijikokun/bootstrap-notify
// Definitions by: Blake Niemyjski <https://github.com/niemyjski/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Type definitions for bootstrap-notify v3.1.3
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="../jquery/jquery.d.ts" />
interface NotifyOptions {
/**
Alert style, omit alert- from style name.
@param {string} type
*/
type?: string;
/**
Allow alert to be closable through a close icon.
@param {boolean} closable
*/
closable?: boolean;
/**
Alert transition, pretty sure only fade is supported, you can try others if you wish.
@param {string} transition
*/
transition?: string;
/**
Fade alert out after a certain delay (in ms)
@param {string} fadeOut
*/
fadeOut?: NotifyFadeOutSettings;
/**
Text to show on alert, you can use either html or text. HTML will override text.
@param {MessageOptions} message
*/
message?: MessageOptions;
/**
Called before alert closes.
@param {function} onClose
*/
onClose?: () => void;
/**
Called after alert closes.
@param {function} onClosed
*/
onClosed?: () => void;
/* tslint:disable: interface-name no-any */
interface JQueryStatic {
/* tslint:enable: interface-name */
notify(message: string): INotifyReturn;
notify(opts: INotifyOptions, settings?: INotifySettings): INotifyReturn;
notifyDefaults(settings: INotifySettings): void;
notifyClose(): void;
notifyClose(command: string): void;
}
interface NotifyFadeOutSettings {
enabled?: boolean;
delay?: number;
interface INotifyOptions {
message: string;
title?: string;
icon?: string;
url?: string;
target?: string;
}
interface MessageOptions {
html?: string;
text?: string;
interface INotifySettings {
element?: string;
position?: string;
type?: string;
allow_dismiss?: boolean;
allow_duplicates?: boolean;
newest_on_top?: boolean;
showProgressbar?: boolean;
placement?: {
from?: string;
align?: string;
};
offset?: number;
spacing?: number;
z_index?: number;
delay?: number;
timer?: number;
url_target?: string;
mouse_over?: string;
animate?: {
enter?: string;
exit?: string;
};
onShow?: () => void;
onShown?: () => void;
onClose?: () => void;
onClosed?: () => void;
icon_type?: string;
template?: string;
}
interface Notification {
show();
hide();
}
interface JQuery {
/**
Creates a notification instance with default options.
@constructor
@param {NotifyOptions} options
*/
notify(options: NotifyOptions): Notification;
interface INotifyReturn {
$ele: JQueryStatic;
close: () => void;
update: (command: string, update: any) => void;
}