@girs/manette-1 1.0.0-4.0.0-beta.37
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 +85 -0
- package/index.d.ts +15 -0
- package/index.js +5 -0
- package/manette-1-ambient.d.ts +9 -0
- package/manette-1-ambient.js +2 -0
- package/manette-1-import.d.ts +9 -0
- package/manette-1-import.js +3 -0
- package/manette-1.d.ts +505 -0
- package/manette-1.js +5 -0
- package/package.json +55 -0
- package/tsconfig.json +25 -0
- package/typedoc.json +7 -0
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
# Manette-1
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
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.0.0-beta.37.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
To use this type definitions, install them with NPM:
|
|
13
|
+
```bash
|
|
14
|
+
npm install @girs/manette-1
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
You can import this package into your project like this:
|
|
20
|
+
```ts
|
|
21
|
+
import Manette from '@girs/manette-1';
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Ambient Modules
|
|
25
|
+
|
|
26
|
+
You can also use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) to import this module like you would do this in JavaScript.
|
|
27
|
+
For this you need to include `@girs/manette-1` or `@girs/manette-1/ambient` in your `tsconfig` or entry point Typescript file:
|
|
28
|
+
|
|
29
|
+
`index.ts`:
|
|
30
|
+
```ts
|
|
31
|
+
import '@girs/manette-1'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`tsconfig.json`:
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"compilerOptions": {
|
|
38
|
+
...
|
|
39
|
+
},
|
|
40
|
+
"include": ["@girs/manette-1"],
|
|
41
|
+
...
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Now you can import the ambient module with TypeScript support:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import Manette from 'gi://Manette?version=1';
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Global import
|
|
52
|
+
|
|
53
|
+
You can also import the module with Typescript support using the global `imports.gi` object of GJS.
|
|
54
|
+
For this you need to include `@girs/manette-1` or `@girs/manette-1/import` in your `tsconfig` or entry point Typescript file:
|
|
55
|
+
|
|
56
|
+
`index.ts`:
|
|
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
|
+
```
|
|
71
|
+
|
|
72
|
+
Now you have also type support for this, too:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
const Manette = imports.gi.Manette;
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Bundle
|
|
79
|
+
|
|
80
|
+
Depending on your project configuration, it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). You can find examples using different bundlers [here](https://github.com/gjsify/ts-for-gir/tree/main/examples).
|
|
81
|
+
|
|
82
|
+
## Other packages
|
|
83
|
+
|
|
84
|
+
All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
|
|
85
|
+
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
3
|
+
*
|
|
4
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
5
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
|
|
6
|
+
*
|
|
7
|
+
* This template is used to generate the index.d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import './manette-1-ambient.d.ts';
|
|
11
|
+
|
|
12
|
+
import './manette-1-import.d.ts';
|
|
13
|
+
|
|
14
|
+
import Manette from './manette-1.js';
|
|
15
|
+
export default Manette;
|
package/index.js
ADDED
package/manette-1.d.ts
ADDED
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
3
|
+
*
|
|
4
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
5
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
|
|
6
|
+
*
|
|
7
|
+
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import '@girs/gjs';
|
|
11
|
+
|
|
12
|
+
// Module dependencies
|
|
13
|
+
import type Gio from '@girs/gio-2.0';
|
|
14
|
+
import type GObject from '@girs/gobject-2.0';
|
|
15
|
+
import type GLib from '@girs/glib-2.0';
|
|
16
|
+
import type GModule from '@girs/gmodule-2.0';
|
|
17
|
+
|
|
18
|
+
export namespace Manette {
|
|
19
|
+
/**
|
|
20
|
+
* Manette-1
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Describes available axes a [class`Device]` can have.
|
|
25
|
+
*
|
|
26
|
+
* More values may be added to this enumeration over time.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Describes available axes a [class`Device]` can have.
|
|
31
|
+
*
|
|
32
|
+
* More values may be added to this enumeration over time.
|
|
33
|
+
*/
|
|
34
|
+
export namespace Axis {
|
|
35
|
+
export const $gtype: GObject.GType<Axis>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
enum Axis {
|
|
39
|
+
/**
|
|
40
|
+
* Left analog stick, horizontal axis
|
|
41
|
+
*/
|
|
42
|
+
LEFT_X,
|
|
43
|
+
/**
|
|
44
|
+
* Left analog stick, vertical axis
|
|
45
|
+
*/
|
|
46
|
+
LEFT_Y,
|
|
47
|
+
/**
|
|
48
|
+
* Right analog stick, horizontal axis
|
|
49
|
+
*/
|
|
50
|
+
RIGHT_X,
|
|
51
|
+
/**
|
|
52
|
+
* Right analog stick, vertical axis
|
|
53
|
+
*/
|
|
54
|
+
RIGHT_Y,
|
|
55
|
+
/**
|
|
56
|
+
* Left trigger (L2, LT or ZL)
|
|
57
|
+
*/
|
|
58
|
+
LEFT_TRIGGER,
|
|
59
|
+
/**
|
|
60
|
+
* Right trigger (R2, RT or ZR)
|
|
61
|
+
*/
|
|
62
|
+
RIGHT_TRIGGER,
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Describes available buttons a [class`Device]` can have.
|
|
66
|
+
*
|
|
67
|
+
* More values may be added to this enumeration over time.
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Describes available buttons a [class`Device]` can have.
|
|
72
|
+
*
|
|
73
|
+
* More values may be added to this enumeration over time.
|
|
74
|
+
*/
|
|
75
|
+
export namespace Button {
|
|
76
|
+
export const $gtype: GObject.GType<Button>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
enum Button {
|
|
80
|
+
/**
|
|
81
|
+
* D-pad (up)
|
|
82
|
+
*/
|
|
83
|
+
DPAD_UP,
|
|
84
|
+
/**
|
|
85
|
+
* D-pad (down)
|
|
86
|
+
*/
|
|
87
|
+
DPAD_DOWN,
|
|
88
|
+
/**
|
|
89
|
+
* D-pad (left)
|
|
90
|
+
*/
|
|
91
|
+
DPAD_LEFT,
|
|
92
|
+
/**
|
|
93
|
+
* D-pad (right)
|
|
94
|
+
*/
|
|
95
|
+
DPAD_RIGHT,
|
|
96
|
+
/**
|
|
97
|
+
* Top face button
|
|
98
|
+
* (XBox Y, Nintendo X, PlayStation triangle)
|
|
99
|
+
*/
|
|
100
|
+
NORTH,
|
|
101
|
+
/**
|
|
102
|
+
* Bottom face button
|
|
103
|
+
* (XBox A, Nintendo B, PlayStation X)
|
|
104
|
+
*/
|
|
105
|
+
SOUTH,
|
|
106
|
+
/**
|
|
107
|
+
* Left face button
|
|
108
|
+
* (XBox X, Nintendo Y, PlayStation square)
|
|
109
|
+
*/
|
|
110
|
+
WEST,
|
|
111
|
+
/**
|
|
112
|
+
* Right face button
|
|
113
|
+
* (XBox B, Nintendo A, PlayStation circle)
|
|
114
|
+
*/
|
|
115
|
+
EAST,
|
|
116
|
+
/**
|
|
117
|
+
* Left menu button
|
|
118
|
+
*/
|
|
119
|
+
SELECT,
|
|
120
|
+
/**
|
|
121
|
+
* Right menu button
|
|
122
|
+
*/
|
|
123
|
+
START,
|
|
124
|
+
/**
|
|
125
|
+
* Center menu button (Home, Guide, Steam etc)
|
|
126
|
+
*/
|
|
127
|
+
MODE,
|
|
128
|
+
/**
|
|
129
|
+
* Left shoulder button (L, L1 or LB)
|
|
130
|
+
*/
|
|
131
|
+
LEFT_SHOULDER,
|
|
132
|
+
/**
|
|
133
|
+
* Right shoulder button (R, R1 or RB)
|
|
134
|
+
*/
|
|
135
|
+
RIGHT_SHOULDER,
|
|
136
|
+
/**
|
|
137
|
+
* Left stick
|
|
138
|
+
*/
|
|
139
|
+
LEFT_STICK,
|
|
140
|
+
/**
|
|
141
|
+
* Right stick
|
|
142
|
+
*/
|
|
143
|
+
RIGHT_STICK,
|
|
144
|
+
/**
|
|
145
|
+
* Upper left paddle
|
|
146
|
+
* (Steam Deck L4 or XBox Elite P3)
|
|
147
|
+
*/
|
|
148
|
+
LEFT_PADDLE1,
|
|
149
|
+
/**
|
|
150
|
+
* Lower left paddle
|
|
151
|
+
* (Steam Deck L5 or XBox Elite P4)
|
|
152
|
+
*/
|
|
153
|
+
LEFT_PADDLE2,
|
|
154
|
+
/**
|
|
155
|
+
* Upper right paddle
|
|
156
|
+
* (Steam Deck R4 or XBox Elite P1)
|
|
157
|
+
*/
|
|
158
|
+
RIGHT_PADDLE1,
|
|
159
|
+
/**
|
|
160
|
+
* Lower right paddle
|
|
161
|
+
* (Steam Deck R5 or XBox Elite P2)
|
|
162
|
+
*/
|
|
163
|
+
RIGHT_PADDLE2,
|
|
164
|
+
/**
|
|
165
|
+
* Additional button
|
|
166
|
+
* (Steam Deck QAM button, Xbox Series X share button etc)
|
|
167
|
+
*/
|
|
168
|
+
MISC1,
|
|
169
|
+
/**
|
|
170
|
+
* Additional button
|
|
171
|
+
*/
|
|
172
|
+
MISC2,
|
|
173
|
+
/**
|
|
174
|
+
* Additional button
|
|
175
|
+
*/
|
|
176
|
+
MISC3,
|
|
177
|
+
/**
|
|
178
|
+
* Additional button
|
|
179
|
+
*/
|
|
180
|
+
MISC4,
|
|
181
|
+
/**
|
|
182
|
+
* Additional button
|
|
183
|
+
*/
|
|
184
|
+
MISC5,
|
|
185
|
+
/**
|
|
186
|
+
* Additional button
|
|
187
|
+
*/
|
|
188
|
+
MISC6,
|
|
189
|
+
/**
|
|
190
|
+
* PS4/PS5 touchpad button
|
|
191
|
+
*/
|
|
192
|
+
TOUCHPAD,
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Describes available types of a [class`Device]`.
|
|
196
|
+
*
|
|
197
|
+
* More values may be added to this enumeration over time.
|
|
198
|
+
*/
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Describes available types of a [class`Device]`.
|
|
202
|
+
*
|
|
203
|
+
* More values may be added to this enumeration over time.
|
|
204
|
+
*/
|
|
205
|
+
export namespace DeviceType {
|
|
206
|
+
export const $gtype: GObject.GType<DeviceType>;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
enum DeviceType {
|
|
210
|
+
/**
|
|
211
|
+
* Generic gamepads
|
|
212
|
+
*/
|
|
213
|
+
GENERIC,
|
|
214
|
+
/**
|
|
215
|
+
* Steam Deck
|
|
216
|
+
*/
|
|
217
|
+
STEAM_DECK,
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* libmanette major version component (e.g. 1 if the version is 1.2.3).
|
|
221
|
+
*/
|
|
222
|
+
const MAJOR_VERSION: number;
|
|
223
|
+
/**
|
|
224
|
+
* libmanette micro version component (e.g. 3 if the version is 1.2.3).
|
|
225
|
+
*/
|
|
226
|
+
const MICRO_VERSION: number;
|
|
227
|
+
/**
|
|
228
|
+
* libmanette minor version component (e.g. 2 if the version is 1.2.3).
|
|
229
|
+
*/
|
|
230
|
+
const MINOR_VERSION: number;
|
|
231
|
+
/**
|
|
232
|
+
* libmanette version, encoded as a string, useful for printing and
|
|
233
|
+
* concatenation.
|
|
234
|
+
*/
|
|
235
|
+
const VERSION_S: string;
|
|
236
|
+
/**
|
|
237
|
+
* Returns the major version number of the libmanette library.
|
|
238
|
+
*
|
|
239
|
+
* For example, in libmanette version 1.2.3 this is 1.
|
|
240
|
+
*
|
|
241
|
+
* This function is in the library, so it represents the libmanette library your
|
|
242
|
+
* code is running against. Contrast with the [const`MAJOR_VERSION]` constant,
|
|
243
|
+
* which represents the major version of the libmanette headers you have
|
|
244
|
+
* included when compiling your code.
|
|
245
|
+
* @returns the major version number of the libmanette library
|
|
246
|
+
*/
|
|
247
|
+
function get_major_version(): number;
|
|
248
|
+
/**
|
|
249
|
+
* Returns the micro version number of the libmanette library.
|
|
250
|
+
*
|
|
251
|
+
* For example, in libmanette version 1.2.3 this is 3.
|
|
252
|
+
*
|
|
253
|
+
* This function is in the library, so it represents the libmanette library your
|
|
254
|
+
* code is running against. Contrast with the [const`MAJOR_VERSION]` constant,
|
|
255
|
+
* which represents the micro version of the libmanette headers you have
|
|
256
|
+
* included when compiling your code.
|
|
257
|
+
* @returns the micro version number of the libmanette library
|
|
258
|
+
*/
|
|
259
|
+
function get_micro_version(): number;
|
|
260
|
+
/**
|
|
261
|
+
* Returns the minor version number of the libmanette library.
|
|
262
|
+
*
|
|
263
|
+
* For example, in libmanette version 1.2.3 this is 2.
|
|
264
|
+
*
|
|
265
|
+
* This function is in the library, so it represents the libmanette library your
|
|
266
|
+
* code is running against. Contrast with the [const`MAJOR_VERSION]` constant,
|
|
267
|
+
* which represents the minor version of the libmanette headers you have
|
|
268
|
+
* included when compiling your code.
|
|
269
|
+
* @returns the minor version number of the libmanette library
|
|
270
|
+
*/
|
|
271
|
+
function get_minor_version(): number;
|
|
272
|
+
namespace Device {
|
|
273
|
+
// Signal signatures
|
|
274
|
+
interface SignalSignatures extends GObject.Object.SignalSignatures {
|
|
275
|
+
'absolute-axis-changed': (arg0: Axis, arg1: number) => void;
|
|
276
|
+
'button-pressed': (arg0: Button) => void;
|
|
277
|
+
'button-released': (arg0: Button) => void;
|
|
278
|
+
disconnected: () => void;
|
|
279
|
+
'unmapped-absolute-axis-changed': (arg0: number, arg1: number) => void;
|
|
280
|
+
'unmapped-button-pressed': (arg0: number) => void;
|
|
281
|
+
'unmapped-button-released': (arg0: number) => void;
|
|
282
|
+
'unmapped-hat-axis-changed': (arg0: number, arg1: number) => void;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// Constructor properties interface
|
|
286
|
+
|
|
287
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* An object representing a physical gamepad.
|
|
292
|
+
*
|
|
293
|
+
* See also: [class`Monitor]`.
|
|
294
|
+
*/
|
|
295
|
+
class Device extends GObject.Object {
|
|
296
|
+
static $gtype: GObject.GType<Device>;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Compile-time signal type information.
|
|
300
|
+
*
|
|
301
|
+
* This instance property is generated only for TypeScript type checking.
|
|
302
|
+
* It is not defined at runtime and should not be accessed in JS code.
|
|
303
|
+
* @internal
|
|
304
|
+
*/
|
|
305
|
+
$signals: Device.SignalSignatures;
|
|
306
|
+
|
|
307
|
+
// Constructors
|
|
308
|
+
|
|
309
|
+
constructor(properties?: Partial<Device.ConstructorProps>, ...args: any[]);
|
|
310
|
+
|
|
311
|
+
_init(...args: any[]): void;
|
|
312
|
+
|
|
313
|
+
// Signals
|
|
314
|
+
|
|
315
|
+
connect<K extends keyof Device.SignalSignatures>(
|
|
316
|
+
signal: K,
|
|
317
|
+
callback: GObject.SignalCallback<this, Device.SignalSignatures[K]>,
|
|
318
|
+
): number;
|
|
319
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
320
|
+
connect_after<K extends keyof Device.SignalSignatures>(
|
|
321
|
+
signal: K,
|
|
322
|
+
callback: GObject.SignalCallback<this, Device.SignalSignatures[K]>,
|
|
323
|
+
): number;
|
|
324
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
325
|
+
emit<K extends keyof Device.SignalSignatures>(
|
|
326
|
+
signal: K,
|
|
327
|
+
...args: GObject.GjsParameters<Device.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
328
|
+
): void;
|
|
329
|
+
emit(signal: string, ...args: any[]): void;
|
|
330
|
+
|
|
331
|
+
// Methods
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Gets the timestamp of when the current event was emitted on `self`.
|
|
335
|
+
*
|
|
336
|
+
* Use this timestamp to ensure external factors such as synchronous disk writes
|
|
337
|
+
* don't influence your timing computations.
|
|
338
|
+
* @returns the timestamp of when the current event was emitted
|
|
339
|
+
*/
|
|
340
|
+
get_current_event_time(): number;
|
|
341
|
+
/**
|
|
342
|
+
* Gets the device type of `self`.
|
|
343
|
+
* @returns the device type
|
|
344
|
+
*/
|
|
345
|
+
get_device_type(): DeviceType;
|
|
346
|
+
/**
|
|
347
|
+
* Gets the identifier used by SDL mappings to discriminate game controller
|
|
348
|
+
* devices.
|
|
349
|
+
* @returns the identifier used by SDL mappings
|
|
350
|
+
*/
|
|
351
|
+
get_guid(): string;
|
|
352
|
+
/**
|
|
353
|
+
* Gets the user mapping for `self,` or default mapping if there isn't any.
|
|
354
|
+
*
|
|
355
|
+
* Can return `NULL` if there's no mapping or `self` doesn't support mappings.
|
|
356
|
+
* @returns the mapping for @self
|
|
357
|
+
*/
|
|
358
|
+
get_mapping(): string | null;
|
|
359
|
+
/**
|
|
360
|
+
* Gets the device's name.
|
|
361
|
+
* @returns the name of @self
|
|
362
|
+
*/
|
|
363
|
+
get_name(): string;
|
|
364
|
+
/**
|
|
365
|
+
* Gets whether the device has `axis`.
|
|
366
|
+
* @param axis an axis
|
|
367
|
+
* @returns whether the device has @axis
|
|
368
|
+
*/
|
|
369
|
+
has_axis(axis: Axis | null): boolean;
|
|
370
|
+
/**
|
|
371
|
+
* Gets whether the device has `button`.
|
|
372
|
+
* @param button a button
|
|
373
|
+
* @returns whether the device has @button
|
|
374
|
+
*/
|
|
375
|
+
has_button(button: Button | null): boolean;
|
|
376
|
+
/**
|
|
377
|
+
* Gets whether the device has the given input.
|
|
378
|
+
*
|
|
379
|
+
* If the input is present, it means that the device can send events for it
|
|
380
|
+
* regardless of whether the device is mapped or not.
|
|
381
|
+
* @param type the input type
|
|
382
|
+
* @param code the input code
|
|
383
|
+
* @returns whether the device has the given input
|
|
384
|
+
*/
|
|
385
|
+
has_input(type: number, code: number): boolean;
|
|
386
|
+
/**
|
|
387
|
+
* Gets whether `self` supports rumble.
|
|
388
|
+
* @returns whether @self supports rumble
|
|
389
|
+
*/
|
|
390
|
+
has_rumble(): boolean;
|
|
391
|
+
/**
|
|
392
|
+
* Gets whether `self` has a user mapping.
|
|
393
|
+
* @returns whether @self has a user mapping
|
|
394
|
+
*/
|
|
395
|
+
has_user_mapping(): boolean;
|
|
396
|
+
/**
|
|
397
|
+
* Removes the user mapping for `self`.
|
|
398
|
+
*/
|
|
399
|
+
remove_user_mapping(): void;
|
|
400
|
+
/**
|
|
401
|
+
* Make `self` rumble during `milliseconds` milliseconds.
|
|
402
|
+
*
|
|
403
|
+
* The heavy and light motors will rumble at their respectively defined
|
|
404
|
+
* magnitudes.
|
|
405
|
+
*
|
|
406
|
+
* The duration cannot exceed 32767 milliseconds.
|
|
407
|
+
* @param strong_magnitude the magnitude for the heavy motor
|
|
408
|
+
* @param weak_magnitude the magnitude for the light motor
|
|
409
|
+
* @param milliseconds the rumble effect play time in milliseconds
|
|
410
|
+
* @returns whether the rumble effect was played
|
|
411
|
+
*/
|
|
412
|
+
rumble(strong_magnitude: number, weak_magnitude: number, milliseconds: number): boolean;
|
|
413
|
+
/**
|
|
414
|
+
* Saves `mapping_string` as the user mapping for `self`.
|
|
415
|
+
* @param mapping_string the mapping string
|
|
416
|
+
*/
|
|
417
|
+
save_user_mapping(mapping_string: string): void;
|
|
418
|
+
/**
|
|
419
|
+
* Gets whether `self` supports mapping.
|
|
420
|
+
* @returns whether @self supports mapping
|
|
421
|
+
*/
|
|
422
|
+
supports_mapping(): boolean;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
namespace Monitor {
|
|
426
|
+
// Signal signatures
|
|
427
|
+
interface SignalSignatures extends GObject.Object.SignalSignatures {
|
|
428
|
+
'device-connected': (arg0: Device) => void;
|
|
429
|
+
'device-disconnected': (arg0: Device) => void;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// Constructor properties interface
|
|
433
|
+
|
|
434
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* An object monitoring the availability of devices.
|
|
439
|
+
*
|
|
440
|
+
* See also: [class`Device]`.
|
|
441
|
+
*/
|
|
442
|
+
class Monitor extends GObject.Object {
|
|
443
|
+
static $gtype: GObject.GType<Monitor>;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Compile-time signal type information.
|
|
447
|
+
*
|
|
448
|
+
* This instance property is generated only for TypeScript type checking.
|
|
449
|
+
* It is not defined at runtime and should not be accessed in JS code.
|
|
450
|
+
* @internal
|
|
451
|
+
*/
|
|
452
|
+
$signals: Monitor.SignalSignatures;
|
|
453
|
+
|
|
454
|
+
// Constructors
|
|
455
|
+
|
|
456
|
+
constructor(properties?: Partial<Monitor.ConstructorProps>, ...args: any[]);
|
|
457
|
+
|
|
458
|
+
_init(...args: any[]): void;
|
|
459
|
+
|
|
460
|
+
static ['new'](): Monitor;
|
|
461
|
+
|
|
462
|
+
// Signals
|
|
463
|
+
|
|
464
|
+
connect<K extends keyof Monitor.SignalSignatures>(
|
|
465
|
+
signal: K,
|
|
466
|
+
callback: GObject.SignalCallback<this, Monitor.SignalSignatures[K]>,
|
|
467
|
+
): number;
|
|
468
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
469
|
+
connect_after<K extends keyof Monitor.SignalSignatures>(
|
|
470
|
+
signal: K,
|
|
471
|
+
callback: GObject.SignalCallback<this, Monitor.SignalSignatures[K]>,
|
|
472
|
+
): number;
|
|
473
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
474
|
+
emit<K extends keyof Monitor.SignalSignatures>(
|
|
475
|
+
signal: K,
|
|
476
|
+
...args: GObject.GjsParameters<Monitor.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
477
|
+
): void;
|
|
478
|
+
emit(signal: string, ...args: any[]): void;
|
|
479
|
+
|
|
480
|
+
// Methods
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Lists the currently connected devices.
|
|
484
|
+
* @returns the list of devices
|
|
485
|
+
*/
|
|
486
|
+
list_devices(): Device[];
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
type DeviceClass = typeof Device;
|
|
490
|
+
type MonitorClass = typeof Monitor;
|
|
491
|
+
/**
|
|
492
|
+
* Name of the imported GIR library
|
|
493
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
494
|
+
*/
|
|
495
|
+
const __name__: string;
|
|
496
|
+
/**
|
|
497
|
+
* Version of the imported GIR library
|
|
498
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
499
|
+
*/
|
|
500
|
+
const __version__: string;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
export default Manette;
|
|
504
|
+
|
|
505
|
+
// END
|
package/manette-1.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@girs/manette-1",
|
|
3
|
+
"version": "1.0.0-4.0.0-beta.37",
|
|
4
|
+
"description": "GJS TypeScript type definitions for Manette-1, generated from library version 1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "manette-1.js",
|
|
7
|
+
"main": "manette-1.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./ambient": {
|
|
10
|
+
"types": "./manette-1-ambient.d.ts",
|
|
11
|
+
"import": "./manette-1-ambient.js",
|
|
12
|
+
"default": "./manette-1-ambient.js"
|
|
13
|
+
},
|
|
14
|
+
"./import": {
|
|
15
|
+
"types": "./manette-1-import.d.ts",
|
|
16
|
+
"import": "./manette-1-import.js",
|
|
17
|
+
"default": "./manette-1-import.js"
|
|
18
|
+
},
|
|
19
|
+
"./manette-1": {
|
|
20
|
+
"types": "./manette-1.d.ts",
|
|
21
|
+
"import": "./manette-1.js",
|
|
22
|
+
"default": "./manette-1.js"
|
|
23
|
+
},
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./index.d.ts",
|
|
26
|
+
"import": "./index.js",
|
|
27
|
+
"default": "./index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"test": "tsc --project tsconfig.json"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@girs/gjs": "4.0.0-beta.37",
|
|
35
|
+
"@girs/gio-2.0": "2.86.0-4.0.0-beta.37",
|
|
36
|
+
"@girs/gobject-2.0": "2.86.0-4.0.0-beta.37",
|
|
37
|
+
"@girs/glib-2.0": "2.86.0-4.0.0-beta.37",
|
|
38
|
+
"@girs/gmodule-2.0": "2.0.0-4.0.0-beta.37" },
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"typescript": "*"
|
|
41
|
+
},
|
|
42
|
+
"keywords": ["Gir", "TypeScript", "types", "GObject-Introspection", "GJS", "Manette-1"],
|
|
43
|
+
"author": "ts-for-gir",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/gjsify/types.git"
|
|
48
|
+
},
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/gjsify/ts-for-gir/issues"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://github.com/gjsify/types/tree/main/manette-1#readme"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// General settings for code interpretation
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "NodeNext",
|
|
6
|
+
"lib": ["ESNext"],
|
|
7
|
+
"types": [],
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
"moduleResolution": "NodeNext",
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"noEmitOnError": false,
|
|
12
|
+
"baseUrl": "./",
|
|
13
|
+
"rootDir": ".",
|
|
14
|
+
// General settings for code generation
|
|
15
|
+
"removeComments": false,
|
|
16
|
+
"inlineSourceMap": false,
|
|
17
|
+
"inlineSources": false,
|
|
18
|
+
"newLine": "LF",
|
|
19
|
+
// Show diagnostics
|
|
20
|
+
"diagnostics": true
|
|
21
|
+
},
|
|
22
|
+
"include": ["./manette-1.d.ts"]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|