interface TokenAnimationContext {
    name: string | symbol;
    to: Partial<TokenAnimationData>;
    duration: number;
    time: number;
    preAnimate: ((context) => Promise<void>)[];
    postAnimate: ((context) => void)[];
    onAnimate: ((context) => void)[];
    promise: Promise<boolean>;
}

Properties

name: string | symbol

The name of the animation

to: Partial<TokenAnimationData>

The final animation state

duration: number

The duration of the animation

time: number

The current time of the animation

preAnimate: ((context) => Promise<void>)[]

Asynchronous functions that are executed before the animation starts

Type declaration

postAnimate: ((context) => void)[]

Synchronous functions that are executed after the animation ended. They may be executed before the preAnimate functions have finished if the animation is terminated.

Type declaration

onAnimate: ((context) => void)[]

Synchronous functions that are executed each frame after ontick and before Token#_onAnimationUpdate.

Type declaration

promise: Promise<boolean>

The promise of the animation, which resolves to true if the animation completed, to false if it was terminated, and rejects if an error occurred. Undefined in the first frame (at time 0) of the animation.