@girs/glib-2.0 2.82.2-4.0.0-beta.18 → 2.82.4-4.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/glib-2.0)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GLib-2.0, generated from library version 2.82.2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.18.
8
+ GJS TypeScript type definitions for GLib-2.0, generated from library version 2.82.4 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.20.
9
9
 
10
10
 
11
11
  ## Install
package/glib-2.0.d.ts CHANGED
@@ -4609,6 +4609,11 @@ export namespace GLib {
4609
4609
  * If the reference was the last one, it will call `clear_func`
4610
4610
  * to clear the contents of `mem_block,` and then will free the
4611
4611
  * resources allocated for `mem_block`.
4612
+ *
4613
+ * Note that implementing weak references via `clear_func` is not thread-safe:
4614
+ * clearing a pointer to the memory from the callback can race with another
4615
+ * thread trying to access it as `mem_block` already has a reference count of 0
4616
+ * when the callback is called and will be freed.
4612
4617
  * @param mem_block a pointer to reference counted data
4613
4618
  */
4614
4619
  function atomic_rc_box_release_full(mem_block: any): void;
@@ -5027,7 +5032,7 @@ export namespace GLib {
5027
5032
  * @param checksum_type a #GChecksumType
5028
5033
  * @returns the checksum length, or -1 if @checksum_type is not supported.
5029
5034
  */
5030
- function checksum_type_get_length(checksum_type: ChecksumType): number;
5035
+ function checksum_type_get_length(checksum_type: ChecksumType | null): number;
5031
5036
  /**
5032
5037
  * Sets a function to be called when the child indicated by `pid`
5033
5038
  * exits, at the priority `priority`.
@@ -5184,7 +5189,7 @@ export namespace GLib {
5184
5189
  * @param data binary blob to compute the digest of
5185
5190
  * @returns the digest of the binary data as a string in hexadecimal, or %NULL if g_checksum_new() fails for @checksum_type. The returned string should be freed with g_free() when done using it.
5186
5191
  */
5187
- function compute_checksum_for_bytes(checksum_type: ChecksumType, data: Bytes | Uint8Array): string | null;
5192
+ function compute_checksum_for_bytes(checksum_type: ChecksumType | null, data: Bytes | Uint8Array): string | null;
5188
5193
  /**
5189
5194
  * Computes the checksum for a binary `data` of `length`. This is a
5190
5195
  * convenience wrapper for g_checksum_new(), g_checksum_get_string()
@@ -5195,7 +5200,7 @@ export namespace GLib {
5195
5200
  * @param data binary blob to compute the digest of
5196
5201
  * @returns the digest of the binary data as a string in hexadecimal, or %NULL if g_checksum_new() fails for @checksum_type. The returned string should be freed with g_free() when done using it.
5197
5202
  */
5198
- function compute_checksum_for_data(checksum_type: ChecksumType, data: Uint8Array | string): string | null;
5203
+ function compute_checksum_for_data(checksum_type: ChecksumType | null, data: Uint8Array | string): string | null;
5199
5204
  /**
5200
5205
  * Computes the checksum of a string.
5201
5206
  *
@@ -5205,7 +5210,11 @@ export namespace GLib {
5205
5210
  * @param length the length of the string, or -1 if the string is null-terminated.
5206
5211
  * @returns the checksum as a hexadecimal string, or %NULL if g_checksum_new() fails for @checksum_type. The returned string should be freed with g_free() when done using it.
5207
5212
  */
5208
- function compute_checksum_for_string(checksum_type: ChecksumType, str: string, length: number): string | null;
5213
+ function compute_checksum_for_string(
5214
+ checksum_type: ChecksumType | null,
5215
+ str: string,
5216
+ length: number,
5217
+ ): string | null;
5209
5218
  /**
5210
5219
  * Computes the HMAC for a binary `data`. This is a
5211
5220
  * convenience wrapper for g_hmac_new(), g_hmac_get_string()
@@ -5218,7 +5227,7 @@ export namespace GLib {
5218
5227
  * @returns the HMAC of the binary data as a string in hexadecimal. The returned string should be freed with g_free() when done using it.
5219
5228
  */
5220
5229
  function compute_hmac_for_bytes(
5221
- digest_type: ChecksumType,
5230
+ digest_type: ChecksumType | null,
5222
5231
  key: Bytes | Uint8Array,
5223
5232
  data: Bytes | Uint8Array,
5224
5233
  ): string;
@@ -5234,7 +5243,7 @@ export namespace GLib {
5234
5243
  * @returns the HMAC of the binary data as a string in hexadecimal. The returned string should be freed with g_free() when done using it.
5235
5244
  */
5236
5245
  function compute_hmac_for_data(
5237
- digest_type: ChecksumType,
5246
+ digest_type: ChecksumType | null,
5238
5247
  key: Uint8Array | string,
5239
5248
  data: Uint8Array | string,
5240
5249
  ): string;
@@ -5249,7 +5258,7 @@ export namespace GLib {
5249
5258
  * @returns the HMAC as a hexadecimal string. The returned string should be freed with g_free() when done using it.
5250
5259
  */
5251
5260
  function compute_hmac_for_string(
5252
- digest_type: ChecksumType,
5261
+ digest_type: ChecksumType | null,
5253
5262
  key: Uint8Array | string,
5254
5263
  str: string,
5255
5264
  length: number,
@@ -5431,7 +5440,7 @@ export namespace GLib {
5431
5440
  * @param year year
5432
5441
  * @returns number of days in @month during the @year
5433
5442
  */
5434
- function date_get_days_in_month(month: DateMonth, year: DateYear): number;
5443
+ function date_get_days_in_month(month: DateMonth | null, year: DateYear): number;
5435
5444
  /**
5436
5445
  * Returns the number of weeks in the year, where weeks
5437
5446
  * are taken to start on Monday. Will be 52 or 53. The
@@ -5504,7 +5513,7 @@ export namespace GLib {
5504
5513
  * @param year year
5505
5514
  * @returns %TRUE if the date is a valid one
5506
5515
  */
5507
- function date_valid_dmy(day: DateDay, month: DateMonth, year: DateYear): boolean;
5516
+ function date_valid_dmy(day: DateDay, month: DateMonth | null, year: DateYear): boolean;
5508
5517
  /**
5509
5518
  * Returns %TRUE if the Julian day is valid. Anything greater than zero
5510
5519
  * is basically a valid Julian, though there is a 32-bit limit.
@@ -5518,14 +5527,14 @@ export namespace GLib {
5518
5527
  * @param month month
5519
5528
  * @returns %TRUE if the month is valid
5520
5529
  */
5521
- function date_valid_month(month: DateMonth): boolean;
5530
+ function date_valid_month(month: DateMonth | null): boolean;
5522
5531
  /**
5523
5532
  * Returns %TRUE if the weekday is valid. The seven #GDateWeekday enumeration
5524
5533
  * values are the only valid weekdays.
5525
5534
  * @param weekday weekday
5526
5535
  * @returns %TRUE if the weekday is valid
5527
5536
  */
5528
- function date_valid_weekday(weekday: DateWeekday): boolean;
5537
+ function date_valid_weekday(weekday: DateWeekday | null): boolean;
5529
5538
  /**
5530
5539
  * Returns %TRUE if the year is valid. Any year greater than 0 is valid,
5531
5540
  * though there is a 16-bit limit to what #GDate will understand.
@@ -5944,7 +5953,7 @@ export namespace GLib {
5944
5953
  function file_set_contents_full(
5945
5954
  filename: string,
5946
5955
  contents: Uint8Array | string,
5947
- flags: FileSetContentsFlags,
5956
+ flags: FileSetContentsFlags | null,
5948
5957
  mode: number,
5949
5958
  ): boolean;
5950
5959
  /**
@@ -6013,7 +6022,7 @@ export namespace GLib {
6013
6022
  * @param test bitfield of #GFileTest flags
6014
6023
  * @returns whether a test was %TRUE
6015
6024
  */
6016
- function file_test(filename: string, test: FileTest): boolean;
6025
+ function file_test(filename: string, test: FileTest | null): boolean;
6017
6026
  /**
6018
6027
  * Returns the display basename for the particular filename, guaranteed
6019
6028
  * to be valid UTF-8. The display name might not be identical to the filename,
@@ -6194,7 +6203,7 @@ export namespace GLib {
6194
6203
  * @param flags #GFormatSizeFlags to modify the output
6195
6204
  * @returns a newly-allocated formatted string containing a human readable file size
6196
6205
  */
6197
- function format_size_full(size: number, flags: FormatSizeFlags): string;
6206
+ function format_size_full(size: number, flags: FormatSizeFlags | null): string;
6198
6207
  /**
6199
6208
  * Frees the memory pointed to by `mem`.
6200
6209
  *
@@ -6719,7 +6728,7 @@ export namespace GLib {
6719
6728
  * @param directory the logical id of special directory
6720
6729
  * @returns the path to the specified special directory, or %NULL if the logical id was not found. The returned string is owned by GLib and should not be modified or freed.
6721
6730
  */
6722
- function get_user_special_dir(directory: UserDirectory): string | null;
6731
+ function get_user_special_dir(directory: UserDirectory | null): string | null;
6723
6732
  /**
6724
6733
  * Returns a base directory in which to store state files specific to
6725
6734
  * particular user.
@@ -7252,7 +7261,7 @@ export namespace GLib {
7252
7261
  * @param func the function to call when the condition is satisfied
7253
7262
  * @returns the event source id
7254
7263
  */
7255
- function io_add_watch(channel: IOChannel, priority: number, condition: IOCondition, func: IOFunc): number;
7264
+ function io_add_watch(channel: IOChannel, priority: number, condition: IOCondition | null, func: IOFunc): number;
7256
7265
  /**
7257
7266
  * Converts an `errno` error number to a #GIOChannelError.
7258
7267
  * @param en an `errno` error number, e.g. `EINVAL`
@@ -7279,7 +7288,7 @@ export namespace GLib {
7279
7288
  * @param condition conditions to watch for
7280
7289
  * @returns a new #GSource
7281
7290
  */
7282
- function io_create_watch(channel: IOChannel, condition: IOCondition): Source;
7291
+ function io_create_watch(channel: IOChannel, condition: IOCondition | null): Source;
7283
7292
  function key_file_error_quark(): Quark;
7284
7293
  function list_pop_allocator(): void;
7285
7294
  function list_push_allocator(allocator: Allocator): void;
@@ -7362,7 +7371,7 @@ export namespace GLib {
7362
7371
  */
7363
7372
  function log_default_handler(
7364
7373
  log_domain: string | null,
7365
- log_level: LogLevelFlags,
7374
+ log_level: LogLevelFlags | null,
7366
7375
  message?: string | null,
7367
7376
  unused_data?: any | null,
7368
7377
  ): void;
@@ -7408,7 +7417,7 @@ export namespace GLib {
7408
7417
  * @param fatal_mask the mask containing bits set for each level of error which is to be fatal
7409
7418
  * @returns the old fatal mask
7410
7419
  */
7411
- function log_set_always_fatal(fatal_mask: LogLevelFlags): LogLevelFlags;
7420
+ function log_set_always_fatal(fatal_mask: LogLevelFlags | null): LogLevelFlags;
7412
7421
  /**
7413
7422
  * Enable or disable debug output from the GLib logging system for all domains.
7414
7423
  *
@@ -7440,7 +7449,7 @@ export namespace GLib {
7440
7449
  * @param fatal_mask the new fatal mask
7441
7450
  * @returns the old fatal mask for the log domain
7442
7451
  */
7443
- function log_set_fatal_mask(log_domain: string, fatal_mask: LogLevelFlags): LogLevelFlags;
7452
+ function log_set_fatal_mask(log_domain: string, fatal_mask: LogLevelFlags | null): LogLevelFlags;
7444
7453
  /**
7445
7454
  * Like [func`GLib`.log_set_handler], but takes a destroy notify for the `user_data`.
7446
7455
  *
@@ -7451,7 +7460,7 @@ export namespace GLib {
7451
7460
  * @param log_func the log handler function
7452
7461
  * @returns the ID of the new handler
7453
7462
  */
7454
- function log_set_handler(log_domain: string | null, log_levels: LogLevelFlags, log_func: LogFunc): number;
7463
+ function log_set_handler(log_domain: string | null, log_levels: LogLevelFlags | null, log_func: LogFunc): number;
7455
7464
  /**
7456
7465
  * Set a writer function which will be called to format and write out each log
7457
7466
  * message.
@@ -7482,7 +7491,7 @@ export namespace GLib {
7482
7491
  * @param log_level log level, either from [type@GLib.LogLevelFlags], or a user-defined level
7483
7492
  * @param fields key–value pairs of structured data to add to the log message
7484
7493
  */
7485
- function log_structured_array(log_level: LogLevelFlags, fields: LogField[]): void;
7494
+ function log_structured_array(log_level: LogLevelFlags | null, fields: LogField[]): void;
7486
7495
  /**
7487
7496
  * Log a message with structured data, accepting the data within a [type`GLib`.Variant].
7488
7497
  *
@@ -7503,7 +7512,7 @@ export namespace GLib {
7503
7512
  * @param log_level log level, either from [type@GLib.LogLevelFlags], or a user-defined level
7504
7513
  * @param fields a dictionary ([type@GLib.Variant] of the type `G_VARIANT_TYPE_VARDICT`) containing the key-value pairs of message data.
7505
7514
  */
7506
- function log_variant(log_domain: string | null, log_level: LogLevelFlags, fields: Variant): void;
7515
+ function log_variant(log_domain: string | null, log_level: LogLevelFlags | null, fields: Variant): void;
7507
7516
  /**
7508
7517
  * Format a structured log message and output it to the default log destination
7509
7518
  * for the platform.
@@ -7531,7 +7540,11 @@ export namespace GLib {
7531
7540
  * @param user_data user data passed to [func@GLib.log_set_writer_func]
7532
7541
  * @returns [enum@GLib.LogWriterOutput.HANDLED] on success, [enum@GLib.LogWriterOutput.UNHANDLED] otherwise
7533
7542
  */
7534
- function log_writer_default(log_level: LogLevelFlags, fields: LogField[], user_data?: any | null): LogWriterOutput;
7543
+ function log_writer_default(
7544
+ log_level: LogLevelFlags | null,
7545
+ fields: LogField[],
7546
+ user_data?: any | null,
7547
+ ): LogWriterOutput;
7535
7548
  /**
7536
7549
  * Reset the list of domains to be logged, that might be initially set by the
7537
7550
  * `G_MESSAGES_DEBUG` environment variable.
@@ -7591,7 +7604,7 @@ export namespace GLib {
7591
7604
  * @param log_domain log domain
7592
7605
  * @returns `TRUE` if the log message would be dropped by GLib’s default log handlers
7593
7606
  */
7594
- function log_writer_default_would_drop(log_level: LogLevelFlags, log_domain?: string | null): boolean;
7607
+ function log_writer_default_would_drop(log_level: LogLevelFlags | null, log_domain?: string | null): boolean;
7595
7608
  /**
7596
7609
  * Format a structured log message as a string suitable for outputting to the
7597
7610
  * terminal (or elsewhere).
@@ -7609,7 +7622,7 @@ export namespace GLib {
7609
7622
  * @param use_color `TRUE` to use [ANSI color escape sequences](https://en.wikipedia.org/wiki/ANSI_escape_code) when formatting the message, `FALSE` to not
7610
7623
  * @returns string containing the formatted log message, in the character set of the current locale
7611
7624
  */
7612
- function log_writer_format_fields(log_level: LogLevelFlags, fields: LogField[], use_color: boolean): string;
7625
+ function log_writer_format_fields(log_level: LogLevelFlags | null, fields: LogField[], use_color: boolean): string;
7613
7626
  /**
7614
7627
  * Check whether the given `output_fd` file descriptor is a connection to the
7615
7628
  * systemd journal, or something else (like a log file or `stdout` or
@@ -7641,7 +7654,11 @@ export namespace GLib {
7641
7654
  * @param user_data user data passed to [func@GLib.log_set_writer_func]
7642
7655
  * @returns [enum@GLib.LogWriterOutput.HANDLED] on success, [enum@GLib.LogWriterOutput.UNHANDLED] otherwise
7643
7656
  */
7644
- function log_writer_journald(log_level: LogLevelFlags, fields: LogField[], user_data?: any | null): LogWriterOutput;
7657
+ function log_writer_journald(
7658
+ log_level: LogLevelFlags | null,
7659
+ fields: LogField[],
7660
+ user_data?: any | null,
7661
+ ): LogWriterOutput;
7645
7662
  /**
7646
7663
  * Format a structured log message and print it to either `stdout` or `stderr`,
7647
7664
  * depending on its log level.
@@ -7666,7 +7683,7 @@ export namespace GLib {
7666
7683
  * @returns [enum@GLib.LogWriterOutput.HANDLED] on success, [enum@GLib.LogWriterOutput.UNHANDLED] otherwise
7667
7684
  */
7668
7685
  function log_writer_standard_streams(
7669
- log_level: LogLevelFlags,
7686
+ log_level: LogLevelFlags | null,
7670
7687
  fields: LogField[],
7671
7688
  user_data?: any | null,
7672
7689
  ): LogWriterOutput;
@@ -7697,7 +7714,11 @@ export namespace GLib {
7697
7714
  * @param user_data user data passed to [func@GLib.log_set_writer_func]
7698
7715
  * @returns [enum@GLib.LogWriterOutput.HANDLED] on success, [enum@GLib.LogWriterOutput.UNHANDLED] otherwise
7699
7716
  */
7700
- function log_writer_syslog(log_level: LogLevelFlags, fields: LogField[], user_data?: any | null): LogWriterOutput;
7717
+ function log_writer_syslog(
7718
+ log_level: LogLevelFlags | null,
7719
+ fields: LogField[],
7720
+ user_data?: any | null,
7721
+ ): LogWriterOutput;
7701
7722
  /**
7702
7723
  * A wrapper for the POSIX lstat() function. The lstat() function is
7703
7724
  * like stat() except that in the case of symbolic links, it returns
@@ -8718,8 +8739,8 @@ export namespace GLib {
8718
8739
  function regex_match_simple(
8719
8740
  pattern: string,
8720
8741
  string: string,
8721
- compile_options: RegexCompileFlags,
8722
- match_options: RegexMatchFlags,
8742
+ compile_options: RegexCompileFlags | null,
8743
+ match_options: RegexMatchFlags | null,
8723
8744
  ): boolean;
8724
8745
  /**
8725
8746
  * Breaks the string on the pattern, and returns an array of
@@ -8758,8 +8779,8 @@ export namespace GLib {
8758
8779
  function regex_split_simple(
8759
8780
  pattern: string,
8760
8781
  string: string,
8761
- compile_options: RegexCompileFlags,
8762
- match_options: RegexMatchFlags,
8782
+ compile_options: RegexCompileFlags | null,
8783
+ match_options: RegexMatchFlags | null,
8763
8784
  ): string[];
8764
8785
  /**
8765
8786
  * Resets the cache used for g_get_user_special_dir(), so
@@ -8976,14 +8997,6 @@ export namespace GLib {
8976
8997
  * @param prgname the name of the program.
8977
8998
  */
8978
8999
  function set_prgname(prgname: string): void;
8979
- /**
8980
- * If g_get_prgname() is not set, this is the same as setting
8981
- * the name via g_set_prgname() and %TRUE is returned. Otherwise,
8982
- * does nothing and returns %FALSE. This is thread-safe.
8983
- * @param prgname the name of the program.
8984
- * @returns whether g_prgname was initialized by the call.
8985
- */
8986
- function set_prgname_once(prgname: string): boolean;
8987
9000
  /**
8988
9001
  * Sets an environment variable. On UNIX, both the variable's name and
8989
9002
  * value can be arbitrary byte strings, except that the variable's name
@@ -9152,9 +9165,9 @@ export namespace GLib {
9152
9165
  * @param next_offset the offset of the @next field in the blocks
9153
9166
  */
9154
9167
  function slice_free_chain_with_offset(block_size: number, mem_chain: any | null, next_offset: number): void;
9155
- function slice_get_config(ckey: SliceConfig): number;
9156
- function slice_get_config_state(ckey: SliceConfig, address: number, n_values: number): number;
9157
- function slice_set_config(ckey: SliceConfig, value: number): void;
9168
+ function slice_get_config(ckey: SliceConfig | null): number;
9169
+ function slice_get_config_state(ckey: SliceConfig | null, address: number, n_values: number): number;
9170
+ function slice_set_config(ckey: SliceConfig | null, value: number): void;
9158
9171
  function slist_pop_allocator(): void;
9159
9172
  function slist_push_allocator(allocator: Allocator): void;
9160
9173
  /**
@@ -9259,7 +9272,7 @@ export namespace GLib {
9259
9272
  working_directory: string | null,
9260
9273
  argv: string[],
9261
9274
  envp: string[] | null,
9262
- flags: SpawnFlags,
9275
+ flags: SpawnFlags | null,
9263
9276
  child_setup?: SpawnChildSetupFunc | null,
9264
9277
  ): [boolean, Pid | null];
9265
9278
  /**
@@ -9281,7 +9294,7 @@ export namespace GLib {
9281
9294
  working_directory: string | null,
9282
9295
  argv: string[],
9283
9296
  envp: string[] | null,
9284
- flags: SpawnFlags,
9297
+ flags: SpawnFlags | null,
9285
9298
  child_setup: SpawnChildSetupFunc | null,
9286
9299
  stdin_fd: number,
9287
9300
  stdout_fd: number,
@@ -9301,7 +9314,7 @@ export namespace GLib {
9301
9314
  working_directory: string | null,
9302
9315
  argv: string[],
9303
9316
  envp: string[] | null,
9304
- flags: SpawnFlags,
9317
+ flags: SpawnFlags | null,
9305
9318
  child_setup: SpawnChildSetupFunc | null,
9306
9319
  ): [boolean, Pid | null, number, number, number];
9307
9320
  /**
@@ -9515,7 +9528,7 @@ export namespace GLib {
9515
9528
  working_directory: string | null,
9516
9529
  argv: string[],
9517
9530
  envp: string[] | null,
9518
- flags: SpawnFlags,
9531
+ flags: SpawnFlags | null,
9519
9532
  child_setup: SpawnChildSetupFunc | null,
9520
9533
  stdin_fd: number,
9521
9534
  stdout_fd: number,
@@ -9674,7 +9687,7 @@ export namespace GLib {
9674
9687
  working_directory: string | null,
9675
9688
  argv: string[],
9676
9689
  envp: string[] | null,
9677
- flags: SpawnFlags,
9690
+ flags: SpawnFlags | null,
9678
9691
  child_setup: SpawnChildSetupFunc | null,
9679
9692
  ): [boolean, Uint8Array | null, Uint8Array | null, number];
9680
9693
  /**
@@ -10413,7 +10426,7 @@ export namespace GLib {
10413
10426
  * @param log_level the log level of the message
10414
10427
  * @param pattern a glob-style pattern (see [type@GLib.PatternSpec])
10415
10428
  */
10416
- function test_expect_message(log_domain: string | null, log_level: LogLevelFlags, pattern: string): void;
10429
+ function test_expect_message(log_domain: string | null, log_level: LogLevelFlags | null, pattern: string): void;
10417
10430
  /**
10418
10431
  * Indicates that a test failed. This function can be called
10419
10432
  * multiple times from the same test. You can use this function
@@ -10459,7 +10472,7 @@ export namespace GLib {
10459
10472
  * @param file_type the type of file (built vs. distributed)
10460
10473
  * @returns the path of the directory, owned by GLib
10461
10474
  */
10462
- function test_get_dir(file_type: TestFileType): string;
10475
+ function test_get_dir(file_type: TestFileType | null): string;
10463
10476
  /**
10464
10477
  * Gets the test path for the test currently being run.
10465
10478
  *
@@ -10486,7 +10499,7 @@ export namespace GLib {
10486
10499
  * @param msg explanation
10487
10500
  */
10488
10501
  function test_incomplete(msg?: string | null): void;
10489
- function test_log_type_name(log_type: TestLogType): string;
10502
+ function test_log_type_name(log_type: TestLogType | null): string;
10490
10503
  /**
10491
10504
  * Enqueues a callback `destroy_func` to be executed during the next test case
10492
10505
  * teardown phase.
@@ -10704,7 +10717,7 @@ export namespace GLib {
10704
10717
  * @param test_trap_flags Flags to modify forking behaviour.
10705
10718
  * @returns %TRUE for the forked child and %FALSE for the executing parent process.
10706
10719
  */
10707
- function test_trap_fork(usec_timeout: number, test_trap_flags: TestTrapFlags): boolean;
10720
+ function test_trap_fork(usec_timeout: number, test_trap_flags: TestTrapFlags | null): boolean;
10708
10721
  /**
10709
10722
  * Check the result of the last g_test_trap_subprocess() call.
10710
10723
  * @returns %TRUE if the last test subprocess terminated successfully.
@@ -10727,7 +10740,7 @@ export namespace GLib {
10727
10740
  function test_trap_subprocess(
10728
10741
  test_path: string | null,
10729
10742
  usec_timeout: number,
10730
- test_flags: TestSubprocessFlags,
10743
+ test_flags: TestSubprocessFlags | null,
10731
10744
  ): void;
10732
10745
  /**
10733
10746
  * Respawns the test program to run only `test_path` in a subprocess with the
@@ -10831,7 +10844,7 @@ export namespace GLib {
10831
10844
  test_path: string | null,
10832
10845
  envp: string[] | null,
10833
10846
  usec_timeout: number,
10834
- test_flags: TestSubprocessFlags,
10847
+ test_flags: TestSubprocessFlags | null,
10835
10848
  ): void;
10836
10849
  function thread_error_quark(): Quark;
10837
10850
  /**
@@ -11527,7 +11540,7 @@ export namespace GLib {
11527
11540
  * @param script a Unicode script
11528
11541
  * @returns the ISO 15924 code for @script, encoded as an integer, of zero if @script is %G_UNICODE_SCRIPT_INVALID_CODE or ISO 15924 code 'Zzzz' (script code for UNKNOWN) if @script is not understood.
11529
11542
  */
11530
- function unicode_script_to_iso15924(script: UnicodeScript): number;
11543
+ function unicode_script_to_iso15924(script: UnicodeScript | null): number;
11531
11544
  function unix_error_quark(): Quark;
11532
11545
  /**
11533
11546
  * Sets a function to be called when the IO condition, as specified by
@@ -11545,7 +11558,7 @@ export namespace GLib {
11545
11558
  function unix_fd_add_full(
11546
11559
  priority: number,
11547
11560
  fd: number,
11548
- condition: IOCondition,
11561
+ condition: IOCondition | null,
11549
11562
  _function: UnixFDSourceFunc,
11550
11563
  ): number;
11551
11564
  /**
@@ -11560,7 +11573,7 @@ export namespace GLib {
11560
11573
  * @param condition I/O conditions to watch for on @fd
11561
11574
  * @returns the newly created #GSource
11562
11575
  */
11563
- function unix_fd_source_new(fd: number, condition: IOCondition): Source;
11576
+ function unix_fd_source_new(fd: number, condition: IOCondition | null): Source;
11564
11577
  /**
11565
11578
  * Get the `passwd` file entry for the given `user_name` using `getpwnam_r()`.
11566
11579
  * This can fail if the given `user_name` doesn’t exist.
@@ -11699,7 +11712,7 @@ export namespace GLib {
11699
11712
  * @returns a new #GUri
11700
11713
  */
11701
11714
  function uri_build(
11702
- flags: UriFlags,
11715
+ flags: UriFlags | null,
11703
11716
  scheme: string,
11704
11717
  userinfo: string | null,
11705
11718
  host: string | null,
@@ -11730,7 +11743,7 @@ export namespace GLib {
11730
11743
  * @returns a new #GUri
11731
11744
  */
11732
11745
  function uri_build_with_user(
11733
- flags: UriFlags,
11746
+ flags: UriFlags | null,
11734
11747
  scheme: string,
11735
11748
  user: string | null,
11736
11749
  password: string | null,
@@ -11787,7 +11800,7 @@ export namespace GLib {
11787
11800
  * @param flags flags for parsing @uri_string
11788
11801
  * @returns %TRUE if @uri_string is a valid absolute URI, %FALSE on error.
11789
11802
  */
11790
- function uri_is_valid(uri_string: string, flags: UriFlags): boolean;
11803
+ function uri_is_valid(uri_string: string, flags: UriFlags | null): boolean;
11791
11804
  /**
11792
11805
  * Joins the given components together according to `flags` to create
11793
11806
  * an absolute URI string. `path` may not be %NULL (though it may be the empty
@@ -11814,7 +11827,7 @@ export namespace GLib {
11814
11827
  * @returns an absolute URI string
11815
11828
  */
11816
11829
  function uri_join(
11817
- flags: UriFlags,
11830
+ flags: UriFlags | null,
11818
11831
  scheme: string | null,
11819
11832
  userinfo: string | null,
11820
11833
  host: string | null,
@@ -11846,7 +11859,7 @@ export namespace GLib {
11846
11859
  * @returns an absolute URI string
11847
11860
  */
11848
11861
  function uri_join_with_user(
11849
- flags: UriFlags,
11862
+ flags: UriFlags | null,
11850
11863
  scheme: string | null,
11851
11864
  user: string | null,
11852
11865
  password: string | null,
@@ -11873,7 +11886,7 @@ export namespace GLib {
11873
11886
  * @param flags flags describing how to parse @uri_string
11874
11887
  * @returns a new #GUri, or NULL on error.
11875
11888
  */
11876
- function uri_parse(uri_string: string, flags: UriFlags): Uri;
11889
+ function uri_parse(uri_string: string, flags: UriFlags | null): Uri;
11877
11890
  /**
11878
11891
  * Many URI schemes include one or more attribute/value pairs as part of the URI
11879
11892
  * value. This method can be used to parse them into a hash table. When an
@@ -11909,7 +11922,7 @@ export namespace GLib {
11909
11922
  params: string,
11910
11923
  length: number,
11911
11924
  separators: string,
11912
- flags: UriParamsFlags,
11925
+ flags: UriParamsFlags | null,
11913
11926
  ): HashTable<string, string>;
11914
11927
  /**
11915
11928
  * Gets the scheme portion of a URI string.
@@ -11955,7 +11968,7 @@ export namespace GLib {
11955
11968
  * @param flags flags describing how to parse @uri_ref
11956
11969
  * @returns the resolved URI string, or NULL on error.
11957
11970
  */
11958
- function uri_resolve_relative(base_uri_string: string | null, uri_ref: string, flags: UriFlags): string;
11971
+ function uri_resolve_relative(base_uri_string: string | null, uri_ref: string, flags: UriFlags | null): string;
11959
11972
  /**
11960
11973
  * Parses `uri_ref` (which can be an
11961
11974
  * [absolute or relative URI](#relative-and-absolute-uris)) according to `flags,` and
@@ -11979,7 +11992,7 @@ export namespace GLib {
11979
11992
  */
11980
11993
  function uri_split(
11981
11994
  uri_ref: string,
11982
- flags: UriFlags,
11995
+ flags: UriFlags | null,
11983
11996
  ): [boolean, string, string, string, number, string, string, string];
11984
11997
  /**
11985
11998
  * Parses `uri_string` (which must be an [absolute URI](#relative-and-absolute-uris))
@@ -11992,7 +12005,7 @@ export namespace GLib {
11992
12005
  * @param flags flags for parsing @uri_string
11993
12006
  * @returns %TRUE if @uri_string parsed successfully, %FALSE on error.
11994
12007
  */
11995
- function uri_split_network(uri_string: string, flags: UriFlags): [boolean, string, string, number];
12008
+ function uri_split_network(uri_string: string, flags: UriFlags | null): [boolean, string, string, number];
11996
12009
  /**
11997
12010
  * Parses `uri_ref` (which can be an
11998
12011
  * [absolute or relative URI](#relative-and-absolute-uris)) according to `flags,` and
@@ -12011,7 +12024,7 @@ export namespace GLib {
12011
12024
  */
12012
12025
  function uri_split_with_user(
12013
12026
  uri_ref: string,
12014
- flags: UriFlags,
12027
+ flags: UriFlags | null,
12015
12028
  ): [boolean, string, string, string, string, string, number, string, string, string];
12016
12029
  /**
12017
12030
  * Unescapes a segment of an escaped string as binary data.
@@ -12264,7 +12277,7 @@ export namespace GLib {
12264
12277
  * @param mode the type of normalization to perform.
12265
12278
  * @returns a newly allocated string, that is the normalized form of @str, or %NULL if @str is not valid UTF-8.
12266
12279
  */
12267
- function utf8_normalize(str: string, len: number, mode: NormalizeMode): string | null;
12280
+ function utf8_normalize(str: string, len: number, mode: NormalizeMode | null): string | null;
12268
12281
  /**
12269
12282
  * Converts from an integer character offset to a pointer to a position
12270
12283
  * within the string.
@@ -16010,7 +16023,7 @@ export namespace GLib {
16010
16023
  * @param month month
16011
16024
  * @param y year
16012
16025
  */
16013
- set_dmy(day: DateDay, month: DateMonth, y: DateYear): void;
16026
+ set_dmy(day: DateDay, month: DateMonth | null, y: DateYear): void;
16014
16027
  /**
16015
16028
  * Sets the value of a #GDate from a Julian day number.
16016
16029
  * @param julian_date Julian day number (days since January 1, Year 1)
@@ -16021,7 +16034,7 @@ export namespace GLib {
16021
16034
  * day-month-year triplet is invalid, the date will be invalid.
16022
16035
  * @param month month to set
16023
16036
  */
16024
- set_month(month: DateMonth): void;
16037
+ set_month(month: DateMonth | null): void;
16025
16038
  /**
16026
16039
  * Parses a user-inputted string `str,` and try to figure out what date it
16027
16040
  * represents, taking the [current locale][setlocale] into account. If the
@@ -17254,24 +17267,85 @@ export namespace GLib {
17254
17267
  steal(): void;
17255
17268
  }
17256
17269
 
17270
+ /**
17271
+ * HMACs should be used when producing a cookie or hash based on data
17272
+ * and a key. Simple mechanisms for using SHA1 and other algorithms to
17273
+ * digest a key and data together are vulnerable to various security
17274
+ * issues.
17275
+ * [HMAC](http://en.wikipedia.org/wiki/HMAC)
17276
+ * uses algorithms like SHA1 in a secure way to produce a digest of a
17277
+ * key and data.
17278
+ *
17279
+ * Both the key and data are arbitrary byte arrays of bytes or characters.
17280
+ *
17281
+ * Support for HMAC Digests has been added in GLib 2.30, and support for SHA-512
17282
+ * in GLib 2.42. Support for SHA-384 was added in GLib 2.52.
17283
+ *
17284
+ * To create a new `GHmac`, use [ctor`GLib`.Hmac.new]. To free a `GHmac`, use
17285
+ * [method`GLib`.Hmac.unref].
17286
+ */
17257
17287
  class Hmac {
17258
17288
  static $gtype: GObject.GType<Hmac>;
17259
17289
 
17260
17290
  // Constructors
17261
17291
 
17262
- constructor(digest_type: ChecksumType, key: number, key_len: number);
17292
+ constructor(digest_type: ChecksumType, key: Uint8Array | string);
17263
17293
  _init(...args: any[]): void;
17264
17294
 
17265
- static ['new'](digest_type: ChecksumType, key: number, key_len: number): Hmac;
17295
+ static ['new'](digest_type: ChecksumType, key: Uint8Array | string): Hmac;
17266
17296
 
17267
17297
  // Methods
17268
17298
 
17299
+ /**
17300
+ * Copies a #GHmac. If `hmac` has been closed, by calling
17301
+ * g_hmac_get_string() or g_hmac_get_digest(), the copied
17302
+ * HMAC will be closed as well.
17303
+ * @returns the copy of the passed #GHmac. Use g_hmac_unref() when finished using it.
17304
+ */
17269
17305
  copy(): Hmac;
17270
- get_digest(buffer: number, digest_len: number): void;
17306
+ /**
17307
+ * Gets the digest from `checksum` as a raw binary array and places it
17308
+ * into `buffer`. The size of the digest depends on the type of checksum.
17309
+ *
17310
+ * Once this function has been called, the #GHmac is closed and can
17311
+ * no longer be updated with g_checksum_update().
17312
+ * @param buffer output buffer
17313
+ */
17314
+ get_digest(buffer: Uint8Array | string): void;
17315
+ /**
17316
+ * Gets the HMAC as a hexadecimal string.
17317
+ *
17318
+ * Once this function has been called the #GHmac can no longer be
17319
+ * updated with g_hmac_update().
17320
+ *
17321
+ * The hexadecimal characters will be lower case.
17322
+ * @returns the hexadecimal representation of the HMAC. The returned string is owned by the HMAC and should not be modified or freed.
17323
+ */
17271
17324
  get_string(): string;
17325
+ /**
17326
+ * Atomically increments the reference count of `hmac` by one.
17327
+ *
17328
+ * This function is MT-safe and may be called from any thread.
17329
+ * @returns the passed in #GHmac.
17330
+ */
17272
17331
  ref(): Hmac;
17332
+ /**
17333
+ * Atomically decrements the reference count of `hmac` by one.
17334
+ *
17335
+ * If the reference count drops to 0, all keys and values will be
17336
+ * destroyed, and all memory allocated by the hash table is released.
17337
+ * This function is MT-safe and may be called from any thread.
17338
+ * Frees the memory allocated for `hmac`.
17339
+ */
17273
17340
  unref(): void;
17274
- update(data: number, length: number): void;
17341
+ /**
17342
+ * Feeds `data` into an existing #GHmac.
17343
+ *
17344
+ * The HMAC must still be open, that is g_hmac_get_string() or
17345
+ * g_hmac_get_digest() must not have been called on `hmac`.
17346
+ * @param data buffer used to compute the checksum
17347
+ */
17348
+ update(data: Uint8Array | string): void;
17275
17349
  }
17276
17350
 
17277
17351
  /**
@@ -17589,14 +17663,14 @@ export namespace GLib {
17589
17663
  * @param type the position in the file, which can be %G_SEEK_CUR (the current position), %G_SEEK_SET (the start of the file), or %G_SEEK_END (the end of the file)
17590
17664
  * @returns %G_IO_ERROR_NONE if the operation was successful.
17591
17665
  */
17592
- seek(offset: number, type: SeekType): IOError;
17666
+ seek(offset: number, type: SeekType | null): IOError;
17593
17667
  /**
17594
17668
  * Replacement for g_io_channel_seek() with the new API.
17595
17669
  * @param offset The offset in bytes from the position specified by @type
17596
17670
  * @param type a #GSeekType. The type %G_SEEK_CUR is only allowed in those cases where a call to g_io_channel_set_encoding () is allowed. See the documentation for g_io_channel_set_encoding () for details.
17597
17671
  * @returns the status of the operation.
17598
17672
  */
17599
- seek_position(offset: number, type: SeekType): IOStatus;
17673
+ seek_position(offset: number, type: SeekType | null): IOStatus;
17600
17674
  /**
17601
17675
  * Sets the buffer size.
17602
17676
  * @param size the size of the buffer, or 0 to let GLib pick a good size
@@ -17679,7 +17753,7 @@ export namespace GLib {
17679
17753
  * @param flags the flags to set on the IO channel
17680
17754
  * @returns the status of the operation.
17681
17755
  */
17682
- set_flags(flags: IOFlags): IOStatus;
17756
+ set_flags(flags: IOFlags | null): IOStatus;
17683
17757
  /**
17684
17758
  * This sets the string that #GIOChannel uses to determine
17685
17759
  * where in the file a line break occurs.
@@ -18139,7 +18213,7 @@ export namespace GLib {
18139
18213
  * @param flags flags from #GKeyFileFlags
18140
18214
  * @returns %TRUE if a key file could be loaded, %FALSE otherwise
18141
18215
  */
18142
- load_from_bytes(bytes: Bytes | Uint8Array, flags: KeyFileFlags): boolean;
18216
+ load_from_bytes(bytes: Bytes | Uint8Array, flags: KeyFileFlags | null): boolean;
18143
18217
  /**
18144
18218
  * Loads a key file from memory into an empty #GKeyFile structure.
18145
18219
  * If the object cannot be created then %error is set to a #GKeyFileError.
@@ -18148,7 +18222,7 @@ export namespace GLib {
18148
18222
  * @param flags flags from #GKeyFileFlags
18149
18223
  * @returns %TRUE if a key file could be loaded, %FALSE otherwise
18150
18224
  */
18151
- load_from_data(data: string, length: number, flags: KeyFileFlags): boolean;
18225
+ load_from_data(data: string, length: number, flags: KeyFileFlags | null): boolean;
18152
18226
  /**
18153
18227
  * This function looks for a key file named `file` in the paths
18154
18228
  * returned from g_get_user_data_dir() and g_get_system_data_dirs(),
@@ -18159,7 +18233,7 @@ export namespace GLib {
18159
18233
  * @param flags flags from #GKeyFileFlags
18160
18234
  * @returns %TRUE if a key file could be loaded, %FALSE otherwise
18161
18235
  */
18162
- load_from_data_dirs(file: string, flags: KeyFileFlags): [boolean, string];
18236
+ load_from_data_dirs(file: string, flags: KeyFileFlags | null): [boolean, string];
18163
18237
  /**
18164
18238
  * This function looks for a key file named `file` in the paths
18165
18239
  * specified in `search_dirs,` loads the file into `key_file` and
@@ -18175,7 +18249,7 @@ export namespace GLib {
18175
18249
  * @param flags flags from #GKeyFileFlags
18176
18250
  * @returns %TRUE if a key file could be loaded, %FALSE otherwise
18177
18251
  */
18178
- load_from_dirs(file: string, search_dirs: string[], flags: KeyFileFlags): [boolean, string];
18252
+ load_from_dirs(file: string, search_dirs: string[], flags: KeyFileFlags | null): [boolean, string];
18179
18253
  /**
18180
18254
  * Loads a key file into an empty #GKeyFile structure.
18181
18255
  *
@@ -18189,7 +18263,7 @@ export namespace GLib {
18189
18263
  * @param flags flags from #GKeyFileFlags
18190
18264
  * @returns %TRUE if a key file could be loaded, %FALSE otherwise
18191
18265
  */
18192
- load_from_file(file: string, flags: KeyFileFlags): boolean;
18266
+ load_from_file(file: string, flags: KeyFileFlags | null): boolean;
18193
18267
  /**
18194
18268
  * Removes a comment above `key` from `group_name`.
18195
18269
  * If `key` is %NULL then `comment` will be removed above `group_name`.
@@ -19438,7 +19512,7 @@ export namespace GLib {
19438
19512
  * @param flags which types of children are to be visited, one of %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES
19439
19513
  * @param func the function to call for each visited node
19440
19514
  */
19441
- children_foreach(flags: TraverseFlags, func: NodeForeachFunc): void;
19515
+ children_foreach(flags: TraverseFlags | null, func: NodeForeachFunc): void;
19442
19516
  /**
19443
19517
  * Gets the depth of a #GNode.
19444
19518
  *
@@ -19479,7 +19553,7 @@ export namespace GLib {
19479
19553
  * @param flags which types of children are to be counted, one of %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES
19480
19554
  * @returns the number of nodes in the tree
19481
19555
  */
19482
- n_nodes(flags: TraverseFlags): number;
19556
+ n_nodes(flags: TraverseFlags | null): number;
19483
19557
  /**
19484
19558
  * Reverses the order of the children of a #GNode.
19485
19559
  * (It doesn't change the order of the grandchildren.)
@@ -19495,7 +19569,12 @@ export namespace GLib {
19495
19569
  * @param max_depth the maximum depth of the traversal. Nodes below this depth will not be visited. If max_depth is -1 all nodes in the tree are visited. If depth is 1, only the root is visited. If depth is 2, the root and its children are visited. And so on.
19496
19570
  * @param func the function to call for each visited #GNode
19497
19571
  */
19498
- traverse(order: TraverseType, flags: TraverseFlags, max_depth: number, func: NodeTraverseFunc): void;
19572
+ traverse(
19573
+ order: TraverseType | null,
19574
+ flags: TraverseFlags | null,
19575
+ max_depth: number,
19576
+ func: NodeTraverseFunc,
19577
+ ): void;
19499
19578
  /**
19500
19579
  * Unlinks a #GNode from a tree, resulting in two separate trees.
19501
19580
  */
@@ -21107,7 +21186,7 @@ export namespace GLib {
21107
21186
  * @param match_options match options
21108
21187
  * @returns %TRUE is the string matched, %FALSE otherwise
21109
21188
  */
21110
- match(string: string, match_options: RegexMatchFlags): [boolean, MatchInfo | null];
21189
+ match(string: string, match_options: RegexMatchFlags | null): [boolean, MatchInfo | null];
21111
21190
  /**
21112
21191
  * Using the standard algorithm for regular expression matching only
21113
21192
  * the longest match in the string is retrieved. This function uses
@@ -21127,7 +21206,7 @@ export namespace GLib {
21127
21206
  * @param match_options match options
21128
21207
  * @returns %TRUE is the string matched, %FALSE otherwise
21129
21208
  */
21130
- match_all(string: string, match_options: RegexMatchFlags): [boolean, MatchInfo | null];
21209
+ match_all(string: string, match_options: RegexMatchFlags | null): [boolean, MatchInfo | null];
21131
21210
  /**
21132
21211
  * Using the standard algorithm for regular expression matching only
21133
21212
  * the longest match in the `string` is retrieved, it is not possible
@@ -21175,7 +21254,7 @@ export namespace GLib {
21175
21254
  match_all_full(
21176
21255
  string: string[],
21177
21256
  start_position: number,
21178
- match_options: RegexMatchFlags,
21257
+ match_options: RegexMatchFlags | null,
21179
21258
  ): [boolean, MatchInfo | null];
21180
21259
  /**
21181
21260
  * Scans for a match in `string` for the pattern in `regex`.
@@ -21239,7 +21318,7 @@ export namespace GLib {
21239
21318
  match_full(
21240
21319
  string: string[],
21241
21320
  start_position: number,
21242
- match_options: RegexMatchFlags,
21321
+ match_options: RegexMatchFlags | null,
21243
21322
  ): [boolean, MatchInfo | null];
21244
21323
  /**
21245
21324
  * Increases reference count of `regex` by 1.
@@ -21279,7 +21358,12 @@ export namespace GLib {
21279
21358
  * @param match_options options for the match
21280
21359
  * @returns a newly allocated string containing the replacements
21281
21360
  */
21282
- replace(string: string[], start_position: number, replacement: string, match_options: RegexMatchFlags): string;
21361
+ replace(
21362
+ string: string[],
21363
+ start_position: number,
21364
+ replacement: string,
21365
+ match_options: RegexMatchFlags | null,
21366
+ ): string;
21283
21367
  /**
21284
21368
  * Replaces occurrences of the pattern in regex with the output of
21285
21369
  * `eval` for that occurrence.
@@ -21337,7 +21421,7 @@ export namespace GLib {
21337
21421
  replace_eval(
21338
21422
  string: string[],
21339
21423
  start_position: number,
21340
- match_options: RegexMatchFlags,
21424
+ match_options: RegexMatchFlags | null,
21341
21425
  _eval: RegexEvalCallback,
21342
21426
  ): string;
21343
21427
  /**
@@ -21359,7 +21443,7 @@ export namespace GLib {
21359
21443
  string: string[],
21360
21444
  start_position: number,
21361
21445
  replacement: string,
21362
- match_options: RegexMatchFlags,
21446
+ match_options: RegexMatchFlags | null,
21363
21447
  ): string;
21364
21448
  /**
21365
21449
  * Breaks the string on the pattern, and returns an array of the tokens.
@@ -21383,7 +21467,7 @@ export namespace GLib {
21383
21467
  * @param match_options match time option flags
21384
21468
  * @returns a %NULL-terminated gchar ** array. Free it using g_strfreev()
21385
21469
  */
21386
- split(string: string, match_options: RegexMatchFlags): string[];
21470
+ split(string: string, match_options: RegexMatchFlags | null): string[];
21387
21471
  /**
21388
21472
  * Breaks the string on the pattern, and returns an array of the tokens.
21389
21473
  * If the pattern contains capturing parentheses, then the text for each
@@ -21415,7 +21499,7 @@ export namespace GLib {
21415
21499
  split_full(
21416
21500
  string: string[],
21417
21501
  start_position: number,
21418
- match_options: RegexMatchFlags,
21502
+ match_options: RegexMatchFlags | null,
21419
21503
  max_tokens: number,
21420
21504
  ): string[];
21421
21505
  /**
@@ -21704,7 +21788,7 @@ export namespace GLib {
21704
21788
  * @param is_error if %TRUE it is output as an error. If %FALSE it is output as a warning.
21705
21789
  */
21706
21790
  unexp_token(
21707
- expected_token: TokenType,
21791
+ expected_token: TokenType | null,
21708
21792
  identifier_spec: string,
21709
21793
  symbol_spec: string,
21710
21794
  symbol_name: string,
@@ -22306,7 +22390,7 @@ export namespace GLib {
22306
22390
  * @param events an event mask
22307
22391
  * @returns an opaque tag
22308
22392
  */
22309
- add_unix_fd(fd: number, events: IOCondition): any;
22393
+ add_unix_fd(fd: number, events: IOCondition | null): any;
22310
22394
  /**
22311
22395
  * Adds a [struct`GLib`.Source] to a `context` so that it will be executed within
22312
22396
  * that context. Remove it by calling [method`GLib`.Source.destroy].
@@ -22505,7 +22589,7 @@ export namespace GLib {
22505
22589
  * @param tag the tag from [method@GLib.Source.add_unix_fd]
22506
22590
  * @param new_events the new event mask to watch
22507
22591
  */
22508
- modify_unix_fd(tag: any, new_events: IOCondition): void;
22592
+ modify_unix_fd(tag: any, new_events: IOCondition | null): void;
22509
22593
  /**
22510
22594
  * Queries the events reported for the fd corresponding to `tag` on
22511
22595
  * `source` during the last poll.
@@ -23815,7 +23899,7 @@ export namespace GLib {
23815
23899
  * @param time_ a pointer to a number of seconds since January 1, 1970
23816
23900
  * @returns the interval containing @time_, never -1
23817
23901
  */
23818
- adjust_time(type: TimeType, time_: number): [number, number];
23902
+ adjust_time(type: TimeType | null, time_: number): [number, number];
23819
23903
  /**
23820
23904
  * Finds an interval within `tz` that corresponds to the given `time_`.
23821
23905
  * The meaning of `time_` depends on `type`.
@@ -23839,7 +23923,7 @@ export namespace GLib {
23839
23923
  * @param time_ a number of seconds since January 1, 1970
23840
23924
  * @returns the interval containing @time_, or -1 in case of failure
23841
23925
  */
23842
- find_interval(type: TimeType, time_: number): number;
23926
+ find_interval(type: TimeType | null, time_: number): number;
23843
23927
  /**
23844
23928
  * Determines the time zone abbreviation to be used during a particular
23845
23929
  * `interval` of time in the time zone `tz`.
@@ -24236,7 +24320,7 @@ export namespace GLib {
24236
24320
  * @param traverse_func the function to call for each node visited. If this function returns %TRUE, the traversal is stopped.
24237
24321
  * @param traverse_type the order in which nodes are visited, one of %G_IN_ORDER, %G_PRE_ORDER and %G_POST_ORDER
24238
24322
  */
24239
- traverse(traverse_func: TraverseFunc, traverse_type: TraverseType): void;
24323
+ traverse(traverse_func: TraverseFunc, traverse_type: TraverseType | null): void;
24240
24324
  /**
24241
24325
  * Decrements the reference count of `tree` by one.
24242
24326
  * If the reference count drops to 0, all keys and values will
@@ -24987,7 +25071,7 @@ export namespace GLib {
24987
25071
  * @param flags flags describing how to parse @uri_ref
24988
25072
  * @returns a new #GUri, or NULL on error.
24989
25073
  */
24990
- parse_relative(uri_ref: string, flags: UriFlags): Uri;
25074
+ parse_relative(uri_ref: string, flags: UriFlags | null): Uri;
24991
25075
  /**
24992
25076
  * Returns a string representing `uri`.
24993
25077
  *
@@ -25010,7 +25094,7 @@ export namespace GLib {
25010
25094
  * @param flags flags describing what parts of @uri to hide
25011
25095
  * @returns a string representing @uri, which the caller must free.
25012
25096
  */
25013
- to_string_partial(flags: UriHideFlags): string;
25097
+ to_string_partial(flags: UriHideFlags | null): string;
25014
25098
  }
25015
25099
 
25016
25100
  /**
@@ -25075,7 +25159,7 @@ export namespace GLib {
25075
25159
  * @param separators the separator byte character set between parameters. (usually `&`, but sometimes `;` or both `&;`). Note that this function works on bytes not characters, so it can't be used to delimit UTF-8 strings for anything but ASCII characters. You may pass an empty set, in which case no splitting will occur.
25076
25160
  * @param flags flags to modify the way the parameters are handled.
25077
25161
  */
25078
- init(params: string, length: number, separators: string, flags: UriParamsFlags): void;
25162
+ init(params: string, length: number, separators: string, flags: UriParamsFlags | null): void;
25079
25163
  /**
25080
25164
  * Advances `iter` and retrieves the next attribute/value. %FALSE is returned if
25081
25165
  * an error has occurred (in which case `error` is set), or if the end of the
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@girs/glib-2.0",
3
- "version": "2.82.2-4.0.0-beta.18",
4
- "description": "GJS TypeScript type definitions for GLib-2.0, generated from library version 2.82.2",
3
+ "version": "2.82.4-4.0.0-beta.20",
4
+ "description": "GJS TypeScript type definitions for GLib-2.0, generated from library version 2.82.4",
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.18",
35
- "@girs/gobject-2.0": "^2.82.2-4.0.0-beta.18"
34
+ "@girs/gjs": "^4.0.0-beta.20",
35
+ "@girs/gobject-2.0": "^2.82.4-4.0.0-beta.20"
36
36
  },
37
37
  "devDependencies": {
38
38
  "typescript": "*"
package/tsconfig.json CHANGED
@@ -15,7 +15,9 @@
15
15
  "removeComments": false,
16
16
  "inlineSourceMap": false,
17
17
  "inlineSources": false,
18
- "newLine": "LF"
18
+ "newLine": "LF",
19
+ // Show diagnostics
20
+ "diagnostics": true
19
21
  },
20
22
  "include": ["./glib-2.0.d.ts"]
21
23
  }