Optionalloop?: booleanloop forever (default) or play once and hold the last frame
Optionalnext?: stringname of an animation to switch to when this one finishes
OptionalonComplete?: () => unknowncalled when the animation completes a cycle
OptionalonFrame?: (frame: number) => unknowncalled with the index of each frame as playback reaches it (frame animations only)
Optionalspeed?: numberplayback rate multiplier (1 = authored speed)
What a caller may PASS as the second argument of
setCurrentAnimation.The loose counterpart of AnimationOptions, which is what those choices normalize TO. Every field here is optional, because the defaults are the point:
{ loop: true }has to be a complete thing to say. Typing an argument as the normalized shape instead makesloopandspeedmandatory and turns the shortest useful call into a type error.