@girs/appstreamcompose-1.0 1.0.0-4.0.0-beta.39 → 1.0.0-4.0.0-beta.41
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/appstreamcompose-1.0.d.ts +252 -251
- package/package.json +7 -8
- package/tsconfig.json +21 -1
- package/typedoc.json +3 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for AppStreamCompose-1.0, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.
|
|
8
|
+
GJS TypeScript type definitions for AppStreamCompose-1.0, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.41.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
@@ -14,7 +14,6 @@ import type Gio from '@girs/gio-2.0';
|
|
|
14
14
|
import type GObject from '@girs/gobject-2.0';
|
|
15
15
|
import type GLib from '@girs/glib-2.0';
|
|
16
16
|
import type GModule from '@girs/gmodule-2.0';
|
|
17
|
-
import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
|
|
18
17
|
import type AppStream from '@girs/appstream-1.0';
|
|
19
18
|
|
|
20
19
|
export namespace AppStreamCompose {
|
|
@@ -22,45 +21,12 @@ export namespace AppStreamCompose {
|
|
|
22
21
|
* AppStreamCompose-1.0
|
|
23
22
|
*/
|
|
24
23
|
|
|
25
|
-
/**
|
|
26
|
-
* A drawing error.
|
|
27
|
-
*/
|
|
28
|
-
class CanvasError extends GLib.Error {
|
|
29
|
-
static $gtype: GObject.GType<CanvasError>;
|
|
30
|
-
|
|
31
|
-
// Static fields
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Generic failure.
|
|
35
|
-
*/
|
|
36
|
-
static FAILED: number;
|
|
37
|
-
/**
|
|
38
|
-
* Drawing operation failed.
|
|
39
|
-
*/
|
|
40
|
-
static DRAWING: number;
|
|
41
|
-
/**
|
|
42
|
-
* Issue with font or font selection.
|
|
43
|
-
*/
|
|
44
|
-
static FONT: number;
|
|
45
|
-
/**
|
|
46
|
-
* The requested action was not supported.
|
|
47
|
-
*/
|
|
48
|
-
static UNSUPPORTED: number;
|
|
49
|
-
|
|
50
|
-
// Constructors
|
|
51
|
-
|
|
52
|
-
constructor(options: { message: string; code: number });
|
|
53
|
-
|
|
54
|
-
// Static methods
|
|
55
|
-
|
|
56
|
-
static quark(): GLib.Quark;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
24
|
/**
|
|
60
25
|
* A metadata composition error.
|
|
26
|
+
* @gir-type Struct
|
|
61
27
|
*/
|
|
62
28
|
class ComposeError extends GLib.Error {
|
|
63
|
-
static $gtype: GObject.GType<
|
|
29
|
+
static $gtype: GObject.GType<GLib.Error>;
|
|
64
30
|
|
|
65
31
|
// Static fields
|
|
66
32
|
|
|
@@ -79,16 +45,16 @@ export namespace AppStreamCompose {
|
|
|
79
45
|
}
|
|
80
46
|
|
|
81
47
|
/**
|
|
82
|
-
*
|
|
83
|
-
*/
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Designated state for an icon of a given size.
|
|
48
|
+
* @gir-type Enum
|
|
87
49
|
*/
|
|
88
50
|
export namespace IconState {
|
|
89
51
|
export const $gtype: GObject.GType<IconState>;
|
|
90
52
|
}
|
|
91
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Designated state for an icon of a given size.
|
|
56
|
+
* @gir-type Enum
|
|
57
|
+
*/
|
|
92
58
|
enum IconState {
|
|
93
59
|
/**
|
|
94
60
|
* Ignore icons of this size.
|
|
@@ -107,11 +73,13 @@ export namespace AppStreamCompose {
|
|
|
107
73
|
*/
|
|
108
74
|
REMOTE_ONLY,
|
|
109
75
|
}
|
|
76
|
+
|
|
110
77
|
/**
|
|
111
78
|
* An image processing error.
|
|
79
|
+
* @gir-type Struct
|
|
112
80
|
*/
|
|
113
81
|
class ImageError extends GLib.Error {
|
|
114
|
-
static $gtype: GObject.GType<
|
|
82
|
+
static $gtype: GObject.GType<GLib.Error>;
|
|
115
83
|
|
|
116
84
|
// Static fields
|
|
117
85
|
|
|
@@ -134,16 +102,16 @@ export namespace AppStreamCompose {
|
|
|
134
102
|
}
|
|
135
103
|
|
|
136
104
|
/**
|
|
137
|
-
*
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* File format of an image.
|
|
105
|
+
* @gir-type Enum
|
|
142
106
|
*/
|
|
143
107
|
export namespace ImageFormat {
|
|
144
108
|
export const $gtype: GObject.GType<ImageFormat>;
|
|
145
109
|
}
|
|
146
110
|
|
|
111
|
+
/**
|
|
112
|
+
* File format of an image.
|
|
113
|
+
* @gir-type Enum
|
|
114
|
+
*/
|
|
147
115
|
enum ImageFormat {
|
|
148
116
|
/**
|
|
149
117
|
* Unknown image format.
|
|
@@ -154,13 +122,17 @@ export namespace AppStreamCompose {
|
|
|
154
122
|
*/
|
|
155
123
|
PNG,
|
|
156
124
|
/**
|
|
157
|
-
* JPEG format
|
|
125
|
+
* JPEG-XL format
|
|
158
126
|
*/
|
|
159
|
-
|
|
127
|
+
JXL,
|
|
160
128
|
/**
|
|
161
|
-
*
|
|
129
|
+
* AVIF format
|
|
162
130
|
*/
|
|
163
|
-
|
|
131
|
+
AVIF,
|
|
132
|
+
/**
|
|
133
|
+
* WebP format
|
|
134
|
+
*/
|
|
135
|
+
WEBP,
|
|
164
136
|
/**
|
|
165
137
|
* SVG format
|
|
166
138
|
*/
|
|
@@ -170,18 +142,19 @@ export namespace AppStreamCompose {
|
|
|
170
142
|
*/
|
|
171
143
|
SVGZ,
|
|
172
144
|
/**
|
|
173
|
-
*
|
|
145
|
+
* JPEG format
|
|
174
146
|
*/
|
|
175
|
-
|
|
147
|
+
JPEG,
|
|
176
148
|
/**
|
|
177
|
-
*
|
|
149
|
+
* GIF format
|
|
178
150
|
*/
|
|
179
|
-
|
|
151
|
+
GIF,
|
|
180
152
|
/**
|
|
181
153
|
* XPM format
|
|
182
154
|
*/
|
|
183
155
|
XPM,
|
|
184
156
|
}
|
|
157
|
+
|
|
185
158
|
/**
|
|
186
159
|
* Builds a global component ID from a component-id
|
|
187
160
|
* and a (usually MD5) checksum generated from the component data.
|
|
@@ -194,7 +167,9 @@ export namespace AppStreamCompose {
|
|
|
194
167
|
* @param checksum a MD5 hashsum as string generated from the component's combined metadata.
|
|
195
168
|
*/
|
|
196
169
|
function build_component_global_id(component_id: string, checksum: string): string;
|
|
197
|
-
|
|
170
|
+
/**
|
|
171
|
+
* @returns An error quark.
|
|
172
|
+
*/
|
|
198
173
|
function compose_error_quark(): GLib.Quark;
|
|
199
174
|
/**
|
|
200
175
|
* Generate a filename from a web-URL that can be used to store the
|
|
@@ -205,14 +180,14 @@ export namespace AppStreamCompose {
|
|
|
205
180
|
/**
|
|
206
181
|
* Register a new hint tag. If a previous tag with the given name
|
|
207
182
|
* already existed, the existing tag will not be replaced unless
|
|
208
|
-
* `overrideExisting` is set to
|
|
183
|
+
* `overrideExisting` is set to `true`.
|
|
209
184
|
* Please be careful when overriding tags! Tag severities can not
|
|
210
185
|
* be lowered by overriding a tag.
|
|
211
186
|
* @param tag the tag-ID to add
|
|
212
|
-
* @param severity the tag severity as
|
|
187
|
+
* @param severity the tag severity as {@link AppStream.IssueSeverity}
|
|
213
188
|
* @param explanation the tag explanatory message
|
|
214
189
|
* @param overrideExisting whether an existing tag should be replaced
|
|
215
|
-
* @returns
|
|
190
|
+
* @returns `true` if the tag was registered and did not exist previously.
|
|
216
191
|
*/
|
|
217
192
|
function globals_add_hint_tag(
|
|
218
193
|
tag: string,
|
|
@@ -253,13 +228,13 @@ export namespace AppStreamCompose {
|
|
|
253
228
|
/**
|
|
254
229
|
* Retrieve the explanation template of the given hint tag.
|
|
255
230
|
* @param tag
|
|
256
|
-
* @returns An explanation template, or
|
|
231
|
+
* @returns An explanation template, or `null` if the tag was not found.
|
|
257
232
|
*/
|
|
258
233
|
function globals_hint_tag_explanation(tag: string): string;
|
|
259
234
|
/**
|
|
260
235
|
* Retrieve the severity of the given hint tag.
|
|
261
236
|
* @param tag
|
|
262
|
-
* @returns An
|
|
237
|
+
* @returns An {@link AppStream.IssueSeverity} or {@link AppStream.IssueSeverity.UNKNOWN} if the tag did not exist or has an unknown severity.
|
|
263
238
|
*/
|
|
264
239
|
function globals_hint_tag_severity(tag: string): AppStream.IssueSeverity;
|
|
265
240
|
/**
|
|
@@ -285,50 +260,69 @@ export namespace AppStreamCompose {
|
|
|
285
260
|
/**
|
|
286
261
|
* Converts the text representation to an enumerated value.
|
|
287
262
|
* @param state_str the string.
|
|
288
|
-
* @returns a
|
|
263
|
+
* @returns a {@link AppStreamCompose.IconState}
|
|
289
264
|
*/
|
|
290
265
|
function icon_state_from_string(state_str: string): IconState;
|
|
291
266
|
/**
|
|
292
267
|
* Converts the enumerated value to an text representation.
|
|
293
|
-
* @param istate the
|
|
294
|
-
* @returns string version of
|
|
268
|
+
* @param istate the {@link AppStreamCompose.IconState}.
|
|
269
|
+
* @returns string version of `istate`
|
|
295
270
|
*/
|
|
296
271
|
function icon_state_to_string(istate: IconState | null): string;
|
|
272
|
+
/**
|
|
273
|
+
* @returns An error quark.
|
|
274
|
+
*/
|
|
297
275
|
function image_error_quark(): GLib.Quark;
|
|
298
276
|
/**
|
|
299
277
|
* Returns the image format type based on the given file's filename.
|
|
300
278
|
* @param fname the filename.
|
|
301
|
-
* @returns a
|
|
279
|
+
* @returns a {@link AppStreamCompose.ImageFormat} or {@link AppStreamCompose.ImageFormat.UNKNOWN} for unknown
|
|
302
280
|
*/
|
|
303
281
|
function image_format_from_filename(fname: string): ImageFormat;
|
|
304
282
|
/**
|
|
305
283
|
* Converts the text representation to an enumerated value.
|
|
306
284
|
* @param str the string.
|
|
307
|
-
* @returns a
|
|
285
|
+
* @returns a {@link AppStreamCompose.ImageFormat} or {@link AppStreamCompose.ImageFormat.UNKNOWN} for unknown
|
|
308
286
|
*/
|
|
309
287
|
function image_format_from_string(str: string): ImageFormat;
|
|
310
288
|
/**
|
|
311
289
|
* Converts the enumerated value to an text representation.
|
|
312
290
|
* @param format the %AscImageFormat.
|
|
313
|
-
* @returns string version of
|
|
291
|
+
* @returns string version of `format`
|
|
314
292
|
*/
|
|
315
293
|
function image_format_to_string(format: ImageFormat | null): string;
|
|
316
294
|
/**
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
* @param
|
|
295
|
+
* Renders SVG data from a stream to a file in a specific format.
|
|
296
|
+
* @param stream Input stream with SVG data.
|
|
297
|
+
* @param width Target width.
|
|
298
|
+
* @param height Target height.
|
|
299
|
+
* @param format Target image format, e.g. {@link AppStreamCompose.ImageFormat.PNG}
|
|
300
|
+
* @param filename Filename to write to.
|
|
301
|
+
* @returns `true` for success
|
|
302
|
+
*/
|
|
303
|
+
function render_svg_to_file(
|
|
304
|
+
stream: Gio.InputStream,
|
|
305
|
+
width: number,
|
|
306
|
+
height: number,
|
|
307
|
+
format: ImageFormat | null,
|
|
308
|
+
filename: string,
|
|
309
|
+
): boolean;
|
|
310
|
+
/**
|
|
311
|
+
* @gir-type Callback
|
|
320
312
|
*/
|
|
321
|
-
function optimize_png(fname: string): boolean;
|
|
322
|
-
function pixbuf_blur(src: GdkPixbuf.Pixbuf, radius: number, iterations: number): void;
|
|
323
|
-
function pixbuf_sharpen(src: GdkPixbuf.Pixbuf, radius: number, amount: number): void;
|
|
324
313
|
interface CheckMetadataEarlyFn {
|
|
325
314
|
(cres: Result, unit: Unit): void;
|
|
326
315
|
}
|
|
327
|
-
|
|
316
|
+
/**
|
|
317
|
+
* @gir-type Flags
|
|
318
|
+
*/
|
|
328
319
|
export namespace ComposeFlags {
|
|
329
320
|
export const $gtype: GObject.GType<ComposeFlags>;
|
|
330
321
|
}
|
|
331
322
|
|
|
323
|
+
/**
|
|
324
|
+
* @gir-type Flags
|
|
325
|
+
*/
|
|
332
326
|
enum ComposeFlags {
|
|
333
327
|
NONE,
|
|
334
328
|
USE_THREADS,
|
|
@@ -345,17 +339,18 @@ export namespace AppStreamCompose {
|
|
|
345
339
|
NO_FINAL_CHECK,
|
|
346
340
|
NO_PARTIAL_URLS,
|
|
347
341
|
}
|
|
348
|
-
/**
|
|
349
|
-
* The flags used for loading images.
|
|
350
|
-
*/
|
|
351
342
|
|
|
352
343
|
/**
|
|
353
|
-
*
|
|
344
|
+
* @gir-type Flags
|
|
354
345
|
*/
|
|
355
346
|
export namespace ImageLoadFlags {
|
|
356
347
|
export const $gtype: GObject.GType<ImageLoadFlags>;
|
|
357
348
|
}
|
|
358
349
|
|
|
350
|
+
/**
|
|
351
|
+
* The flags used for loading images.
|
|
352
|
+
* @gir-type Flags
|
|
353
|
+
*/
|
|
359
354
|
enum ImageLoadFlags {
|
|
360
355
|
/**
|
|
361
356
|
* No special flags set
|
|
@@ -374,17 +369,18 @@ export namespace AppStreamCompose {
|
|
|
374
369
|
*/
|
|
375
370
|
ALWAYS_RESIZE,
|
|
376
371
|
}
|
|
377
|
-
/**
|
|
378
|
-
* The flags used for saving images.
|
|
379
|
-
*/
|
|
380
372
|
|
|
381
373
|
/**
|
|
382
|
-
*
|
|
374
|
+
* @gir-type Flags
|
|
383
375
|
*/
|
|
384
376
|
export namespace ImageSaveFlags {
|
|
385
377
|
export const $gtype: GObject.GType<ImageSaveFlags>;
|
|
386
378
|
}
|
|
387
379
|
|
|
380
|
+
/**
|
|
381
|
+
* The flags used for saving images.
|
|
382
|
+
* @gir-type Flags
|
|
383
|
+
*/
|
|
388
384
|
enum ImageSaveFlags {
|
|
389
385
|
/**
|
|
390
386
|
* No special flags set
|
|
@@ -407,74 +403,6 @@ export namespace AppStreamCompose {
|
|
|
407
403
|
*/
|
|
408
404
|
BLUR,
|
|
409
405
|
}
|
|
410
|
-
namespace Canvas {
|
|
411
|
-
// Signal signatures
|
|
412
|
-
interface SignalSignatures extends GObject.Object.SignalSignatures {}
|
|
413
|
-
|
|
414
|
-
// Constructor properties interface
|
|
415
|
-
|
|
416
|
-
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
class Canvas extends GObject.Object {
|
|
420
|
-
static $gtype: GObject.GType<Canvas>;
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* Compile-time signal type information.
|
|
424
|
-
*
|
|
425
|
-
* This instance property is generated only for TypeScript type checking.
|
|
426
|
-
* It is not defined at runtime and should not be accessed in JS code.
|
|
427
|
-
* @internal
|
|
428
|
-
*/
|
|
429
|
-
$signals: Canvas.SignalSignatures;
|
|
430
|
-
|
|
431
|
-
// Constructors
|
|
432
|
-
|
|
433
|
-
constructor(properties?: Partial<Canvas.ConstructorProps>, ...args: any[]);
|
|
434
|
-
|
|
435
|
-
_init(...args: any[]): void;
|
|
436
|
-
|
|
437
|
-
static ['new'](width: number, height: number): Canvas;
|
|
438
|
-
|
|
439
|
-
// Signals
|
|
440
|
-
|
|
441
|
-
connect<K extends keyof Canvas.SignalSignatures>(
|
|
442
|
-
signal: K,
|
|
443
|
-
callback: GObject.SignalCallback<this, Canvas.SignalSignatures[K]>,
|
|
444
|
-
): number;
|
|
445
|
-
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
446
|
-
connect_after<K extends keyof Canvas.SignalSignatures>(
|
|
447
|
-
signal: K,
|
|
448
|
-
callback: GObject.SignalCallback<this, Canvas.SignalSignatures[K]>,
|
|
449
|
-
): number;
|
|
450
|
-
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
451
|
-
emit<K extends keyof Canvas.SignalSignatures>(
|
|
452
|
-
signal: K,
|
|
453
|
-
...args: GObject.GjsParameters<Canvas.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
454
|
-
): void;
|
|
455
|
-
emit(signal: string, ...args: any[]): void;
|
|
456
|
-
|
|
457
|
-
// Methods
|
|
458
|
-
|
|
459
|
-
/**
|
|
460
|
-
* Gets the canvas height.
|
|
461
|
-
*/
|
|
462
|
-
get_height(): number;
|
|
463
|
-
/**
|
|
464
|
-
* Gets the canvas width.
|
|
465
|
-
*/
|
|
466
|
-
get_width(): number;
|
|
467
|
-
/**
|
|
468
|
-
* Render an SVG graphic from the SVG data provided.
|
|
469
|
-
* @param stream SVG data input stream.
|
|
470
|
-
*/
|
|
471
|
-
render_svg(stream: Gio.InputStream): boolean;
|
|
472
|
-
/**
|
|
473
|
-
* Save canvas to PNG file.
|
|
474
|
-
* @param fname Filename to save to.
|
|
475
|
-
*/
|
|
476
|
-
save_png(fname: string): boolean;
|
|
477
|
-
}
|
|
478
406
|
|
|
479
407
|
namespace Compose {
|
|
480
408
|
// Signal signatures
|
|
@@ -485,6 +413,9 @@ export namespace AppStreamCompose {
|
|
|
485
413
|
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
486
414
|
}
|
|
487
415
|
|
|
416
|
+
/**
|
|
417
|
+
* @gir-type Class
|
|
418
|
+
*/
|
|
488
419
|
class Compose extends GObject.Object {
|
|
489
420
|
static $gtype: GObject.GType<Compose>;
|
|
490
421
|
|
|
@@ -507,16 +438,19 @@ export namespace AppStreamCompose {
|
|
|
507
438
|
|
|
508
439
|
// Signals
|
|
509
440
|
|
|
441
|
+
/** @signal */
|
|
510
442
|
connect<K extends keyof Compose.SignalSignatures>(
|
|
511
443
|
signal: K,
|
|
512
444
|
callback: GObject.SignalCallback<this, Compose.SignalSignatures[K]>,
|
|
513
445
|
): number;
|
|
514
446
|
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
447
|
+
/** @signal */
|
|
515
448
|
connect_after<K extends keyof Compose.SignalSignatures>(
|
|
516
449
|
signal: K,
|
|
517
450
|
callback: GObject.SignalCallback<this, Compose.SignalSignatures[K]>,
|
|
518
451
|
): number;
|
|
519
452
|
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
453
|
+
/** @signal */
|
|
520
454
|
emit<K extends keyof Compose.SignalSignatures>(
|
|
521
455
|
signal: K,
|
|
522
456
|
...args: GObject.GjsParameters<Compose.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
@@ -542,8 +476,8 @@ export namespace AppStreamCompose {
|
|
|
542
476
|
*/
|
|
543
477
|
add_flags(flags: ComposeFlags | null): void;
|
|
544
478
|
/**
|
|
545
|
-
* Add an
|
|
546
|
-
* @param unit The
|
|
479
|
+
* Add an {@link AppStreamCompose.Unit} as data source for metadata processing.
|
|
480
|
+
* @param unit The {@link AppStreamCompose.Unit} to add
|
|
547
481
|
*/
|
|
548
482
|
add_unit(unit: Unit): void;
|
|
549
483
|
/**
|
|
@@ -554,17 +488,17 @@ export namespace AppStreamCompose {
|
|
|
554
488
|
/**
|
|
555
489
|
* Perform final validation of generated data for the specified
|
|
556
490
|
* result container.
|
|
557
|
-
* @param result the
|
|
491
|
+
* @param result the {@link AppStreamCompose.Result} to finalize
|
|
558
492
|
*/
|
|
559
493
|
finalize_result(result: Result): void;
|
|
560
494
|
/**
|
|
561
495
|
* Perform final validation of generated data.
|
|
562
496
|
* Calling this function is not necessary, unless the final check was explicitly
|
|
563
|
-
* disabled using the
|
|
497
|
+
* disabled using the {@link AppStreamCompose.ComposeFlags.NO_FINAL_CHECK} flag.
|
|
564
498
|
*/
|
|
565
499
|
finalize_results(): void;
|
|
566
500
|
/**
|
|
567
|
-
* Get the CA file used to verify peers with, or
|
|
501
|
+
* Get the CA file used to verify peers with, or `null` for default.
|
|
568
502
|
*/
|
|
569
503
|
get_cainfo(): string;
|
|
570
504
|
/**
|
|
@@ -586,7 +520,7 @@ export namespace AppStreamCompose {
|
|
|
586
520
|
/**
|
|
587
521
|
* Get the policy for how icons should be distributed to
|
|
588
522
|
* any AppStream clients.
|
|
589
|
-
* @returns an
|
|
523
|
+
* @returns an {@link AppStreamCompose.IconPolicy}
|
|
590
524
|
*/
|
|
591
525
|
get_icon_policy(): IconPolicy;
|
|
592
526
|
/**
|
|
@@ -595,7 +529,7 @@ export namespace AppStreamCompose {
|
|
|
595
529
|
get_icons_result_dir(): string;
|
|
596
530
|
/**
|
|
597
531
|
* Get the unit we use for locale processing
|
|
598
|
-
* @returns The unit used for locale processing, or
|
|
532
|
+
* @returns The unit used for locale processing, or `null` for default.
|
|
599
533
|
*/
|
|
600
534
|
get_locale_unit(): Unit | null;
|
|
601
535
|
/**
|
|
@@ -606,7 +540,7 @@ export namespace AppStreamCompose {
|
|
|
606
540
|
get_max_screenshot_size(): number;
|
|
607
541
|
/**
|
|
608
542
|
* Get the media base URL to be used for the generated data,
|
|
609
|
-
* or
|
|
543
|
+
* or `null` if no media is cached.
|
|
610
544
|
*/
|
|
611
545
|
get_media_baseurl(): string;
|
|
612
546
|
/**
|
|
@@ -628,7 +562,7 @@ export namespace AppStreamCompose {
|
|
|
628
562
|
get_results(): Result[];
|
|
629
563
|
/**
|
|
630
564
|
* Check if the last run generated any errors (which will cause metadata to be ignored).
|
|
631
|
-
* @returns
|
|
565
|
+
* @returns `true` if we had errors.
|
|
632
566
|
*/
|
|
633
567
|
has_errors(): boolean;
|
|
634
568
|
/**
|
|
@@ -649,13 +583,13 @@ export namespace AppStreamCompose {
|
|
|
649
583
|
/**
|
|
650
584
|
* Process the registered units and generate catalog metadata from
|
|
651
585
|
* found components.
|
|
652
|
-
* @param cancellable a
|
|
653
|
-
* @returns The results, or
|
|
586
|
+
* @param cancellable a {@link Gio.Cancellable}.
|
|
587
|
+
* @returns The results, or `null` on error
|
|
654
588
|
*/
|
|
655
589
|
run(cancellable?: Gio.Cancellable | null): Result[];
|
|
656
590
|
/**
|
|
657
591
|
* Set a CA file holding one or more certificates to verify peers with
|
|
658
|
-
* for download operations performed by this
|
|
592
|
+
* for download operations performed by this {@link AppStreamCompose.Compose}.
|
|
659
593
|
* @param cainfo a valid file path
|
|
660
594
|
*/
|
|
661
595
|
set_cainfo(cainfo: string): void;
|
|
@@ -665,24 +599,24 @@ export namespace AppStreamCompose {
|
|
|
665
599
|
* This can be used to ignore unwanted components early on.
|
|
666
600
|
*
|
|
667
601
|
* The callback function may be called from any thread, so it needs to ensure thread safety on its own.
|
|
668
|
-
* @param func the
|
|
602
|
+
* @param func the `AscCheckMetainfoLoadResultFn` function to be called
|
|
669
603
|
*/
|
|
670
604
|
set_check_metadata_early_func(func: CheckMetadataEarlyFn): void;
|
|
671
605
|
/**
|
|
672
606
|
* Set an output location where generated metadata should be saved.
|
|
673
|
-
* If this is set to
|
|
607
|
+
* If this is set to `null`, no metadata will be saved.
|
|
674
608
|
* @param dir the metadata save location.
|
|
675
609
|
*/
|
|
676
610
|
set_data_result_dir(dir: string): void;
|
|
677
611
|
/**
|
|
678
612
|
* Set compose flags bitfield that controls the enabled features
|
|
679
|
-
* for this
|
|
613
|
+
* for this {@link AppStreamCompose.Compose}.
|
|
680
614
|
* @param flags The compose flags bitfield.
|
|
681
615
|
*/
|
|
682
616
|
set_flags(flags: ComposeFlags | null): void;
|
|
683
617
|
/**
|
|
684
618
|
* Set the format kind of the catalog metadata that we should generate.
|
|
685
|
-
* @param kind The format, e.g.
|
|
619
|
+
* @param kind The format, e.g. {@link AppStream.FormatKind.XML}
|
|
686
620
|
*/
|
|
687
621
|
set_format(kind: AppStream.FormatKind | null): void;
|
|
688
622
|
/**
|
|
@@ -693,7 +627,7 @@ export namespace AppStreamCompose {
|
|
|
693
627
|
set_hints_result_dir(dir: string): void;
|
|
694
628
|
/**
|
|
695
629
|
* Set an icon policy object, overriding the existing one.
|
|
696
|
-
* @param policy an
|
|
630
|
+
* @param policy an {@link AppStreamCompose.IconPolicy} instance
|
|
697
631
|
*/
|
|
698
632
|
set_icon_policy(policy: IconPolicy): void;
|
|
699
633
|
/**
|
|
@@ -718,7 +652,7 @@ export namespace AppStreamCompose {
|
|
|
718
652
|
*/
|
|
719
653
|
set_max_screenshot_size(size_bytes: number): void;
|
|
720
654
|
/**
|
|
721
|
-
* Set the media base URL for the generated metadata. Can be
|
|
655
|
+
* Set the media base URL for the generated metadata. Can be `null` if no media
|
|
722
656
|
* should be cached and the original URLs should be kept.
|
|
723
657
|
* @param url the media base URL.
|
|
724
658
|
*/
|
|
@@ -750,6 +684,9 @@ export namespace AppStreamCompose {
|
|
|
750
684
|
interface ConstructorProps extends Unit.ConstructorProps {}
|
|
751
685
|
}
|
|
752
686
|
|
|
687
|
+
/**
|
|
688
|
+
* @gir-type Class
|
|
689
|
+
*/
|
|
753
690
|
class DirectoryUnit extends Unit {
|
|
754
691
|
static $gtype: GObject.GType<DirectoryUnit>;
|
|
755
692
|
|
|
@@ -775,16 +712,19 @@ export namespace AppStreamCompose {
|
|
|
775
712
|
|
|
776
713
|
// Signals
|
|
777
714
|
|
|
715
|
+
/** @signal */
|
|
778
716
|
connect<K extends keyof DirectoryUnit.SignalSignatures>(
|
|
779
717
|
signal: K,
|
|
780
718
|
callback: GObject.SignalCallback<this, DirectoryUnit.SignalSignatures[K]>,
|
|
781
719
|
): number;
|
|
782
720
|
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
721
|
+
/** @signal */
|
|
783
722
|
connect_after<K extends keyof DirectoryUnit.SignalSignatures>(
|
|
784
723
|
signal: K,
|
|
785
724
|
callback: GObject.SignalCallback<this, DirectoryUnit.SignalSignatures[K]>,
|
|
786
725
|
): number;
|
|
787
726
|
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
727
|
+
/** @signal */
|
|
788
728
|
emit<K extends keyof DirectoryUnit.SignalSignatures>(
|
|
789
729
|
signal: K,
|
|
790
730
|
...args: GObject.GjsParameters<DirectoryUnit.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
@@ -813,6 +753,9 @@ export namespace AppStreamCompose {
|
|
|
813
753
|
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
814
754
|
}
|
|
815
755
|
|
|
756
|
+
/**
|
|
757
|
+
* @gir-type Class
|
|
758
|
+
*/
|
|
816
759
|
class Hint extends GObject.Object {
|
|
817
760
|
static $gtype: GObject.GType<Hint>;
|
|
818
761
|
|
|
@@ -837,16 +780,19 @@ export namespace AppStreamCompose {
|
|
|
837
780
|
|
|
838
781
|
// Signals
|
|
839
782
|
|
|
783
|
+
/** @signal */
|
|
840
784
|
connect<K extends keyof Hint.SignalSignatures>(
|
|
841
785
|
signal: K,
|
|
842
786
|
callback: GObject.SignalCallback<this, Hint.SignalSignatures[K]>,
|
|
843
787
|
): number;
|
|
844
788
|
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
789
|
+
/** @signal */
|
|
845
790
|
connect_after<K extends keyof Hint.SignalSignatures>(
|
|
846
791
|
signal: K,
|
|
847
792
|
callback: GObject.SignalCallback<this, Hint.SignalSignatures[K]>,
|
|
848
793
|
): number;
|
|
849
794
|
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
795
|
+
/** @signal */
|
|
850
796
|
emit<K extends keyof Hint.SignalSignatures>(
|
|
851
797
|
signal: K,
|
|
852
798
|
...args: GObject.GjsParameters<Hint.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
@@ -874,7 +820,7 @@ export namespace AppStreamCompose {
|
|
|
874
820
|
/**
|
|
875
821
|
* Returns a list with the flattened key/value pairs for this hint.
|
|
876
822
|
* Values are located in uneven list entries, following their keys in even list entries.
|
|
877
|
-
* @returns A flattened
|
|
823
|
+
* @returns A flattened {@link GLib.PtrArray} with the key/value pairs.
|
|
878
824
|
*/
|
|
879
825
|
get_explanation_vars_list(): string[];
|
|
880
826
|
/**
|
|
@@ -885,11 +831,14 @@ export namespace AppStreamCompose {
|
|
|
885
831
|
* Gets the unique tag for the type of this hint.
|
|
886
832
|
*/
|
|
887
833
|
get_tag(): string;
|
|
834
|
+
/**
|
|
835
|
+
* @returns `true` if this hint describes an error.
|
|
836
|
+
*/
|
|
888
837
|
is_error(): boolean;
|
|
889
838
|
/**
|
|
890
839
|
* Check if this hint is valid (it requires at least a tag and a severity
|
|
891
840
|
* in order to be considered valid).
|
|
892
|
-
* @returns
|
|
841
|
+
* @returns `true` if this hint is valid.
|
|
893
842
|
*/
|
|
894
843
|
is_valid(): boolean;
|
|
895
844
|
/**
|
|
@@ -918,6 +867,9 @@ export namespace AppStreamCompose {
|
|
|
918
867
|
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
919
868
|
}
|
|
920
869
|
|
|
870
|
+
/**
|
|
871
|
+
* @gir-type Class
|
|
872
|
+
*/
|
|
921
873
|
class IconPolicy extends GObject.Object {
|
|
922
874
|
static $gtype: GObject.GType<IconPolicy>;
|
|
923
875
|
|
|
@@ -940,16 +892,19 @@ export namespace AppStreamCompose {
|
|
|
940
892
|
|
|
941
893
|
// Signals
|
|
942
894
|
|
|
895
|
+
/** @signal */
|
|
943
896
|
connect<K extends keyof IconPolicy.SignalSignatures>(
|
|
944
897
|
signal: K,
|
|
945
898
|
callback: GObject.SignalCallback<this, IconPolicy.SignalSignatures[K]>,
|
|
946
899
|
): number;
|
|
947
900
|
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
901
|
+
/** @signal */
|
|
948
902
|
connect_after<K extends keyof IconPolicy.SignalSignatures>(
|
|
949
903
|
signal: K,
|
|
950
904
|
callback: GObject.SignalCallback<this, IconPolicy.SignalSignatures[K]>,
|
|
951
905
|
): number;
|
|
952
906
|
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
907
|
+
/** @signal */
|
|
953
908
|
emit<K extends keyof IconPolicy.SignalSignatures>(
|
|
954
909
|
signal: K,
|
|
955
910
|
...args: GObject.GjsParameters<IconPolicy.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
@@ -967,12 +922,12 @@ export namespace AppStreamCompose {
|
|
|
967
922
|
* Sets a designated state for an icon of the given size.
|
|
968
923
|
* @param icon_size the size of the icon to set policy for (e.g. 64 for 64x64px icons)
|
|
969
924
|
* @param icon_scale the icon scale factor, e.g. 1
|
|
970
|
-
* @param state the designated
|
|
925
|
+
* @param state the designated {@link AppStreamCompose.IconState}
|
|
971
926
|
*/
|
|
972
927
|
set_policy(icon_size: number, icon_scale: number, state: IconState | null): void;
|
|
973
928
|
/**
|
|
974
929
|
* Converts the current icon policy into a textual representation.
|
|
975
|
-
* @returns The icon policy serialized into a string. Free with g_free()
|
|
930
|
+
* @returns The icon policy serialized into a string. Free with `g_free()`
|
|
976
931
|
*/
|
|
977
932
|
to_string(): string;
|
|
978
933
|
}
|
|
@@ -986,6 +941,9 @@ export namespace AppStreamCompose {
|
|
|
986
941
|
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
987
942
|
}
|
|
988
943
|
|
|
944
|
+
/**
|
|
945
|
+
* @gir-type Class
|
|
946
|
+
*/
|
|
989
947
|
class Image extends GObject.Object {
|
|
990
948
|
static $gtype: GObject.GType<Image>;
|
|
991
949
|
|
|
@@ -1009,25 +967,29 @@ export namespace AppStreamCompose {
|
|
|
1009
967
|
static new_from_data(
|
|
1010
968
|
data: any | null,
|
|
1011
969
|
len: number,
|
|
1012
|
-
|
|
1013
|
-
|
|
970
|
+
dest_width: number,
|
|
971
|
+
dest_height: number,
|
|
1014
972
|
flags: ImageLoadFlags,
|
|
973
|
+
format_hint: ImageFormat,
|
|
1015
974
|
): Image;
|
|
1016
975
|
|
|
1017
|
-
static new_from_file(fname: string,
|
|
976
|
+
static new_from_file(fname: string, dest_width: number, dest_height: number, flags: ImageLoadFlags): Image;
|
|
1018
977
|
|
|
1019
978
|
// Signals
|
|
1020
979
|
|
|
980
|
+
/** @signal */
|
|
1021
981
|
connect<K extends keyof Image.SignalSignatures>(
|
|
1022
982
|
signal: K,
|
|
1023
983
|
callback: GObject.SignalCallback<this, Image.SignalSignatures[K]>,
|
|
1024
984
|
): number;
|
|
1025
985
|
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
986
|
+
/** @signal */
|
|
1026
987
|
connect_after<K extends keyof Image.SignalSignatures>(
|
|
1027
988
|
signal: K,
|
|
1028
989
|
callback: GObject.SignalCallback<this, Image.SignalSignatures[K]>,
|
|
1029
990
|
): number;
|
|
1030
991
|
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
992
|
+
/** @signal */
|
|
1031
993
|
emit<K extends keyof Image.SignalSignatures>(
|
|
1032
994
|
signal: K,
|
|
1033
995
|
...args: GObject.GjsParameters<Image.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
@@ -1048,11 +1010,6 @@ export namespace AppStreamCompose {
|
|
|
1048
1010
|
* Gets the image height.
|
|
1049
1011
|
*/
|
|
1050
1012
|
get_height(): number;
|
|
1051
|
-
/**
|
|
1052
|
-
* Gets the image pixbuf if set.
|
|
1053
|
-
* @returns the #GdkPixbuf, or %NULL
|
|
1054
|
-
*/
|
|
1055
|
-
get_pixbuf(): GdkPixbuf.Pixbuf;
|
|
1056
1013
|
/**
|
|
1057
1014
|
* Gets the image width.
|
|
1058
1015
|
*/
|
|
@@ -1060,29 +1017,28 @@ export namespace AppStreamCompose {
|
|
|
1060
1017
|
/**
|
|
1061
1018
|
* Reads an image from a file.
|
|
1062
1019
|
* @param filename filename to read from
|
|
1063
|
-
* @param
|
|
1064
|
-
* @param
|
|
1065
|
-
* @param
|
|
1066
|
-
* @
|
|
1067
|
-
|
|
1068
|
-
|
|
1020
|
+
* @param dest_width The suggested width of the constructed pixbuf, or 0 for the native size
|
|
1021
|
+
* @param dest_height The suggested height of the constructed pixbuf, or 0 for the native size
|
|
1022
|
+
* @param src_size_min The smallest source size (width or height) allowed, or 0 for no limit
|
|
1023
|
+
* @param flags a {@link AppStreamCompose.ImageLoadFlags}, e.g. {@link AppStreamCompose.ImageLoadFlags.NONE}
|
|
1024
|
+
* @returns `true` for success
|
|
1025
|
+
*/
|
|
1026
|
+
load_filename(
|
|
1027
|
+
filename: string,
|
|
1028
|
+
dest_width: number,
|
|
1029
|
+
dest_height: number,
|
|
1030
|
+
src_size_min: number,
|
|
1031
|
+
flags: ImageLoadFlags | null,
|
|
1032
|
+
): boolean;
|
|
1069
1033
|
/**
|
|
1070
1034
|
* Saves the image to a file.
|
|
1071
1035
|
* @param filename filename to write to
|
|
1072
1036
|
* @param width target width, or 0 for default
|
|
1073
1037
|
* @param height target height, or 0 for default
|
|
1074
|
-
* @param flags some
|
|
1075
|
-
* @returns
|
|
1038
|
+
* @param flags some {@link AppStreamCompose.ImageSaveFlags} values, e.g. {@link AppStreamCompose.ImageSaveFlags.PAD_16_9}
|
|
1039
|
+
* @returns `true` for success
|
|
1076
1040
|
*/
|
|
1077
1041
|
save_filename(filename: string, width: number, height: number, flags: ImageSaveFlags | null): boolean;
|
|
1078
|
-
/**
|
|
1079
|
-
* Resamples a pixbuf to a specific size.
|
|
1080
|
-
* @param width target width, or 0 for default
|
|
1081
|
-
* @param height target height, or 0 for default
|
|
1082
|
-
* @param flags some #AscImageSaveFlags values, e.g. %ASC_IMAGE_SAVE_FLAG_PAD_16_9
|
|
1083
|
-
* @returns A #GdkPixbuf of the specified size
|
|
1084
|
-
*/
|
|
1085
|
-
save_pixbuf(width: number, height: number, flags: ImageSaveFlags | null): GdkPixbuf.Pixbuf;
|
|
1086
1042
|
/**
|
|
1087
1043
|
* Scale the image to the given size.
|
|
1088
1044
|
* @param new_width The new width.
|
|
@@ -1107,11 +1063,6 @@ export namespace AppStreamCompose {
|
|
|
1107
1063
|
* @param new_width The new width.
|
|
1108
1064
|
*/
|
|
1109
1065
|
scale_to_width(new_width: number): void;
|
|
1110
|
-
/**
|
|
1111
|
-
* Sets the image pixbuf.
|
|
1112
|
-
* @param pixbuf the #GdkPixbuf, or %NULL
|
|
1113
|
-
*/
|
|
1114
|
-
set_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
|
|
1115
1066
|
}
|
|
1116
1067
|
|
|
1117
1068
|
namespace Result {
|
|
@@ -1123,6 +1074,9 @@ export namespace AppStreamCompose {
|
|
|
1123
1074
|
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
1124
1075
|
}
|
|
1125
1076
|
|
|
1077
|
+
/**
|
|
1078
|
+
* @gir-type Class
|
|
1079
|
+
*/
|
|
1126
1080
|
class Result extends GObject.Object {
|
|
1127
1081
|
static $gtype: GObject.GType<Result>;
|
|
1128
1082
|
|
|
@@ -1145,16 +1099,19 @@ export namespace AppStreamCompose {
|
|
|
1145
1099
|
|
|
1146
1100
|
// Signals
|
|
1147
1101
|
|
|
1102
|
+
/** @signal */
|
|
1148
1103
|
connect<K extends keyof Result.SignalSignatures>(
|
|
1149
1104
|
signal: K,
|
|
1150
1105
|
callback: GObject.SignalCallback<this, Result.SignalSignatures[K]>,
|
|
1151
1106
|
): number;
|
|
1152
1107
|
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
1108
|
+
/** @signal */
|
|
1153
1109
|
connect_after<K extends keyof Result.SignalSignatures>(
|
|
1154
1110
|
signal: K,
|
|
1155
1111
|
callback: GObject.SignalCallback<this, Result.SignalSignatures[K]>,
|
|
1156
1112
|
): number;
|
|
1157
1113
|
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
1114
|
+
/** @signal */
|
|
1158
1115
|
emit<K extends keyof Result.SignalSignatures>(
|
|
1159
1116
|
signal: K,
|
|
1160
1117
|
...args: GObject.GjsParameters<Result.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
@@ -1165,52 +1122,58 @@ export namespace AppStreamCompose {
|
|
|
1165
1122
|
|
|
1166
1123
|
/**
|
|
1167
1124
|
* Add component to the results set.
|
|
1168
|
-
* @param cpt The
|
|
1169
|
-
* @param bytes Source data used to generate the GCID hash, or
|
|
1170
|
-
* @returns
|
|
1125
|
+
* @param cpt The {@link AppStream.Component} to add.
|
|
1126
|
+
* @param bytes Source data used to generate the GCID hash, or `null` if nonexistent.
|
|
1127
|
+
* @returns `true` on success.
|
|
1171
1128
|
*/
|
|
1172
1129
|
add_component(cpt: AppStream.Component, bytes: GLib.Bytes | Uint8Array): boolean;
|
|
1173
1130
|
/**
|
|
1174
1131
|
* Add component to the results set, using string data.
|
|
1175
|
-
* @param cpt The
|
|
1176
|
-
* @param data Source data used to generate the GCID hash, or
|
|
1177
|
-
* @returns
|
|
1132
|
+
* @param cpt The {@link AppStream.Component} to add.
|
|
1133
|
+
* @param data Source data used to generate the GCID hash, or `null` if nonexistent.
|
|
1134
|
+
* @returns `true` on success.
|
|
1178
1135
|
*/
|
|
1179
1136
|
add_component_with_string(cpt: AppStream.Component, data: string): boolean;
|
|
1180
1137
|
/**
|
|
1181
1138
|
* Add an issue hint for a component.
|
|
1182
|
-
* @param component_id The component-ID of the affected
|
|
1139
|
+
* @param component_id The component-ID of the affected {@link AppStream.Component}
|
|
1183
1140
|
* @param tag AppStream Compose Issue hint tag
|
|
1184
1141
|
* @param kv List of key-value pairs for replacement variables.
|
|
1185
|
-
* @returns
|
|
1142
|
+
* @returns `true` if the added hint did not cause the component to be invalidated.
|
|
1186
1143
|
*/
|
|
1187
1144
|
add_hint_by_cid(component_id: string, tag: string, kv: string): boolean;
|
|
1188
1145
|
/**
|
|
1189
1146
|
* Add an issue hint for a component.
|
|
1190
|
-
* @param cpt The affected
|
|
1147
|
+
* @param cpt The affected {@link AppStream.Component}
|
|
1191
1148
|
* @param tag AppStream Compose Issue hint tag
|
|
1192
1149
|
* @param kv List of key-value pairs for replacement variables.
|
|
1193
|
-
* @returns
|
|
1150
|
+
* @returns `true` if the added hint did not cause the component to be invalidated.
|
|
1194
1151
|
*/
|
|
1195
1152
|
add_hint(cpt: AppStream.Component, tag: string, kv: string): boolean;
|
|
1153
|
+
/**
|
|
1154
|
+
* @returns The amount of components found for this unit.
|
|
1155
|
+
*/
|
|
1196
1156
|
components_count(): number;
|
|
1197
1157
|
/**
|
|
1198
|
-
* Gets all components this
|
|
1199
|
-
* @returns An array of
|
|
1158
|
+
* Gets all components this `AsResult` instance contains.
|
|
1159
|
+
* @returns An array of {@link AppStream.Component}
|
|
1200
1160
|
*/
|
|
1201
1161
|
fetch_components(): AppStream.Component[];
|
|
1202
1162
|
/**
|
|
1203
1163
|
* Get a list of all hints for all components that are registered with this result.
|
|
1204
|
-
* @returns An array of
|
|
1164
|
+
* @returns An array of {@link AppStreamCompose.Hint}
|
|
1205
1165
|
*/
|
|
1206
1166
|
fetch_hints_all(): Hint[];
|
|
1207
1167
|
/**
|
|
1208
1168
|
* Retrieve the global component-ID string for the given component-ID,
|
|
1209
|
-
* as long as component with the given ID is registered with this
|
|
1210
|
-
* Otherwise,
|
|
1169
|
+
* as long as component with the given ID is registered with this {@link AppStreamCompose.Result}.
|
|
1170
|
+
* Otherwise, `null` is returned.
|
|
1211
1171
|
* @param cid Component ID to look for.
|
|
1212
1172
|
*/
|
|
1213
1173
|
gcid_for_cid(cid: string): string;
|
|
1174
|
+
/**
|
|
1175
|
+
* @param cpt
|
|
1176
|
+
*/
|
|
1214
1177
|
gcid_for_component(cpt: AppStream.Component): string;
|
|
1215
1178
|
/**
|
|
1216
1179
|
* Gets the ID name of the bundle (a package / Flatpak / any entity containing metadata)
|
|
@@ -1224,7 +1187,7 @@ export namespace AppStreamCompose {
|
|
|
1224
1187
|
/**
|
|
1225
1188
|
* Gets the component by its component-id-
|
|
1226
1189
|
* @param cid Component ID to look for.
|
|
1227
|
-
* @returns An
|
|
1190
|
+
* @returns An {@link AppStream.Component}
|
|
1228
1191
|
*/
|
|
1229
1192
|
get_component(cid: string): AppStream.Component;
|
|
1230
1193
|
/**
|
|
@@ -1240,41 +1203,44 @@ export namespace AppStreamCompose {
|
|
|
1240
1203
|
/**
|
|
1241
1204
|
* Gets hints for a component with the given component-id.
|
|
1242
1205
|
* @param cid Component ID to look for.
|
|
1243
|
-
* @returns An array of
|
|
1206
|
+
* @returns An array of {@link AppStreamCompose.Hint} or `null`
|
|
1244
1207
|
*/
|
|
1245
1208
|
get_hints(cid: string): Hint[];
|
|
1246
1209
|
/**
|
|
1247
1210
|
* Test if a hint tag is associated with a given component in this result.
|
|
1248
|
-
* @param cpt the
|
|
1211
|
+
* @param cpt the {@link AppStream.Component} to check
|
|
1249
1212
|
* @param tag the hint tag to check for
|
|
1250
|
-
* @returns
|
|
1213
|
+
* @returns `true` if a hint with this tag exists for the selected component.
|
|
1251
1214
|
*/
|
|
1252
1215
|
has_hint(cpt: AppStream.Component, tag: string): boolean;
|
|
1216
|
+
/**
|
|
1217
|
+
* @returns The amount of hints emitted for this unit.
|
|
1218
|
+
*/
|
|
1253
1219
|
hints_count(): number;
|
|
1254
1220
|
/**
|
|
1255
|
-
* Check if an
|
|
1221
|
+
* Check if an {@link AppStream.Component} was set to be ignored in this result
|
|
1256
1222
|
* (usually due to errors).
|
|
1257
1223
|
* @param cpt the component to check for.
|
|
1258
|
-
* @returns
|
|
1224
|
+
* @returns `true` if the component is ignored.
|
|
1259
1225
|
*/
|
|
1260
1226
|
is_ignored(cpt: AppStream.Component): boolean;
|
|
1261
1227
|
/**
|
|
1262
1228
|
* Remove a component from the results set.
|
|
1263
|
-
* @param cpt The
|
|
1264
|
-
* @returns
|
|
1229
|
+
* @param cpt The {@link AppStream.Component} to remove.
|
|
1230
|
+
* @returns `true` if the component was found and removed.
|
|
1265
1231
|
*/
|
|
1266
1232
|
remove_component(cpt: AppStream.Component): boolean;
|
|
1267
1233
|
/**
|
|
1268
1234
|
* Remove a component from the results set.
|
|
1269
1235
|
* @param cid a component-ID
|
|
1270
|
-
* @returns
|
|
1236
|
+
* @returns `true` if the component was found and removed.
|
|
1271
1237
|
*/
|
|
1272
1238
|
remove_component_by_id(cid: string): boolean;
|
|
1273
1239
|
/**
|
|
1274
1240
|
* Remove a component from the results set.
|
|
1275
|
-
* @param cpt The
|
|
1276
|
-
* @param remove_gcid
|
|
1277
|
-
* @returns
|
|
1241
|
+
* @param cpt The {@link AppStream.Component} to remove.
|
|
1242
|
+
* @param remove_gcid `true` if global component ID should be unregistered as well.
|
|
1243
|
+
* @returns `true` if the component was found and removed.
|
|
1278
1244
|
*/
|
|
1279
1245
|
remove_component_full(cpt: AppStream.Component, remove_gcid: boolean): boolean;
|
|
1280
1246
|
/**
|
|
@@ -1292,20 +1258,23 @@ export namespace AppStreamCompose {
|
|
|
1292
1258
|
* @param kind
|
|
1293
1259
|
*/
|
|
1294
1260
|
set_bundle_kind(kind: AppStream.BundleKind | null): void;
|
|
1261
|
+
/**
|
|
1262
|
+
* @returns `true` if this result means the analyzed unit was ignored entirely.
|
|
1263
|
+
*/
|
|
1295
1264
|
unit_ignored(): boolean;
|
|
1296
1265
|
/**
|
|
1297
1266
|
* Update the global component ID for the given component.
|
|
1298
|
-
* @param cpt The
|
|
1299
|
-
* @param bytes The data to include in the global component ID, or
|
|
1300
|
-
* @returns
|
|
1267
|
+
* @param cpt The {@link AppStream.Component} to edit.
|
|
1268
|
+
* @param bytes The data to include in the global component ID, or `null`
|
|
1269
|
+
* @returns `true` if the component existed and was updated.
|
|
1301
1270
|
*/
|
|
1302
1271
|
update_component_gcid(cpt: AppStream.Component, bytes?: GLib.Bytes | null): boolean;
|
|
1303
1272
|
/**
|
|
1304
1273
|
* Update the global component ID for the given component.
|
|
1305
1274
|
* This is a convenience method for %asc_result_update_component_gcid
|
|
1306
|
-
* @param cpt The
|
|
1307
|
-
* @param data The data as string to include in the global component ID, or
|
|
1308
|
-
* @returns
|
|
1275
|
+
* @param cpt The {@link AppStream.Component} to edit.
|
|
1276
|
+
* @param data The data as string to include in the global component ID, or `null`
|
|
1277
|
+
* @returns `true` if the component existed and was updated.
|
|
1309
1278
|
*/
|
|
1310
1279
|
update_component_gcid_with_string(cpt: AppStream.Component, data?: string | null): boolean;
|
|
1311
1280
|
}
|
|
@@ -1319,6 +1288,9 @@ export namespace AppStreamCompose {
|
|
|
1319
1288
|
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
1320
1289
|
}
|
|
1321
1290
|
|
|
1291
|
+
/**
|
|
1292
|
+
* @gir-type Class
|
|
1293
|
+
*/
|
|
1322
1294
|
class Unit extends GObject.Object {
|
|
1323
1295
|
static $gtype: GObject.GType<Unit>;
|
|
1324
1296
|
|
|
@@ -1341,16 +1313,19 @@ export namespace AppStreamCompose {
|
|
|
1341
1313
|
|
|
1342
1314
|
// Signals
|
|
1343
1315
|
|
|
1316
|
+
/** @signal */
|
|
1344
1317
|
connect<K extends keyof Unit.SignalSignatures>(
|
|
1345
1318
|
signal: K,
|
|
1346
1319
|
callback: GObject.SignalCallback<this, Unit.SignalSignatures[K]>,
|
|
1347
1320
|
): number;
|
|
1348
1321
|
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
1322
|
+
/** @signal */
|
|
1349
1323
|
connect_after<K extends keyof Unit.SignalSignatures>(
|
|
1350
1324
|
signal: K,
|
|
1351
1325
|
callback: GObject.SignalCallback<this, Unit.SignalSignatures[K]>,
|
|
1352
1326
|
): number;
|
|
1353
1327
|
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
1328
|
+
/** @signal */
|
|
1354
1329
|
emit<K extends keyof Unit.SignalSignatures>(
|
|
1355
1330
|
signal: K,
|
|
1356
1331
|
...args: GObject.GjsParameters<Unit.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
@@ -1360,27 +1335,32 @@ export namespace AppStreamCompose {
|
|
|
1360
1335
|
// Virtual methods
|
|
1361
1336
|
|
|
1362
1337
|
/**
|
|
1363
|
-
* Close this unit, possibly freeing its resources. Calls to read_data() or
|
|
1364
|
-
* get_contents() may not produce results until open() is called again.
|
|
1338
|
+
* Close this unit, possibly freeing its resources. Calls to `read_data()` or
|
|
1339
|
+
* `get_contents()` may not produce results until `open()` is called again.
|
|
1340
|
+
* @virtual
|
|
1365
1341
|
*/
|
|
1366
1342
|
vfunc_close(): void;
|
|
1367
1343
|
/**
|
|
1368
|
-
* Returns
|
|
1344
|
+
* Returns `true` if the directory exists and files in it are readable.
|
|
1369
1345
|
* @param dirname The directory name to check.
|
|
1346
|
+
* @virtual
|
|
1370
1347
|
*/
|
|
1371
1348
|
vfunc_dir_exists(dirname: string): boolean;
|
|
1372
1349
|
/**
|
|
1373
|
-
* Returns
|
|
1350
|
+
* Returns `true` if the filename exists and is readable using %asc_unit_read_data.
|
|
1374
1351
|
* @param filename The filename to check.
|
|
1352
|
+
* @virtual
|
|
1375
1353
|
*/
|
|
1376
1354
|
vfunc_file_exists(filename: string): boolean;
|
|
1377
1355
|
/**
|
|
1378
1356
|
* Open this unit, populating its content listing.
|
|
1357
|
+
* @virtual
|
|
1379
1358
|
*/
|
|
1380
1359
|
vfunc_open(): boolean;
|
|
1381
1360
|
/**
|
|
1382
1361
|
* Read the contents of the selected file into memory and return them.
|
|
1383
1362
|
* @param filename The file to read data for.
|
|
1363
|
+
* @virtual
|
|
1384
1364
|
*/
|
|
1385
1365
|
vfunc_read_data(filename: string): GLib.Bytes;
|
|
1386
1366
|
|
|
@@ -1394,17 +1374,17 @@ export namespace AppStreamCompose {
|
|
|
1394
1374
|
*/
|
|
1395
1375
|
add_relevant_path(path: string): void;
|
|
1396
1376
|
/**
|
|
1397
|
-
* Close this unit, possibly freeing its resources. Calls to read_data() or
|
|
1398
|
-
* get_contents() may not produce results until open() is called again.
|
|
1377
|
+
* Close this unit, possibly freeing its resources. Calls to `read_data()` or
|
|
1378
|
+
* `get_contents()` may not produce results until `open()` is called again.
|
|
1399
1379
|
*/
|
|
1400
1380
|
close(): void;
|
|
1401
1381
|
/**
|
|
1402
|
-
* Returns
|
|
1382
|
+
* Returns `true` if the directory exists and files in it are readable.
|
|
1403
1383
|
* @param dirname The directory name to check.
|
|
1404
1384
|
*/
|
|
1405
1385
|
dir_exists(dirname: string): boolean;
|
|
1406
1386
|
/**
|
|
1407
|
-
* Returns
|
|
1387
|
+
* Returns `true` if the filename exists and is readable using %asc_unit_read_data.
|
|
1408
1388
|
* @param filename The filename to check.
|
|
1409
1389
|
*/
|
|
1410
1390
|
file_exists(filename: string): boolean;
|
|
@@ -1415,7 +1395,7 @@ export namespace AppStreamCompose {
|
|
|
1415
1395
|
get_bundle_id(): string;
|
|
1416
1396
|
/**
|
|
1417
1397
|
* Gets the ID name of the bundle, normalized to be safe to use
|
|
1418
|
-
* in filenames. This may *not* be the same name as set via asc_unit_get_bundle_id()
|
|
1398
|
+
* in filenames. This may *not* be the same name as set via `asc_unit_get_bundle_id()`
|
|
1419
1399
|
*/
|
|
1420
1400
|
get_bundle_id_safe(): string;
|
|
1421
1401
|
/**
|
|
@@ -1469,16 +1449,28 @@ export namespace AppStreamCompose {
|
|
|
1469
1449
|
set_user_data(user_data?: any | null): void;
|
|
1470
1450
|
}
|
|
1471
1451
|
|
|
1472
|
-
|
|
1452
|
+
/**
|
|
1453
|
+
* @gir-type Alias
|
|
1454
|
+
*/
|
|
1473
1455
|
type ComposeClass = typeof Compose;
|
|
1456
|
+
/**
|
|
1457
|
+
* @gir-type Alias
|
|
1458
|
+
*/
|
|
1474
1459
|
type DirectoryUnitClass = typeof DirectoryUnit;
|
|
1460
|
+
/**
|
|
1461
|
+
* @gir-type Alias
|
|
1462
|
+
*/
|
|
1475
1463
|
type HintClass = typeof Hint;
|
|
1464
|
+
/**
|
|
1465
|
+
* @gir-type Alias
|
|
1466
|
+
*/
|
|
1476
1467
|
type IconPolicyClass = typeof IconPolicy;
|
|
1477
1468
|
/**
|
|
1478
|
-
* A
|
|
1479
|
-
* to iterate over the icon sizes / policy entries of an
|
|
1480
|
-
*
|
|
1481
|
-
* then initialized with asc_icon_policy_iter_init()
|
|
1469
|
+
* A {@link AppStreamCompose.IconPolicyIter} structure represents an iterator that can be used
|
|
1470
|
+
* to iterate over the icon sizes / policy entries of an {@link AppStreamCompose.IconPolicy}.
|
|
1471
|
+
* {@link AppStreamCompose.IconPolicyIter} structures are typically allocated on the stack and
|
|
1472
|
+
* then initialized with `asc_icon_policy_iter_init()`.
|
|
1473
|
+
* @gir-type Struct
|
|
1482
1474
|
*/
|
|
1483
1475
|
class IconPolicyIter {
|
|
1484
1476
|
static $gtype: GObject.GType<IconPolicyIter>;
|
|
@@ -1492,9 +1484,9 @@ export namespace AppStreamCompose {
|
|
|
1492
1484
|
/**
|
|
1493
1485
|
* Initializes a policy iterator for the policy entry list and associates it
|
|
1494
1486
|
* it with `ipolicy`.
|
|
1495
|
-
* The
|
|
1487
|
+
* The {@link AppStreamCompose.IconPolicyIter} structure is typically allocated on the stack
|
|
1496
1488
|
* and does not need to be freed explicitly.
|
|
1497
|
-
* @param ipolicy an
|
|
1489
|
+
* @param ipolicy an {@link AppStreamCompose.IconPolicy}
|
|
1498
1490
|
*/
|
|
1499
1491
|
init(ipolicy: IconPolicy): void;
|
|
1500
1492
|
/**
|
|
@@ -1513,13 +1505,22 @@ export namespace AppStreamCompose {
|
|
|
1513
1505
|
* }
|
|
1514
1506
|
* ```
|
|
1515
1507
|
*
|
|
1516
|
-
* @returns
|
|
1508
|
+
* @returns `false` if the last entry has been reached.
|
|
1517
1509
|
*/
|
|
1518
1510
|
next(): [boolean, number, number, IconState | null];
|
|
1519
1511
|
}
|
|
1520
1512
|
|
|
1513
|
+
/**
|
|
1514
|
+
* @gir-type Alias
|
|
1515
|
+
*/
|
|
1521
1516
|
type ImageClass = typeof Image;
|
|
1517
|
+
/**
|
|
1518
|
+
* @gir-type Alias
|
|
1519
|
+
*/
|
|
1522
1520
|
type ResultClass = typeof Result;
|
|
1521
|
+
/**
|
|
1522
|
+
* @gir-type Alias
|
|
1523
|
+
*/
|
|
1523
1524
|
type UnitClass = typeof Unit;
|
|
1524
1525
|
/**
|
|
1525
1526
|
* Name of the imported GIR library
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/appstreamcompose-1.0",
|
|
3
|
-
"version": "1.0.0-4.0.0-beta.
|
|
3
|
+
"version": "1.0.0-4.0.0-beta.41",
|
|
4
4
|
"description": "GJS TypeScript type definitions for AppStreamCompose-1.0, generated from library version 1.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "appstreamcompose-1.0.js",
|
|
@@ -31,13 +31,12 @@
|
|
|
31
31
|
"test": "tsc --project tsconfig.json"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@girs/gjs": "4.0.0-beta.
|
|
35
|
-
"@girs/gio-2.0": "2.
|
|
36
|
-
"@girs/gobject-2.0": "2.
|
|
37
|
-
"@girs/glib-2.0": "2.
|
|
38
|
-
"@girs/gmodule-2.0": "2.0.0-4.0.0-beta.
|
|
39
|
-
"@girs/
|
|
40
|
-
"@girs/appstream-1.0": "1.1.1-4.0.0-beta.39" },
|
|
34
|
+
"@girs/gjs": "4.0.0-beta.41",
|
|
35
|
+
"@girs/gio-2.0": "2.88.0-4.0.0-beta.41",
|
|
36
|
+
"@girs/gobject-2.0": "2.88.0-4.0.0-beta.41",
|
|
37
|
+
"@girs/glib-2.0": "2.88.0-4.0.0-beta.41",
|
|
38
|
+
"@girs/gmodule-2.0": "2.0.0-4.0.0-beta.41",
|
|
39
|
+
"@girs/appstream-1.0": "1.1.0-4.0.0-beta.41" },
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"typescript": "*"
|
|
43
42
|
},
|
package/tsconfig.json
CHANGED
|
@@ -17,7 +17,27 @@
|
|
|
17
17
|
"inlineSources": false,
|
|
18
18
|
"newLine": "LF",
|
|
19
19
|
// Show diagnostics
|
|
20
|
-
"diagnostics": true
|
|
20
|
+
"diagnostics": true,
|
|
21
|
+
"paths": {
|
|
22
|
+
"@girs/gio-2.0": [
|
|
23
|
+
"../gio-2.0/index.d.ts"
|
|
24
|
+
],
|
|
25
|
+
"@girs/gobject-2.0": [
|
|
26
|
+
"../gobject-2.0/index.d.ts"
|
|
27
|
+
],
|
|
28
|
+
"@girs/glib-2.0": [
|
|
29
|
+
"../glib-2.0/index.d.ts"
|
|
30
|
+
],
|
|
31
|
+
"@girs/gmodule-2.0": [
|
|
32
|
+
"../gmodule-2.0/index.d.ts"
|
|
33
|
+
],
|
|
34
|
+
"@girs/appstream-1.0": [
|
|
35
|
+
"../appstream-1.0/index.d.ts"
|
|
36
|
+
],
|
|
37
|
+
"@girs/gjs": [
|
|
38
|
+
"../gjs/index.d.ts"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
21
41
|
},
|
|
22
42
|
"include": ["./appstreamcompose-1.0.d.ts"]
|
|
23
43
|
}
|
package/typedoc.json
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
"entryPoints": ["./appstreamcompose-1.0.d.ts"],
|
|
3
3
|
"readme": "./README.md",
|
|
4
4
|
"name": "AppStreamCompose-1.0",
|
|
5
|
-
"tsconfig": "./tsconfig.json"
|
|
5
|
+
"tsconfig": "./tsconfig.json",
|
|
6
|
+
"skipErrorChecking": true,
|
|
7
|
+
"highlightLanguages": ["typescript", "javascript", "c", "cpp", "xml", "bash", "json", "css"]
|
|
6
8
|
}
|
|
7
9
|
|