forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.cycle2.d.ts
144 lines (134 loc) · 6.9 KB
/
jquery.cycle2.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
// Type definitions for jQuery Cycle2 version 2.1.2 (build 20140216)
// Project: http://jquery.malsup.com/cycle2/
// https://github.com/malsup/cycle2
// Definitions by: Donny Nadolny <https://github.com/dnadolny/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
interface JQuery {
cycle: JQueryCycle2.Cycle2;
on(methodName: 'cycle-after', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState, outgoingSlideEl: Element, incomingSlideEl: Element, forwardFlag: boolean) => void): JQuery;
on(methodName: 'cycle-before', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState, outgoingSlideEl: Element, incomingSlideEl: Element, forwardFlag: boolean) => void): JQuery;
on(methodName: 'cycle-bootstrap', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState, API: JQueryCycle2.API) => void): JQuery;
on(methodName: 'cycle-destroyed', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState) => void): JQuery;
on(methodName: 'cycle-finished', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState) => void): JQuery;
on(methodName: 'cycle-initialized', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState) => void): JQuery;
on(methodName: 'cycle-next', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState) => void): JQuery;
on(methodName: 'cycle-pager-activated', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState) => void): JQuery;
on(methodName: 'cycle-paused', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState) => void): JQuery;
on(methodName: 'cycle-post-initialize', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState) => void): JQuery;
on(methodName: 'cycle-pre-initialize', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState) => void): JQuery;
on(methodName: 'cycle-prev', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState) => void): JQuery;
on(methodName: 'cycle-resumed', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState) => void): JQuery;
on(methodName: 'cycle-slide-added', callback: (event: JQueryEventObject, jQueryWrappedSlideEl: JQuery) => void): JQuery;
on(methodName: 'cycle-slide-removed', callback: (event: JQueryEventObject, indexOfSlideRemoved: number, removedSlideEl: Element) => void): JQuery;
on(methodName: 'cycle-stopped', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState) => void): JQuery;
on(methodName: 'cycle-transition-stopped', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState) => void): JQuery;
on(methodName: 'cycle-update-view', callback: (event: JQueryEventObject, optionHash: JQueryCycle2.OptionsWithState, slideOptionsHash: JQueryCycle2.OptionsWithState, currentSlideEl: Element) => void): JQuery;
}
declare module JQueryCycle2 {
interface Cycle2 {
(options?: Options): JQuery;
(methodName: 'add', newSlide: any): JQuery; // string or JQuery
(methodName: 'destroy'): JQuery;
(methodName: 'goto', index: number): JQuery;
(methodName: 'next'): JQuery;
(methodName: 'pause'): JQuery;
(methodName: 'prev'): JQuery;
(methodName: 'reinit'): JQuery;
(methodName: 'remove', index: number): JQuery;
(methodName: 'resume'): JQuery;
(methodName: 'stop'): JQuery;
(methodNameDontCallMe: string, arg1DontCallMe: any, arg2DontCallMe: any): JQuery; // catch-all, shouldn't ever be called though
}
interface Options {
allowWrap?: boolean;
autoHeight?: any; // number or string
autoSelector?: string;
caption?: string;
captionTemplate?: string;
continueAuto?: boolean;
delay?: number;
disabledClass?: string;
easing?: string;
fx?: string;
hideNonActive?: boolean;
loader?: any; // boolean or 'wait'
log?: boolean;
loop?: number;
manualSpeed?: number;
manualTrump?: boolean;
next?: string;
nextEvent?: string;
overlay?: string;
overlayTemplate?: string;
pager?: string;
pagerActivateClass?: string;
pagerEvent?: string;
pagerTemplate?: string;
pauseOnHover?: any; // boolean or string
paused?: boolean;
prev?: string;
prevEvent?: string;
progressive?: string;
random?: boolean;
reverse?: boolean;
slideActiveClass?: string;
slideCss?: any;
slideClass?: string;
slides?: string;
speed?: number;
startingSlide?: number;
swipe?: boolean;
sync?: boolean;
timeout?: number;
tmplRegex?: string;
updateView?: number;
}
interface OptionsWithState extends Options {
busy: boolean;
currSlide: number;
nextSlide: number;
paused: boolean;
slideNum: number;
slideCount: number;
}
interface API {
add(slides: any, prepend?: boolean): void; // string or array or JQuery
addInitialSlides(): void;
advanceSlide(numberOfOpositions: number): boolean; // always false
buildPagerLink(slideOptionHash: Options, slide: any /*not sure*/): void;
buildSlideOpts(slide: any /*not sure*/): Options;
calcFirstSlide(): void;
calcNextSlide(): void;
calcTx(slideOptions: Options, manual: boolean): Transition;
destroy(): void;
doTransition(slideOptions: Options, currEl: Element, nextEl: Element, fwdFlag: boolean, callback: Function): void;
getComponent(nameOfComponent: string): JQuery;
getSlideIndex(slideElement: Element): number;
getSlideOpts(slideIndex: number): Options;
goto(index: number): void;
initSlide(slideOptions: Options, slide: any /*not sure*/, suggestedZindex: number): void;
initSlideshow(): void;
log(...args: any[]): void;
next(): void;
page(pagerEl: Element, targetEl: Element): void;
pause(): void;
postInitSlideshow(): void;
preInitSlideshow(): void;
prepareTx(manualFlag: boolean, fwdFlag: boolean): void;
prev(): void;
queueTransition(slideOptions: Options): void;
reinit(): void;
remove(slideIndexToRemove: number): void;
resume(): void;
stackSlides(currEl: Element, nextEl: Element, fwdFlag: boolean): void;
stop(): void;
stopTransition(): void;
tmpl(templateString: string, optionHash: Options, slideEl: Element): void;
trigger(eventName: String, ...args: any[]): void;
updateView(): void;
}
interface Transition {
before(opts: Options, curr: Element, next: Element, fwd: boolean): void;
}
}