UNPKG

dualsense-ts

Version:

The natural interface for your DualSense Classic and DualSense Access controllers, with Typescript

111 lines 4.11 kB
import { Momentary, Analog, AnalogParams, Battery, BatteryParams, Lightbar } from "./elements"; import { AccessProfileLeds } from "./elements/access_profile_leds"; import { AccessStatusLed } from "./elements/access_status_led"; import { AccessPlayerIndicatorLed } from "./elements/access_player_indicator"; import { Input, InputParams } from "./input"; import { AccessHID } from "./hid/access/access_hid"; import type { FirmwareInfo } from "./hid/firmware_info"; import type { FactoryInfo } from "./hid/factory_info"; /** Settings for your DualSense Access controller */ export interface DualsenseAccessParams extends InputParams { /** Sets the source for HID events. Default: decide automatically */ hid?: AccessHID | null; /** Settings for the B1 button */ b1?: InputParams; /** Settings for the B2 button */ b2?: InputParams; /** Settings for the B3 button */ b3?: InputParams; /** Settings for the B4 button */ b4?: InputParams; /** Settings for the B5 button */ b5?: InputParams; /** Settings for the B6 button */ b6?: InputParams; /** Settings for the B7 button */ b7?: InputParams; /** Settings for the B8 button */ b8?: InputParams; /** Settings for the center button */ center?: InputParams; /** Settings for the PS button */ ps?: InputParams; /** Settings for the profile cycle button */ profile?: InputParams; /** Settings for the analog stick */ stick?: AnalogParams; /** Settings for the battery */ battery?: BatteryParams; /** Settings for the connection indicator */ connection?: InputParams; } /** Tracks the active profile ID (1–3) */ declare class ProfileId extends Input<number> { state: number; get active(): boolean; } /** Represents a DualSense Access controller */ export declare class DualsenseAccess extends Input<DualsenseAccess> { readonly state: DualsenseAccess; /** Hardware button 1 */ readonly b1: Momentary; /** Hardware button 2 */ readonly b2: Momentary; /** Hardware button 3 */ readonly b3: Momentary; /** Hardware button 4 */ readonly b4: Momentary; /** Hardware button 5 */ readonly b5: Momentary; /** Hardware button 6 */ readonly b6: Momentary; /** Hardware button 7 */ readonly b7: Momentary; /** Hardware button 8 */ readonly b8: Momentary; /** Center button */ readonly center: Momentary; /** PlayStation button */ readonly ps: Momentary; /** Profile cycle button */ readonly profile: Momentary; /** Analog stick (x, y, button = stick click) */ readonly stick: Analog; /** Battery level and charging status */ readonly battery: Battery; /** Active profile ID (1–3) */ readonly profileId: ProfileId; /** Whether a controller is connected */ readonly connection: Momentary; /** RGB light bar */ readonly lightbar: Lightbar; /** Profile indicator LEDs (3 LEDs, animation modes) */ readonly profileLeds: AccessProfileLeds; /** Player indicator LED pattern (6-segment cross) */ readonly playerIndicator: AccessPlayerIndicatorLed; /** White status LED */ readonly statusLed: AccessStatusLed; /** Active interval timers, cleared on dispose */ private readonly timers; /** Buffered battery reading */ private readonly pendingBattery; /** The underlying HID coordinator */ readonly hid: AccessHID; /** Firmware and hardware information */ get firmwareInfo(): FirmwareInfo; /** Factory information (serial number, body color, board revision) */ get factoryInfo(): FactoryInfo; /** True if any input is active */ get active(): boolean; /** Returns true if connected via Bluetooth */ get wireless(): boolean; /** Factory-stamped serial number */ get serialNumber(): string; constructor(params?: DualsenseAccessParams); /** Stop all internal timers and release resources */ dispose(): void; /** Distributes HID state to inputs */ private processHID; } export {}; //# sourceMappingURL=dualsense_access.d.ts.map