forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.pnotify.d.ts
180 lines (164 loc) · 4.67 KB
/
jquery.pnotify.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// Type definitions for jquery.pnotify 2.x
// Project: https://github.com/sciactive/pnotify
// Definitions by: David Sichau <https://github.com/DavidSichau>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
interface PNotifyStack {
dir1?: string;
dir2?: string;
push?: string;
spacing1?: number;
spacing2?: number;
context?: JQuery
}
interface PNotifyLabel {
redisplay?: string;
all?: string;
last?: string;
close?: string;
stick?: string;
}
interface PNotifyOptions {
/**
* The notice's title. Either boolean false or string
*/
title?: any;
/**
* Whether to escape the content of the title. (Not allow HTML.)
*/
title_escape?: boolean;
/**
* The notice's text. Either boolean false or string
*/
text?: any;
/**
* Whether to escape the content of the text. (Not allow HTML.)
*/
text_escape?: boolean;
/**
* What styling classes to use. (Can be either jqueryui or bootstrap.)
*/
styling?: string;
/**
* Additional classes to be added to the notice. (For custom styling.)
*/
addclass?: string;
/**
* Class to be added to the notice for corner styling.
*/
cornerclass?: string;
nonblock?: {
/**
* Create a non-blocking notice. It lets the user click elements underneath it.
*/
nonblock: boolean;
/**
* The opacity of the notice (if it's non-blocking) when the mouse is over it.
*/
nonblock_opacity?: number
};
/**
* Display a pull down menu to redisplay previous notices, and place the notice in the history.
*/
history?: boolean;
/**
* Maximum number of notifications to have onscreen.
*/
maxonscreen?: number;
/**
* Display the notice when it is created. Turn this off to add notifications to the history without displaying them.
*/
auto_display?: boolean;
/**
* Width of the notice.
*/
width?: string;
/**
* Minimum height of the notice. It will expand to fit content.
*/
min_height?: string;
/**
* Type of the notice. "notice", "info", "success", or "error".
*/
type?: string;
/**
* Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class.
*/
icon?: any;
/**
* The animation to use when displaying and hiding the notice. "none", "show", "fade", and "slide" are built in to jQuery. Others require jQuery UI. Use an object with effect_in and effect_out to use different effects.
*/
animation?: any;
/**
* Speed at which the notice animates in and out. "slow", "def" or "normal", "fast" or number of milliseconds.
*/
animate_speed?: string;
/**
* Specify a specific duration of position animation
*/
position_animate_speed?: number;
/**
* Opacity of the notice.
*/
opacity?: number;
/**
* Display a drop shadow.
*/
shadow?: boolean;
buttons?: {
/**
* Provide a button for the user to manually close the notice.
*/
closer?: boolean;
/**
* Only show the closer button on hover.
*/
closer_hover?: boolean;
/**
* Provide a button for the user to manually stick the notice.
*/
sticker?: boolean;
/**
* Only show the sticker button on hover.
*/
sticker_hover?: boolean;
}
/**
* After a delay, remove the notice.
*/
hide?: boolean;
/**
* Delay in milliseconds before the notice is removed.
*/
delay?: number;
/**
* Reset the hide timer if the mouse moves over the notice.
*/
mouse_reset?: boolean;
/**
* Remove the notice's elements from the DOM after it is removed.
*/
remove?: boolean;
/**
* Change new lines to br tags.
*/
insert_brs?: boolean;
/**
* The stack on which the notices will be placed. Also controls the direction the notices stack.
*/
stack?: PNotifyStack;
/**
* The various displayed text, helps facilitating internationalization.
*/
labels?: PNotifyLabel;
}
interface PNotify {
elem: JQuery;
update(options?: PNotifyOptions): void;
remove(): void;
}
interface PNotifyConstructor {
new (options?: PNotifyOptions): PNotify;
removeAll(): void;
}
declare var PNotify: PNotifyConstructor;