Optionalprops: TModuleProps<IRafCallbacksMap, IRafStaticProps, IRafMutableProps, Raf>Retrieves the module's callbacks instance.
Duration of the last processed frame in milliseconds.
Estimated real-time FPS (recalculated every fpsRecalcFrames).
Multiplier 60 / fps for physics tuned to a 60 Hz baseline.
Count of processed frames since the last enabled / fps reset.
Indicates whether the instance has been destroyed.
After destruction, destroy is a no-op.
Whether the rAF chain is active (enabled and not paused).
The name of the module, derived from the class name
Optional prefix for classnames used by the module
Current properties. Do not mutate these directly, use updateProps instead.
High-resolution timestamp of the last processed frame (now()).
Protected_addAdds prefixed classes to an element and removes them on destroy.
Skips classes that are already present on the element.
Target DOM element.
Unprefixed class name segments.
Protected_cnBuilds one or more prefixed class names.
Unprefixed class name segments.
Space-separated prefixed class string.
Protected_destroyPauses the loop and clears the scheduled rAF.
Protected_emitEmits a callback event with a fixed payload.
Set default mutable props
Enables or disables the Raf animation loop.
Frames per second (FPS) for the animation. Set to 'auto' for dynamic adjustment.
The number of frames after which the FPS is recalculated. This value determines how often the FPS calculation is updated based on frame counts.
Get default static props
Protected_handleMethod that is called when the module's properties mutate. In most cases, used to handle callbacks.
lerp toward to using lerpFactor.
Optionalapproximation: numberFrame-rate–independent interpolation factor for the last duration.
Non-finite ease falls back to 1.
Adds a custom callback to the module.
The event type to listen for (e.g., 'props', 'destroy').
The function to execute when the event is triggered.
Additional settings for the callback.
Registers a function to run when the instance is destroyed.
If the instance is already destroyed, action runs immediately.
Cleanup function (for example remove listeners or DOM classes).
Sets enabled: false and cancels the scheduled rAF.
Sets enabled: true and starts the loop when currently disabled.
requestAnimationFrameloop with FPS throttling and frame-rate–independent easing.enabledis truefps(fixed cap or'auto')fps,duration, and frameindexAnimation loop
play/enabled: true→ rAF chain → throttledframecallbacks →pause/enabled: false→cancelAnimationFrame.Each
framepayload includeslerpFactorbound to the current duration.Documentation