/** * SimulationRecorder — Record simulation field snapshots for playback. * * Captures field data from any SimSolver at configurable intervals, * stores in a memory-capped circular buffer, and supports bracket * search for interpolated playback. * * @see SimulationPlayback — consumes recorded snapshots for scrubbing * @see SimSolver — generic solver interface whose fields we capture */ import type { SimSolver } from './SimSolver'; export interface FieldSnapshot { /** Simulation time in seconds */ time: number; /** Field name → copied Float32Array data */ fields: Map; } export interface RecorderConfig { /** Maximum memory budget in bytes (default: 512MB) */ maxMemoryBytes?: number; /** Minimum interval between captures in seconds (default: 0 = every step) */ captureInterval?: number; /** Which fields to capture (default: all from solver.fieldNames) */ fieldFilter?: string[]; } export declare class SimulationRecorder { private snapshots; private totalBytes; private lastCaptureTime; private maxBytes; private interval; private filter; constructor(config?: RecorderConfig); /** * Capture a snapshot from the solver at the given simulation time. * Returns true if a snapshot was captured, false if skipped (interval not met). */ capture(solver: SimSolver, simTime: number): boolean; /** * Find the two snapshots bracketing a given time, plus interpolation alpha. * Returns { before, after, alpha } where alpha ∈ [0,1]. */ findBracket(time: number): { before: number; after: number; alpha: number; }; /** Get a snapshot by index. */ getSnapshot(index: number): FieldSnapshot | null; /** Number of recorded snapshots. */ get frameCount(): number; /** Time range [start, end] in seconds. */ get timeRange(): [number, number]; /** Estimated memory usage in bytes. */ get memoryUsage(): number; /** Clear all recorded data. */ clear(): void; /** * Evict oldest snapshots to free memory. * Strategy: drop every other frame from the first half of history * (temporal downsampling of old data, preserves recent detail). */ private evict; /** Estimate bytes for a snapshot. */ private snapshotBytes; } //# sourceMappingURL=SimulationRecorder.d.ts.map