Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added type definitions for bootstrap-notify

  • Loading branch information...
commit 6bb759b3602ab625b5d60f22ce46532d59644023 1 parent 8cfe8c7
@niemyjski niemyjski authored
Showing with 69 additions and 0 deletions.
  1. +1 −0  README.md
  2. +68 −0 bootstrap-notify/bootstrap-notify.d.ts
View
1  README.md
@@ -33,6 +33,7 @@ List of Definitions
* [Backbone.js](http://backbonejs.org/) (by [Boris Yankov](https://github.com/borisyankov))
* [Bootbox](https://github.com/makeusabrew/bootbox) (by [Vincent Bortone](https://github.com/vbortone/))
* [Bootstrap](http://twitter.github.com/bootstrap/) (by [Boris Yankov](https://github.com/borisyankov))
+* [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) (by [Blake Niemyjski](https://github.com/niemyjski))
* [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) (by [Boris Yankov](https://github.com/borisyankov))
* [Box2DWeb](http://code.google.com/p/box2dweb/) (by [Josh Baldwin](https://github.com/jbaldwin/))
* [Breeze](http://www.breezejs.com/) (by [Boris Yankov](https://github.com/borisyankov))
View
68 bootstrap-notify/bootstrap-notify.d.ts
@@ -0,0 +1,68 @@
+// 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
+
+/// <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 {bool} closable
+ */
+ closable?: bool;
+ /**
+ 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;
+}
+
+interface NotifyFadeOutSettings {
+ enabled?: bool;
+ delay?: number;
+}
+
+interface MessageOptions {
+ html?: string;
+ text?: string;
+}
+
+interface Notification {
+ show();
+ hide();
+}
+
+interface JQuery {
+ /**
+ Creates a notification instance with default options.
+ @constructor
+ @param {NotifyOptions} options
+ */
+ notify(options: NotifyOptions): Notification;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.