KeyframeAnimationDef
Defined in: KeyframeAnimator.ts:13
Definition for a named keyframe animation.
Type Parameters
Section titled “Type Parameters”T extends Interpolatable = Interpolatable
Properties
Section titled “Properties”clock?
Section titled “clock?”
optionalclock?:ProcessClock
Defined in: KeyframeAnimator.ts:48
Clock that advances this animation’s playback (see ProcessClock),
default "frame".
"frame" is rendered-frame time, right for setter-driven visuals.
"fixed" is the fixed timestep, right for timing that must stay in step
with a fixed-step simulation — typically a setter-less timeline whose
keyframe event callbacks drive gameplay. The choice is per animation, so
one animator can hold a frame-clock walk cycle and a fixed-clock event
timeline.
A setter on "fixed" is written on fixed steps, so a rendered frame that
runs no fixed step shows the previous value.
duration?
Section titled “duration?”
optionalduration?:number
Defined in: KeyframeAnimator.ts:53
Track length in seconds, finite and > 0. Defaults to the last keyframe’s time.
easing?
Section titled “easing?”
optionaleasing?:EasingFunction
Defined in: KeyframeAnimator.ts:54
keyframes
Section titled “keyframes”keyframes:
Keyframe<T>[]
Defined in: KeyframeAnimator.ts:20
At least 2 keyframes, sorted by time. A track interpolates between
control points, so play() throws on fewer than 2.
optionalloop?:boolean
Defined in: KeyframeAnimator.ts:49
onEnter?
Section titled “onEnter?”
optionalonEnter?: () =>void
Defined in: KeyframeAnimator.ts:55
Returns
Section titled “Returns”void
onExit?
Section titled “onExit?”
optionalonExit?: (complete) =>void
Defined in: KeyframeAnimator.ts:56
Parameters
Section titled “Parameters”complete
Section titled “complete”boolean
Returns
Section titled “Returns”void
speed?
Section titled “speed?”
optionalspeed?:number
Defined in: KeyframeAnimator.ts:51
Playback speed multiplier (default 1). Finite and > 0.
Methods
Section titled “Methods”setter()?
Section titled “setter()?”
optionalsetter(value):void
Defined in: KeyframeAnimator.ts:33
Receives the interpolated value on every tick of the animation’s clock —
each rendered frame by default. The tick that wraps a looping animation
back to time 0 skips the setter, so the previous value holds for one tick.
Optional — when omitted the animator only fires keyframe event callbacks
(pure-timeline use case).
Declared as a method signature (rather than a (value: T) => void
property) so the parameter type is bivariant — this is what lets a
Record<string, KeyframeAnimationDef<number>> literal flow into the
KeyframeAnimator constructor without per-key casts.
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”void
Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/core.md.