import { type PointerAxisBinding, type PointerAxisState } from "./pointerAxis.js"; export interface AxisInput { throttle: number; brake: number; steer: number; handbrake: number; } export declare const NEUTRAL_AXIS: AxisInput; export type AxisName = keyof AxisInput; export interface AxisBinding { positive: readonly string[]; negative?: readonly string[]; /** Pointer-position source for this axis (#293) — takes over from the key lists whenever a pointer is active. */ pointer?: PointerAxisBinding; } export type AxisBindingMap = Record; export interface AxisChannelConfig { bindings: AxisBindingMap; smoothing?: number; } export interface AxisRange { min: number; max: number; } export declare const AXIS_RANGE: Record; /** @internal */ export declare function clampAxis(value: number, range: AxisRange): number; /** @internal */ export declare function rampToward(current: number, target: number, rate: number, dt: number): number; /** * Analog control channel — distinct from the digital action bindings. Throttle/brake/steer/handbrake * are continuous values ramped from held keys (a keyboard feels like a pedal) or driven directly from * a gamepad axis via `setAnalog`. `sample(dt, isDown, pointer?)` folds the current held-key state into * the smoothed value; a binding's `pointer` source takes over from its keys while a pointer is active, * and a `setAnalog` override replaces both for that axis until cleared. * @internal */ export declare class AxisChannel { private readonly bindings; private readonly smoothing; private readonly current; private readonly overrides; constructor(config: AxisChannelConfig); setAnalog(axis: AxisName, value: number): void; clearAnalog(axis: AxisName): void; reset(): void; get value(): AxisInput; sample(dt: number, isDown: (code: string) => boolean, pointer?: PointerAxisState | null): AxisInput; } /** * Car axes bound to raw key codes, for an {@link AxisChannel} sampled with a key-code `isDown`. `ctx.input.axis` * samples action names instead, so bind it to the game's input actions (e.g. `moveForward`), not this map. */ export declare const DRIVE_AXIS_BINDINGS: AxisBindingMap; export interface GenericAxisConfig { bindings: Record; /** Per-axis value range; unlisted axes default to bipolar `[-1, 1]` (use `{ min: 0, max: 1 }` for pedals). */ ranges?: Partial>; smoothing?: number; } /** * The held-key-ramping analog channel for any axis schema (#282.7) — drones (pitch/roll/strafe), * boats, mechs — not just the four car axes `AxisChannel` hardcodes. Same semantics: keys ramp, * `setAnalog` overrides, a binding's `pointer` source takes over while a pointer is active. */ export interface GenericAxisChannel { sample(dt: number, isDown: (code: string) => boolean, pointer?: PointerAxisState | null): Record; setAnalog(axis: TAxes, value: number): void; clearAnalog(axis: TAxes): void; reset(): void; readonly value: Record; } /** * Instantaneous (unsmoothed) analog sample of an axis binding map — the per-frame target an * `AxisChannel` ramps toward, exposed as a pure read for `ctx.input.axis` and headless sampling. * Each axis is its binding's positive-minus-negative held state (or its pointer source while a pointer * is active), clamped to the axis range; axes without a listed range default to bipolar `[-1, 1]`. * @internal */ export declare function sampleAxisBindings(bindings: Record, isDown: (code: string) => boolean, pointer?: PointerAxisState | null, ranges?: Partial>, value?: (code: string) => number): Record; /** @internal */ export declare function createAxisChannel(config: GenericAxisConfig): GenericAxisChannel;