@girs/grlnet-0.3 0.3.0-3.3.0 → 0.3.0-4.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,9 +5,8 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/grlnet-0.3)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GrlNet-0.3, generated from library version 0.3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.3.0.
8
+ GJS TypeScript type definitions for GrlNet-0.3, generated from library version 0.3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.2.
9
9
 
10
- Network classes for Grilo
11
10
 
12
11
  ## Install
13
12
 
@@ -1,11 +1,11 @@
1
1
 
2
2
  declare module 'gi://GrlNet?version=0.3' {
3
- import GrlNet03 from '@girs/grlnet-0.3';
4
- export default GrlNet03;
3
+ import GrlNet from '@girs/grlnet-0.3';
4
+ export default GrlNet;
5
5
  }
6
6
 
7
7
  declare module 'gi://GrlNet' {
8
- import GrlNet03 from '@girs/grlnet-0.3';
8
+ import GrlNet03 from 'gi://GrlNet?version=0.3';
9
9
  export default GrlNet03;
10
10
  }
11
11
 
package/grlnet-0.3.d.ts CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  /*
3
2
  * Type Definitions for Gjs (https://gjs.guide/)
4
3
  *
@@ -7,7 +6,7 @@
7
6
  */
8
7
 
9
8
  import './grlnet-0.3-ambient.d.ts';
10
- import './grlnet-0.3-import.d.ts';
9
+
11
10
  /**
12
11
  * GrlNet-0.3
13
12
  */
@@ -16,254 +15,195 @@ import type Soup from '@girs/soup-3.0';
16
15
  import type Gio from '@girs/gio-2.0';
17
16
  import type GObject from '@girs/gobject-2.0';
18
17
  import type GLib from '@girs/glib-2.0';
18
+ import type GModule from '@girs/gmodule-2.0';
19
19
 
20
20
  export namespace GrlNet {
21
-
22
- /**
23
- * These constants identify all the available errors managed by
24
- * the web client.
25
- */
26
- enum WcError {
27
- /**
28
- * Deprecated. For generic errors, you
29
- * should check for G_IO_ERROR_FAILED from G_IO_ERROR domain.
30
- */
31
- UNAVAILABLE,
32
- /**
33
- * Invalid URI or header
34
- */
35
- PROTOCOL_ERROR,
36
- /**
37
- * Required authentication
38
- */
39
- AUTHENTICATION_REQUIRED,
40
- /**
41
- * Request resource not found
42
- */
43
- NOT_FOUND,
44
- /**
45
- * The entry has been modified since is was
46
- * downloaded
47
- */
48
- CONFLICT,
49
- /**
50
- * TBD
51
- */
52
- FORBIDDEN,
53
- /**
54
- * Cannot connect to the server
55
- */
56
- NETWORK_ERROR,
57
- /**
58
- * Deprecated. You should check for
59
- * G_IO_ERROR_PROXY_FAILED from G_IO_ERROR domain.
60
- */
61
- PROXY_ERROR,
62
21
  /**
63
- * Deprecated. You should check for
64
- * G_IO_ERROR_CANCELLED from G_IO_ERROR domain.
65
- */
66
- CANCELLED,
67
- }
68
- module Wc {
69
-
70
- // Constructor properties interface
71
-
72
- interface ConstructorProperties extends GObject.Object.ConstructorProperties {
73
-
74
- // Own constructor properties of GrlNet-0.3.GrlNet.Wc
75
-
76
- cache?: boolean | null
77
- cacheSize?: number | null
78
- loglevel?: number | null
79
- throttling?: number | null
80
- userAgent?: string | null
22
+ * These constants identify all the available errors managed by
23
+ * the web client.
24
+ */
25
+ enum WcError {
26
+ /**
27
+ * Deprecated. For generic errors, you
28
+ * should check for G_IO_ERROR_FAILED from G_IO_ERROR domain.
29
+ */
30
+ UNAVAILABLE,
31
+ /**
32
+ * Invalid URI or header
33
+ */
34
+ PROTOCOL_ERROR,
35
+ /**
36
+ * Required authentication
37
+ */
38
+ AUTHENTICATION_REQUIRED,
39
+ /**
40
+ * Request resource not found
41
+ */
42
+ NOT_FOUND,
43
+ /**
44
+ * The entry has been modified since is was
45
+ * downloaded
46
+ */
47
+ CONFLICT,
48
+ /**
49
+ * TBD
50
+ */
51
+ FORBIDDEN,
52
+ /**
53
+ * Cannot connect to the server
54
+ */
55
+ NETWORK_ERROR,
56
+ /**
57
+ * Deprecated. You should check for
58
+ * G_IO_ERROR_PROXY_FAILED from G_IO_ERROR domain.
59
+ */
60
+ PROXY_ERROR,
61
+ /**
62
+ * Deprecated. You should check for
63
+ * G_IO_ERROR_CANCELLED from G_IO_ERROR domain.
64
+ */
65
+ CANCELLED,
66
+ }
67
+ module Wc {
68
+ // Constructor properties interface
69
+
70
+ interface ConstructorProps extends GObject.Object.ConstructorProps {
71
+ cache: boolean;
72
+ cache_size: number;
73
+ cacheSize: number;
74
+ loglevel: number;
75
+ throttling: number;
76
+ user_agent: string;
77
+ userAgent: string;
78
+ }
81
79
  }
82
80
 
83
- }
84
-
85
- interface Wc {
86
-
87
- // Own properties of GrlNet-0.3.GrlNet.Wc
88
-
89
- cache: boolean
90
- cacheSize: number
91
- loglevel: number
92
- throttling: number
93
- userAgent: string | null
94
-
95
- // Owm methods of GrlNet-0.3.GrlNet.Wc
96
-
97
- /**
98
- * This method will flush all the pending request in the queue.
99
- */
100
- flush_delayed_requests(): void
101
- /**
102
- * Request the fetching of a web resource given the `uri`. This request is
103
- * asynchronous, thus the result will be returned within the `callback`.
104
- * @param uri The URI of the resource to request
105
- * @param cancellable a #GCancellable instance or %NULL to ignore
106
- * @param callback The callback when the result is ready
107
- */
108
- request_async(uri: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
109
-
110
- // Overloads of request_async
111
-
112
- /**
113
- * Promisified version of {@link request_async}
114
- *
115
- * Request the fetching of a web resource given the `uri`. This request is
116
- * asynchronous, thus the result will be returned within the `callback`.
117
- * @param uri The URI of the resource to request
118
- * @param cancellable a #GCancellable instance or %NULL to ignore
119
- * @returns A Promise of: %TRUE if the request was successfull. If %FALSE an error occurred.
120
- */
121
- request_async(uri: string, cancellable: Gio.Cancellable | null): globalThis.Promise</* content */ Uint8Array>
122
- /**
123
- * Finishes an asynchronous load of the file's contents.
124
- * The contents are placed in contents, and length is set to the size of the
125
- * contents string.
126
- *
127
- * The content address will be invalidated at the next request. So if you
128
- * want to keep it, please copy it into another address.
129
- * @param result The result of the request
130
- * @returns %TRUE if the request was successfull. If %FALSE an error occurred.
131
- */
132
- request_finish(result: Gio.AsyncResult): [ /* returnType */ boolean, /* content */ Uint8Array ]
133
- /**
134
- * Request the fetching of a web resource given the `uri`. This request is
135
- * asynchronous, thus the result will be returned within the `callback`.
136
- * @param uri The URI of the resource to request
137
- * @param headers a set of additional HTTP headers for this request or %NULL to ignore
138
- * @param cancellable a #GCancellable instance or %NULL to ignore
139
- * @param callback The callback when the result is ready
140
- */
141
- request_with_headers_async(uri: string, headers: GLib.HashTable | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
142
- /**
143
- * Sets if cache must be used. Note that this will only work if caching is
144
- * supporting. If sets %TRUE, a new cache will be created. If sets to %FALSE,
145
- * current cache is clean and removed.
146
- * @param use_cache if cache must be used or not
147
- */
148
- set_cache(use_cache: boolean): void
149
- /**
150
- * Sets the new maximum size of cache, in Megabytes. Default value is 10. Using
151
- * 0 means no cache will be done.
152
- * @param cache_size size of cache (in Mb)
153
- */
154
- set_cache_size(cache_size: number): void
155
- /**
156
- * Setting the log level the logger feature is added into
157
- * the libsoup session.
158
- * @param log_level the libsoup log level to set [0,3]
159
- */
160
- set_log_level(log_level: number): void
161
- /**
162
- * Setting this property, the #GrlNetWc will queue all the requests and
163
- * will dispatch them with a pause between them of this value.
164
- *
165
- * Note that if the grl-net library was compiled against libsoup3, changing
166
- * the throttling configuration will show a warning if done after the first
167
- * request.
168
- * @param throttling the number of seconds to wait between requests
169
- */
170
- set_throttling(throttling: number): void
171
-
172
- // Class property signals of GrlNet-0.3.GrlNet.Wc
173
-
174
- connect(sigName: "notify::cache", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
175
- connect_after(sigName: "notify::cache", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
176
- emit(sigName: "notify::cache", ...args: any[]): void
177
- connect(sigName: "notify::cache-size", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
178
- connect_after(sigName: "notify::cache-size", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
179
- emit(sigName: "notify::cache-size", ...args: any[]): void
180
- connect(sigName: "notify::loglevel", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
181
- connect_after(sigName: "notify::loglevel", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
182
- emit(sigName: "notify::loglevel", ...args: any[]): void
183
- connect(sigName: "notify::throttling", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
184
- connect_after(sigName: "notify::throttling", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
185
- emit(sigName: "notify::throttling", ...args: any[]): void
186
- connect(sigName: "notify::user-agent", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
187
- connect_after(sigName: "notify::user-agent", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
188
- emit(sigName: "notify::user-agent", ...args: any[]): void
189
- connect(sigName: string, callback: (...args: any[]) => void): number
190
- connect_after(sigName: string, callback: (...args: any[]) => void): number
191
- emit(sigName: string, ...args: any[]): void
192
- disconnect(id: number): void
193
- }
194
-
195
- class Wc extends GObject.Object {
81
+ class Wc extends GObject.Object {
82
+ static $gtype: GObject.GType<Wc>;
83
+
84
+ // Own properties of GrlNet.Wc
85
+
86
+ get cache(): boolean;
87
+ set cache(val: boolean);
88
+ get cache_size(): number;
89
+ set cache_size(val: number);
90
+ get cacheSize(): number;
91
+ set cacheSize(val: number);
92
+ get loglevel(): number;
93
+ set loglevel(val: number);
94
+ get throttling(): number;
95
+ set throttling(val: number);
96
+ get user_agent(): string;
97
+ set user_agent(val: string);
98
+ get userAgent(): string;
99
+ set userAgent(val: string);
100
+
101
+ // Constructors of GrlNet.Wc
102
+
103
+ constructor(properties?: Partial<Wc.ConstructorProps>, ...args: any[]);
104
+
105
+ _init(...args: any[]): void;
106
+
107
+ static ['new'](): Wc;
108
+
109
+ // Own static methods of GrlNet.Wc
110
+
111
+ static error_quark(): GLib.Quark;
112
+
113
+ // Own methods of GrlNet.Wc
114
+
115
+ /**
116
+ * This method will flush all the pending request in the queue.
117
+ */
118
+ flush_delayed_requests(): void;
119
+ /**
120
+ * Request the fetching of a web resource given the `uri`. This request is
121
+ * asynchronous, thus the result will be returned within the `callback`.
122
+ * @param uri The URI of the resource to request
123
+ * @param cancellable a #GCancellable instance or %NULL to ignore
124
+ * @param callback The callback when the result is ready
125
+ */
126
+ request_async(
127
+ uri: string,
128
+ cancellable?: Gio.Cancellable | null,
129
+ callback?: Gio.AsyncReadyCallback<this> | null,
130
+ ): void;
131
+ /**
132
+ * Finishes an asynchronous load of the file's contents.
133
+ * The contents are placed in contents, and length is set to the size of the
134
+ * contents string.
135
+ *
136
+ * The content address will be invalidated at the next request. So if you
137
+ * want to keep it, please copy it into another address.
138
+ * @param result The result of the request
139
+ * @returns %TRUE if the request was successfull. If %FALSE an error occurred.
140
+ */
141
+ request_finish(result: Gio.AsyncResult): [boolean, Uint8Array | null];
142
+ /**
143
+ * Request the fetching of a web resource given the `uri`. This request is
144
+ * asynchronous, thus the result will be returned within the `callback`.
145
+ * @param uri The URI of the resource to request
146
+ * @param headers a set of additional HTTP headers for this request or %NULL to ignore
147
+ * @param cancellable a #GCancellable instance or %NULL to ignore
148
+ * @param callback The callback when the result is ready
149
+ */
150
+ request_with_headers_async(
151
+ uri: string,
152
+ headers?: GLib.HashTable<string, string> | null,
153
+ cancellable?: Gio.Cancellable | null,
154
+ callback?: Gio.AsyncReadyCallback<this> | null,
155
+ ): void;
156
+ /**
157
+ * Sets if cache must be used. Note that this will only work if caching is
158
+ * supporting. If sets %TRUE, a new cache will be created. If sets to %FALSE,
159
+ * current cache is clean and removed.
160
+ * @param use_cache if cache must be used or not
161
+ */
162
+ set_cache(use_cache: boolean): void;
163
+ /**
164
+ * Sets the new maximum size of cache, in Megabytes. Default value is 10. Using
165
+ * 0 means no cache will be done.
166
+ * @param cache_size size of cache (in Mb)
167
+ */
168
+ set_cache_size(cache_size: number): void;
169
+ /**
170
+ * Setting the log level the logger feature is added into
171
+ * the libsoup session.
172
+ * @param log_level the libsoup log level to set [0,3]
173
+ */
174
+ set_log_level(log_level: number): void;
175
+ /**
176
+ * Setting this property, the #GrlNetWc will queue all the requests and
177
+ * will dispatch them with a pause between them of this value.
178
+ *
179
+ * Note that if the grl-net library was compiled against libsoup3, changing
180
+ * the throttling configuration will show a warning if done after the first
181
+ * request.
182
+ * @param throttling the number of seconds to wait between requests
183
+ */
184
+ set_throttling(throttling: number): void;
185
+ }
196
186
 
197
- // Own properties of GrlNet-0.3.GrlNet.Wc
187
+ type WcClass = typeof Wc;
188
+ abstract class WcPrivate {
189
+ static $gtype: GObject.GType<WcPrivate>;
198
190
 
199
- static name: string
200
- static $gtype: GObject.GType<Wc>
191
+ // Constructors of GrlNet.WcPrivate
201
192
 
202
- // Constructors of GrlNet-0.3.GrlNet.Wc
193
+ _init(...args: any[]): void;
194
+ }
203
195
 
204
- constructor(config?: Wc.ConstructorProperties)
205
196
  /**
206
- * Creates a new #GrlNetWc.
207
- * @constructor
208
- * @returns a new allocated instance of #GrlNetWc. Do g_object_unref() after use it.
197
+ * Name of the imported GIR library
198
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
209
199
  */
210
- constructor()
211
- /**
212
- * Creates a new #GrlNetWc.
213
- * @constructor
214
- * @returns a new allocated instance of #GrlNetWc. Do g_object_unref() after use it.
215
- */
216
- static new(): Wc
217
- _init(config?: Wc.ConstructorProperties): void
218
- static error_quark(): GLib.Quark
219
- }
220
-
221
- interface WcClass {
222
-
223
- // Own fields of GrlNet-0.3.GrlNet.WcClass
224
-
200
+ const __name__: string;
225
201
  /**
226
- * the parent class structure
227
- * @field
202
+ * Version of the imported GIR library
203
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
228
204
  */
229
- parent_class: GObject.ObjectClass
230
- }
231
-
232
- /**
233
- * Grilo web client helper class.
234
- *
235
- * It's a simple and thin web client to be used by the sources to download
236
- * content from Internet.
237
- * @record
238
- */
239
- abstract class WcClass {
240
-
241
- // Own properties of GrlNet-0.3.GrlNet.WcClass
242
-
243
- static name: string
244
- }
245
-
246
- interface WcPrivate {
247
- }
248
-
249
- class WcPrivate {
250
-
251
- // Own properties of GrlNet-0.3.GrlNet.WcPrivate
252
-
253
- static name: string
254
- }
255
-
256
- /**
257
- * Name of the imported GIR library
258
- * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
259
- */
260
- const __name__: string
261
- /**
262
- * Version of the imported GIR library
263
- * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
264
- */
265
- const __version__: string
205
+ const __version__: string;
266
206
  }
267
207
 
268
208
  export default GrlNet;
269
- // END
209
+ // END
package/grlnet-0.3.js CHANGED
@@ -1,10 +1,6 @@
1
1
 
2
-
3
2
  // @ts-expect-error
4
3
  import GrlNet from 'gi://GrlNet?version=0.3';
5
4
  export { GrlNet };
6
5
  export default GrlNet;
7
6
 
8
-
9
-
10
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/grlnet-0.3",
3
- "version": "0.3.0-3.3.0",
3
+ "version": "0.3.0-4.0.0-beta.2",
4
4
  "description": "GJS TypeScript type definitions for GrlNet-0.3, generated from library version 0.3.0",
5
5
  "type": "module",
6
6
  "module": "grlnet-0.3.js",
@@ -8,34 +8,30 @@
8
8
  "exports": {
9
9
  "./ambient": {
10
10
  "types": "./grlnet-0.3-ambient.d.ts",
11
+ "import": "./grlnet-0.3-ambient.js",
11
12
  "default": "./grlnet-0.3-ambient.js"
12
13
  },
13
14
  "./import": {
14
15
  "types": "./grlnet-0.3-import.d.ts",
16
+ "import": "./grlnet-0.3-import.js",
15
17
  "default": "./grlnet-0.3-import.js"
16
18
  },
17
19
  ".": {
18
- "import": {
19
- "types": "./grlnet-0.3.d.ts",
20
- "default": "./grlnet-0.3.js"
21
- },
22
- "require": {
23
- "types": "./grlnet-0.3.d.cts",
24
- "default": "./grlnet-0.3.cjs"
25
- }
20
+ "types": "./grlnet-0.3.d.ts",
21
+ "import": "./grlnet-0.3.js",
22
+ "default": "./grlnet-0.3.js"
26
23
  }
27
24
  },
28
25
  "scripts": {
29
- "test": "yarn test:esm && yarn test:cjs",
30
- "test:esm": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit grlnet-0.3.d.ts",
31
- "test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit grlnet-0.3.d.cts"
26
+ "test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit grlnet-0.3.d.ts"
32
27
  },
33
28
  "dependencies": {
34
- "@girs/gio-2.0": "^2.78.0-3.3.0",
35
- "@girs/gjs": "^3.3.0",
36
- "@girs/glib-2.0": "^2.78.0-3.3.0",
37
- "@girs/gobject-2.0": "^2.78.0-3.3.0",
38
- "@girs/soup-3.0": "^3.4.4-3.3.0"
29
+ "@girs/gio-2.0": "^2.80.0-4.0.0-beta.2",
30
+ "@girs/gjs": "^4.0.0-beta.2",
31
+ "@girs/glib-2.0": "^2.80.0-4.0.0-beta.2",
32
+ "@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.2",
33
+ "@girs/gobject-2.0": "^2.80.0-4.0.0-beta.2",
34
+ "@girs/soup-3.0": "^3.4.4-4.0.0-beta.2"
39
35
  },
40
36
  "devDependencies": {
41
37
  "typescript": "*"
package/grlnet-0.3.cjs DELETED
@@ -1,11 +0,0 @@
1
-
2
-
3
- imports.gi.versions.GrlNet = '0.3'
4
- const GrlNet = imports.gi.GrlNet;
5
-
6
- module.exports = GrlNet;
7
-
8
-
9
-
10
-
11
-
package/grlnet-0.3.d.cts DELETED
@@ -1,264 +0,0 @@
1
-
2
- /*
3
- * Type Definitions for Gjs (https://gjs.guide/)
4
- *
5
- * These type definitions are automatically generated, do not edit them by hand.
6
- * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
7
- */
8
-
9
- import './grlnet-0.3-ambient.d.ts';
10
- import './grlnet-0.3-import.d.ts';
11
- /**
12
- * GrlNet-0.3
13
- */
14
-
15
- import type Soup from '@girs/soup-3.0';
16
- import type Gio from '@girs/gio-2.0';
17
- import type GObject from '@girs/gobject-2.0';
18
- import type GLib from '@girs/glib-2.0';
19
-
20
- /**
21
- * These constants identify all the available errors managed by
22
- * the web client.
23
- */
24
- export enum WcError {
25
- /**
26
- * Deprecated. For generic errors, you
27
- * should check for G_IO_ERROR_FAILED from G_IO_ERROR domain.
28
- */
29
- UNAVAILABLE,
30
- /**
31
- * Invalid URI or header
32
- */
33
- PROTOCOL_ERROR,
34
- /**
35
- * Required authentication
36
- */
37
- AUTHENTICATION_REQUIRED,
38
- /**
39
- * Request resource not found
40
- */
41
- NOT_FOUND,
42
- /**
43
- * The entry has been modified since is was
44
- * downloaded
45
- */
46
- CONFLICT,
47
- /**
48
- * TBD
49
- */
50
- FORBIDDEN,
51
- /**
52
- * Cannot connect to the server
53
- */
54
- NETWORK_ERROR,
55
- /**
56
- * Deprecated. You should check for
57
- * G_IO_ERROR_PROXY_FAILED from G_IO_ERROR domain.
58
- */
59
- PROXY_ERROR,
60
- /**
61
- * Deprecated. You should check for
62
- * G_IO_ERROR_CANCELLED from G_IO_ERROR domain.
63
- */
64
- CANCELLED,
65
- }
66
- export module Wc {
67
-
68
- // Constructor properties interface
69
-
70
- export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
71
-
72
- // Own constructor properties of GrlNet-0.3.GrlNet.Wc
73
-
74
- cache?: boolean | null
75
- cacheSize?: number | null
76
- loglevel?: number | null
77
- throttling?: number | null
78
- userAgent?: string | null
79
- }
80
-
81
- }
82
-
83
- export interface Wc {
84
-
85
- // Own properties of GrlNet-0.3.GrlNet.Wc
86
-
87
- cache: boolean
88
- cacheSize: number
89
- loglevel: number
90
- throttling: number
91
- userAgent: string | null
92
-
93
- // Owm methods of GrlNet-0.3.GrlNet.Wc
94
-
95
- /**
96
- * This method will flush all the pending request in the queue.
97
- */
98
- flush_delayed_requests(): void
99
- /**
100
- * Request the fetching of a web resource given the `uri`. This request is
101
- * asynchronous, thus the result will be returned within the `callback`.
102
- * @param uri The URI of the resource to request
103
- * @param cancellable a #GCancellable instance or %NULL to ignore
104
- * @param callback The callback when the result is ready
105
- */
106
- request_async(uri: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
107
-
108
- // Overloads of request_async
109
-
110
- /**
111
- * Promisified version of {@link request_async}
112
- *
113
- * Request the fetching of a web resource given the `uri`. This request is
114
- * asynchronous, thus the result will be returned within the `callback`.
115
- * @param uri The URI of the resource to request
116
- * @param cancellable a #GCancellable instance or %NULL to ignore
117
- * @returns A Promise of: %TRUE if the request was successfull. If %FALSE an error occurred.
118
- */
119
- request_async(uri: string, cancellable: Gio.Cancellable | null): globalThis.Promise</* content */ Uint8Array>
120
- /**
121
- * Finishes an asynchronous load of the file's contents.
122
- * The contents are placed in contents, and length is set to the size of the
123
- * contents string.
124
- *
125
- * The content address will be invalidated at the next request. So if you
126
- * want to keep it, please copy it into another address.
127
- * @param result The result of the request
128
- * @returns %TRUE if the request was successfull. If %FALSE an error occurred.
129
- */
130
- request_finish(result: Gio.AsyncResult): [ /* returnType */ boolean, /* content */ Uint8Array ]
131
- /**
132
- * Request the fetching of a web resource given the `uri`. This request is
133
- * asynchronous, thus the result will be returned within the `callback`.
134
- * @param uri The URI of the resource to request
135
- * @param headers a set of additional HTTP headers for this request or %NULL to ignore
136
- * @param cancellable a #GCancellable instance or %NULL to ignore
137
- * @param callback The callback when the result is ready
138
- */
139
- request_with_headers_async(uri: string, headers: GLib.HashTable | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
140
- /**
141
- * Sets if cache must be used. Note that this will only work if caching is
142
- * supporting. If sets %TRUE, a new cache will be created. If sets to %FALSE,
143
- * current cache is clean and removed.
144
- * @param use_cache if cache must be used or not
145
- */
146
- set_cache(use_cache: boolean): void
147
- /**
148
- * Sets the new maximum size of cache, in Megabytes. Default value is 10. Using
149
- * 0 means no cache will be done.
150
- * @param cache_size size of cache (in Mb)
151
- */
152
- set_cache_size(cache_size: number): void
153
- /**
154
- * Setting the log level the logger feature is added into
155
- * the libsoup session.
156
- * @param log_level the libsoup log level to set [0,3]
157
- */
158
- set_log_level(log_level: number): void
159
- /**
160
- * Setting this property, the #GrlNetWc will queue all the requests and
161
- * will dispatch them with a pause between them of this value.
162
- *
163
- * Note that if the grl-net library was compiled against libsoup3, changing
164
- * the throttling configuration will show a warning if done after the first
165
- * request.
166
- * @param throttling the number of seconds to wait between requests
167
- */
168
- set_throttling(throttling: number): void
169
-
170
- // Class property signals of GrlNet-0.3.GrlNet.Wc
171
-
172
- connect(sigName: "notify::cache", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
173
- connect_after(sigName: "notify::cache", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
174
- emit(sigName: "notify::cache", ...args: any[]): void
175
- connect(sigName: "notify::cache-size", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
176
- connect_after(sigName: "notify::cache-size", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
177
- emit(sigName: "notify::cache-size", ...args: any[]): void
178
- connect(sigName: "notify::loglevel", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
179
- connect_after(sigName: "notify::loglevel", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
180
- emit(sigName: "notify::loglevel", ...args: any[]): void
181
- connect(sigName: "notify::throttling", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
182
- connect_after(sigName: "notify::throttling", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
183
- emit(sigName: "notify::throttling", ...args: any[]): void
184
- connect(sigName: "notify::user-agent", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
185
- connect_after(sigName: "notify::user-agent", callback: (($obj: Wc, pspec: GObject.ParamSpec) => void)): number
186
- emit(sigName: "notify::user-agent", ...args: any[]): void
187
- connect(sigName: string, callback: (...args: any[]) => void): number
188
- connect_after(sigName: string, callback: (...args: any[]) => void): number
189
- emit(sigName: string, ...args: any[]): void
190
- disconnect(id: number): void
191
- }
192
-
193
- export class Wc extends GObject.Object {
194
-
195
- // Own properties of GrlNet-0.3.GrlNet.Wc
196
-
197
- static name: string
198
- static $gtype: GObject.GType<Wc>
199
-
200
- // Constructors of GrlNet-0.3.GrlNet.Wc
201
-
202
- constructor(config?: Wc.ConstructorProperties)
203
- /**
204
- * Creates a new #GrlNetWc.
205
- * @constructor
206
- * @returns a new allocated instance of #GrlNetWc. Do g_object_unref() after use it.
207
- */
208
- constructor()
209
- /**
210
- * Creates a new #GrlNetWc.
211
- * @constructor
212
- * @returns a new allocated instance of #GrlNetWc. Do g_object_unref() after use it.
213
- */
214
- static new(): Wc
215
- _init(config?: Wc.ConstructorProperties): void
216
- static error_quark(): GLib.Quark
217
- }
218
-
219
- export interface WcClass {
220
-
221
- // Own fields of GrlNet-0.3.GrlNet.WcClass
222
-
223
- /**
224
- * the parent class structure
225
- * @field
226
- */
227
- parent_class: GObject.ObjectClass
228
- }
229
-
230
- /**
231
- * Grilo web client helper class.
232
- *
233
- * It's a simple and thin web client to be used by the sources to download
234
- * content from Internet.
235
- * @record
236
- */
237
- export abstract class WcClass {
238
-
239
- // Own properties of GrlNet-0.3.GrlNet.WcClass
240
-
241
- static name: string
242
- }
243
-
244
- export interface WcPrivate {
245
- }
246
-
247
- export class WcPrivate {
248
-
249
- // Own properties of GrlNet-0.3.GrlNet.WcPrivate
250
-
251
- static name: string
252
- }
253
-
254
- /**
255
- * Name of the imported GIR library
256
- * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
257
- */
258
- export const __name__: string
259
- /**
260
- * Version of the imported GIR library
261
- * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
262
- */
263
- export const __version__: string
264
- // END