@girs/deviced-1.0 3.27.4-4.0.0-beta.21

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,1603 @@
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
+ // Module dependencies
11
+ import type Gio from '@girs/gio-2.0';
12
+ import type GObject from '@girs/gobject-2.0';
13
+ import type GLib from '@girs/glib-2.0';
14
+ import type GModule from '@girs/gmodule-2.0';
15
+
16
+ export namespace Deviced {
17
+ /**
18
+ * Deviced-1.0
19
+ */
20
+
21
+ export namespace DeviceKind {
22
+ export const $gtype: GObject.GType<DeviceKind>;
23
+ }
24
+
25
+ enum DeviceKind {
26
+ COMPUTER,
27
+ TABLET,
28
+ PHONE,
29
+ MICRO_CONTROLLER,
30
+ }
31
+ /**
32
+ * libdeviced major version component (e.g. 1 if %DEVD_VERSION is 1.2.3)
33
+ */
34
+ const MAJOR_VERSION: number;
35
+ /**
36
+ * libdeviced micro version component (e.g. 3 if %DEVD_VERSION is 1.2.3)
37
+ */
38
+ const MICRO_VERSION: number;
39
+ /**
40
+ * libdeviced minor version component (e.g. 2 if %DEVD_VERSION is 1.2.3)
41
+ */
42
+ const MINOR_VERSION: number;
43
+ const PROCESS_SERVICE_NAME: string;
44
+ const TRANSFER_SERVICE_NAME: string;
45
+ /**
46
+ * libdeviced version, encoded as a string, useful for printing and
47
+ * concatenation.
48
+ */
49
+ const VERSION_S: string;
50
+ namespace AppInfo {
51
+ // Constructor properties interface
52
+
53
+ interface ConstructorProps extends GObject.Object.ConstructorProps {
54
+ commit_id: string;
55
+ commitId: string;
56
+ id: string;
57
+ installed_size: number;
58
+ installedSize: number;
59
+ name: string;
60
+ provider: string;
61
+ }
62
+ }
63
+
64
+ class AppInfo extends GObject.Object {
65
+ static $gtype: GObject.GType<AppInfo>;
66
+
67
+ // Properties
68
+
69
+ get commit_id(): string;
70
+ set commit_id(val: string);
71
+ get commitId(): string;
72
+ set commitId(val: string);
73
+ get id(): string;
74
+ set id(val: string);
75
+ get installed_size(): number;
76
+ set installed_size(val: number);
77
+ get installedSize(): number;
78
+ set installedSize(val: number);
79
+ get name(): string;
80
+ set name(val: string);
81
+ get provider(): string;
82
+ set provider(val: string);
83
+
84
+ // Constructors
85
+
86
+ constructor(properties?: Partial<AppInfo.ConstructorProps>, ...args: any[]);
87
+
88
+ _init(...args: any[]): void;
89
+ }
90
+
91
+ namespace Browser {
92
+ // Signal callback interfaces
93
+
94
+ interface DeviceAdded {
95
+ (device: Device): void;
96
+ }
97
+
98
+ interface DeviceRemoved {
99
+ (device: Device): void;
100
+ }
101
+
102
+ // Constructor properties interface
103
+
104
+ interface ConstructorProps extends GObject.Object.ConstructorProps {
105
+ certificate: Gio.TlsCertificate;
106
+ enable_ipv4: boolean;
107
+ enableIpv4: boolean;
108
+ enable_ipv6: boolean;
109
+ enableIpv6: boolean;
110
+ }
111
+ }
112
+
113
+ class Browser extends GObject.Object {
114
+ static $gtype: GObject.GType<Browser>;
115
+
116
+ // Properties
117
+
118
+ /**
119
+ * The tls certificate to use when communicating with peers.
120
+ */
121
+ get certificate(): Gio.TlsCertificate;
122
+ set certificate(val: Gio.TlsCertificate);
123
+ get enable_ipv4(): boolean;
124
+ set enable_ipv4(val: boolean);
125
+ get enableIpv4(): boolean;
126
+ set enableIpv4(val: boolean);
127
+ get enable_ipv6(): boolean;
128
+ set enable_ipv6(val: boolean);
129
+ get enableIpv6(): boolean;
130
+ set enableIpv6(val: boolean);
131
+
132
+ // Constructors
133
+
134
+ constructor(properties?: Partial<Browser.ConstructorProps>, ...args: any[]);
135
+
136
+ _init(...args: any[]): void;
137
+
138
+ static ['new'](): Browser;
139
+
140
+ // Signals
141
+
142
+ connect(id: string, callback: (...args: any[]) => any): number;
143
+ connect_after(id: string, callback: (...args: any[]) => any): number;
144
+ emit(id: string, ...args: any[]): void;
145
+ connect(signal: 'device-added', callback: (_source: this, device: Device) => void): number;
146
+ connect_after(signal: 'device-added', callback: (_source: this, device: Device) => void): number;
147
+ emit(signal: 'device-added', device: Device): void;
148
+ connect(signal: 'device-removed', callback: (_source: this, device: Device) => void): number;
149
+ connect_after(signal: 'device-removed', callback: (_source: this, device: Device) => void): number;
150
+ emit(signal: 'device-removed', device: Device): void;
151
+
152
+ // Virtual methods
153
+
154
+ vfunc_device_added(device: Device): void;
155
+ vfunc_device_removed(device: Device): void;
156
+
157
+ // Methods
158
+
159
+ /**
160
+ * Gets the #DevdBrowser:certificate property. This is used as the
161
+ * client TLS certificate when connecting to peers.
162
+ *
163
+ * If unset, a certificate will be reloaded or generated when
164
+ * devd_browser_load_async() is called.
165
+ * @returns a #GTlsCertificate or %NULL
166
+ */
167
+ get_certificate(): Gio.TlsCertificate | null;
168
+ /**
169
+ * Gets a SHA256 hash for the #DevdBrowser:certificate property.
170
+ * @returns the hash or %NULL
171
+ */
172
+ get_certificate_hash(): string | null;
173
+ /**
174
+ * Gets a #GPtrArray of #DevdDevice that have been discovered.
175
+ * @returns a #GPtrArray of #DevdDevice.
176
+ */
177
+ get_devices(): Device[];
178
+ get_enable_ipv4(): boolean;
179
+ get_enable_ipv6(): boolean;
180
+ /**
181
+ * Asynchronously loads data needed by the browser and then scans the
182
+ * local network segments for Deviced nodes. The #DevdBrowser::device-added
183
+ * and #DevdBrowser::device-removed signals will be emitted in reaction to
184
+ * network changes.
185
+ *
186
+ * Call devd_browser_load_finish() to get the result of this operation.
187
+ *
188
+ * If you want to control the #GTlsCertificate to use, then call
189
+ * devd_browser_set_certificate() before calling this function.
190
+ * @param cancellable a #GCancellable, or %NULL
191
+ */
192
+ load_async(cancellable?: Gio.Cancellable | null): Promise<boolean>;
193
+ /**
194
+ * Asynchronously loads data needed by the browser and then scans the
195
+ * local network segments for Deviced nodes. The #DevdBrowser::device-added
196
+ * and #DevdBrowser::device-removed signals will be emitted in reaction to
197
+ * network changes.
198
+ *
199
+ * Call devd_browser_load_finish() to get the result of this operation.
200
+ *
201
+ * If you want to control the #GTlsCertificate to use, then call
202
+ * devd_browser_set_certificate() before calling this function.
203
+ * @param cancellable a #GCancellable, or %NULL
204
+ * @param callback a #GAsyncReadyCallback to execute upon completion of the asynchronous task.
205
+ */
206
+ load_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
207
+ /**
208
+ * Asynchronously loads data needed by the browser and then scans the
209
+ * local network segments for Deviced nodes. The #DevdBrowser::device-added
210
+ * and #DevdBrowser::device-removed signals will be emitted in reaction to
211
+ * network changes.
212
+ *
213
+ * Call devd_browser_load_finish() to get the result of this operation.
214
+ *
215
+ * If you want to control the #GTlsCertificate to use, then call
216
+ * devd_browser_set_certificate() before calling this function.
217
+ * @param cancellable a #GCancellable, or %NULL
218
+ * @param callback a #GAsyncReadyCallback to execute upon completion of the asynchronous task.
219
+ */
220
+ load_async(
221
+ cancellable?: Gio.Cancellable | null,
222
+ callback?: Gio.AsyncReadyCallback<this> | null,
223
+ ): Promise<boolean> | void;
224
+ /**
225
+ * Completes an asynchronous load of the browser. This includes loading the
226
+ * TLS certificate (or generating one) and then scanning the local network
227
+ * segments for mDNS (Avahi) peers advertising Deviced nodes.
228
+ * @param result a #GAsyncResult
229
+ * @returns %TRUE if successful; otherwise %FALSE and @error is set.
230
+ */
231
+ load_finish(result: Gio.AsyncResult): boolean;
232
+ /**
233
+ * Sets the #GTlsCertificate to use for client communication.
234
+ *
235
+ * To ensure this is being used on all new connnections, you should set this
236
+ * property before calling devd_browser_load_async().
237
+ * @param certificate a #GTlsCertificate
238
+ */
239
+ set_certificate(certificate: Gio.TlsCertificate): void;
240
+ set_enable_ipv4(enable_ipv4: boolean): void;
241
+ set_enable_ipv6(enable_ipv6: boolean): void;
242
+ }
243
+
244
+ namespace Client {
245
+ // Signal callback interfaces
246
+
247
+ interface Notification {
248
+ (method: string, params: GLib.Variant): void;
249
+ }
250
+
251
+ interface ServiceAdded {
252
+ (service: string): void;
253
+ }
254
+
255
+ // Constructor properties interface
256
+
257
+ interface ConstructorProps extends GObject.Object.ConstructorProps {
258
+ arch: string;
259
+ kernel: string;
260
+ name: string;
261
+ system: string;
262
+ timeout: number;
263
+ triplet: string;
264
+ }
265
+ }
266
+
267
+ abstract class Client extends GObject.Object {
268
+ static $gtype: GObject.GType<Client>;
269
+
270
+ // Properties
271
+
272
+ get arch(): string;
273
+ get kernel(): string;
274
+ get name(): string;
275
+ get system(): string;
276
+ get timeout(): number;
277
+ set timeout(val: number);
278
+ get triplet(): string;
279
+
280
+ // Constructors
281
+
282
+ constructor(properties?: Partial<Client.ConstructorProps>, ...args: any[]);
283
+
284
+ _init(...args: any[]): void;
285
+
286
+ // Signals
287
+
288
+ connect(id: string, callback: (...args: any[]) => any): number;
289
+ connect_after(id: string, callback: (...args: any[]) => any): number;
290
+ emit(id: string, ...args: any[]): void;
291
+ connect(
292
+ signal: 'notification',
293
+ callback: (_source: this, method: string, params: GLib.Variant) => void,
294
+ ): number;
295
+ connect_after(
296
+ signal: 'notification',
297
+ callback: (_source: this, method: string, params: GLib.Variant) => void,
298
+ ): number;
299
+ emit(signal: 'notification', method: string, params: GLib.Variant): void;
300
+ connect(signal: 'service-added', callback: (_source: this, service: string) => void): number;
301
+ connect_after(signal: 'service-added', callback: (_source: this, service: string) => void): number;
302
+ emit(signal: 'service-added', service: string): void;
303
+
304
+ // Virtual methods
305
+
306
+ /**
307
+ * Asynchronously calls an RPC on the device, if available.
308
+ *
309
+ * Not all #DevdClient implementations are guaranteed to support this
310
+ * interface, and therefore may fail.
311
+ * @param method the RPC method name
312
+ * @param params the parameters for the method
313
+ * @param cancellable a #GCancellable or %NULL
314
+ * @param callback a callback to execute upon completion
315
+ */
316
+ vfunc_call_async(
317
+ method: string,
318
+ params?: GLib.Variant | null,
319
+ cancellable?: Gio.Cancellable | null,
320
+ callback?: Gio.AsyncReadyCallback<this> | null,
321
+ ): void;
322
+ /**
323
+ * Gets the result of the RPC call.
324
+ * @param result a #GAsyncResult provided to callback
325
+ */
326
+ vfunc_call_finish(result: Gio.AsyncResult): [boolean, GLib.Variant | null];
327
+ /**
328
+ * Asynchronously connects to the device for which the client was created.
329
+ *
330
+ * `callback` should complete the operation by calling devd_client_connect_finish().
331
+ * @param cancellable a #GCancellable or %NULL
332
+ * @param callback a #GAsyncReadyCallback, or %NULL
333
+ */
334
+ vfunc_connect_async(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): void;
335
+ /**
336
+ * Completes an asynchronous connection to the device, initiated with
337
+ * devd_client_connect_async().
338
+ * @param result a #GAsyncResult provided to callback
339
+ */
340
+ vfunc_connect_finish(result: Gio.AsyncResult): boolean;
341
+ vfunc_disconnect_async(
342
+ cancellable?: Gio.Cancellable | null,
343
+ callback?: Gio.AsyncReadyCallback<this> | null,
344
+ ): void;
345
+ vfunc_disconnect_finish(result: Gio.AsyncResult): boolean;
346
+ /**
347
+ * Gets the architecture of the device, such as "x86_64". Generally,
348
+ * this is the machine value from uname().
349
+ */
350
+ vfunc_get_arch(): string;
351
+ /**
352
+ * Gets the kernel of the device, such as "linux". This is the kernel
353
+ * component of the familiar "target triplet".
354
+ */
355
+ vfunc_get_kernel(): string;
356
+ /**
357
+ * Gets the name of the peer that this client is connected to.
358
+ *
359
+ * This value is discovered when initializing a connection with the peer.
360
+ */
361
+ vfunc_get_name(): string | null;
362
+ /**
363
+ * Gets the system of the device, such as "gnu". This is the system
364
+ * component of the familiar "target triplet".
365
+ */
366
+ vfunc_get_system(): string;
367
+ /**
368
+ * Gets the #DevdTriplet object holding information about the architecture triplet
369
+ */
370
+ vfunc_get_triplet(): Triplet;
371
+ /**
372
+ * Asynchronously requests a list of applications that are available to
373
+ * the peer that the #DevdClient is connected to.
374
+ *
375
+ * To complete the asynchronous request, `callback` must call
376
+ * devd_client_list_apps_finish() to obtain the result.
377
+ * @param cancellable a #GCancellable or %NULL
378
+ * @param callback a #GAsyncReadyCallback
379
+ */
380
+ vfunc_list_apps_async(
381
+ cancellable?: Gio.Cancellable | null,
382
+ callback?: Gio.AsyncReadyCallback<this> | null,
383
+ ): void;
384
+ /**
385
+ * Completes an asynchronous request to devd_client_list_apps_async().
386
+ * @param result a #GAsyncResult provided to callback
387
+ */
388
+ vfunc_list_apps_finish(result: Gio.AsyncResult): AppInfo[];
389
+ /**
390
+ * Lists the files in a given path on the device.
391
+ *
392
+ * Use `attributes` to specify the file attributes to retrieve. These
393
+ * follow the same convention as g_file_enumerate_children().
394
+ * @param path the path on the device
395
+ * @param attributes file attributes
396
+ * @param cancellable a #GCancellable, or %NULL
397
+ * @param callback a callback to execute up on completion
398
+ */
399
+ vfunc_list_files_async(
400
+ path: string,
401
+ attributes: string,
402
+ cancellable?: Gio.Cancellable | null,
403
+ callback?: Gio.AsyncReadyCallback<this> | null,
404
+ ): void;
405
+ /**
406
+ * Completes an asynchronous request to list files on the device.
407
+ * @param result a #GAsyncResult provided to callback
408
+ */
409
+ vfunc_list_files_finish(result: Gio.AsyncResult): Gio.FileInfo[];
410
+ /**
411
+ * Asynchronously requests a list of runtimes that are available to
412
+ * the peer that the #DevdClient is connected to.
413
+ *
414
+ * To complete the asynchronous request, `callback` must call
415
+ * devd_client_list_runtimes_finish() to obtain the result.
416
+ * @param cancellable a #GCancellable or %NULL
417
+ * @param callback a #GAsyncReadyCallback
418
+ */
419
+ vfunc_list_runtimes_async(
420
+ cancellable?: Gio.Cancellable | null,
421
+ callback?: Gio.AsyncReadyCallback<this> | null,
422
+ ): void;
423
+ /**
424
+ * Completes an asynchronous request to devd_client_list_runtimes_async().
425
+ * @param result a #GAsyncResult provided to callback
426
+ */
427
+ vfunc_list_runtimes_finish(result: Gio.AsyncResult): AppInfo[];
428
+ vfunc_notification(method: string, params: GLib.Variant): void;
429
+ /**
430
+ * Asynchronously runs an application on the connected #DevdClient.
431
+ *
432
+ * To complete the asynchronous request, `callback` must call
433
+ * devd_client_run_app_finish() to obtain the result.
434
+ * @param provider the app provider
435
+ * @param app_id the ID of the app to run
436
+ * @param pty a pty ID
437
+ * @param cancellable a #GCancellable or %NULL
438
+ * @param callback a #GAsyncReadyCallback
439
+ */
440
+ vfunc_run_app_async(
441
+ provider: string,
442
+ app_id: string,
443
+ pty?: string | null,
444
+ cancellable?: Gio.Cancellable | null,
445
+ callback?: Gio.AsyncReadyCallback<this> | null,
446
+ ): void;
447
+ /**
448
+ * Completes an asynchronous request to devd_client_run_app_async().
449
+ * @param result a #GAsyncResult provided to callback
450
+ */
451
+ vfunc_run_app_finish(result: Gio.AsyncResult): string;
452
+ vfunc_service_added(service: string): void;
453
+ /**
454
+ * Requests that the device sync changes to the file-system to the underlying
455
+ * storage devices specified, or all devices if `devices` is %NULL.
456
+ *
457
+ * Note, currently, only syncing all file-systems is supported.
458
+ * @param devices a comma-separated list of devices, or %NULL
459
+ * @param cancellable a #GCancellable, or %NULL
460
+ * @param callback a callback to execute upon completion
461
+ */
462
+ vfunc_syncfs_async(
463
+ devices?: string | null,
464
+ cancellable?: Gio.Cancellable | null,
465
+ callback?: Gio.AsyncReadyCallback<this> | null,
466
+ ): void;
467
+ /**
468
+ * Completes an asynchronous request to sync file-system changes to
469
+ * their underlying storage devices.
470
+ * @param result a #GAsyncResult provided to callback
471
+ */
472
+ vfunc_syncfs_finish(result: Gio.AsyncResult): boolean;
473
+
474
+ // Methods
475
+
476
+ /**
477
+ * Asynchronously calls an RPC on the device, if available.
478
+ *
479
+ * Not all #DevdClient implementations are guaranteed to support this
480
+ * interface, and therefore may fail.
481
+ * @param method the RPC method name
482
+ * @param params the parameters for the method
483
+ * @param cancellable a #GCancellable or %NULL
484
+ */
485
+ call_async(
486
+ method: string,
487
+ params?: GLib.Variant | null,
488
+ cancellable?: Gio.Cancellable | null,
489
+ ): Promise<GLib.Variant | null>;
490
+ /**
491
+ * Asynchronously calls an RPC on the device, if available.
492
+ *
493
+ * Not all #DevdClient implementations are guaranteed to support this
494
+ * interface, and therefore may fail.
495
+ * @param method the RPC method name
496
+ * @param params the parameters for the method
497
+ * @param cancellable a #GCancellable or %NULL
498
+ * @param callback a callback to execute upon completion
499
+ */
500
+ call_async(
501
+ method: string,
502
+ params: GLib.Variant | null,
503
+ cancellable: Gio.Cancellable | null,
504
+ callback: Gio.AsyncReadyCallback<this> | null,
505
+ ): void;
506
+ /**
507
+ * Asynchronously calls an RPC on the device, if available.
508
+ *
509
+ * Not all #DevdClient implementations are guaranteed to support this
510
+ * interface, and therefore may fail.
511
+ * @param method the RPC method name
512
+ * @param params the parameters for the method
513
+ * @param cancellable a #GCancellable or %NULL
514
+ * @param callback a callback to execute upon completion
515
+ */
516
+ call_async(
517
+ method: string,
518
+ params?: GLib.Variant | null,
519
+ cancellable?: Gio.Cancellable | null,
520
+ callback?: Gio.AsyncReadyCallback<this> | null,
521
+ ): Promise<GLib.Variant | null> | void;
522
+ /**
523
+ * Gets the result of the RPC call.
524
+ * @param result a #GAsyncResult provided to callback
525
+ * @returns %TRUE if successful; otherwise %FALSE and @error is set. @reply is set to the reply from the peer, of provided.
526
+ */
527
+ call_finish(result: Gio.AsyncResult): [boolean, GLib.Variant | null];
528
+ /**
529
+ * Asynchronously connects to the device for which the client was created.
530
+ *
531
+ * `callback` should complete the operation by calling devd_client_connect_finish().
532
+ * @param cancellable a #GCancellable or %NULL
533
+ */
534
+ connect_async(cancellable?: Gio.Cancellable | null): Promise<boolean>;
535
+ /**
536
+ * Asynchronously connects to the device for which the client was created.
537
+ *
538
+ * `callback` should complete the operation by calling devd_client_connect_finish().
539
+ * @param cancellable a #GCancellable or %NULL
540
+ * @param callback a #GAsyncReadyCallback, or %NULL
541
+ */
542
+ connect_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
543
+ /**
544
+ * Asynchronously connects to the device for which the client was created.
545
+ *
546
+ * `callback` should complete the operation by calling devd_client_connect_finish().
547
+ * @param cancellable a #GCancellable or %NULL
548
+ * @param callback a #GAsyncReadyCallback, or %NULL
549
+ */
550
+ connect_async(
551
+ cancellable?: Gio.Cancellable | null,
552
+ callback?: Gio.AsyncReadyCallback<this> | null,
553
+ ): Promise<boolean> | void;
554
+ /**
555
+ * Completes an asynchronous connection to the device, initiated with
556
+ * devd_client_connect_async().
557
+ * @param result a #GAsyncResult provided to callback
558
+ * @returns %TRUE if successful; otherwise %FALSE and @error is set.
559
+ */
560
+ connect_finish(result: Gio.AsyncResult): boolean;
561
+ disconnect_async(cancellable?: Gio.Cancellable | null): Promise<boolean>;
562
+ disconnect_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
563
+ disconnect_async(
564
+ cancellable?: Gio.Cancellable | null,
565
+ callback?: Gio.AsyncReadyCallback<this> | null,
566
+ ): Promise<boolean> | void;
567
+ disconnect_finish(result: Gio.AsyncResult): boolean;
568
+ emit_notification(method: string, params: GLib.Variant): void;
569
+ emit_service_added(service: string): void;
570
+ /**
571
+ * Gets the architecture of the device, such as "x86_64". Generally,
572
+ * this is the machine value from uname().
573
+ * @returns a string representing the architecture.
574
+ */
575
+ get_arch(): string;
576
+ /**
577
+ * Gets the kernel of the device, such as "linux". This is the kernel
578
+ * component of the familiar "target triplet".
579
+ * @returns a string representing the kernel.
580
+ */
581
+ get_kernel(): string;
582
+ /**
583
+ * Gets the name of the peer that this client is connected to.
584
+ *
585
+ * This value is discovered when initializing a connection with the peer.
586
+ * @returns a newly allocated string or %NULL
587
+ */
588
+ get_name(): string | null;
589
+ /**
590
+ * Gets the names of services currently supported by the client.
591
+ * @returns a #GStrv of service names
592
+ */
593
+ get_services(): string[];
594
+ /**
595
+ * Gets the system of the device, such as "gnu". This is the system
596
+ * component of the familiar "target triplet".
597
+ * @returns a string representing the system.
598
+ */
599
+ get_system(): string;
600
+ get_timeout(): number;
601
+ /**
602
+ * Gets the #DevdTriplet object holding information about the architecture triplet
603
+ * @returns a #DevdTriplet representing the architecture triplet.
604
+ */
605
+ get_triplet(): Triplet;
606
+ has_service(name: string): boolean;
607
+ /**
608
+ * Asynchronously requests a list of applications that are available to
609
+ * the peer that the #DevdClient is connected to.
610
+ *
611
+ * To complete the asynchronous request, `callback` must call
612
+ * devd_client_list_apps_finish() to obtain the result.
613
+ * @param cancellable a #GCancellable or %NULL
614
+ */
615
+ list_apps_async(cancellable?: Gio.Cancellable | null): Promise<AppInfo[]>;
616
+ /**
617
+ * Asynchronously requests a list of applications that are available to
618
+ * the peer that the #DevdClient is connected to.
619
+ *
620
+ * To complete the asynchronous request, `callback` must call
621
+ * devd_client_list_apps_finish() to obtain the result.
622
+ * @param cancellable a #GCancellable or %NULL
623
+ * @param callback a #GAsyncReadyCallback
624
+ */
625
+ list_apps_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
626
+ /**
627
+ * Asynchronously requests a list of applications that are available to
628
+ * the peer that the #DevdClient is connected to.
629
+ *
630
+ * To complete the asynchronous request, `callback` must call
631
+ * devd_client_list_apps_finish() to obtain the result.
632
+ * @param cancellable a #GCancellable or %NULL
633
+ * @param callback a #GAsyncReadyCallback
634
+ */
635
+ list_apps_async(
636
+ cancellable?: Gio.Cancellable | null,
637
+ callback?: Gio.AsyncReadyCallback<this> | null,
638
+ ): Promise<AppInfo[]> | void;
639
+ /**
640
+ * Completes an asynchronous request to devd_client_list_apps_async().
641
+ * @param result a #GAsyncResult provided to callback
642
+ * @returns An array of #DevdClientAppInfo if successful; otherwise %NULL and @error is set.
643
+ */
644
+ list_apps_finish(result: Gio.AsyncResult): AppInfo[];
645
+ /**
646
+ * Lists the files in a given path on the device.
647
+ *
648
+ * Use `attributes` to specify the file attributes to retrieve. These
649
+ * follow the same convention as g_file_enumerate_children().
650
+ * @param path the path on the device
651
+ * @param attributes file attributes
652
+ * @param cancellable a #GCancellable, or %NULL
653
+ */
654
+ list_files_async(
655
+ path: string,
656
+ attributes: string,
657
+ cancellable?: Gio.Cancellable | null,
658
+ ): Promise<Gio.FileInfo[]>;
659
+ /**
660
+ * Lists the files in a given path on the device.
661
+ *
662
+ * Use `attributes` to specify the file attributes to retrieve. These
663
+ * follow the same convention as g_file_enumerate_children().
664
+ * @param path the path on the device
665
+ * @param attributes file attributes
666
+ * @param cancellable a #GCancellable, or %NULL
667
+ * @param callback a callback to execute up on completion
668
+ */
669
+ list_files_async(
670
+ path: string,
671
+ attributes: string,
672
+ cancellable: Gio.Cancellable | null,
673
+ callback: Gio.AsyncReadyCallback<this> | null,
674
+ ): void;
675
+ /**
676
+ * Lists the files in a given path on the device.
677
+ *
678
+ * Use `attributes` to specify the file attributes to retrieve. These
679
+ * follow the same convention as g_file_enumerate_children().
680
+ * @param path the path on the device
681
+ * @param attributes file attributes
682
+ * @param cancellable a #GCancellable, or %NULL
683
+ * @param callback a callback to execute up on completion
684
+ */
685
+ list_files_async(
686
+ path: string,
687
+ attributes: string,
688
+ cancellable?: Gio.Cancellable | null,
689
+ callback?: Gio.AsyncReadyCallback<this> | null,
690
+ ): Promise<Gio.FileInfo[]> | void;
691
+ /**
692
+ * Completes an asynchronous request to list files on the device.
693
+ * @param result a #GAsyncResult provided to callback
694
+ * @returns a #GPtrArray of #GFileInfo retrieved from the device.
695
+ */
696
+ list_files_finish(result: Gio.AsyncResult): Gio.FileInfo[];
697
+ /**
698
+ * Asynchronously requests a list of runtimes that are available to
699
+ * the peer that the #DevdClient is connected to.
700
+ *
701
+ * To complete the asynchronous request, `callback` must call
702
+ * devd_client_list_runtimes_finish() to obtain the result.
703
+ * @param cancellable a #GCancellable or %NULL
704
+ */
705
+ list_runtimes_async(cancellable?: Gio.Cancellable | null): Promise<AppInfo[]>;
706
+ /**
707
+ * Asynchronously requests a list of runtimes that are available to
708
+ * the peer that the #DevdClient is connected to.
709
+ *
710
+ * To complete the asynchronous request, `callback` must call
711
+ * devd_client_list_runtimes_finish() to obtain the result.
712
+ * @param cancellable a #GCancellable or %NULL
713
+ * @param callback a #GAsyncReadyCallback
714
+ */
715
+ list_runtimes_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
716
+ /**
717
+ * Asynchronously requests a list of runtimes that are available to
718
+ * the peer that the #DevdClient is connected to.
719
+ *
720
+ * To complete the asynchronous request, `callback` must call
721
+ * devd_client_list_runtimes_finish() to obtain the result.
722
+ * @param cancellable a #GCancellable or %NULL
723
+ * @param callback a #GAsyncReadyCallback
724
+ */
725
+ list_runtimes_async(
726
+ cancellable?: Gio.Cancellable | null,
727
+ callback?: Gio.AsyncReadyCallback<this> | null,
728
+ ): Promise<AppInfo[]> | void;
729
+ /**
730
+ * Completes an asynchronous request to devd_client_list_runtimes_async().
731
+ * @param result a #GAsyncResult provided to callback
732
+ * @returns An array of #DevdClientAppInfo if successful; otherwise %NULL and @error is set.
733
+ */
734
+ list_runtimes_finish(result: Gio.AsyncResult): AppInfo[];
735
+ /**
736
+ * Asynchronously runs an application on the connected #DevdClient.
737
+ *
738
+ * To complete the asynchronous request, `callback` must call
739
+ * devd_client_run_app_finish() to obtain the result.
740
+ * @param provider the app provider
741
+ * @param app_id the ID of the app to run
742
+ * @param pty a pty ID
743
+ * @param cancellable a #GCancellable or %NULL
744
+ */
745
+ run_app_async(
746
+ provider: string,
747
+ app_id: string,
748
+ pty?: string | null,
749
+ cancellable?: Gio.Cancellable | null,
750
+ ): Promise<string>;
751
+ /**
752
+ * Asynchronously runs an application on the connected #DevdClient.
753
+ *
754
+ * To complete the asynchronous request, `callback` must call
755
+ * devd_client_run_app_finish() to obtain the result.
756
+ * @param provider the app provider
757
+ * @param app_id the ID of the app to run
758
+ * @param pty a pty ID
759
+ * @param cancellable a #GCancellable or %NULL
760
+ * @param callback a #GAsyncReadyCallback
761
+ */
762
+ run_app_async(
763
+ provider: string,
764
+ app_id: string,
765
+ pty: string | null,
766
+ cancellable: Gio.Cancellable | null,
767
+ callback: Gio.AsyncReadyCallback<this> | null,
768
+ ): void;
769
+ /**
770
+ * Asynchronously runs an application on the connected #DevdClient.
771
+ *
772
+ * To complete the asynchronous request, `callback` must call
773
+ * devd_client_run_app_finish() to obtain the result.
774
+ * @param provider the app provider
775
+ * @param app_id the ID of the app to run
776
+ * @param pty a pty ID
777
+ * @param cancellable a #GCancellable or %NULL
778
+ * @param callback a #GAsyncReadyCallback
779
+ */
780
+ run_app_async(
781
+ provider: string,
782
+ app_id: string,
783
+ pty?: string | null,
784
+ cancellable?: Gio.Cancellable | null,
785
+ callback?: Gio.AsyncReadyCallback<this> | null,
786
+ ): Promise<string> | void;
787
+ /**
788
+ * Completes an asynchronous request to devd_client_run_app_async().
789
+ * @param result a #GAsyncResult provided to callback
790
+ * @returns the identifier for the process, or %NULL and @error is set.
791
+ */
792
+ run_app_finish(result: Gio.AsyncResult): string;
793
+ set_timeout(timeout: number): void;
794
+ /**
795
+ * Requests that the device sync changes to the file-system to the underlying
796
+ * storage devices specified, or all devices if `devices` is %NULL.
797
+ *
798
+ * Note, currently, only syncing all file-systems is supported.
799
+ * @param devices a comma-separated list of devices, or %NULL
800
+ * @param cancellable a #GCancellable, or %NULL
801
+ */
802
+ syncfs_async(devices?: string | null, cancellable?: Gio.Cancellable | null): Promise<boolean>;
803
+ /**
804
+ * Requests that the device sync changes to the file-system to the underlying
805
+ * storage devices specified, or all devices if `devices` is %NULL.
806
+ *
807
+ * Note, currently, only syncing all file-systems is supported.
808
+ * @param devices a comma-separated list of devices, or %NULL
809
+ * @param cancellable a #GCancellable, or %NULL
810
+ * @param callback a callback to execute upon completion
811
+ */
812
+ syncfs_async(
813
+ devices: string | null,
814
+ cancellable: Gio.Cancellable | null,
815
+ callback: Gio.AsyncReadyCallback<this> | null,
816
+ ): void;
817
+ /**
818
+ * Requests that the device sync changes to the file-system to the underlying
819
+ * storage devices specified, or all devices if `devices` is %NULL.
820
+ *
821
+ * Note, currently, only syncing all file-systems is supported.
822
+ * @param devices a comma-separated list of devices, or %NULL
823
+ * @param cancellable a #GCancellable, or %NULL
824
+ * @param callback a callback to execute upon completion
825
+ */
826
+ syncfs_async(
827
+ devices?: string | null,
828
+ cancellable?: Gio.Cancellable | null,
829
+ callback?: Gio.AsyncReadyCallback<this> | null,
830
+ ): Promise<boolean> | void;
831
+ /**
832
+ * Completes an asynchronous request to sync file-system changes to
833
+ * their underlying storage devices.
834
+ * @param result a #GAsyncResult provided to callback
835
+ * @returns %TRUE if successful; otherwise %FALSE and @error is set.
836
+ */
837
+ syncfs_finish(result: Gio.AsyncResult): boolean;
838
+ }
839
+
840
+ namespace Device {
841
+ // Constructor properties interface
842
+
843
+ interface ConstructorProps extends GObject.Object.ConstructorProps {
844
+ icon_name: string;
845
+ iconName: string;
846
+ id: string;
847
+ kind: DeviceKind;
848
+ machine_id: string;
849
+ machineId: string;
850
+ name: string;
851
+ }
852
+ }
853
+
854
+ abstract class Device extends GObject.Object {
855
+ static $gtype: GObject.GType<Device>;
856
+
857
+ // Properties
858
+
859
+ get icon_name(): string;
860
+ set icon_name(val: string);
861
+ get iconName(): string;
862
+ set iconName(val: string);
863
+ get id(): string;
864
+ get kind(): DeviceKind;
865
+ set kind(val: DeviceKind);
866
+ get machine_id(): string;
867
+ set machine_id(val: string);
868
+ get machineId(): string;
869
+ set machineId(val: string);
870
+ get name(): string;
871
+ set name(val: string);
872
+
873
+ // Constructors
874
+
875
+ constructor(properties?: Partial<Device.ConstructorProps>, ...args: any[]);
876
+
877
+ _init(...args: any[]): void;
878
+
879
+ // Virtual methods
880
+
881
+ /**
882
+ * Creates a new #DevdClient that can be used to connect to the device
883
+ * in question.
884
+ *
885
+ * Not all devices are guaranteed to support multiple connections. For
886
+ * example, a USB device connection over serial may require exclusive
887
+ * access to the serial port and therefore, fail to connect if you try
888
+ * to use multiple client simultaneously.
889
+ *
890
+ * See devd_client_connect_async() to establish a connection.
891
+ */
892
+ vfunc_create_client(): Client;
893
+
894
+ // Methods
895
+
896
+ /**
897
+ * Creates a new #DevdClient that can be used to connect to the device
898
+ * in question.
899
+ *
900
+ * Not all devices are guaranteed to support multiple connections. For
901
+ * example, a USB device connection over serial may require exclusive
902
+ * access to the serial port and therefore, fail to connect if you try
903
+ * to use multiple client simultaneously.
904
+ *
905
+ * See devd_client_connect_async() to establish a connection.
906
+ * @returns a newly created #DevdClient
907
+ */
908
+ create_client(): Client;
909
+ /**
910
+ * Gets the #DevdDevice:icon-name property.
911
+ * @returns the icon-name, or %NULL
912
+ */
913
+ get_icon_name(): string | null;
914
+ /**
915
+ * Gets the identifier for the device.
916
+ * @returns a string identifying the device
917
+ */
918
+ get_id(): string;
919
+ get_kind(): DeviceKind;
920
+ /**
921
+ * Gets the machine-id property, if specified
922
+ * @returns a machine-id, or %NULL
923
+ */
924
+ get_machine_id(): string | null;
925
+ /**
926
+ * Gets the "name" property of the device, if there is one.
927
+ * @returns the device name
928
+ */
929
+ get_name(): string;
930
+ /**
931
+ * This set the icon-name for the local #DevdDevice instance. It does not
932
+ * change the icon on the remove device. To interact with the remove device
933
+ * use devd_device_create_client().
934
+ * @param icon_name the icon name for the device
935
+ */
936
+ set_icon_name(icon_name: string): void;
937
+ set_kind(kind: DeviceKind | null): void;
938
+ /**
939
+ * Sets the #DevdDevice:machine-id for the local object instance.
940
+ * @param machine_id the identifier of the machine, if known
941
+ */
942
+ set_machine_id(machine_id: string): void;
943
+ /**
944
+ * Sets the name of the device.
945
+ *
946
+ * This only changes the local representation of the device name. It does
947
+ * not change the name on the remove device. To interact with the remote
948
+ * device, use devd_device_create_client() to create a #DevdClient.
949
+ * @param name the name for the device
950
+ */
951
+ set_name(name: string): void;
952
+ }
953
+
954
+ namespace FlatpakService {
955
+ // Constructor properties interface
956
+
957
+ interface ConstructorProps extends Service.ConstructorProps {}
958
+ }
959
+
960
+ class FlatpakService extends Service {
961
+ static $gtype: GObject.GType<FlatpakService>;
962
+
963
+ // Constructors
964
+
965
+ constructor(properties?: Partial<FlatpakService.ConstructorProps>, ...args: any[]);
966
+
967
+ _init(...args: any[]): void;
968
+
969
+ static ['new'](client: Client): FlatpakService;
970
+ // Conflicted with Deviced.Service.new
971
+
972
+ static ['new'](...args: never[]): any;
973
+
974
+ // Methods
975
+
976
+ install_bundle_async(path: string, cancellable?: Gio.Cancellable | null): Promise<boolean>;
977
+ install_bundle_async(
978
+ path: string,
979
+ cancellable: Gio.Cancellable | null,
980
+ callback: Gio.AsyncReadyCallback<this> | null,
981
+ ): void;
982
+ install_bundle_async(
983
+ path: string,
984
+ cancellable?: Gio.Cancellable | null,
985
+ callback?: Gio.AsyncReadyCallback<this> | null,
986
+ ): Promise<boolean> | void;
987
+ install_bundle_finish(result: Gio.AsyncResult): boolean;
988
+ }
989
+
990
+ namespace NetworkClient {
991
+ // Constructor properties interface
992
+
993
+ interface ConstructorProps extends Client.ConstructorProps {
994
+ address: Gio.InetSocketAddress;
995
+ certificate: Gio.TlsCertificate;
996
+ }
997
+ }
998
+
999
+ class NetworkClient extends Client {
1000
+ static $gtype: GObject.GType<NetworkClient>;
1001
+
1002
+ // Properties
1003
+
1004
+ /**
1005
+ * The "address" is the destination that we will attept to connect to
1006
+ * using this client, when devd_client_connect_async() is called.
1007
+ */
1008
+ get address(): Gio.InetSocketAddress;
1009
+ get certificate(): Gio.TlsCertificate;
1010
+
1011
+ // Constructors
1012
+
1013
+ constructor(properties?: Partial<NetworkClient.ConstructorProps>, ...args: any[]);
1014
+
1015
+ _init(...args: any[]): void;
1016
+
1017
+ static ['new'](address: Gio.InetSocketAddress, certificate?: Gio.TlsCertificate | null): NetworkClient;
1018
+
1019
+ // Methods
1020
+
1021
+ /**
1022
+ * Gets the address that is to be used to connect to the device.
1023
+ * @returns a #GInetSocketAddress
1024
+ */
1025
+ get_address(): Gio.InetSocketAddress;
1026
+ /**
1027
+ * Gets the certificate for the network client.
1028
+ * @returns a #GTlsCertificate
1029
+ */
1030
+ get_certificate(): Gio.TlsCertificate;
1031
+ }
1032
+
1033
+ namespace NetworkDevice {
1034
+ // Constructor properties interface
1035
+
1036
+ interface ConstructorProps extends Device.ConstructorProps {
1037
+ address: Gio.InetSocketAddress;
1038
+ certificate: Gio.TlsCertificate;
1039
+ }
1040
+ }
1041
+
1042
+ class NetworkDevice extends Device {
1043
+ static $gtype: GObject.GType<NetworkDevice>;
1044
+
1045
+ // Properties
1046
+
1047
+ get address(): Gio.InetSocketAddress;
1048
+ get certificate(): Gio.TlsCertificate;
1049
+
1050
+ // Constructors
1051
+
1052
+ constructor(properties?: Partial<NetworkDevice.ConstructorProps>, ...args: any[]);
1053
+
1054
+ _init(...args: any[]): void;
1055
+
1056
+ // Methods
1057
+
1058
+ /**
1059
+ * Gets the #GInetSocketAddress that can be used to connect to the
1060
+ * device daemon.
1061
+ * @returns a #GInetSocketAddress or %NULL
1062
+ */
1063
+ get_address(): Gio.InetSocketAddress;
1064
+ /**
1065
+ * Gets the #GTlsCertificate that will be used as the client-side certificate
1066
+ * when communicating with this network device.
1067
+ * @returns a #GTlsCertificate or %NULL
1068
+ */
1069
+ get_certificate(): Gio.TlsCertificate | null;
1070
+ }
1071
+
1072
+ namespace ProcessService {
1073
+ // Signal callback interfaces
1074
+
1075
+ interface ProcessExited {
1076
+ (identifier: string, exit_code: number): void;
1077
+ }
1078
+
1079
+ interface ProcessSignaled {
1080
+ (identifier: string, term_sig: number): void;
1081
+ }
1082
+
1083
+ // Constructor properties interface
1084
+
1085
+ interface ConstructorProps extends Service.ConstructorProps {}
1086
+ }
1087
+
1088
+ class ProcessService extends Service {
1089
+ static $gtype: GObject.GType<ProcessService>;
1090
+
1091
+ // Constructors
1092
+
1093
+ constructor(properties?: Partial<ProcessService.ConstructorProps>, ...args: any[]);
1094
+
1095
+ _init(...args: any[]): void;
1096
+
1097
+ static ['new'](client: Client): ProcessService;
1098
+ // Conflicted with Deviced.Service.new
1099
+
1100
+ static ['new'](...args: never[]): any;
1101
+
1102
+ // Signals
1103
+
1104
+ connect(id: string, callback: (...args: any[]) => any): number;
1105
+ connect_after(id: string, callback: (...args: any[]) => any): number;
1106
+ emit(id: string, ...args: any[]): void;
1107
+ connect(
1108
+ signal: 'process-exited',
1109
+ callback: (_source: this, identifier: string, exit_code: number) => void,
1110
+ ): number;
1111
+ connect_after(
1112
+ signal: 'process-exited',
1113
+ callback: (_source: this, identifier: string, exit_code: number) => void,
1114
+ ): number;
1115
+ emit(signal: 'process-exited', identifier: string, exit_code: number): void;
1116
+ connect(
1117
+ signal: 'process-signaled',
1118
+ callback: (_source: this, identifier: string, term_sig: number) => void,
1119
+ ): number;
1120
+ connect_after(
1121
+ signal: 'process-signaled',
1122
+ callback: (_source: this, identifier: string, term_sig: number) => void,
1123
+ ): number;
1124
+ emit(signal: 'process-signaled', identifier: string, term_sig: number): void;
1125
+
1126
+ // Methods
1127
+
1128
+ /**
1129
+ * Creates a new PTY on the device and proxies PTY data to `local_pty_fd`.
1130
+ *
1131
+ * You may want to use the result of this asynchronous operation to pass the
1132
+ * PTY token to other client operations. That will result in the PTY data being
1133
+ * delivered to `local_pty_fd`.
1134
+ * @param local_pty_fd a PTY slave fd to proxy PTY data to
1135
+ * @param cancellable a #GCancellable or %NULL
1136
+ */
1137
+ create_pty_async(local_pty_fd: number, cancellable?: Gio.Cancellable | null): Promise<string>;
1138
+ /**
1139
+ * Creates a new PTY on the device and proxies PTY data to `local_pty_fd`.
1140
+ *
1141
+ * You may want to use the result of this asynchronous operation to pass the
1142
+ * PTY token to other client operations. That will result in the PTY data being
1143
+ * delivered to `local_pty_fd`.
1144
+ * @param local_pty_fd a PTY slave fd to proxy PTY data to
1145
+ * @param cancellable a #GCancellable or %NULL
1146
+ * @param callback a calllback to execute upon completion
1147
+ */
1148
+ create_pty_async(
1149
+ local_pty_fd: number,
1150
+ cancellable: Gio.Cancellable | null,
1151
+ callback: Gio.AsyncReadyCallback<this> | null,
1152
+ ): void;
1153
+ /**
1154
+ * Creates a new PTY on the device and proxies PTY data to `local_pty_fd`.
1155
+ *
1156
+ * You may want to use the result of this asynchronous operation to pass the
1157
+ * PTY token to other client operations. That will result in the PTY data being
1158
+ * delivered to `local_pty_fd`.
1159
+ * @param local_pty_fd a PTY slave fd to proxy PTY data to
1160
+ * @param cancellable a #GCancellable or %NULL
1161
+ * @param callback a calllback to execute upon completion
1162
+ */
1163
+ create_pty_async(
1164
+ local_pty_fd: number,
1165
+ cancellable?: Gio.Cancellable | null,
1166
+ callback?: Gio.AsyncReadyCallback<this> | null,
1167
+ ): Promise<string> | void;
1168
+ /**
1169
+ * Completes a request to create a new PTY on the remote device.
1170
+ *
1171
+ * The resulting PTY identifier is a unique string representing the PTY.
1172
+ * Data will be proxied to the `local_pty_fd` provided in
1173
+ * devd_process_service_create_pty_async(), however you may need this PTY token
1174
+ * to pass to other operations to reference the specific PTY instance.
1175
+ * @param result a #GAsyncResult provided to callback
1176
+ * @returns the pty identifier or %NULL
1177
+ */
1178
+ create_pty_finish(result: Gio.AsyncResult): string;
1179
+ /**
1180
+ * Requests that the device close a PTY device that was opened. This will
1181
+ * stop PTY data being proxied to the FD that was provided when creating the
1182
+ * PTY device.
1183
+ * @param pty_id the identifier of a previously created PTY
1184
+ * @param cancellable a #GCancellable or %NULL
1185
+ */
1186
+ destroy_pty_async(pty_id: string, cancellable?: Gio.Cancellable | null): Promise<boolean>;
1187
+ /**
1188
+ * Requests that the device close a PTY device that was opened. This will
1189
+ * stop PTY data being proxied to the FD that was provided when creating the
1190
+ * PTY device.
1191
+ * @param pty_id the identifier of a previously created PTY
1192
+ * @param cancellable a #GCancellable or %NULL
1193
+ * @param callback a callback to execute upon completion
1194
+ */
1195
+ destroy_pty_async(
1196
+ pty_id: string,
1197
+ cancellable: Gio.Cancellable | null,
1198
+ callback: Gio.AsyncReadyCallback<this> | null,
1199
+ ): void;
1200
+ /**
1201
+ * Requests that the device close a PTY device that was opened. This will
1202
+ * stop PTY data being proxied to the FD that was provided when creating the
1203
+ * PTY device.
1204
+ * @param pty_id the identifier of a previously created PTY
1205
+ * @param cancellable a #GCancellable or %NULL
1206
+ * @param callback a callback to execute upon completion
1207
+ */
1208
+ destroy_pty_async(
1209
+ pty_id: string,
1210
+ cancellable?: Gio.Cancellable | null,
1211
+ callback?: Gio.AsyncReadyCallback<this> | null,
1212
+ ): Promise<boolean> | void;
1213
+ /**
1214
+ * Completes an asynchronous request to destroy a PTY device.
1215
+ * @param result a #GAsyncResult provided to callback
1216
+ * @returns %TRUE if successful; otherwise %FALSE and @error is set.
1217
+ */
1218
+ destroy_pty_finish(result: Gio.AsyncResult): boolean;
1219
+ /**
1220
+ * Requests that the device terminate process identified by `identifier`.
1221
+ *
1222
+ * `identifier` should be a process that the client was previously notified of.
1223
+ *
1224
+ * As these requests are inherently racey, as signals are involved, no async
1225
+ * pair is provided for this. Calling this function only ensures an attempt
1226
+ * to force exit the program.
1227
+ * @param identifier the process identifier
1228
+ */
1229
+ force_exit(identifier: string): void;
1230
+ /**
1231
+ * Requests that the device send signal `signum` to the process known
1232
+ * by `identifier`.
1233
+ *
1234
+ * `identifier` should be a process that the client was previously notified of.
1235
+ *
1236
+ * As these requests are inherently racey, as signals are involved, no async
1237
+ * pair is provided for this. Calling this function only ensures an attempt
1238
+ * to send the signal to the program.
1239
+ * @param identifier the process identifier
1240
+ * @param signum the signal number
1241
+ */
1242
+ send_signal(identifier: string, signum: number): void;
1243
+ spawn_async(pty_id: string, argv: string, env: string, cancellable?: Gio.Cancellable | null): Promise<string>;
1244
+ spawn_async(
1245
+ pty_id: string,
1246
+ argv: string,
1247
+ env: string,
1248
+ cancellable: Gio.Cancellable | null,
1249
+ callback: Gio.AsyncReadyCallback<this> | null,
1250
+ ): void;
1251
+ spawn_async(
1252
+ pty_id: string,
1253
+ argv: string,
1254
+ env: string,
1255
+ cancellable?: Gio.Cancellable | null,
1256
+ callback?: Gio.AsyncReadyCallback<this> | null,
1257
+ ): Promise<string> | void;
1258
+ spawn_finish(result: Gio.AsyncResult): string;
1259
+ wait_for_process_async(identifier: string, cancellable?: Gio.Cancellable | null): Promise<boolean>;
1260
+ wait_for_process_async(
1261
+ identifier: string,
1262
+ cancellable: Gio.Cancellable | null,
1263
+ callback: Gio.AsyncReadyCallback<this> | null,
1264
+ ): void;
1265
+ wait_for_process_async(
1266
+ identifier: string,
1267
+ cancellable?: Gio.Cancellable | null,
1268
+ callback?: Gio.AsyncReadyCallback<this> | null,
1269
+ ): Promise<boolean> | void;
1270
+ wait_for_process_finish(result: Gio.AsyncResult, exited: boolean, exit_code: number, term_sig: number): boolean;
1271
+ }
1272
+
1273
+ namespace Service {
1274
+ // Signal callback interfaces
1275
+
1276
+ interface Notification {
1277
+ (object: string, p0: GLib.Variant): void;
1278
+ }
1279
+
1280
+ // Constructor properties interface
1281
+
1282
+ interface ConstructorProps extends GObject.Object.ConstructorProps {
1283
+ client: Client;
1284
+ }
1285
+ }
1286
+
1287
+ abstract class Service extends GObject.Object {
1288
+ static $gtype: GObject.GType<Service>;
1289
+
1290
+ // Properties
1291
+
1292
+ get client(): Client;
1293
+
1294
+ // Constructors
1295
+
1296
+ constructor(properties?: Partial<Service.ConstructorProps>, ...args: any[]);
1297
+
1298
+ _init(...args: any[]): void;
1299
+
1300
+ static ['new'](service_type: GObject.GType, service_name: string, client: Client): Service;
1301
+
1302
+ // Signals
1303
+
1304
+ connect(id: string, callback: (...args: any[]) => any): number;
1305
+ connect_after(id: string, callback: (...args: any[]) => any): number;
1306
+ emit(id: string, ...args: any[]): void;
1307
+ connect(signal: 'notification', callback: (_source: this, object: string, p0: GLib.Variant) => void): number;
1308
+ connect_after(
1309
+ signal: 'notification',
1310
+ callback: (_source: this, object: string, p0: GLib.Variant) => void,
1311
+ ): number;
1312
+ emit(signal: 'notification', object: string, p0: GLib.Variant): void;
1313
+
1314
+ // Virtual methods
1315
+
1316
+ vfunc_notification(method: string, params: GLib.Variant): void;
1317
+
1318
+ // Methods
1319
+
1320
+ /**
1321
+ * This is a wrapper around getting the client and calling
1322
+ * devd_client_call_async(). It's purpose is to allow service implementations
1323
+ * to have a bit less code by just calling this.
1324
+ *
1325
+ * Call devd_service_call_finish() to get the result.
1326
+ * @param method the RPC method name
1327
+ * @param params the parameters for the method
1328
+ * @param cancellable a #GCancellable or %NULL
1329
+ */
1330
+ call_async(
1331
+ method: string,
1332
+ params?: GLib.Variant | null,
1333
+ cancellable?: Gio.Cancellable | null,
1334
+ ): Promise<GLib.Variant | null>;
1335
+ /**
1336
+ * This is a wrapper around getting the client and calling
1337
+ * devd_client_call_async(). It's purpose is to allow service implementations
1338
+ * to have a bit less code by just calling this.
1339
+ *
1340
+ * Call devd_service_call_finish() to get the result.
1341
+ * @param method the RPC method name
1342
+ * @param params the parameters for the method
1343
+ * @param cancellable a #GCancellable or %NULL
1344
+ * @param callback a callback to execute upon completion
1345
+ */
1346
+ call_async(
1347
+ method: string,
1348
+ params: GLib.Variant | null,
1349
+ cancellable: Gio.Cancellable | null,
1350
+ callback: Gio.AsyncReadyCallback<this> | null,
1351
+ ): void;
1352
+ /**
1353
+ * This is a wrapper around getting the client and calling
1354
+ * devd_client_call_async(). It's purpose is to allow service implementations
1355
+ * to have a bit less code by just calling this.
1356
+ *
1357
+ * Call devd_service_call_finish() to get the result.
1358
+ * @param method the RPC method name
1359
+ * @param params the parameters for the method
1360
+ * @param cancellable a #GCancellable or %NULL
1361
+ * @param callback a callback to execute upon completion
1362
+ */
1363
+ call_async(
1364
+ method: string,
1365
+ params?: GLib.Variant | null,
1366
+ cancellable?: Gio.Cancellable | null,
1367
+ callback?: Gio.AsyncReadyCallback<this> | null,
1368
+ ): Promise<GLib.Variant | null> | void;
1369
+ /**
1370
+ * Gets the result of the RPC call.
1371
+ * @param result a #GAsyncResult provided to callback
1372
+ * @returns %TRUE if successful; otherwise %FALSE and @error is set. @reply is set to the reply from the peer, of provided.
1373
+ */
1374
+ call_finish(result: Gio.AsyncResult): [boolean, GLib.Variant | null];
1375
+ /**
1376
+ * Gets the client that the service was initialized with.
1377
+ * @returns a #DevdClient
1378
+ */
1379
+ get_client(): Client;
1380
+ }
1381
+
1382
+ namespace TransferService {
1383
+ // Constructor properties interface
1384
+
1385
+ interface ConstructorProps extends Service.ConstructorProps {}
1386
+ }
1387
+
1388
+ class TransferService extends Service {
1389
+ static $gtype: GObject.GType<TransferService>;
1390
+
1391
+ // Constructors
1392
+
1393
+ constructor(properties?: Partial<TransferService.ConstructorProps>, ...args: any[]);
1394
+
1395
+ _init(...args: any[]): void;
1396
+
1397
+ static ['new'](client: Client): TransferService;
1398
+ // Conflicted with Deviced.Service.new
1399
+
1400
+ static ['new'](...args: never[]): any;
1401
+
1402
+ // Methods
1403
+
1404
+ /**
1405
+ * Asynchronously copies the contents of `path` on the remote device to `file`.
1406
+ *
1407
+ * `progress` is called periodically with updates to the progress of the copy.
1408
+ * @param path the path on the remote device
1409
+ * @param file a #GFile to write to
1410
+ * @param progress A progress callback or %NULL to execute when transfer progress is updated.
1411
+ * @param cancellable a #GCancellable, or %NULL
1412
+ */
1413
+ get_file_async(
1414
+ path: string,
1415
+ file: Gio.File,
1416
+ progress?: Gio.FileProgressCallback | null,
1417
+ cancellable?: Gio.Cancellable | null,
1418
+ ): Promise<boolean>;
1419
+ /**
1420
+ * Asynchronously copies the contents of `path` on the remote device to `file`.
1421
+ *
1422
+ * `progress` is called periodically with updates to the progress of the copy.
1423
+ * @param path the path on the remote device
1424
+ * @param file a #GFile to write to
1425
+ * @param progress A progress callback or %NULL to execute when transfer progress is updated.
1426
+ * @param cancellable a #GCancellable, or %NULL
1427
+ * @param callback a callback to execute upon completion
1428
+ */
1429
+ get_file_async(
1430
+ path: string,
1431
+ file: Gio.File,
1432
+ progress: Gio.FileProgressCallback | null,
1433
+ cancellable: Gio.Cancellable | null,
1434
+ callback: Gio.AsyncReadyCallback<this> | null,
1435
+ ): void;
1436
+ /**
1437
+ * Asynchronously copies the contents of `path` on the remote device to `file`.
1438
+ *
1439
+ * `progress` is called periodically with updates to the progress of the copy.
1440
+ * @param path the path on the remote device
1441
+ * @param file a #GFile to write to
1442
+ * @param progress A progress callback or %NULL to execute when transfer progress is updated.
1443
+ * @param cancellable a #GCancellable, or %NULL
1444
+ * @param callback a callback to execute upon completion
1445
+ */
1446
+ get_file_async(
1447
+ path: string,
1448
+ file: Gio.File,
1449
+ progress?: Gio.FileProgressCallback | null,
1450
+ cancellable?: Gio.Cancellable | null,
1451
+ callback?: Gio.AsyncReadyCallback<this> | null,
1452
+ ): Promise<boolean> | void;
1453
+ /**
1454
+ * Completes an asynchronous request to download a file from the device.
1455
+ * @param result a #GAsyncResult provided to callback
1456
+ * @returns %TRUE if successful; otherwise %FALSE and @error is set.
1457
+ */
1458
+ get_file_finish(result: Gio.AsyncResult): boolean;
1459
+ /**
1460
+ * Asynchronously copies the contents of `file` to the remote device at `path`.
1461
+ *
1462
+ * `progress` is called periodically with updates to the progress of the copy.
1463
+ * @param file a #GFile to copy
1464
+ * @param path the path on the remote device
1465
+ * @param progress A progress callback or %NULL to execute when transfer progress is updated.
1466
+ * @param cancellable a #GCancellable, or %NULL
1467
+ */
1468
+ put_file_async(
1469
+ file: Gio.File,
1470
+ path: string,
1471
+ progress?: Gio.FileProgressCallback | null,
1472
+ cancellable?: Gio.Cancellable | null,
1473
+ ): Promise<boolean>;
1474
+ /**
1475
+ * Asynchronously copies the contents of `file` to the remote device at `path`.
1476
+ *
1477
+ * `progress` is called periodically with updates to the progress of the copy.
1478
+ * @param file a #GFile to copy
1479
+ * @param path the path on the remote device
1480
+ * @param progress A progress callback or %NULL to execute when transfer progress is updated.
1481
+ * @param cancellable a #GCancellable, or %NULL
1482
+ * @param callback a callback to execute upon completion
1483
+ */
1484
+ put_file_async(
1485
+ file: Gio.File,
1486
+ path: string,
1487
+ progress: Gio.FileProgressCallback | null,
1488
+ cancellable: Gio.Cancellable | null,
1489
+ callback: Gio.AsyncReadyCallback<this> | null,
1490
+ ): void;
1491
+ /**
1492
+ * Asynchronously copies the contents of `file` to the remote device at `path`.
1493
+ *
1494
+ * `progress` is called periodically with updates to the progress of the copy.
1495
+ * @param file a #GFile to copy
1496
+ * @param path the path on the remote device
1497
+ * @param progress A progress callback or %NULL to execute when transfer progress is updated.
1498
+ * @param cancellable a #GCancellable, or %NULL
1499
+ * @param callback a callback to execute upon completion
1500
+ */
1501
+ put_file_async(
1502
+ file: Gio.File,
1503
+ path: string,
1504
+ progress?: Gio.FileProgressCallback | null,
1505
+ cancellable?: Gio.Cancellable | null,
1506
+ callback?: Gio.AsyncReadyCallback<this> | null,
1507
+ ): Promise<boolean> | void;
1508
+ /**
1509
+ * Completes an asynchronous request to upload a file to the device.
1510
+ *
1511
+ * Clients are required to use rename() properly to ensure that the file is
1512
+ * either replaced or created if successful so you get either the previous
1513
+ * version or new version of the file.
1514
+ * @param result a #GAsyncResult provided to callback
1515
+ * @returns %TRUE if successful; otherwise %FALSE and @error is set.
1516
+ */
1517
+ put_file_finish(result: Gio.AsyncResult): boolean;
1518
+ }
1519
+
1520
+ type AppInfoClass = typeof AppInfo;
1521
+ type BrowserClass = typeof Browser;
1522
+ type ClientClass = typeof Client;
1523
+ type DeviceClass = typeof Device;
1524
+ type FlatpakServiceClass = typeof FlatpakService;
1525
+ type NetworkClientClass = typeof NetworkClient;
1526
+ type NetworkDeviceClass = typeof NetworkDevice;
1527
+ type ProcessServiceClass = typeof ProcessService;
1528
+ type ServiceClass = typeof Service;
1529
+ type TransferServiceClass = typeof TransferService;
1530
+ class Triplet {
1531
+ static $gtype: GObject.GType<Triplet>;
1532
+
1533
+ // Constructors
1534
+
1535
+ constructor(full_name: string);
1536
+ _init(...args: any[]): void;
1537
+
1538
+ static ['new'](full_name: string): Triplet;
1539
+
1540
+ static new_with_quadruplet(
1541
+ arch: string,
1542
+ vendor?: string | null,
1543
+ kernel?: string | null,
1544
+ operating_system?: string | null,
1545
+ ): Triplet;
1546
+
1547
+ static new_with_triplet(arch: string, kernel?: string | null, operating_system?: string | null): Triplet;
1548
+
1549
+ // Methods
1550
+
1551
+ /**
1552
+ * Gets the architecture name of the machine
1553
+ * @returns The architecture name of the machine
1554
+ */
1555
+ get_arch(): string;
1556
+ /**
1557
+ * Gets the full name of the machine configuration name (can be an architecture name,
1558
+ * a duet, a triplet or a quadruplet).
1559
+ * @returns The full name of the machine configuration name
1560
+ */
1561
+ get_full_name(): string;
1562
+ /**
1563
+ * Gets name of the kernel of the machine
1564
+ * @returns The name of the kernel of the machine
1565
+ */
1566
+ get_kernel(): string | null;
1567
+ /**
1568
+ * Gets name of the operating system of the machine
1569
+ * @returns The name of the operating system of the machine
1570
+ */
1571
+ get_operating_system(): string | null;
1572
+ /**
1573
+ * Gets the vendor name of the machine
1574
+ * @returns The vendor name of the machine
1575
+ */
1576
+ get_vendor(): string | null;
1577
+ /**
1578
+ * Increases the reference count of `self`
1579
+ * @returns An #DevdTriplet.
1580
+ */
1581
+ ref(): Triplet;
1582
+ /**
1583
+ * Decreases the reference count of `self`
1584
+ * Once the reference count reaches 0, the object is freed.
1585
+ */
1586
+ unref(): void;
1587
+ }
1588
+
1589
+ /**
1590
+ * Name of the imported GIR library
1591
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
1592
+ */
1593
+ const __name__: string;
1594
+ /**
1595
+ * Version of the imported GIR library
1596
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
1597
+ */
1598
+ const __version__: string;
1599
+ }
1600
+
1601
+ export default Deviced;
1602
+
1603
+ // END