export type RuntimeSystemPhase = "input" | "fixed" | "update" | "late" | "presentation"; /** All durations use milliseconds, matching the session's animation clock. */ export interface RuntimeTickContext { readonly phase: RuntimeSystemPhase; readonly deltaMs: number; readonly unscaledDeltaMs: number; readonly elapsedMs: number; readonly frame: number; readonly fixed?: Readonly<{ index: number; count: number; elapsedMs: number; interpolation: number; droppedMs: number; }>; } export interface RuntimeSystem { readonly id: string; readonly phase: RuntimeSystemPhase; readonly order?: number; run(context: RuntimeTickContext): void; } /** Opt-in host systems; no document writes, timers, engine or render-loop ownership. */ export interface RuntimeLoop { addSystem(system: RuntimeSystem): () => void; paused: boolean; timeScale: number; configureFixedStep(options: { stepMs: number; maxSubsteps: number; }): void; getState(): RuntimeLoopState; /** Simulated milliseconds. Each repeating timer runs at most once per frame. */ schedule(delayMs: number, callback: () => void, options?: { repeatMs?: number; }): () => void; } export interface RuntimeLoopState { readonly paused: boolean; readonly timeScale: number; readonly elapsedMs: number; readonly fixedElapsedMs: number; readonly frame: number; readonly stepMs: number; readonly maxSubsteps: number; readonly interpolation: number; readonly droppedMs: number; readonly totalDroppedMs: number; readonly timers: number; readonly systems: readonly { id: string; phase: RuntimeSystemPhase; order: number; }[]; } interface LoopHost { transaction(action: () => void): void; advanceClock(deltaMs: number): void; reportError(error: unknown, systemId: string): void; } /** Internal driver. Only RuntimeSession supplies frame timestamps and lifecycle. */ export declare class RuntimeLoopController implements RuntimeLoop { #private; readonly host: LoopHost; constructor(host: LoopHost); get paused(): boolean; set paused(value: boolean); get timeScale(): number; set timeScale(value: number); addSystem(system: RuntimeSystem): () => void; configureFixedStep(options: { stepMs: number; maxSubsteps: number; }): void; getState(): RuntimeLoopState; schedule(delayMs: number, callback: () => void, options?: { repeatMs?: number; }): () => void; advance(now: number, active: boolean): void; resetInterval(): void; reset(): void; dispose(): void; } export {}; //# sourceMappingURL=runtime-loop.d.ts.map