import type { GameContext } from "./gameContext.js"; /** One piece of simulation state that can be captured and restored by id. */ export interface SimSnapshotContributor { id: string; capture(): T; restore(data: T): void; } /** Captured contributor data keyed by contributor id. */ export type SimSnapshot = Record; /** Registry of {@link SimSnapshotContributor}s that captures and restores them together. */ export interface SimSnapshotRegistry { register(contributor: SimSnapshotContributor): () => void; capture(): SimSnapshot; /** Alias of {@link capture}, matching the engine's snapshot/restore naming. */ snapshot(): SimSnapshot; /** Restore every contributor present in `snapshot`; contributors missing from it are left untouched. */ restore(snapshot: SimSnapshot): void; ids(): string[]; } /** * A registry of everything that must round-trip for a simulation to resume bit-for-bit: world state, the * clock, the rng cursor, the loop accumulator, and whatever a physics backend or game adds. Pair with * {@link createInputRecorder} for replay. * * @capability sim-snapshot capture and restore whole-simulation state for replay, rollback, and regression tests */ export declare function createSimSnapshotRegistry(): SimSnapshotRegistry; /** * The engine's own contributors for a context: replicated world state, the sim clock, the loop and pose * history, and the rng cursor when `ctx.rng` is a seeded stream. Games register theirs on the same registry. */ export declare function createContextSimSnapshot(ctx: GameContext): SimSnapshotRegistry;