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