-
Notifications
You must be signed in to change notification settings - Fork 49
/
jqModal.d.ts
89 lines (88 loc) · 3.77 KB
/
jqModal.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
// Generated by typings
// Source: typings/globals/jqModal/index.d.ts
interface JQueryModalSettings {
/**
* [0-100] Translucency percentage (opacity) of the body covering overlay. Set to 0 for NO overlay, and up to 100 for a 100% opaque overlay.
* @default 50 */
overlay?: number;
/**
* (String) overlayClass - Applied to the body covering overlay. Useful for controlling overlay look (tint, background-image, &c) with CSS.
* @default 'jqmOverlay'*/
overlayClass?: string;
/**
* (String) closeClass - Children of the modal element matching `closeClass` will fire the onHide event (to close the modal).
* @default 'jqmClose' */
closeClass?: string;
/**
* (Mixed) trigger - Matching elements will fire the onShow event (to display the modal). Trigger can be a selector String, a jQuery collection of elements, a DOM element, or a False boolean.
* @default '.jqModal' */
trigger?: any;
/**
* (String) ajax - URL to load content from via an AJAX request. False to disable ajax. If ajax begins with a "@", the URL is extracted from the attribute of the triggering element (e.g. use '@data-url' for; <a href="#" class="jqModal" data-url="modal.html">...)
* @default false */
ajax?: string;
/**
* (Mixed) target - Children of the modal element to load the ajax response into. If false, modal content will be overwritten by ajax response. Useful for retaining modal design.
* @default false */
target?: any;
/** Target may be a selector string, jQuery collection of elements, or a DOM element -- and MUST exist as a child of the modal element. */
/** (String) ajaxText - Text shown while waiting for ajax return. Replaces HTML content of `target` element.
* @default '' */
ajaxText?: string;
/**
* (Boolean) modal - If true, user interactivity will be locked to the modal window until closed.
* @default false*/
modal?: boolean;
/**
* (Boolean) toTop - If true, modal will be posistioned as a first child of the BODY element when opened, and its DOM posistion restored when closed. Useful for overcoming z-Index container issues.
* @default false */
toTop?: boolean;
/**
* (Function) onShow - User defined callback function fired when modal opened.
* @default onShow */
onShow?: any;
/**
* (Function) onHide - User defined callback function fired when modal closed.
* @default onHide */
onHide?: any;
/**
* (Function) onLoad - User defined callback function fired when ajax content loads.
* @default false */
onLoad?: any;
}
interface JQuery {
/**
* Initialize a set of elements as "modals". Modals typically are popup dialogs,
* notices, modal windows, &c.
*
* @name jqm
* @param options user defined options, augments defaults.
* @type jQuery
* @cat Plugins/jqModal
*/
jqm(config: JQueryModalSettings): JQuery;
/**
* Matching modals will have their jqmShow() method fired by attaching a
* onClick event to elements matching `trigger`.
*
* @name jqmAddTrigger
* @param trigger a selector String, jQuery collection of elements, or a DOM element.
*/
jqmAddTrigger(trigger: any);
/**
* Matching modals will have their jqmHide() method fired by attaching an
* onClick event to elements matching `trigger`.
*
* @name jqmAddClose
* @param trigger a selector String, jQuery collection of elements, or a DOM element.
*/
jqmAddClose(trigger: any);
/**
* Open matching modals (if not shown)
*/
jqmShow(trigger?: any): JQuery;
/**
* Close matching modals
*/
jqmHide(trigger?: any): JQuery;
}