forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap-notify.d.ts
68 lines (62 loc) · 1.55 KB
/
bootstrap-notify.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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 {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;
}
interface NotifyFadeOutSettings {
enabled?: boolean;
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;
}