forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.joyride.d.ts
273 lines (233 loc) · 5.02 KB
/
jquery.joyride.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
// Type definitions for jQuery JoyRide Plugin 2.1
// Project: https://github.com/zurb/joyride
// Definitions by: Vincent Bortone <https://github.com/vbortone/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/**
* HTML segments for tip layout
*/
interface JoyrideTemplate {
/**
* Link template
* @member {string}
*/
link?: string;
/**
* Timer template
* @member {string}
*/
timer?: string;
/**
* Tip template
* @member {string}
*/
tip?: string;
/**
* Wrapper template
* @member {string}
*/
wrapper?: string;
/**
* Button template
* @member {string}
*/
button?: string;
/**
* Modal template
* @member {string}
*/
modal?: string;
/**
* Exposed Cover template
* @member {string}
*/
exposeCover?: string;
}
interface JoyrideOptions {
/**
* Version
* @member {string}
*/
version?: string;
/**
* 'top' or 'bottom' in relation to parent
* @member {string}
*/
tipLocation?: string;
/**
* override on a per tooltip bases
* @member {any}
*/
nubPosition?: any;
/**
* whether to scroll to tips
* @member {boolean}
*/
scroll?: boolean;
/**
* Page scrolling speed in ms
* @member {number}
*/
scrollSpeed?: number;
/**
* 0 = off, all other numbers = time(ms)
* @member {number}
*/
timer?: number;
/**
* true or false - false tour starts when restart called
* @member {boolean}
*/
autoStart?: boolean;
/**
* true/false to start timer on first click
* @member {boolean}
*/
startTimerOnClick?: boolean;
/**
* the index of the tooltip you want to start on (index of the li)
* @member {number}
*/
startOffset?: number;
/**
* true/false for next button visibility
* @member {boolean}
*/
nextButton?: boolean;
/**
* 'pop' or 'fade' in each tip
* @member {string}
*/
tipAnimation?: string;
/**
* array of indexes where to pause the tour after
* @member {any[]}
*/
pauseAfter?: any[];
/**
* if 'fade'- speed in ms of transition
* @member {number}
*/
tipAnimationFadeSpeed?: number;
/**
* true/false for whether cookies are used
* @member {boolean}
*/
cookieMonster?: boolean;
/**
* choose your own cookie name
* member {string}
*/
cookieName?: string;
/**
* Will this cookie be attached to a domain, ie. '.notableapp.com'
* @member {any}
*/
cookieDomain?: any;
/**
* Set to '/' if you want the cookie for the whole website
* @member {any}
*/
cookiePath?: any;
/**
* true or false to control whether localstorage is used
* @member {boolean}
*/
localStorage?: boolean;
/**
* Keyname in localstorage
@member {string}
*/
localStorageKey?: string;
/**
* Where the tip be attached if not inline
* @member {HTMLElement}
*/
tipContainer?: HTMLElement;
/**
* Whether to cover page with modal during the tour
* @member {boolean}
*/
modal?: boolean;
/**
* Whether to expose the elements at each step in the tour (requires modal:true)
* @member {boolean}
*/
expose?: boolean;
/**
* A method to call after an element has been exposed
* @method
* @param {number} index Tip Index
* @param {JQuery} nextTip Tip object
* @param {JQuery} el Element
*/
postExposeCallback?: (index: number, nextTip: JQuery, el?: JQuery) => void;
/**
* A method to call before the tour starts (passed index, tip, and cloned exposed element)
* @method
* @param {number} index Current Tip Index
* @param {JQuery} currentTip Current Tip object
* @param {JQuery} el Element
*/
preRideCallback?: (index: number, currentTip: JQuery, el?: JQuery) => void;
/**
* a method to call once the tour closes
* @method
* @param {number} index Current Tip Index
* @param {JQuery} currentTip Current Tip object
* @param {boolean} isAborted Is Aborted?
*/
postRideCallback?: (index: number, currentTip: JQuery, isAborted?: boolean) => void;
/**
* A method to call after each step
* @method
* @param {number} index Current Tip Index
* @param {JQuery} currentTip Current Tip object
* @param {boolean} isAborted Is Aborted?
*/
postStepCallback?: (index: number, currentTip: JQuery, isAborted?: boolean) => void;
/**
* A method to call before each step
* @method
* @param {number} index Tip Index
* @param {JQuery} nextTip Tip object
* @param {JQuery} el Element
*/
preStepCallback?: (index: number, nextTip: JQuery, el?: JQuery) => void;
/**
* HTML segments for tip layout
* @member {JoyrideTemplate}
*/
template?: JoyrideTemplate;
}
interface Joyride
{
/**
* Default function, no options
* @method
* @return {JQuery} JQuery instance
*/
(): JQuery;
/**
* Function with options
* @method
* @param {JoyrideOptions} options An object with all the joyride options you want to overwrite.
* @return {JQuery} JQuery instance
*/
(options: JoyrideOptions): JQuery;
/**
* Function with method name and params
* @method
* @param {string} methodName Name of method to call.
* @param {any[]} params parameters for method
* @return {JQuery} JQuery instance
*/
(methodName: string, ...params: any[]): JQuery;
}
interface JQuery {
/**
* joyride function
* @return {Joyride} Joyride instance.
*/
joyride: Joyride;
}