* Web animation for sprite nodes.
| 142 | * Web animation for sprite nodes. |
| 143 | */ |
| 144 | interface Animation { |
| 145 | readonly effects: Record<string, any>; |
| 146 | /** |
| 147 | * The finished promise resolved when the animation's playstate is finished. |
| 148 | */ |
| 149 | readonly finished: Promise<void>; |
| 150 | /** |
| 151 | * The current frame props of the animation. |
| 152 | */ |
| 153 | readonly frame: Partial<Attrs>; |
| 154 | /** |
| 155 | * The playState of the animation. |
| 156 | * Valid values are 'idel' or 'running' or 'pending' or 'paused' or 'finished'. |
| 157 | */ |
| 158 | readonly playState: playState; |
| 159 | /** |
| 160 | * The progress of the animation. |
| 161 | * The value is between [0, 1]. |
| 162 | */ |
| 163 | readonly progress: number; |
| 164 | /** |
| 165 | * The ready promise resolved when the animation's playstate is ready. |
| 166 | */ |
| 167 | readonly ready: Promise<void>; |
| 168 | /** |
| 169 | * Timing properties of an animation. |
| 170 | */ |
| 171 | readonly timing: Timing; |
| 172 | /** |
| 173 | * Custom timeline. https://github.com/spritejs/sprite-timeline |
| 174 | */ |
| 175 | baseTimeline: Timeline; |
| 176 | /** |
| 177 | * Sets the rate at which the animation is being played back. |
| 178 | */ |
| 179 | playbackRate: number; |
| 180 | /** |
| 181 | * Apply animation effects to the animation. |
| 182 | * @param effects The effect function maps. |
| 183 | * @returns All effect function maps. |
| 184 | */ |
| 185 | applyEffects(effects: Record<string, Function>): Record<string, Function>; |
| 186 | /** |
| 187 | * Cancel the animation. |
| 188 | * @param preserveState Whether the frame state is preserved when the animation is canceled. |
| 189 | */ |
| 190 | cancel(preserveState?: boolean): void; |
| 191 | /** |
| 192 | * Finish the animation. |
| 193 | */ |
| 194 | finish(): void; |
| 195 | /** |
| 196 | * Pause the animation. Set the timeline's playbackRate to 0. |
| 197 | */ |
| 198 | pause(): void; |
| 199 | /** |
| 200 | * Play the animation. |
| 201 | */ |
no outgoing calls
no test coverage detected