import type { Motion, SeekableMotion } from './motion'; import { type SimulationState } from './simulation'; /** * Upper bound on how many fixed steps a single cold seek re-walks before it * yields a sample, and the cap on the checkpoint stride. Bounds the synchronous * cost of reconstructing a state far from a checkpoint. Only the record/bake * paths consult it; the onFrame accumulator hot path is untouched. */ export declare const MAX_STEPS_PER_FRAME = 240; export interface Trajectory { /** Total elapsed at rest (seconds): the step where the simulation first rested, times H. */ readonly durationS: number; /** * Exposed (position, velocity) at absolute elapsed time (seconds), clamped to * [0, durationS]. Reproduces the live animatable's one-step-trailing * interpolation, so a baked clip scrubs to the exact pixels a live run showed. */ sample(elapsedS: number): SimulationState; } export interface RecordOptions { /** Checkpoint stride in steps. Default 64, clamped to MAX_STEPS_PER_FRAME. Bounds cold-seek re-walk for stateless motions. */ checkpointStride?: number; /** * The motion carries latched state (a decay edge, a tween clock) that a * mid-trajectory state cannot resume from: rebuild makeMotion() and re-walk * from the start on every cold seek so that state re-forms identically. */ stateful?: boolean; /** Steps before record gives up (the motion never rests). Default 100_000. */ maxSteps?: number; } /** * Run the 1/120 s simulation once to discover its duration and a sparse * checkpoint table. Pure: no scheduler, no time source. Returns null when the * motion never rests within maxSteps (the bake-failure path). */ export declare function record(makeMotion: () => Motion, initial: SimulationState, options?: RecordOptions): Trajectory | null; /** * A SeekableMotion backed by a recorded trajectory. Owns its elapsed clock so * the playback layer can jump the playhead; step() advances it, rest() reports * the settle once the duration is reached. */ export declare function sampledMotion(trajectory: Trajectory): SeekableMotion; //# sourceMappingURL=sampled.d.ts.map