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