@girs/dex-1 1.0.0-3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dex-1.d.ts ADDED
@@ -0,0 +1,1224 @@
1
+
2
+ /*
3
+ * Type Definitions for Gjs (https://gjs.guide/)
4
+ *
5
+ * These type definitions are automatically generated, do not edit them by hand.
6
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
7
+ */
8
+
9
+ import './dex-1-ambient.d.ts';
10
+ import './dex-1-import.d.ts';
11
+ /**
12
+ * Dex-1
13
+ */
14
+
15
+ import type Gio from '@girs/gio-2.0';
16
+ import type GObject from '@girs/gobject-2.0';
17
+ import type GLib from '@girs/glib-2.0';
18
+
19
+ export namespace Dex {
20
+
21
+ enum BlockKind {
22
+ THEN,
23
+ CATCH,
24
+ FINALLY,
25
+ }
26
+ enum Error {
27
+ UNKNOWN,
28
+ CHANNEL_CLOSED,
29
+ DEPENDENCY_FAILED,
30
+ FIBER_EXITED,
31
+ NO_FIBER,
32
+ PENDING,
33
+ SEMAPHORE_CLOSED,
34
+ TIMED_OUT,
35
+ TYPE_MISMATCH,
36
+ TYPE_NOT_SUPPORTED,
37
+ FIBER_CANCELLED,
38
+ }
39
+ enum FutureStatus {
40
+ PENDING,
41
+ RESOLVED,
42
+ REJECTED,
43
+ }
44
+ /**
45
+ * An asynchronous `pread()` wrapper.
46
+ * @param aio_context
47
+ * @param fd
48
+ * @param buffer
49
+ * @param count
50
+ * @param offset
51
+ * @returns a future that will resolve when the read completes or rejects with error.
52
+ */
53
+ function aio_read(aio_context: AioContext, fd: number, buffer: any | null, count: number, offset: number): Future
54
+ /**
55
+ * An asynchronous `pwrite()` wrapper.
56
+ * @param aio_context
57
+ * @param fd
58
+ * @param buffer
59
+ * @param count
60
+ * @param offset
61
+ * @returns a future that will resolve when the write completes or rejects with error.
62
+ */
63
+ function aio_write(aio_context: AioContext, fd: number, buffer: any | null, count: number, offset: number): Future
64
+ /**
65
+ * Wrapper for g_bus_get().
66
+ * @param bus_type
67
+ * @returns a #DexFuture that resolves to a #GDBusConnection or rejects with error.
68
+ */
69
+ function bus_get(bus_type: Gio.BusType): Future
70
+ /**
71
+ * Wrapper for g_dbus_connection_call().
72
+ * @param connection
73
+ * @param bus_name
74
+ * @param object_path
75
+ * @param interface_name
76
+ * @param method_name
77
+ * @param parameters
78
+ * @param reply_type
79
+ * @param flags
80
+ * @param timeout_msec
81
+ * @returns a #DexFuture that resolves to a #GVariant or rejects with error.
82
+ */
83
+ function dbus_connection_call(connection: Gio.DBusConnection, bus_name: string | null, object_path: string | null, interface_name: string | null, method_name: string | null, parameters: GLib.Variant, reply_type: GLib.VariantType, flags: Gio.DBusCallFlags, timeout_msec: number): Future
84
+ /**
85
+ * Wrapper for g_dbus_connection_call_with_unix_fd_list().
86
+ * @param connection
87
+ * @param bus_name
88
+ * @param object_path
89
+ * @param interface_name
90
+ * @param method_name
91
+ * @param parameters
92
+ * @param reply_type
93
+ * @param flags
94
+ * @param timeout_msec
95
+ * @param fd_list a #GUnixFDList
96
+ * @returns a #DexFutureSet that resolves to a #GVariant. The #DexFuture containing the resulting #GUnixFDList can be retrieved with dex_future_set_get_future_at() with an index of 1.
97
+ */
98
+ function dbus_connection_call_with_unix_fd_list(connection: Gio.DBusConnection, bus_name: string | null, object_path: string | null, interface_name: string | null, method_name: string | null, parameters: GLib.Variant, reply_type: GLib.VariantType, flags: Gio.DBusCallFlags, timeout_msec: number, fd_list: Gio.UnixFDList | null): Future
99
+ /**
100
+ * Wrapper for g_dbus_connection_send_message_with_reply().
101
+ * @param connection a #GDBusConnection
102
+ * @param message a #GDBusMessage
103
+ * @param flags flags for `message`
104
+ * @param timeout_msec timeout in milliseconds, or -1 for default, or %G_MAXINT for no timeout.
105
+ * @returns a #DexFuture that will resolve to a #GDBusMessage or reject with failure.
106
+ */
107
+ function dbus_connection_send_message_with_reply(connection: Gio.DBusConnection, message: Gio.DBusMessage, flags: Gio.DBusSendMessageFlags, timeout_msec: number): [ /* returnType */ Future, /* out_serial */ number | null ]
108
+ function error_quark(): GLib.Quark
109
+ /**
110
+ * Asynchronously copies a file and returns a #DexFuture which
111
+ * can be observed for the result.
112
+ * @param source a #GFile
113
+ * @param destination a #GFile
114
+ * @param flags the #GFileCopyFlags
115
+ * @param io_priority IO priority such as %G_PRIORITY_DEFAULT
116
+ * @returns a #DexFuture
117
+ */
118
+ function file_copy(source: Gio.File, destination: Gio.File, flags: Gio.FileCopyFlags, io_priority: number): Future
119
+ function file_enumerate_children(file: Gio.File, attributes: string | null, flags: Gio.FileQueryInfoFlags, io_priority: number): Future
120
+ function file_enumerator_next_files(file_enumerator: Gio.FileEnumerator, num_files: number, io_priority: number): Future
121
+ function file_load_contents_bytes(file: Gio.File): Future
122
+ /**
123
+ * Asynchronously creates a directory and returns #DexFuture which
124
+ * can be observed for the result.
125
+ * @param file a #GFile
126
+ * @param io_priority IO priority such as %G_PRIORITY_DEFAULT
127
+ * @returns a #DexFuture
128
+ */
129
+ function file_make_directory(file: Gio.File, io_priority: number): Future
130
+ function file_query_info(file: Gio.File, attributes: string | null, flags: Gio.FileQueryInfoFlags, io_priority: number): Future
131
+ /**
132
+ * Asynchronously opens a file for reading.
133
+ * @param file a #GFile
134
+ * @param io_priority IO priority such as %G_PRIORITY_DEFAULT
135
+ * @returns a #DexFuture
136
+ */
137
+ function file_read(file: Gio.File, io_priority: number): Future
138
+ function file_replace(file: Gio.File, etag: string | null, make_backup: boolean, flags: Gio.FileCreateFlags, io_priority: number): Future
139
+ function get_min_stack_size(): number
140
+ function get_page_size(): number
141
+ function init(): void
142
+ function input_stream_close(self: Gio.InputStream, io_priority: number): Future
143
+ function input_stream_read(self: Gio.InputStream, buffer: any | null, count: number, io_priority: number): Future
144
+ function input_stream_read_bytes(self: Gio.InputStream, count: number, io_priority: number): Future
145
+ function input_stream_skip(self: Gio.InputStream, count: number, io_priority: number): Future
146
+ function io_stream_close(io_stream: Gio.IOStream, io_priority: number): Future
147
+ function output_stream_close(self: Gio.OutputStream, io_priority: number): Future
148
+ function output_stream_splice(output: Gio.OutputStream, input: Gio.InputStream, flags: Gio.OutputStreamSpliceFlags, io_priority: number): Future
149
+ function output_stream_write(self: Gio.OutputStream, buffer: any | null, count: number, io_priority: number): Future
150
+ function output_stream_write_bytes(self: Gio.OutputStream, bytes: GLib.Bytes, io_priority: number): Future
151
+ function resolver_lookup_by_name(resolver: Gio.Resolver, address: string | null): Future
152
+ function socket_client_connect(socket_client: Gio.SocketClient, socket_connectable: Gio.SocketConnectable): Future
153
+ function socket_listener_accept(listener: Gio.SocketListener): Future
154
+ /**
155
+ * Creates a future that awaits for `subprocess` to complete using
156
+ * g_subprocess_wait_check_async().
157
+ * @param subprocess a #GSubprocess
158
+ * @returns a #DexFuture that will resolve when @subprocess exits cleanly or reject upon signal or non-successful exit.
159
+ */
160
+ function subprocess_wait_check(subprocess: Gio.Subprocess): Future
161
+ /**
162
+ * Retrieves the `DexObject` stored inside the given `value`.
163
+ * @param value a `GValue` initialized with type `DEX_TYPE_OBJECT`
164
+ * @returns a `DexObject`
165
+ */
166
+ function value_get_object(value: any): Object | null
167
+ /**
168
+ * Stores the given `DexObject` inside `value`.
169
+ *
170
+ * The [struct`GObject`.Value] will acquire a reference to the `object`.
171
+ * @param value a [struct`GObject`.Value] initialized with type `DEX_TYPE_OBJECT`
172
+ * @param object a `DexObject` or %NULL
173
+ */
174
+ function value_set_object(value: any, object: Object | null): void
175
+ /**
176
+ * Stores the given `DexObject` inside `value`.
177
+ *
178
+ * This function transfers the ownership of the `object` to the `GValue`.
179
+ * @param value a [struct`GObject`.Value] initialized with type `DEX_TYPE_OBJECT`
180
+ * @param object a `DexObject`
181
+ */
182
+ function value_take_object(value: any, object: Object | null): void
183
+ /**
184
+ * This function prototype is used for spawning fibers. A fiber
185
+ * is a lightweight, cooperative-multitasking feature where the
186
+ * fiber is given it's own stack. The fiber runs until it reaches
187
+ * a point of suspention (using `dex_await` or similar) or exits
188
+ * the fiber.
189
+ *
190
+ * When suspended, the fiber is placed onto a queue until it is
191
+ * runnable again. Once runnable, the fiber is scheduled to run
192
+ * from within whatever scheduler it was created with.
193
+ *
194
+ * See `dex_scheduler_spawn()`
195
+ * @callback
196
+ * @returns a #DexFuture or %NULL
197
+ */
198
+ interface FiberFunc {
199
+ (): Future | null
200
+ }
201
+ /**
202
+ * A #DexFutureCallback can be executed from a #DexBlock as response to
203
+ * another #DexFuture resolving or rejecting.
204
+ *
205
+ * The callback will be executed within the scheduler environment the
206
+ * block is created within when using dex_future_then(), dex_future_catch(),
207
+ * dex_future_finally(), dex_future_all(), and similar functions.
208
+ *
209
+ * This is the expected way to handle completion of a future when not using
210
+ * #DexFiber via dex_scheduler_spawn().
211
+ * @callback
212
+ * @param future a resolved or rejected #DexFuture
213
+ * @returns a #DexFuture or %NULL
214
+ */
215
+ interface FutureCallback {
216
+ (future: Future): Future | null
217
+ }
218
+ interface SchedulerFunc {
219
+ (): void
220
+ }
221
+ interface AsyncPair {
222
+
223
+ // Owm methods of Dex-1.Dex.AsyncPair
224
+
225
+ /**
226
+ * Gets the cancellable for the async pair.
227
+ *
228
+ * If the DexAsyncPair is discarded by it's callers, then it will automatically
229
+ * be cancelled using g_cancellable_cancel().
230
+ * @returns a #GCancellable
231
+ */
232
+ get_cancellable(): Gio.Cancellable
233
+ return_boolean(value: boolean): void
234
+ /**
235
+ * Rejects `async_pair` with `error`.
236
+ *
237
+ * This function is meant to be used when manually wrapping
238
+ * various #GAsyncReadyCallback based API.
239
+ *
240
+ * The ownership of `error` is taken when calling this function.
241
+ * @param error a #GError
242
+ */
243
+ return_error(error: GLib.Error): void
244
+ return_int64(value: number): void
245
+ /**
246
+ * Resolves `async_pair` with a value of `instance`.
247
+ *
248
+ * This function is meant to be used when manually wrapping
249
+ * various #GAsyncReadyCallback based API.
250
+ *
251
+ * The ownership of `instance` is taken when calling this function.
252
+ * @param instance a #GObject
253
+ */
254
+ return_object(instance: GObject.Object): void
255
+ /**
256
+ * Resolves `async_pair` with `value`.
257
+ * @param value a string or %NULL
258
+ */
259
+ return_string(value: string | null): void
260
+ return_uint64(value: number): void
261
+ /**
262
+ * Resolves `async_pair` with `variant`.
263
+ * @param variant the variant to resolve with
264
+ */
265
+ return_variant(variant: GLib.Variant): void
266
+ /**
267
+ * Sets whether or not the future should cancel the async operation when
268
+ * the future is discarded. This happens when no more futures are awaiting
269
+ * the completion of this future.
270
+ * @param cancel_on_discard if the operation should cancel when the future is discarded
271
+ */
272
+ set_cancel_on_discard(cancel_on_discard: boolean): void
273
+ }
274
+
275
+ class AsyncPair extends Future {
276
+
277
+ // Own properties of Dex-1.Dex.AsyncPair
278
+
279
+ static name: string
280
+
281
+ // Constructors of Dex-1.Dex.AsyncPair
282
+
283
+ constructor(instance: any | null, info: AsyncPairInfo)
284
+ static new(instance: any | null, info: AsyncPairInfo): AsyncPair
285
+ }
286
+
287
+ module AsyncResult {
288
+
289
+ // Constructor properties interface
290
+
291
+ interface ConstructorProperties extends Gio.AsyncResult.ConstructorProperties, GObject.Object.ConstructorProperties {
292
+ }
293
+
294
+ }
295
+
296
+ interface AsyncResult extends Gio.AsyncResult {
297
+
298
+ // Owm methods of Dex-1.Dex.AsyncResult
299
+
300
+ /**
301
+ * Tracks the result of `future` and uses the value to complete `async_result,`
302
+ * eventually calling the registered #GAsyncReadyCallback.
303
+ * @param future a #DexFuture
304
+ */
305
+ await(future: Future): void
306
+ /**
307
+ * Gets the future for the #DexAsyncResult, or %NULL if a future
308
+ * is not available.
309
+ * @returns a #DexFuture or %NULL
310
+ */
311
+ dup_future(): Future | null
312
+ get_name(): string | null
313
+ propagate_boolean(): boolean
314
+ propagate_double(): number
315
+ propagate_int(): number
316
+ propagate_pointer(): any | null
317
+ set_name(name: string | null): void
318
+ set_priority(priority: number): void
319
+ set_static_name(name: string | null): void
320
+
321
+ // Class property signals of Dex-1.Dex.AsyncResult
322
+
323
+ connect(sigName: string, callback: (...args: any[]) => void): number
324
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
325
+ emit(sigName: string, ...args: any[]): void
326
+ disconnect(id: number): void
327
+ }
328
+
329
+ class AsyncResult extends GObject.Object {
330
+
331
+ // Own properties of Dex-1.Dex.AsyncResult
332
+
333
+ static name: string
334
+ static $gtype: GObject.GType<AsyncResult>
335
+
336
+ // Constructors of Dex-1.Dex.AsyncResult
337
+
338
+ constructor(config?: AsyncResult.ConstructorProperties)
339
+ constructor(source_object: any | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<AsyncResult> | null)
340
+ static new(source_object: any | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<AsyncResult> | null): AsyncResult
341
+ _init(config?: AsyncResult.ConstructorProperties): void
342
+ }
343
+
344
+ interface Block {
345
+
346
+ // Owm methods of Dex-1.Dex.Block
347
+
348
+ /**
349
+ * Gets the kind of block.
350
+ *
351
+ * The kind of block relates to what situations the block would be
352
+ * executed such as for handling a future resolution, rejection, or
353
+ * both.
354
+ * @returns a #DexBlockKind
355
+ */
356
+ get_kind(): BlockKind
357
+ /**
358
+ * Gets the scheduler to use when executing a block.
359
+ * @returns a #DexScheduler
360
+ */
361
+ get_scheduler(): Scheduler
362
+ }
363
+
364
+ class Block extends Future {
365
+
366
+ // Own properties of Dex-1.Dex.Block
367
+
368
+ static name: string
369
+ }
370
+
371
+ interface Cancellable {
372
+
373
+ // Owm methods of Dex-1.Dex.Cancellable
374
+
375
+ cancel(): void
376
+ }
377
+
378
+ class Cancellable extends Future {
379
+
380
+ // Own properties of Dex-1.Dex.Cancellable
381
+
382
+ static name: string
383
+
384
+ // Constructors of Dex-1.Dex.Cancellable
385
+
386
+ constructor()
387
+ static new(): Cancellable
388
+ static new_from_cancellable(cancellable: Gio.Cancellable | null): Cancellable
389
+ }
390
+
391
+ interface Channel {
392
+
393
+ // Owm methods of Dex-1.Dex.Channel
394
+
395
+ can_receive(): boolean
396
+ can_send(): boolean
397
+ close_receive(): void
398
+ close_send(): void
399
+ /**
400
+ * Receives the next item from the channel.
401
+ *
402
+ * The resulting future will resolve or reject when an item is available
403
+ * to the channel or when send side has closed (in that order).
404
+ * @returns a #DexFuture
405
+ */
406
+ receive(): Future
407
+ /**
408
+ * Will attempt to receive all items in the channel as a #DexResultSet.
409
+ *
410
+ * If the receive side of the channel is closed, then the future will
411
+ * reject with an error.
412
+ *
413
+ * If there are items in the queue, then they will be returned as part
414
+ * of a #DexResultSet containing each of the futures.
415
+ *
416
+ * Otherwise, a #DexFutureSet will be returned which will resolve or
417
+ * reject when the next item is available in the channel (or the send
418
+ * or receive sides are closed).
419
+ * @returns a #DexFuture
420
+ */
421
+ receive_all(): Future
422
+ /**
423
+ * Queues `future` into the channel.
424
+ *
425
+ * The other end of the channel can receive the future (or a future that will
426
+ * eventually resolve to `future)` using dex_channel_receive().
427
+ *
428
+ * This function returns a #DexFuture that will resolve when the channels
429
+ * capacity is low enough to queue more items.
430
+ *
431
+ * If the send side of the channel is closed, the returned #DexFuture will be
432
+ * rejected with %DEX_ERROR_CHANNEL_CLOSED.
433
+ * @param future a #DexFuture
434
+ * @returns a #DexFuture
435
+ */
436
+ send(future: Future): Future
437
+ }
438
+
439
+ class Channel extends Object {
440
+
441
+ // Own properties of Dex-1.Dex.Channel
442
+
443
+ static name: string
444
+
445
+ // Constructors of Dex-1.Dex.Channel
446
+
447
+ /**
448
+ * Creates a new #DexChannel.
449
+ *
450
+ * If capacity is non-zero, it can be used to limit the size of the channel
451
+ * so that functions can asynchronously stall until items have been removed
452
+ * from the channel. This is useful in buffering situations so that the
453
+ * producer does not outpace the consumer.
454
+ * @constructor
455
+ * @param capacity the channel queue depth or 0 for unlimited
456
+ * @returns a new #DexChannel
457
+ */
458
+ constructor(capacity: number)
459
+ /**
460
+ * Creates a new #DexChannel.
461
+ *
462
+ * If capacity is non-zero, it can be used to limit the size of the channel
463
+ * so that functions can asynchronously stall until items have been removed
464
+ * from the channel. This is useful in buffering situations so that the
465
+ * producer does not outpace the consumer.
466
+ * @constructor
467
+ * @param capacity the channel queue depth or 0 for unlimited
468
+ * @returns a new #DexChannel
469
+ */
470
+ static new(capacity: number): Channel
471
+ }
472
+
473
+ interface Delayed {
474
+
475
+ // Owm methods of Dex-1.Dex.Delayed
476
+
477
+ /**
478
+ * Retrieves the delayed future provided to dex_delayed_new().
479
+ *
480
+ * This function can only return a #DexFuture before dex_delayed_release()
481
+ * is called. After that, the delayed future is released and this function
482
+ * will return %NULL.
483
+ * @returns a #DexFuture or %NULL
484
+ */
485
+ dup_future(): Future | null
486
+ release(): void
487
+ }
488
+
489
+ class Delayed extends Future {
490
+
491
+ // Own properties of Dex-1.Dex.Delayed
492
+
493
+ static name: string
494
+
495
+ // Constructors of Dex-1.Dex.Delayed
496
+
497
+ constructor(future: Future)
498
+ static new(future: Future): Delayed
499
+ }
500
+
501
+ interface Fiber {
502
+ }
503
+
504
+ class Fiber extends Future {
505
+
506
+ // Own properties of Dex-1.Dex.Fiber
507
+
508
+ static name: string
509
+ }
510
+
511
+ interface Future {
512
+
513
+ // Owm methods of Dex-1.Dex.Future
514
+
515
+ /**
516
+ * Suspends the current #DexFiber and resumes when `future` has completed.
517
+ *
518
+ * If `future` is completed when this function is called, the fiber will handle
519
+ * the result immediately.
520
+ *
521
+ * This function may only be called within a #DexFiber. To do otherwise will
522
+ * return %FALSE and `error` set to %DEX_ERROR_NO_FIBER.
523
+ *
524
+ * It is an error to call this function in a way that would cause
525
+ * intermediate code to become invalid when resuming the stack. For example,
526
+ * if a foreach-style function taking a callback was to suspend from the
527
+ * callback, undefined behavior may occur such as thread-local-storage
528
+ * having changed.
529
+ * @returns %TRUE if the future resolved, otherwise %FALSE and @error is set.
530
+ */
531
+ await(): boolean
532
+ /**
533
+ * Awaits on `future` and returns the gboolean result.
534
+ *
535
+ * If the result is not a #gboolean, `error` is set.
536
+ * @returns the #gboolean, or %FALSE and @error is set
537
+ */
538
+ await_boolean(): boolean
539
+ /**
540
+ * Awaits on `future` and returns the %G_TYPE_BOXED based result.
541
+ * @returns the boxed result, or %NULL and @error is set.
542
+ */
543
+ await_boxed(): any | null
544
+ /**
545
+ * Awaits on `future` and returns the result as an double.
546
+ *
547
+ * The resolved value must be of type %G_TYPE_INT or `error` is set.
548
+ * @returns an double, or 0 in case of failure and @error is set.
549
+ */
550
+ await_double(): number
551
+ /**
552
+ * Awaits on `future` and returns the enum result.
553
+ *
554
+ * If the result is not a %G_TYPE_ENUM, `error` is set.
555
+ * @returns the enum or 0 and @error is set.
556
+ */
557
+ await_enum(): number
558
+ /**
559
+ * Awaits on `future` and returns the flags result.
560
+ *
561
+ * If the result is not a %G_TYPE_FLAGS, `error` is set.
562
+ * @returns the flags or 0 and @error is set.
563
+ */
564
+ await_flags(): number
565
+ /**
566
+ * Awaits on `future` and returns the result as an float.
567
+ *
568
+ * The resolved value must be of type %G_TYPE_INT or `error` is set.
569
+ * @returns an float, or 0 in case of failure and @error is set.
570
+ */
571
+ await_float(): number
572
+ /**
573
+ * Awaits on `future` and returns the result as an int.
574
+ *
575
+ * The resolved value must be of type %G_TYPE_INT or `error` is set.
576
+ * @returns an int, or 0 in case of failure and @error is set.
577
+ */
578
+ await_int(): number
579
+ /**
580
+ * Awaits on `future` and returns the result as an int64.
581
+ *
582
+ * The resolved value must be of type %G_TYPE_INT64 or `error` is set.
583
+ * @returns an int64, or 0 in case of failure and @error is set.
584
+ */
585
+ await_int64(): number
586
+ /**
587
+ * Awaits on `future` and returns the #GObject-based result.
588
+ * @returns the object, or %NULL and @error is set.
589
+ */
590
+ await_object(): GObject.Object
591
+ /**
592
+ * Calls dex_await() and returns the value of g_value_get_pointer(),
593
+ * otherwise `error` is set if the future rejected.
594
+ * @returns a pointer or %NULL
595
+ */
596
+ await_pointer(): any | null
597
+ /**
598
+ * Awaits on `future` and returns the string result.
599
+ *
600
+ * If the result is not a %G_TYPE_STRING, `error` is set.
601
+ * @returns the string or %NULL and @error is set
602
+ */
603
+ await_string(): string | null
604
+ /**
605
+ * Awaits on `future` and returns the result as an uint.
606
+ *
607
+ * The resolved value must be of type %G_TYPE_INT or `error` is set.
608
+ * @returns an uint, or 0 in case of failure and @error is set.
609
+ */
610
+ await_uint(): number
611
+ /**
612
+ * Awaits on `future` and returns the result as an uint64.
613
+ *
614
+ * The resolved value must be of type %G_TYPE_INT64 or `error` is set.
615
+ * @returns an uint64, or 0 in case of failure and @error is set.
616
+ */
617
+ await_uint64(): number
618
+ /**
619
+ * Awaits on `future` and returns the %G_TYPE_VARIANT based result.
620
+ * @returns the variant result, or %NULL and @error is set.
621
+ */
622
+ await_variant(): GLib.Variant
623
+ /**
624
+ * Disowns a future, allowing it to run to completion even though there may
625
+ * be no observer interested in the futures completion or rejection.
626
+ */
627
+ disown(): void
628
+ get_name(): string | null
629
+ get_status(): FutureStatus
630
+ get_value(): any
631
+ }
632
+
633
+ class Future extends Object {
634
+
635
+ // Own properties of Dex-1.Dex.Future
636
+
637
+ static name: string
638
+
639
+ // Constructors of Dex-1.Dex.Future
640
+
641
+ /**
642
+ * Creates a new #DexFuture that resolves when all futures resolve.
643
+ *
644
+ * If any future rejects, the resulting #DexFuture also rejects immediately.
645
+ * @constructor
646
+ * @param futures an array of futures
647
+ * @returns a #DexFuture
648
+ */
649
+ static all_race(futures: Future[]): Future
650
+ /**
651
+ * Creates a new #DexFuture that resolves when all futures resolve.
652
+ *
653
+ * The resulting #DexFuture will not resolve or reject until all futures
654
+ * have either resolved or rejected.
655
+ * @constructor
656
+ * @param futures an array of futures
657
+ * @returns a #DexFuture
658
+ */
659
+ static all(futures: Future[]): Future
660
+ /**
661
+ * Creates a new #DexFuture that resolves when the first future resolves.
662
+ *
663
+ * If all futures reject, then the #DexFuture returned will also reject.
664
+ * @constructor
665
+ * @param futures an array of futures
666
+ * @returns a #DexFuture
667
+ */
668
+ static any(futures: Future[]): Future
669
+ /**
670
+ * Calls `callback` when `future` rejects.
671
+ *
672
+ * If `future` resolves, then `callback` will not be called.
673
+ * @constructor
674
+ * @param future a #DexFuture
675
+ * @param callback a callback to execute
676
+ * @returns a #DexFuture
677
+ */
678
+ static catch(future: Future, callback: FutureCallback): Future
679
+ /**
680
+ * Asynchronously calls `callback` when `future` rejects.
681
+ *
682
+ * This is similar to dex_future_catch() except that it will call
683
+ * `callback` multiple times as each returned #DexFuture rejects,
684
+ * allowing for infinite loops.
685
+ * @constructor
686
+ * @param future a #DexFuture
687
+ * @param callback a callback to execute
688
+ * @returns a #DexFuture
689
+ */
690
+ static catch_loop(future: Future, callback: FutureCallback): Future
691
+ /**
692
+ * Calls `callback` when `future` resolves or rejects.
693
+ * @constructor
694
+ * @param future a #DexFuture
695
+ * @param callback a callback to execute
696
+ * @returns a #DexFuture
697
+ */
698
+ static finally(future: Future, callback: FutureCallback): Future
699
+ /**
700
+ * Asynchronously calls `callback` when `future` rejects or resolves.
701
+ *
702
+ * This is similar to dex_future_finally() except that it will call
703
+ * `callback` multiple times as each returned #DexFuture rejects or resolves,
704
+ * allowing for infinite loops.
705
+ * @constructor
706
+ * @param future a #DexFuture
707
+ * @param callback a callback to execute
708
+ * @returns a #DexFuture
709
+ */
710
+ static finally_loop(future: Future, callback: FutureCallback): Future
711
+ /**
712
+ * Creates a new #DexFuture that resolves or rejects as soon as the
713
+ * first dependent future resolves or rejects, sharing the same result.
714
+ * @constructor
715
+ * @param futures an array of futures
716
+ * @returns a #DexFuture
717
+ */
718
+ static first(futures: Future[]): Future
719
+ /**
720
+ * Creates a new #DexFuture and resolves it with `v_bool`.
721
+ * @constructor
722
+ * @param v_bool the resolved value for the future
723
+ * @returns a resolved #DexFuture
724
+ */
725
+ static new_for_boolean(v_bool: boolean): Future
726
+ /**
727
+ * Creates a new #DexFuture and resolves it with `v_double`.
728
+ * @constructor
729
+ * @param v_double the resolved value for the future
730
+ * @returns a resolved #DexFuture
731
+ */
732
+ static new_for_double(v_double: number): Future
733
+ /**
734
+ * Creates a new rejected future using `errno_` as the value
735
+ * of errno for the GError.
736
+ *
737
+ * The resulting error domain will be %G_IO_ERROR.
738
+ * @constructor
739
+ * @param errno_ the `errno` to use for rejection
740
+ * @returns a rejected #DexFuture.
741
+ */
742
+ static new_for_errno(errno_: number): Future
743
+ /**
744
+ * Creates a read-only #DexFuture that has rejected.
745
+ * @constructor
746
+ * @param error a #GError
747
+ * @returns a #DexFuture
748
+ */
749
+ static new_for_error(error: GLib.Error): Future
750
+ /**
751
+ * Creates a new #DexFuture and resolves it with `v_float`.
752
+ * @constructor
753
+ * @param v_float the resolved value for the future
754
+ * @returns a resolved #DexFuture
755
+ */
756
+ static new_for_float(v_float: number): Future
757
+ /**
758
+ * Creates a new #DexFuture and resolves it with `v_int`.
759
+ * @constructor
760
+ * @param v_int the resolved value for the future
761
+ * @returns a resolved #DexFuture
762
+ */
763
+ static new_for_int(v_int: number): Future
764
+ /**
765
+ * Creates a new #DexFuture and resolves it with `v_int6`4.
766
+ * @constructor
767
+ * @param v_int64 the resolved value for the future
768
+ * @returns a resolved #DexFuture
769
+ */
770
+ static new_for_int64(v_int64: number): Future
771
+ /**
772
+ * Creates a new #DexFuture that is resolved with `value`.
773
+ * @constructor
774
+ * @param value the value
775
+ * @returns a resolved #DexFuture
776
+ */
777
+ static new_for_object(value: GObject.Object): Future
778
+ /**
779
+ * Creates a new #DexFuture that is resolved with `pointer` as a %G_TYPE_POINTER.
780
+ * @constructor
781
+ * @param pointer the resolved future value as a pointer
782
+ * @returns a resolved #DexFuture
783
+ */
784
+ static new_for_pointer(pointer: any | null): Future
785
+ /**
786
+ * Creates a new #DexFuture and resolves it with `string`.
787
+ * @constructor
788
+ * @param string the resolved value for the future
789
+ * @returns a resolved #DexFuture
790
+ */
791
+ static new_for_string(string: string | null): Future
792
+ /**
793
+ * Creates a new #DexFuture and resolves it with `v_uint`.
794
+ * @constructor
795
+ * @param v_uint the resolved value for the future
796
+ * @returns a resolved #DexFuture
797
+ */
798
+ static new_for_uint(v_uint: number): Future
799
+ /**
800
+ * Creates a new #DexFuture and resolves it with `v_uint6`4.
801
+ * @constructor
802
+ * @param v_uint64 the resolved value for the future
803
+ * @returns a resolved #DexFuture
804
+ */
805
+ static new_for_uint64(v_uint64: number): Future
806
+ /**
807
+ * Creates a read-only #DexFuture that has resolved.
808
+ * @constructor
809
+ * @param value the resolved #GValue
810
+ * @returns a #DexFuture
811
+ */
812
+ static new_for_value(value: any): Future
813
+ /**
814
+ * Creates an infinite future that will never resolve or reject. This can
815
+ * be useful when you want to mock a situation of "run forever" unless
816
+ * another future rejects or resolves.
817
+ * @constructor
818
+ * @returns a #DexFuture that will never complete or reject
819
+ */
820
+ static new_infinite(): Future
821
+ /**
822
+ * Creates a new #DexFuture that is resolved with `value`.
823
+ * @constructor
824
+ * @param value the value
825
+ * @returns a resolved #DexFuture
826
+ */
827
+ static new_take_object(value: GObject.Object): Future
828
+ /**
829
+ * Creates a new #DexFuture and resolves it with `string`.
830
+ * @constructor
831
+ * @param string the resolved value for the future
832
+ * @returns a resolved #DexFuture
833
+ */
834
+ static new_take_string(string: string | null): Future
835
+ /**
836
+ * Calls `callback` when `future` resolves.
837
+ *
838
+ * If `future` rejects, then `callback` will not be called.
839
+ * @constructor
840
+ * @param future a #DexFuture
841
+ * @param callback a callback to execute
842
+ * @returns a #DexFuture
843
+ */
844
+ static then(future: Future, callback: FutureCallback): Future
845
+ /**
846
+ * Asynchronously calls `callback` when `future` resolves.
847
+ *
848
+ * This is similar to dex_future_then() except that it will call
849
+ * `callback` multiple times as each returned #DexFuture resolves or
850
+ * rejects, allowing for infinite loops.
851
+ * @constructor
852
+ * @param future a #DexFuture
853
+ * @param callback a callback to execute
854
+ * @returns a #DexFuture
855
+ */
856
+ static then_loop(future: Future, callback: FutureCallback): Future
857
+ }
858
+
859
+ interface FutureSet {
860
+
861
+ // Owm methods of Dex-1.Dex.FutureSet
862
+
863
+ /**
864
+ * Gets a #DexFuture that was used to produce the result of `future_set`.
865
+ *
866
+ * Use dex_future_set_get_size() to determine the number of #DexFuture that
867
+ * are contained within the #DexFutureSet.
868
+ * @param position
869
+ * @returns a #DexFuture
870
+ */
871
+ get_future_at(position: number): Future
872
+ /**
873
+ * Gets the number of futures associated with the #DexFutureSet. You may
874
+ * use dex_future_set_get_future_at() to obtain the individual #DexFuture.
875
+ * @returns the number of #DexFuture in @future_set.
876
+ */
877
+ get_size(): number
878
+ /**
879
+ * Gets the result from a #DexFuture that is part of the
880
+ * #DexFutureSet.
881
+ * @param position the #DexFuture position within the set
882
+ * @returns a #GValue if successful; otherwise %NULL and @error is set.
883
+ */
884
+ get_value_at(position: number): any
885
+ }
886
+
887
+ class FutureSet extends Future {
888
+
889
+ // Own properties of Dex-1.Dex.FutureSet
890
+
891
+ static name: string
892
+ }
893
+
894
+ interface MainScheduler {
895
+ }
896
+
897
+ class MainScheduler extends Scheduler {
898
+
899
+ // Own properties of Dex-1.Dex.MainScheduler
900
+
901
+ static name: string
902
+ }
903
+
904
+ interface Object {
905
+
906
+ // Owm methods of Dex-1.Dex.Object
907
+
908
+ /**
909
+ * Acquires a reference on the given object, and increases its reference count by one.
910
+ * @returns the object with its reference count increased
911
+ */
912
+ ref(): Object
913
+ /**
914
+ * Releases a reference on the given object, and decreases its reference count by one.
915
+ *
916
+ * If it was the last reference, the resources associated to the instance are freed.
917
+ */
918
+ unref(): void
919
+ }
920
+
921
+ /**
922
+ * `DexObject` is the basic building block of types defined within
923
+ * libdex. Futures, Schedulers, and Channels all inherit from DexObject
924
+ * which provides features like thread-safe weak pointers and memory
925
+ * management operations.
926
+ *
927
+ * Objects that are integrating with GIO instead inherit from their
928
+ * natural type in GIO.
929
+ * @class
930
+ */
931
+ class Object {
932
+
933
+ // Own properties of Dex-1.Dex.Object
934
+
935
+ static name: string
936
+ }
937
+
938
+ interface Promise {
939
+
940
+ // Owm methods of Dex-1.Dex.Promise
941
+
942
+ /**
943
+ * Gets a #GCancellable that will cancel when the promise has
944
+ * been discarded (and therefore result no longer necessary).
945
+ *
946
+ * This is useful when manually implementing wrappers around various
947
+ * #GAsyncReadyCallback based API.
948
+ *
949
+ * If `promise` was created with dex_promise_new(), then %NULL is returned.
950
+ * @returns a #GCancellable or %NULL
951
+ */
952
+ get_cancellable(): Gio.Cancellable | null
953
+ /**
954
+ * Marks the promise as rejected, indicating a failure.
955
+ * @param error a #GError
956
+ */
957
+ reject(error: GLib.Error): void
958
+ /**
959
+ * Sets the result for a #DexPromise.
960
+ * @param value a #GValue containing the resolved value
961
+ */
962
+ resolve(value: any): void
963
+ resolve_boolean(value: boolean): void
964
+ resolve_double(value: number): void
965
+ resolve_float(value: number): void
966
+ resolve_int(value: number): void
967
+ resolve_int64(value: number): void
968
+ resolve_long(value: number): void
969
+ resolve_object(object: any | null): void
970
+ resolve_string(value: string | null): void
971
+ resolve_uint(value: number): void
972
+ resolve_uint64(value: number): void
973
+ resolve_ulong(value: number): void
974
+ }
975
+
976
+ class Promise extends Future {
977
+
978
+ // Own properties of Dex-1.Dex.Promise
979
+
980
+ static name: string
981
+
982
+ // Constructors of Dex-1.Dex.Promise
983
+
984
+ constructor()
985
+ static new(): Promise
986
+ /**
987
+ * Creates a new #DexPromise that can propagate cancellation if the
988
+ * promise is discarded.
989
+ *
990
+ * This can be used to plumb cancellation between promises and
991
+ * #GAsyncReadyCallback based APIs.
992
+ * @constructor
993
+ * @returns a #DexPromise
994
+ */
995
+ static new_cancellable(): Promise
996
+ }
997
+
998
+ interface Scheduler {
999
+
1000
+ // Owm methods of Dex-1.Dex.Scheduler
1001
+
1002
+ /**
1003
+ * Gets the default main context for a scheduler.
1004
+ *
1005
+ * This may be a different value depending on the calling thread.
1006
+ *
1007
+ * For example, calling this on the #DexThreadPoolScheduer from outside
1008
+ * a worker thread may result in getting a shared #GMainContext for the
1009
+ * process.
1010
+ *
1011
+ * However, calling from a worker thread may give you a #GMainContext
1012
+ * specifically for that thread.
1013
+ * @returns a #GMainContext
1014
+ */
1015
+ get_main_context(): GLib.MainContext
1016
+ /**
1017
+ * Queues `func` to run on `scheduler`.
1018
+ * @param func the function callback
1019
+ */
1020
+ push(func: SchedulerFunc): void
1021
+ /**
1022
+ * Request `scheduler` to spawn a #DexFiber.
1023
+ *
1024
+ * The fiber will have it's own stack and cooperatively schedules among other
1025
+ * fibers sharing the schaeduler.
1026
+ *
1027
+ * If `stack_size` is 0, it will set to a sensible default. Otherwise, it is
1028
+ * rounded up to the nearest page size.
1029
+ * @param stack_size stack size in bytes or 0
1030
+ * @returns a #DexFuture that will resolve or reject when @func completes (or it's resulting #DexFuture completes).
1031
+ */
1032
+ spawn(stack_size: number): Future
1033
+ }
1034
+
1035
+ class Scheduler extends Object {
1036
+
1037
+ // Own properties of Dex-1.Dex.Scheduler
1038
+
1039
+ static name: string
1040
+
1041
+ // Constructors of Dex-1.Dex.Scheduler
1042
+
1043
+ /**
1044
+ * Gets the default scheduler for the process.
1045
+ *
1046
+ * The default scheduler executes tasks within the default #GMainContext.
1047
+ * Typically that is the main thread of the application.
1048
+ * @returns a #DexScheduler
1049
+ */
1050
+ static get_default(): Scheduler
1051
+ /**
1052
+ * Gets the default scheduler for the thread.
1053
+ * @returns a #DexScheduler or %NULL
1054
+ */
1055
+ static get_thread_default(): Scheduler | null
1056
+ /**
1057
+ * Gets the thread default scheduler with the reference count incremented.
1058
+ * @returns a #DexScheduler or %NULL
1059
+ */
1060
+ static ref_thread_default(): Scheduler | null
1061
+ }
1062
+
1063
+ interface StaticFuture {
1064
+ }
1065
+
1066
+ class StaticFuture extends Future {
1067
+
1068
+ // Own properties of Dex-1.Dex.StaticFuture
1069
+
1070
+ static name: string
1071
+ }
1072
+
1073
+ interface ThreadPoolScheduler {
1074
+ }
1075
+
1076
+ class ThreadPoolScheduler extends Scheduler {
1077
+
1078
+ // Own properties of Dex-1.Dex.ThreadPoolScheduler
1079
+
1080
+ static name: string
1081
+
1082
+ // Constructors of Dex-1.Dex.ThreadPoolScheduler
1083
+
1084
+ /**
1085
+ * Creates a new #DexScheduler that executes work items on a thread pool.
1086
+ * @constructor
1087
+ * @returns a #DexThreadPoolScheduler
1088
+ */
1089
+ constructor()
1090
+ /**
1091
+ * Creates a new #DexScheduler that executes work items on a thread pool.
1092
+ * @constructor
1093
+ * @returns a #DexThreadPoolScheduler
1094
+ */
1095
+ static new(): ThreadPoolScheduler
1096
+ /**
1097
+ * Gets the default thread pool scheduler for the instance.
1098
+ *
1099
+ * This function is useful to allow programs and libraries to share
1100
+ * an off-main-thread scheduler without having to coordinate on where
1101
+ * the scheduler instance is created or owned.
1102
+ * @returns a #DexScheduler
1103
+ */
1104
+ static get_default(): Scheduler
1105
+ }
1106
+
1107
+ interface Timeout {
1108
+
1109
+ // Owm methods of Dex-1.Dex.Timeout
1110
+
1111
+ postpone_until(deadline: number): void
1112
+ }
1113
+
1114
+ class Timeout extends Future {
1115
+
1116
+ // Own properties of Dex-1.Dex.Timeout
1117
+
1118
+ static name: string
1119
+
1120
+ // Constructors of Dex-1.Dex.Timeout
1121
+
1122
+ static new_deadline(deadline: number): Timeout
1123
+ static new_msec(msec: number): Timeout
1124
+ static new_seconds(seconds: number): Timeout
1125
+ static new_usec(usec: number): Timeout
1126
+ }
1127
+
1128
+ interface UnixSignal {
1129
+
1130
+ // Owm methods of Dex-1.Dex.UnixSignal
1131
+
1132
+ get_signum(): number
1133
+ }
1134
+
1135
+ class UnixSignal extends Future {
1136
+
1137
+ // Own properties of Dex-1.Dex.UnixSignal
1138
+
1139
+ static name: string
1140
+
1141
+ // Constructors of Dex-1.Dex.UnixSignal
1142
+
1143
+ /**
1144
+ * Creates a new #DexUnixSignal that completes when `signum` is delivered
1145
+ * to the process.
1146
+ *
1147
+ * `signum` must be one of SIGHUP, SIGINT, SIGTERM, SIGUSR1, SIGUSR2, or
1148
+ * SIGWINCH.
1149
+ *
1150
+ * This API is only supported on UNIX-like systems.
1151
+ * @constructor
1152
+ * @param signum a unix signal number
1153
+ * @returns a new #DexFuture
1154
+ */
1155
+ constructor(signum: number)
1156
+ /**
1157
+ * Creates a new #DexUnixSignal that completes when `signum` is delivered
1158
+ * to the process.
1159
+ *
1160
+ * `signum` must be one of SIGHUP, SIGINT, SIGTERM, SIGUSR1, SIGUSR2, or
1161
+ * SIGWINCH.
1162
+ *
1163
+ * This API is only supported on UNIX-like systems.
1164
+ * @constructor
1165
+ * @param signum a unix signal number
1166
+ * @returns a new #DexFuture
1167
+ */
1168
+ static new(signum: number): UnixSignal
1169
+ }
1170
+
1171
+ interface AioContext {
1172
+ }
1173
+
1174
+ class AioContext {
1175
+
1176
+ // Own properties of Dex-1.Dex.AioContext
1177
+
1178
+ static name: string
1179
+ }
1180
+
1181
+ interface AsyncPairInfo {
1182
+
1183
+ // Own fields of Dex-1.Dex.AsyncPairInfo
1184
+
1185
+ async: any
1186
+ finish: any
1187
+ return_type: GObject.GType
1188
+ }
1189
+
1190
+ class AsyncPairInfo {
1191
+
1192
+ // Own properties of Dex-1.Dex.AsyncPairInfo
1193
+
1194
+ static name: string
1195
+ }
1196
+
1197
+ interface AsyncResultClass {
1198
+
1199
+ // Own fields of Dex-1.Dex.AsyncResultClass
1200
+
1201
+ parent_class: GObject.ObjectClass
1202
+ }
1203
+
1204
+ abstract class AsyncResultClass {
1205
+
1206
+ // Own properties of Dex-1.Dex.AsyncResultClass
1207
+
1208
+ static name: string
1209
+ }
1210
+
1211
+ /**
1212
+ * Name of the imported GIR library
1213
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
1214
+ */
1215
+ const __name__: string
1216
+ /**
1217
+ * Version of the imported GIR library
1218
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
1219
+ */
1220
+ const __version__: string
1221
+ }
1222
+
1223
+ export default Dex;
1224
+ // END