steamworks-ffi-node 0.6.9 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +153 -107
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/SteamInputManager.d.ts +496 -0
- package/dist/internal/SteamInputManager.d.ts.map +1 -0
- package/dist/internal/SteamInputManager.js +993 -0
- package/dist/internal/SteamInputManager.js.map +1 -0
- package/dist/internal/SteamLibraryLoader.d.ts +48 -0
- package/dist/internal/SteamLibraryLoader.d.ts.map +1 -1
- package/dist/internal/SteamLibraryLoader.js +61 -0
- package/dist/internal/SteamLibraryLoader.js.map +1 -1
- package/dist/steam.d.ts +59 -0
- package/dist/steam.d.ts.map +1 -1
- package/dist/steam.js +5 -0
- package/dist/steam.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/input.d.ts +252 -0
- package/dist/types/input.d.ts.map +1 -0
- package/dist/types/input.js +142 -0
- package/dist/types/input.js.map +1 -0
- package/docs/README.md +30 -2
- package/package.json +8 -2
- package/verify-sdk-setup.js +3 -3
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Steam Input types
|
|
3
|
+
*
|
|
4
|
+
* Types for Steam Input API which provides unified controller support
|
|
5
|
+
* across Xbox, PlayStation, Nintendo Switch, Steam Controller, and more.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Handle for a specific controller device
|
|
9
|
+
* This handle consistently identifies a controller even across disconnects/reconnects
|
|
10
|
+
*/
|
|
11
|
+
export type InputHandle = bigint;
|
|
12
|
+
/**
|
|
13
|
+
* Handle for an action set
|
|
14
|
+
* Action sets group related actions together (e.g., "MenuControls", "GameplayControls")
|
|
15
|
+
*/
|
|
16
|
+
export type InputActionSetHandle = bigint;
|
|
17
|
+
/**
|
|
18
|
+
* Handle for a digital action (button press)
|
|
19
|
+
*/
|
|
20
|
+
export type InputDigitalActionHandle = bigint;
|
|
21
|
+
/**
|
|
22
|
+
* Handle for an analog action (joystick, trigger, etc.)
|
|
23
|
+
*/
|
|
24
|
+
export type InputAnalogActionHandle = bigint;
|
|
25
|
+
/**
|
|
26
|
+
* Constants for Steam Input
|
|
27
|
+
*/
|
|
28
|
+
export declare const STEAM_INPUT: {
|
|
29
|
+
/** Maximum number of controllers supported */
|
|
30
|
+
readonly MAX_COUNT: 16;
|
|
31
|
+
/** Maximum number of analog actions */
|
|
32
|
+
readonly MAX_ANALOG_ACTIONS: 24;
|
|
33
|
+
/** Maximum number of digital actions */
|
|
34
|
+
readonly MAX_DIGITAL_ACTIONS: 256;
|
|
35
|
+
/** Maximum number of origins for an action */
|
|
36
|
+
readonly MAX_ORIGINS: 8;
|
|
37
|
+
/** Maximum number of active action set layers */
|
|
38
|
+
readonly MAX_ACTIVE_LAYERS: 16;
|
|
39
|
+
/** Special handle to send commands to all controllers */
|
|
40
|
+
readonly HANDLE_ALL_CONTROLLERS: bigint;
|
|
41
|
+
/** Min value for analog action data */
|
|
42
|
+
readonly MIN_ANALOG_ACTION_DATA: -1;
|
|
43
|
+
/** Max value for analog action data */
|
|
44
|
+
readonly MAX_ANALOG_ACTION_DATA: 1;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Input source modes - describes how an analog action gets its data
|
|
48
|
+
*/
|
|
49
|
+
export declare enum InputSourceMode {
|
|
50
|
+
None = 0,
|
|
51
|
+
Dpad = 1,
|
|
52
|
+
Buttons = 2,
|
|
53
|
+
FourButtons = 3,
|
|
54
|
+
AbsoluteMouse = 4,
|
|
55
|
+
RelativeMouse = 5,
|
|
56
|
+
JoystickMove = 6,
|
|
57
|
+
JoystickMouse = 7,
|
|
58
|
+
JoystickCamera = 8,
|
|
59
|
+
ScrollWheel = 9,
|
|
60
|
+
Trigger = 10,
|
|
61
|
+
TouchMenu = 11,
|
|
62
|
+
MouseJoystick = 12,
|
|
63
|
+
MouseRegion = 13,
|
|
64
|
+
RadialMenu = 14,
|
|
65
|
+
SingleButton = 15,
|
|
66
|
+
Switches = 16
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Controller input types
|
|
70
|
+
* Note: This enum is stable and won't change with Steam updates
|
|
71
|
+
*/
|
|
72
|
+
export declare enum SteamInputType {
|
|
73
|
+
Unknown = 0,
|
|
74
|
+
SteamController = 1,
|
|
75
|
+
XBox360Controller = 2,
|
|
76
|
+
XBoxOneController = 3,
|
|
77
|
+
GenericGamepad = 4,
|
|
78
|
+
PS4Controller = 5,
|
|
79
|
+
AppleMFiController = 6,
|
|
80
|
+
AndroidController = 7,
|
|
81
|
+
SwitchJoyConPair = 8,
|
|
82
|
+
SwitchJoyConSingle = 9,
|
|
83
|
+
SwitchProController = 10,
|
|
84
|
+
MobileTouch = 11,
|
|
85
|
+
PS3Controller = 12,
|
|
86
|
+
PS5Controller = 13,
|
|
87
|
+
SteamDeckController = 14,
|
|
88
|
+
Count = 15,
|
|
89
|
+
MaximumPossibleValue = 255
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* LED flags for SetLEDColor
|
|
93
|
+
*/
|
|
94
|
+
export declare enum SteamInputLEDFlag {
|
|
95
|
+
/** Set the color */
|
|
96
|
+
SetColor = 0,
|
|
97
|
+
/** Restore the default color */
|
|
98
|
+
RestoreUserDefault = 1
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Glyph sizes for controller button icons
|
|
102
|
+
*/
|
|
103
|
+
export declare enum SteamInputGlyphSize {
|
|
104
|
+
Small = 0,
|
|
105
|
+
Medium = 1,
|
|
106
|
+
Large = 2,
|
|
107
|
+
Count = 3
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Glyph style flags for controller button icons
|
|
111
|
+
*/
|
|
112
|
+
export declare enum SteamInputGlyphStyle {
|
|
113
|
+
/** Use the default glyphs for the controller type */
|
|
114
|
+
Knockout = 0,
|
|
115
|
+
/** Black detail/borders on white background */
|
|
116
|
+
Light = 1,
|
|
117
|
+
/** White detail/borders on black background */
|
|
118
|
+
Dark = 2,
|
|
119
|
+
/** ABXY buttons match base color instead of physical colors */
|
|
120
|
+
NeutralColorABXY = 16,
|
|
121
|
+
/** ABXY buttons have solid fill */
|
|
122
|
+
SolidABXY = 32
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Haptic locations for Steam Controller
|
|
126
|
+
*/
|
|
127
|
+
export declare enum ControllerHapticLocation {
|
|
128
|
+
Left = 1,
|
|
129
|
+
Right = 2,
|
|
130
|
+
Both = 3
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Haptic pad locations for legacy API
|
|
134
|
+
*/
|
|
135
|
+
export declare enum SteamControllerPad {
|
|
136
|
+
Left = 0,
|
|
137
|
+
Right = 1
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Configuration enable types
|
|
141
|
+
*/
|
|
142
|
+
export declare enum SteamInputConfigurationEnableType {
|
|
143
|
+
None = 0,
|
|
144
|
+
Playstation = 1,
|
|
145
|
+
Xbox = 2,
|
|
146
|
+
Generic = 4,
|
|
147
|
+
Switch = 8
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Digital action data (button state)
|
|
151
|
+
*/
|
|
152
|
+
export interface InputDigitalActionData {
|
|
153
|
+
/** True if the button is currently pressed */
|
|
154
|
+
state: boolean;
|
|
155
|
+
/** True if this action is currently available in the active action set */
|
|
156
|
+
active: boolean;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Analog action data (joystick, trigger, etc.)
|
|
160
|
+
*/
|
|
161
|
+
export interface InputAnalogActionData {
|
|
162
|
+
/** Type of data (joystick, trigger, etc.) */
|
|
163
|
+
mode: InputSourceMode;
|
|
164
|
+
/** X-axis value (-1.0 to 1.0) */
|
|
165
|
+
x: number;
|
|
166
|
+
/** Y-axis value (-1.0 to 1.0) */
|
|
167
|
+
y: number;
|
|
168
|
+
/** True if this action is currently available in the active action set */
|
|
169
|
+
active: boolean;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Motion data from controller gyroscope and accelerometer
|
|
173
|
+
*/
|
|
174
|
+
export interface InputMotionData {
|
|
175
|
+
/** Quaternion X component for absolute rotation */
|
|
176
|
+
rotQuatX: number;
|
|
177
|
+
/** Quaternion Y component for absolute rotation */
|
|
178
|
+
rotQuatY: number;
|
|
179
|
+
/** Quaternion Z component for absolute rotation */
|
|
180
|
+
rotQuatZ: number;
|
|
181
|
+
/** Quaternion W component for absolute rotation */
|
|
182
|
+
rotQuatW: number;
|
|
183
|
+
/** Positional acceleration X (right side up is positive) */
|
|
184
|
+
posAccelX: number;
|
|
185
|
+
/** Positional acceleration Y (forward side up is positive) */
|
|
186
|
+
posAccelY: number;
|
|
187
|
+
/** Positional acceleration Z (sticks up is positive) */
|
|
188
|
+
posAccelZ: number;
|
|
189
|
+
/** Angular velocity X (local pitch in degrees/sec) */
|
|
190
|
+
rotVelX: number;
|
|
191
|
+
/** Angular velocity Y (local roll in degrees/sec) */
|
|
192
|
+
rotVelY: number;
|
|
193
|
+
/** Angular velocity Z (local yaw in degrees/sec) */
|
|
194
|
+
rotVelZ: number;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Controller information
|
|
198
|
+
*/
|
|
199
|
+
export interface ControllerInfo {
|
|
200
|
+
/** Controller handle */
|
|
201
|
+
handle: InputHandle;
|
|
202
|
+
/** Controller type */
|
|
203
|
+
type: SteamInputType;
|
|
204
|
+
/** Human-readable controller type name */
|
|
205
|
+
typeName: string;
|
|
206
|
+
/** Gamepad index if emulating XInput (-1 if not) */
|
|
207
|
+
gamepadIndex: number;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Action origin information for displaying button glyphs
|
|
211
|
+
*/
|
|
212
|
+
export interface ActionOriginInfo {
|
|
213
|
+
/** Path to PNG file for the button glyph */
|
|
214
|
+
glyphPNG?: string;
|
|
215
|
+
/** Path to SVG file for the button glyph */
|
|
216
|
+
glyphSVG?: string;
|
|
217
|
+
/** Localized string for the button name */
|
|
218
|
+
localizedString?: string;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Action set layer information
|
|
222
|
+
*/
|
|
223
|
+
export interface ActionSetLayer {
|
|
224
|
+
/** Handle for the layer */
|
|
225
|
+
handle: InputActionSetHandle;
|
|
226
|
+
/** Name of the layer */
|
|
227
|
+
name: string;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Device binding revision
|
|
231
|
+
*/
|
|
232
|
+
export interface DeviceBindingRevision {
|
|
233
|
+
/** Major version */
|
|
234
|
+
major: number;
|
|
235
|
+
/** Minor version */
|
|
236
|
+
minor: number;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Input action configuration for generating VDF files
|
|
240
|
+
*/
|
|
241
|
+
export interface InputActionConfig {
|
|
242
|
+
/** List of action sets */
|
|
243
|
+
actionSets: Array<{
|
|
244
|
+
/** Name of the action set */
|
|
245
|
+
name: string;
|
|
246
|
+
/** Digital actions (buttons) */
|
|
247
|
+
digitalActions?: string[];
|
|
248
|
+
/** Analog actions (sticks, triggers) */
|
|
249
|
+
analogActions?: string[];
|
|
250
|
+
}>;
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/types/input.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM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,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,MAAM,EAAE,WAAW,CAAC;IAEpB,sBAAsB;IACtB,IAAI,EAAE,cAAc,CAAC;IAErB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IAEjB,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,2CAA2C;IAC3C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,2BAA2B;IAC3B,MAAM,EAAE,oBAAoB,CAAC;IAE7B,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IAEd,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;IAC1B,UAAU,EAAE,KAAK,CAAC;QAChB,6BAA6B;QAC7B,IAAI,EAAE,MAAM,CAAC;QAEb,gCAAgC;QAChC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAE1B,wCAAwC;QACxC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC,CAAC;CACJ"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Steam Input types
|
|
4
|
+
*
|
|
5
|
+
* Types for Steam Input API which provides unified controller support
|
|
6
|
+
* across Xbox, PlayStation, Nintendo Switch, Steam Controller, and more.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SteamInputConfigurationEnableType = exports.SteamControllerPad = exports.ControllerHapticLocation = exports.SteamInputGlyphStyle = exports.SteamInputGlyphSize = exports.SteamInputLEDFlag = exports.SteamInputType = exports.InputSourceMode = exports.STEAM_INPUT = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Constants for Steam Input
|
|
12
|
+
*/
|
|
13
|
+
exports.STEAM_INPUT = {
|
|
14
|
+
/** Maximum number of controllers supported */
|
|
15
|
+
MAX_COUNT: 16,
|
|
16
|
+
/** Maximum number of analog actions */
|
|
17
|
+
MAX_ANALOG_ACTIONS: 24,
|
|
18
|
+
/** Maximum number of digital actions */
|
|
19
|
+
MAX_DIGITAL_ACTIONS: 256,
|
|
20
|
+
/** Maximum number of origins for an action */
|
|
21
|
+
MAX_ORIGINS: 8,
|
|
22
|
+
/** Maximum number of active action set layers */
|
|
23
|
+
MAX_ACTIVE_LAYERS: 16,
|
|
24
|
+
/** Special handle to send commands to all controllers */
|
|
25
|
+
HANDLE_ALL_CONTROLLERS: BigInt('0xFFFFFFFFFFFFFFFF'),
|
|
26
|
+
/** Min value for analog action data */
|
|
27
|
+
MIN_ANALOG_ACTION_DATA: -1.0,
|
|
28
|
+
/** Max value for analog action data */
|
|
29
|
+
MAX_ANALOG_ACTION_DATA: 1.0,
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Input source modes - describes how an analog action gets its data
|
|
33
|
+
*/
|
|
34
|
+
var InputSourceMode;
|
|
35
|
+
(function (InputSourceMode) {
|
|
36
|
+
InputSourceMode[InputSourceMode["None"] = 0] = "None";
|
|
37
|
+
InputSourceMode[InputSourceMode["Dpad"] = 1] = "Dpad";
|
|
38
|
+
InputSourceMode[InputSourceMode["Buttons"] = 2] = "Buttons";
|
|
39
|
+
InputSourceMode[InputSourceMode["FourButtons"] = 3] = "FourButtons";
|
|
40
|
+
InputSourceMode[InputSourceMode["AbsoluteMouse"] = 4] = "AbsoluteMouse";
|
|
41
|
+
InputSourceMode[InputSourceMode["RelativeMouse"] = 5] = "RelativeMouse";
|
|
42
|
+
InputSourceMode[InputSourceMode["JoystickMove"] = 6] = "JoystickMove";
|
|
43
|
+
InputSourceMode[InputSourceMode["JoystickMouse"] = 7] = "JoystickMouse";
|
|
44
|
+
InputSourceMode[InputSourceMode["JoystickCamera"] = 8] = "JoystickCamera";
|
|
45
|
+
InputSourceMode[InputSourceMode["ScrollWheel"] = 9] = "ScrollWheel";
|
|
46
|
+
InputSourceMode[InputSourceMode["Trigger"] = 10] = "Trigger";
|
|
47
|
+
InputSourceMode[InputSourceMode["TouchMenu"] = 11] = "TouchMenu";
|
|
48
|
+
InputSourceMode[InputSourceMode["MouseJoystick"] = 12] = "MouseJoystick";
|
|
49
|
+
InputSourceMode[InputSourceMode["MouseRegion"] = 13] = "MouseRegion";
|
|
50
|
+
InputSourceMode[InputSourceMode["RadialMenu"] = 14] = "RadialMenu";
|
|
51
|
+
InputSourceMode[InputSourceMode["SingleButton"] = 15] = "SingleButton";
|
|
52
|
+
InputSourceMode[InputSourceMode["Switches"] = 16] = "Switches";
|
|
53
|
+
})(InputSourceMode || (exports.InputSourceMode = InputSourceMode = {}));
|
|
54
|
+
/**
|
|
55
|
+
* Controller input types
|
|
56
|
+
* Note: This enum is stable and won't change with Steam updates
|
|
57
|
+
*/
|
|
58
|
+
var SteamInputType;
|
|
59
|
+
(function (SteamInputType) {
|
|
60
|
+
SteamInputType[SteamInputType["Unknown"] = 0] = "Unknown";
|
|
61
|
+
SteamInputType[SteamInputType["SteamController"] = 1] = "SteamController";
|
|
62
|
+
SteamInputType[SteamInputType["XBox360Controller"] = 2] = "XBox360Controller";
|
|
63
|
+
SteamInputType[SteamInputType["XBoxOneController"] = 3] = "XBoxOneController";
|
|
64
|
+
SteamInputType[SteamInputType["GenericGamepad"] = 4] = "GenericGamepad";
|
|
65
|
+
SteamInputType[SteamInputType["PS4Controller"] = 5] = "PS4Controller";
|
|
66
|
+
SteamInputType[SteamInputType["AppleMFiController"] = 6] = "AppleMFiController";
|
|
67
|
+
SteamInputType[SteamInputType["AndroidController"] = 7] = "AndroidController";
|
|
68
|
+
SteamInputType[SteamInputType["SwitchJoyConPair"] = 8] = "SwitchJoyConPair";
|
|
69
|
+
SteamInputType[SteamInputType["SwitchJoyConSingle"] = 9] = "SwitchJoyConSingle";
|
|
70
|
+
SteamInputType[SteamInputType["SwitchProController"] = 10] = "SwitchProController";
|
|
71
|
+
SteamInputType[SteamInputType["MobileTouch"] = 11] = "MobileTouch";
|
|
72
|
+
SteamInputType[SteamInputType["PS3Controller"] = 12] = "PS3Controller";
|
|
73
|
+
SteamInputType[SteamInputType["PS5Controller"] = 13] = "PS5Controller";
|
|
74
|
+
SteamInputType[SteamInputType["SteamDeckController"] = 14] = "SteamDeckController";
|
|
75
|
+
SteamInputType[SteamInputType["Count"] = 15] = "Count";
|
|
76
|
+
SteamInputType[SteamInputType["MaximumPossibleValue"] = 255] = "MaximumPossibleValue";
|
|
77
|
+
})(SteamInputType || (exports.SteamInputType = SteamInputType = {}));
|
|
78
|
+
/**
|
|
79
|
+
* LED flags for SetLEDColor
|
|
80
|
+
*/
|
|
81
|
+
var SteamInputLEDFlag;
|
|
82
|
+
(function (SteamInputLEDFlag) {
|
|
83
|
+
/** Set the color */
|
|
84
|
+
SteamInputLEDFlag[SteamInputLEDFlag["SetColor"] = 0] = "SetColor";
|
|
85
|
+
/** Restore the default color */
|
|
86
|
+
SteamInputLEDFlag[SteamInputLEDFlag["RestoreUserDefault"] = 1] = "RestoreUserDefault";
|
|
87
|
+
})(SteamInputLEDFlag || (exports.SteamInputLEDFlag = SteamInputLEDFlag = {}));
|
|
88
|
+
/**
|
|
89
|
+
* Glyph sizes for controller button icons
|
|
90
|
+
*/
|
|
91
|
+
var SteamInputGlyphSize;
|
|
92
|
+
(function (SteamInputGlyphSize) {
|
|
93
|
+
SteamInputGlyphSize[SteamInputGlyphSize["Small"] = 0] = "Small";
|
|
94
|
+
SteamInputGlyphSize[SteamInputGlyphSize["Medium"] = 1] = "Medium";
|
|
95
|
+
SteamInputGlyphSize[SteamInputGlyphSize["Large"] = 2] = "Large";
|
|
96
|
+
SteamInputGlyphSize[SteamInputGlyphSize["Count"] = 3] = "Count";
|
|
97
|
+
})(SteamInputGlyphSize || (exports.SteamInputGlyphSize = SteamInputGlyphSize = {}));
|
|
98
|
+
/**
|
|
99
|
+
* Glyph style flags for controller button icons
|
|
100
|
+
*/
|
|
101
|
+
var SteamInputGlyphStyle;
|
|
102
|
+
(function (SteamInputGlyphStyle) {
|
|
103
|
+
/** Use the default glyphs for the controller type */
|
|
104
|
+
SteamInputGlyphStyle[SteamInputGlyphStyle["Knockout"] = 0] = "Knockout";
|
|
105
|
+
/** Black detail/borders on white background */
|
|
106
|
+
SteamInputGlyphStyle[SteamInputGlyphStyle["Light"] = 1] = "Light";
|
|
107
|
+
/** White detail/borders on black background */
|
|
108
|
+
SteamInputGlyphStyle[SteamInputGlyphStyle["Dark"] = 2] = "Dark";
|
|
109
|
+
/** ABXY buttons match base color instead of physical colors */
|
|
110
|
+
SteamInputGlyphStyle[SteamInputGlyphStyle["NeutralColorABXY"] = 16] = "NeutralColorABXY";
|
|
111
|
+
/** ABXY buttons have solid fill */
|
|
112
|
+
SteamInputGlyphStyle[SteamInputGlyphStyle["SolidABXY"] = 32] = "SolidABXY";
|
|
113
|
+
})(SteamInputGlyphStyle || (exports.SteamInputGlyphStyle = SteamInputGlyphStyle = {}));
|
|
114
|
+
/**
|
|
115
|
+
* Haptic locations for Steam Controller
|
|
116
|
+
*/
|
|
117
|
+
var ControllerHapticLocation;
|
|
118
|
+
(function (ControllerHapticLocation) {
|
|
119
|
+
ControllerHapticLocation[ControllerHapticLocation["Left"] = 1] = "Left";
|
|
120
|
+
ControllerHapticLocation[ControllerHapticLocation["Right"] = 2] = "Right";
|
|
121
|
+
ControllerHapticLocation[ControllerHapticLocation["Both"] = 3] = "Both";
|
|
122
|
+
})(ControllerHapticLocation || (exports.ControllerHapticLocation = ControllerHapticLocation = {}));
|
|
123
|
+
/**
|
|
124
|
+
* Haptic pad locations for legacy API
|
|
125
|
+
*/
|
|
126
|
+
var SteamControllerPad;
|
|
127
|
+
(function (SteamControllerPad) {
|
|
128
|
+
SteamControllerPad[SteamControllerPad["Left"] = 0] = "Left";
|
|
129
|
+
SteamControllerPad[SteamControllerPad["Right"] = 1] = "Right";
|
|
130
|
+
})(SteamControllerPad || (exports.SteamControllerPad = SteamControllerPad = {}));
|
|
131
|
+
/**
|
|
132
|
+
* Configuration enable types
|
|
133
|
+
*/
|
|
134
|
+
var SteamInputConfigurationEnableType;
|
|
135
|
+
(function (SteamInputConfigurationEnableType) {
|
|
136
|
+
SteamInputConfigurationEnableType[SteamInputConfigurationEnableType["None"] = 0] = "None";
|
|
137
|
+
SteamInputConfigurationEnableType[SteamInputConfigurationEnableType["Playstation"] = 1] = "Playstation";
|
|
138
|
+
SteamInputConfigurationEnableType[SteamInputConfigurationEnableType["Xbox"] = 2] = "Xbox";
|
|
139
|
+
SteamInputConfigurationEnableType[SteamInputConfigurationEnableType["Generic"] = 4] = "Generic";
|
|
140
|
+
SteamInputConfigurationEnableType[SteamInputConfigurationEnableType["Switch"] = 8] = "Switch";
|
|
141
|
+
})(SteamInputConfigurationEnableType || (exports.SteamInputConfigurationEnableType = SteamInputConfigurationEnableType = {}));
|
|
142
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/types/input.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAwBH;;GAEG;AACU,QAAA,WAAW,GAAG;IACzB,8CAA8C;IAC9C,SAAS,EAAE,EAAE;IAEb,uCAAuC;IACvC,kBAAkB,EAAE,EAAE;IAEtB,wCAAwC;IACxC,mBAAmB,EAAE,GAAG;IAExB,8CAA8C;IAC9C,WAAW,EAAE,CAAC;IAEd,iDAAiD;IACjD,iBAAiB,EAAE,EAAE;IAErB,yDAAyD;IACzD,s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7B,+DAAS,CAAA;IACT,iEAAU,CAAA;IACV,+DAAS,CAAA;IACT,+DAAS,CAAA;AACX,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AAED;;GAEG;AACH,IAAY,oBAWX;AAXD,WAAY,oBAAoB;IAC9B,qDAAqD;IACrD,uEAAc,CAAA;IACd,+CAA+C;IAC/C,iEAAW,CAAA;IACX,+CAA+C;IAC/C,+DAAU,CAAA;IACV,+DAA+D;IAC/D,wFAAuB,CAAA;IACvB,mCAAmC;IACnC,0EAAgB,CAAA;AAClB,CAAC,EAXW,oBAAoB,oCAApB,oBAAoB,QAW/B;AAED;;GAEG;AACH,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,uEAAe,CAAA;IACf,yEAAgB,CAAA;IAChB,uEAA0B,CAAA;AAC5B,CAAC,EAJW,wBAAwB,wCAAxB,wBAAwB,QAInC;AAED;;GAEG;AACH,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,2DAAQ,CAAA;IACR,6DAAS,CAAA;AACX,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED;;GAEG;AACH,IAAY,iCAMX;AAND,WAAY,iCAAiC;IAC3C,yFAAa,CAAA;IACb,uGAAoB,CAAA;IACpB,yFAAa,CAAA;IACb,+FAAgB,CAAA;IAChB,6FAAe,CAAA;AACjB,CAAC,EANW,iCAAiC,iDAAjC,iCAAiC,QAM5C"}
|
package/docs/README.md
CHANGED
|
@@ -9,12 +9,12 @@ Steamworks FFI uses a **manager-based architecture** for better organization:
|
|
|
9
9
|
```typescript
|
|
10
10
|
import SteamworksSDK from 'steamworks-ffi-node';
|
|
11
11
|
|
|
12
|
-
const steam =
|
|
12
|
+
const steam = SteamworksSDK.getInstance();
|
|
13
13
|
steam.init({ appId: 480 });
|
|
14
14
|
|
|
15
15
|
// Access features through specialized managers
|
|
16
16
|
steam.achievements.* // Achievement operations
|
|
17
|
-
steam.stats.* // Statistics operations
|
|
17
|
+
steam.stats.* // Statistics operations
|
|
18
18
|
steam.leaderboards.* // Leaderboard operations
|
|
19
19
|
steam.friends.* // Friends and social operations
|
|
20
20
|
steam.richPresence.* // Rich Presence operations
|
|
@@ -24,6 +24,7 @@ steam.workshop.* // Workshop/UGC operations
|
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
This design:
|
|
27
|
+
|
|
27
28
|
- ✅ **Groups related functions** - Easy to discover all achievement/stats/leaderboard methods
|
|
28
29
|
- ✅ **Clear namespacing** - No naming conflicts
|
|
29
30
|
- ✅ **Better IDE support** - Autocomplete shows relevant methods
|
|
@@ -34,6 +35,7 @@ This design:
|
|
|
34
35
|
## 📚 Available Documentation
|
|
35
36
|
|
|
36
37
|
### Core API
|
|
38
|
+
|
|
37
39
|
- **[SteamAPICore Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/STEAM_API_CORE.md)**
|
|
38
40
|
- Initialization and lifecycle management
|
|
39
41
|
- Steam callbacks and event handling
|
|
@@ -41,6 +43,7 @@ This design:
|
|
|
41
43
|
- Platform-specific library loading
|
|
42
44
|
|
|
43
45
|
### Achievement System
|
|
46
|
+
|
|
44
47
|
- **[Achievement Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/ACHIEVEMENT_MANAGER.md)**
|
|
45
48
|
- **20 Functions** - 100% Achievement API coverage
|
|
46
49
|
- Core operations (get, unlock, clear, check status)
|
|
@@ -51,6 +54,7 @@ This design:
|
|
|
51
54
|
- Testing tools (reset stats/achievements)
|
|
52
55
|
|
|
53
56
|
### Statistics System
|
|
57
|
+
|
|
54
58
|
- **[Stats Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/STATS_MANAGER.md)**
|
|
55
59
|
- **14 Functions** - 100% Stats API coverage
|
|
56
60
|
- User stats (get/set int/float, average rate tracking)
|
|
@@ -58,6 +62,7 @@ This design:
|
|
|
58
62
|
- Global statistics (worldwide aggregated data with history)
|
|
59
63
|
|
|
60
64
|
### Leaderboard System
|
|
65
|
+
|
|
61
66
|
- **[Leaderboard Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/LEADERBOARD_MANAGER.md)**
|
|
62
67
|
- **7 Functions** - 100% Leaderboard API coverage
|
|
63
68
|
- Leaderboard management (find, create, get info)
|
|
@@ -66,6 +71,7 @@ This design:
|
|
|
66
71
|
- UGC integration (attach replays/screenshots to entries)
|
|
67
72
|
|
|
68
73
|
### Friends & Social System
|
|
74
|
+
|
|
69
75
|
- **[Friends Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/FRIENDS_MANAGER.md)**
|
|
70
76
|
- **22 Functions** - Complete friends and social features
|
|
71
77
|
- Current user info (get persona name, online status)
|
|
@@ -77,6 +83,7 @@ This design:
|
|
|
77
83
|
- Coplay tracking (recently played with users)
|
|
78
84
|
|
|
79
85
|
### Rich Presence System
|
|
86
|
+
|
|
80
87
|
- **[Rich Presence Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/RICH_PRESENCE_MANAGER.md)**
|
|
81
88
|
- **6 Functions** - Complete Rich Presence support
|
|
82
89
|
- Set/clear rich presence key/value pairs
|
|
@@ -86,6 +93,7 @@ This design:
|
|
|
86
93
|
- Player groups and localization support
|
|
87
94
|
|
|
88
95
|
### Overlay System
|
|
96
|
+
|
|
89
97
|
- **[Overlay Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/OVERLAY_MANAGER.md)**
|
|
90
98
|
- **7 Functions** - Complete overlay control
|
|
91
99
|
- Open overlay to various dialogs (friends, achievements, etc.)
|
|
@@ -95,6 +103,7 @@ This design:
|
|
|
95
103
|
- Show invite dialogs for multiplayer
|
|
96
104
|
|
|
97
105
|
### Cloud Storage System
|
|
106
|
+
|
|
98
107
|
- **[Cloud Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/CLOUD_MANAGER.md)**
|
|
99
108
|
- **14 Functions** - Complete Steam Cloud (Remote Storage) support
|
|
100
109
|
- File operations (write, read, delete, check existence)
|
|
@@ -104,6 +113,7 @@ This design:
|
|
|
104
113
|
- Cloud settings (check/toggle cloud sync for account and app)
|
|
105
114
|
|
|
106
115
|
### Workshop System
|
|
116
|
+
|
|
107
117
|
- **[Workshop Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/WORKSHOP_MANAGER.md)**
|
|
108
118
|
- **29 Functions** - Complete Steam Workshop/UGC support
|
|
109
119
|
- Subscription management (subscribe, unsubscribe, list items)
|
|
@@ -112,9 +122,21 @@ This design:
|
|
|
112
122
|
- Item creation & update (create, upload, manage your Workshop items)
|
|
113
123
|
- Voting & favorites (vote on items, manage favorites)
|
|
114
124
|
|
|
125
|
+
### Input System
|
|
126
|
+
|
|
127
|
+
- **[Input Manager API](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/INPUT_MANAGER.md)**
|
|
128
|
+
- **35+ Functions** - Complete Steam Input (controller) support
|
|
129
|
+
- Controller detection (Xbox, PlayStation, Switch, Steam Controller, Steam Deck)
|
|
130
|
+
- Action sets and layers (menu controls, gameplay controls, etc.)
|
|
131
|
+
- Digital actions (buttons) and analog actions (sticks/triggers)
|
|
132
|
+
- Motion data (gyro, accelerometer for supported controllers)
|
|
133
|
+
- Haptics (vibration, LED control for DualShock/DualSense)
|
|
134
|
+
- ⚠️ **Tested with virtual gamepad only** - not yet tested in production projects
|
|
135
|
+
|
|
115
136
|
## 🚀 Quick Links
|
|
116
137
|
|
|
117
138
|
### Getting Started
|
|
139
|
+
|
|
118
140
|
- [Installation Guide](https://github.com/ArtyProf/steamworks-ffi-node#installation)
|
|
119
141
|
- [Quick Start Examples](https://github.com/ArtyProf/steamworks-ffi-node#quick-start)
|
|
120
142
|
- [Electron Integration](https://github.com/ArtyProf/steamworks-ffi-node#electron-integration)
|
|
@@ -122,6 +144,7 @@ This design:
|
|
|
122
144
|
### Testing
|
|
123
145
|
|
|
124
146
|
**JavaScript Tests** (Production - Uses compiled dist/):
|
|
147
|
+
|
|
125
148
|
- Run Achievement Tests: `npm run test:achievements:js` - Tests all 20 achievement functions
|
|
126
149
|
- Run Stats Tests: `npm run test:stats:js` - Tests all 14 stats functions
|
|
127
150
|
- Run Leaderboard Tests: `npm run test:leaderboards:js` - Tests all 7 leaderboard functions
|
|
@@ -129,8 +152,10 @@ This design:
|
|
|
129
152
|
- Run Cloud Tests: `npm run test:cloud:js` - Tests all 14 cloud storage functions
|
|
130
153
|
- Run Rich Presence & Overlay Tests: `npm run test:richpresence-overlay:js` - Tests 6 rich presence + 7 overlay functions
|
|
131
154
|
- Run Workshop Tests: `npm run test:workshop:js` - Tests all 29 Workshop/UGC functions
|
|
155
|
+
- Run Input Tests: `npm run test:input-xbox:js` or `npm run test:input-ps4:js` - Tests 35+ input functions with virtual gamepad
|
|
132
156
|
|
|
133
157
|
**TypeScript Tests** (Development - Direct src/ imports, no rebuild needed):
|
|
158
|
+
|
|
134
159
|
- Run Achievement Tests: `npm run test:achievements:ts` - With type safety ✨
|
|
135
160
|
- Run Stats Tests: `npm run test:stats:ts` - With type safety ✨
|
|
136
161
|
- Run Leaderboard Tests: `npm run test:leaderboards:ts` - With type safety ✨
|
|
@@ -138,12 +163,14 @@ This design:
|
|
|
138
163
|
- Run Cloud Tests: `npm run test:cloud:ts` - With type safety ✨
|
|
139
164
|
- Run Rich Presence & Overlay Tests: `npm run test:richpresence-overlay:ts` - With type safety ✨
|
|
140
165
|
- Run Workshop Tests: `npm run test:workshop:ts` - With type safety ✨
|
|
166
|
+
- Run Input Tests: `npm run test:input-xbox:ts` or `npm run test:input-ps4:ts` - With type safety ✨
|
|
141
167
|
|
|
142
168
|
📁 All tests are in `tests/` folder with separate `js/` and `ts/` subfolders.
|
|
143
169
|
|
|
144
170
|
💡 **Pro tip**: TypeScript tests import directly from `src/` so you can test changes immediately without running `npm run build`!
|
|
145
171
|
|
|
146
172
|
### Additional Resources
|
|
173
|
+
|
|
147
174
|
- [GitHub Repository](https://github.com/ArtyProf/steamworks-ffi-node)
|
|
148
175
|
- [NPM Package](https://www.npmjs.com/package/steamworks-ffi-node)
|
|
149
176
|
- [Report Issues](https://github.com/ArtyProf/steamworks-ffi-node/issues)
|
|
@@ -153,6 +180,7 @@ This design:
|
|
|
153
180
|
## 📖 Documentation Structure
|
|
154
181
|
|
|
155
182
|
Each API documentation includes:
|
|
183
|
+
|
|
156
184
|
- **Overview** - Architecture and design patterns
|
|
157
185
|
- **Quick Reference** - Function categories and counts
|
|
158
186
|
- **Detailed Functions** - Parameters, returns, SDK mappings, examples
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "steamworks-ffi-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Steamworks SDK wrapper using FFI for Node.js/Electron - Full Steam Integration",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"test:cloud:js": "node tests/js/test-complete-cloud.js",
|
|
17
17
|
"test:workshop:js": "node tests/js/test-workshop.js",
|
|
18
18
|
"test:richpresence-overlay:js": "node tests/js/test-richpresence-overlay.js",
|
|
19
|
+
"test:input:js": "node tests/js/test-input.js",
|
|
20
|
+
"test:input-xbox:js": "node tests/js/test-input.js --virtual --type=xbox",
|
|
21
|
+
"test:input-ps4:js": "node tests/js/test-input.js --virtual --type=ps4",
|
|
19
22
|
"test:core:ts": "ts-node tests/ts/test-core-api.ts",
|
|
20
23
|
"test:achievements:ts": "ts-node tests/ts/test-complete-achievements.ts",
|
|
21
24
|
"test:stats:ts": "ts-node tests/ts/test-complete-stats.ts",
|
|
@@ -24,13 +27,16 @@
|
|
|
24
27
|
"test:cloud:ts": "ts-node tests/ts/test-complete-cloud.ts",
|
|
25
28
|
"test:workshop:ts": "ts-node tests/ts/test-workshop.ts",
|
|
26
29
|
"test:richpresence-overlay:ts": "ts-node tests/ts/test-richpresence-overlay.ts",
|
|
30
|
+
"test:input:ts": "ts-node tests/ts/test-input.ts",
|
|
31
|
+
"test:input-xbox:ts": "ts-node tests/ts/test-input.ts --virtual --type=xbox",
|
|
32
|
+
"test:input-ps4:ts": "ts-node tests/ts/test-input.ts --virtual --type=ps4",
|
|
27
33
|
"prepublishOnly": "npm run build"
|
|
28
34
|
},
|
|
29
35
|
"dependencies": {
|
|
30
36
|
"koffi": "^2.8.8"
|
|
31
37
|
},
|
|
32
38
|
"devDependencies": {
|
|
33
|
-
"@types/node": "^
|
|
39
|
+
"@types/node": "^24.10.1",
|
|
34
40
|
"ts-node": "^10.9.2",
|
|
35
41
|
"typescript": "^5.0.0"
|
|
36
42
|
},
|
package/verify-sdk-setup.js
CHANGED
|
@@ -181,13 +181,13 @@ function testBasicFunctionality() {
|
|
|
181
181
|
try {
|
|
182
182
|
console.log('Attempting to load steamworks-ffi-node...');
|
|
183
183
|
|
|
184
|
-
// Try to require the package
|
|
185
|
-
const SteamworksSDK = require('./dist/index.js')
|
|
184
|
+
// Try to require the package (named export is preferred)
|
|
185
|
+
const { SteamworksSDK } = require('./dist/index.js');
|
|
186
186
|
console.log('✅ Package loaded successfully');
|
|
187
187
|
|
|
188
188
|
// Try to create instance (this will test SDK loading)
|
|
189
189
|
console.log('Testing SDK initialization...');
|
|
190
|
-
|
|
190
|
+
SteamworksSDK.getInstance();
|
|
191
191
|
console.log('✅ SteamworksSDK instance created');
|
|
192
192
|
|
|
193
193
|
console.log('');
|