-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappstreamcompose-1.0.d.ts
More file actions
1677 lines (1523 loc) · 61.1 KB
/
appstreamcompose-1.0.d.ts
File metadata and controls
1677 lines (1523 loc) · 61.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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
78
79
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/// <reference path="./appstream-1.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AppStreamCompose?version=1.0' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type AppStream from 'gi://AppStream?version=1.0';
export namespace AppStreamCompose {
/**
* AppStreamCompose-1.0
*/
/**
* A drawing error.
* @gir-type Struct
*/
class CanvasError extends GLib.Error {
static $gtype: GObject.GType<GLib.Error>;
// Static fields
/**
* Generic failure.
*/
static FAILED: number;
/**
* Drawing operation failed.
*/
static DRAWING: number;
/**
* Issue with font or font selection.
*/
static FONT: number;
/**
* The requested action was not supported.
*/
static UNSUPPORTED: number;
// Constructors
constructor(options: { message: string; code: number });
// Static methods
static quark(): GLib.Quark;
}
/**
* A metadata composition error.
* @gir-type Struct
*/
class ComposeError extends GLib.Error {
static $gtype: GObject.GType<GLib.Error>;
// Static fields
/**
* Generic failure.
*/
static FAILED: number;
// Constructors
constructor(options: { message: string; code: number });
// Static methods
static quark(): GLib.Quark;
}
/**
* @gir-type Enum
*/
export namespace IconState {
export const $gtype: GObject.GType<IconState>;
}
/**
* Designated state for an icon of a given size.
* @gir-type Enum
*/
enum IconState {
/**
* Ignore icons of this size.
*/
IGNORED,
/**
* Create cache for the icon, and provide remote link as well.
*/
CACHED_REMOTE,
/**
* Set if the icon should be stored in an icon tarball and be cached locally.
*/
CACHED_ONLY,
/**
* Set if this icon should be stored remotely and fetched on demand.
*/
REMOTE_ONLY,
}
/**
* An image processing error.
* @gir-type Struct
*/
class ImageError extends GLib.Error {
static $gtype: GObject.GType<GLib.Error>;
// Static fields
/**
* Generic failure.
*/
static FAILED: number;
/**
* The graphic type is not supported.
*/
static UNSUPPORTED: number;
// Constructors
constructor(options: { message: string; code: number });
// Static methods
static quark(): GLib.Quark;
}
/**
* @gir-type Enum
*/
export namespace ImageFormat {
export const $gtype: GObject.GType<ImageFormat>;
}
/**
* File format of an image.
* @gir-type Enum
*/
enum ImageFormat {
/**
* Unknown image format.
*/
UNKNOWN,
/**
* PNG format
*/
PNG,
/**
* JPEG format
*/
JPEG,
/**
* GIF format
*/
GIF,
/**
* SVG format
*/
SVG,
/**
* Compressed SVG format
*/
SVGZ,
/**
* WebP format
*/
WEBP,
/**
* AVIF format
*/
AVIF,
/**
* XPM format
*/
XPM,
}
/**
* Builds a global component ID from a component-id
* and a (usually MD5) checksum generated from the component data.
*
* The global-id is used as a global, unique identifier for a component.
* (while the component-ID is local, e.g. for one source).
* Its primary usecase is to identify a media directory on the filesystem which is
* associated with this component.
* @param component_id an AppStream component ID.
* @param checksum a MD5 hashsum as string generated from the component's combined metadata.
*/
function build_component_global_id(component_id: string, checksum: string): string;
/**
* @returns An error quark.
*/
function canvas_error_quark(): GLib.Quark;
/**
* @returns An error quark.
*/
function compose_error_quark(): GLib.Quark;
/**
* Generate a filename from a web-URL that can be used to store the
* file on disk after download.
* @param url The URL to extract a filename from.
*/
function filename_from_url(url: string): string;
/**
* Register a new hint tag. If a previous tag with the given name
* already existed, the existing tag will not be replaced unless
* `overrideExisting` is set to `true`.
* Please be careful when overriding tags! Tag severities can not
* be lowered by overriding a tag.
* @param tag the tag-ID to add
* @param severity the tag severity as {@link AppStream.IssueSeverity}
* @param explanation the tag explanatory message
* @param overrideExisting whether an existing tag should be replaced
* @returns `true` if the tag was registered and did not exist previously.
*/
function globals_add_hint_tag(
tag: string,
severity: AppStream.IssueSeverity,
explanation: string,
overrideExisting: boolean,
): boolean;
/**
* Clear all global state and restore defaults.
*/
function globals_clear(): void;
/**
* Get path to the "ffprobe" binary we should use.
*/
function globals_get_ffprobe_binary(): string;
/**
* Retrieve all hint tags that we know.
* @returns A list of valid hint tags. Free with %g_strfreev
*/
function globals_get_hint_tags(): string[];
/**
* Get path to the "optipng" binary we should use.
*/
function globals_get_optipng_binary(): string;
/**
* Get temporary directory used by appstream-compose.
*/
function globals_get_tmp_dir(): string;
/**
* Get temporary directory used by appstream-compose
* and try to create it if it does not exist.
*/
function globals_get_tmp_dir_create(): string;
/**
* Get whether images should be optimized using optipng.
*/
function globals_get_use_optipng(): boolean;
/**
* Retrieve the explanation template of the given hint tag.
* @param tag
* @returns An explanation template, or `null` if the tag was not found.
*/
function globals_hint_tag_explanation(tag: string): string;
/**
* Retrieve the severity of the given hint tag.
* @param tag
* @returns An {@link AppStream.IssueSeverity} or {@link AppStream.IssueSeverity.UNKNOWN} if the tag did not exist or has an unknown severity.
*/
function globals_hint_tag_severity(tag: string): AppStream.IssueSeverity;
/**
* Set path to the "ffprobe" binary we should use.
* @param path
*/
function globals_set_ffprobe_binary(path: string): void;
/**
* Set path to the "optipng" binary we should use.
* @param path
*/
function globals_set_optipng_binary(path: string): void;
/**
* Set temporary directory used by appstream-compose.
* @param path
*/
function globals_set_tmp_dir(path: string): void;
/**
* Set whether images should be optimized using optipng.
* @param enabled
*/
function globals_set_use_optipng(enabled: boolean): void;
/**
* Converts the text representation to an enumerated value.
* @param state_str the string.
* @returns a {@link AppStreamCompose.IconState}
*/
function icon_state_from_string(state_str: string): IconState;
/**
* Converts the enumerated value to an text representation.
* @param istate the {@link AppStreamCompose.IconState}.
* @returns string version of `istate`
*/
function icon_state_to_string(istate: IconState): string;
/**
* @returns An error quark.
*/
function image_error_quark(): GLib.Quark;
/**
* Returns the image format type based on the given file's filename.
* @param fname the filename.
* @returns a {@link AppStreamCompose.ImageFormat} or {@link AppStreamCompose.ImageFormat.UNKNOWN} for unknown
*/
function image_format_from_filename(fname: string): ImageFormat;
/**
* Converts the text representation to an enumerated value.
* @param str the string.
* @returns a {@link AppStreamCompose.ImageFormat} or {@link AppStreamCompose.ImageFormat.UNKNOWN} for unknown
*/
function image_format_from_string(str: string): ImageFormat;
/**
* Converts the enumerated value to an text representation.
* @param format the %AscImageFormat.
* @returns string version of `format`
*/
function image_format_to_string(format: ImageFormat): string;
/**
* Optimizes a PNG graphic for size with optipng, if its binary
* is available and this feature is enabled.
* @param fname Filename of the PNG image to optimize.
*/
function optimize_png(fname: string): boolean;
/**
* @param src
* @param radius
* @param iterations
*/
function pixbuf_blur(src: GdkPixbuf.Pixbuf, radius: number, iterations: number): void;
/**
* @param src
* @param radius
* @param amount
*/
function pixbuf_sharpen(src: GdkPixbuf.Pixbuf, radius: number, amount: number): void;
/**
* @gir-type Callback
*/
interface CheckMetadataEarlyFn {
(cres: Result, unit: Unit): void;
}
/**
* @gir-type Flags
*/
export namespace ComposeFlags {
export const $gtype: GObject.GType<ComposeFlags>;
}
/**
* @gir-type Flags
*/
enum ComposeFlags {
NONE,
USE_THREADS,
ALLOW_NET,
VALIDATE,
STORE_SCREENSHOTS,
ALLOW_SCREENCASTS,
PROCESS_FONTS,
PROCESS_TRANSLATIONS,
IGNORE_ICONS,
PROCESS_UNPAIRED_DESKTOP,
PROPAGATE_CUSTOM,
PROPAGATE_ARTIFACTS,
NO_FINAL_CHECK,
NO_PARTIAL_URLS,
}
/**
* @gir-type Flags
*/
export namespace ImageLoadFlags {
export const $gtype: GObject.GType<ImageLoadFlags>;
}
/**
* The flags used for loading images.
* @gir-type Flags
*/
enum ImageLoadFlags {
/**
* No special flags set
*/
NONE,
/**
* Sharpen the resulting image
*/
SHARPEN,
/**
* Allow loading of unsupported image types.
*/
ALLOW_UNSUPPORTED,
/**
* Always resize the source image to the perfect size
*/
ALWAYS_RESIZE,
}
/**
* @gir-type Flags
*/
export namespace ImageSaveFlags {
export const $gtype: GObject.GType<ImageSaveFlags>;
}
/**
* The flags used for saving images.
* @gir-type Flags
*/
enum ImageSaveFlags {
/**
* No special flags set
*/
NONE,
/**
* Optimize generated PNG for size
*/
OPTIMIZE,
/**
* Pad with alpha to 16:9 aspect
*/
PAD_16_9,
/**
* Sharpen the image to clarify detail
*/
SHARPEN,
/**
* Blur the image to clear detail
*/
BLUR,
}
namespace Canvas {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* @gir-type Class
*/
class Canvas extends GObject.Object {
static $gtype: GObject.GType<Canvas>;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: Canvas.SignalSignatures;
// Constructors
constructor(properties?: Partial<Canvas.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](width: number, height: number): Canvas;
// Signals
/** @signal */
connect<K extends keyof Canvas.SignalSignatures>(
signal: K,
callback: GObject.SignalCallback<this, Canvas.SignalSignatures[K]>,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after<K extends keyof Canvas.SignalSignatures>(
signal: K,
callback: GObject.SignalCallback<this, Canvas.SignalSignatures[K]>,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit<K extends keyof Canvas.SignalSignatures>(
signal: K,
...args: GObject.GjsParameters<Canvas.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Gets the canvas height.
*/
get_height(): number;
/**
* Gets the canvas width.
*/
get_width(): number;
/**
* Render an SVG graphic from the SVG data provided.
* @param stream SVG data input stream.
*/
render_svg(stream: Gio.InputStream): boolean;
/**
* Save canvas to PNG file.
* @param fname Filename to save to.
*/
save_png(fname: string): boolean;
}
namespace Compose {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* @gir-type Class
*/
class Compose extends GObject.Object {
static $gtype: GObject.GType<Compose>;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: Compose.SignalSignatures;
// Constructors
constructor(properties?: Partial<Compose.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Compose;
// Signals
/** @signal */
connect<K extends keyof Compose.SignalSignatures>(
signal: K,
callback: GObject.SignalCallback<this, Compose.SignalSignatures[K]>,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after<K extends keyof Compose.SignalSignatures>(
signal: K,
callback: GObject.SignalCallback<this, Compose.SignalSignatures[K]>,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit<K extends keyof Compose.SignalSignatures>(
signal: K,
...args: GObject.GjsParameters<Compose.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Adds a component ID to the allowlist. If the list is not empty, only
* components in the list will be added to the metadata output.
* @param component_id The component-id to whitelist
*/
add_allowed_cid(component_id: string): void;
/**
* Add a key to the allowlist that is used to filter custom tag values.
* @param key_id the custom key to add to the allowed list.
*/
add_custom_allowed(key_id: string): void;
/**
* Add compose flags.
* @param flags The compose flags to add.
*/
add_flags(flags: ComposeFlags): void;
/**
* Add an {@link AppStreamCompose.Unit} as data source for metadata processing.
* @param unit The {@link AppStreamCompose.Unit} to add
*/
add_unit(unit: Unit): void;
/**
* Get the results components extracted in the last data processing run.
* @returns The components
*/
fetch_components(): AppStream.Component[];
/**
* Perform final validation of generated data for the specified
* result container.
* @param result the {@link AppStreamCompose.Result} to finalize
*/
finalize_result(result: Result): void;
/**
* Perform final validation of generated data.
* Calling this function is not necessary, unless the final check was explicitly
* disabled using the {@link AppStreamCompose.ComposeFlags.NO_FINAL_CHECK} flag.
*/
finalize_results(): void;
/**
* Get the CA file used to verify peers with, or `null` for default.
*/
get_cainfo(): string;
/**
* Get the data result directory.
*/
get_data_result_dir(): string;
/**
* Get the flags controlling compose behavior.
*/
get_flags(): ComposeFlags;
/**
* get the format type we are generating.
*/
get_format(): AppStream.FormatKind;
/**
* Get hints report output directory.
*/
get_hints_result_dir(): string;
/**
* Get the policy for how icons should be distributed to
* any AppStream clients.
* @returns an {@link AppStreamCompose.IconPolicy}
*/
get_icon_policy(): IconPolicy;
/**
* Get the icon result directory.
*/
get_icons_result_dir(): string;
/**
* Get the unit we use for locale processing
* @returns The unit used for locale processing, or `null` for default.
*/
get_locale_unit(): Unit | null;
/**
* Get the maximum size a screenshot video or image can have.
* A size < 0 may be returned for no limit, setting a limit of 0
* will disable screenshots.
*/
get_max_screenshot_size(): number;
/**
* Get the media base URL to be used for the generated data,
* or `null` if no media is cached.
*/
get_media_baseurl(): string;
/**
* Get the media result directory, that can be served on a webserver.
*/
get_media_result_dir(): string;
/**
* Get the metadata origin field.
*/
get_origin(): string;
/**
* Get the directory prefix used for processing.
*/
get_prefix(): string;
/**
* Get the results of the last processing run.
* @returns The results
*/
get_results(): Result[];
/**
* Check if the last run generated any errors (which will cause metadata to be ignored).
* @returns `true` if we had errors.
*/
has_errors(): boolean;
/**
* Remove a key from the allowlist used to filter the `<custom/>` tag entries.
* @param key_id the custom key to drop from the allowed list.
*/
remove_custom_allowed(key_id: string): void;
/**
* Remove compose flags.
* @param flags The compose flags to remove.
*/
remove_flags(flags: ComposeFlags): void;
/**
* Reset the results, units and run-specific settings so the
* instance can be reused for another metadata generation run.
*/
reset(): void;
/**
* Process the registered units and generate catalog metadata from
* found components.
* @param cancellable a {@link Gio.Cancellable}.
* @returns The results, or `null` on error
*/
run(cancellable?: Gio.Cancellable | null): Result[];
/**
* Set a CA file holding one or more certificates to verify peers with
* for download operations performed by this {@link AppStreamCompose.Compose}.
* @param cainfo a valid file path
*/
set_cainfo(cainfo: string): void;
/**
* Set an custom callback to be run when most of the metadata has been loaded,
* but no expensive operations (like downloads or icon rendering) have been done yet.
* This can be used to ignore unwanted components early on.
*
* The callback function may be called from any thread, so it needs to ensure thread safety on its own.
* @param func the `AscCheckMetainfoLoadResultFn` function to be called
*/
set_check_metadata_early_func(func: CheckMetadataEarlyFn): void;
/**
* Set an output location where generated metadata should be saved.
* If this is set to `null`, no metadata will be saved.
* @param dir the metadata save location.
*/
set_data_result_dir(dir: string): void;
/**
* Set compose flags bitfield that controls the enabled features
* for this {@link AppStreamCompose.Compose}.
* @param flags The compose flags bitfield.
*/
set_flags(flags: ComposeFlags): void;
/**
* Set the format kind of the catalog metadata that we should generate.
* @param kind The format, e.g. {@link AppStream.FormatKind.XML}
*/
set_format(kind: AppStream.FormatKind): void;
/**
* Set an output location for HTML reports of issues generated
* during a compose run.
* @param dir the hints data directory.
*/
set_hints_result_dir(dir: string): void;
/**
* Set an icon policy object, overriding the existing one.
* @param policy an {@link AppStreamCompose.IconPolicy} instance
*/
set_icon_policy(policy: IconPolicy): void;
/**
* Set an output location where plain icons for the processed metadata
* are stored.
* @param dir the icon storage location.
*/
set_icons_result_dir(dir: string): void;
/**
* Set a specific unit that is used for fetching locale information.
* This may be useful in case a special language pack layout is used,
* but is generally not necessary to be set explicitly, as locale
* will be found in the unit where the metadata is by default.
* @param locale_unit the unit used for locale processing.
*/
set_locale_unit(locale_unit: Unit): void;
/**
* Set the maximum size a screenshot video or image can have.
* A size < 0 may be set to allow unlimited sizes, setting a limit of 0
* will disable screenshot caching entirely.
* @param size_bytes maximum size of a screenshot image or video in bytes
*/
set_max_screenshot_size(size_bytes: bigint | number): void;
/**
* Set the media base URL for the generated metadata. Can be `null` if no media
* should be cached and the original URLs should be kept.
* @param url the media base URL.
*/
set_media_baseurl(url?: string | null): void;
/**
* Set an output location to store media (screenshots, icons, ...) that
* will be served on a webserver via the URL set as media baseurl.
* @param dir the media storage location.
*/
set_media_result_dir(dir: string): void;
/**
* Set the metadata origin field (e.g. "debian" or "flathub")
* @param origin the origin.
*/
set_origin(origin: string): void;
/**
* Set the directory prefix the to-be-processed units are using.
* @param prefix a directory prefix, e.g. "/usr"
*/
set_prefix(prefix: string): void;
}
namespace DirectoryUnit {
// Signal signatures
interface SignalSignatures extends Unit.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends Unit.ConstructorProps {}
}
/**
* @gir-type Class
*/
class DirectoryUnit extends Unit {
static $gtype: GObject.GType<DirectoryUnit>;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: DirectoryUnit.SignalSignatures;
// Constructors
constructor(properties?: Partial<DirectoryUnit.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](root_dir: string): DirectoryUnit;
// Conflicted with AppStreamCompose.Unit.new
static ['new'](...args: never[]): any;
// Signals
/** @signal */
connect<K extends keyof DirectoryUnit.SignalSignatures>(
signal: K,
callback: GObject.SignalCallback<this, DirectoryUnit.SignalSignatures[K]>,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after<K extends keyof DirectoryUnit.SignalSignatures>(
signal: K,
callback: GObject.SignalCallback<this, DirectoryUnit.SignalSignatures[K]>,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit<K extends keyof DirectoryUnit.SignalSignatures>(
signal: K,
...args: GObject.GjsParameters<DirectoryUnit.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Get the root directory path for this unit.
*/
get_root(): string;
/**
* Sets the root directory path for this unit.
* @param root_dir Absolute directory path
*/
set_root(root_dir: string): void;
}
namespace Hint {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* @gir-type Class
*/
class Hint extends GObject.Object {
static $gtype: GObject.GType<Hint>;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: Hint.SignalSignatures;
// Constructors
constructor(properties?: Partial<Hint.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Hint;
static new_for_tag(tag: string): Hint;
// Signals
/** @signal */
connect<K extends keyof Hint.SignalSignatures>(
signal: K,
callback: GObject.SignalCallback<this, Hint.SignalSignatures[K]>,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after<K extends keyof Hint.SignalSignatures>(
signal: K,
callback: GObject.SignalCallback<this, Hint.SignalSignatures[K]>,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit<K extends keyof Hint.SignalSignatures>(
signal: K,
...args: GObject.GjsParameters<Hint.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Add a replacement variable for the explanation text.
* @param var_name Name of the variable to be replaced.
* @param text Replacement for the variable name.
*/
add_explanation_var(var_name: string, text: string): void;
/**
* Formats the explanation template to return a human-redable issue hint
* explanation, with all placeholder variables replaced.
* @returns Explanation text for this hint, with variables replaced.
*/
format_explanation(): string;
/**
* Gets the explanation template for this hint.
*/
get_explanation_template(): string;
/**
* Returns a list with the flattened key/value pairs for this hint.
* Values are located in uneven list entries, following their keys in even list entries.
* @returns A flattened {@link GLib.PtrArray} with the key/value pairs.
*/
get_explanation_vars_list(): string[];
/**
* Gets the issue severity of this hint.
*/
get_severity(): AppStream.IssueSeverity;
/**
* Gets the unique tag for the type of this hint.
*/
get_tag(): string;
/**
* @returns `true` if this hint describes an error.
*/
is_error(): boolean;
/**
* Check if this hint is valid (it requires at least a tag and a severity
* in order to be considered valid).
* @returns `true` if this hint is valid.
*/
is_valid(): boolean;
/**
* Sets the explanation template for this hint.
* @param explanation_tmpl
*/
set_explanation_template(explanation_tmpl: string): void;
/**
* Sets the issue severity of this hint.
* @param severity
*/
set_severity(severity: AppStream.IssueSeverity): void;
/**
* Sets the unique tag for the type of this hint.
* @param tag
*/
set_tag(tag: string): void;
}
namespace IconPolicy {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* @gir-type Class
*/
class IconPolicy extends GObject.Object {
static $gtype: GObject.GType<IconPolicy>;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal