1 | import type { KeyframeEffect } from './KeyframeEffect';
|
2 | import type { AnimationTimeline } from './AnimationTimeline';
|
3 |
|
4 |
|
5 |
|
6 | export declare class Animation {
|
7 | |
8 |
|
9 |
|
10 | effect: KeyframeEffect;
|
11 | |
12 |
|
13 |
|
14 | timeline: AnimationTimeline;
|
15 | |
16 |
|
17 |
|
18 | id: string;
|
19 | |
20 |
|
21 |
|
22 | get pending(): boolean;
|
23 | private currentTimePending;
|
24 | |
25 |
|
26 |
|
27 | private _idle;
|
28 | private _paused;
|
29 | private _finishedFlag;
|
30 | get playState(): AnimationPlayState;
|
31 | |
32 |
|
33 |
|
34 | private oldPlayState;
|
35 | private _holdTime;
|
36 | private readyPromise;
|
37 | private finishedPromise;
|
38 | private resolveReadyPromise;
|
39 | private rejectReadyPromise;
|
40 | private resolveFinishedPromise;
|
41 | private rejectFinishedPromise;
|
42 | |
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | get ready(): Promise<any>;
|
53 | |
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 | get finished(): Promise<any>;
|
69 | |
70 |
|
71 |
|
72 | onfinish: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null;
|
73 | /**
|
74 | * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/oncancel
|
75 | */
|
76 | oncancel: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null;
|
77 | /**
|
78 | * get called after each frame when running
|
79 | */
|
80 | onframe: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null;
|
81 | /**
|
82 | * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/currentTime
|
83 | */
|
84 | get currentTime(): number | null;
|
85 | private _currentTime;
|
86 | set currentTime(newTime: number | null);
|
87 | /**
|
88 | * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/startTime
|
89 | */
|
90 | private _startTime;
|
91 | get startTime(): number | null;
|
92 | set startTime(newTime: number | null);
|
93 | private _playbackRate;
|
94 | get playbackRate(): number;
|
95 | set playbackRate(value: number);
|
96 | get _isFinished(): boolean;
|
97 | get totalDuration(): number;
|
98 | _inEffect: boolean;
|
99 | _inTimeline: boolean;
|
100 | get _needsTick(): boolean;
|
101 | constructor(effect: KeyframeEffect, timeline: AnimationTimeline);
|
102 | /**
|
103 | * state machine,
|
104 | * resolve/reject ready/finished Promise according to current state
|
105 | */
|
106 | updatePromises(): Promise<any>;
|
107 | play(): void;
|
108 | pause(): void;
|
109 | finish(): void;
|
110 | cancel(): void;
|
111 | reverse(): void;
|
112 | /**
|
113 | * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/updatePlaybackRate
|
114 | */
|
115 | updatePlaybackRate(playbackRate: number): void;
|
116 | targetAnimations(): Animation[];
|
117 | markTarget(): void;
|
118 | unmarkTarget(): void;
|
119 | tick(timelineTime: number, isAnimationFrame: boolean): void;
|
120 | private rewind;
|
121 | persist(): void;
|
122 | addEventListener<K extends keyof AnimationEventMap>(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
123 | addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
124 | removeEventListener<K extends keyof AnimationEventMap>(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
125 | removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
126 | dispatchEvent(event: Event): boolean;
|
127 | onremove: ((this: Animation, ev: Event) => any) | null;
|
128 | commitStyles(): void;
|
129 | private ensureAlive;
|
130 | private tickCurrentTime;
|
131 | private fireEvents;
|
132 | }
|
133 |
|
\ | No newline at end of file |