@openmouse/protocol 0.42.2 → 0.43.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.
Files changed (122) hide show
  1. package/dist/drivers/registry.d.ts +13 -1
  2. package/dist/drivers/registry.d.ts.map +1 -1
  3. package/dist/drivers/registry.js +24 -0
  4. package/dist/drivers/registry.js.map +1 -1
  5. package/dist/drivers/steelseries/aerox-3-wireless-gen2-hid.d.ts +65 -0
  6. package/dist/drivers/steelseries/aerox-3-wireless-gen2-hid.d.ts.map +1 -0
  7. package/dist/drivers/steelseries/aerox-3-wireless-gen2-hid.js +205 -0
  8. package/dist/drivers/steelseries/aerox-3-wireless-gen2-hid.js.map +1 -0
  9. package/dist/drivers/steelseries/prime-mini-hid.d.ts +59 -0
  10. package/dist/drivers/steelseries/prime-mini-hid.d.ts.map +1 -0
  11. package/dist/drivers/steelseries/prime-mini-hid.js +183 -0
  12. package/dist/drivers/steelseries/prime-mini-hid.js.map +1 -0
  13. package/dist/drivers/steelseries/rival-100-hid.d.ts +57 -0
  14. package/dist/drivers/steelseries/rival-100-hid.d.ts.map +1 -0
  15. package/dist/drivers/steelseries/rival-100-hid.js +181 -0
  16. package/dist/drivers/steelseries/rival-100-hid.js.map +1 -0
  17. package/dist/drivers/steelseries/rival-110-hid.d.ts +78 -0
  18. package/dist/drivers/steelseries/rival-110-hid.d.ts.map +1 -0
  19. package/dist/drivers/steelseries/rival-110-hid.js +206 -0
  20. package/dist/drivers/steelseries/rival-110-hid.js.map +1 -0
  21. package/dist/drivers/steelseries/rival-3-v2-hid.d.ts +59 -0
  22. package/dist/drivers/steelseries/rival-3-v2-hid.d.ts.map +1 -0
  23. package/dist/drivers/steelseries/rival-3-v2-hid.js +183 -0
  24. package/dist/drivers/steelseries/rival-3-v2-hid.js.map +1 -0
  25. package/dist/drivers/steelseries/rival-3-wireless-v2-hid.d.ts +64 -0
  26. package/dist/drivers/steelseries/rival-3-wireless-v2-hid.d.ts.map +1 -0
  27. package/dist/drivers/steelseries/rival-3-wireless-v2-hid.js +199 -0
  28. package/dist/drivers/steelseries/rival-3-wireless-v2-hid.js.map +1 -0
  29. package/dist/drivers/steelseries/rival-300-hid.d.ts +78 -0
  30. package/dist/drivers/steelseries/rival-300-hid.d.ts.map +1 -0
  31. package/dist/drivers/steelseries/rival-300-hid.js +206 -0
  32. package/dist/drivers/steelseries/rival-300-hid.js.map +1 -0
  33. package/dist/drivers/steelseries/rival-5-hid.d.ts +55 -0
  34. package/dist/drivers/steelseries/rival-5-hid.d.ts.map +1 -0
  35. package/dist/drivers/steelseries/rival-5-hid.js +177 -0
  36. package/dist/drivers/steelseries/rival-5-hid.js.map +1 -0
  37. package/dist/drivers/steelseries/rival-600-hid.d.ts +65 -0
  38. package/dist/drivers/steelseries/rival-600-hid.d.ts.map +1 -0
  39. package/dist/drivers/steelseries/rival-600-hid.js +184 -0
  40. package/dist/drivers/steelseries/rival-600-hid.js.map +1 -0
  41. package/dist/drivers/steelseries/sensei-310-hid.d.ts +54 -0
  42. package/dist/drivers/steelseries/sensei-310-hid.d.ts.map +1 -0
  43. package/dist/drivers/steelseries/sensei-310-hid.js +177 -0
  44. package/dist/drivers/steelseries/sensei-310-hid.js.map +1 -0
  45. package/dist/drivers/steelseries/sensei-raw-hid.d.ts +75 -0
  46. package/dist/drivers/steelseries/sensei-raw-hid.d.ts.map +1 -0
  47. package/dist/drivers/steelseries/sensei-raw-hid.js +199 -0
  48. package/dist/drivers/steelseries/sensei-raw-hid.js.map +1 -0
  49. package/dist/drivers/steelseries/sensei-rival-pro-hid.d.ts +42 -0
  50. package/dist/drivers/steelseries/sensei-rival-pro-hid.d.ts.map +1 -0
  51. package/dist/drivers/steelseries/sensei-rival-pro-hid.js +132 -0
  52. package/dist/drivers/steelseries/sensei-rival-pro-hid.js.map +1 -0
  53. package/dist/finalmouse/index.d.ts.map +1 -1
  54. package/dist/finalmouse/index.js +6 -2
  55. package/dist/finalmouse/index.js.map +1 -1
  56. package/dist/steelseries/aerox-3-wireless-gen2.d.ts +204 -0
  57. package/dist/steelseries/aerox-3-wireless-gen2.d.ts.map +1 -0
  58. package/dist/steelseries/aerox-3-wireless-gen2.js +301 -0
  59. package/dist/steelseries/aerox-3-wireless-gen2.js.map +1 -0
  60. package/dist/steelseries/aerox3.d.ts +3 -3
  61. package/dist/steelseries/aerox3.js +3 -3
  62. package/dist/steelseries/devices.d.ts +31 -14
  63. package/dist/steelseries/devices.d.ts.map +1 -1
  64. package/dist/steelseries/devices.js +417 -13
  65. package/dist/steelseries/devices.js.map +1 -1
  66. package/dist/steelseries/index.d.ts +12 -0
  67. package/dist/steelseries/index.d.ts.map +1 -1
  68. package/dist/steelseries/index.js +12 -0
  69. package/dist/steelseries/index.js.map +1 -1
  70. package/dist/steelseries/prime-mini-wireless.d.ts +9 -14
  71. package/dist/steelseries/prime-mini-wireless.d.ts.map +1 -1
  72. package/dist/steelseries/prime-mini-wireless.js +9 -14
  73. package/dist/steelseries/prime-mini-wireless.js.map +1 -1
  74. package/dist/steelseries/prime-mini.d.ts +173 -0
  75. package/dist/steelseries/prime-mini.d.ts.map +1 -0
  76. package/dist/steelseries/prime-mini.js +273 -0
  77. package/dist/steelseries/prime-mini.js.map +1 -0
  78. package/dist/steelseries/prime-plus.d.ts +5 -4
  79. package/dist/steelseries/prime-plus.d.ts.map +1 -1
  80. package/dist/steelseries/prime-plus.js +5 -4
  81. package/dist/steelseries/prime-plus.js.map +1 -1
  82. package/dist/steelseries/rival-100.d.ts +134 -0
  83. package/dist/steelseries/rival-100.d.ts.map +1 -0
  84. package/dist/steelseries/rival-100.js +195 -0
  85. package/dist/steelseries/rival-100.js.map +1 -0
  86. package/dist/steelseries/rival-110.d.ts +134 -0
  87. package/dist/steelseries/rival-110.d.ts.map +1 -0
  88. package/dist/steelseries/rival-110.js +205 -0
  89. package/dist/steelseries/rival-110.js.map +1 -0
  90. package/dist/steelseries/rival-3-v2.d.ts +168 -0
  91. package/dist/steelseries/rival-3-v2.d.ts.map +1 -0
  92. package/dist/steelseries/rival-3-v2.js +242 -0
  93. package/dist/steelseries/rival-3-v2.js.map +1 -0
  94. package/dist/steelseries/rival-3-wireless-v2.d.ts +219 -0
  95. package/dist/steelseries/rival-3-wireless-v2.d.ts.map +1 -0
  96. package/dist/steelseries/rival-3-wireless-v2.js +270 -0
  97. package/dist/steelseries/rival-3-wireless-v2.js.map +1 -0
  98. package/dist/steelseries/rival-300.d.ts +163 -0
  99. package/dist/steelseries/rival-300.d.ts.map +1 -0
  100. package/dist/steelseries/rival-300.js +266 -0
  101. package/dist/steelseries/rival-300.js.map +1 -0
  102. package/dist/steelseries/rival-5.d.ts +165 -0
  103. package/dist/steelseries/rival-5.d.ts.map +1 -0
  104. package/dist/steelseries/rival-5.js +212 -0
  105. package/dist/steelseries/rival-5.js.map +1 -0
  106. package/dist/steelseries/rival-600.d.ts +194 -0
  107. package/dist/steelseries/rival-600.d.ts.map +1 -0
  108. package/dist/steelseries/rival-600.js +262 -0
  109. package/dist/steelseries/rival-600.js.map +1 -0
  110. package/dist/steelseries/sensei-310.d.ts +162 -0
  111. package/dist/steelseries/sensei-310.d.ts.map +1 -0
  112. package/dist/steelseries/sensei-310.js +250 -0
  113. package/dist/steelseries/sensei-310.js.map +1 -0
  114. package/dist/steelseries/sensei-raw.d.ts +169 -0
  115. package/dist/steelseries/sensei-raw.d.ts.map +1 -0
  116. package/dist/steelseries/sensei-raw.js +233 -0
  117. package/dist/steelseries/sensei-raw.js.map +1 -0
  118. package/dist/steelseries/sensei-rival-pro.d.ts +214 -0
  119. package/dist/steelseries/sensei-rival-pro.d.ts.map +1 -0
  120. package/dist/steelseries/sensei-rival-pro.js +298 -0
  121. package/dist/steelseries/sensei-rival-pro.js.map +1 -0
  122. package/package.json +1 -1
@@ -0,0 +1,168 @@
1
+ /**
2
+ * SteelSeries Rival 3 Gen 2 configuration protocol — pure encode/decode helpers.
3
+ *
4
+ * Reconstructed from the vendor's own software, not from a third-party
5
+ * reimplementation: SteelSeries GG 121.0.0 ships `rival-3-v2.lisp` under
6
+ * `apps/engine/install/deviceSpecifications/`, and this module transcribes
7
+ * it. Those files are OpenPGP-armored ("DESCRIPTOR" armor, SKESK/AES-128);
8
+ * the bytes below are the documented HID report payloads, not guesses.
9
+ * rivalcfg's mainline `rival3_gen2.py` corroborates the product id, the
10
+ * `0x34` XY-DPI command shape, and most other command bytes — but see the
11
+ * DPI table note below, where the two sources disagree.
12
+ *
13
+ * Despite the shared "Rival 3" name this is a different command set from
14
+ * Rival 3 Gen 1 (`./rival3.ts`: two-byte `0x0B 0x00` DPI, `0x04 0x00`
15
+ * polling, `0x09 0x00` save) and from Aerox 3 (`./aerox3.ts`). Command
16
+ * bytes here are single-byte prefixes with a `write-op`/`read-op` framing
17
+ * convention; on this wired-only mouse both masks are `0x00`, so the bytes
18
+ * go on the wire as written.
19
+ *
20
+ * Every command is an HID **output report** with report id 0x00 (65-byte
21
+ * reports throughout the specification).
22
+ *
23
+ * DPI uses an XY batch (`0x34`): `num_cpi_levels` (1–5), `index` (0–4,
24
+ * 0-based), then a 10-byte interleaved table (x0, y0, x1, y1, …), one
25
+ * sensor byte per axis value. The sensor table is TrueMove Core shaped
26
+ * (200–8500), transcribed here from the vendor file's own
27
+ * `convert_cpi_fw_to_driver` case table — **not** imported from
28
+ * `./rival3.ts`'s `TRUEMOVE_CORE_DPI_TO_BYTE`, because the two disagree on
29
+ * 23 entries: the vendor file says `0x49→3200` where rivalcfg says
30
+ * `0x4A→3200`, and similarly one byte lower at 22 other DPI steps (2300,
31
+ * 2600, 2900, 3500, 3800, …). The vendor table is self-consistent with the
32
+ * vendor's own factory defaults (Aerox 3's default preset bytes
33
+ * 8/18/27/55/73 decode to exactly 400/800/1200/2400/3200 under it, while
34
+ * `0x49` is absent from rivalcfg's table), so this module follows the
35
+ * vendor file and flags the divergence for the shared table to be
36
+ * reconciled separately. Off-grid DPI values are rejected rather than
37
+ * rounded.
38
+ *
39
+ * The specification always carries all five XY pairs, so this codec
40
+ * requires exactly five presets rather than guessing at padding for
41
+ * shorter tables.
42
+ *
43
+ * Polling (`0x2B`, values 1000→0x01, 500→0x02, 250→0x03, 125→0x04) has a
44
+ * read-back (same values), defined but not decoded here. Buttons are one
45
+ * 40-byte packet (8 slots × 5-byte fields: 6 physical buttons plus scroll
46
+ * up/down), command `0x2A`.
47
+ *
48
+ * Known but deliberately not implemented — documented so nobody re-derives
49
+ * them, withheld until there is hardware evidence and a reason to ship them:
50
+ *
51
+ * - The 3-zone RGB commands (`0x21`, per-zone bitmasks), reactive color
52
+ * (`0x26`), lighting enable (`0x27`), and reset (`0x22`, mask `0x07`).
53
+ * - `read_polling_rate` and the unique-id read.
54
+ * - Angle snapping: driver-side (`SSE`) settings, not HID commands.
55
+ *
56
+ * Settings apply immediately; the save command (`0x11`, one byte) persists
57
+ * them to onboard flash. None of this has been verified on physical
58
+ * hardware by this project.
59
+ */
60
+ /** Vendor TrueMove Core table, transcribed from the specification's own conversion table. */
61
+ export declare const RIVAL3_GEN2_DPI_TO_BYTE: ReadonlyMap<number, number>;
62
+ export declare const RIVAL3_GEN2_REPORT_ID = 0;
63
+ /** Command prefixes; the payload is the prefix plus its arguments. */
64
+ export declare const RIVAL3_GEN2_COMMAND: {
65
+ readonly dpiPresets: readonly [52];
66
+ readonly pollingRate: readonly [43];
67
+ readonly buttonsMapping: readonly [42];
68
+ readonly firmware: readonly [144];
69
+ };
70
+ /** `0x11` — one byte; commit the current settings to onboard flash. */
71
+ export declare const RIVAL3_GEN2_SAVE_COMMAND: readonly [17];
72
+ export declare const RIVAL3_GEN2_POLLING_RATES: readonly [125, 250, 500, 1000];
73
+ export declare const RIVAL3_GEN2_DPI_MIN = 200;
74
+ export declare const RIVAL3_GEN2_DPI_MAX = 8500;
75
+ export declare const RIVAL3_GEN2_DPI_STEP = 100;
76
+ export declare const RIVAL3_GEN2_MAX_DPI_PRESETS = 5;
77
+ export declare const RIVAL3_GEN2_FIRMWARE_RESPONSE_LENGTH = 15;
78
+ /** Common factory table shared across the modern SteelSeries families. */
79
+ export declare const RIVAL3_GEN2_DEFAULT_DPI_PRESETS: readonly [400, 800, 1600, 2400, 3200];
80
+ export declare const RIVAL3_GEN2_DEFAULT_POLLING_RATE = 1000;
81
+ export declare class Rival3Gen2ProtocolError extends Error {
82
+ }
83
+ /** One DPI preset: independent X/Y sensitivities. */
84
+ export interface Rival3Gen2DpiPreset {
85
+ x: number;
86
+ y: number;
87
+ }
88
+ /** The 84 DPI values the vendor sensor table can express, ascending. */
89
+ export declare function steelseriesRival3Gen2DpiOptions(): number[];
90
+ /**
91
+ * `34 <count 1–5> <selected 0-based> <x0 y0 x1 y1 … x4 y4>` — replaces the
92
+ * mouse's whole preset table with five interleaved XY pairs. Exactly five
93
+ * presets are required (see the module doc comment).
94
+ */
95
+ export declare function steelseriesRival3Gen2EncodeDpiPresets(presets: readonly Rival3Gen2DpiPreset[], selectedIndex: number): Uint8Array;
96
+ /** `2B <v>` with 1000→0x01, 500→0x02, 250→0x03, 125→0x04. */
97
+ export declare function steelseriesRival3Gen2EncodePollingRate(pollingRateHz: number): Uint8Array;
98
+ /** `11` — commit the current settings to onboard flash. */
99
+ export declare function steelseriesRival3Gen2SaveCommand(): Uint8Array;
100
+ /** `90` — the device answers with a 15-byte version string. */
101
+ export declare function steelseriesRival3Gen2FirmwareQuery(): Uint8Array;
102
+ /**
103
+ * Decode the 15-byte firmware version reply as ASCII, stopping at the
104
+ * first NUL. Same shape as the Prime Mini's reply; trailing padding is not
105
+ * part of the version.
106
+ */
107
+ export declare function steelseriesRival3Gen2DecodeFirmware(payload: Uint8Array): string;
108
+ /** 6 physical buttons plus scroll up/down (8 slots). */
109
+ export declare const RIVAL3_GEN2_BUTTONS: {
110
+ readonly button1: {
111
+ readonly id: 1;
112
+ readonly offset: 0;
113
+ };
114
+ readonly button2: {
115
+ readonly id: 2;
116
+ readonly offset: 5;
117
+ };
118
+ readonly button3: {
119
+ readonly id: 3;
120
+ readonly offset: 10;
121
+ };
122
+ readonly button4: {
123
+ readonly id: 4;
124
+ readonly offset: 15;
125
+ };
126
+ readonly button5: {
127
+ readonly id: 5;
128
+ readonly offset: 20;
129
+ };
130
+ readonly button6: {
131
+ readonly id: 6;
132
+ readonly offset: 25;
133
+ };
134
+ readonly scrollUp: {
135
+ readonly id: 49;
136
+ readonly offset: 30;
137
+ };
138
+ readonly scrollDown: {
139
+ readonly id: 50;
140
+ readonly offset: 35;
141
+ };
142
+ };
143
+ export type Rival3Gen2ButtonName = keyof typeof RIVAL3_GEN2_BUTTONS;
144
+ export type Rival3Gen2ButtonAction = {
145
+ type: "button";
146
+ target: Rival3Gen2ButtonName;
147
+ } | {
148
+ type: "disabled";
149
+ } | {
150
+ type: "dpiSwitch";
151
+ } | {
152
+ type: "scrollUp";
153
+ } | {
154
+ type: "scrollDown";
155
+ } | {
156
+ type: "keyboard";
157
+ code: number;
158
+ } | {
159
+ type: "multimedia";
160
+ code: number;
161
+ };
162
+ /**
163
+ * `2A` + one 40-byte packet (8 slots × 5-byte fields), zero-filled except
164
+ * where a mapping is given. Pass every button explicitly — unmapped buttons
165
+ * stay disabled, matching this package's no-silent-defaults policy.
166
+ */
167
+ export declare function steelseriesRival3Gen2EncodeButtonsMapping(mapping: Partial<Record<Rival3Gen2ButtonName, Rival3Gen2ButtonAction>>): Uint8Array;
168
+ //# sourceMappingURL=rival-3-v2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rival-3-v2.d.ts","sourceRoot":"","sources":["../../src/steelseries/rival-3-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,6FAA6F;AAC7F,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAe9D,CAAC;AAEH,eAAO,MAAM,qBAAqB,IAAO,CAAC;AAE1C,sEAAsE;AACtE,eAAO,MAAM,mBAAmB;;;;;CAKtB,C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,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AASzC;;;;GAIG;AACH,wBAAgB,yCAAyC,CACvD,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC,GACrE,UAAU,CAqDZ"}
@@ -0,0 +1,242 @@
1
+ /**
2
+ * SteelSeries Rival 3 Gen 2 configuration protocol — pure encode/decode helpers.
3
+ *
4
+ * Reconstructed from the vendor's own software, not from a third-party
5
+ * reimplementation: SteelSeries GG 121.0.0 ships `rival-3-v2.lisp` under
6
+ * `apps/engine/install/deviceSpecifications/`, and this module transcribes
7
+ * it. Those files are OpenPGP-armored ("DESCRIPTOR" armor, SKESK/AES-128);
8
+ * the bytes below are the documented HID report payloads, not guesses.
9
+ * rivalcfg's mainline `rival3_gen2.py` corroborates the product id, the
10
+ * `0x34` XY-DPI command shape, and most other command bytes — but see the
11
+ * DPI table note below, where the two sources disagree.
12
+ *
13
+ * Despite the shared "Rival 3" name this is a different command set from
14
+ * Rival 3 Gen 1 (`./rival3.ts`: two-byte `0x0B 0x00` DPI, `0x04 0x00`
15
+ * polling, `0x09 0x00` save) and from Aerox 3 (`./aerox3.ts`). Command
16
+ * bytes here are single-byte prefixes with a `write-op`/`read-op` framing
17
+ * convention; on this wired-only mouse both masks are `0x00`, so the bytes
18
+ * go on the wire as written.
19
+ *
20
+ * Every command is an HID **output report** with report id 0x00 (65-byte
21
+ * reports throughout the specification).
22
+ *
23
+ * DPI uses an XY batch (`0x34`): `num_cpi_levels` (1–5), `index` (0–4,
24
+ * 0-based), then a 10-byte interleaved table (x0, y0, x1, y1, …), one
25
+ * sensor byte per axis value. The sensor table is TrueMove Core shaped
26
+ * (200–8500), transcribed here from the vendor file's own
27
+ * `convert_cpi_fw_to_driver` case table — **not** imported from
28
+ * `./rival3.ts`'s `TRUEMOVE_CORE_DPI_TO_BYTE`, because the two disagree on
29
+ * 23 entries: the vendor file says `0x49→3200` where rivalcfg says
30
+ * `0x4A→3200`, and similarly one byte lower at 22 other DPI steps (2300,
31
+ * 2600, 2900, 3500, 3800, …). The vendor table is self-consistent with the
32
+ * vendor's own factory defaults (Aerox 3's default preset bytes
33
+ * 8/18/27/55/73 decode to exactly 400/800/1200/2400/3200 under it, while
34
+ * `0x49` is absent from rivalcfg's table), so this module follows the
35
+ * vendor file and flags the divergence for the shared table to be
36
+ * reconciled separately. Off-grid DPI values are rejected rather than
37
+ * rounded.
38
+ *
39
+ * The specification always carries all five XY pairs, so this codec
40
+ * requires exactly five presets rather than guessing at padding for
41
+ * shorter tables.
42
+ *
43
+ * Polling (`0x2B`, values 1000→0x01, 500→0x02, 250→0x03, 125→0x04) has a
44
+ * read-back (same values), defined but not decoded here. Buttons are one
45
+ * 40-byte packet (8 slots × 5-byte fields: 6 physical buttons plus scroll
46
+ * up/down), command `0x2A`.
47
+ *
48
+ * Known but deliberately not implemented — documented so nobody re-derives
49
+ * them, withheld until there is hardware evidence and a reason to ship them:
50
+ *
51
+ * - The 3-zone RGB commands (`0x21`, per-zone bitmasks), reactive color
52
+ * (`0x26`), lighting enable (`0x27`), and reset (`0x22`, mask `0x07`).
53
+ * - `read_polling_rate` and the unique-id read.
54
+ * - Angle snapping: driver-side (`SSE`) settings, not HID commands.
55
+ *
56
+ * Settings apply immediately; the save command (`0x11`, one byte) persists
57
+ * them to onboard flash. None of this has been verified on physical
58
+ * hardware by this project.
59
+ */
60
+ /** Vendor TrueMove Core table, transcribed from the specification's own conversion table. */
61
+ export const RIVAL3_GEN2_DPI_TO_BYTE = new Map([
62
+ [200, 0x04], [300, 0x06], [400, 0x08], [500, 0x0b], [600, 0x0d], [700, 0x0f],
63
+ [800, 0x12], [900, 0x14], [1000, 0x16], [1100, 0x19], [1200, 0x1b], [1300, 0x1d],
64
+ [1400, 0x20], [1500, 0x22], [1600, 0x24], [1700, 0x27], [1800, 0x29], [1900, 0x2b],
65
+ [2000, 0x2e], [2100, 0x30], [2200, 0x32], [2300, 0x34], [2400, 0x37], [2500, 0x39],
66
+ [2600, 0x3b], [2700, 0x3e], [2800, 0x40], [2900, 0x42], [3000, 0x45], [3100, 0x47],
67
+ [3200, 0x49], [3300, 0x4c], [3400, 0x4e], [3500, 0x50], [3600, 0x53], [3700, 0x55],
68
+ [3800, 0x57], [3900, 0x5a], [4000, 0x5c], [4100, 0x5e], [4200, 0x61], [4300, 0x63],
69
+ [4400, 0x65], [4500, 0x68], [4600, 0x6a], [4700, 0x6c], [4800, 0x6f], [4900, 0x71],
70
+ [5000, 0x73], [5100, 0x76], [5200, 0x78], [5300, 0x7a], [5400, 0x7d], [5500, 0x7f],
71
+ [5600, 0x81], [5700, 0x84], [5800, 0x86], [5900, 0x88], [6000, 0x8b], [6100, 0x8d],
72
+ [6200, 0x8f], [6300, 0x92], [6400, 0x94], [6500, 0x96], [6600, 0x99], [6700, 0x9b],
73
+ [6800, 0x9d], [6900, 0xa0], [7000, 0xa2], [7100, 0xa4], [7200, 0xa7], [7300, 0xa9],
74
+ [7400, 0xab], [7500, 0xad], [7600, 0xb0], [7700, 0xb2], [7800, 0xb4], [7900, 0xb7],
75
+ [8000, 0xb9], [8100, 0xbc], [8200, 0xbe], [8300, 0xc0], [8400, 0xc3], [8500, 0xc5],
76
+ ]);
77
+ export const RIVAL3_GEN2_REPORT_ID = 0x00;
78
+ /** Command prefixes; the payload is the prefix plus its arguments. */
79
+ export const RIVAL3_GEN2_COMMAND = {
80
+ dpiPresets: [0x34],
81
+ pollingRate: [0x2b],
82
+ buttonsMapping: [0x2a],
83
+ firmware: [0x90],
84
+ };
85
+ /** `0x11` — one byte; commit the current settings to onboard flash. */
86
+ export const RIVAL3_GEN2_SAVE_COMMAND = [0x11];
87
+ export const RIVAL3_GEN2_POLLING_RATES = [125, 250, 500, 1000];
88
+ const POLLING_RATE_TO_BYTE = new Map([
89
+ [1000, 0x01],
90
+ [500, 0x02],
91
+ [250, 0x03],
92
+ [125, 0x04],
93
+ ]);
94
+ export const RIVAL3_GEN2_DPI_MIN = 200;
95
+ export const RIVAL3_GEN2_DPI_MAX = 8500;
96
+ export const RIVAL3_GEN2_DPI_STEP = 100;
97
+ export const RIVAL3_GEN2_MAX_DPI_PRESETS = 5;
98
+ export const RIVAL3_GEN2_FIRMWARE_RESPONSE_LENGTH = 15;
99
+ /** Common factory table shared across the modern SteelSeries families. */
100
+ export const RIVAL3_GEN2_DEFAULT_DPI_PRESETS = [400, 800, 1600, 2400, 3200];
101
+ export const RIVAL3_GEN2_DEFAULT_POLLING_RATE = 1000;
102
+ export class Rival3Gen2ProtocolError extends Error {
103
+ }
104
+ /** The 84 DPI values the vendor sensor table can express, ascending. */
105
+ export function steelseriesRival3Gen2DpiOptions() {
106
+ return [...RIVAL3_GEN2_DPI_TO_BYTE.keys()].sort((a, b) => a - b);
107
+ }
108
+ function dpiToByte(dpi) {
109
+ const byte = RIVAL3_GEN2_DPI_TO_BYTE.get(dpi);
110
+ if (byte === undefined) {
111
+ throw new Rival3Gen2ProtocolError(`SteelSeries Rival 3 Gen 2 DPI must be ${RIVAL3_GEN2_DPI_MIN}–${RIVAL3_GEN2_DPI_MAX.toLocaleString("en-US")} in ${RIVAL3_GEN2_DPI_STEP} DPI steps.`);
112
+ }
113
+ return byte;
114
+ }
115
+ /**
116
+ * `34 <count 1–5> <selected 0-based> <x0 y0 x1 y1 … x4 y4>` — replaces the
117
+ * mouse's whole preset table with five interleaved XY pairs. Exactly five
118
+ * presets are required (see the module doc comment).
119
+ */
120
+ export function steelseriesRival3Gen2EncodeDpiPresets(presets, selectedIndex) {
121
+ if (presets.length !== RIVAL3_GEN2_MAX_DPI_PRESETS) {
122
+ throw new Rival3Gen2ProtocolError(`SteelSeries Rival 3 Gen 2 requires exactly ${RIVAL3_GEN2_MAX_DPI_PRESETS} DPI presets.`);
123
+ }
124
+ if (!Number.isInteger(selectedIndex) || selectedIndex < 0 || selectedIndex >= presets.length) {
125
+ throw new Rival3Gen2ProtocolError(`Selected DPI preset must be an index into the ${presets.length} presets being written.`);
126
+ }
127
+ return new Uint8Array([
128
+ ...RIVAL3_GEN2_COMMAND.dpiPresets,
129
+ presets.length,
130
+ selectedIndex,
131
+ ...presets.flatMap((preset) => [dpiToByte(preset.x), dpiToByte(preset.y)]),
132
+ ]);
133
+ }
134
+ /** `2B <v>` with 1000→0x01, 500→0x02, 250→0x03, 125→0x04. */
135
+ export function steelseriesRival3Gen2EncodePollingRate(pollingRateHz) {
136
+ const byte = POLLING_RATE_TO_BYTE.get(pollingRateHz);
137
+ if (byte === undefined) {
138
+ throw new Rival3Gen2ProtocolError("SteelSeries Rival 3 Gen 2 supports 125, 250, 500, or 1000 Hz polling.");
139
+ }
140
+ return new Uint8Array([...RIVAL3_GEN2_COMMAND.pollingRate, byte]);
141
+ }
142
+ /** `11` — commit the current settings to onboard flash. */
143
+ export function steelseriesRival3Gen2SaveCommand() {
144
+ return new Uint8Array(RIVAL3_GEN2_SAVE_COMMAND);
145
+ }
146
+ /** `90` — the device answers with a 15-byte version string. */
147
+ export function steelseriesRival3Gen2FirmwareQuery() {
148
+ return new Uint8Array(RIVAL3_GEN2_COMMAND.firmware);
149
+ }
150
+ /**
151
+ * Decode the 15-byte firmware version reply as ASCII, stopping at the
152
+ * first NUL. Same shape as the Prime Mini's reply; trailing padding is not
153
+ * part of the version.
154
+ */
155
+ export function steelseriesRival3Gen2DecodeFirmware(payload) {
156
+ if (payload.length < RIVAL3_GEN2_FIRMWARE_RESPONSE_LENGTH) {
157
+ throw new Rival3Gen2ProtocolError("SteelSeries Rival 3 Gen 2 firmware response is shorter than 15 bytes.");
158
+ }
159
+ const bytes = payload.slice(0, RIVAL3_GEN2_FIRMWARE_RESPONSE_LENGTH);
160
+ const nul = bytes.indexOf(0x00);
161
+ return new TextDecoder("ascii").decode(nul === -1 ? bytes : bytes.slice(0, nul));
162
+ }
163
+ // -- Button mapping --------------------------------------------------------
164
+ /** 6 physical buttons plus scroll up/down (8 slots). */
165
+ export const RIVAL3_GEN2_BUTTONS = {
166
+ button1: { id: 0x01, offset: 0x00 },
167
+ button2: { id: 0x02, offset: 0x05 },
168
+ button3: { id: 0x03, offset: 0x0a },
169
+ button4: { id: 0x04, offset: 0x0f },
170
+ button5: { id: 0x05, offset: 0x14 },
171
+ button6: { id: 0x06, offset: 0x19 },
172
+ scrollUp: { id: 0x31, offset: 0x1e },
173
+ scrollDown: { id: 0x32, offset: 0x23 },
174
+ };
175
+ const BUTTON_FIELD_LENGTH = 5;
176
+ const BUTTON_DISABLE = 0x00;
177
+ const BUTTON_DPI_SWITCH = 0x30;
178
+ const BUTTON_KEYBOARD = 0x51;
179
+ const BUTTON_MULTIMEDIA = 0x61;
180
+ function encodeKeyCode(code, kind) {
181
+ if (!Number.isInteger(code) || code < 0 || code > 255) {
182
+ throw new Rival3Gen2ProtocolError(`${kind} codes must be integers 0–255.`);
183
+ }
184
+ return code;
185
+ }
186
+ /**
187
+ * `2A` + one 40-byte packet (8 slots × 5-byte fields), zero-filled except
188
+ * where a mapping is given. Pass every button explicitly — unmapped buttons
189
+ * stay disabled, matching this package's no-silent-defaults policy.
190
+ */
191
+ export function steelseriesRival3Gen2EncodeButtonsMapping(mapping) {
192
+ for (const name of Object.keys(mapping)) {
193
+ if (!Object.hasOwn(RIVAL3_GEN2_BUTTONS, name)) {
194
+ throw new Rival3Gen2ProtocolError(`Unknown SteelSeries Rival 3 Gen 2 button "${name}".`);
195
+ }
196
+ }
197
+ const names = Object.keys(RIVAL3_GEN2_BUTTONS);
198
+ const packet = new Array(names.length * BUTTON_FIELD_LENGTH).fill(0x00);
199
+ for (const [name, action] of Object.entries(mapping)) {
200
+ const { offset } = RIVAL3_GEN2_BUTTONS[name];
201
+ switch (action.type) {
202
+ case "button": {
203
+ if (!Object.hasOwn(RIVAL3_GEN2_BUTTONS, action.target)) {
204
+ throw new Rival3Gen2ProtocolError(`Unknown SteelSeries Rival 3 Gen 2 button "${action.target}".`);
205
+ }
206
+ packet[offset] = RIVAL3_GEN2_BUTTONS[action.target].id;
207
+ break;
208
+ }
209
+ case "disabled": {
210
+ packet[offset] = BUTTON_DISABLE;
211
+ break;
212
+ }
213
+ case "dpiSwitch": {
214
+ packet[offset] = BUTTON_DPI_SWITCH;
215
+ break;
216
+ }
217
+ case "scrollUp": {
218
+ packet[offset] = RIVAL3_GEN2_BUTTONS.scrollUp.id;
219
+ break;
220
+ }
221
+ case "scrollDown": {
222
+ packet[offset] = RIVAL3_GEN2_BUTTONS.scrollDown.id;
223
+ break;
224
+ }
225
+ case "keyboard": {
226
+ packet[offset] = BUTTON_KEYBOARD;
227
+ packet[offset + 1] = encodeKeyCode(action.code, "Keyboard scan");
228
+ break;
229
+ }
230
+ case "multimedia": {
231
+ packet[offset] = BUTTON_MULTIMEDIA;
232
+ packet[offset + 1] = encodeKeyCode(action.code, "Multimedia key");
233
+ break;
234
+ }
235
+ default: {
236
+ throw new Rival3Gen2ProtocolError("Unsupported SteelSeries Rival 3 Gen 2 button action.");
237
+ }
238
+ }
239
+ }
240
+ return new Uint8Array([...RIVAL3_GEN2_COMMAND.buttonsMapping, ...packet]);
241
+ }
242
+ //# sourceMappingURL=rival-3-v2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rival-3-v2.js","sourceRoot":"","sources":["../../src/steelseries/rival-3-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,6FAA6F;AAC7F,MAAM,CAAC,MAAM,uBAAuB,GAAgC,IAAI,GAAG,CAAC;IA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ration protocol — pure
3
+ * encode/decode helpers.
4
+ *
5
+ * Reconstructed from the vendor's own software, not from a third-party
6
+ * reimplementation: SteelSeries GG 121.0.0 ships
7
+ * `rival-3-wireless-v2.lisp` under
8
+ * `apps/engine/install/deviceSpecifications/`, and this module transcribes
9
+ * it. Those files are OpenPGP-armored ("DESCRIPTOR" armor, SKESK/AES-128);
10
+ * the bytes below are the documented HID report payloads, not guesses.
11
+ * rivalcfg lists a `rival3_wireless_gen2` profile (PID `1038:1872`) but its
12
+ * command set was never readable in this environment, so nothing here is
13
+ * corroborated beyond the vendor file — treat every byte as
14
+ * vendor-documented but not yet hardware-verified.
15
+ *
16
+ * Despite the shared "Rival 3 Wireless" name this is a different command
17
+ * set from Rival 3 Wireless Gen 1 (`./rival3-wireless.ts`: single-byte DPI
18
+ * `0x20`, 6 button slots, single lighting zone, `0xAA` 3-byte battery
19
+ * shape). The Gen 2 uses XY DPI (`0x2C`), 7 button slots plus a separate
20
+ * 2-slot wheel mapping, no lighting at all, and a 2-byte battery reply.
21
+ *
22
+ * Every command is an HID **output report** with report id 0x00 (65-byte
23
+ * reports throughout the specification). The specification frames commands
24
+ * through `write-op`/`read-op` mask helpers; on this 2.4 GHz-mode product
25
+ * id both masks are `0x00`, so the bytes go on the wire as written.
26
+ *
27
+ * DPI uses an XY batch (`0x2C`): `max_level` (0x01–0x05), `index`
28
+ * (0x01–0x05, **1-based** — unlike every other SteelSeries XY family in
29
+ * this package, which are 0-based), then five horizontal bytes followed by
30
+ * five vertical bytes (split arrays, not interleaved). The sensor table is
31
+ * TrueMove Air (100–18000), imported from `./rival3-wireless.ts`'s
32
+ * `TRUEMOVE_AIR_DPI_TO_BYTE` — the vendor file includes the same table
33
+ * (spot-checked `0x04→400`, `0x12→1600`, `0xD6→18000`). The specification
34
+ * always carries all five pairs per axis, so this codec requires exactly
35
+ * five presets rather than guessing at padding for shorter tables.
36
+ *
37
+ * Polling (`0x17`, values 1000→0x00, 500→0x01, 250→0x02, 125→0x03 — the
38
+ * same mapping as Gen 1's identical command byte, confirmed by direct
39
+ * comparison, not assumed) has a read-back, defined but not decoded here.
40
+ * Buttons are one 35-byte packet (7 slots × 5-byte fields: function byte
41
+ * plus 4 key-code bytes), command `0x19`, plus a separate 2-slot wheel
42
+ * mapping, command `0x1A`. The 7th button slot has no confirmed physical
43
+ * identity (the GG seed data exposes 6 buttons); it is encodable as
44
+ * `button7` and zero-filled when unmapped, both flagged here.
45
+ *
46
+ * Known but deliberately not implemented — documented so nobody re-derives
47
+ * them, withheld until there is hardware evidence and a reason to ship them:
48
+ *
49
+ * - `read_polling_rate` — polling read-back.
50
+ * - `power_mode` (`0x2B`, sleep timer only) and `wireless_power_mode`
51
+ * (`0x2E`, no-redundancy / boosted-bluetooth flags).
52
+ * - Accelerometer/deceleration and angle snapping: driver-side (`SSE`)
53
+ * settings, not HID commands, out of scope for this codec.
54
+ *
55
+ * This mouse has no lighting commands at all. Settings apply immediately;
56
+ * the save command (`0x09`, one byte) persists them to onboard flash. None
57
+ * of this has been verified on physical hardware by this project.
58
+ */
59
+ export declare const RIVAL3_WIRELESS_V2_REPORT_ID = 0;
60
+ /** Command prefixes; the payload is the prefix plus its arguments. */
61
+ export declare const RIVAL3_WIRELESS_V2_COMMAND: {
62
+ readonly dpiPresets: readonly [44];
63
+ readonly pollingRate: readonly [23];
64
+ readonly buttonsMapping: readonly [25];
65
+ readonly wheelMapping: readonly [26];
66
+ readonly batteryLevel: readonly [170, 1];
67
+ readonly firmware: readonly [16];
68
+ };
69
+ /** `0x09` — one byte; commit the current settings to onboard flash. */
70
+ export declare const RIVAL3_WIRELESS_V2_SAVE_COMMAND: readonly [9];
71
+ export declare const RIVAL3_WIRELESS_V2_POLLING_RATES: readonly [125, 250, 500, 1000];
72
+ export declare const RIVAL3_WIRELESS_V2_DPI_MIN = 100;
73
+ export declare const RIVAL3_WIRELESS_V2_DPI_MAX = 18000;
74
+ export declare const RIVAL3_WIRELESS_V2_DPI_STEP = 100;
75
+ export declare const RIVAL3_WIRELESS_V2_MAX_DPI_PRESETS = 5;
76
+ export declare const RIVAL3_WIRELESS_V2_BATTERY_RESPONSE_LENGTH = 2;
77
+ /** Factory table shared across the modern SteelSeries families. */
78
+ export declare const RIVAL3_WIRELESS_V2_DEFAULT_DPI_PRESETS: readonly [400, 800, 1600, 2400, 3200];
79
+ export declare const RIVAL3_WIRELESS_V2_DEFAULT_POLLING_RATE = 1000;
80
+ export declare class Rival3WirelessV2ProtocolError extends Error {
81
+ }
82
+ /** One DPI preset: independent X/Y sensitivities. */
83
+ export interface Rival3WirelessV2DpiPreset {
84
+ x: number;
85
+ y: number;
86
+ }
87
+ /** Every DPI value the shared TrueMove Air table can express, ascending. */
88
+ export declare function steelseriesRival3WirelessV2DpiOptions(): number[];
89
+ /**
90
+ * `2C <count 1–5> <selected 1-based> <x0…x4> <y0…y4>` — replaces the
91
+ * mouse's whole preset table with five horizontal bytes followed by five
92
+ * vertical bytes. Exactly five presets are required (see the module doc
93
+ * comment); `selectedIndex` is 0-based here and encoded 1-based on the
94
+ * wire — the reverse of the Gen 1 convention, so do not reuse that
95
+ * encoder.
96
+ */
97
+ export declare function steelseriesRival3WirelessV2EncodeDpiPresets(presets: readonly Rival3WirelessV2DpiPreset[], selectedIndex: number): Uint8Array;
98
+ /** `17 <v>` with 1000→0x00, 500→0x01, 250→0x02, 125→0x03. */
99
+ export declare function steelseriesRival3WirelessV2EncodePollingRate(pollingRateHz: number): Uint8Array;
100
+ /** `09` — commit the current settings to onboard flash. */
101
+ export declare function steelseriesRival3WirelessV2SaveCommand(): Uint8Array;
102
+ /** `AA 01` — answered by a two-byte input report. */
103
+ export declare function steelseriesRival3WirelessV2BatteryQuery(): Uint8Array;
104
+ export interface Rival3WirelessV2Battery {
105
+ /** Battery level as reported (0–100 scale per the specification's GG mapping). */
106
+ level: number;
107
+ }
108
+ /**
109
+ * Decode the two-byte battery reply as a little-endian level. Unlike Gen
110
+ * 1's 3-byte reply this packet carries no charging flag, so charging state
111
+ * stays unknown — do not infer it.
112
+ */
113
+ export declare function steelseriesRival3WirelessV2DecodeBattery(payload: Uint8Array): Rival3WirelessV2Battery;
114
+ /** `10` — the mouse answers with major/minor firmware bytes. */
115
+ export declare function steelseriesRival3WirelessV2FirmwareQuery(): Uint8Array;
116
+ export interface Rival3WirelessV2Firmware {
117
+ /** The two raw response bytes, in the order the device sent them. */
118
+ bytes: [number, number];
119
+ /** The bytes joined in read order, e.g. "1.5". */
120
+ display: string;
121
+ }
122
+ /** Decode the two-byte firmware reply, read-order convention as usual. */
123
+ export declare function steelseriesRival3WirelessV2DecodeFirmware(payload: Uint8Array): Rival3WirelessV2Firmware;
124
+ /**
125
+ * 7 button slots. The 7th slot's physical identity is unconfirmed (the GG
126
+ * seed exposes 6 buttons); it is encodable and zero-filled when unmapped —
127
+ * see the module doc comment.
128
+ */
129
+ export declare const RIVAL3_WIRELESS_V2_BUTTONS: {
130
+ readonly button1: {
131
+ readonly id: 1;
132
+ readonly offset: 0;
133
+ };
134
+ readonly button2: {
135
+ readonly id: 2;
136
+ readonly offset: 5;
137
+ };
138
+ readonly button3: {
139
+ readonly id: 3;
140
+ readonly offset: 10;
141
+ };
142
+ readonly button4: {
143
+ readonly id: 4;
144
+ readonly offset: 15;
145
+ };
146
+ readonly button5: {
147
+ readonly id: 5;
148
+ readonly offset: 20;
149
+ };
150
+ readonly button6: {
151
+ readonly id: 6;
152
+ readonly offset: 25;
153
+ };
154
+ readonly button7: {
155
+ readonly id: 7;
156
+ readonly offset: 30;
157
+ };
158
+ };
159
+ export type Rival3WirelessV2ButtonName = keyof typeof RIVAL3_WIRELESS_V2_BUTTONS;
160
+ /** The 2 scroll-wheel slots use the same field shape under command `0x1A`. */
161
+ export declare const RIVAL3_WIRELESS_V2_WHEEL_BUTTONS: {
162
+ readonly scrollUp: {
163
+ readonly id: 49;
164
+ readonly offset: 0;
165
+ };
166
+ readonly scrollDown: {
167
+ readonly id: 50;
168
+ readonly offset: 5;
169
+ };
170
+ };
171
+ export type Rival3WirelessV2WheelName = keyof typeof RIVAL3_WIRELESS_V2_WHEEL_BUTTONS;
172
+ export type Rival3WirelessV2ButtonAction = {
173
+ type: "button";
174
+ target: Rival3WirelessV2ButtonName;
175
+ } | {
176
+ type: "disabled";
177
+ } | {
178
+ type: "dpiSwitch";
179
+ } | {
180
+ type: "scrollUp";
181
+ } | {
182
+ type: "scrollDown";
183
+ } | {
184
+ type: "keyboard";
185
+ code: number;
186
+ } | {
187
+ type: "multimedia";
188
+ code: number;
189
+ };
190
+ export type Rival3WirelessV2WheelAction = {
191
+ type: "button";
192
+ target: Rival3WirelessV2ButtonName | Rival3WirelessV2WheelName;
193
+ } | {
194
+ type: "disabled";
195
+ } | {
196
+ type: "dpiSwitch";
197
+ } | {
198
+ type: "scrollUp";
199
+ } | {
200
+ type: "scrollDown";
201
+ } | {
202
+ type: "keyboard";
203
+ code: number;
204
+ } | {
205
+ type: "multimedia";
206
+ code: number;
207
+ };
208
+ /**
209
+ * `19` + one 35-byte packet (7 slots × 5-byte fields), zero-filled except
210
+ * where a mapping is given. Pass every button explicitly — unmapped buttons
211
+ * stay disabled, matching this package's no-silent-defaults policy.
212
+ */
213
+ export declare function steelseriesRival3WirelessV2EncodeButtonsMapping(mapping: Partial<Record<Rival3WirelessV2ButtonName, Rival3WirelessV2ButtonAction>>): Uint8Array;
214
+ /**
215
+ * `1A` + one 10-byte packet (2 wheel slots × 5-byte fields). The wheel
216
+ * mapping is always written to flash alongside buttons on the real device.
217
+ */
218
+ export declare function steelseriesRival3WirelessV2EncodeWheelMapping(mapping: Partial<Record<Rival3WirelessV2WheelName, Rival3WirelessV2WheelAction>>): Uint8Array;
219
+ //# sourceMappingURL=rival-3-wireless-v2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rival-3-wireless-v2.d.ts","sourceRoot":"","sources":["../../src/steelseries/rival-3-wireless-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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