/** Piecewise-linear map from a signal value to an output value; points in ascending input order, ends clamp. */ export type FeedbackCurve = readonly (readonly [number, number])[]; /** One wire from a sim signal to a named output. */ export interface FeedbackRoute { signal: TSignal; target: TTarget; /** Signal → output mapping (default identity). */ curve?: FeedbackCurve; /** Units/s the routed value may rise (default `Infinity`: follows instantly). */ attack?: number; /** Units/s the routed value may fall (default `attack`). */ release?: number; } /** A one-shot fired when a signal crosses a threshold (landing thud, gear-change clunk, impact rumble). */ export interface FeedbackEvent { id: string; signal: TSignal; /** Fires when the signal rises to or above this value from below it. */ threshold: number; /** Seconds before the same event may fire again (default `0`). */ cooldown?: number; } /** Config for {@link createFeedbackMixer}. */ export interface FeedbackMixerConfig { routes: readonly FeedbackRoute[]; /** How routes landing on the same target combine (default `"sum"`). */ combine?: Partial>; /** Value a target starts from before routes add to it (default `0`). */ base?: Partial>; events?: readonly FeedbackEvent[]; } /** Serializable mixer state: smoothed route values, last signal per event, and event cooldowns. */ export interface FeedbackMixerState { routes: number[]; eventSignals: number[]; cooldowns: number[]; } /** Maps sim telemetry to presentation parameters through declared routes, curves and smoothing. */ export interface FeedbackMixer { /** * Advance by `dt` with this tick's signals and return every target's value. The returned record is reused * between calls, so read it before the next update. Missing signals read as `0`. */ update(dt: number, signals: Readonly>>): Readonly>; /** True when event `id` fired on the last update. */ fired(id: string): boolean; value(): Readonly>; retune(next: FeedbackMixerConfig): void; snapshot(): FeedbackMixerState; restore(state: FeedbackMixerState): void; reset(): void; } /** Sample a {@link FeedbackCurve}; an empty curve is the identity. */ export declare function sampleFeedbackCurve(curve: FeedbackCurve | undefined, x: number): number; /** * Creates a {@link FeedbackMixer}: the one place a game declares how sim telemetry drives presentation — * rpm to engine pitch, tire saturation to squeal and rumble, speed to FOV, landing speed to a thud — instead * of hand-writing that glue per vehicle, aircraft or weapon. Deterministic, allocation-free per update. * @capability feedback-mixer map sim telemetry to camera, audio and haptic parameters through curves, smoothing and threshold events */ export declare function createFeedbackMixer(initial: FeedbackMixerConfig): FeedbackMixer;