forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.blockUI.d.ts
129 lines (102 loc) · 4.04 KB
/
jquery.blockUI.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
// Type definitions for jQuery BlockUI Plugin
// Project: http://malsup.com/jquery/block/
// Definitions by: Jeffrey Lee <http://blog.darkthread.net/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../jquery/jquery.d.ts" />
interface JQBlockUIOptions {
/** message displayed when blocking (use null for no message) */
message?: any;
/** title string; only used when theme == true */
title?: string;
/** only used when theme == true (requires jquery-ui.js to be loaded) */
draggable?: boolean;
/** set to true to use with jQuery UI themes */
theme?: boolean;
/**
* styles for the message when blocking; if you wish to disable
* these and use an external stylesheet then do this in your code:
* $.blockUI.defaults.css = {};
*/
css?: any;
/** minimal style set used when themes are used */
themedCSS?: any;
/** styles for the overlay */
overlayCSS?: any;
/** style to replace wait cursor before unblocking to correct issue of lingering wait cursor */
cursorReset?: string;
/** styles applied when using $.growlUI */
growlCSS?: any;
/** ifreamSrc for IE */
iframeSrc?: string;
/** force usage of iframe in non-IE browsers (handy for blocking applets) */
forceIframe?: boolean;
/** z-index for the blocking overlay */
baseZ?: number;
/** set true to have the message automatically centered for X */
centerX?: boolean;
/** set true to have the message automatically centered for Y */
centerY?: boolean;
/**
* allow body element to be stetched in ie6; this makes blocking look better
* on "short" pages. disable if you wish to prevent changes to the body height
*/
allowBodyStretch?: boolean;
/** enable if you want key and mouse events to be disabled for content that is blocked */
bindEvents?: boolean;
/** be default blockUI will supress tab navigation from leaving blocking content(if bindEvents is true) */
constrainTabKey?: boolean;
/** fadeIn time in millis; set to 0 to disable fadeIn on block */
fadeIn?: number;
/** fadeOut time in millis; set to 0 to disable fadeOut on unblock */
fadeOut?: number;
/** time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock */
timeout?: number;
/** disable if you don't want to show the overlay */
showOverlay?: boolean;
/** if true, focus will be placed in the first available input field when page blocking */
focusInput?: boolean;
/** callback method invoked when fadeIn has completed and blocking message is visible */
onBlock?: () => void;
/**
* callback method invoked when unblocking has completed; the callback is
* passed the element that has been unblocked (which is the window object for page
* blocks) and the options that were passed to the unblock call:
* onUnblock(element, options)
*/
onUnblock?: (element: any, options: any) => void;
// don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
/** quirksmodeOffsetHack */
quirksmodeOffsetHack?: number;
/** class name of the message block */
blockMsgClass?: string;
/** if it is already blocked, then ignore it (don't unblock and reblock) */
ignoreIfBlocked?: boolean;
}
interface JQBlockUIStatic {
/** default options */
defaults?: JQBlockUIOptions;
/** block user activity for the page */
(): void;
/**
* block user activity for the page
* @param options options
*/
(option: JQBlockUIOptions): void;
}
interface JQueryStatic {
/** block user activity for the page */
blockUI?: JQBlockUIStatic;
/** unblock the page */
unblockUI?: JQBlockUIStatic;
}
interface JQuery {
/**
* block the element(s)
* @param options block options
*/
block(option?: JQBlockUIOptions): JQuery;
/**
* unblock the element(s)
*/
unblock(option?: JQBlockUIOptions): JQuery;
}