From 0592895e0431d2f290a1330d0d78fd9cb4ece1e7 Mon Sep 17 00:00:00 2001 From: robert-voica Date: Thu, 17 Sep 2015 13:41:05 +0300 Subject: [PATCH 1/5] Updated bootstrap-notify to v3.1.3 --- bootstrap-notify/bootstrap-notify-test.ts | 51 ++++++++++ bootstrap-notify/bootstrap-notify.d.ts | 109 ++++++++++------------ 2 files changed, 101 insertions(+), 59 deletions(-) create mode 100644 bootstrap-notify/bootstrap-notify-test.ts diff --git a/bootstrap-notify/bootstrap-notify-test.ts b/bootstrap-notify/bootstrap-notify-test.ts new file mode 100644 index 000000000..09e1dba1e --- /dev/null +++ b/bootstrap-notify/bootstrap-notify-test.ts @@ -0,0 +1,51 @@ +/// +/// + +//Test for bootstrap-notify v3.1.3 + +$.notify({ + // options + icon: 'glyphicon glyphicon-warning-sign', + title: 'Bootstrap notify', + message: 'Turning standard Bootstrap alerts into "notify" like notifications', + url: 'https://github.com/mouse0270/bootstrap-notify', + target: '_blank' +},{ + // settings + element: 'body', + position: null, + type: "info", + allow_dismiss: true, + newest_on_top: false, + showProgressbar: false, + placement: { + from: "top", + align: "right" + }, + offset: 20, + spacing: 10, + z_index: 1031, + delay: 5000, + timer: 1000, + url_target: '_blank', + mouse_over: null, + animate: { + enter: 'animated fadeInDown', + exit: 'animated fadeOutUp' + }, + onShow: null, + onShown: null, + onClose: null, + onClosed: null, + icon_type: 'class', + template: '' +}); \ No newline at end of file diff --git a/bootstrap-notify/bootstrap-notify.d.ts b/bootstrap-notify/bootstrap-notify.d.ts index 2159aa21a..556bf6137 100644 --- a/bootstrap-notify/bootstrap-notify.d.ts +++ b/bootstrap-notify/bootstrap-notify.d.ts @@ -1,68 +1,59 @@ -// Type definitions for bootstrap-notify -// Project: https://github.com/Nijikokun/bootstrap-notify -// Definitions by: Blake Niemyjski -// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Type definitions for bootstrap-notify v3.1.3 -/// +/// -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; } \ No newline at end of file From 79b6ebd0e9eb25625379fe1e1e19ac939283475d Mon Sep 17 00:00:00 2001 From: robert-voica Date: Thu, 17 Sep 2015 13:55:26 +0300 Subject: [PATCH 2/5] Repaired header --- bootstrap-notify/bootstrap-notify-test.ts | 1 + bootstrap-notify/bootstrap-notify.d.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/bootstrap-notify/bootstrap-notify-test.ts b/bootstrap-notify/bootstrap-notify-test.ts index 09e1dba1e..a71a83557 100644 --- a/bootstrap-notify/bootstrap-notify-test.ts +++ b/bootstrap-notify/bootstrap-notify-test.ts @@ -2,6 +2,7 @@ /// //Test for bootstrap-notify v3.1.3 +//Copied example directly from Bootstrap-notify site $.notify({ // options diff --git a/bootstrap-notify/bootstrap-notify.d.ts b/bootstrap-notify/bootstrap-notify.d.ts index 556bf6137..dc08354d9 100644 --- a/bootstrap-notify/bootstrap-notify.d.ts +++ b/bootstrap-notify/bootstrap-notify.d.ts @@ -1,4 +1,7 @@ // Type definitions for bootstrap-notify v3.1.3 +// Project: http://bootstrap-notify.remabledesigns.com/ +// Definitions by: Robert McIntosh , Robert Voica +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// From 02e0f2fdc7f48c16650196bde8b7c20f737d72ee Mon Sep 17 00:00:00 2001 From: robert-voica Date: Mon, 21 Sep 2015 17:40:37 +0300 Subject: [PATCH 3/5] Resolved problems with interfaces' name and mentioned the original author too --- bootstrap-notify/bootstrap-notify.d.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bootstrap-notify/bootstrap-notify.d.ts b/bootstrap-notify/bootstrap-notify.d.ts index dc08354d9..9962150e5 100644 --- a/bootstrap-notify/bootstrap-notify.d.ts +++ b/bootstrap-notify/bootstrap-notify.d.ts @@ -1,6 +1,8 @@ // Type definitions for bootstrap-notify v3.1.3 // Project: http://bootstrap-notify.remabledesigns.com/ -// Definitions by: Robert McIntosh , Robert Voica +// Definitions by: Blake Niemyjski , +// Robert McIntosh , +// Robert Voica // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -9,14 +11,14 @@ interface JQueryStatic { /* tslint:enable: interface-name */ - notify(message: string): INotifyReturn; - notify(opts: INotifyOptions, settings?: INotifySettings): INotifyReturn; - notifyDefaults(settings: INotifySettings): void; + notify(message: string): NotifyReturn; + notify(opts: NotifyOptions, settings?: NotifySettings): NotifyReturn; + notifyDefaults(settings: NotifySettings): void; notifyClose(): void; notifyClose(command: string): void; } -interface INotifyOptions { +interface NotifyOptions { message: string; title?: string; icon?: string; @@ -24,7 +26,7 @@ interface INotifyOptions { target?: string; } -interface INotifySettings { +interface NotifySettings { element?: string; position?: string; type?: string; @@ -55,7 +57,7 @@ interface INotifySettings { template?: string; } -interface INotifyReturn { +interface NotifyReturn { $ele: JQueryStatic; close: () => void; update: (command: string, update: any) => void; From 2e34170fa74ba6439af996f8a3096fe9aef61fc6 Mon Sep 17 00:00:00 2001 From: robert-voica Date: Mon, 21 Sep 2015 17:44:00 +0300 Subject: [PATCH 4/5] Removed new lines between names --- bootstrap-notify/bootstrap-notify.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bootstrap-notify/bootstrap-notify.d.ts b/bootstrap-notify/bootstrap-notify.d.ts index 9962150e5..39a627d54 100644 --- a/bootstrap-notify/bootstrap-notify.d.ts +++ b/bootstrap-notify/bootstrap-notify.d.ts @@ -1,8 +1,6 @@ // Type definitions for bootstrap-notify v3.1.3 // Project: http://bootstrap-notify.remabledesigns.com/ -// Definitions by: Blake Niemyjski , -// Robert McIntosh , -// Robert Voica +// Definitions by: Blake Niemyjski , Robert McIntosh , Robert Voica // Definitions: https://github.com/borisyankov/DefinitelyTyped /// From 9443438c83b59d29b768e1035e7a2d7275c36f6a Mon Sep 17 00:00:00 2001 From: robert-voica Date: Mon, 21 Sep 2015 17:47:32 +0300 Subject: [PATCH 5/5] Removed tab --- bootstrap-notify/bootstrap-notify.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-notify/bootstrap-notify.d.ts b/bootstrap-notify/bootstrap-notify.d.ts index 39a627d54..52e0cb472 100644 --- a/bootstrap-notify/bootstrap-notify.d.ts +++ b/bootstrap-notify/bootstrap-notify.d.ts @@ -1,6 +1,6 @@ // Type definitions for bootstrap-notify v3.1.3 // Project: http://bootstrap-notify.remabledesigns.com/ -// Definitions by: Blake Niemyjski , Robert McIntosh , Robert Voica +// Definitions by: Blake Niemyjski , Robert McIntosh , Robert Voica // Definitions: https://github.com/borisyankov/DefinitelyTyped ///