forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
greensock.d.ts
338 lines (309 loc) · 11.9 KB
/
greensock.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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
// Type definitions for GreenSock Animation Platform 1.15.1
// Project: http://www.greensock.com/get-started-js/
// Definitions by: Robert S <https://github.com/codebelt>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// JavaScript Docs http://api.greensock.com/js/
// Version 1.15.1 (TypeScript 1.4)
interface IDispatcher {
addEventListener(type:string, callback:Function, scope?:Object, useParam?:boolean, priority?:number):void;
removeEventListener(type:string, callback:Function):void;
}
declare type Tween = TweenLite | TweenMax;
declare type Timeline = SimpleTimeline | TimelineLite | TimelineMax;
//com.greensock.core
declare class Animation {
static ticker: IDispatcher;
data: any;
timeline: SimpleTimeline;
vars: Object;
constructor(duration?: number, vars?: Object);
delay(): number;
delay(value: number): Animation;
duration(): number;
duration(value: number): Animation;
eventCallback(type: string): Function;
eventCallback(type: string, callback: Function, params?: any[], scope?: any): Animation;
invalidate(): Animation;
isActive(): boolean;
kill(vars?: Object, target?: Object): Animation;
pause(atTime?: any, suppressEvents?: boolean): Animation;
paused(): boolean;
paused(value: boolean): Animation;
play(from?: any, suppressEvents?: boolean): Animation;
progress(): number;
progress(value: number, supressEvents?: boolean): Animation;
restart(includeDelay?: boolean, suppressEvents?: boolean): Animation;
resume(from?: any, suppressEvents?: boolean): Animation;
reverse(from?: any, suppressEvents?: boolean): Animation;
reversed(): boolean;
reversed(value: boolean): Animation;
seek(time: any, suppressEvents?: boolean): Animation;
startTime(): number;
startTime(value: number): Animation;
time(): number;
time(value: number, suppressEvents?: boolean): Animation;
timeScale(): number;
timeScale(value: number): Animation;
totalDuration(): number;
totalDuration(value: number): Animation;
totalProgress(): number;
totalProgress(value: number): Animation;
totalTime(): number;
totalTime(time: number, suppressEvents?: boolean): Animation;
}
declare class SimpleTimeline extends Animation {
autoRemoveChildren: boolean;
smoothChildTiming: boolean;
constructor(vars?: Object);
add(value: any, position?: any, align?: string, stagger?: number): SimpleTimeline;
render(time: number, suppressEvents?: boolean, force?: boolean): void;
}
//com.greensock
declare class TweenLite extends Animation {
static defaultEase: Ease;
static defaultOverwrite: string;
static selector: any;
target: Object;
constructor(target: Object, duration: number, vars: Object);
static delayedCall(delay: number, callback: Function, params?: any[], scope?: any, useFrames?: boolean): TweenLite;
endTime(includeRepeats?: boolean): number;
static from(target: Object | Object[], duration: number, vars: Object): TweenLite;
static fromTo(target: Object | Object[], duration: number, fromVars: Object, toVars: Object): TweenLite;
static getTweensOf(target: Object, onlyActive: boolean): Tween[];
static killDelayedCallsTo(func: Function): void;
static killTweensOf(target: Object, onlyActive?: boolean, vars?: Object): void;
static lagSmoothing(threshold: number, adjustedLag: number): void;
static set(target: Object, vars: Object): TweenLite;
static to(target: Object, duration: number, vars: Object): TweenLite;
}
declare class TweenMax extends TweenLite {
constructor(target: Object, duration: number, vars: Object);
static delayedCall(delay: number, callback: Function, params?: any[], scope?: Object, useFrames?: boolean): TweenMax;
static from(target: Object, duration: number, vars: Object): TweenMax;
static fromTo(target: Object, duration: number, fromVars: Object, toVars: Object): TweenMax;
static getAllTweens(includeTimelines?: boolean): Tween[];
static getTweensOf(target: Object): Tween[];
static isTweening(target: Object): boolean;
static killAll(complete?: boolean, tweens?: boolean, delayedCalls?: boolean, timelines?: boolean): void;
static killChildTweensOf(parent: any, complete?: boolean): void;
static killDelayedCallsTo(func: Function): void;
static killTweensOf(target: Object, vars?: Object): void;
static pauseAll(tweens?: boolean, delayedCalls?: boolean, timelines?: boolean): void;
repeat(): number;
repeat(value: number): TweenMax;
repeatDelay(): number;
repeatDelay(value: number): TweenMax;
static resumeAll(tweens?: boolean, delayedCalls?: boolean, timelines?: boolean): void;
static set(target: Object, vars: Object): TweenMax;
static staggerFrom(targets: any, duration: number, vars: Object, stagger: number, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): any[];
static staggerFromTo(targets: any, duration: number, fromVars: Object, toVars: Object, stagger: number, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): any[];
static staggerTo(targets: any, duration: number, vars: Object, stagger: number, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): any[];
static to(target:Object, duration:number, vars:Object):TweenMax;
updateTo(vars: Object, resetDuration?: boolean): TweenMax;
yoyo(): boolean;
yoyo(value?: boolean): TweenMax;
}
declare class TimelineLite extends SimpleTimeline {
constructor(vars?: Object);
add(value: any, position?: any, align?: string, stagger?: number): TimelineLite;
addLabel(label: string, position: any): TimelineLite;
addPause(position?: any, callback?: Function, params?: any[], scope?: any): TimelineLite;
call(callback: Function, params?: any[], scope?: any, position?: any): TimelineLite;
clear(labels?: boolean): TimelineLite;
endTime(includeRepeats?: boolean): number;
static exportRoot(vars?: Object, omitDelayedCalls?: boolean): TimelineLite;
from(target: Object, duration: number, vars: Object, position?: any): TimelineLite;
fromTo(target: Object, duration: number, fromVars: Object, toVars: Object, position?: any): TimelineLite;
getChildren(nested?: boolean, tweens?: boolean, timelines?: boolean, ignoreBeforeTime?: number): Tween | Timeline[];
getLabelTime(label: string): number;
getTweensOf(target: Object, nested?: boolean): Tween[];
recent(): Animation;
remove(value: any): TimelineLite;
removeLabel(label: string): any;
set(target: Object, vars: Object, position?: any): TimelineLite;
shiftChildren(amount: number, adjustLabels?: boolean, ignoreBeforeTime?: number): TimelineLite;
staggerFrom(targets: any, duration: number, vars: Object, stagger?: number, position?: any, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteScope?: any): TimelineLite;
staggerFromTo(targets: any, duration: number, fromVars: Object, toVars: Object, stagger?: number, position?: any, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): TimelineLite;
staggerTo(targets: any, duration: number, vars: Object, stagger: number, position?: any, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): TimelineLite;
to(target: Object, duration: number, vars: Object, position?: any): TimelineLite;
usesFrames(): boolean;
}
declare class TimelineMax extends TimelineLite {
constructor(vars?: Object);
addCallback(callback: Function, position: any, params?: any[], scope?: any): TimelineMax;
currentLabel(): string;
currentLabel(value: string): TimelineMax;
getActive(nested?: boolean, tweens?: boolean, timelines?: boolean): Tween | Timeline[];
getLabelAfter(time: number): string;
getLabelBefore(time: number): string;
getLabelsArray(): any[];
removeCallback(callback: Function, timeOrLabel?: any): TimelineMax;
repeat(): number;
repeat(value: number): TimelineMax;
repeatDelay(): number;
repeatDelay(value: number): TimelineMax;
tweenFromTo(fromPosition: any, toPosition: any, vars?: Object): TweenLite;
tweenTo(position: any, vars?: Object): TweenLite;
yoyo(): boolean;
yoyo(value: boolean): TimelineMax;
}
//com.greensock.easing
interface Back {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Bounce {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Circ {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Cubic {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Ease {
getRatio(p:number):number;
}
interface EaseLookup {
find(name:string):Ease;
}
interface Elastic {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Expo {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Linear {
ease:Linear;
easeIn:Linear;
easeInOut:Linear;
easeNone:Linear;
easeOut:Linear;
}
interface Power0 {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Power1 {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Power2 {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Power3 {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Power4 {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Quad {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Quart {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Quint {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Sine {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface SlowMo {
ease:SlowMo;
new (linearRatio:number, power:number, yoyoMode:boolean):SlowMo;
config(linearRatio:number, power:number, yoyoMode:boolean):SlowMo;
getRatio(p:number):number;
}
interface SteppedEase {
config(steps:number):SteppedEase;
getRatio(p:number):number;
}
interface Strong {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
//com.greensock.plugins
interface BezierPlugin extends TweenPlugin {
bezierThrough(values:any[], curviness?:number, quadratic?:boolean, correlate?:string, prepend?:Object, calcDifs?:boolean):Object;
cubicToQuadratic(a:number, b:number, c:number, d:number):any[];
quadraticToCubic(a:number, b:number, c:number):Object;
}
interface ColorPropsPlugin extends TweenPlugin {
}
interface CSSPlugin extends TweenPlugin {
}
interface CSSRulePlugin extends TweenPlugin {
getRule(selector:string):Object;
}
interface EaselPlugin extends TweenPlugin {
}
interface RaphaelPlugin extends TweenPlugin {
}
interface RoundPropsPlugin extends TweenPlugin {
}
interface ScrollToPlugin extends TweenPlugin {
}
interface TweenPlugin {
activate(plugins:any[]):boolean;
}
//com.greensock.easing
declare var Back:Back;
declare var Bounce:Bounce;
declare var Circ:Circ;
declare var Cubic:Cubic;
declare var Ease:Ease;
declare var EaseLookup:EaseLookup;
declare var Elastic:Elastic;
declare var Expo:Expo;
declare var Linear:Linear;
declare var Power0:Power0;
declare var Power1:Power1;
declare var Power2:Power2;
declare var Power3:Power3;
declare var Power4:Power4;
declare var Quad:Quad;
declare var Quart:Quart;
declare var Quint:Quint;
declare var Sine:Sine;
declare var SlowMo:SlowMo;
declare var SteppedEase:SteppedEase;
declare var Strong:Strong;
//com.greensock.plugins
declare var BezierPlugin:BezierPlugin;
declare var ColorPropsPlugin:ColorPropsPlugin;
declare var CSSPlugin:CSSPlugin;
declare var CSSRulePlugin:CSSRulePlugin;
declare var EaselPlugin:EaselPlugin;
declare var RaphaelPlugin:RaphaelPlugin;
declare var RoundPropsPlugin:RoundPropsPlugin;
declare var ScrollToPlugin:ScrollToPlugin;
declare var TweenPlugin:TweenPlugin;