/
SecretUnstable-0.d.ts
6056 lines (6053 loc) · 293 KB
/
SecretUnstable-0.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in ts-for-gir itself or create a bug report on https://github.com/sammydre/ts-for-gjs
*/
/**
* SecretUnstable-0
*/
import type * as Gjs from './Gjs';
import type Secret from './Secret-1';
import type Gio from './Gio-2.0';
import type GObject from './GObject-2.0';
import type GLib from './GLib-2.0';
export namespace SecretUnstable {
/**
* Flags for secret_collection_create().
*/
enum CollectionCreateFlags {
/**
* no flags
*/
COLLECTION_CREATE_NONE,
}
/**
* Flags which determine which parts of the #SecretCollection proxy are initialized.
*/
enum CollectionFlags {
/**
* no flags
*/
NONE,
/**
* items have or should be loaded
*/
LOAD_ITEMS,
}
/**
* Flags for secret_item_create().
*/
enum ItemCreateFlags {
/**
* no flags
*/
NONE,
/**
* replace an item with the same attributes.
*/
REPLACE,
}
/**
* Flags which determine which parts of the #SecretItem proxy are initialized.
*/
enum ItemFlags {
/**
* no flags
*/
NONE,
/**
* a secret has been (or should be) loaded for #SecretItem
*/
LOAD_SECRET,
}
/**
* Various flags to be used with secret_service_search() and secret_service_search_sync().
*/
enum SearchFlags {
/**
* no flags
*/
NONE,
/**
* all the items matching the search will be returned, instead of just the first one
*/
ALL,
/**
* unlock locked items while searching
*/
UNLOCK,
/**
* while searching load secrets for items that are not locked
*/
LOAD_SECRETS,
}
/**
* Flags which determine which parts of the #SecretService proxy are initialized
* during a secret_service_get() or secret_service_open() operation.
*/
enum ServiceFlags {
/**
* no flags for initializing the #SecretService
*/
NONE,
/**
* establish a session for transfer of secrets while initializing the #SecretService
*/
OPEN_SESSION,
/**
* load collections while initializing the #SecretService
*/
LOAD_COLLECTIONS,
}
interface Collection_ConstructProps extends Gio.DBusProxy_ConstructProps {
/* Constructor properties of SecretUnstable-0.SecretUnstable.Collection */
/**
* The date and time (in seconds since the UNIX epoch) that this
* collection was created.
*/
created?: number
/**
* The human readable label for the collection.
*
* Setting this property will result in the label of the collection being
* set asynchronously. To properly track the changing of the label use the
* secret_collection_set_label() function.
*/
label?: string
/**
* The date and time (in seconds since the UNIX epoch) that this
* collection was last modified.
*/
modified?: number
/**
* The #SecretService object that this collection is associated with and
* uses to interact with the actual D-Bus Secret Service.
*/
service?: Service
}
class Collection {
/* Properties of SecretUnstable-0.SecretUnstable.Collection */
/**
* The date and time (in seconds since the UNIX epoch) that this
* collection was created.
*/
created: number
/**
* The human readable label for the collection.
*
* Setting this property will result in the label of the collection being
* set asynchronously. To properly track the changing of the label use the
* secret_collection_set_label() function.
*/
label: string
/**
* Whether the collection is locked or not.
*
* To lock or unlock a collection use the secret_service_lock() or
* secret_service_unlock() functions.
*/
readonly locked: boolean
/**
* The date and time (in seconds since the UNIX epoch) that this
* collection was last modified.
*/
modified: number
/**
* The #SecretService object that this collection is associated with and
* uses to interact with the actual D-Bus Secret Service.
*/
readonly service: Service
/* Properties of Gio-2.0.Gio.DBusProxy */
/**
* If this property is not %G_BUS_TYPE_NONE, then
* #GDBusProxy:g-connection must be %NULL and will be set to the
* #GDBusConnection obtained by calling g_bus_get() with the value
* of this property.
*/
readonly g_bus_type: Gio.BusType
/**
* The #GDBusConnection the proxy is for.
*/
readonly g_connection: Gio.DBusConnection
/**
* The timeout to use if -1 (specifying default timeout) is passed
* as `timeout_msec` in the g_dbus_proxy_call() and
* g_dbus_proxy_call_sync() functions.
*
* This allows applications to set a proxy-wide timeout for all
* remote method invocations on the proxy. If this property is -1,
* the default timeout (typically 25 seconds) is used. If set to
* %G_MAXINT, then no timeout is used.
*/
g_default_timeout: number
/**
* Flags from the #GDBusProxyFlags enumeration.
*/
readonly g_flags: Gio.DBusProxyFlags
/**
* Ensure that interactions with this proxy conform to the given
* interface. This is mainly to ensure that malformed data received
* from the other peer is ignored. The given #GDBusInterfaceInfo is
* said to be the "expected interface".
*
* The checks performed are:
* - When completing a method call, if the type signature of
* the reply message isn't what's expected, the reply is
* discarded and the #GError is set to %G_IO_ERROR_INVALID_ARGUMENT.
*
* - Received signals that have a type signature mismatch are dropped and
* a warning is logged via g_warning().
*
* - Properties received via the initial `GetAll()` call or via the
* `::PropertiesChanged` signal (on the
* [org.freedesktop.DBus.Properties](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties)
* interface) or set using g_dbus_proxy_set_cached_property()
* with a type signature mismatch are ignored and a warning is
* logged via g_warning().
*
* Note that these checks are never done on methods, signals and
* properties that are not referenced in the given
* #GDBusInterfaceInfo, since extending a D-Bus interface on the
* service-side is not considered an ABI break.
*/
g_interface_info: Gio.DBusInterfaceInfo
/**
* The D-Bus interface name the proxy is for.
*/
readonly g_interface_name: string
/**
* The well-known or unique name that the proxy is for.
*/
readonly g_name: string
/**
* The unique name that owns #GDBusProxy:g-name or %NULL if no-one
* currently owns that name. You may connect to #GObject::notify signal to
* track changes to this property.
*/
readonly g_name_owner: string
/**
* The object path the proxy is for.
*/
readonly g_object_path: string
/* Fields of GObject-2.0.GObject.Object */
g_type_instance: GObject.TypeInstance
/* Methods of SecretUnstable-0.SecretUnstable.Collection */
/**
* Delete this collection.
*
* This method returns immediately and completes asynchronously. The secret
* service may prompt the user. secret_service_prompt() will be used to handle
* any prompts that show up.
* @param cancellable optional cancellation object
* @param callback called when the operation completes
*/
delete(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Complete operation to delete this collection.
* @param result asynchronous result passed to the callback
*/
delete_finish(result: Gio.AsyncResult): boolean
/**
* Delete this collection.
*
* This method may block indefinitely and should not be used in user
* interface threads. The secret service may prompt the user.
* secret_service_prompt() will be used to handle any prompts that show up.
* @param cancellable optional cancellation object
*/
delete_sync(cancellable?: Gio.Cancellable | null): boolean
/**
* Get the created date and time of the collection. The return value is
* the number of seconds since the unix epoch, January 1st 1970.
*/
get_created(): number
/**
* Get the flags representing what features of the #SecretCollection proxy
* have been initialized.
*
* Use secret_collection_load_items() to initialize further features
* and change the flags.
*/
get_flags(): CollectionFlags
/**
* Get the list of items in this collection.
*/
get_items(): Item[]
/**
* Get the label of this collection.
*/
get_label(): string
/**
* Get whether the collection is locked or not.
*
* Use secret_service_lock() or secret_service_unlock() to lock or unlock the
* collection.
*/
get_locked(): boolean
/**
* Get the modified date and time of the collection. The return value is
* the number of seconds since the unix epoch, January 1st 1970.
*/
get_modified(): number
/**
* Get the Secret Service object that this collection was created with.
*/
get_service(): Service
/**
* Ensure that the #SecretCollection proxy has loaded all the items present
* in the Secret Service. This affects the result of
* secret_collection_get_items().
*
* For collections returned from secret_service_get_collections() the items
* will have already been loaded.
*
* This method will return immediately and complete asynchronously.
* @param cancellable optional cancellation object
* @param callback called when the operation completes
*/
load_items(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Complete an asynchronous operation to ensure that the #SecretCollection proxy
* has loaded all the items present in the Secret Service.
* @param result the asynchronous result passed to the callback
*/
load_items_finish(result: Gio.AsyncResult): boolean
/**
* Ensure that the #SecretCollection proxy has loaded all the items present
* in the Secret Service. This affects the result of
* secret_collection_get_items().
*
* For collections returned from secret_service_get_collections() the items
* will have already been loaded.
*
* This method may block indefinitely and should not be used in user interface
* threads.
* @param cancellable optional cancellation object
*/
load_items_sync(cancellable?: Gio.Cancellable | null): boolean
/**
* Refresh the properties on this collection. This fires off a request to
* refresh, and the properties will be updated later.
*
* Calling this method is not normally necessary, as the secret service
* will notify the client when properties change.
*/
refresh(): void
/**
* Search for items matching the `attributes` in the `collection`.
* The `attributes` should be a table of string keys and string values.
*
* If %SECRET_SEARCH_ALL is set in `flags,` then all the items matching the
* search will be returned. Otherwise only the first item will be returned.
* This is almost always the unlocked item that was most recently stored.
*
* If %SECRET_SEARCH_UNLOCK is set in `flags,` then items will be unlocked
* if necessary. In either case, locked and unlocked items will match the
* search and be returned. If the unlock fails, the search does not fail.
*
* If %SECRET_SEARCH_LOAD_SECRETS is set in `flags,` then the items will have
* their secret values loaded and available via secret_item_get_secret().
*
* This function returns immediately and completes asynchronously.
* @param schema the schema for the attributes
* @param attributes search for items matching these attributes
* @param flags search option flags
* @param cancellable optional cancellation object
* @param callback called when the operation completes
*/
search(schema: Secret.Schema | null, attributes: GLib.HashTable, flags: SearchFlags, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Complete asynchronous operation to search for items in a collection.
* @param result asynchronous result passed to callback
*/
search_finish(result: Gio.AsyncResult): Item[]
/**
* Search for items in `collection` matching the `attributes,` and return their
* DBus object paths. Only the specified collection is searched. The `attributes`
* should be a table of string keys and string values.
*
* This function returns immediately and completes asynchronously.
*
* When your callback is called use secret_collection_search_for_dbus_paths_finish()
* to get the results of this function. Only the DBus object paths of the
* items will be returned. If you would like #SecretItem objects to be returned
* instead, then use the secret_collection_search() function.
* @param schema the schema for the attributes
* @param attributes search for items matching these attributes
* @param cancellable optional cancellation object
* @param callback called when the operation completes
*/
search_for_dbus_paths(schema: Secret.Schema | null, attributes: GLib.HashTable, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Complete asynchronous operation to search for items in a collection.
*
* DBus object paths of the items will be returned. If you would to have
* #SecretItem objects to be returned instead, then use the
* secret_collection_search() and secret_collection_search_finish() functions.
* @param result asynchronous result passed to callback
*/
search_for_dbus_paths_finish(result: Gio.AsyncResult): string[]
/**
* Search for items matching the `attributes` in `collection,` and return their
* DBus object paths. The `attributes` should be a table of string keys and
* string values.
*
* This function may block indefinetely. Use the asynchronous version
* in user interface threads.
*
* DBus object paths of the items will be returned. If you would to have
* #SecretItem objects to be returned instead, then use the
* secret_collection_search_sync() function.
* @param schema the schema for the attributes
* @param attributes search for items matching these attributes
* @param cancellable optional cancellation object
*/
search_for_dbus_paths_sync(schema: Secret.Schema | null, attributes: GLib.HashTable, cancellable?: Gio.Cancellable | null): string[]
/**
* Search for items matching the `attributes` in the `collection`.
* The `attributes` should be a table of string keys and string values.
*
* If %SECRET_SEARCH_ALL is set in `flags,` then all the items matching the
* search will be returned. Otherwise only the first item will be returned.
* This is almost always the unlocked item that was most recently stored.
*
* If %SECRET_SEARCH_UNLOCK is set in `flags,` then items will be unlocked
* if necessary. In either case, locked and unlocked items will match the
* search and be returned. If the unlock fails, the search does not fail.
*
* If %SECRET_SEARCH_LOAD_SECRETS is set in `flags,` then the items will have
* their secret values loaded and available via secret_item_get_secret().
*
* This function may block indefinetely. Use the asynchronous version
* in user interface threads.
* @param schema the schema for the attributes
* @param attributes search for items matching these attributes
* @param flags search option flags
* @param cancellable optional cancellation object
*/
search_sync(schema: Secret.Schema | null, attributes: GLib.HashTable, flags: SearchFlags, cancellable?: Gio.Cancellable | null): Item[]
/**
* Set the label of this collection.
*
* This function returns immediately and completes asynchronously.
* @param label a new label
* @param cancellable optional cancellation object
* @param callback called when the operation completes
*/
set_label(label: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Complete asynchronous operation to set the label of this collection.
* @param result asynchronous result passed to callback
*/
set_label_finish(result: Gio.AsyncResult): boolean
/**
* Set the label of this collection.
*
* This function may block indefinetely. Use the asynchronous version
* in user interface threads.
* @param label a new label
* @param cancellable optional cancellation object
*/
set_label_sync(label: string, cancellable?: Gio.Cancellable | null): boolean
/* Methods of Gio-2.0.Gio.DBusProxy */
/**
* Asynchronously invokes the `method_name` method on `proxy`.
*
* If `method_name` contains any dots, then `name` is split into interface and
* method name parts. This allows using `proxy` for invoking methods on
* other interfaces.
*
* If the #GDBusConnection associated with `proxy` is closed then
* the operation will fail with %G_IO_ERROR_CLOSED. If
* `cancellable` is canceled, the operation will fail with
* %G_IO_ERROR_CANCELLED. If `parameters` contains a value not
* compatible with the D-Bus protocol, the operation fails with
* %G_IO_ERROR_INVALID_ARGUMENT.
*
* If the `parameters` #GVariant is floating, it is consumed. This allows
* convenient 'inline' use of g_variant_new(), e.g.:
*
* ```c
* g_dbus_proxy_call (proxy,
* "TwoStrings",
* g_variant_new ("(ss)",
* "Thing One",
* "Thing Two"),
* G_DBUS_CALL_FLAGS_NONE,
* -1,
* NULL,
* (GAsyncReadyCallback) two_strings_done,
* &data);
* ```
*
*
* If `proxy` has an expected interface (see
* #GDBusProxy:g-interface-info) and `method_name` is referenced by it,
* then the return value is checked against the return type.
*
* This is an asynchronous method. When the operation is finished,
* `callback` will be invoked in the
* [thread-default main context][g-main-context-push-thread-default]
* of the thread you are calling this method from.
* You can then call g_dbus_proxy_call_finish() to get the result of
* the operation. See g_dbus_proxy_call_sync() for the synchronous
* version of this method.
*
* If `callback` is %NULL then the D-Bus method call message will be sent with
* the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
* @param method_name Name of method to invoke.
* @param parameters A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
* @param flags Flags from the #GDBusCallFlags enumeration.
* @param timeout_msec The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
* @param cancellable A #GCancellable or %NULL.
* @param callback A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
*/
call(method_name: string, parameters: GLib.Variant | null, flags: Gio.DBusCallFlags, timeout_msec: number, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void
/**
* Finishes an operation started with g_dbus_proxy_call().
* @param res A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
*/
call_finish(res: Gio.AsyncResult): GLib.Variant
/**
* Synchronously invokes the `method_name` method on `proxy`.
*
* If `method_name` contains any dots, then `name` is split into interface and
* method name parts. This allows using `proxy` for invoking methods on
* other interfaces.
*
* If the #GDBusConnection associated with `proxy` is disconnected then
* the operation will fail with %G_IO_ERROR_CLOSED. If
* `cancellable` is canceled, the operation will fail with
* %G_IO_ERROR_CANCELLED. If `parameters` contains a value not
* compatible with the D-Bus protocol, the operation fails with
* %G_IO_ERROR_INVALID_ARGUMENT.
*
* If the `parameters` #GVariant is floating, it is consumed. This allows
* convenient 'inline' use of g_variant_new(), e.g.:
*
* ```c
* g_dbus_proxy_call_sync (proxy,
* "TwoStrings",
* g_variant_new ("(ss)",
* "Thing One",
* "Thing Two"),
* G_DBUS_CALL_FLAGS_NONE,
* -1,
* NULL,
* &error);
* ```
*
*
* The calling thread is blocked until a reply is received. See
* g_dbus_proxy_call() for the asynchronous version of this
* method.
*
* If `proxy` has an expected interface (see
* #GDBusProxy:g-interface-info) and `method_name` is referenced by it,
* then the return value is checked against the return type.
* @param method_name Name of method to invoke.
* @param parameters A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
* @param flags Flags from the #GDBusCallFlags enumeration.
* @param timeout_msec The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
* @param cancellable A #GCancellable or %NULL.
*/
call_sync(method_name: string, parameters: GLib.Variant | null, flags: Gio.DBusCallFlags, timeout_msec: number, cancellable?: Gio.Cancellable | null): GLib.Variant
/**
* Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
*
* This method is only available on UNIX.
* @param method_name Name of method to invoke.
* @param parameters A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
* @param flags Flags from the #GDBusCallFlags enumeration.
* @param timeout_msec The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
* @param fd_list A #GUnixFDList or %NULL.
* @param cancellable A #GCancellable or %NULL.
* @param callback A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
*/
call_with_unix_fd_list(method_name: string, parameters: GLib.Variant | null, flags: Gio.DBusCallFlags, timeout_msec: number, fd_list?: Gio.UnixFDList | null, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void
/**
* Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
* @param res A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
*/
call_with_unix_fd_list_finish(res: Gio.AsyncResult): [ /* returnType */ GLib.Variant, /* out_fd_list */ Gio.UnixFDList | null ]
/**
* Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
*
* This method is only available on UNIX.
* @param method_name Name of method to invoke.
* @param parameters A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
* @param flags Flags from the #GDBusCallFlags enumeration.
* @param timeout_msec The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
* @param fd_list A #GUnixFDList or %NULL.
* @param cancellable A #GCancellable or %NULL.
*/
call_with_unix_fd_list_sync(method_name: string, parameters: GLib.Variant | null, flags: Gio.DBusCallFlags, timeout_msec: number, fd_list?: Gio.UnixFDList | null, cancellable?: Gio.Cancellable | null): [ /* returnType */ GLib.Variant, /* out_fd_list */ Gio.UnixFDList | null ]
/**
* Looks up the value for a property from the cache. This call does no
* blocking IO.
*
* If `proxy` has an expected interface (see
* #GDBusProxy:g-interface-info) and `property_name` is referenced by
* it, then `value` is checked against the type of the property.
* @param property_name Property name.
*/
get_cached_property(property_name: string): GLib.Variant | null
/**
* Gets the names of all cached properties on `proxy`.
*/
get_cached_property_names(): string[] | null
/**
* Gets the connection `proxy` is for.
*/
get_connection(): Gio.DBusConnection
/**
* Gets the timeout to use if -1 (specifying default timeout) is
* passed as `timeout_msec` in the g_dbus_proxy_call() and
* g_dbus_proxy_call_sync() functions.
*
* See the #GDBusProxy:g-default-timeout property for more details.
*/
get_default_timeout(): number
/**
* Gets the flags that `proxy` was constructed with.
*/
get_flags(): Gio.DBusProxyFlags
/**
* Returns the #GDBusInterfaceInfo, if any, specifying the interface
* that `proxy` conforms to. See the #GDBusProxy:g-interface-info
* property for more details.
*/
get_interface_info(): Gio.DBusInterfaceInfo | null
/**
* Gets the D-Bus interface name `proxy` is for.
*/
get_interface_name(): string
/**
* Gets the name that `proxy` was constructed for.
*
* When connected to a message bus, this will usually be non-%NULL.
* However, it may be %NULL for a proxy that communicates using a peer-to-peer
* pattern.
*/
get_name(): string | null
/**
* The unique name that owns the name that `proxy` is for or %NULL if
* no-one currently owns that name. You may connect to the
* #GObject::notify signal to track changes to the
* #GDBusProxy:g-name-owner property.
*/
get_name_owner(): string | null
/**
* Gets the object path `proxy` is for.
*/
get_object_path(): string
/**
* If `value` is not %NULL, sets the cached value for the property with
* name `property_name` to the value in `value`.
*
* If `value` is %NULL, then the cached value is removed from the
* property cache.
*
* If `proxy` has an expected interface (see
* #GDBusProxy:g-interface-info) and `property_name` is referenced by
* it, then `value` is checked against the type of the property.
*
* If the `value` #GVariant is floating, it is consumed. This allows
* convenient 'inline' use of g_variant_new(), e.g.
*
* ```c
* g_dbus_proxy_set_cached_property (proxy,
* "SomeProperty",
* g_variant_new ("(si)",
* "A String",
* 42));
* ```
*
*
* Normally you will not need to use this method since `proxy`
* is tracking changes using the
* `org.freedesktop.DBus.Properties.PropertiesChanged`
* D-Bus signal. However, for performance reasons an object may
* decide to not use this signal for some properties and instead
* use a proprietary out-of-band mechanism to transmit changes.
*
* As a concrete example, consider an object with a property
* `ChatroomParticipants` which is an array of strings. Instead of
* transmitting the same (long) array every time the property changes,
* it is more efficient to only transmit the delta using e.g. signals
* `ChatroomParticipantJoined(String name)` and
* `ChatroomParticipantParted(String name)`.
* @param property_name Property name.
* @param value Value for the property or %NULL to remove it from the cache.
*/
set_cached_property(property_name: string, value?: GLib.Variant | null): void
/**
* Sets the timeout to use if -1 (specifying default timeout) is
* passed as `timeout_msec` in the g_dbus_proxy_call() and
* g_dbus_proxy_call_sync() functions.
*
* See the #GDBusProxy:g-default-timeout property for more details.
* @param timeout_msec Timeout in milliseconds.
*/
set_default_timeout(timeout_msec: number): void
/**
* Ensure that interactions with `proxy` conform to the given
* interface. See the #GDBusProxy:g-interface-info property for more
* details.
* @param info Minimum interface this proxy conforms to or %NULL to unset.
*/
set_interface_info(info?: Gio.DBusInterfaceInfo | null): void
/* Methods of GObject-2.0.GObject.Object */
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on `source` to bind
* @param target the target #GObject
* @param target_property the property on `target` to bind
* @param flags flags to pass to #GBinding
*/
bind_property(source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags): GObject.Binding
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* This function is the language bindings friendly version of
* g_object_bind_property_full(), using #GClosures instead of
* function pointers.
* @param source_property the property on `source` to bind
* @param target the target #GObject
* @param target_property the property on `target` to bind
* @param flags flags to pass to #GBinding
* @param transform_to a #GClosure wrapping the transformation function from the `source` to the `target,` or %NULL to use the default
* @param transform_from a #GClosure wrapping the transformation function from the `target` to the `source,` or %NULL to use the default
*/
bind_property_full(source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags, transform_to: Function, transform_from: Function): GObject.Binding
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
*/
get_data(key: string): object | null
/**
* Gets a property of an object.
*
* The `value` can be:
*
* - an empty #GValue initialized by %G_VALUE_INIT, which will be
* automatically initialized with the expected type of the property
* (since GLib 2.60)
* - a #GValue initialized with the expected type of the property
* - a #GValue initialized with a type to which the expected type
* of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is
* responsible for freeing the memory by calling g_value_unset().
*
* Note that g_object_get_property() is really intended for language
* bindings, g_object_get() is much more convenient for C programming.
* @param property_name the name of the property to get
* @param value return location for the property value
*/
get_property(property_name: string, value: any): void
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
*/
get_qdata(quark: GLib.Quark): object | null
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: any[]): void
/**
* Checks whether `object` has a [floating][floating-ref] reference.
*/
is_floating(): boolean
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of `object`.
*/
notify(property_name: string): void
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* enum
* {
* PROP_0,
* PROP_FOO,
* PROP_LAST
* };
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
* 0, 100,
* 50,
* G_PARAM_READWRITE);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of `object`.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
*/
ref(): GObject.Object
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
*/
ref_sink(): GObject.Object
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: object | null): void
/**
* Sets a property on an object.
* @param property_name the name of the property to set
* @param value the value
*/
set_property(property_name: string, value: any): void
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
*/
steal_data(key: string): object | null
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
*/
steal_qdata(quark: GLib.Quark): object | null
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the