import type { Schema } from "../Schema.js"; /** * Bound single-struct decoder for input packets. Wraps the standard * `Decoder` so bytes emitted by `InputEncoder` land on the bound instance. * * - `decode(bytes)`: single-input packet (reliable mode). * - `decodeAll(bytes, cb)`: multi-input length-framed packet (unreliable * mode). Invokes `cb` with the mutated instance once per framed input, * oldest → newest. The instance is re-used across callbacks — consume * synchronously (apply to game state) rather than holding the reference. */ export declare class InputDecoder { readonly instance: T; private readonly _decoder; private readonly _it; constructor(instance: T); /** * Decode a single-input (reliable) packet into the bound instance. * Returns the instance for chaining. */ decode(bytes: Uint8Array): T; /** * Walk a multi-input (unreliable) packet, decoding each length-framed * input into the bound instance in order and invoking `onInput` after * each decode. `onInput` receives the bound instance and the framework * **seq** of that input (decoded from the packet's base seq + position) — * the receiver dedupes the redundancy ring on it (monotonic: drop seq ≤ * last seen). Reads of the instance must be synchronous; downstream code * should apply the input to game state, not retain the reference. * * Packet layout: `[baseSeq][len][body]…[len][body]` (oldest→newest); * slot *i* has `seq = baseSeq + i`. * * Returns the number of inputs decoded. */ decodeAll(bytes: Uint8Array, onInput: (instance: T, seq: number) => void): number; }