import type { InputFrame } from "./inputSnapshot.js"; /** Deterministic state transition used to advance one predicted input frame. */ export type PredictionStep = (state: S, input: InputFrame, dt: number) => S; /** One input, tick, and resulting state retained for authoritative replay. */ export type PredictionRecord = { tick: number; input: InputFrame; state: S; dt: number; }; /** Serializable prediction state containing the confirmation baseline and pending input history. */ export type PredictionSnapshot = { confirmedTick: number; confirmed: S; predicted: S; records: PredictionRecord[]; }; /** Stateful prediction handle supporting recording, reconciliation, inspection, and restoration. */ export type PredictionBuffer = { record(input: InputFrame, dt?: number, observedState?: S): S; reconcile(tick: number, authoritative: S): { error: number; replayed: number; snapped: boolean; state: S; }; state(): S; snapshot(): PredictionSnapshot; restore(next: PredictionSnapshot): void; }; /** * Keeps local input predictions ahead of the last server confirmation. Reconciliation replaces the * confirmed state and deterministically replays unconfirmed inputs through the supplied step function. * `maxTicks` bounds retained work and memory; dropped inputs are folded into the confirmed baseline. * @capability client-side input prediction with replay reconciliation */ export declare function createPredictionBuffer(config: { initial: S; step: PredictionStep; maxTicks: number; startTick?: number; dt?: number; /** Error above which a caller should snap its rendered pose to the reconciled result. */ snapThreshold?: number; }): PredictionBuffer;