@girs/gudev-1.0 1.0.0-3.0.0-beta.12

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.
@@ -0,0 +1,885 @@
1
+
2
+ /*
3
+ * Type Definitions for Gjs (https://gjs.guide/)
4
+ *
5
+ * These type definitions are automatically generated, do not edit them by hand.
6
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gjs
7
+ */
8
+ /**
9
+ * GUdev-1.0
10
+ */
11
+
12
+ import type GObject from '@girs/gobject-2.0';
13
+ import type GLib from '@girs/glib-2.0';
14
+
15
+ /**
16
+ * Enumeration used to specify a the type of a device.
17
+ */
18
+ export enum DeviceType {
19
+ /**
20
+ * Device does not have a device file.
21
+ */
22
+ NONE,
23
+ /**
24
+ * Device is a block device.
25
+ */
26
+ BLOCK,
27
+ /**
28
+ * Device is a character device.
29
+ */
30
+ CHAR,
31
+ }
32
+ export module Client {
33
+
34
+ // Signal callback interfaces
35
+
36
+ /**
37
+ * Signal callback interface for `uevent`
38
+ */
39
+ export interface UeventSignalCallback {
40
+ ($obj: Client, action: string | null, device: Device): void
41
+ }
42
+
43
+
44
+ // Constructor properties interface
45
+
46
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
47
+
48
+ // Own constructor properties of GUdev-1.0.GUdev.Client
49
+
50
+ /**
51
+ * The subsystems to listen for uevents on.
52
+ *
53
+ * To listen for only a specific DEVTYPE for a given SUBSYSTEM, use
54
+ * "subsystem/devtype". For example, to only listen for uevents
55
+ * where SUBSYSTEM is usb and DEVTYPE is usb_interface, use
56
+ * "usb/usb_interface".
57
+ *
58
+ * If this property is %NULL, then no events will be reported. If
59
+ * it's the empty array, events from all subsystems will be
60
+ * reported.
61
+ */
62
+ subsystems?: string[] | null
63
+ }
64
+
65
+ }
66
+
67
+ export interface Client {
68
+
69
+ // Own properties of GUdev-1.0.GUdev.Client
70
+
71
+ /**
72
+ * The subsystems to listen for uevents on.
73
+ *
74
+ * To listen for only a specific DEVTYPE for a given SUBSYSTEM, use
75
+ * "subsystem/devtype". For example, to only listen for uevents
76
+ * where SUBSYSTEM is usb and DEVTYPE is usb_interface, use
77
+ * "usb/usb_interface".
78
+ *
79
+ * If this property is %NULL, then no events will be reported. If
80
+ * it's the empty array, events from all subsystems will be
81
+ * reported.
82
+ */
83
+ readonly subsystems: string[]
84
+
85
+ // Own fields of GUdev-1.0.GUdev.Client
86
+
87
+ parent: GObject.Object
88
+
89
+ // Owm methods of GUdev-1.0.GUdev.Client
90
+
91
+ /**
92
+ * Looks up a device for a device file.
93
+ * @param device_file A device file.
94
+ * @returns A #GUdevDevice object or %NULL if the device was not found. Free with g_object_unref().
95
+ */
96
+ query_by_device_file(device_file: string | null): Device | null
97
+ /**
98
+ * Looks up a device for a type and device number.
99
+ * @param type A value from the #GUdevDeviceType enumeration.
100
+ * @param number A device number.
101
+ * @returns A #GUdevDevice object or %NULL if the device was not found. Free with g_object_unref().
102
+ */
103
+ query_by_device_number(type: DeviceType, number: DeviceNumber): Device | null
104
+ /**
105
+ * Gets all devices belonging to `subsystem`.
106
+ * @param subsystem The subsystem to get devices for or %NULL to get all devices.
107
+ * @returns A list of #GUdevDevice objects. The caller should free the result by using g_object_unref() on each element in the list and then g_list_free() on the list.
108
+ */
109
+ query_by_subsystem(subsystem: string | null): Device[] | null
110
+ /**
111
+ * Looks up a device for a subsystem and name.
112
+ * @param subsystem A subsystem name.
113
+ * @param name The name of the device.
114
+ * @returns A #GUdevDevice object or %NULL if the device was not found. Free with g_object_unref().
115
+ */
116
+ query_by_subsystem_and_name(subsystem: string | null, name: string | null): Device | null
117
+ /**
118
+ * Looks up a device for a sysfs path.
119
+ * @param sysfs_path A sysfs path.
120
+ * @returns A #GUdevDevice object or %NULL if the device was not found. Free with g_object_unref().
121
+ */
122
+ query_by_sysfs_path(sysfs_path: string | null): Device | null
123
+
124
+ // Own virtual methods of GUdev-1.0.GUdev.Client
125
+
126
+ vfunc_uevent(action: string | null, device: Device): void
127
+
128
+ // Own signals of GUdev-1.0.GUdev.Client
129
+
130
+ connect(sigName: "uevent", callback: Client.UeventSignalCallback): number
131
+ connect_after(sigName: "uevent", callback: Client.UeventSignalCallback): number
132
+ emit(sigName: "uevent", action: string | null, device: Device, ...args: any[]): void
133
+
134
+ // Class property signals of GUdev-1.0.GUdev.Client
135
+
136
+ connect(sigName: "notify::subsystems", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
137
+ connect_after(sigName: "notify::subsystems", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
138
+ emit(sigName: "notify::subsystems", ...args: any[]): void
139
+ connect(sigName: string, callback: (...args: any[]) => void): number
140
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
141
+ emit(sigName: string, ...args: any[]): void
142
+ disconnect(id: number): void
143
+ }
144
+
145
+ /**
146
+ * #GUdevClient is used to query information about devices on a Linux
147
+ * system from the Linux kernel and the udev device
148
+ * manager.
149
+ *
150
+ * Device information is retrieved from the kernel (through the
151
+ * <literal>sysfs</literal> filesystem) and the udev daemon (through a
152
+ * <literal>tmpfs</literal> filesystem) and presented through
153
+ * #GUdevDevice objects. This means that no blocking IO ever happens
154
+ * (in both cases, we are essentially just reading data from kernel
155
+ * memory) and as such there are no asynchronous versions of the
156
+ * provided methods.
157
+ *
158
+ * To get #GUdevDevice objects, use
159
+ * g_udev_client_query_by_subsystem(),
160
+ * g_udev_client_query_by_device_number(),
161
+ * g_udev_client_query_by_device_file(),
162
+ * g_udev_client_query_by_sysfs_path(),
163
+ * g_udev_client_query_by_subsystem_and_name()
164
+ * or the #GUdevEnumerator type.
165
+ *
166
+ * To listen to uevents, connect to the #GUdevClient::uevent signal.
167
+ * @class
168
+ */
169
+ export class Client extends GObject.Object {
170
+
171
+ // Own properties of GUdev-1.0.GUdev.Client
172
+
173
+ static name: string
174
+ static $gtype: GObject.GType<Client>
175
+
176
+ // Constructors of GUdev-1.0.GUdev.Client
177
+
178
+ constructor(config?: Client.ConstructorProperties)
179
+ /**
180
+ * Constructs a #GUdevClient object that can be used to query
181
+ * information about devices. Connect to the #GUdevClient::uevent
182
+ * signal to listen for uevents. Note that signals are emitted in the
183
+ * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
184
+ * of the thread that you call this constructor from.
185
+ * @constructor
186
+ * @param subsystems A %NULL terminated string array of subsystems to listen for uevents on, %NULL to not listen on uevents at all, or an empty array to listen to uevents on all subsystems. See the documentation for the #GUdevClient:subsystems property for details on this parameter.
187
+ * @returns A new #GUdevClient object. Free with g_object_unref().
188
+ */
189
+ constructor(subsystems: string[] | null)
190
+ /**
191
+ * Constructs a #GUdevClient object that can be used to query
192
+ * information about devices. Connect to the #GUdevClient::uevent
193
+ * signal to listen for uevents. Note that signals are emitted in the
194
+ * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
195
+ * of the thread that you call this constructor from.
196
+ * @constructor
197
+ * @param subsystems A %NULL terminated string array of subsystems to listen for uevents on, %NULL to not listen on uevents at all, or an empty array to listen to uevents on all subsystems. See the documentation for the #GUdevClient:subsystems property for details on this parameter.
198
+ * @returns A new #GUdevClient object. Free with g_object_unref().
199
+ */
200
+ static new(subsystems: string[] | null): Client
201
+ _init(config?: Client.ConstructorProperties): void
202
+ }
203
+
204
+ export module Device {
205
+
206
+ // Constructor properties interface
207
+
208
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
209
+ }
210
+
211
+ }
212
+
213
+ export interface Device {
214
+
215
+ // Own fields of GUdev-1.0.GUdev.Device
216
+
217
+ parent: GObject.Object
218
+
219
+ // Owm methods of GUdev-1.0.GUdev.Device
220
+
221
+ /**
222
+ * Gets the most recent action (e.g. "add", "remove", "change", etc.) for `device`.
223
+ * @returns An action string.
224
+ */
225
+ get_action(): string | null
226
+ /**
227
+ * Gets the device file for `device`.
228
+ * @returns The device file for @device or %NULL if no device file exists.
229
+ */
230
+ get_device_file(): string | null
231
+ /**
232
+ * Gets a list of symlinks (in <literal>/dev</literal>) that points to
233
+ * the device file for `device`.
234
+ * @returns A %NULL terminated string array of symlinks. This array is owned by @device and should not be freed by the caller.
235
+ */
236
+ get_device_file_symlinks(): string[]
237
+ /**
238
+ * Gets the device number, if any, for `device`.
239
+ * @returns The device number for @device or 0 if unknown.
240
+ */
241
+ get_device_number(): DeviceNumber
242
+ /**
243
+ * Gets the type of the device file, if any, for `device`.
244
+ * @returns The device number for @device or #G_UDEV_DEVICE_TYPE_NONE if the device does not have a device file.
245
+ */
246
+ get_device_type(): DeviceType
247
+ /**
248
+ * Gets the device type for `device`.
249
+ * @returns The devtype for @device.
250
+ */
251
+ get_devtype(): string | null
252
+ /**
253
+ * Gets the name of the driver used for `device`.
254
+ * @returns The name of the driver for @device or %NULL if unknown.
255
+ */
256
+ get_driver(): string | null
257
+ /**
258
+ * Gets whether `device` has been initialized.
259
+ * @returns Whether @device has been initialized.
260
+ */
261
+ get_is_initialized(): boolean
262
+ /**
263
+ * Gets the name of `device,` e.g. "sda3".
264
+ * @returns The name of @device.
265
+ */
266
+ get_name(): string | null
267
+ /**
268
+ * Gets the number of `device,` e.g. "3" if g_udev_device_get_name() returns "sda3".
269
+ * @returns The number of @device.
270
+ */
271
+ get_number(): string | null
272
+ /**
273
+ * Gets the immediate parent of `device,` if any.
274
+ * @returns A #GUdevDevice or %NULL if @device has no parent. Free with g_object_unref().
275
+ */
276
+ get_parent(): Device | null
277
+ /**
278
+ * Walks up the chain of parents of `device` and returns the first
279
+ * device encountered where `subsystem` and `devtype` matches, if any.
280
+ * @param subsystem The subsystem of the parent to get.
281
+ * @param devtype The devtype of the parent to get or %NULL.
282
+ * @returns A #GUdevDevice or %NULL if @device has no parent with @subsystem and @devtype. Free with g_object_unref().
283
+ */
284
+ get_parent_with_subsystem(subsystem: string | null, devtype: string | null): Device | null
285
+ /**
286
+ * Look up the value for `key` on `device`.
287
+ * @param key Name of property.
288
+ * @returns The value for @key or %NULL if @key doesn't exist on @device. Do not free this string, it is owned by @device.
289
+ */
290
+ get_property(key: string | null): string | null
291
+
292
+ // Overloads of get_property
293
+
294
+ /**
295
+ * Gets a property of an object.
296
+ *
297
+ * The `value` can be:
298
+ *
299
+ * - an empty #GValue initialized by %G_VALUE_INIT, which will be
300
+ * automatically initialized with the expected type of the property
301
+ * (since GLib 2.60)
302
+ * - a #GValue initialized with the expected type of the property
303
+ * - a #GValue initialized with a type to which the expected type
304
+ * of the property can be transformed
305
+ *
306
+ * In general, a copy is made of the property contents and the caller is
307
+ * responsible for freeing the memory by calling g_value_unset().
308
+ *
309
+ * Note that g_object_get_property() is really intended for language
310
+ * bindings, g_object_get() is much more convenient for C programming.
311
+ * @param property_name the name of the property to get
312
+ * @param value return location for the property value
313
+ */
314
+ get_property(property_name: string | null, value: any): void
315
+ /**
316
+ * Look up the value for `key` on `device` and convert it to an
317
+ * boolean. This is done by doing a case-insensitive string comparison
318
+ * on the string value against "1" and "true".
319
+ * @param key Name of property.
320
+ * @returns The value for @key or %FALSE if @key doesn't exist or isn't a #gboolean.
321
+ */
322
+ get_property_as_boolean(key: string | null): boolean
323
+ /**
324
+ * Look up the value for `key` on `device` and convert it to a double
325
+ * precision floating point number using g_ascii_strtod().
326
+ * @param key Name of property.
327
+ * @returns The value for @key or 0.0 if @key doesn't exist or isn't a #gdouble.
328
+ */
329
+ get_property_as_double(key: string | null): number
330
+ /**
331
+ * Look up the value for `key` on `device` and convert it to an integer
332
+ * using strtol().
333
+ * @param key Name of property.
334
+ * @returns The value for @key or 0 if @key doesn't exist or isn't an integer.
335
+ */
336
+ get_property_as_int(key: string | null): number
337
+ /**
338
+ * Look up the value for `key` on `device` and return the result of
339
+ * splitting it into non-empty tokens split at white space (only space
340
+ * (' '), form-feed ('\f'), newline ('\n'), carriage return ('\r'),
341
+ * horizontal tab ('\t'), and vertical tab ('\v') are considered; the
342
+ * locale is not taken into account).
343
+ * @param key Name of property.
344
+ * @returns The value of @key on @device split into tokens or %NULL if @key doesn't exist. This array is owned by @device and should not be freed by the caller.
345
+ */
346
+ get_property_as_strv(key: string | null): string[] | null
347
+ /**
348
+ * Look up the value for `key` on `device` and convert it to an unsigned
349
+ * 64-bit integer using g_ascii_strtoull().
350
+ * @param key Name of property.
351
+ * @returns The value for @key or 0 if @key doesn't exist or isn't a #guint64.
352
+ */
353
+ get_property_as_uint64(key: string | null): number
354
+ /**
355
+ * Gets all keys for properties on `device`.
356
+ * @returns A %NULL terminated string array of property keys. This array is owned by @device and should not be freed by the caller.
357
+ */
358
+ get_property_keys(): string[]
359
+ /**
360
+ * Gets the most recent sequence number for `device`.
361
+ * @returns A sequence number.
362
+ */
363
+ get_seqnum(): number
364
+ /**
365
+ * Gets the subsystem for `device`.
366
+ * @returns The subsystem for @device.
367
+ */
368
+ get_subsystem(): string | null
369
+ /**
370
+ * Look up the sysfs attribute with `name` on `device`. The retrieved value
371
+ * is cached in the device. Repeated calls will return the same value and
372
+ * not open the attribute again, unless updated through one of the
373
+ * "uncached" functions.
374
+ * @param name Name of the sysfs attribute.
375
+ * @returns The value of the sysfs attribute or %NULL if there is no such attribute. Do not free this string, it is owned by @device.
376
+ */
377
+ get_sysfs_attr(name: string | null): string | null
378
+ /**
379
+ * Look up the sysfs attribute with `name` on `device` and convert it to an
380
+ * boolean. This is done by doing a case-insensitive string comparison
381
+ * on the string value against "1", "true", "Y" and "y". The retrieved value is
382
+ * cached in the device. Repeated calls will return the same value and
383
+ * not open the attribute again, unless updated through one of the
384
+ * "uncached" functions.
385
+ * @param name Name of the sysfs attribute.
386
+ * @returns The value of the sysfs attribute or %FALSE if there is no such attribute.
387
+ */
388
+ get_sysfs_attr_as_boolean(name: string | null): boolean
389
+ /**
390
+ * Look up the sysfs attribute with `name` on `device` and convert it to an
391
+ * boolean. This is done by doing a case-insensitive string comparison
392
+ * on the string value against "1", "true", "Y" and "y". This function does
393
+ * blocking I/O, and updates the sysfs attributes cache.
394
+ *
395
+ * Before version 238 the uncached getters would not strip trailing newlines.
396
+ * @param name Name of the sysfs attribute.
397
+ * @returns The value of the sysfs attribute or %FALSE if there is no such attribute.
398
+ */
399
+ get_sysfs_attr_as_boolean_uncached(name: string | null): boolean
400
+ /**
401
+ * Look up the sysfs attribute with `name` on `device` and convert it to a double
402
+ * precision floating point number using g_ascii_strtod(). The retrieved value is cached
403
+ * in the device. Repeated calls will return the same value and not open the
404
+ * attribute again, unless updated through one of the "uncached" functions.
405
+ * @param name Name of the sysfs attribute.
406
+ * @returns The value of the sysfs attribute or 0.0 if there is no such attribute.
407
+ */
408
+ get_sysfs_attr_as_double(name: string | null): number
409
+ /**
410
+ * Look up the sysfs attribute with `name` on `device` and convert it to a double
411
+ * precision floating point number using g_ascii_strtod(). This function does blocking
412
+ * I/O, and updates the sysfs attributes cache.
413
+ *
414
+ * Before version 238 the uncached getters would not strip trailing newlines.
415
+ * @param name Name of the sysfs attribute.
416
+ * @returns The value of the sysfs attribute or 0.0 if there is no such attribute.
417
+ */
418
+ get_sysfs_attr_as_double_uncached(name: string | null): number
419
+ /**
420
+ * Look up the sysfs attribute with `name` on `device` and convert it to an integer
421
+ * using strtol(). The retrieved value is cached in the device. Repeated calls
422
+ * will return the same value and not open the attribute again, unless updated
423
+ * through one of the "uncached" functions.
424
+ * @param name Name of the sysfs attribute.
425
+ * @returns The value of the sysfs attribute or 0 if there is no such attribute.
426
+ */
427
+ get_sysfs_attr_as_int(name: string | null): number
428
+ /**
429
+ * Look up the sysfs attribute with `name` on `device` and convert it to an integer
430
+ * using strtol(). This function does blocking I/O, and updates the sysfs
431
+ * attributes cache.
432
+ *
433
+ * Before version 238 the uncached getters would not strip trailing newlines.
434
+ * @param name Name of the sysfs attribute.
435
+ * @returns The value of the sysfs attribute or 0 if there is no such attribute.
436
+ */
437
+ get_sysfs_attr_as_int_uncached(name: string | null): number
438
+ /**
439
+ * Look up the sysfs attribute with `name` on `device` and return the result of
440
+ * splitting it into non-empty tokens split at white space (only space (' '),
441
+ * form-feed ('\f'), newline ('\n'), carriage return ('\r'), horizontal
442
+ * tab ('\t'), and vertical tab ('\v') are considered; the locale is
443
+ * not taken into account).
444
+ *
445
+ * The retrieved value is cached in the device. Repeated calls will return
446
+ * the same value and not open the attribute again, unless updated through
447
+ * one of the "uncached" functions.
448
+ * @param name Name of the sysfs attribute.
449
+ * @returns The value of the sysfs attribute split into tokens or %NULL if there is no such attribute. This array is owned by @device and should not be freed by the caller.
450
+ */
451
+ get_sysfs_attr_as_strv(name: string | null): string[] | null
452
+ /**
453
+ * Look up the sysfs attribute with `name` on `device` and return the result of
454
+ * splitting it into non-empty tokens split at white space (only space (' '),
455
+ * form-feed ('\f'), newline ('\n'), carriage return ('\r'), horizontal
456
+ * tab ('\t'), and vertical tab ('\v') are considered; the locale is
457
+ * not taken into account).
458
+ *
459
+ * This function does blocking I/O, and updates the sysfs attributes cache.
460
+ * @param name Name of the sysfs attribute.
461
+ * @returns The value of the sysfs attribute split into tokens or %NULL if there is no such attribute. This array is owned by @device and should not be freed by the caller. Before version 238 the uncached getters would not strip trailing newlines.
462
+ */
463
+ get_sysfs_attr_as_strv_uncached(name: string | null): string[] | null
464
+ /**
465
+ * Look up the sysfs attribute with `name` on `device` and convert it to an unsigned
466
+ * 64-bit integer using g_ascii_strtoull(). The retrieved value is cached in the
467
+ * device. Repeated calls will return the same value and not open the attribute
468
+ * again, unless updated through one of the "uncached" functions.
469
+ * @param name Name of the sysfs attribute.
470
+ * @returns The value of the sysfs attribute or 0 if there is no such attribute.
471
+ */
472
+ get_sysfs_attr_as_uint64(name: string | null): number
473
+ /**
474
+ * Look up the sysfs attribute with `name` on `device` and convert it to an unsigned
475
+ * 64-bit integer using g_ascii_strtoull(). This function does blocking I/O, and
476
+ * updates the sysfs attributes cache.
477
+ *
478
+ * Before version 238 the uncached getters would not strip trailing newlines.
479
+ * @param name Name of the sysfs attribute.
480
+ * @returns The value of the sysfs attribute or 0 if there is no such attribute.
481
+ */
482
+ get_sysfs_attr_as_uint64_uncached(name: string | null): number
483
+ /**
484
+ * Gets all keys for sysfs attributes on `device`.
485
+ * @returns A %NULL terminated string array of sysfs attribute keys. This array is owned by @device and should not be freed by the caller.
486
+ */
487
+ get_sysfs_attr_keys(): string[]
488
+ /**
489
+ * Look up the sysfs attribute with `name` on `device`. This function does
490
+ * blocking I/O, and updates the sysfs attributes cache.
491
+ *
492
+ * Before version 238 the uncached getters would not strip trailing newlines.
493
+ * @param name Name of the sysfs attribute.
494
+ * @returns The value of the sysfs attribute or %NULL if there is no such attribute. Do not free this string, it is owned by @device.
495
+ */
496
+ get_sysfs_attr_uncached(name: string | null): string | null
497
+ /**
498
+ * Gets the sysfs path for `device`.
499
+ * @returns The sysfs path for @device.
500
+ */
501
+ get_sysfs_path(): string | null
502
+ /**
503
+ * Gets all tags for `device`.
504
+ * @returns A %NULL terminated string array of tags. This array is owned by @device and should not be freed by the caller.
505
+ */
506
+ get_tags(): string[]
507
+ /**
508
+ * Gets number of micro-seconds since `device` was initialized.
509
+ *
510
+ * This only works for devices with properties in the udev
511
+ * database. All other devices return 0.
512
+ * @returns Number of micro-seconds since @device was initialized or 0 if unknown.
513
+ */
514
+ get_usec_since_initialized(): number
515
+ /**
516
+ * Check if a the property with the given key exists.
517
+ * @param key Name of property.
518
+ * @returns %TRUE only if the value for @key exist.
519
+ */
520
+ has_property(key: string | null): boolean
521
+ /**
522
+ * Check if a the sysfs attribute with the given key exists. The
523
+ * retrieved value is cached in the device. Repeated calls will
524
+ * return the same result and not check for the presence of the
525
+ * attribute again, unless updated through one of the "uncached"
526
+ * functions.
527
+ * @param key Name of sysfs attribute.
528
+ * @returns %TRUE only if the value for @key exist.
529
+ */
530
+ has_sysfs_attr(key: string | null): boolean
531
+ /**
532
+ * Check if a the sysfs attribute with the given key exists. The
533
+ * retrieved value is cached in the device. Repeated calls will
534
+ * return the same result and not check for the presence of the
535
+ * attribute again, unless updated through one of the "uncached"
536
+ * functions.
537
+ * @param key Name of sysfs attribute.
538
+ * @returns %TRUE only if the value for @key exist.
539
+ */
540
+ has_sysfs_attr_uncached(key: string | null): boolean
541
+
542
+ // Class property signals of GUdev-1.0.GUdev.Device
543
+
544
+ connect(sigName: string, callback: (...args: any[]) => void): number
545
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
546
+ emit(sigName: string, ...args: any[]): void
547
+ disconnect(id: number): void
548
+ }
549
+
550
+ /**
551
+ * The #GUdevDevice class is used to get information about a specific
552
+ * device. Note that you cannot instantiate a #GUdevDevice object
553
+ * yourself. Instead you must use #GUdevClient to obtain #GUdevDevice
554
+ * objects.
555
+ *
556
+ * To get basic information about a device, use
557
+ * g_udev_device_get_subsystem(), g_udev_device_get_devtype(),
558
+ * g_udev_device_get_name(), g_udev_device_get_number(),
559
+ * g_udev_device_get_sysfs_path(), g_udev_device_get_driver(),
560
+ * g_udev_device_get_action(), g_udev_device_get_seqnum(),
561
+ * g_udev_device_get_device_type(), g_udev_device_get_device_number(),
562
+ * g_udev_device_get_device_file(),
563
+ * g_udev_device_get_device_file_symlinks().
564
+ *
565
+ * To navigate the device tree, use g_udev_device_get_parent() and
566
+ * g_udev_device_get_parent_with_subsystem().
567
+ *
568
+ * To access udev properties for the device, use
569
+ * g_udev_device_get_property_keys(),
570
+ * g_udev_device_has_property(),
571
+ * g_udev_device_get_property(),
572
+ * g_udev_device_get_property_as_int(),
573
+ * g_udev_device_get_property_as_uint64(),
574
+ * g_udev_device_get_property_as_double(),
575
+ * g_udev_device_get_property_as_boolean() and
576
+ * g_udev_device_get_property_as_strv().
577
+ *
578
+ * To access sysfs attributes for the device, use
579
+ * g_udev_device_get_sysfs_attr_keys(),
580
+ * g_udev_device_has_sysfs_attr(),
581
+ * g_udev_device_get_sysfs_attr(),
582
+ * g_udev_device_get_sysfs_attr_as_int(),
583
+ * g_udev_device_get_sysfs_attr_as_uint64(),
584
+ * g_udev_device_get_sysfs_attr_as_double(),
585
+ * g_udev_device_get_sysfs_attr_as_boolean() and
586
+ * g_udev_device_get_sysfs_attr_as_strv().
587
+ *
588
+ * Note that all getters on #GUdevDevice are non-reffing – returned
589
+ * values are owned by the object, should not be freed and are only
590
+ * valid as long as the object is alive.
591
+ *
592
+ * By design, #GUdevDevice will not react to changes for a device – it
593
+ * only contains a snapshot of information when the #GUdevDevice
594
+ * object was created. To work with changes, you typically connect to
595
+ * the #GUdevClient::uevent signal on a #GUdevClient and get a new
596
+ * #GUdevDevice whenever an event happens.
597
+ * @class
598
+ */
599
+ export class Device extends GObject.Object {
600
+
601
+ // Own properties of GUdev-1.0.GUdev.Device
602
+
603
+ static name: string
604
+ static $gtype: GObject.GType<Device>
605
+
606
+ // Constructors of GUdev-1.0.GUdev.Device
607
+
608
+ constructor(config?: Device.ConstructorProperties)
609
+ _init(config?: Device.ConstructorProperties): void
610
+ }
611
+
612
+ export module Enumerator {
613
+
614
+ // Constructor properties interface
615
+
616
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
617
+
618
+ // Own constructor properties of GUdev-1.0.GUdev.Enumerator
619
+
620
+ /**
621
+ * The #GUdevClient to enumerate devices from.
622
+ */
623
+ client?: Client | null
624
+ }
625
+
626
+ }
627
+
628
+ export interface Enumerator {
629
+
630
+ // Own properties of GUdev-1.0.GUdev.Enumerator
631
+
632
+ /**
633
+ * The #GUdevClient to enumerate devices from.
634
+ */
635
+ readonly client: Client
636
+
637
+ // Own fields of GUdev-1.0.GUdev.Enumerator
638
+
639
+ parent: GObject.Object
640
+
641
+ // Owm methods of GUdev-1.0.GUdev.Enumerator
642
+
643
+ /**
644
+ * All returned devices will be initialized.
645
+ * @returns The passed in @enumerator.
646
+ */
647
+ add_match_is_initialized(): Enumerator
648
+ /**
649
+ * All returned devices will match the given `name`.
650
+ * @param name Wildcard filter for kernel name e.g. "sda*".
651
+ * @returns The passed in @enumerator.
652
+ */
653
+ add_match_name(name: string | null): Enumerator
654
+ /**
655
+ * All returned devices will have a property matching the given `name` and `value`.
656
+ * @param name Wildcard filter for property name.
657
+ * @param value Wildcard filter for property value.
658
+ * @returns The passed in @enumerator.
659
+ */
660
+ add_match_property(name: string | null, value: string | null): Enumerator
661
+ /**
662
+ * All returned devices will match the given `subsystem`.
663
+ * @param subsystem Wildcard for subsystem name e.g. 'scsi' or 'a*'.
664
+ * @returns The passed in @enumerator.
665
+ */
666
+ add_match_subsystem(subsystem: string | null): Enumerator
667
+ /**
668
+ * All returned devices will have a sysfs attribute matching the given `name` and `value`.
669
+ * @param name Wildcard filter for sysfs attribute key.
670
+ * @param value Wildcard filter for sysfs attribute value.
671
+ * @returns The passed in @enumerator.
672
+ */
673
+ add_match_sysfs_attr(name: string | null, value: string | null): Enumerator
674
+ /**
675
+ * All returned devices will match the given `tag`.
676
+ * @param tag A udev tag e.g. "udev-acl".
677
+ * @returns The passed in @enumerator.
678
+ */
679
+ add_match_tag(tag: string | null): Enumerator
680
+ /**
681
+ * All returned devices will not match the given `subsystem`.
682
+ * @param subsystem Wildcard for subsystem name e.g. 'scsi' or 'a*'.
683
+ * @returns The passed in @enumerator.
684
+ */
685
+ add_nomatch_subsystem(subsystem: string | null): Enumerator
686
+ /**
687
+ * All returned devices will not have a sysfs attribute matching the given `name` and `value`.
688
+ * @param name Wildcard filter for sysfs attribute key.
689
+ * @param value Wildcard filter for sysfs attribute value.
690
+ * @returns The passed in @enumerator.
691
+ */
692
+ add_nomatch_sysfs_attr(name: string | null, value: string | null): Enumerator
693
+ /**
694
+ * Add a device to the list of devices, to retrieve it back sorted in dependency order.
695
+ * @param sysfs_path A sysfs path, e.g. "/sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda"
696
+ * @returns The passed in @enumerator.
697
+ */
698
+ add_sysfs_path(sysfs_path: string | null): Enumerator
699
+ /**
700
+ * Executes the query in `enumerator`.
701
+ * @returns A list of #GUdevDevice objects. The caller should free the result by using g_object_unref() on each element in the list and then g_list_free() on the list.
702
+ */
703
+ execute(): Device[]
704
+
705
+ // Class property signals of GUdev-1.0.GUdev.Enumerator
706
+
707
+ connect(sigName: "notify::client", callback: (($obj: Enumerator, pspec: GObject.ParamSpec) => void)): number
708
+ connect_after(sigName: "notify::client", callback: (($obj: Enumerator, pspec: GObject.ParamSpec) => void)): number
709
+ emit(sigName: "notify::client", ...args: any[]): void
710
+ connect(sigName: string, callback: (...args: any[]) => void): number
711
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
712
+ emit(sigName: string, ...args: any[]): void
713
+ disconnect(id: number): void
714
+ }
715
+
716
+ /**
717
+ * #GUdevEnumerator is used to lookup and sort devices.
718
+ * @class
719
+ */
720
+ export class Enumerator extends GObject.Object {
721
+
722
+ // Own properties of GUdev-1.0.GUdev.Enumerator
723
+
724
+ static name: string
725
+ static $gtype: GObject.GType<Enumerator>
726
+
727
+ // Constructors of GUdev-1.0.GUdev.Enumerator
728
+
729
+ constructor(config?: Enumerator.ConstructorProperties)
730
+ /**
731
+ * Constructs a #GUdevEnumerator object that can be used to enumerate
732
+ * and sort devices. Use the add_match_*() and add_nomatch_*() methods
733
+ * and execute the query to get a list of devices with
734
+ * g_udev_enumerator_execute().
735
+ * @constructor
736
+ * @param client A #GUdevClient to enumerate devices from.
737
+ * @returns A new #GUdevEnumerator object. Free with g_object_unref().
738
+ */
739
+ constructor(client: Client)
740
+ /**
741
+ * Constructs a #GUdevEnumerator object that can be used to enumerate
742
+ * and sort devices. Use the add_match_*() and add_nomatch_*() methods
743
+ * and execute the query to get a list of devices with
744
+ * g_udev_enumerator_execute().
745
+ * @constructor
746
+ * @param client A #GUdevClient to enumerate devices from.
747
+ * @returns A new #GUdevEnumerator object. Free with g_object_unref().
748
+ */
749
+ static new(client: Client): Enumerator
750
+ _init(config?: Enumerator.ConstructorProperties): void
751
+ }
752
+
753
+ export interface ClientClass {
754
+
755
+ // Own fields of GUdev-1.0.GUdev.ClientClass
756
+
757
+ /**
758
+ * Parent class.
759
+ * @field
760
+ */
761
+ parent_class: GObject.ObjectClass
762
+ uevent: (client: Client, action: string | null, device: Device) => void
763
+ reserved1: () => void
764
+ reserved2: () => void
765
+ reserved3: () => void
766
+ reserved4: () => void
767
+ reserved5: () => void
768
+ reserved6: () => void
769
+ reserved7: () => void
770
+ reserved8: () => void
771
+ }
772
+
773
+ /**
774
+ * Class structure for #GUdevClient.
775
+ * @record
776
+ */
777
+ export abstract class ClientClass {
778
+
779
+ // Own properties of GUdev-1.0.GUdev.ClientClass
780
+
781
+ static name: string
782
+ }
783
+
784
+ export interface ClientPrivate {
785
+ }
786
+
787
+ export class ClientPrivate {
788
+
789
+ // Own properties of GUdev-1.0.GUdev.ClientPrivate
790
+
791
+ static name: string
792
+ }
793
+
794
+ export interface DeviceClass {
795
+
796
+ // Own fields of GUdev-1.0.GUdev.DeviceClass
797
+
798
+ /**
799
+ * Parent class.
800
+ * @field
801
+ */
802
+ parent_class: GObject.ObjectClass
803
+ reserved1: () => void
804
+ reserved2: () => void
805
+ reserved3: () => void
806
+ reserved4: () => void
807
+ reserved5: () => void
808
+ reserved6: () => void
809
+ reserved7: () => void
810
+ reserved8: () => void
811
+ }
812
+
813
+ /**
814
+ * Class structure for #GUdevDevice.
815
+ * @record
816
+ */
817
+ export abstract class DeviceClass {
818
+
819
+ // Own properties of GUdev-1.0.GUdev.DeviceClass
820
+
821
+ static name: string
822
+ }
823
+
824
+ export interface DevicePrivate {
825
+ }
826
+
827
+ export class DevicePrivate {
828
+
829
+ // Own properties of GUdev-1.0.GUdev.DevicePrivate
830
+
831
+ static name: string
832
+ }
833
+
834
+ export interface EnumeratorClass {
835
+
836
+ // Own fields of GUdev-1.0.GUdev.EnumeratorClass
837
+
838
+ /**
839
+ * Parent class.
840
+ * @field
841
+ */
842
+ parent_class: GObject.ObjectClass
843
+ reserved1: () => void
844
+ reserved2: () => void
845
+ reserved3: () => void
846
+ reserved4: () => void
847
+ reserved5: () => void
848
+ reserved6: () => void
849
+ reserved7: () => void
850
+ reserved8: () => void
851
+ }
852
+
853
+ /**
854
+ * Class structure for #GUdevEnumerator.
855
+ * @record
856
+ */
857
+ export abstract class EnumeratorClass {
858
+
859
+ // Own properties of GUdev-1.0.GUdev.EnumeratorClass
860
+
861
+ static name: string
862
+ }
863
+
864
+ export interface EnumeratorPrivate {
865
+ }
866
+
867
+ export class EnumeratorPrivate {
868
+
869
+ // Own properties of GUdev-1.0.GUdev.EnumeratorPrivate
870
+
871
+ static name: string
872
+ }
873
+
874
+ export type DeviceNumber = number
875
+ /**
876
+ * Name of the imported GIR library
877
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
878
+ */
879
+ export const __name__: string
880
+ /**
881
+ * Version of the imported GIR library
882
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
883
+ */
884
+ export const __version__: string
885
+ // END