forked from pissang/claygl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimeline.d.ts
61 lines (38 loc) · 1.34 KB
/
Timeline.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
import { Base } from './core/Base';
import { Clip } from './animation/Clip';
interface IStage {
render: Function;
}
interface IAnimationOption {
stage?: IStage;
}
interface IAnimationAnimateOption {
loop?: boolean;
getter?: (key: string) => any;
setter?: (key: string, value: any) => any;
}
declare function easingFunc(percent: number) : number;
interface IAnimator<T> {
when(time: number, props: Object, easing: string|easingFunc) : IAnimator<T>;
then(time: number, props: Object, easing: string|easingFunc) : IAnimator<T>;
during(callback: (target: T, percent: number)=> any): IAnimator<T>;
start(): IAnimator<T>;
start(easing: string|easingFunc): IAnimator<T>;
start(easing: (percent: number) => number): IAnimator<T>;
stop(): IAnimator<T>;
delay(time: string): IAnimator<T>;
done(callback: Function): IAnimator<T>;
}
export class Timeline extends clay.Base {
constructor(option?: IAnimationOption);
stage: IStage;
addClip(clip: Clip): void;
removeClip(clip: Clip): void;
removeClipsAll(): void;
update(): void;
start(): void;
stop(): void;
animate<T>(target: T, options: IAnimationAnimateOption): IAnimator<T>;
on(name: "frame", handler: (deltaTime?: number) => any, context?: any): void;
on(name: string, handler: Function, context?: any): void;
}