@girs/gnomebluetooth-3.0 3.0.0-3.2.4 → 3.0.0-3.2.6
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
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for GnomeBluetooth-3.0, generated from library version 3.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.
|
|
8
|
+
GJS TypeScript type definitions for GnomeBluetooth-3.0, generated from library version 3.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.6.
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
## Install
|
|
@@ -81,6 +81,19 @@ Now you have also type support for this, too:
|
|
|
81
81
|
const GnomeBluetooth = imports.gi.GnomeBluetooth;
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
|
|
85
|
+
### ESM vs. CommonJS
|
|
86
|
+
|
|
87
|
+
GJS supports two different import syntaxes. The new modern ESM syntax and the old global imports syntax.
|
|
88
|
+
|
|
89
|
+
In TypeScript projects for GJS and GNOME Shell extensions, you have the flexibility to use `ESM` syntax and then decide the import syntax for your bundled file. If your bundler is configured to use `CommonJS`, it will convert to the GJS-specific global imports syntax, like `const moduleName = imports.gi[moduleName]`. This is different from the traditional `require` syntax seen in Node.js. The global imports syntax is chosen because it aligns with the CommonJS format supported by NPM, which is used for the generated type definitions and this package.
|
|
90
|
+
|
|
91
|
+
On the other hand, if you configure your bundler to use ESM, it will retain the ESM import syntax. It's crucial to ensure that your bundler is set up to correctly translate and bundle these imports into either CommonJS or ESM format, depending on your project's requirements.
|
|
92
|
+
|
|
93
|
+
This approach is particularly important due to the `@girs` types, which include both `*.cjs `files, using the GJS global imports syntax, and `*.js` files, which utilize the ESM syntax. By appropriately setting up your bundler, you can control which syntax—CommonJS or ESM—is used in your project. The choice of CommonJS in this context is also due to the similarity between the GJS-specific global imports and CommonJS syntax, allowing for easier management and bundling in these specific types of projects.
|
|
94
|
+
|
|
95
|
+
Since GNOME Shell 45, you should only use ESM, even for GNOME Shell extensions. Before that, extensions had to use the global import syntax, unlike normal GJS applications, where ESM has been available for some time.
|
|
96
|
+
|
|
84
97
|
### Bundle
|
|
85
98
|
|
|
86
99
|
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).
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
2
|
declare module 'gi://GnomeBluetooth?version=3.0' {
|
|
4
3
|
import GnomeBluetooth30 from '@girs/gnomebluetooth-3.0';
|
|
5
4
|
export default GnomeBluetooth30;
|
|
6
5
|
}
|
|
7
6
|
|
|
7
|
+
declare module 'gi://GnomeBluetooth' {
|
|
8
|
+
import GnomeBluetooth30 from '@girs/gnomebluetooth-3.0';
|
|
9
|
+
export default GnomeBluetooth30;
|
|
10
|
+
}
|
|
8
11
|
|
|
9
12
|
|
package/gnomebluetooth-3.0.d.cts
CHANGED
|
@@ -228,6 +228,14 @@ export module Client {
|
|
|
228
228
|
* %TRUE if the default Bluetooth adapter is in setup mode (discoverable, and discovering).
|
|
229
229
|
*/
|
|
230
230
|
default_adapter_setup_mode?: boolean | null
|
|
231
|
+
/**
|
|
232
|
+
* %TRUE if the default Bluetooth adapter is powered.
|
|
233
|
+
*/
|
|
234
|
+
defaultAdapterPowered?: boolean | null
|
|
235
|
+
/**
|
|
236
|
+
* %TRUE if the default Bluetooth adapter is in setup mode (discoverable, and discovering).
|
|
237
|
+
*/
|
|
238
|
+
defaultAdapterSetupMode?: boolean | null
|
|
231
239
|
}
|
|
232
240
|
|
|
233
241
|
}
|
|
@@ -240,31 +248,60 @@ export interface Client {
|
|
|
240
248
|
* The D-Bus path of the default Bluetooth adapter or %NULL.
|
|
241
249
|
*/
|
|
242
250
|
readonly default_adapter: string | null
|
|
251
|
+
/**
|
|
252
|
+
* The D-Bus path of the default Bluetooth adapter or %NULL.
|
|
253
|
+
*/
|
|
254
|
+
readonly defaultAdapter: string | null
|
|
243
255
|
/**
|
|
244
256
|
* The address of the default Bluetooth adapter or %NULL.
|
|
245
257
|
*/
|
|
246
258
|
readonly default_adapter_address: string | null
|
|
259
|
+
/**
|
|
260
|
+
* The address of the default Bluetooth adapter or %NULL.
|
|
261
|
+
*/
|
|
262
|
+
readonly defaultAdapterAddress: string | null
|
|
247
263
|
/**
|
|
248
264
|
* The name of the default Bluetooth adapter or %NULL.
|
|
249
265
|
*/
|
|
250
266
|
readonly default_adapter_name: string | null
|
|
267
|
+
/**
|
|
268
|
+
* The name of the default Bluetooth adapter or %NULL.
|
|
269
|
+
*/
|
|
270
|
+
readonly defaultAdapterName: string | null
|
|
251
271
|
/**
|
|
252
272
|
* %TRUE if the default Bluetooth adapter is powered.
|
|
253
273
|
*/
|
|
254
274
|
default_adapter_powered: boolean
|
|
275
|
+
/**
|
|
276
|
+
* %TRUE if the default Bluetooth adapter is powered.
|
|
277
|
+
*/
|
|
278
|
+
defaultAdapterPowered: boolean
|
|
255
279
|
/**
|
|
256
280
|
* %TRUE if the default Bluetooth adapter is in setup mode (discoverable, and discovering).
|
|
257
281
|
*/
|
|
258
282
|
default_adapter_setup_mode: boolean
|
|
283
|
+
/**
|
|
284
|
+
* %TRUE if the default Bluetooth adapter is in setup mode (discoverable, and discovering).
|
|
285
|
+
*/
|
|
286
|
+
defaultAdapterSetupMode: boolean
|
|
259
287
|
/**
|
|
260
288
|
* The #BluetoothAdapterState of the default Bluetooth adapter. More precise than
|
|
261
289
|
* #BluetoothClient:default-adapter-powered.
|
|
262
290
|
*/
|
|
263
291
|
readonly default_adapter_state: AdapterState
|
|
292
|
+
/**
|
|
293
|
+
* The #BluetoothAdapterState of the default Bluetooth adapter. More precise than
|
|
294
|
+
* #BluetoothClient:default-adapter-powered.
|
|
295
|
+
*/
|
|
296
|
+
readonly defaultAdapterState: AdapterState
|
|
264
297
|
/**
|
|
265
298
|
* The number of detected Bluetooth adapters.
|
|
266
299
|
*/
|
|
267
300
|
readonly num_adapters: number
|
|
301
|
+
/**
|
|
302
|
+
* The number of detected Bluetooth adapters.
|
|
303
|
+
*/
|
|
304
|
+
readonly numAdapters: number
|
|
268
305
|
|
|
269
306
|
// Owm methods of GnomeBluetooth-3.0.GnomeBluetooth.Client
|
|
270
307
|
|
|
@@ -391,6 +428,10 @@ export module Device {
|
|
|
391
428
|
trusted?: boolean | null
|
|
392
429
|
type?: Type | null
|
|
393
430
|
uuids?: string[] | null
|
|
431
|
+
batteryLevel?: number | null
|
|
432
|
+
batteryPercentage?: number | null
|
|
433
|
+
batteryType?: BatteryType | null
|
|
434
|
+
legacyPairing?: boolean | null
|
|
394
435
|
}
|
|
395
436
|
|
|
396
437
|
}
|
|
@@ -402,12 +443,16 @@ export interface Device {
|
|
|
402
443
|
address: string | null
|
|
403
444
|
alias: string | null
|
|
404
445
|
battery_level: number
|
|
446
|
+
batteryLevel: number
|
|
405
447
|
battery_percentage: number
|
|
448
|
+
batteryPercentage: number
|
|
406
449
|
battery_type: BatteryType
|
|
450
|
+
batteryType: BatteryType
|
|
407
451
|
readonly connectable: boolean
|
|
408
452
|
connected: boolean
|
|
409
453
|
icon: string | null
|
|
410
454
|
legacy_pairing: boolean
|
|
455
|
+
legacyPairing: boolean
|
|
411
456
|
name: string | null
|
|
412
457
|
paired: boolean
|
|
413
458
|
proxy: Gio.DBusProxy
|
package/gnomebluetooth-3.0.d.ts
CHANGED
|
@@ -230,6 +230,14 @@ module Client {
|
|
|
230
230
|
* %TRUE if the default Bluetooth adapter is in setup mode (discoverable, and discovering).
|
|
231
231
|
*/
|
|
232
232
|
default_adapter_setup_mode?: boolean | null
|
|
233
|
+
/**
|
|
234
|
+
* %TRUE if the default Bluetooth adapter is powered.
|
|
235
|
+
*/
|
|
236
|
+
defaultAdapterPowered?: boolean | null
|
|
237
|
+
/**
|
|
238
|
+
* %TRUE if the default Bluetooth adapter is in setup mode (discoverable, and discovering).
|
|
239
|
+
*/
|
|
240
|
+
defaultAdapterSetupMode?: boolean | null
|
|
233
241
|
}
|
|
234
242
|
|
|
235
243
|
}
|
|
@@ -242,31 +250,60 @@ interface Client {
|
|
|
242
250
|
* The D-Bus path of the default Bluetooth adapter or %NULL.
|
|
243
251
|
*/
|
|
244
252
|
readonly default_adapter: string | null
|
|
253
|
+
/**
|
|
254
|
+
* The D-Bus path of the default Bluetooth adapter or %NULL.
|
|
255
|
+
*/
|
|
256
|
+
readonly defaultAdapter: string | null
|
|
245
257
|
/**
|
|
246
258
|
* The address of the default Bluetooth adapter or %NULL.
|
|
247
259
|
*/
|
|
248
260
|
readonly default_adapter_address: string | null
|
|
261
|
+
/**
|
|
262
|
+
* The address of the default Bluetooth adapter or %NULL.
|
|
263
|
+
*/
|
|
264
|
+
readonly defaultAdapterAddress: string | null
|
|
249
265
|
/**
|
|
250
266
|
* The name of the default Bluetooth adapter or %NULL.
|
|
251
267
|
*/
|
|
252
268
|
readonly default_adapter_name: string | null
|
|
269
|
+
/**
|
|
270
|
+
* The name of the default Bluetooth adapter or %NULL.
|
|
271
|
+
*/
|
|
272
|
+
readonly defaultAdapterName: string | null
|
|
253
273
|
/**
|
|
254
274
|
* %TRUE if the default Bluetooth adapter is powered.
|
|
255
275
|
*/
|
|
256
276
|
default_adapter_powered: boolean
|
|
277
|
+
/**
|
|
278
|
+
* %TRUE if the default Bluetooth adapter is powered.
|
|
279
|
+
*/
|
|
280
|
+
defaultAdapterPowered: boolean
|
|
257
281
|
/**
|
|
258
282
|
* %TRUE if the default Bluetooth adapter is in setup mode (discoverable, and discovering).
|
|
259
283
|
*/
|
|
260
284
|
default_adapter_setup_mode: boolean
|
|
285
|
+
/**
|
|
286
|
+
* %TRUE if the default Bluetooth adapter is in setup mode (discoverable, and discovering).
|
|
287
|
+
*/
|
|
288
|
+
defaultAdapterSetupMode: boolean
|
|
261
289
|
/**
|
|
262
290
|
* The #BluetoothAdapterState of the default Bluetooth adapter. More precise than
|
|
263
291
|
* #BluetoothClient:default-adapter-powered.
|
|
264
292
|
*/
|
|
265
293
|
readonly default_adapter_state: AdapterState
|
|
294
|
+
/**
|
|
295
|
+
* The #BluetoothAdapterState of the default Bluetooth adapter. More precise than
|
|
296
|
+
* #BluetoothClient:default-adapter-powered.
|
|
297
|
+
*/
|
|
298
|
+
readonly defaultAdapterState: AdapterState
|
|
266
299
|
/**
|
|
267
300
|
* The number of detected Bluetooth adapters.
|
|
268
301
|
*/
|
|
269
302
|
readonly num_adapters: number
|
|
303
|
+
/**
|
|
304
|
+
* The number of detected Bluetooth adapters.
|
|
305
|
+
*/
|
|
306
|
+
readonly numAdapters: number
|
|
270
307
|
|
|
271
308
|
// Owm methods of GnomeBluetooth-3.0.GnomeBluetooth.Client
|
|
272
309
|
|
|
@@ -393,6 +430,10 @@ module Device {
|
|
|
393
430
|
trusted?: boolean | null
|
|
394
431
|
type?: Type | null
|
|
395
432
|
uuids?: string[] | null
|
|
433
|
+
batteryLevel?: number | null
|
|
434
|
+
batteryPercentage?: number | null
|
|
435
|
+
batteryType?: BatteryType | null
|
|
436
|
+
legacyPairing?: boolean | null
|
|
396
437
|
}
|
|
397
438
|
|
|
398
439
|
}
|
|
@@ -404,12 +445,16 @@ interface Device {
|
|
|
404
445
|
address: string | null
|
|
405
446
|
alias: string | null
|
|
406
447
|
battery_level: number
|
|
448
|
+
batteryLevel: number
|
|
407
449
|
battery_percentage: number
|
|
450
|
+
batteryPercentage: number
|
|
408
451
|
battery_type: BatteryType
|
|
452
|
+
batteryType: BatteryType
|
|
409
453
|
readonly connectable: boolean
|
|
410
454
|
connected: boolean
|
|
411
455
|
icon: string | null
|
|
412
456
|
legacy_pairing: boolean
|
|
457
|
+
legacyPairing: boolean
|
|
413
458
|
name: string | null
|
|
414
459
|
paired: boolean
|
|
415
460
|
proxy: Gio.DBusProxy
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/gnomebluetooth-3.0",
|
|
3
|
-
"version": "3.0.0-3.2.
|
|
3
|
+
"version": "3.0.0-3.2.6",
|
|
4
4
|
"description": "GJS TypeScript type definitions for GnomeBluetooth-3.0, generated from library version 3.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "gnomebluetooth-3.0.js",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gnomebluetooth-3.0.d.cts"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@girs/gio-2.0": "^2.78.0-3.2.
|
|
29
|
-
"@girs/gjs": "^3.2.
|
|
30
|
-
"@girs/glib-2.0": "^2.78.0-3.2.
|
|
31
|
-
"@girs/gobject-2.0": "^2.78.0-3.2.
|
|
28
|
+
"@girs/gio-2.0": "^2.78.0-3.2.6",
|
|
29
|
+
"@girs/gjs": "^3.2.6",
|
|
30
|
+
"@girs/glib-2.0": "^2.78.0-3.2.6",
|
|
31
|
+
"@girs/gobject-2.0": "^2.78.0-3.2.6"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"typescript": "*"
|