forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bounce.d.ts
66 lines (53 loc) · 1.67 KB
/
bounce.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
// Type definitions for Bounce.js v0.8.2
// Project: http://github.com/tictail/bounce.js
// Definitions by: Cherry <http://github.com/cherrry>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
declare module 'bounce.js' {
export default Bounce
interface Point2D {
x: number
y: number
}
interface BounceOptions<T> {
from: T
to: T
duration?: number
delay?: number
easing?: string
bounces?: number
stiffness?: number
}
interface AnimationOptions {
loop?: boolean
remove?: boolean
onComplete?: () => void
}
interface SerailizedComponent<T> {
type: string
from: T
to: T
duration: number
delay: number
easing: string
bounces: number
stiffness: number
}
class Bounce {
static FPS: number
static counter: number
static isSupported(): boolean
constructor();
scale(options: BounceOptions<Point2D>): Bounce
rotate(options: BounceOptions<number>): Bounce
translate(options: BounceOptions<Point2D>): Bounce
skew(options: BounceOptions<Point2D>): Bounce
serialize(): SerailizedComponent<number|Point2D>[]
deserialize(serailized: SerailizedComponent<number|Point2D>[]): Bounce
applyTo(element: Element, options?: AnimationOptions): void
applyTo(elements: Element[], options?: AnimationOptions): void
applyTo(elements: JQuery, options?: AnimationOptions): JQueryPromise<void>
define(name: string): Bounce
remove(): void
}
}