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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/rest-1.0.d.ts ADDED
@@ -0,0 +1,1418 @@
1
+
2
+ /*
3
+ * Type Definitions for Gjs (https://gjs.guide/)
4
+ *
5
+ * These type definitions are automatically generated, do not edit them by hand.
6
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gjs
7
+ */
8
+ /**
9
+ * Rest-1.0
10
+ */
11
+
12
+ import type Soup from '@girs/soup-3.0';
13
+ import type Gio from '@girs/gio-2.0';
14
+ import type GObject from '@girs/gobject-2.0';
15
+ import type GLib from '@girs/glib-2.0';
16
+
17
+ export namespace Rest {
18
+
19
+ enum MemoryUse {
20
+ /**
21
+ * the memory block can be assumed to always exist for the
22
+ * lifetime of the parameter, #RestParam will use it directly.
23
+ */
24
+ STATIC,
25
+ /**
26
+ * #RestParam will take ownership of the memory block, and
27
+ * g_free() it when it isn't used.
28
+ */
29
+ TAKE,
30
+ /**
31
+ * #RestParam will make a copy of the memory block.
32
+ */
33
+ COPY,
34
+ }
35
+ enum OAuth2Error {
36
+ NO_REFRESH_TOKEN,
37
+ ACCESS_TOKEN_EXPIRED,
38
+ }
39
+ /**
40
+ * Error domain used when returning errors from #RestProxyCall.
41
+ */
42
+ enum ProxyCallError {
43
+ /**
44
+ * the method call failed
45
+ */
46
+ FAILED,
47
+ }
48
+ /**
49
+ * Error domain used when returning errors from a #RestProxy.
50
+ */
51
+ enum ProxyError {
52
+ /**
53
+ * Cancelled
54
+ */
55
+ CANCELLED,
56
+ /**
57
+ * Resolution
58
+ */
59
+ RESOLUTION,
60
+ /**
61
+ * Connection
62
+ */
63
+ CONNECTION,
64
+ /**
65
+ * SSL
66
+ */
67
+ SSL,
68
+ /**
69
+ * Input/Output
70
+ */
71
+ IO,
72
+ /**
73
+ * Failure
74
+ */
75
+ FAILED,
76
+ /**
77
+ * Invalid URL
78
+ */
79
+ URL_INVALID,
80
+ /**
81
+ * URL requires binding
82
+ */
83
+ BINDING_REQUIRED,
84
+ /**
85
+ * HTTP/Multiple choices
86
+ */
87
+ HTTP_MULTIPLE_CHOICES,
88
+ /**
89
+ * HTTP/Moved permanently
90
+ */
91
+ HTTP_MOVED_PERMANENTLY,
92
+ /**
93
+ * HTTP/Found
94
+ */
95
+ HTTP_FOUND,
96
+ /**
97
+ * HTTP/See other
98
+ */
99
+ HTTP_SEE_OTHER,
100
+ /**
101
+ * HTTP/Not modified
102
+ */
103
+ HTTP_NOT_MODIFIED,
104
+ /**
105
+ * HTTP/Use proxy
106
+ */
107
+ HTTP_USE_PROXY,
108
+ /**
109
+ * HTTP/306
110
+ */
111
+ HTTP_THREEOHSIX,
112
+ /**
113
+ * HTTP/Temporary redirect
114
+ */
115
+ HTTP_TEMPORARY_REDIRECT,
116
+ /**
117
+ * HTTP/Bad request
118
+ */
119
+ HTTP_BAD_REQUEST,
120
+ /**
121
+ * HTTP/Unauthorized
122
+ */
123
+ HTTP_UNAUTHORIZED,
124
+ /**
125
+ * HTTP/402
126
+ */
127
+ HTTP_FOUROHTWO,
128
+ /**
129
+ * HTTP/Forbidden
130
+ */
131
+ HTTP_FORBIDDEN,
132
+ /**
133
+ * HTTP/Not found
134
+ */
135
+ HTTP_NOT_FOUND,
136
+ /**
137
+ * HTTP/Method not allowed
138
+ */
139
+ HTTP_METHOD_NOT_ALLOWED,
140
+ /**
141
+ * HTTP/Not acceptable
142
+ */
143
+ HTTP_NOT_ACCEPTABLE,
144
+ /**
145
+ * HTTP/Proxy authentication required
146
+ */
147
+ HTTP_PROXY_AUTHENTICATION_REQUIRED,
148
+ /**
149
+ * HTTP/Request timeout
150
+ */
151
+ HTTP_REQUEST_TIMEOUT,
152
+ /**
153
+ * HTTP/Conflict
154
+ */
155
+ HTTP_CONFLICT,
156
+ /**
157
+ * HTTP/Gone
158
+ */
159
+ HTTP_GONE,
160
+ /**
161
+ * HTTP/Length required
162
+ */
163
+ HTTP_LENGTH_REQUIRED,
164
+ /**
165
+ * HTTP/Precondition failed
166
+ */
167
+ HTTP_PRECONDITION_FAILED,
168
+ /**
169
+ * HTTP/Request entity too large
170
+ */
171
+ HTTP_REQUEST_ENTITY_TOO_LARGE,
172
+ /**
173
+ * HTTP/Request URI too long
174
+ */
175
+ HTTP_REQUEST_URI_TOO_LONG,
176
+ /**
177
+ * HTTP/Unsupported media type
178
+ */
179
+ HTTP_UNSUPPORTED_MEDIA_TYPE,
180
+ /**
181
+ * HTTP/Requested range not satisfiable
182
+ */
183
+ HTTP_REQUESTED_RANGE_NOT_SATISFIABLE,
184
+ /**
185
+ * HTTP/Expectation failed
186
+ */
187
+ HTTP_EXPECTATION_FAILED,
188
+ /**
189
+ * HTTP/Internal server error
190
+ */
191
+ HTTP_INTERNAL_SERVER_ERROR,
192
+ /**
193
+ * HTTP/Not implemented
194
+ */
195
+ HTTP_NOT_IMPLEMENTED,
196
+ /**
197
+ * HTTP/Bad gateway
198
+ */
199
+ HTTP_BAD_GATEWAY,
200
+ /**
201
+ * HTTP/Service unavailable
202
+ */
203
+ HTTP_SERVICE_UNAVAILABLE,
204
+ /**
205
+ * HTTP/Gateway timeout
206
+ */
207
+ HTTP_GATEWAY_TIMEOUT,
208
+ /**
209
+ * HTTP/Version not supported
210
+ */
211
+ HTTP_HTTP_VERSION_NOT_SUPPORTED,
212
+ }
213
+ function oauth2_error_quark(): GLib.Quark
214
+ function proxy_call_error_quark(): GLib.Quark
215
+ function proxy_error_quark(): GLib.Quark
216
+ /**
217
+ * Creates a random string from a given alphabeth with length `length`
218
+ * @param length the length of the random string
219
+ * @returns a random string
220
+ */
221
+ function random_string(length: number): string | null
222
+ interface ProxyCallAsyncCallback {
223
+ (call: ProxyCall, error: GLib.Error, weak_object: GObject.Object, userdata: any | null): void
224
+ }
225
+ interface ProxyCallContinuousCallback {
226
+ (call: ProxyCall, buf: string | null, len: number, error: GLib.Error, weak_object: GObject.Object, userdata: any | null): void
227
+ }
228
+ interface ProxyCallUploadCallback {
229
+ (call: ProxyCall, total: number, uploaded: number, error: GLib.Error, weak_object: GObject.Object, userdata: any | null): void
230
+ }
231
+ module OAuth2Proxy {
232
+
233
+ // Constructor properties interface
234
+
235
+ interface ConstructorProperties extends Proxy.ConstructorProperties {
236
+
237
+ // Own constructor properties of Rest-1.0.Rest.OAuth2Proxy
238
+
239
+ access_token?: string | null
240
+ auth_url?: string | null
241
+ client_id?: string | null
242
+ client_secret?: string | null
243
+ expiration_date?: GLib.DateTime | null
244
+ redirect_uri?: string | null
245
+ refresh_token?: string | null
246
+ token_url?: string | null
247
+ }
248
+
249
+ }
250
+
251
+ interface OAuth2Proxy {
252
+
253
+ // Own properties of Rest-1.0.Rest.OAuth2Proxy
254
+
255
+ access_token: string | null
256
+ auth_url: string | null
257
+ client_id: string | null
258
+ client_secret: string | null
259
+ expiration_date: GLib.DateTime
260
+ redirect_uri: string | null
261
+ refresh_token: string | null
262
+ token_url: string | null
263
+
264
+ // Own fields of Rest-1.0.Rest.OAuth2Proxy
265
+
266
+ parent_instance: Proxy & GObject.Object
267
+
268
+ // Owm methods of Rest-1.0.Rest.OAuth2Proxy
269
+
270
+ build_authorization_url(code_challenge: string | null, scope: string | null): [ /* returnType */ string | null, /* state */ string | null ]
271
+ fetch_access_token_async(authorization_code: string | null, code_verifier: string | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
272
+ fetch_access_token_finish(result: Gio.AsyncResult): boolean
273
+ get_access_token(): string | null
274
+ get_auth_url(): string | null
275
+ get_client_id(): string | null
276
+ get_client_secret(): string | null
277
+ get_expiration_date(): GLib.DateTime
278
+ get_redirect_uri(): string | null
279
+ get_refresh_token(): string | null
280
+ get_token_url(): string | null
281
+ refresh_access_token(): boolean
282
+ refresh_access_token_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
283
+ refresh_access_token_finish(result: Gio.AsyncResult): boolean
284
+ set_access_token(access_token: string | null): void
285
+ set_auth_url(tokenurl: string | null): void
286
+ set_client_id(client_id: string | null): void
287
+ set_client_secret(client_secret: string | null): void
288
+ set_expiration_date(expiration_date: GLib.DateTime): void
289
+ set_redirect_uri(redirect_uri: string | null): void
290
+ set_refresh_token(refresh_token: string | null): void
291
+ set_token_url(tokenurl: string | null): void
292
+
293
+ // Own virtual methods of Rest-1.0.Rest.OAuth2Proxy
294
+
295
+ vfunc_parse_access_token(payload: GLib.Bytes, task: Gio.Task): void
296
+
297
+ // Class property signals of Rest-1.0.Rest.OAuth2Proxy
298
+
299
+ connect(sigName: "notify::access-token", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
300
+ connect_after(sigName: "notify::access-token", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
301
+ emit(sigName: "notify::access-token", ...args: any[]): void
302
+ connect(sigName: "notify::auth-url", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
303
+ connect_after(sigName: "notify::auth-url", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
304
+ emit(sigName: "notify::auth-url", ...args: any[]): void
305
+ connect(sigName: "notify::client-id", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
306
+ connect_after(sigName: "notify::client-id", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
307
+ emit(sigName: "notify::client-id", ...args: any[]): void
308
+ connect(sigName: "notify::client-secret", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
309
+ connect_after(sigName: "notify::client-secret", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
310
+ emit(sigName: "notify::client-secret", ...args: any[]): void
311
+ connect(sigName: "notify::expiration-date", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
312
+ connect_after(sigName: "notify::expiration-date", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
313
+ emit(sigName: "notify::expiration-date", ...args: any[]): void
314
+ connect(sigName: "notify::redirect-uri", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
315
+ connect_after(sigName: "notify::redirect-uri", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
316
+ emit(sigName: "notify::redirect-uri", ...args: any[]): void
317
+ connect(sigName: "notify::refresh-token", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
318
+ connect_after(sigName: "notify::refresh-token", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
319
+ emit(sigName: "notify::refresh-token", ...args: any[]): void
320
+ connect(sigName: "notify::token-url", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
321
+ connect_after(sigName: "notify::token-url", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
322
+ emit(sigName: "notify::token-url", ...args: any[]): void
323
+ connect(sigName: "notify::binding-required", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
324
+ connect_after(sigName: "notify::binding-required", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
325
+ emit(sigName: "notify::binding-required", ...args: any[]): void
326
+ connect(sigName: "notify::disable-cookies", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
327
+ connect_after(sigName: "notify::disable-cookies", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
328
+ emit(sigName: "notify::disable-cookies", ...args: any[]): void
329
+ connect(sigName: "notify::password", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
330
+ connect_after(sigName: "notify::password", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
331
+ emit(sigName: "notify::password", ...args: any[]): void
332
+ connect(sigName: "notify::ssl-ca-file", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
333
+ connect_after(sigName: "notify::ssl-ca-file", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
334
+ emit(sigName: "notify::ssl-ca-file", ...args: any[]): void
335
+ connect(sigName: "notify::ssl-strict", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
336
+ connect_after(sigName: "notify::ssl-strict", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
337
+ emit(sigName: "notify::ssl-strict", ...args: any[]): void
338
+ connect(sigName: "notify::url-format", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
339
+ connect_after(sigName: "notify::url-format", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
340
+ emit(sigName: "notify::url-format", ...args: any[]): void
341
+ connect(sigName: "notify::user-agent", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
342
+ connect_after(sigName: "notify::user-agent", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
343
+ emit(sigName: "notify::user-agent", ...args: any[]): void
344
+ connect(sigName: "notify::username", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
345
+ connect_after(sigName: "notify::username", callback: (($obj: OAuth2Proxy, pspec: GObject.ParamSpec) => void)): number
346
+ emit(sigName: "notify::username", ...args: any[]): void
347
+ connect(sigName: string, callback: (...args: any[]) => void): number
348
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
349
+ emit(sigName: string, ...args: any[]): void
350
+ disconnect(id: number): void
351
+ }
352
+
353
+ class OAuth2Proxy extends Proxy {
354
+
355
+ // Own properties of Rest-1.0.Rest.OAuth2Proxy
356
+
357
+ static name: string
358
+ static $gtype: GObject.GType<OAuth2Proxy>
359
+
360
+ // Constructors of Rest-1.0.Rest.OAuth2Proxy
361
+
362
+ constructor(config?: OAuth2Proxy.ConstructorProperties)
363
+ /**
364
+ * Create a new #RestOAuth2Proxy.
365
+ * @constructor
366
+ * @param authurl
367
+ * @param tokenurl
368
+ * @param redirecturl
369
+ * @param client_id
370
+ * @param client_secret
371
+ * @param baseurl
372
+ * @returns a newly created #RestOAuth2Proxy
373
+ */
374
+ constructor(authurl: string | null, tokenurl: string | null, redirecturl: string | null, client_id: string | null, client_secret: string | null, baseurl: string | null)
375
+ /**
376
+ * Create a new #RestOAuth2Proxy.
377
+ * @constructor
378
+ * @param authurl
379
+ * @param tokenurl
380
+ * @param redirecturl
381
+ * @param client_id
382
+ * @param client_secret
383
+ * @param baseurl
384
+ * @returns a newly created #RestOAuth2Proxy
385
+ */
386
+ static new(authurl: string | null, tokenurl: string | null, redirecturl: string | null, client_id: string | null, client_secret: string | null, baseurl: string | null): OAuth2Proxy
387
+
388
+ // Overloads of new
389
+
390
+ /**
391
+ * Create a new #RestProxy for the specified endpoint `url_format,` using the
392
+ * "GET" method.
393
+ *
394
+ * Set `binding_required` to %TRUE if the URL contains string formatting
395
+ * operations (for example "http://foo.com/%<!-- -->s". These must be expanded
396
+ * using rest_proxy_bind() before invoking the proxy.
397
+ * @constructor
398
+ * @param url_format the endpoint URL
399
+ * @param binding_required whether the URL needs to be bound before calling
400
+ * @returns A new #RestProxy.
401
+ */
402
+ static new(url_format: string | null, binding_required: boolean): Proxy
403
+ _init(config?: OAuth2Proxy.ConstructorProperties): void
404
+ }
405
+
406
+ module OAuth2ProxyCall {
407
+
408
+ // Constructor properties interface
409
+
410
+ interface ConstructorProperties extends ProxyCall.ConstructorProperties {
411
+ }
412
+
413
+ }
414
+
415
+ interface OAuth2ProxyCall {
416
+
417
+ // Own fields of Rest-1.0.Rest.OAuth2ProxyCall
418
+
419
+ parent_instance: ProxyCall & GObject.Object
420
+
421
+ // Class property signals of Rest-1.0.Rest.OAuth2ProxyCall
422
+
423
+ connect(sigName: "notify::proxy", callback: (($obj: OAuth2ProxyCall, pspec: GObject.ParamSpec) => void)): number
424
+ connect_after(sigName: "notify::proxy", callback: (($obj: OAuth2ProxyCall, pspec: GObject.ParamSpec) => void)): number
425
+ emit(sigName: "notify::proxy", ...args: any[]): void
426
+ connect(sigName: string, callback: (...args: any[]) => void): number
427
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
428
+ emit(sigName: string, ...args: any[]): void
429
+ disconnect(id: number): void
430
+ }
431
+
432
+ class OAuth2ProxyCall extends ProxyCall {
433
+
434
+ // Own properties of Rest-1.0.Rest.OAuth2ProxyCall
435
+
436
+ static name: string
437
+ static $gtype: GObject.GType<OAuth2ProxyCall>
438
+
439
+ // Constructors of Rest-1.0.Rest.OAuth2ProxyCall
440
+
441
+ constructor(config?: OAuth2ProxyCall.ConstructorProperties)
442
+ _init(config?: OAuth2ProxyCall.ConstructorProperties): void
443
+ }
444
+
445
+ module Proxy {
446
+
447
+ // Constructor properties interface
448
+
449
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
450
+
451
+ // Own constructor properties of Rest-1.0.Rest.Proxy
452
+
453
+ binding_required?: boolean | null
454
+ disable_cookies?: boolean | null
455
+ password?: string | null
456
+ ssl_ca_file?: string | null
457
+ ssl_strict?: boolean | null
458
+ url_format?: string | null
459
+ user_agent?: string | null
460
+ username?: string | null
461
+ }
462
+
463
+ }
464
+
465
+ interface Proxy {
466
+
467
+ // Own properties of Rest-1.0.Rest.Proxy
468
+
469
+ binding_required: boolean
470
+ readonly disable_cookies: boolean
471
+ password: string | null
472
+ ssl_ca_file: string | null
473
+ ssl_strict: boolean
474
+ url_format: string | null
475
+ user_agent: string | null
476
+ username: string | null
477
+
478
+ // Own fields of Rest-1.0.Rest.Proxy
479
+
480
+ parent_instance: GObject.Object
481
+
482
+ // Owm methods of Rest-1.0.Rest.Proxy
483
+
484
+ /**
485
+ * This method can be used to add specific features to the #SoupSession objects
486
+ * that are used by librest for its HTTP connections. For example, if one needs
487
+ * extensive control over the cookies which are used for the REST HTTP
488
+ * communication, it's possible to get full access to libsoup cookie API by
489
+ * using
490
+ *
491
+ * <programlisting>
492
+ * RestProxy *proxy = g_object_new(REST_TYPE_PROXY,
493
+ * "url-format", url,
494
+ * "disable-cookies", TRUE,
495
+ * NULL);
496
+ * SoupSessionFeature *cookie_jar = SOUP_SESSION_FEATURE(soup_cookie_jar_new ());
497
+ * rest_proxy_add_soup_feature(proxy, cookie_jar);
498
+ * </programlisting>
499
+ * @param feature A #SoupSessionFeature
500
+ */
501
+ add_soup_feature(feature: Soup.SessionFeature): void
502
+ get_user_agent(): string | null
503
+ /**
504
+ * Create a new #RestProxyCall for making a call to the web service. This call
505
+ * is one-shot and should not be re-used for making multiple calls.
506
+ * @returns a new #RestProxyCall.
507
+ */
508
+ new_call(): ProxyCall
509
+ set_user_agent(user_agent: string | null): void
510
+
511
+ // Own virtual methods of Rest-1.0.Rest.Proxy
512
+
513
+ vfunc_authenticate(auth: ProxyAuth, retrying: boolean): boolean
514
+ /**
515
+ * Create a new #RestProxyCall for making a call to the web service. This call
516
+ * is one-shot and should not be re-used for making multiple calls.
517
+ * @virtual
518
+ * @returns a new #RestProxyCall.
519
+ */
520
+ vfunc_new_call(): ProxyCall
521
+
522
+ // Class property signals of Rest-1.0.Rest.Proxy
523
+
524
+ connect(sigName: "notify::binding-required", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
525
+ connect_after(sigName: "notify::binding-required", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
526
+ emit(sigName: "notify::binding-required", ...args: any[]): void
527
+ connect(sigName: "notify::disable-cookies", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
528
+ connect_after(sigName: "notify::disable-cookies", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
529
+ emit(sigName: "notify::disable-cookies", ...args: any[]): void
530
+ connect(sigName: "notify::password", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
531
+ connect_after(sigName: "notify::password", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
532
+ emit(sigName: "notify::password", ...args: any[]): void
533
+ connect(sigName: "notify::ssl-ca-file", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
534
+ connect_after(sigName: "notify::ssl-ca-file", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
535
+ emit(sigName: "notify::ssl-ca-file", ...args: any[]): void
536
+ connect(sigName: "notify::ssl-strict", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
537
+ connect_after(sigName: "notify::ssl-strict", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
538
+ emit(sigName: "notify::ssl-strict", ...args: any[]): void
539
+ connect(sigName: "notify::url-format", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
540
+ connect_after(sigName: "notify::url-format", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
541
+ emit(sigName: "notify::url-format", ...args: any[]): void
542
+ connect(sigName: "notify::user-agent", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
543
+ connect_after(sigName: "notify::user-agent", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
544
+ emit(sigName: "notify::user-agent", ...args: any[]): void
545
+ connect(sigName: "notify::username", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
546
+ connect_after(sigName: "notify::username", callback: (($obj: Proxy, pspec: GObject.ParamSpec) => void)): number
547
+ emit(sigName: "notify::username", ...args: any[]): void
548
+ connect(sigName: string, callback: (...args: any[]) => void): number
549
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
550
+ emit(sigName: string, ...args: any[]): void
551
+ disconnect(id: number): void
552
+ }
553
+
554
+ /**
555
+ * #RestProxy has no publicly available members.
556
+ * @class
557
+ */
558
+ class Proxy extends GObject.Object {
559
+
560
+ // Own properties of Rest-1.0.Rest.Proxy
561
+
562
+ static name: string
563
+ static $gtype: GObject.GType<Proxy>
564
+
565
+ // Constructors of Rest-1.0.Rest.Proxy
566
+
567
+ constructor(config?: Proxy.ConstructorProperties)
568
+ /**
569
+ * Create a new #RestProxy for the specified endpoint `url_format,` using the
570
+ * "GET" method.
571
+ *
572
+ * Set `binding_required` to %TRUE if the URL contains string formatting
573
+ * operations (for example "http://foo.com/%<!-- -->s". These must be expanded
574
+ * using rest_proxy_bind() before invoking the proxy.
575
+ * @constructor
576
+ * @param url_format the endpoint URL
577
+ * @param binding_required whether the URL needs to be bound before calling
578
+ * @returns A new #RestProxy.
579
+ */
580
+ constructor(url_format: string | null, binding_required: boolean)
581
+ /**
582
+ * Create a new #RestProxy for the specified endpoint `url_format,` using the
583
+ * "GET" method.
584
+ *
585
+ * Set `binding_required` to %TRUE if the URL contains string formatting
586
+ * operations (for example "http://foo.com/%<!-- -->s". These must be expanded
587
+ * using rest_proxy_bind() before invoking the proxy.
588
+ * @constructor
589
+ * @param url_format the endpoint URL
590
+ * @param binding_required whether the URL needs to be bound before calling
591
+ * @returns A new #RestProxy.
592
+ */
593
+ static new(url_format: string | null, binding_required: boolean): Proxy
594
+ /**
595
+ * Create a new #RestProxy for the specified endpoint `url_format,` using the
596
+ * "GET" method.
597
+ *
598
+ * Set `binding_required` to %TRUE if the URL contains string formatting
599
+ * operations (for example "http://foo.com/%<!-- -->s". These must be expanded
600
+ * using rest_proxy_bind() before invoking the proxy.
601
+ * @constructor
602
+ * @param url_format the endpoint URL
603
+ * @param binding_required whether the URL needs to be bound before calling
604
+ * @param username the username provided by the user or client
605
+ * @param password the password provided by the user or client
606
+ * @returns A new #RestProxy.
607
+ */
608
+ static new_with_authentication(url_format: string | null, binding_required: boolean, username: string | null, password: string | null): Proxy
609
+ _init(config?: Proxy.ConstructorProperties): void
610
+ }
611
+
612
+ module ProxyAuth {
613
+
614
+ // Constructor properties interface
615
+
616
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
617
+ }
618
+
619
+ }
620
+
621
+ interface ProxyAuth {
622
+
623
+ // Own fields of Rest-1.0.Rest.ProxyAuth
624
+
625
+ parent: GObject.Object
626
+ priv: ProxyAuthPrivate
627
+
628
+ // Owm methods of Rest-1.0.Rest.ProxyAuth
629
+
630
+ /**
631
+ * Cancel the authentication process
632
+ * by cancelling the associated #SoupMessage.
633
+ * It results in returning #GError REST_PROXY_ERROR_CANCELLED
634
+ * to the function that requested the authentication.
635
+ */
636
+ cancel(): void
637
+ /**
638
+ * Pauses `auth`.
639
+ *
640
+ * If `auth` is already paused, this function does not
641
+ * do anything.
642
+ */
643
+ pause(): void
644
+ /**
645
+ * Unpauses a paused #RestProxyAuth instance.
646
+ */
647
+ unpause(): void
648
+
649
+ // Class property signals of Rest-1.0.Rest.ProxyAuth
650
+
651
+ connect(sigName: string, callback: (...args: any[]) => void): number
652
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
653
+ emit(sigName: string, ...args: any[]): void
654
+ disconnect(id: number): void
655
+ }
656
+
657
+ /**
658
+ * #RestProxyAuth has no publicly available members.
659
+ * @class
660
+ */
661
+ class ProxyAuth extends GObject.Object {
662
+
663
+ // Own properties of Rest-1.0.Rest.ProxyAuth
664
+
665
+ static name: string
666
+ static $gtype: GObject.GType<ProxyAuth>
667
+
668
+ // Constructors of Rest-1.0.Rest.ProxyAuth
669
+
670
+ constructor(config?: ProxyAuth.ConstructorProperties)
671
+ _init(config?: ProxyAuth.ConstructorProperties): void
672
+ }
673
+
674
+ module ProxyCall {
675
+
676
+ // Constructor properties interface
677
+
678
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
679
+
680
+ // Own constructor properties of Rest-1.0.Rest.ProxyCall
681
+
682
+ proxy?: Proxy | null
683
+ }
684
+
685
+ }
686
+
687
+ interface ProxyCall {
688
+
689
+ // Own properties of Rest-1.0.Rest.ProxyCall
690
+
691
+ readonly proxy: Proxy
692
+
693
+ // Own fields of Rest-1.0.Rest.ProxyCall
694
+
695
+ parent_instance: GObject.Object
696
+
697
+ // Owm methods of Rest-1.0.Rest.ProxyCall
698
+
699
+ /**
700
+ * Add a header called `header` with the value `value` to the call. If a
701
+ * header with this name already exists, the new value will replace the old.
702
+ * @param header The name of the header to set
703
+ * @param value The value of the header
704
+ */
705
+ add_header(header: string | null, value: string | null): void
706
+ /**
707
+ * Add a query parameter called `param` with the string value `value` to the call.
708
+ * If a parameter with this name already exists, the new value will replace the
709
+ * old.
710
+ * @param name The name of the parameter to set
711
+ * @param value The value of the parameter
712
+ */
713
+ add_param(name: string | null, value: string | null): void
714
+ /**
715
+ * Add a query parameter `param` to the call.
716
+ * If a parameter with this name already exists, the new value will replace the
717
+ * old.
718
+ * @param param A #RestParam
719
+ */
720
+ add_param_full(param: Param): void
721
+ /**
722
+ * Get the REST function that is going to be called on the proxy.
723
+ * @returns The REST "function" for the current call, see also rest_proxy_call_set_function(). This string is owned by the #RestProxyCall and should not be freed.
724
+ */
725
+ get_function(): string | null
726
+ /**
727
+ * Get the HTTP method to use when making the call, for example GET or POST.
728
+ * @returns the HTTP method
729
+ */
730
+ get_method(): string | null
731
+ /**
732
+ * Get the parameters as a #RestParams of parameter names to values. The
733
+ * returned value is owned by the RestProxyCall instance and should not
734
+ * be freed by the caller.
735
+ * @returns A #RestParams.
736
+ */
737
+ get_params(): Params
738
+ /**
739
+ * Get the return payload.
740
+ * @returns A pointer to the payload. This is owned by #RestProxyCall and should not be freed.
741
+ */
742
+ get_payload(): string | null
743
+ /**
744
+ * Get the length of the return payload.
745
+ * @returns the length of the payload in bytes.
746
+ */
747
+ get_payload_length(): number
748
+ get_response_headers(): GLib.HashTable
749
+ /**
750
+ * Get the HTTP status code for the call.
751
+ */
752
+ get_status_code(): number
753
+ /**
754
+ * Get the human-readable HTTP status message for the call.
755
+ * @returns The status message. This string is owned by #RestProxyCall and should not be freed.
756
+ */
757
+ get_status_message(): string | null
758
+ invoke_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
759
+ invoke_finish(result: Gio.AsyncResult): boolean
760
+ /**
761
+ * Get the value of the header called `header`.
762
+ * @param header The header name
763
+ * @returns The header value, or %NULL if it does not exist. This string is owned by the #RestProxyCall and should not be freed.
764
+ */
765
+ lookup_header(header: string | null): string | null
766
+ /**
767
+ * Get the value of the parameter called `name`.
768
+ * @param name The paramter name
769
+ * @returns The parameter value, or %NULL if it does not exist. This string is owned by the #RestProxyCall and should not be freed.
770
+ */
771
+ lookup_param(name: string | null): Param | null
772
+ /**
773
+ * Get the string value of the header `header` or %NULL if that header is not
774
+ * present or there are no headers.
775
+ * @param header The name of the header to lookup.
776
+ */
777
+ lookup_response_header(header: string | null): string | null
778
+ /**
779
+ * Remove the header named `header` from the call.
780
+ * @param header The header name
781
+ */
782
+ remove_header(header: string | null): void
783
+ /**
784
+ * Remove the parameter named `name` from the call.
785
+ * @param name The paramter name
786
+ */
787
+ remove_param(name: string | null): void
788
+ /**
789
+ * Invoker for a virtual method to serialize the parameters for this
790
+ * #RestProxyCall.
791
+ * @returns TRUE if the serialization was successful, FALSE otherwise.
792
+ */
793
+ serialize_params(): [ /* returnType */ boolean, /* content_type */ string | null, /* content */ string | null, /* content_len */ number ]
794
+ /**
795
+ * Set the REST "function" to call on the proxy. This is appended to the URL,
796
+ * so that for example a proxy with the URL
797
+ * <literal>http://www.example.com/</literal> and the function
798
+ * <literal>test</literal> would actually access the URL
799
+ * <literal>http://www.example.com/test</literal>
800
+ * @param function_ The function to call
801
+ */
802
+ set_function(function_: string | null): void
803
+ /**
804
+ * Set the HTTP method to use when making the call, for example GET or POST.
805
+ * @param method The HTTP method to use
806
+ */
807
+ set_method(method: string | null): void
808
+ /**
809
+ * Synchronously invokes `call`. After this function has returned,
810
+ * rest_proxy_call_get_payload() will return the result of this call.
811
+ *
812
+ * Note that this will block an undefined amount of time, so
813
+ * rest_proxy_call_invoke_async() is generally recommended.
814
+ * @returns %TRUE on success, %FALSE if a failure occurred, in which case @error_out will be set.
815
+ */
816
+ sync(): boolean
817
+ /**
818
+ * Asynchronously invoke `call` but expect to have the callback invoked every time a
819
+ * chunk of our request's body is written.
820
+ *
821
+ * When the callback is invoked with the uploaded byte count equaling the message
822
+ * byte count, the call has completed.
823
+ *
824
+ * If `weak_object` is disposed during the call then this call will be
825
+ * cancelled. If the call is cancelled then the callback will be invoked with
826
+ * an error state.
827
+ *
828
+ * You may unref the call after calling this function since there is an
829
+ * internal reference, or you may unref in the callback.
830
+ * @param callback a #RestProxyCallUploadCallback to invoke when a chunk of data was uploaded
831
+ * @param weak_object The #GObject to weakly reference and tie the lifecycle to
832
+ */
833
+ upload(callback: ProxyCallUploadCallback, weak_object: GObject.Object): boolean
834
+
835
+ // Own virtual methods of Rest-1.0.Rest.ProxyCall
836
+
837
+ vfunc_prepare(): boolean
838
+ /**
839
+ * Invoker for a virtual method to serialize the parameters for this
840
+ * #RestProxyCall.
841
+ * @virtual
842
+ * @returns TRUE if the serialization was successful, FALSE otherwise.
843
+ */
844
+ vfunc_serialize_params(): [ /* returnType */ boolean, /* content_type */ string | null, /* content */ string | null, /* content_len */ number ]
845
+
846
+ // Class property signals of Rest-1.0.Rest.ProxyCall
847
+
848
+ connect(sigName: "notify::proxy", callback: (($obj: ProxyCall, pspec: GObject.ParamSpec) => void)): number
849
+ connect_after(sigName: "notify::proxy", callback: (($obj: ProxyCall, pspec: GObject.ParamSpec) => void)): number
850
+ emit(sigName: "notify::proxy", ...args: any[]): void
851
+ connect(sigName: string, callback: (...args: any[]) => void): number
852
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
853
+ emit(sigName: string, ...args: any[]): void
854
+ disconnect(id: number): void
855
+ }
856
+
857
+ /**
858
+ * #RestProxyCall has no publicly available members.
859
+ * @class
860
+ */
861
+ class ProxyCall extends GObject.Object {
862
+
863
+ // Own properties of Rest-1.0.Rest.ProxyCall
864
+
865
+ static name: string
866
+ static $gtype: GObject.GType<ProxyCall>
867
+
868
+ // Constructors of Rest-1.0.Rest.ProxyCall
869
+
870
+ constructor(config?: ProxyCall.ConstructorProperties)
871
+ _init(config?: ProxyCall.ConstructorProperties): void
872
+ }
873
+
874
+ module XmlParser {
875
+
876
+ // Constructor properties interface
877
+
878
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
879
+ }
880
+
881
+ }
882
+
883
+ interface XmlParser {
884
+
885
+ // Own fields of Rest-1.0.Rest.XmlParser
886
+
887
+ parent_instance: GObject.Object
888
+
889
+ // Owm methods of Rest-1.0.Rest.XmlParser
890
+
891
+ /**
892
+ * Parse the XML in `data,` and return a new #RestXmlNode. If `data` is invalid
893
+ * XML, %NULL is returned.
894
+ * @param data the XML content to parse
895
+ * @param len the length of `data,` or -1 if `data` is a nul-terminated string
896
+ * @returns a new #RestXmlNode, or %NULL if the XML was invalid.
897
+ */
898
+ parse_from_data(data: string | null, len: number): XmlNode
899
+
900
+ // Class property signals of Rest-1.0.Rest.XmlParser
901
+
902
+ connect(sigName: string, callback: (...args: any[]) => void): number
903
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
904
+ emit(sigName: string, ...args: any[]): void
905
+ disconnect(id: number): void
906
+ }
907
+
908
+ /**
909
+ * A Xml Parser for Rest Responses
910
+ * @class
911
+ */
912
+ class XmlParser extends GObject.Object {
913
+
914
+ // Own properties of Rest-1.0.Rest.XmlParser
915
+
916
+ static name: string
917
+ static $gtype: GObject.GType<XmlParser>
918
+
919
+ // Constructors of Rest-1.0.Rest.XmlParser
920
+
921
+ constructor(config?: XmlParser.ConstructorProperties)
922
+ /**
923
+ * Create a new #RestXmlParser, for parsing XML documents.
924
+ * @constructor
925
+ * @returns a new #RestXmlParser.
926
+ */
927
+ constructor()
928
+ /**
929
+ * Create a new #RestXmlParser, for parsing XML documents.
930
+ * @constructor
931
+ * @returns a new #RestXmlParser.
932
+ */
933
+ static new(): XmlParser
934
+ _init(config?: XmlParser.ConstructorProperties): void
935
+ }
936
+
937
+ interface OAuth2ProxyCallClass {
938
+
939
+ // Own fields of Rest-1.0.Rest.OAuth2ProxyCallClass
940
+
941
+ parent_class: ProxyCallClass
942
+ }
943
+
944
+ abstract class OAuth2ProxyCallClass {
945
+
946
+ // Own properties of Rest-1.0.Rest.OAuth2ProxyCallClass
947
+
948
+ static name: string
949
+ }
950
+
951
+ interface OAuth2ProxyClass {
952
+
953
+ // Own fields of Rest-1.0.Rest.OAuth2ProxyClass
954
+
955
+ parent_class: ProxyClass
956
+ parse_access_token: (self: OAuth2Proxy, payload: GLib.Bytes, task: Gio.Task) => void
957
+ padding: any[]
958
+ }
959
+
960
+ abstract class OAuth2ProxyClass {
961
+
962
+ // Own properties of Rest-1.0.Rest.OAuth2ProxyClass
963
+
964
+ static name: string
965
+ }
966
+
967
+ interface Param {
968
+
969
+ // Owm methods of Rest-1.0.Rest.Param
970
+
971
+ /**
972
+ * Get the content of `param`. The content should be treated as read-only and
973
+ * not modified in any way.
974
+ * @returns the content.
975
+ */
976
+ get_content(): any | null
977
+ /**
978
+ * Get the length of the content of `param`.
979
+ * @returns the length of the content
980
+ */
981
+ get_content_length(): number
982
+ /**
983
+ * Get the MIME type of the parameter. For example, basic strings have the MIME
984
+ * type "text/plain".
985
+ * @returns the MIME type
986
+ */
987
+ get_content_type(): string | null
988
+ /**
989
+ * Get the original file name of the parameter, if one is available.
990
+ * @returns the filename if set, or %NULL.
991
+ */
992
+ get_file_name(): string | null
993
+ /**
994
+ * Get the name of the parameter.
995
+ * @returns the parameter name.
996
+ */
997
+ get_name(): string | null
998
+ /**
999
+ * Determine if the parameter is a string value, i.e. the content type is "text/plain".
1000
+ * @returns %TRUE if the parameter is a string, %FALSE otherwise.
1001
+ */
1002
+ is_string(): boolean
1003
+ /**
1004
+ * Increase the reference count on `param`.
1005
+ * @returns the #RestParam
1006
+ */
1007
+ ref(): Param
1008
+ /**
1009
+ * Decrease the reference count on `param,` destroying it if the reference count
1010
+ * reaches 0.
1011
+ */
1012
+ unref(): void
1013
+ }
1014
+
1015
+ class Param {
1016
+
1017
+ // Own properties of Rest-1.0.Rest.Param
1018
+
1019
+ static name: string
1020
+
1021
+ // Constructors of Rest-1.0.Rest.Param
1022
+
1023
+ /**
1024
+ * Create a new #RestParam called `name` with `length` bytes of `data` as the
1025
+ * value. `content_type` is the type of the data as a MIME type, for example
1026
+ * "text/plain" for simple string parameters.
1027
+ *
1028
+ * If the parameter is a file upload it can be passed as `filename`.
1029
+ * @constructor
1030
+ * @param name the parameter name
1031
+ * @param use the #RestMemoryUse describing how the memory can be used
1032
+ * @param data a pointer to the start of the data
1033
+ * @param content_type the content type of the data
1034
+ * @param filename the original filename, or %NULL
1035
+ * @returns a new #RestParam.
1036
+ */
1037
+ static new_full(name: string | null, use: MemoryUse, data: Uint8Array, content_type: string | null, filename: string | null): Param
1038
+ /**
1039
+ * A convience constructor to create a #RestParam from a given UTF-8 string.
1040
+ * The resulting #RestParam will have a content type of "text/plain".
1041
+ * @constructor
1042
+ * @param name the parameter name
1043
+ * @param use the #RestMemoryUse describing how the memory can be used
1044
+ * @param string the parameter value
1045
+ * @returns a new #RestParam.
1046
+ */
1047
+ static new_string(name: string | null, use: MemoryUse, string: string | null): Param
1048
+ /**
1049
+ * Create a new #RestParam called `name` with `length` bytes of `data` as the
1050
+ * value. `content_type` is the type of the data as a MIME type, for example
1051
+ * "text/plain" for simple string parameters.
1052
+ *
1053
+ * If the parameter is a file upload it can be passed as `filename`.
1054
+ *
1055
+ * When the #RestParam is freed, it will call `owner_dnotify,` passing `owner` to
1056
+ * it. This allows you to do something like this:
1057
+ *
1058
+ *
1059
+ * ```
1060
+ * GMappedFile *map = g_mapped_file_new (filename, FALSE, &error);
1061
+ * RestParam *param = rest_param_new_with_owner ("media",
1062
+ * g_mapped_file_get_contents (map),
1063
+ * g_mapped_file_get_length (map),
1064
+ * "image/jpeg",
1065
+ * filename,
1066
+ * map,
1067
+ * (GDestroyNotify)g_mapped_file_unref);
1068
+ * ```
1069
+ *
1070
+ * @constructor
1071
+ * @param name the parameter name
1072
+ * @param data a pointer to the start of the data
1073
+ * @param content_type the content type of the data
1074
+ * @param filename the original filename, or %NULL
1075
+ * @param owner pointer to an object that owns `data`
1076
+ * @param owner_dnotify a function to free/unref `owner` when the buffer is freed
1077
+ * @returns a new #RestParam.
1078
+ */
1079
+ static new_with_owner(name: string | null, data: Uint8Array, content_type: string | null, filename: string | null, owner: any | null, owner_dnotify: GLib.DestroyNotify | null): Param
1080
+ }
1081
+
1082
+ interface Params {
1083
+
1084
+ // Owm methods of Rest-1.0.Rest.Params
1085
+
1086
+ /**
1087
+ * Add `param` to `params`.
1088
+ * @param param a valid #RestParam
1089
+ */
1090
+ add(param: Param): void
1091
+ /**
1092
+ * Checks if the parameters are all simple strings (have a content type of
1093
+ * "text/plain").
1094
+ * @returns %TRUE if all of the parameters are simple strings, %FALSE otherwise.
1095
+ */
1096
+ are_strings(): boolean
1097
+ /**
1098
+ * Create a new #GHashTable which contains the name and value of all string
1099
+ * (content type of text/plain) parameters.
1100
+ *
1101
+ * The values are owned by the #RestParams, so don't destroy the #RestParams
1102
+ * before the hash table.
1103
+ * @returns a new #GHashTable.
1104
+ */
1105
+ as_string_hash_table(): GLib.HashTable
1106
+ /**
1107
+ * Makes a deep copy of a #RestParams.
1108
+ * @returns A newly created #RestParams with the same contents as @self
1109
+ */
1110
+ copy(): Params
1111
+ /**
1112
+ * Return the #RestParam called `name,` or %NULL if it doesn't exist.
1113
+ * @param name a parameter name
1114
+ * @returns a #RestParam or %NULL if the name doesn't exist
1115
+ */
1116
+ get(name: string | null): Param | null
1117
+ /**
1118
+ * Increments the reference count of `self` by one.
1119
+ * @returns @self
1120
+ */
1121
+ ref(): Params
1122
+ /**
1123
+ * Remove the #RestParam called `name`.
1124
+ * @param name a parameter name
1125
+ */
1126
+ remove(name: string | null): void
1127
+ /**
1128
+ * Decrements the reference count of `self` by one, freeing the structure when
1129
+ * the reference count reaches zero.
1130
+ */
1131
+ unref(): void
1132
+ }
1133
+
1134
+ class Params {
1135
+
1136
+ // Own properties of Rest-1.0.Rest.Params
1137
+
1138
+ static name: string
1139
+
1140
+ // Constructors of Rest-1.0.Rest.Params
1141
+
1142
+ /**
1143
+ * Create a new #RestParams.
1144
+ * @constructor
1145
+ * @returns A empty #RestParams.
1146
+ */
1147
+ constructor()
1148
+ /**
1149
+ * Create a new #RestParams.
1150
+ * @constructor
1151
+ * @returns A empty #RestParams.
1152
+ */
1153
+ static new(): Params
1154
+ }
1155
+
1156
+ interface ParamsIter {
1157
+
1158
+ // Owm methods of Rest-1.0.Rest.ParamsIter
1159
+
1160
+ /**
1161
+ * Initialize a parameter iterator over `params`. Modifying `params` after calling
1162
+ * this function invalidates the returned iterator.
1163
+ *
1164
+ * ```
1165
+ * RestParamsIter iter;
1166
+ * const char *name;
1167
+ * RestParam *param;
1168
+ *
1169
+ * rest_params_iter_init (&iter, params);
1170
+ * while (rest_params_iter_next (&iter, &name, &param)) {
1171
+ * /&ast; do something with name and param &ast;/
1172
+ * }
1173
+ * ```
1174
+ *
1175
+ * @param params a valid #RestParams
1176
+ */
1177
+ init(params: Params): void
1178
+ /**
1179
+ * Advances `iter` and retrieves the name and/or parameter that are now pointed
1180
+ * at as a result of this advancement. If %FALSE is returned, `name` and `param`
1181
+ * are set to %NULL and the iterator becomes invalid.
1182
+ * @returns %FALSE if the end of the #RestParams has been reached, %TRUE otherwise.
1183
+ */
1184
+ next(): [ /* returnType */ boolean, /* name */ string | null, /* param */ Param | null ]
1185
+ }
1186
+
1187
+ class ParamsIter {
1188
+
1189
+ // Own properties of Rest-1.0.Rest.ParamsIter
1190
+
1191
+ static name: string
1192
+ }
1193
+
1194
+ interface PkceCodeChallenge {
1195
+
1196
+ // Owm methods of Rest-1.0.Rest.PkceCodeChallenge
1197
+
1198
+ /**
1199
+ * Makes a deep copy of a #RestPkceCodeChallenge.
1200
+ * @returns A newly created #RestPkceCodeChallenge with the same contents as @self
1201
+ */
1202
+ copy(): PkceCodeChallenge
1203
+ /**
1204
+ * Frees a #RestPkceCodeChallenge allocated using rest_pkce_code_challenge_new()
1205
+ * or rest_pkce_code_challenge_copy().
1206
+ */
1207
+ free(): void
1208
+ /**
1209
+ * Returns the Code Challenge for the Pkce verification.
1210
+ * @returns the code_challenge
1211
+ */
1212
+ get_challenge(): string | null
1213
+ /**
1214
+ * Returns the Code Verifier for the Pkce verification.
1215
+ * @returns the code_verifier
1216
+ */
1217
+ get_verifier(): string | null
1218
+ }
1219
+
1220
+ /**
1221
+ * In order to play a Pkce Code Verification during a OAuth2 authorization
1222
+ * you need this structure which handles the algorithmic part.
1223
+ * @record
1224
+ */
1225
+ class PkceCodeChallenge {
1226
+
1227
+ // Own properties of Rest-1.0.Rest.PkceCodeChallenge
1228
+
1229
+ static name: string
1230
+
1231
+ // Constructors of Rest-1.0.Rest.PkceCodeChallenge
1232
+
1233
+ /**
1234
+ * Creates a new #RestPkceCodeChallenge.
1235
+ * @constructor
1236
+ * @returns A newly created #RestPkceCodeChallenge
1237
+ */
1238
+ static new_random(): PkceCodeChallenge
1239
+ }
1240
+
1241
+ interface ProxyAuthClass {
1242
+
1243
+ // Own fields of Rest-1.0.Rest.ProxyAuthClass
1244
+
1245
+ parent_class: GObject.ObjectClass
1246
+ }
1247
+
1248
+ abstract class ProxyAuthClass {
1249
+
1250
+ // Own properties of Rest-1.0.Rest.ProxyAuthClass
1251
+
1252
+ static name: string
1253
+ }
1254
+
1255
+ interface ProxyAuthPrivate {
1256
+ }
1257
+
1258
+ class ProxyAuthPrivate {
1259
+
1260
+ // Own properties of Rest-1.0.Rest.ProxyAuthPrivate
1261
+
1262
+ static name: string
1263
+ }
1264
+
1265
+ interface ProxyCallClass {
1266
+
1267
+ // Own fields of Rest-1.0.Rest.ProxyCallClass
1268
+
1269
+ prepare: (call: ProxyCall) => boolean
1270
+ serialize_params: (call: ProxyCall) => [ /* returnType */ boolean, /* content_type */ string | null, /* content */ string | null, /* content_len */ number ]
1271
+ }
1272
+
1273
+ /**
1274
+ * Class structure for #RestProxyCall for subclasses to implement specialised
1275
+ * behaviour.
1276
+ * @record
1277
+ */
1278
+ abstract class ProxyCallClass {
1279
+
1280
+ // Own properties of Rest-1.0.Rest.ProxyCallClass
1281
+
1282
+ static name: string
1283
+ }
1284
+
1285
+ interface ProxyClass {
1286
+
1287
+ // Own fields of Rest-1.0.Rest.ProxyClass
1288
+
1289
+ new_call: (proxy: Proxy) => ProxyCall
1290
+ authenticate: (proxy: Proxy, auth: ProxyAuth, retrying: boolean) => boolean
1291
+ }
1292
+
1293
+ /**
1294
+ * Class structure for #RestProxy for subclasses to implement specialised
1295
+ * behaviour.
1296
+ *
1297
+ * Typically subclasses will override `new_call` to construct a subclass of
1298
+ * #RestProxyCall.
1299
+ * @record
1300
+ */
1301
+ abstract class ProxyClass {
1302
+
1303
+ // Own properties of Rest-1.0.Rest.ProxyClass
1304
+
1305
+ static name: string
1306
+ }
1307
+
1308
+ interface XmlNode {
1309
+
1310
+ // Own fields of Rest-1.0.Rest.XmlNode
1311
+
1312
+ /**
1313
+ * the name of the element
1314
+ * @field
1315
+ */
1316
+ name: string | null
1317
+ /**
1318
+ * the textual content of the element
1319
+ * @field
1320
+ */
1321
+ content: string | null
1322
+ /**
1323
+ * a #GHashTable of string name to #RestXmlNode for the children of
1324
+ * the element.
1325
+ * @field
1326
+ */
1327
+ children: GLib.HashTable
1328
+ /**
1329
+ * a #GHashTable of string name to string values for the attributes of
1330
+ * the element.
1331
+ * @field
1332
+ */
1333
+ attrs: GLib.HashTable
1334
+ /**
1335
+ * the sibling #RestXmlNode with the same name
1336
+ * @field
1337
+ */
1338
+ next: XmlNode
1339
+
1340
+ // Owm methods of Rest-1.0.Rest.XmlNode
1341
+
1342
+ /**
1343
+ * Adds attribute to the given node.
1344
+ * @param attribute name of the attribute
1345
+ * @param value value to set attribute to
1346
+ */
1347
+ add_attr(attribute: string | null, value: string | null): void
1348
+ /**
1349
+ * Adds a new node to the given parent node; to create the top-level node,
1350
+ * parent should be %NULL.
1351
+ * @param tag name of the child node
1352
+ * @returns the newly added #RestXmlNode; the node object is owned by, and valid for the life time of, the #RestXmlCreator.
1353
+ */
1354
+ add_child(tag: string | null): XmlNode
1355
+ /**
1356
+ * Searches for the first child node of `start` named `tag`.
1357
+ * @param tag the name of a node
1358
+ * @returns the first child node, or %NULL if it doesn't exist.
1359
+ */
1360
+ find(tag: string | null): XmlNode
1361
+ /**
1362
+ * Get the value of the attribute named `attr_name,` or %NULL if it doesn't
1363
+ * exist.
1364
+ * @param attr_name the name of an attribute
1365
+ * @returns the attribute value. This string is owned by #RestXmlNode and should not be freed.
1366
+ */
1367
+ get_attr(attr_name: string | null): string | null
1368
+ /**
1369
+ * Recursively outputs given node and it's children.
1370
+ * @returns xml string representing the node.
1371
+ */
1372
+ print(): string | null
1373
+ /**
1374
+ * Sets content for the given node.
1375
+ * @param value the content
1376
+ */
1377
+ set_content(value: string | null): void
1378
+ }
1379
+
1380
+ /**
1381
+ * The #RestXmlNode contains a parsed XmlNode for easy consumption
1382
+ * @record
1383
+ */
1384
+ class XmlNode {
1385
+
1386
+ // Own properties of Rest-1.0.Rest.XmlNode
1387
+
1388
+ static name: string
1389
+ }
1390
+
1391
+ interface XmlParserClass {
1392
+
1393
+ // Own fields of Rest-1.0.Rest.XmlParserClass
1394
+
1395
+ parent_class: GObject.ObjectClass
1396
+ }
1397
+
1398
+ abstract class XmlParserClass {
1399
+
1400
+ // Own properties of Rest-1.0.Rest.XmlParserClass
1401
+
1402
+ static name: string
1403
+ }
1404
+
1405
+ /**
1406
+ * Name of the imported GIR library
1407
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
1408
+ */
1409
+ const __name__: string
1410
+ /**
1411
+ * Version of the imported GIR library
1412
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
1413
+ */
1414
+ const __version__: string
1415
+ }
1416
+
1417
+ export default Rest;
1418
+ // END