dualsense-ts
Version:
A natural interface for your DualSense controller, with Typescript
114 lines • 2.49 kB
TypeScript
export declare const enum LedOptions {
Off = 0,
PlayerLedBrightness = 1,
Uninterruptible = 2,
Both = 3
}
export declare const enum PulseOptions {
Off = 0,
FadeBlue = 1,
FadeOut = 2
}
export declare const enum Brightness {
High = 0,
Medium = 1,
Low = 2
}
export declare const enum PlayerID {
Player1 = 4,
Player2 = 10,
Player3 = 21,
Player4 = 27,
All = 31
}
export declare const enum TriggerMode {
/** No resistance */
Off = 0,
/** Continuous resistance */
Rigid = 1,
Pulse = 2,
Calibration = 252,
rigid_A = 33,
rigid_B = 5,
rigid_AB = 37,
pulse_A = 34,
pulse_B = 6,
pulse_AB = 38
}
export declare const enum CommandScopeA {
HapticRumble = 1,
PrimaryRumble = 2,
RightTriggerFeedback = 4,
LeftTriggerFeedback = 8,
AudioVolume = 16,
SpeakerToggle = 32,
MicrophoneVolume = 64
}
export declare const enum CommandScopeB {
MicrophoneLED = 1,
Mute = 2,
TouchpadLeds = 4,
DisableLeds = 8,
PlayerLeds = 16,
MotorPower = 64
}
export type CommandScope = CommandScopeA | CommandScopeB;
/** Byte value, 0 to 255 */
type Intensity = number;
/** 48 byte packet that is sent to the controller to update LEDs, rumble, etc */
export interface DualsenseCommand extends Uint8Array {
/** Packet type */
[]: 0x2;
/** Command effect limited to these bits */
[]: CommandScopeA | 0xff;
/** Command effect also limited to these bits */
[]: CommandScopeB | (0x1 | 0x2 | 0x4 | 0x10 | 0x40);
/** Right rumble intensity */
[]: Intensity;
/** Left rumble intensity */
[]: Intensity;
[]: 0;
[]: 0;
[]: 0;
[]: 0;
/** Microphone LED intensity */
[]: Intensity;
/** Microphone mute state (0x10 muted, 0x00 unmuted) */
[]: 0x10 | 0x00;
[]: TriggerMode;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: 0;
[]: TriggerMode;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: 0;
[]: 0;
[]: 0;
[]: 0;
[]: 0;
[]: 0;
[]: 0;
[]: LedOptions;
[]: 0;
[]: 0;
[]: PulseOptions;
[]: Brightness;
[]: PlayerID;
[]: Intensity;
[]: Intensity;
[]: Intensity;
[]: never;
}
export {};
//# sourceMappingURL=command.d.ts.map