forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.scrollTo.d.ts
116 lines (108 loc) · 3.26 KB
/
jquery.scrollTo.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
// Type definitions for jQuery.scrollTo.js 1.4.4
// Project: https://github.com/flesler/jquery.scrollTo
// Definitions by: Neil Stalker <https://github.com/nestalk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
interface ScrollToOptions {
/**
* Which axis must be scrolled, use 'x', 'y', 'xy' or 'yx'.
*/
axis?: string;
/**
* The OVERALL length of the animation.
*/
duration?: any;
/**
* The easing method for the animation.
*/
easing?: string;
/**
* If true, the margin of the target element will be deducted from the final position.
*/
margin?: boolean;
/**
* Add/deduct from the end position.
* One number for both axes or { top:x, left:y }.
*/
offset?: any;
/**
* Add/deduct the height/width multiplied by 'over'.
* Can be { top:x, left:y } when using both axes.
*/
over? : any;
/**
* If true, and both axis are given.
* The 2nd axis will only be animated after the first one ends.
*/
queue?: boolean;
/**
* Function to be called after the scrolling ends.
*/
onAfter?: () => void;
/**
* If queuing is activated, this function will be called after the first scrolling ends.
*/
onAfterFirst?: () => void;
}
interface JQuery {
/**
* Scroll the matched elements
*/
scrollTo: {
/**
* Scroll the matched elements
*
* @param target Where to scroll the matched elements.
* @param duration The OVERALL length of the animation
* @param settings Set of settings.
*/
(target: any, duration?: number, settings?: ScrollToOptions): JQuery;
/**
* Scroll the matched elements
*
* @param target Where to scroll the matched elements.
* @param duration The OVERALL length of the animation
* @param onAfter The onAfter callback.
*/
(target: any, duration: number, onAfter?: Function): JQuery;
/**
* Scroll the matched elements
*
* @param target Where to scroll the matched elements.
* @param settings Set of settings.
* @param onAfter The onAfter callback.
*/
(target: any, settings: ScrollToOptions, onAfter?: Function): JQuery;
};
}
interface JQueryStatic {
/**
* Scroll window
*/
scrollTo: {
/**
* Scroll window
*
* @param target Where to scroll the matched elements.
* @param duration The OVERALL length of the animation
* @param settings Set of settings.
*/
(target: any, duration?: number, settings?: ScrollToOptions): JQuery;
/**
* Scroll window
*
* @param target Where to scroll the matched elements.
* @param duration The OVERALL length of the animation
* @param onAfter The onAfter callback.
*/
(target: any, duration: number, onAfter?: Function): JQuery;
/**
* Scroll window
*
* @param target Where to scroll the matched elements.
* @param settings Set of settings.
* @param onAfter The onAfter callback.
*/
(target: any, settings: ScrollToOptions, onAfter?: Function): JQuery;
};
}