@girs/grlnet-0.2 0.2.0-3.2.9 → 0.2.0-4.0.0-beta.1
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 +1 -1
- package/grlnet-0.2-ambient.d.ts +2 -2
- package/grlnet-0.2-import.d.ts +1 -11
- package/grlnet-0.2.d.ts +170 -237
- package/grlnet-0.2.js +0 -4
- package/package.json +12 -17
- package/grlnet-0.2.cjs +0 -11
- package/grlnet-0.2.d.cts +0 -265
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

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