UNPKG

507 BTypeScriptView Raw
1/**
2 * Callback called on frame rendered
3 * @argument time Time of the current frame in milliseconds
4 */
5export interface FrameRequestCallback {
6 (time: number): void;
7}
8
9/**
10 * Requests an animation frame and returns the timer ID
11 * @param cb Callback to be called on frame
12 */
13export function requestAnimationFrame(cb: FrameRequestCallback): number;
14
15/**
16 * Cancels a previously scheduled animation frame request
17 * @param id timer ID to cancel
18 */
19export function cancelAnimationFrame(id: number): void;