import { type Resource } from "webappwiz/disposable"; import type { Clock, Duration } from "webappwiz/time"; export type AnimationLoopEventMap = { /** One frame has come round, `dt` after the last. */ frame: { dt: Duration; }; }; /** * Raises a `frame` event every animation frame between `start` and `stop`, * with the time since the previous one. * * ```ts * const loop = new AnimationLoop(clock); * loop.events.on("frame", ({ dt }) => cursor.advance(dt)); * loop.start(); * ``` * * Each frame asks for the next, so a loop nobody stops runs until it is * disposed. Disposing stops it. */ export declare class AnimationLoop implements Resource { private readonly clock; private readonly disposer; private readonly dispatcher; readonly events: import("webappwiz/events").Events; private frame; private running; constructor(clock: Clock); isRunning(): boolean; start(): void; stop(): void; dispose(): void; private onFrame; }