-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathindex.d.ts
154 lines (111 loc) · 4.45 KB
/
index.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
declare namespace pc {
type TweenTarget = Record<string, unknown> | Quat | Vec4 | Vec3 | Vec2;
// Easing Functions
export function Linear(t: number): number;
export function QuadraticIn(t: number): number;
export function QuadraticOut(t: number): number;
export function QuadraticInOut(t: number): number;
export function CubicIn(t: number): number;
export function CubicOut(t: number): number;
export function CubicInOut(t: number): number;
export function QuarticIn(t: number): number;
export function QuarticOut(t: number): number;
export function QuarticInOut(t: number): number;
export function QuinticIn(t: number): number;
export function QuinticOut(t: number): number;
export function QuinticInOut(t: number): number;
export function SineIn(t: number): number;
export function SineOut(t: number): number;
export function SineInOut(t: number): number;
export function ExponentialIn(t: number): number;
export function ExponentialOut(t: number): number;
export function ExponentialInOut(t: number): number;
export function CircularIn(t: number): number;
export function CircularOut(t: number): number;
export function CircularInOut(t: number): number;
export function BackIn(t: number): number;
export function BackOut(t: number): number;
export function BackInOut(t: number): number;
export function BounceIn(t: number): number;
export function BounceOut(t: number): number;
export function BounceInOut(t: number): number;
export function ElasticIn(t: number): number;
export function ElasticOut(t: number): number;
export function ElasticInOut(t: number): number;
/**
* @name pc.Tween
* @param {object} target - The target property that will be tweened
* @param {pc.TweenManager} manager - The tween manager
* @param {pc.Entity} entity - The pc.Entity whose property we are tweening
*/
export class Tween {
time: number;
complete: boolean;
playing: boolean;
stopped: boolean;
pending: boolean;
target: TweenTarget;
duration: number;
private _currentDelay: number;
timeScale: number;
private _reverse: boolean;
private _delay: number;
private _yoyo: boolean;
private _count: number;
private _numRepeats: number;
private _repeatDelay: number;
private _from: boolean;
private _slerp: boolean;
private _fromQuat: Quat;
private _toQuat: Quat;
private _quat: Quat;
easing: (t: number) => number;
private _sv: TweenTarget;
private _ev: TweenTarget;
to: (
properties: TweenTarget,
duration?: number,
easing?: (t: number) => number,
delay?: number,
repeat?: number,
yoyo?: boolean
) => Tween;
from: (
properties: TweenTarget,
duration?: number,
easing?: (t: number) => number,
delay?: number,
repeat?: number,
yoyo?: boolean
) => Tween;
rotate: (
properties: TweenTarget,
duration?: number,
easing?: (t: number) => number,
delay?: number,
repeat?: number,
yoyo?: boolean
) => Tween;
start: () => Tween;
pause: () => void;
resume: () => void;
stop: () => void;
delay: (delay: number) => Tween;
repeat: (num: number, delay?: number) => Tween;
loop: (loop: boolean) => Tween;
yoyo: (yoyo: boolean) => Tween;
reverse: () => Tween;
chain: (...tween: Tween[]) => Tween;
update: (dt: number) => boolean;
onUpdate: (callback: () => void) => Tween;
onComplete: (callback: () => void) => Tween;
onLoop: (callback: () => void) => Tween;
}
export interface TweenOptions {
/** Property name of an Element component to be tweened...? */
element: string;
}
export interface Entity {
tween: (target: TweenTarget, options?: TweenOptions) => Tween;
}
}