@girs/glib-2.0 2.84.0-4.0.0-beta.23 → 2.84.2-4.0.0-beta.25
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/glib-2.0.d.ts +89 -117
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for GLib-2.0, generated from library version 2.84.
|
|
8
|
+
GJS TypeScript type definitions for GLib-2.0, generated from library version 2.84.2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.25.
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
## Install
|
package/glib-2.0.d.ts
CHANGED
|
@@ -9075,15 +9075,26 @@ export namespace GLib {
|
|
|
9075
9075
|
* If you are using #GApplication the program name is set in
|
|
9076
9076
|
* g_application_run(). In case of GDK or GTK it is set in
|
|
9077
9077
|
* gdk_init(), which is called by gtk_init() and the
|
|
9078
|
-
* #GtkApplication::startup handler.
|
|
9079
|
-
* taking the last component of `argv[`0].
|
|
9078
|
+
* #GtkApplication::startup handler. By default, the program name is
|
|
9079
|
+
* found by taking the last component of `argv[`0].
|
|
9080
9080
|
*
|
|
9081
9081
|
* Since GLib 2.72, this function can be called multiple times
|
|
9082
9082
|
* and is fully thread safe. Prior to GLib 2.72, this function
|
|
9083
9083
|
* could only be called once per process.
|
|
9084
|
+
*
|
|
9085
|
+
* See the [GTK documentation](https://docs.gtk.org/gtk4/migrating-3to4.html#set-a-proper-application-id)
|
|
9086
|
+
* for requirements on integrating g_set_prgname() with GTK applications.
|
|
9084
9087
|
* @param prgname the name of the program.
|
|
9085
9088
|
*/
|
|
9086
9089
|
function set_prgname(prgname: string): void;
|
|
9090
|
+
/**
|
|
9091
|
+
* If g_get_prgname() is not set, this is the same as setting
|
|
9092
|
+
* the name via g_set_prgname() and %TRUE is returned. Otherwise,
|
|
9093
|
+
* does nothing and returns %FALSE. This is thread-safe.
|
|
9094
|
+
* @param prgname the name of the program.
|
|
9095
|
+
* @returns whether g_prgname was initialized by the call.
|
|
9096
|
+
*/
|
|
9097
|
+
function set_prgname_once(prgname: string): boolean;
|
|
9087
9098
|
/**
|
|
9088
9099
|
* Sets an environment variable. On UNIX, both the variable's name and
|
|
9089
9100
|
* value can be arbitrary byte strings, except that the variable's name
|
|
@@ -11269,7 +11280,7 @@ export namespace GLib {
|
|
|
11269
11280
|
* @param str a UCS-4 encoded string
|
|
11270
11281
|
* @returns a pointer to a newly allocated UTF-16 string. This value must be freed with [func@GLib.free].
|
|
11271
11282
|
*/
|
|
11272
|
-
function ucs4_to_utf16(str:
|
|
11283
|
+
function ucs4_to_utf16(str: string): [number, number, number];
|
|
11273
11284
|
/**
|
|
11274
11285
|
* Convert a string from a 32-bit fixed width representation as UCS-4.
|
|
11275
11286
|
* to UTF-8.
|
|
@@ -11278,7 +11289,7 @@ export namespace GLib {
|
|
|
11278
11289
|
* @param str a UCS-4 encoded string
|
|
11279
11290
|
* @returns a pointer to a newly allocated UTF-8 string. This value must be freed with [func@GLib.free]. If an error occurs, @items_read will be set to the position of the first invalid input character.
|
|
11280
11291
|
*/
|
|
11281
|
-
function ucs4_to_utf8(str:
|
|
11292
|
+
function ucs4_to_utf8(str: string): [string, number, number];
|
|
11282
11293
|
/**
|
|
11283
11294
|
* Determines the break type of `c`. `c` should be a Unicode character
|
|
11284
11295
|
* (to derive a character from UTF-8 encoded text, use
|
|
@@ -11289,13 +11300,13 @@ export namespace GLib {
|
|
|
11289
11300
|
* @param c a Unicode character
|
|
11290
11301
|
* @returns the break type of @c
|
|
11291
11302
|
*/
|
|
11292
|
-
function unichar_break_type(c:
|
|
11303
|
+
function unichar_break_type(c: string): UnicodeBreakType;
|
|
11293
11304
|
/**
|
|
11294
11305
|
* Determines the canonical combining class of a Unicode character.
|
|
11295
11306
|
* @param uc a Unicode character
|
|
11296
11307
|
* @returns the combining class of the character
|
|
11297
11308
|
*/
|
|
11298
|
-
function unichar_combining_class(uc:
|
|
11309
|
+
function unichar_combining_class(uc: string): number;
|
|
11299
11310
|
/**
|
|
11300
11311
|
* Performs a single composition step of the
|
|
11301
11312
|
* Unicode canonical composition algorithm.
|
|
@@ -11317,7 +11328,7 @@ export namespace GLib {
|
|
|
11317
11328
|
* @param b a Unicode character
|
|
11318
11329
|
* @returns %TRUE if the characters could be composed
|
|
11319
11330
|
*/
|
|
11320
|
-
function unichar_compose(a:
|
|
11331
|
+
function unichar_compose(a: string, b: string): [boolean, string];
|
|
11321
11332
|
/**
|
|
11322
11333
|
* Performs a single decomposition step of the
|
|
11323
11334
|
* Unicode canonical decomposition algorithm.
|
|
@@ -11345,14 +11356,14 @@ export namespace GLib {
|
|
|
11345
11356
|
* @param ch a Unicode character
|
|
11346
11357
|
* @returns %TRUE if the character could be decomposed
|
|
11347
11358
|
*/
|
|
11348
|
-
function unichar_decompose(ch:
|
|
11359
|
+
function unichar_decompose(ch: string): [boolean, string, string];
|
|
11349
11360
|
/**
|
|
11350
11361
|
* Determines the numeric value of a character as a decimal
|
|
11351
11362
|
* digit.
|
|
11352
11363
|
* @param c a Unicode character
|
|
11353
11364
|
* @returns If @c is a decimal digit (according to g_unichar_isdigit()), its numeric value. Otherwise, -1.
|
|
11354
11365
|
*/
|
|
11355
|
-
function unichar_digit_value(c:
|
|
11366
|
+
function unichar_digit_value(c: string): number;
|
|
11356
11367
|
/**
|
|
11357
11368
|
* Computes the canonical or compatibility decomposition of a
|
|
11358
11369
|
* Unicode character. For compatibility decomposition,
|
|
@@ -11378,7 +11389,7 @@ export namespace GLib {
|
|
|
11378
11389
|
* @param result_len length of @result
|
|
11379
11390
|
* @returns the length of the full decomposition.
|
|
11380
11391
|
*/
|
|
11381
|
-
function unichar_fully_decompose(ch:
|
|
11392
|
+
function unichar_fully_decompose(ch: string, compat: boolean, result_len: number): [number, string];
|
|
11382
11393
|
/**
|
|
11383
11394
|
* In Unicode, some characters are "mirrored". This means that their
|
|
11384
11395
|
* images are mirrored horizontally in text that is laid out from right
|
|
@@ -11392,7 +11403,7 @@ export namespace GLib {
|
|
|
11392
11403
|
* @param ch a Unicode character
|
|
11393
11404
|
* @returns %TRUE if @ch has a mirrored character, %FALSE otherwise
|
|
11394
11405
|
*/
|
|
11395
|
-
function unichar_get_mirror_char(ch:
|
|
11406
|
+
function unichar_get_mirror_char(ch: string): [boolean, string];
|
|
11396
11407
|
/**
|
|
11397
11408
|
* Looks up the #GUnicodeScript for a particular character (as defined
|
|
11398
11409
|
* by Unicode Standard Annex \#24). No check is made for `ch` being a
|
|
@@ -11404,7 +11415,7 @@ export namespace GLib {
|
|
|
11404
11415
|
* @param ch a Unicode character
|
|
11405
11416
|
* @returns the #GUnicodeScript for the character.
|
|
11406
11417
|
*/
|
|
11407
|
-
function unichar_get_script(ch:
|
|
11418
|
+
function unichar_get_script(ch: string): UnicodeScript;
|
|
11408
11419
|
/**
|
|
11409
11420
|
* Determines whether a character is alphanumeric.
|
|
11410
11421
|
* Given some UTF-8 text, obtain a character value
|
|
@@ -11412,7 +11423,7 @@ export namespace GLib {
|
|
|
11412
11423
|
* @param c a Unicode character
|
|
11413
11424
|
* @returns %TRUE if @c is an alphanumeric character
|
|
11414
11425
|
*/
|
|
11415
|
-
function unichar_isalnum(c:
|
|
11426
|
+
function unichar_isalnum(c: string): boolean;
|
|
11416
11427
|
/**
|
|
11417
11428
|
* Determines whether a character is alphabetic (i.e. a letter).
|
|
11418
11429
|
* Given some UTF-8 text, obtain a character value with
|
|
@@ -11420,7 +11431,7 @@ export namespace GLib {
|
|
|
11420
11431
|
* @param c a Unicode character
|
|
11421
11432
|
* @returns %TRUE if @c is an alphabetic character
|
|
11422
11433
|
*/
|
|
11423
|
-
function unichar_isalpha(c:
|
|
11434
|
+
function unichar_isalpha(c: string): boolean;
|
|
11424
11435
|
/**
|
|
11425
11436
|
* Determines whether a character is a control character.
|
|
11426
11437
|
* Given some UTF-8 text, obtain a character value with
|
|
@@ -11428,14 +11439,14 @@ export namespace GLib {
|
|
|
11428
11439
|
* @param c a Unicode character
|
|
11429
11440
|
* @returns %TRUE if @c is a control character
|
|
11430
11441
|
*/
|
|
11431
|
-
function unichar_iscntrl(c:
|
|
11442
|
+
function unichar_iscntrl(c: string): boolean;
|
|
11432
11443
|
/**
|
|
11433
11444
|
* Determines if a given character is assigned in the Unicode
|
|
11434
11445
|
* standard.
|
|
11435
11446
|
* @param c a Unicode character
|
|
11436
11447
|
* @returns %TRUE if the character has an assigned value
|
|
11437
11448
|
*/
|
|
11438
|
-
function unichar_isdefined(c:
|
|
11449
|
+
function unichar_isdefined(c: string): boolean;
|
|
11439
11450
|
/**
|
|
11440
11451
|
* Determines whether a character is numeric (i.e. a digit). This
|
|
11441
11452
|
* covers ASCII 0-9 and also digits in other languages/scripts. Given
|
|
@@ -11443,7 +11454,7 @@ export namespace GLib {
|
|
|
11443
11454
|
* @param c a Unicode character
|
|
11444
11455
|
* @returns %TRUE if @c is a digit
|
|
11445
11456
|
*/
|
|
11446
|
-
function unichar_isdigit(c:
|
|
11457
|
+
function unichar_isdigit(c: string): boolean;
|
|
11447
11458
|
/**
|
|
11448
11459
|
* Determines whether a character is printable and not a space
|
|
11449
11460
|
* (returns %FALSE for control characters, format characters, and
|
|
@@ -11453,7 +11464,7 @@ export namespace GLib {
|
|
|
11453
11464
|
* @param c a Unicode character
|
|
11454
11465
|
* @returns %TRUE if @c is printable unless it's a space
|
|
11455
11466
|
*/
|
|
11456
|
-
function unichar_isgraph(c:
|
|
11467
|
+
function unichar_isgraph(c: string): boolean;
|
|
11457
11468
|
/**
|
|
11458
11469
|
* Determines whether a character is a lowercase letter.
|
|
11459
11470
|
* Given some UTF-8 text, obtain a character value with
|
|
@@ -11461,7 +11472,7 @@ export namespace GLib {
|
|
|
11461
11472
|
* @param c a Unicode character
|
|
11462
11473
|
* @returns %TRUE if @c is a lowercase letter
|
|
11463
11474
|
*/
|
|
11464
|
-
function unichar_islower(c:
|
|
11475
|
+
function unichar_islower(c: string): boolean;
|
|
11465
11476
|
/**
|
|
11466
11477
|
* Determines whether a character is a mark (non-spacing mark,
|
|
11467
11478
|
* combining mark, or enclosing mark in Unicode speak).
|
|
@@ -11475,7 +11486,7 @@ export namespace GLib {
|
|
|
11475
11486
|
* @param c a Unicode character
|
|
11476
11487
|
* @returns %TRUE if @c is a mark character
|
|
11477
11488
|
*/
|
|
11478
|
-
function unichar_ismark(c:
|
|
11489
|
+
function unichar_ismark(c: string): boolean;
|
|
11479
11490
|
/**
|
|
11480
11491
|
* Determines whether a character is printable.
|
|
11481
11492
|
* Unlike g_unichar_isgraph(), returns %TRUE for spaces.
|
|
@@ -11484,7 +11495,7 @@ export namespace GLib {
|
|
|
11484
11495
|
* @param c a Unicode character
|
|
11485
11496
|
* @returns %TRUE if @c is printable
|
|
11486
11497
|
*/
|
|
11487
|
-
function unichar_isprint(c:
|
|
11498
|
+
function unichar_isprint(c: string): boolean;
|
|
11488
11499
|
/**
|
|
11489
11500
|
* Determines whether a character is punctuation or a symbol.
|
|
11490
11501
|
* Given some UTF-8 text, obtain a character value with
|
|
@@ -11492,7 +11503,7 @@ export namespace GLib {
|
|
|
11492
11503
|
* @param c a Unicode character
|
|
11493
11504
|
* @returns %TRUE if @c is a punctuation or symbol character
|
|
11494
11505
|
*/
|
|
11495
|
-
function unichar_ispunct(c:
|
|
11506
|
+
function unichar_ispunct(c: string): boolean;
|
|
11496
11507
|
/**
|
|
11497
11508
|
* Determines whether a character is a space, tab, or line separator
|
|
11498
11509
|
* (newline, carriage return, etc.). Given some UTF-8 text, obtain a
|
|
@@ -11504,7 +11515,7 @@ export namespace GLib {
|
|
|
11504
11515
|
* @param c a Unicode character
|
|
11505
11516
|
* @returns %TRUE if @c is a space character
|
|
11506
11517
|
*/
|
|
11507
|
-
function unichar_isspace(c:
|
|
11518
|
+
function unichar_isspace(c: string): boolean;
|
|
11508
11519
|
/**
|
|
11509
11520
|
* Determines if a character is titlecase. Some characters in
|
|
11510
11521
|
* Unicode which are composites, such as the DZ digraph
|
|
@@ -11515,20 +11526,20 @@ export namespace GLib {
|
|
|
11515
11526
|
* @param c a Unicode character
|
|
11516
11527
|
* @returns %TRUE if the character is titlecase
|
|
11517
11528
|
*/
|
|
11518
|
-
function unichar_istitle(c:
|
|
11529
|
+
function unichar_istitle(c: string): boolean;
|
|
11519
11530
|
/**
|
|
11520
11531
|
* Determines if a character is uppercase.
|
|
11521
11532
|
* @param c a Unicode character
|
|
11522
11533
|
* @returns %TRUE if @c is an uppercase character
|
|
11523
11534
|
*/
|
|
11524
|
-
function unichar_isupper(c:
|
|
11535
|
+
function unichar_isupper(c: string): boolean;
|
|
11525
11536
|
/**
|
|
11526
11537
|
* Determines if a character is typically rendered in a double-width
|
|
11527
11538
|
* cell.
|
|
11528
11539
|
* @param c a Unicode character
|
|
11529
11540
|
* @returns %TRUE if the character is wide
|
|
11530
11541
|
*/
|
|
11531
|
-
function unichar_iswide(c:
|
|
11542
|
+
function unichar_iswide(c: string): boolean;
|
|
11532
11543
|
/**
|
|
11533
11544
|
* Determines if a character is typically rendered in a double-width
|
|
11534
11545
|
* cell under legacy East Asian locales. If a character is wide according to
|
|
@@ -11543,13 +11554,13 @@ export namespace GLib {
|
|
|
11543
11554
|
* @param c a Unicode character
|
|
11544
11555
|
* @returns %TRUE if the character is wide in legacy East Asian locales
|
|
11545
11556
|
*/
|
|
11546
|
-
function unichar_iswide_cjk(c:
|
|
11557
|
+
function unichar_iswide_cjk(c: string): boolean;
|
|
11547
11558
|
/**
|
|
11548
11559
|
* Determines if a character is a hexadecimal digit.
|
|
11549
11560
|
* @param c a Unicode character.
|
|
11550
11561
|
* @returns %TRUE if the character is a hexadecimal digit
|
|
11551
11562
|
*/
|
|
11552
|
-
function unichar_isxdigit(c:
|
|
11563
|
+
function unichar_isxdigit(c: string): boolean;
|
|
11553
11564
|
/**
|
|
11554
11565
|
* Determines if a given character typically takes zero width when rendered.
|
|
11555
11566
|
* The return value is %TRUE for all non-spacing and enclosing marks
|
|
@@ -11563,37 +11574,37 @@ export namespace GLib {
|
|
|
11563
11574
|
* @param c a Unicode character
|
|
11564
11575
|
* @returns %TRUE if the character has zero width
|
|
11565
11576
|
*/
|
|
11566
|
-
function unichar_iszerowidth(c:
|
|
11577
|
+
function unichar_iszerowidth(c: string): boolean;
|
|
11567
11578
|
/**
|
|
11568
11579
|
* Converts a single character to UTF-8.
|
|
11569
11580
|
* @param c a Unicode character code
|
|
11570
11581
|
* @returns number of bytes written
|
|
11571
11582
|
*/
|
|
11572
|
-
function unichar_to_utf8(c:
|
|
11583
|
+
function unichar_to_utf8(c: string): [number, string];
|
|
11573
11584
|
/**
|
|
11574
11585
|
* Converts a character to lower case.
|
|
11575
11586
|
* @param c a Unicode character.
|
|
11576
11587
|
* @returns the result of converting @c to lower case. If @c is not an upperlower or titlecase character, or has no lowercase equivalent @c is returned unchanged.
|
|
11577
11588
|
*/
|
|
11578
|
-
function unichar_tolower(c:
|
|
11589
|
+
function unichar_tolower(c: string): string;
|
|
11579
11590
|
/**
|
|
11580
11591
|
* Converts a character to the titlecase.
|
|
11581
11592
|
* @param c a Unicode character
|
|
11582
11593
|
* @returns the result of converting @c to titlecase. If @c is not an uppercase or lowercase character, @c is returned unchanged.
|
|
11583
11594
|
*/
|
|
11584
|
-
function unichar_totitle(c:
|
|
11595
|
+
function unichar_totitle(c: string): string;
|
|
11585
11596
|
/**
|
|
11586
11597
|
* Converts a character to uppercase.
|
|
11587
11598
|
* @param c a Unicode character
|
|
11588
11599
|
* @returns the result of converting @c to uppercase. If @c is not a lowercase or titlecase character, or has no upper case equivalent @c is returned unchanged.
|
|
11589
11600
|
*/
|
|
11590
|
-
function unichar_toupper(c:
|
|
11601
|
+
function unichar_toupper(c: string): string;
|
|
11591
11602
|
/**
|
|
11592
11603
|
* Classifies a Unicode character by type.
|
|
11593
11604
|
* @param c a Unicode character
|
|
11594
11605
|
* @returns the type of the character.
|
|
11595
11606
|
*/
|
|
11596
|
-
function unichar_type(c:
|
|
11607
|
+
function unichar_type(c: string): UnicodeType;
|
|
11597
11608
|
/**
|
|
11598
11609
|
* Checks whether `ch` is a valid Unicode character.
|
|
11599
11610
|
*
|
|
@@ -11602,21 +11613,21 @@ export namespace GLib {
|
|
|
11602
11613
|
* @param ch a Unicode character
|
|
11603
11614
|
* @returns `TRUE` if @ch is a valid Unicode character
|
|
11604
11615
|
*/
|
|
11605
|
-
function unichar_validate(ch:
|
|
11616
|
+
function unichar_validate(ch: string): boolean;
|
|
11606
11617
|
/**
|
|
11607
11618
|
* Determines the numeric value of a character as a hexadecimal
|
|
11608
11619
|
* digit.
|
|
11609
11620
|
* @param c a Unicode character
|
|
11610
11621
|
* @returns If @c is a hex digit (according to g_unichar_isxdigit()), its numeric value. Otherwise, -1.
|
|
11611
11622
|
*/
|
|
11612
|
-
function unichar_xdigit_value(c:
|
|
11623
|
+
function unichar_xdigit_value(c: string): number;
|
|
11613
11624
|
/**
|
|
11614
11625
|
* Computes the canonical decomposition of a Unicode character.
|
|
11615
11626
|
* @param ch a Unicode character.
|
|
11616
11627
|
* @param result_len location to store the length of the return value.
|
|
11617
11628
|
* @returns a newly allocated string of Unicode characters. @result_len is set to the resulting length of the string.
|
|
11618
11629
|
*/
|
|
11619
|
-
function unicode_canonical_decomposition(ch:
|
|
11630
|
+
function unicode_canonical_decomposition(ch: string, result_len: number): string;
|
|
11620
11631
|
/**
|
|
11621
11632
|
* Computes the canonical ordering of a string in-place.
|
|
11622
11633
|
* This rearranges decomposed characters in the string
|
|
@@ -11624,7 +11635,7 @@ export namespace GLib {
|
|
|
11624
11635
|
* manual for more information.
|
|
11625
11636
|
* @param string a UCS-4 encoded string.
|
|
11626
11637
|
*/
|
|
11627
|
-
function unicode_canonical_ordering(string:
|
|
11638
|
+
function unicode_canonical_ordering(string: string): void;
|
|
11628
11639
|
/**
|
|
11629
11640
|
* Looks up the Unicode script for `iso1`5924. ISO 15924 assigns four-letter
|
|
11630
11641
|
* codes to scripts. For example, the code for Arabic is 'Arab'.
|
|
@@ -12206,7 +12217,7 @@ export namespace GLib {
|
|
|
12206
12217
|
* @param str a UTF-16 encoded string
|
|
12207
12218
|
* @returns a pointer to a newly allocated UCS-4 string. This value must be freed with [func@GLib.free].
|
|
12208
12219
|
*/
|
|
12209
|
-
function utf16_to_ucs4(str: number[]): [
|
|
12220
|
+
function utf16_to_ucs4(str: number[]): [string, number, number];
|
|
12210
12221
|
/**
|
|
12211
12222
|
* Convert a string from UTF-16 to UTF-8.
|
|
12212
12223
|
*
|
|
@@ -12338,7 +12349,7 @@ export namespace GLib {
|
|
|
12338
12349
|
* @param p a pointer to Unicode character encoded as UTF-8
|
|
12339
12350
|
* @returns the resulting character
|
|
12340
12351
|
*/
|
|
12341
|
-
function utf8_get_char(p: string):
|
|
12352
|
+
function utf8_get_char(p: string): string;
|
|
12342
12353
|
/**
|
|
12343
12354
|
* Convert a sequence of bytes encoded as UTF-8 to a Unicode character.
|
|
12344
12355
|
*
|
|
@@ -12353,7 +12364,7 @@ export namespace GLib {
|
|
|
12353
12364
|
* @param max_len the maximum number of bytes to read, or `-1` if @p is nul-terminated
|
|
12354
12365
|
* @returns the resulting character. If @p points to a partial sequence at the end of a string that could begin a valid character (or if @max_len is zero), returns `(gunichar)-2`; otherwise, if @p does not point to a valid UTF-8 encoded Unicode character, returns `(gunichar)-1`.
|
|
12355
12366
|
*/
|
|
12356
|
-
function utf8_get_char_validated(p: string, max_len: number):
|
|
12367
|
+
function utf8_get_char_validated(p: string, max_len: number): string;
|
|
12357
12368
|
/**
|
|
12358
12369
|
* If the provided string is valid UTF-8, return a copy of it. If not,
|
|
12359
12370
|
* return a copy in which bytes that could not be interpreted as valid Unicode
|
|
@@ -12453,7 +12464,7 @@ export namespace GLib {
|
|
|
12453
12464
|
* @param c a Unicode character
|
|
12454
12465
|
* @returns `NULL` if the string does not contain the character, otherwise, a pointer to the start of the leftmost occurrence of the character in the string.
|
|
12455
12466
|
*/
|
|
12456
|
-
function utf8_strchr(p: string, len: number, c:
|
|
12467
|
+
function utf8_strchr(p: string, len: number, c: string): string | null;
|
|
12457
12468
|
/**
|
|
12458
12469
|
* Converts all Unicode characters in the string that have a case
|
|
12459
12470
|
* to lowercase. The exact manner that this is done depends
|
|
@@ -12499,7 +12510,7 @@ export namespace GLib {
|
|
|
12499
12510
|
* @param c a Unicode character
|
|
12500
12511
|
* @returns `NULL` if the string does not contain the character, otherwise, a pointer to the start of the rightmost occurrence of the character in the string.
|
|
12501
12512
|
*/
|
|
12502
|
-
function utf8_strrchr(p: string, len: number, c:
|
|
12513
|
+
function utf8_strrchr(p: string, len: number, c: string): string | null;
|
|
12503
12514
|
/**
|
|
12504
12515
|
* Reverses a UTF-8 string.
|
|
12505
12516
|
*
|
|
@@ -12552,7 +12563,7 @@ export namespace GLib {
|
|
|
12552
12563
|
* @param len the maximum length of @str to use, in bytes. If @len is negative, then the string is nul-terminated.
|
|
12553
12564
|
* @returns a pointer to a newly allocated UCS-4 string. This value must be freed with [func@GLib.free].
|
|
12554
12565
|
*/
|
|
12555
|
-
function utf8_to_ucs4(str: string, len: number): [
|
|
12566
|
+
function utf8_to_ucs4(str: string, len: number): [string, number, number];
|
|
12556
12567
|
/**
|
|
12557
12568
|
* Convert a string from UTF-8 to a 32-bit fixed width
|
|
12558
12569
|
* representation as UCS-4, assuming valid UTF-8 input.
|
|
@@ -12564,7 +12575,7 @@ export namespace GLib {
|
|
|
12564
12575
|
* @param len the maximum length of @str to use, in bytes. If @len is negative, then the string is nul-terminated.
|
|
12565
12576
|
* @returns a pointer to a newly allocated UCS-4 string. This value must be freed with [func@GLib.free].
|
|
12566
12577
|
*/
|
|
12567
|
-
function utf8_to_ucs4_fast(str: string, len: number): [
|
|
12578
|
+
function utf8_to_ucs4_fast(str: string, len: number): [string, number];
|
|
12568
12579
|
/**
|
|
12569
12580
|
* Convert a string from UTF-8 to UTF-16.
|
|
12570
12581
|
*
|
|
@@ -17431,85 +17442,24 @@ export namespace GLib {
|
|
|
17431
17442
|
steal(): void;
|
|
17432
17443
|
}
|
|
17433
17444
|
|
|
17434
|
-
/**
|
|
17435
|
-
* HMACs should be used when producing a cookie or hash based on data
|
|
17436
|
-
* and a key. Simple mechanisms for using SHA1 and other algorithms to
|
|
17437
|
-
* digest a key and data together are vulnerable to various security
|
|
17438
|
-
* issues.
|
|
17439
|
-
* [HMAC](http://en.wikipedia.org/wiki/HMAC)
|
|
17440
|
-
* uses algorithms like SHA1 in a secure way to produce a digest of a
|
|
17441
|
-
* key and data.
|
|
17442
|
-
*
|
|
17443
|
-
* Both the key and data are arbitrary byte arrays of bytes or characters.
|
|
17444
|
-
*
|
|
17445
|
-
* Support for HMAC Digests has been added in GLib 2.30, and support for SHA-512
|
|
17446
|
-
* in GLib 2.42. Support for SHA-384 was added in GLib 2.52.
|
|
17447
|
-
*
|
|
17448
|
-
* To create a new `GHmac`, use [ctor`GLib`.Hmac.new]. To free a `GHmac`, use
|
|
17449
|
-
* [method`GLib`.Hmac.unref].
|
|
17450
|
-
*/
|
|
17451
17445
|
class Hmac {
|
|
17452
17446
|
static $gtype: GObject.GType<Hmac>;
|
|
17453
17447
|
|
|
17454
17448
|
// Constructors
|
|
17455
17449
|
|
|
17456
|
-
constructor(digest_type: ChecksumType, key:
|
|
17450
|
+
constructor(digest_type: ChecksumType, key: number, key_len: number);
|
|
17457
17451
|
_init(...args: any[]): void;
|
|
17458
17452
|
|
|
17459
|
-
static ['new'](digest_type: ChecksumType, key:
|
|
17453
|
+
static ['new'](digest_type: ChecksumType, key: number, key_len: number): Hmac;
|
|
17460
17454
|
|
|
17461
17455
|
// Methods
|
|
17462
17456
|
|
|
17463
|
-
/**
|
|
17464
|
-
* Copies a #GHmac. If `hmac` has been closed, by calling
|
|
17465
|
-
* g_hmac_get_string() or g_hmac_get_digest(), the copied
|
|
17466
|
-
* HMAC will be closed as well.
|
|
17467
|
-
* @returns the copy of the passed #GHmac. Use g_hmac_unref() when finished using it.
|
|
17468
|
-
*/
|
|
17469
17457
|
copy(): Hmac;
|
|
17470
|
-
|
|
17471
|
-
* Gets the digest from `checksum` as a raw binary array and places it
|
|
17472
|
-
* into `buffer`. The size of the digest depends on the type of checksum.
|
|
17473
|
-
*
|
|
17474
|
-
* Once this function has been called, the #GHmac is closed and can
|
|
17475
|
-
* no longer be updated with g_checksum_update().
|
|
17476
|
-
* @param buffer output buffer
|
|
17477
|
-
*/
|
|
17478
|
-
get_digest(buffer: Uint8Array | string): void;
|
|
17479
|
-
/**
|
|
17480
|
-
* Gets the HMAC as a hexadecimal string.
|
|
17481
|
-
*
|
|
17482
|
-
* Once this function has been called the #GHmac can no longer be
|
|
17483
|
-
* updated with g_hmac_update().
|
|
17484
|
-
*
|
|
17485
|
-
* The hexadecimal characters will be lower case.
|
|
17486
|
-
* @returns the hexadecimal representation of the HMAC. The returned string is owned by the HMAC and should not be modified or freed.
|
|
17487
|
-
*/
|
|
17458
|
+
get_digest(buffer: number, digest_len: number): void;
|
|
17488
17459
|
get_string(): string;
|
|
17489
|
-
/**
|
|
17490
|
-
* Atomically increments the reference count of `hmac` by one.
|
|
17491
|
-
*
|
|
17492
|
-
* This function is MT-safe and may be called from any thread.
|
|
17493
|
-
* @returns the passed in #GHmac.
|
|
17494
|
-
*/
|
|
17495
17460
|
ref(): Hmac;
|
|
17496
|
-
/**
|
|
17497
|
-
* Atomically decrements the reference count of `hmac` by one.
|
|
17498
|
-
*
|
|
17499
|
-
* If the reference count drops to 0, all keys and values will be
|
|
17500
|
-
* destroyed, and all memory allocated by the hash table is released.
|
|
17501
|
-
* This function is MT-safe and may be called from any thread.
|
|
17502
|
-
* Frees the memory allocated for `hmac`.
|
|
17503
|
-
*/
|
|
17504
17461
|
unref(): void;
|
|
17505
|
-
|
|
17506
|
-
* Feeds `data` into an existing #GHmac.
|
|
17507
|
-
*
|
|
17508
|
-
* The HMAC must still be open, that is g_hmac_get_string() or
|
|
17509
|
-
* g_hmac_get_digest() must not have been called on `hmac`.
|
|
17510
|
-
* @param data buffer used to compute the checksum
|
|
17511
|
-
*/
|
|
17512
|
-
update(data: Uint8Array | string): void;
|
|
17462
|
+
update(data: number, length: number): void;
|
|
17513
17463
|
}
|
|
17514
17464
|
|
|
17515
17465
|
/**
|
|
@@ -17815,7 +17765,7 @@ export namespace GLib {
|
|
|
17815
17765
|
* This function cannot be called on a channel with %NULL encoding.
|
|
17816
17766
|
* @returns a #GIOStatus
|
|
17817
17767
|
*/
|
|
17818
|
-
read_unichar(): [IOStatus,
|
|
17768
|
+
read_unichar(): [IOStatus, string];
|
|
17819
17769
|
/**
|
|
17820
17770
|
* Increments the reference count of a #GIOChannel.
|
|
17821
17771
|
* @returns the @channel that was passed in (since 2.6)
|
|
@@ -17972,7 +17922,7 @@ export namespace GLib {
|
|
|
17972
17922
|
* @param thechar a character
|
|
17973
17923
|
* @returns a #GIOStatus
|
|
17974
17924
|
*/
|
|
17975
|
-
write_unichar(thechar:
|
|
17925
|
+
write_unichar(thechar: string): IOStatus;
|
|
17976
17926
|
}
|
|
17977
17927
|
|
|
17978
17928
|
/**
|
|
@@ -18401,8 +18351,10 @@ export namespace GLib {
|
|
|
18401
18351
|
load_from_data(data: string, length: number, flags: KeyFileFlags | null): boolean;
|
|
18402
18352
|
/**
|
|
18403
18353
|
* Looks for a key file named `file` in the paths returned from
|
|
18404
|
-
* [func`GLib`.get_user_data_dir] and [func`GLib`.get_system_data_dirs]
|
|
18405
|
-
*
|
|
18354
|
+
* [func`GLib`.get_user_data_dir] and [func`GLib`.get_system_data_dirs].
|
|
18355
|
+
*
|
|
18356
|
+
* The search algorithm from [method`GLib`.KeyFile.load_from_dirs] is used. If
|
|
18357
|
+
* `file` is found, it’s loaded into `key_file` and its full path is returned in
|
|
18406
18358
|
* `full_path`.
|
|
18407
18359
|
*
|
|
18408
18360
|
* If the file could not be loaded then either a [error`GLib`.FileError] or
|
|
@@ -18416,6 +18368,13 @@ export namespace GLib {
|
|
|
18416
18368
|
* Looks for a key file named `file` in the paths specified in `search_dirs,`
|
|
18417
18369
|
* loads the file into `key_file` and returns the file’s full path in `full_path`.
|
|
18418
18370
|
*
|
|
18371
|
+
* `search_dirs` are checked in the order listed in the array, with the highest
|
|
18372
|
+
* priority directory listed first. Within each directory, `file` is looked for.
|
|
18373
|
+
* If it’s not found, `-` characters in `file` are progressively replaced with
|
|
18374
|
+
* directory separators to search subdirectories of the search directory. If the
|
|
18375
|
+
* file has not been found after all `-` characters have been replaced, the next
|
|
18376
|
+
* search directory in `search_dirs` is checked.
|
|
18377
|
+
*
|
|
18419
18378
|
* If the file could not be found in any of the `search_dirs,`
|
|
18420
18379
|
* [error`GLib`.KeyFileError.NOT_FOUND] is returned. If
|
|
18421
18380
|
* the file is found but the OS returns an error when opening or reading the
|
|
@@ -23172,7 +23131,7 @@ export namespace GLib {
|
|
|
23172
23131
|
* @param wc a Unicode character
|
|
23173
23132
|
* @returns @string
|
|
23174
23133
|
*/
|
|
23175
|
-
append_unichar(wc:
|
|
23134
|
+
append_unichar(wc: string): String;
|
|
23176
23135
|
/**
|
|
23177
23136
|
* Appends `unescaped` to `string,` escaping any characters that
|
|
23178
23137
|
* are reserved in URIs using URI-style escape sequences.
|
|
@@ -23297,7 +23256,7 @@ export namespace GLib {
|
|
|
23297
23256
|
* @param wc a Unicode character
|
|
23298
23257
|
* @returns @string
|
|
23299
23258
|
*/
|
|
23300
|
-
insert_unichar(pos: number, wc:
|
|
23259
|
+
insert_unichar(pos: number, wc: string): String;
|
|
23301
23260
|
/**
|
|
23302
23261
|
* Overwrites part of a string, lengthening it if necessary.
|
|
23303
23262
|
* @param pos the position at which to start overwriting
|
|
@@ -23349,7 +23308,7 @@ export namespace GLib {
|
|
|
23349
23308
|
* @param wc a Unicode character
|
|
23350
23309
|
* @returns @string
|
|
23351
23310
|
*/
|
|
23352
|
-
prepend_unichar(wc:
|
|
23311
|
+
prepend_unichar(wc: string): String;
|
|
23353
23312
|
/**
|
|
23354
23313
|
* Replaces the string `find` with the string `replace` in a #GString up to
|
|
23355
23314
|
* `limit` times. If the number of instances of `find` in the #GString is
|
|
@@ -26837,6 +26796,19 @@ export namespace GLib {
|
|
|
26837
26796
|
/**
|
|
26838
26797
|
* A type in the [type`GLib`.Variant] type system.
|
|
26839
26798
|
*
|
|
26799
|
+
* [type`GLib`.Variant] types are represented as strings, but have a strict
|
|
26800
|
+
* syntax described below. All [type`GLib`.VariantType]s passed to GLib must be
|
|
26801
|
+
* valid, and they are typically expected to be static (i.e. not provided by
|
|
26802
|
+
* user input) as they determine how binary [type`GLib`.Variant] data is
|
|
26803
|
+
* interpreted.
|
|
26804
|
+
*
|
|
26805
|
+
* To convert a static string to a [type`GLib`.VariantType] in C, use the
|
|
26806
|
+
* [func`GLib`.VARIANT_TYPE] casting macro. When GLib is compiled with checks
|
|
26807
|
+
* enabled, it will validate the type. To check if an arbitrary string is a
|
|
26808
|
+
* valid [type`GLib`.VariantType], use [func`GLib`.VariantType.string_is_valid].
|
|
26809
|
+
*
|
|
26810
|
+
* ## GVariant Type System
|
|
26811
|
+
*
|
|
26840
26812
|
* This section introduces the [type`GLib`.Variant] type system. It is based, in
|
|
26841
26813
|
* large part, on the D-Bus type system, with two major changes and
|
|
26842
26814
|
* some minor lifting of restrictions. The
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/glib-2.0",
|
|
3
|
-
"version": "2.84.
|
|
4
|
-
"description": "GJS TypeScript type definitions for GLib-2.0, generated from library version 2.84.
|
|
3
|
+
"version": "2.84.2-4.0.0-beta.25",
|
|
4
|
+
"description": "GJS TypeScript type definitions for GLib-2.0, generated from library version 2.84.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "glib-2.0.js",
|
|
7
7
|
"main": "glib-2.0.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"test": "tsc --project tsconfig.json"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@girs/gjs": "^4.0.0-beta.
|
|
35
|
-
"@girs/gobject-2.0": "^2.84.
|
|
34
|
+
"@girs/gjs": "^4.0.0-beta.25",
|
|
35
|
+
"@girs/gobject-2.0": "^2.84.2-4.0.0-beta.25"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"typescript": "*"
|