import { GameEventBus } from "../eventBus.d.ts"; import { Action } from "../../interfaces/action.d.ts"; import { Binding, ValueBindingDefinition } from "../../interfaces/binding.d.ts"; import { DeviceType, DeviceValueReader, InputState } from "../../interfaces/input.d.ts"; /** * Options for configuring a value binding */ export interface ValueBindingOptions { /** * Factor to scale the input value by (1.0 = no scaling) */ scale?: number; /** * Value to add to the input value after scaling */ offset?: number; /** * Whether to invert the input value (multiply by -1) */ invert?: boolean; /** * Optional context name this binding belongs to */ context?: string; /** * If true, only emit values when they change * If false, always emit values on each process call */ emitOnChange?: boolean; /** * Deadzone threshold (0.0 to 1.0) * Input values below this threshold will be treated as 0 */ deadzone?: number; /** * Value to emit when the input is digital and true * Only used when action is digital */ onValue?: boolean | number; /** * Value to emit when the input is digital and false * Only used when action is digital */ offValue?: boolean | number; /** * Minimum value to clamp output to */ min?: number; /** * Maximum value to clamp output to */ max?: number; } /** * Implementation of a value binding, which directly converts an analog input * to an analog output with optional scaling, offset, and clamping. * Can handle both digital and analog inputs/outputs based on action type. */ export declare class ValueBinding implements Binding { readonly type: "value"; readonly action: Action; readonly context?: string; readonly deviceID: string; readonly deviceType: DeviceType; readonly reader: DeviceValueReader; private readonly _scale; private readonly _offset; private readonly _invert; private readonly _emitOnChange; private readonly _deadzone; private readonly _onValue; private readonly _offValue; private readonly _min; private readonly _max; private _lastValue; /** * Get the current options for this value binding. */ get options(): ValueBindingOptions; /** * Create a new value binding * * @param action * @param deviceID * @param reader * @param options */ constructor(action: Action, deviceID: string, deviceType: DeviceType, reader: DeviceValueReader, options?: ValueBindingOptions); /** * Process input state, apply scaling/deadzone/clamping, and emit an action event if the value changed. * * @param state * @param eventBus */ process(state: InputState, eventBus: GameEventBus): void; /** * No-op for value bindings — they have no edge-detection state to reset. */ resetEdgeState(_state?: InputState): void; /** * Returns a JSON-serializable representation of this value binding. */ toJSON(): ValueBindingDefinition; }