import type { FrameDriver } from './driver'; export interface FrameInfo { /** Time since the previous frame, in ms. 0 on the first frame after a wake. */ deltaMs: number; /** Driver timestamp of this frame, in ms. */ timestampMs: number; } export type FrameCallback = (frame: FrameInfo) => void; /** * 'update' (default) runs simulations; 'render' runs DOM writes, after every * update of the same tick. A render subscription made during the update phase * still runs this tick - that is what lets bindings batch all style writes * produced by a frame into a single flush. */ export type FramePhase = 'update' | 'render'; export interface Scheduler { /** Register a per-frame callback. Starts the loop if it was sleeping. */ subscribe(callback: FrameCallback, phase?: FramePhase): () => void; isRunning(): boolean; } /** * Upper bound on the delta fed to subscribers. After a freeze (inactive tab, * GC pause, breakpoint) the lost time is dropped, never replayed: physics * must not teleport. */ export declare const MAX_FRAME_DELTA_MS = 64; export declare function createScheduler(driver: FrameDriver): Scheduler; //# sourceMappingURL=scheduler.d.ts.map