forked from michaelvillar/dynamics.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dynamic.d.ts
66 lines (49 loc) · 1.52 KB
/
dynamic.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
namespace dynamics {
type Type =
| typeof spring
| typeof linear
| typeof gravity
| typeof easeIn
| typeof easeInOut
| typeof easeOut
| typeof bounce
| typeof bezier
| typeof forceWithGravity;
interface Options<P, T> {
duration?: number;
type?: T;
complete?(): void;
change?(target: P, progress: number): void;
}
function animate<
P,
T extends Type = typeof easeInOut,
C = Parameters<T>[0] extends undefined ? {} : Parameters<T>[0]
>(target: P, properties: P, options?: Options<P, T> & C): number;
function spring(config?: {
frequency?: number;
friction?: number;
anticipationSize?: number;
anticipationStrength?: number;
}): void;
function bounce(config?: { frequency?: number; friction?: number }): void;
function forceWithGravity(config?: {
bounciness?: number;
elasticity?: number;
}): void;
function gravity(config?: {
bounciness?: number;
elasticity?: number;
}): void;
function easeOut(config?: { friction?: number }): void;
function easeIn(config?: { friction?: number }): void;
function easeInOut(config?: { friction?: number }): void;
function linear(): void;
function bezier(config?: { points: any[] }): void;
function setTimeout(fn: (...args: any[]) => void, delay: number): number;
function clearTimeout(id: number): void;
function stop<P>(target: P): void;
function toggleSlow(): void;
function css<T extends HTMLElement>(el: T, properties: T["style"]): number;
}
export = dynamics;