@girs/manette-1 4.3.0 → 4.5.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 +36 -41
- package/manette-1.d.ts +47 -43
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -4,82 +4,77 @@
|
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|
|
|
7
|
+
GJS TypeScript type definitions for Manette-1, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.5.0.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
This package contains type declarations only. It ships no runtime code, so it adds
|
|
10
|
+
nothing to your program and works with any bundler or none at all.
|
|
9
11
|
|
|
10
12
|
## Install
|
|
11
13
|
|
|
12
|
-
Install the type definitions with npm:
|
|
13
14
|
```bash
|
|
14
15
|
npm install @girs/manette-1
|
|
15
16
|
```
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
Any package manager works. The package has no dependencies beyond other `@girs/*`
|
|
19
|
+
type packages.
|
|
20
|
+
|
|
21
|
+
## What it exports
|
|
22
|
+
|
|
23
|
+
| Import | What you get |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `@girs/manette-1` | the namespace as a default export, plus the ambient and global declarations |
|
|
26
|
+
| `@girs/manette-1/ambient` | only the `gi://` module declarations |
|
|
27
|
+
| `@girs/manette-1/import` | only the `imports.gi` declarations |
|
|
28
|
+
| `@girs/manette-1/manette-1` | the namespace, without the side-effecting declarations |
|
|
29
|
+
|
|
30
|
+
## Three ways to import
|
|
31
|
+
|
|
32
|
+
Which one you use depends on how you write imports elsewhere, not on your toolchain.
|
|
33
|
+
|
|
34
|
+
### As a module
|
|
18
35
|
|
|
19
|
-
Import it like any other module:
|
|
20
36
|
```ts
|
|
21
37
|
import Manette from '@girs/manette-1';
|
|
22
38
|
```
|
|
23
39
|
|
|
24
|
-
###
|
|
40
|
+
### As `gi://`
|
|
25
41
|
|
|
26
|
-
|
|
27
|
-
|
|
42
|
+
GJS resolves `gi://` at runtime. To give it types, reference the package once, either
|
|
43
|
+
from your entry point or from `tsconfig.json`:
|
|
28
44
|
|
|
29
|
-
`index.ts`:
|
|
30
45
|
```ts
|
|
31
|
-
import '@girs/manette-1'
|
|
46
|
+
import '@girs/manette-1';
|
|
32
47
|
```
|
|
33
48
|
|
|
34
|
-
`tsconfig.json`:
|
|
35
49
|
```json
|
|
36
|
-
{
|
|
37
|
-
"compilerOptions": {
|
|
38
|
-
...
|
|
39
|
-
},
|
|
40
|
-
"include": ["@girs/manette-1"],
|
|
41
|
-
...
|
|
42
|
-
}
|
|
50
|
+
{ "include": ["@girs/manette-1"] }
|
|
43
51
|
```
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
Then the runtime spelling type-checks:
|
|
46
54
|
|
|
47
55
|
```ts
|
|
48
56
|
import Manette from 'gi://Manette?version=1';
|
|
49
57
|
```
|
|
50
58
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
GJS's global `imports.gi` works too, with types.
|
|
54
|
-
For this you need to include `@girs/manette-1` or `@girs/manette-1/import` in your `tsconfig` or entry point Typescript file:
|
|
59
|
+
Referencing `@girs/manette-1/ambient` instead pulls in these declarations
|
|
60
|
+
alone. See [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules).
|
|
55
61
|
|
|
56
|
-
`
|
|
57
|
-
```ts
|
|
58
|
-
import '@girs/manette-1'
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
`tsconfig.json`:
|
|
62
|
-
```json
|
|
63
|
-
{
|
|
64
|
-
"compilerOptions": {
|
|
65
|
-
...
|
|
66
|
-
},
|
|
67
|
-
"include": ["@girs/manette-1"],
|
|
68
|
-
...
|
|
69
|
-
}
|
|
70
|
-
```
|
|
62
|
+
### As `imports.gi`
|
|
71
63
|
|
|
72
|
-
|
|
64
|
+
GJS's global object works the same way, via `@girs/manette-1/import`:
|
|
73
65
|
|
|
74
66
|
```ts
|
|
75
67
|
const Manette = imports.gi.Manette;
|
|
76
68
|
```
|
|
77
69
|
|
|
78
|
-
|
|
70
|
+
## Building
|
|
79
71
|
|
|
80
|
-
|
|
72
|
+
The declarations need no build step. If you bundle, every bundler works, since there is
|
|
73
|
+
no runtime code to resolve. The [examples](https://github.com/gjsify/ts-for-gir/tree/main/examples)
|
|
74
|
+
show working setups for several.
|
|
81
75
|
|
|
82
76
|
## Other packages
|
|
83
77
|
|
|
84
|
-
|
|
78
|
+
Every pre-generated package is at [gjsify/types](https://github.com/gjsify/types).
|
|
79
|
+
|
|
85
80
|
|
package/manette-1.d.ts
CHANGED
|
@@ -40,27 +40,27 @@ export namespace Manette {
|
|
|
40
40
|
/**
|
|
41
41
|
* Left analog stick, horizontal axis
|
|
42
42
|
*/
|
|
43
|
-
LEFT_X,
|
|
43
|
+
LEFT_X = 0,
|
|
44
44
|
/**
|
|
45
45
|
* Left analog stick, vertical axis
|
|
46
46
|
*/
|
|
47
|
-
LEFT_Y,
|
|
47
|
+
LEFT_Y = 1,
|
|
48
48
|
/**
|
|
49
49
|
* Right analog stick, horizontal axis
|
|
50
50
|
*/
|
|
51
|
-
RIGHT_X,
|
|
51
|
+
RIGHT_X = 2,
|
|
52
52
|
/**
|
|
53
53
|
* Right analog stick, vertical axis
|
|
54
54
|
*/
|
|
55
|
-
RIGHT_Y,
|
|
55
|
+
RIGHT_Y = 3,
|
|
56
56
|
/**
|
|
57
57
|
* Left trigger (L2, LT or ZL)
|
|
58
58
|
*/
|
|
59
|
-
LEFT_TRIGGER,
|
|
59
|
+
LEFT_TRIGGER = 4,
|
|
60
60
|
/**
|
|
61
61
|
* Right trigger (R2, RT or ZR)
|
|
62
62
|
*/
|
|
63
|
-
RIGHT_TRIGGER,
|
|
63
|
+
RIGHT_TRIGGER = 5,
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
|
|
@@ -81,116 +81,116 @@ export namespace Manette {
|
|
|
81
81
|
/**
|
|
82
82
|
* D-pad (up)
|
|
83
83
|
*/
|
|
84
|
-
DPAD_UP,
|
|
84
|
+
DPAD_UP = 0,
|
|
85
85
|
/**
|
|
86
86
|
* D-pad (down)
|
|
87
87
|
*/
|
|
88
|
-
DPAD_DOWN,
|
|
88
|
+
DPAD_DOWN = 1,
|
|
89
89
|
/**
|
|
90
90
|
* D-pad (left)
|
|
91
91
|
*/
|
|
92
|
-
DPAD_LEFT,
|
|
92
|
+
DPAD_LEFT = 2,
|
|
93
93
|
/**
|
|
94
94
|
* D-pad (right)
|
|
95
95
|
*/
|
|
96
|
-
DPAD_RIGHT,
|
|
96
|
+
DPAD_RIGHT = 3,
|
|
97
97
|
/**
|
|
98
98
|
* Top face button
|
|
99
99
|
* (XBox Y, Nintendo X, PlayStation triangle)
|
|
100
100
|
*/
|
|
101
|
-
NORTH,
|
|
101
|
+
NORTH = 4,
|
|
102
102
|
/**
|
|
103
103
|
* Bottom face button
|
|
104
104
|
* (XBox A, Nintendo B, PlayStation X)
|
|
105
105
|
*/
|
|
106
|
-
SOUTH,
|
|
106
|
+
SOUTH = 5,
|
|
107
107
|
/**
|
|
108
108
|
* Left face button
|
|
109
109
|
* (XBox X, Nintendo Y, PlayStation square)
|
|
110
110
|
*/
|
|
111
|
-
WEST,
|
|
111
|
+
WEST = 6,
|
|
112
112
|
/**
|
|
113
113
|
* Right face button
|
|
114
114
|
* (XBox B, Nintendo A, PlayStation circle)
|
|
115
115
|
*/
|
|
116
|
-
EAST,
|
|
116
|
+
EAST = 7,
|
|
117
117
|
/**
|
|
118
118
|
* Left menu button
|
|
119
119
|
*/
|
|
120
|
-
SELECT,
|
|
120
|
+
SELECT = 8,
|
|
121
121
|
/**
|
|
122
122
|
* Right menu button
|
|
123
123
|
*/
|
|
124
|
-
START,
|
|
124
|
+
START = 9,
|
|
125
125
|
/**
|
|
126
126
|
* Center menu button (Home, Guide, Steam etc)
|
|
127
127
|
*/
|
|
128
|
-
MODE,
|
|
128
|
+
MODE = 10,
|
|
129
129
|
/**
|
|
130
130
|
* Left shoulder button (L, L1 or LB)
|
|
131
131
|
*/
|
|
132
|
-
LEFT_SHOULDER,
|
|
132
|
+
LEFT_SHOULDER = 11,
|
|
133
133
|
/**
|
|
134
134
|
* Right shoulder button (R, R1 or RB)
|
|
135
135
|
*/
|
|
136
|
-
RIGHT_SHOULDER,
|
|
136
|
+
RIGHT_SHOULDER = 12,
|
|
137
137
|
/**
|
|
138
138
|
* Left stick
|
|
139
139
|
*/
|
|
140
|
-
LEFT_STICK,
|
|
140
|
+
LEFT_STICK = 13,
|
|
141
141
|
/**
|
|
142
142
|
* Right stick
|
|
143
143
|
*/
|
|
144
|
-
RIGHT_STICK,
|
|
144
|
+
RIGHT_STICK = 14,
|
|
145
145
|
/**
|
|
146
146
|
* Upper left paddle
|
|
147
147
|
* (Steam Deck L4 or XBox Elite P3)
|
|
148
148
|
*/
|
|
149
|
-
LEFT_PADDLE1,
|
|
149
|
+
LEFT_PADDLE1 = 15,
|
|
150
150
|
/**
|
|
151
151
|
* Lower left paddle
|
|
152
152
|
* (Steam Deck L5 or XBox Elite P4)
|
|
153
153
|
*/
|
|
154
|
-
LEFT_PADDLE2,
|
|
154
|
+
LEFT_PADDLE2 = 16,
|
|
155
155
|
/**
|
|
156
156
|
* Upper right paddle
|
|
157
157
|
* (Steam Deck R4 or XBox Elite P1)
|
|
158
158
|
*/
|
|
159
|
-
RIGHT_PADDLE1,
|
|
159
|
+
RIGHT_PADDLE1 = 17,
|
|
160
160
|
/**
|
|
161
161
|
* Lower right paddle
|
|
162
162
|
* (Steam Deck R5 or XBox Elite P2)
|
|
163
163
|
*/
|
|
164
|
-
RIGHT_PADDLE2,
|
|
164
|
+
RIGHT_PADDLE2 = 18,
|
|
165
165
|
/**
|
|
166
166
|
* Additional button
|
|
167
167
|
* (Steam Deck QAM button, Xbox Series X share button etc)
|
|
168
168
|
*/
|
|
169
|
-
MISC1,
|
|
169
|
+
MISC1 = 19,
|
|
170
170
|
/**
|
|
171
171
|
* Additional button
|
|
172
172
|
*/
|
|
173
|
-
MISC2,
|
|
173
|
+
MISC2 = 20,
|
|
174
174
|
/**
|
|
175
175
|
* Additional button
|
|
176
176
|
*/
|
|
177
|
-
MISC3,
|
|
177
|
+
MISC3 = 21,
|
|
178
178
|
/**
|
|
179
179
|
* Additional button
|
|
180
180
|
*/
|
|
181
|
-
MISC4,
|
|
181
|
+
MISC4 = 22,
|
|
182
182
|
/**
|
|
183
183
|
* Additional button
|
|
184
184
|
*/
|
|
185
|
-
MISC5,
|
|
185
|
+
MISC5 = 23,
|
|
186
186
|
/**
|
|
187
187
|
* Additional button
|
|
188
188
|
*/
|
|
189
|
-
MISC6,
|
|
189
|
+
MISC6 = 24,
|
|
190
190
|
/**
|
|
191
191
|
* PS4/PS5 touchpad button
|
|
192
192
|
*/
|
|
193
|
-
TOUCHPAD,
|
|
193
|
+
TOUCHPAD = 25,
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
|
|
@@ -211,32 +211,36 @@ export namespace Manette {
|
|
|
211
211
|
/**
|
|
212
212
|
* Generic gamepads
|
|
213
213
|
*/
|
|
214
|
-
GENERIC,
|
|
214
|
+
GENERIC = 0,
|
|
215
215
|
/**
|
|
216
216
|
* Steam Deck
|
|
217
217
|
*/
|
|
218
|
-
STEAM_DECK,
|
|
218
|
+
STEAM_DECK = 1,
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
223
|
* libmanette major version component (e.g. 1 if the version is 1.2.3).
|
|
224
|
+
* @default 1
|
|
224
225
|
*/
|
|
225
226
|
const MAJOR_VERSION: number;
|
|
226
227
|
|
|
227
228
|
/**
|
|
228
229
|
* libmanette micro version component (e.g. 3 if the version is 1.2.3).
|
|
230
|
+
* @default 0
|
|
229
231
|
*/
|
|
230
232
|
const MICRO_VERSION: number;
|
|
231
233
|
|
|
232
234
|
/**
|
|
233
235
|
* libmanette minor version component (e.g. 2 if the version is 1.2.3).
|
|
236
|
+
* @default 0
|
|
234
237
|
*/
|
|
235
238
|
const MINOR_VERSION: number;
|
|
236
239
|
|
|
237
240
|
/**
|
|
238
241
|
* libmanette version, encoded as a string, useful for printing and
|
|
239
242
|
* concatenation.
|
|
243
|
+
* @default 1.0.alpha
|
|
240
244
|
*/
|
|
241
245
|
const VERSION_S: string;
|
|
242
246
|
|
|
@@ -287,19 +291,19 @@ export namespace Manette {
|
|
|
287
291
|
* @signal
|
|
288
292
|
* @run-last
|
|
289
293
|
*/
|
|
290
|
-
"absolute-axis-changed": (
|
|
294
|
+
"absolute-axis-changed": (axis: Axis, value: number) => void;
|
|
291
295
|
/**
|
|
292
296
|
* Emitted when `button` is pressed.
|
|
293
297
|
* @signal
|
|
294
298
|
* @run-last
|
|
295
299
|
*/
|
|
296
|
-
"button-pressed": (
|
|
300
|
+
"button-pressed": (button: Button) => void;
|
|
297
301
|
/**
|
|
298
302
|
* Emitted when `button` is released.
|
|
299
303
|
* @signal
|
|
300
304
|
* @run-last
|
|
301
305
|
*/
|
|
302
|
-
"button-released": (
|
|
306
|
+
"button-released": (button: Button) => void;
|
|
303
307
|
/**
|
|
304
308
|
* Emitted when the device is disconnected.
|
|
305
309
|
* @signal
|
|
@@ -311,25 +315,25 @@ export namespace Manette {
|
|
|
311
315
|
* @signal
|
|
312
316
|
* @run-last
|
|
313
317
|
*/
|
|
314
|
-
"unmapped-absolute-axis-changed": (
|
|
318
|
+
"unmapped-absolute-axis-changed": (axis: number, value: number) => void;
|
|
315
319
|
/**
|
|
316
320
|
* Emitted when an unmapped button is pressed.
|
|
317
321
|
* @signal
|
|
318
322
|
* @run-last
|
|
319
323
|
*/
|
|
320
|
-
"unmapped-button-pressed": (
|
|
324
|
+
"unmapped-button-pressed": (index: number) => void;
|
|
321
325
|
/**
|
|
322
326
|
* Emitted when an unmapped button is released.
|
|
323
327
|
* @signal
|
|
324
328
|
* @run-last
|
|
325
329
|
*/
|
|
326
|
-
"unmapped-button-released": (
|
|
330
|
+
"unmapped-button-released": (index: number) => void;
|
|
327
331
|
/**
|
|
328
332
|
* Emitted when an unmapped hat axis' value changes.
|
|
329
333
|
* @signal
|
|
330
334
|
* @run-last
|
|
331
335
|
*/
|
|
332
|
-
"unmapped-hat-axis-changed": (
|
|
336
|
+
"unmapped-hat-axis-changed": (axis: number, value: number) => void;
|
|
333
337
|
}
|
|
334
338
|
|
|
335
339
|
// Constructor properties interface
|
|
@@ -487,13 +491,13 @@ export namespace Manette {
|
|
|
487
491
|
* @signal
|
|
488
492
|
* @run-last
|
|
489
493
|
*/
|
|
490
|
-
"device-connected": (
|
|
494
|
+
"device-connected": (device: Device) => void;
|
|
491
495
|
/**
|
|
492
496
|
* Emitted when `device` is disconnected.
|
|
493
497
|
* @signal
|
|
494
498
|
* @run-last
|
|
495
499
|
*/
|
|
496
|
-
"device-disconnected": (
|
|
500
|
+
"device-disconnected": (device: Device) => void;
|
|
497
501
|
}
|
|
498
502
|
|
|
499
503
|
// Constructor properties interface
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/manette-1",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"libraryVersion": "1.0.0",
|
|
5
5
|
"description": "GJS TypeScript type definitions for Manette-1, generated from library version 1.0.0",
|
|
6
6
|
"type": "module",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"test": "tsc --project tsconfig.json"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@girs/gjs": "^4.
|
|
36
|
-
"@girs/gio-2.0": "^4.
|
|
37
|
-
"@girs/gobject-2.0": "^4.
|
|
38
|
-
"@girs/glib-2.0": "^4.
|
|
39
|
-
"@girs/gmodule-2.0": "^4.
|
|
35
|
+
"@girs/gjs": "^4.5.0",
|
|
36
|
+
"@girs/gio-2.0": "^4.5.0",
|
|
37
|
+
"@girs/gobject-2.0": "^4.5.0",
|
|
38
|
+
"@girs/glib-2.0": "^4.5.0",
|
|
39
|
+
"@girs/gmodule-2.0": "^4.5.0" },
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"typescript": "*"
|
|
42
42
|
},
|