melt
Version:
The next generation of Melt UI. Built for Svelte 5.
25 lines (24 loc) • 851 B
TypeScript
type RafCallbackParams = {
/** The number of milliseconds since the last frame. */
delta: number;
/**
* Time elapsed since the creation of the web page.
* See {@link https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp#the_time_origin Time origin}.
*/
timestamp: DOMHighResTimeStamp;
};
/**
* Wrapper over {@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame requestAnimationFrame},
* with controls for pausing and resuming the animation, reactive tracking and optional limiting of fps, and utilities.
*/
export declare class AnimationFrames {
#private;
frame: number | null;
constructor(callback: (params: RafCallbackParams) => void);
start(): void;
stop(): void;
toggle(): void;
get fps(): number;
get running(): boolean;
}
export {};